@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/event.js
CHANGED
|
@@ -29,12 +29,21 @@ const schema = (definitions) => Schema.Union([
|
|
|
29
29
|
}).annotate({ identifier: "V2Event.server.connected" }),
|
|
30
30
|
]),
|
|
31
31
|
]).annotate({ identifier: "V2Event" });
|
|
32
|
+
const query = (definitions) => Schema.Struct({
|
|
33
|
+
types: Schema.optional(Schema.ArrayEnsure(Schema.Union([
|
|
34
|
+
Schema.Literals(definitions.map((definition) => definition.type)),
|
|
35
|
+
rpcEvent.fields.type,
|
|
36
|
+
]))).annotate({
|
|
37
|
+
description: "Only send events of these types, plus the initial server.connected event. When omitted, all events are sent.",
|
|
38
|
+
}),
|
|
39
|
+
}).annotate({ identifier: "EventSubscribeQuery" });
|
|
32
40
|
const make = (definitions) => {
|
|
33
41
|
const EventSchema = schema(definitions);
|
|
34
42
|
return {
|
|
35
43
|
schema: EventSchema,
|
|
36
44
|
group: HttpApiGroup.make("server.event")
|
|
37
45
|
.add(HttpApiEndpoint.get("event.subscribe", "/api/event", {
|
|
46
|
+
query: query(definitions),
|
|
38
47
|
success: HttpApiSchema.StreamSse({ data: EventSchema }),
|
|
39
48
|
}).annotateMerge(OpenApi.annotations({
|
|
40
49
|
identifier: "event.subscribe",
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/** `server.experimental`: routes under /api/experimental, without compatibility guarantees. */
|
|
2
|
+
export declare const ExperimentalGroup: import("effect/http-api/HttpApiGroup").HttpApiGroup<"server.experimental", import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"media.get", "GET", "/api/experimental/media/:hash", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
3
|
+
hash: import("effect/Schema").String;
|
|
4
|
+
}>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Uint8Array>, import("effect/Schema").toCodecJson<typeof import("../errors.js").InvalidRequestError | typeof import("../errors.js").FileNotFoundError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"persistentPty.connect", "GET", "/api/experimental/persistent-pty/:ptyID/connect", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
5
|
+
ptyID: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
|
|
6
|
+
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
7
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
8
|
+
};
|
|
9
|
+
}>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Boolean>, import("effect/Schema").toCodecJson<typeof import("../errors.js").ServiceUnavailableError | typeof import("../errors.js").ForbiddenError | typeof import("../errors.js").PtyNotFoundError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"persistentPty.connectToken", "POST", "/api/experimental/persistent-pty/:ptyID/connect-token", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
10
|
+
ptyID: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
|
|
11
|
+
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
12
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
13
|
+
};
|
|
14
|
+
}>>, never, never, import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
15
|
+
readonly "x-opencode-ticket": import("effect/Schema").optional<import("effect/Schema").String>;
|
|
16
|
+
}>>, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
17
|
+
readonly data: import("effect/Schema").Struct<{
|
|
18
|
+
readonly ticket: import("effect/Schema").String;
|
|
19
|
+
readonly expires_in: import("effect/Schema").Int;
|
|
20
|
+
}>;
|
|
21
|
+
}>>, import("effect/Schema").toCodecJson<typeof import("../errors.js").ServiceUnavailableError | typeof import("../errors.js").ForbiddenError | typeof import("../errors.js").PtyNotFoundError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"persistentPty.create", "POST", "/api/experimental/session/:sessionID/terminal", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
22
|
+
sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
|
|
23
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
24
|
+
};
|
|
25
|
+
}>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
26
|
+
readonly command: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").String>>, import("effect/Schema").optionalKey<import("effect/Schema").String>, never, never>;
|
|
27
|
+
readonly args: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
28
|
+
readonly cwd: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").String>>, import("effect/Schema").optionalKey<import("effect/Schema").String>, never, never>;
|
|
29
|
+
readonly title: import("effect/Schema").String;
|
|
30
|
+
readonly env: import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").String>;
|
|
31
|
+
readonly size: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
|
|
32
|
+
readonly cols: import("effect/Schema").Int;
|
|
33
|
+
readonly rows: import("effect/Schema").Int;
|
|
34
|
+
}>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
|
|
35
|
+
readonly cols: import("effect/Schema").Int;
|
|
36
|
+
readonly rows: import("effect/Schema").Int;
|
|
37
|
+
}>>, never, never>;
|
|
38
|
+
}>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
39
|
+
readonly data: import("effect/Schema").Struct<{
|
|
40
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
|
|
41
|
+
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
42
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
43
|
+
};
|
|
44
|
+
readonly title: import("effect/Schema").String;
|
|
45
|
+
readonly command: import("effect/Schema").String;
|
|
46
|
+
readonly args: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
47
|
+
readonly cwd: import("effect/Schema").String;
|
|
48
|
+
readonly status: import("effect/Schema").Literals<readonly ["running", "exited"]>;
|
|
49
|
+
readonly pid: import("effect/Schema").Int;
|
|
50
|
+
readonly exitCode: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Int>>, import("effect/Schema").optionalKey<import("effect/Schema").Int>, never, never>;
|
|
51
|
+
readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
|
|
52
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
53
|
+
};
|
|
54
|
+
readonly foregroundProcess: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
55
|
+
readonly size: import("effect/Schema").Struct<{
|
|
56
|
+
readonly cols: import("effect/Schema").Int;
|
|
57
|
+
readonly rows: import("effect/Schema").Int;
|
|
58
|
+
}>;
|
|
59
|
+
readonly output: import("effect/Schema").Struct<{
|
|
60
|
+
readonly head: import("effect/Schema").Int;
|
|
61
|
+
readonly tail: import("effect/Schema").Int;
|
|
62
|
+
}>;
|
|
63
|
+
}>;
|
|
64
|
+
}>>, import("effect/Schema").toCodecJson<typeof import("../errors.js").InvalidRequestError | typeof import("../errors.js").ServiceUnavailableError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"persistentPty.get", "GET", "/api/experimental/persistent-pty/:ptyID", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
65
|
+
ptyID: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
|
|
66
|
+
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
67
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
68
|
+
};
|
|
69
|
+
}>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
70
|
+
readonly data: import("effect/Schema").Struct<{
|
|
71
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
|
|
72
|
+
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
73
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
74
|
+
};
|
|
75
|
+
readonly title: import("effect/Schema").String;
|
|
76
|
+
readonly command: import("effect/Schema").String;
|
|
77
|
+
readonly args: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
78
|
+
readonly cwd: import("effect/Schema").String;
|
|
79
|
+
readonly status: import("effect/Schema").Literals<readonly ["running", "exited"]>;
|
|
80
|
+
readonly pid: import("effect/Schema").Int;
|
|
81
|
+
readonly exitCode: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Int>>, import("effect/Schema").optionalKey<import("effect/Schema").Int>, never, never>;
|
|
82
|
+
readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
|
|
83
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
84
|
+
};
|
|
85
|
+
readonly foregroundProcess: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
86
|
+
readonly size: import("effect/Schema").Struct<{
|
|
87
|
+
readonly cols: import("effect/Schema").Int;
|
|
88
|
+
readonly rows: import("effect/Schema").Int;
|
|
89
|
+
}>;
|
|
90
|
+
readonly output: import("effect/Schema").Struct<{
|
|
91
|
+
readonly head: import("effect/Schema").Int;
|
|
92
|
+
readonly tail: import("effect/Schema").Int;
|
|
93
|
+
}>;
|
|
94
|
+
}>;
|
|
95
|
+
}>>, import("effect/Schema").toCodecJson<typeof import("../errors.js").ServiceUnavailableError | typeof import("../errors.js").PtyNotFoundError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"persistentPty.handoff", "POST", "/api/experimental/persistent-pty/handoff", never, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
96
|
+
readonly handoff: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
97
|
+
readonly directory: import("effect/Schema").String;
|
|
98
|
+
readonly instanceID: import("effect/Schema").String;
|
|
99
|
+
readonly ticket: import("effect/Schema").String;
|
|
100
|
+
readonly expiresAt: import("effect/Schema").Number;
|
|
101
|
+
}>>;
|
|
102
|
+
}>>, import("effect/Schema").toCodecJson<typeof import("../errors.js").ServiceUnavailableError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"persistentPty.list", "GET", "/api/experimental/session/:sessionID/terminal", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
103
|
+
sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
|
|
104
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
105
|
+
};
|
|
106
|
+
}>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
107
|
+
readonly data: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
108
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
|
|
109
|
+
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
110
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
111
|
+
};
|
|
112
|
+
readonly title: import("effect/Schema").String;
|
|
113
|
+
readonly command: import("effect/Schema").String;
|
|
114
|
+
readonly args: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
115
|
+
readonly cwd: import("effect/Schema").String;
|
|
116
|
+
readonly status: import("effect/Schema").Literals<readonly ["running", "exited"]>;
|
|
117
|
+
readonly pid: import("effect/Schema").Int;
|
|
118
|
+
readonly exitCode: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Int>>, import("effect/Schema").optionalKey<import("effect/Schema").Int>, never, never>;
|
|
119
|
+
readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
|
|
120
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
121
|
+
};
|
|
122
|
+
readonly foregroundProcess: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
123
|
+
readonly size: import("effect/Schema").Struct<{
|
|
124
|
+
readonly cols: import("effect/Schema").Int;
|
|
125
|
+
readonly rows: import("effect/Schema").Int;
|
|
126
|
+
}>;
|
|
127
|
+
readonly output: import("effect/Schema").Struct<{
|
|
128
|
+
readonly head: import("effect/Schema").Int;
|
|
129
|
+
readonly tail: import("effect/Schema").Int;
|
|
130
|
+
}>;
|
|
131
|
+
}>>;
|
|
132
|
+
}>>, import("effect/Schema").toCodecJson<typeof import("../errors.js").InvalidRequestError | typeof import("../errors.js").ServiceUnavailableError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"persistentPty.read", "GET", "/api/experimental/session/:sessionID/terminal/read", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
133
|
+
sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
|
|
134
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
135
|
+
};
|
|
136
|
+
}>>, import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
137
|
+
lines: import("effect/Schema").optional<import("effect/Schema").compose<import("effect/Schema").Int, import("effect/Schema").NumberFromString>>;
|
|
138
|
+
}>>, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
139
|
+
readonly data: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
140
|
+
readonly ptyID: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
|
|
141
|
+
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
142
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
143
|
+
};
|
|
144
|
+
readonly title: import("effect/Schema").String;
|
|
145
|
+
readonly cwd: import("effect/Schema").String;
|
|
146
|
+
readonly foregroundProcess: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
147
|
+
readonly screen: import("effect/Schema").Struct<{
|
|
148
|
+
readonly text: import("effect/Schema").String;
|
|
149
|
+
readonly cols: import("effect/Schema").Int;
|
|
150
|
+
readonly rows: import("effect/Schema").Int;
|
|
151
|
+
readonly cursor: import("effect/Schema").Struct<{
|
|
152
|
+
readonly x: import("effect/Schema").Int;
|
|
153
|
+
readonly y: import("effect/Schema").Int;
|
|
154
|
+
}>;
|
|
155
|
+
}>;
|
|
156
|
+
}>>;
|
|
157
|
+
}>>, import("effect/Schema").toCodecJson<typeof import("../errors.js").ServiceUnavailableError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"persistentPty.remove", "DELETE", "/api/experimental/persistent-pty/:ptyID", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
158
|
+
ptyID: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
|
|
159
|
+
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
160
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
161
|
+
};
|
|
162
|
+
}>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/http-api/HttpApiSchema").NoContent>, import("effect/Schema").toCodecJson<typeof import("../errors.js").ServiceUnavailableError | typeof import("../errors.js").PtyNotFoundError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"persistentPty.shutdown", "POST", "/api/experimental/persistent-pty/shutdown", never, never, never, never, import("effect/Schema").toCodecJson<import("effect/http-api/HttpApiSchema").NoContent>, import("effect/Schema").toCodecJson<typeof import("../errors.js").ServiceUnavailableError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"persistentPty.snapshot", "GET", "/api/experimental/persistent-pty/:ptyID/snapshot", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
163
|
+
ptyID: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
|
|
164
|
+
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
165
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
166
|
+
};
|
|
167
|
+
}>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
168
|
+
readonly data: import("effect/Schema").Struct<{
|
|
169
|
+
readonly info: import("effect/Schema").Struct<{
|
|
170
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
|
|
171
|
+
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
172
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
173
|
+
};
|
|
174
|
+
readonly title: import("effect/Schema").String;
|
|
175
|
+
readonly command: import("effect/Schema").String;
|
|
176
|
+
readonly args: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
177
|
+
readonly cwd: import("effect/Schema").String;
|
|
178
|
+
readonly status: import("effect/Schema").Literals<readonly ["running", "exited"]>;
|
|
179
|
+
readonly pid: import("effect/Schema").Int;
|
|
180
|
+
readonly exitCode: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Int>>, import("effect/Schema").optionalKey<import("effect/Schema").Int>, never, never>;
|
|
181
|
+
readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
|
|
182
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
183
|
+
};
|
|
184
|
+
readonly foregroundProcess: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
185
|
+
readonly size: import("effect/Schema").Struct<{
|
|
186
|
+
readonly cols: import("effect/Schema").Int;
|
|
187
|
+
readonly rows: import("effect/Schema").Int;
|
|
188
|
+
}>;
|
|
189
|
+
readonly output: import("effect/Schema").Struct<{
|
|
190
|
+
readonly head: import("effect/Schema").Int;
|
|
191
|
+
readonly tail: import("effect/Schema").Int;
|
|
192
|
+
}>;
|
|
193
|
+
}>;
|
|
194
|
+
readonly text: import("effect/Schema").String;
|
|
195
|
+
readonly checkpoint: import("effect/Schema").Uint8Array;
|
|
196
|
+
readonly cursor: import("effect/Schema").Struct<{
|
|
197
|
+
readonly x: import("effect/Schema").Int;
|
|
198
|
+
readonly y: import("effect/Schema").Int;
|
|
199
|
+
}>;
|
|
200
|
+
}>;
|
|
201
|
+
}>>, import("effect/Schema").toCodecJson<typeof import("../errors.js").ServiceUnavailableError | typeof import("../errors.js").PtyNotFoundError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"persistentPty.update", "PUT", "/api/experimental/persistent-pty/:ptyID", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
202
|
+
ptyID: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
|
|
203
|
+
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
204
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
205
|
+
};
|
|
206
|
+
}>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
207
|
+
readonly attachmentID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").String>>, import("effect/Schema").optionalKey<import("effect/Schema").String>, never, never>;
|
|
208
|
+
readonly size: import("effect/Schema").Struct<{
|
|
209
|
+
readonly cols: import("effect/Schema").Int;
|
|
210
|
+
readonly rows: import("effect/Schema").Int;
|
|
211
|
+
}>;
|
|
212
|
+
}>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
213
|
+
readonly data: import("effect/Schema").Struct<{
|
|
214
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
|
|
215
|
+
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
216
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
217
|
+
};
|
|
218
|
+
readonly title: import("effect/Schema").String;
|
|
219
|
+
readonly command: import("effect/Schema").String;
|
|
220
|
+
readonly args: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
221
|
+
readonly cwd: import("effect/Schema").String;
|
|
222
|
+
readonly status: import("effect/Schema").Literals<readonly ["running", "exited"]>;
|
|
223
|
+
readonly pid: import("effect/Schema").Int;
|
|
224
|
+
readonly exitCode: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Int>>, import("effect/Schema").optionalKey<import("effect/Schema").Int>, never, never>;
|
|
225
|
+
readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
|
|
226
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
227
|
+
};
|
|
228
|
+
readonly foregroundProcess: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
229
|
+
readonly size: import("effect/Schema").Struct<{
|
|
230
|
+
readonly cols: import("effect/Schema").Int;
|
|
231
|
+
readonly rows: import("effect/Schema").Int;
|
|
232
|
+
}>;
|
|
233
|
+
readonly output: import("effect/Schema").Struct<{
|
|
234
|
+
readonly head: import("effect/Schema").Int;
|
|
235
|
+
readonly tail: import("effect/Schema").Int;
|
|
236
|
+
}>;
|
|
237
|
+
}>;
|
|
238
|
+
}>>, import("effect/Schema").toCodecJson<typeof import("../errors.js").ServiceUnavailableError | typeof import("../errors.js").PtyNotFoundError>, never, never>, false>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { MediaGetEndpoint } from "./media.js";
|
|
2
|
+
import { PersistentPtyGroup } from "./persistent-pty.js";
|
|
3
|
+
/** `server.experimental`: routes under /api/experimental, without compatibility guarantees. */
|
|
4
|
+
export const ExperimentalGroup = PersistentPtyGroup.add(MediaGetEndpoint);
|
package/dist/groups/fs.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
|
|
3
|
-
import { FileNotFoundError } from "../errors.js";
|
|
2
|
+
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/http-api";
|
|
3
|
+
import { FileNotFoundError, ServiceUnavailableError } from "../errors.js";
|
|
4
4
|
export declare const FileSystemGroup: HttpApiGroup.HttpApiGroup<"server.fs", HttpApiEndpoint.HttpApiEndpoint<"fs.find", "GET", "/api/fs/find", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
5
5
|
readonly location: Schema.optional<Schema.Struct<{
|
|
6
6
|
readonly directory: Schema.optional<Schema.String>;
|
|
@@ -33,7 +33,19 @@ export declare const FileSystemGroup: HttpApiGroup.HttpApiGroup<"server.fs", Htt
|
|
|
33
33
|
readonly location: Schema.optional<Schema.Struct<{
|
|
34
34
|
readonly directory: Schema.optional<Schema.String>;
|
|
35
35
|
}>>;
|
|
36
|
-
}>>, never, never, Schema.toCodecJson<Schema.Uint8Array>, Schema.toCodecJson<typeof FileNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"fs.
|
|
36
|
+
}>>, never, never, Schema.toCodecJson<Schema.Uint8Array>, Schema.toCodecJson<typeof FileNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"fs.unwatch", "DELETE", "/api/experimental/fs/watch", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
37
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
38
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
39
|
+
}>>;
|
|
40
|
+
}>>, Schema.toCodecJson<Schema.Struct<{
|
|
41
|
+
readonly path: Schema.String;
|
|
42
|
+
}>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"fs.watch", "POST", "/api/experimental/fs/watch", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
43
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
44
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
45
|
+
}>>;
|
|
46
|
+
}>>, Schema.toCodecJson<Schema.Struct<{
|
|
47
|
+
readonly path: Schema.String;
|
|
48
|
+
}>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof ServiceUnavailableError | typeof FileNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"fs.write", "POST", "/api/experimental/fs/write", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
37
49
|
readonly location: Schema.optional<Schema.Struct<{
|
|
38
50
|
readonly directory: Schema.optional<Schema.String>;
|
|
39
51
|
}>>;
|
package/dist/groups/fs.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Location } from "@opencode/schema/location";
|
|
|
3
3
|
import { PositiveInt } from "@opencode/schema/schema";
|
|
4
4
|
import { Schema } from "effect";
|
|
5
5
|
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
|
|
6
|
-
import { FileNotFoundError } from "../errors.js";
|
|
6
|
+
import { FileNotFoundError, ServiceUnavailableError } from "../errors.js";
|
|
7
7
|
import { LocationQuery, locationQueryOpenApi } from "./location.js";
|
|
8
8
|
const ListQuery = Schema.Struct({
|
|
9
9
|
...LocationQuery.fields,
|
|
@@ -17,6 +17,9 @@ const WriteQuery = Schema.Struct({
|
|
|
17
17
|
description: "An absolute path or a path relative to the requested location. Missing parent directories are created.",
|
|
18
18
|
}),
|
|
19
19
|
});
|
|
20
|
+
const WatchPayload = Schema.Struct({
|
|
21
|
+
path: Schema.String.annotate({ description: "A file path relative to the requested location." }),
|
|
22
|
+
});
|
|
20
23
|
const FindQuery = Schema.Struct({
|
|
21
24
|
...LocationQuery.fields,
|
|
22
25
|
query: FileSystem.FindInput.fields.query,
|
|
@@ -66,6 +69,29 @@ export const FileSystemGroup = HttpApiGroup.make("server.fs")
|
|
|
66
69
|
identifier: "experimental.fs.write",
|
|
67
70
|
summary: "Write file",
|
|
68
71
|
description: "Write the raw request body to an absolute path or a path relative to the requested location, creating parent directories, and return the resolved absolute path. Unlike read, the target is not confined to the location. Experimental: may change without compatibility guarantees.",
|
|
72
|
+
})))
|
|
73
|
+
.add(HttpApiEndpoint.post("fs.watch", "/api/experimental/fs/watch", {
|
|
74
|
+
query: LocationQuery,
|
|
75
|
+
payload: WatchPayload,
|
|
76
|
+
success: HttpApiSchema.NoContent,
|
|
77
|
+
error: [FileNotFoundError, ServiceUnavailableError],
|
|
78
|
+
})
|
|
79
|
+
.annotateMerge(locationQueryOpenApi)
|
|
80
|
+
.annotateMerge(OpenApi.annotations({
|
|
81
|
+
identifier: "experimental.fs.watch",
|
|
82
|
+
summary: "Watch file",
|
|
83
|
+
description: "Watch one file relative to the requested location for 24 hours, publishing filesystem.changed on that location when it changes. Watching an already watched file resets its expiry. Paths follow read confinement. Experimental: may change without compatibility guarantees.",
|
|
84
|
+
})))
|
|
85
|
+
.add(HttpApiEndpoint.delete("fs.unwatch", "/api/experimental/fs/watch", {
|
|
86
|
+
query: LocationQuery,
|
|
87
|
+
payload: WatchPayload,
|
|
88
|
+
success: HttpApiSchema.NoContent,
|
|
89
|
+
})
|
|
90
|
+
.annotateMerge(locationQueryOpenApi)
|
|
91
|
+
.annotateMerge(OpenApi.annotations({
|
|
92
|
+
identifier: "experimental.fs.unwatch",
|
|
93
|
+
summary: "Unwatch file",
|
|
94
|
+
description: "Stop watching one file relative to the requested location. Experimental: may change without compatibility guarantees.",
|
|
69
95
|
})))
|
|
70
96
|
.annotateMerge(OpenApi.annotations({
|
|
71
97
|
title: "filesystem",
|
|
@@ -1,7 +1,198 @@
|
|
|
1
|
+
import { Generate } from "@opencode/schema/generate";
|
|
1
2
|
import { Schema } from "effect";
|
|
2
3
|
import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
|
|
3
|
-
import { LocationNotFoundError,
|
|
4
|
-
export declare const GenerateGroup: HttpApiGroup.HttpApiGroup<"server.generate", HttpApiEndpoint.HttpApiEndpoint<"generate.
|
|
4
|
+
import { InvalidRequestError, LocationNotFoundError, ModelNotFoundError, ProviderNotFoundError, ProviderRequestError, ServiceUnavailableError, UnsupportedModelError } from "../errors.js";
|
|
5
|
+
export declare const GenerateGroup: HttpApiGroup.HttpApiGroup<"server.generate", HttpApiEndpoint.HttpApiEndpoint<"generate.decisions", "POST", "/api/experimental/generate/decisions", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
6
|
+
readonly model: Schema.Struct<{
|
|
7
|
+
readonly id: Schema.brand<Schema.String, "Model.ID">;
|
|
8
|
+
readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
|
|
9
|
+
opencode: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
10
|
+
anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
11
|
+
openai: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
12
|
+
google: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
13
|
+
googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
14
|
+
githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
15
|
+
amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
16
|
+
azure: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
17
|
+
openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
18
|
+
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
19
|
+
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
20
|
+
};
|
|
21
|
+
readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
|
|
22
|
+
}> & {
|
|
23
|
+
parse: (input: string) => {
|
|
24
|
+
readonly id: string & import("effect/Brand").Brand<"Model.ID">;
|
|
25
|
+
readonly providerID: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
26
|
+
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
readonly input: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
30
|
+
readonly type: Schema.Literal<"text">;
|
|
31
|
+
readonly text: Schema.String;
|
|
32
|
+
}>, Schema.Struct<{
|
|
33
|
+
readonly type: Schema.Literal<"json">;
|
|
34
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
35
|
+
}>, Schema.Struct<{
|
|
36
|
+
readonly data: Schema.String;
|
|
37
|
+
readonly mime: Schema.String;
|
|
38
|
+
readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
39
|
+
readonly type: Schema.Literal<"file">;
|
|
40
|
+
}>]>>;
|
|
41
|
+
readonly questions: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
42
|
+
readonly type: Schema.Literal<"predicate">;
|
|
43
|
+
readonly name: Schema.String;
|
|
44
|
+
readonly instructions: Schema.String;
|
|
45
|
+
}>, Schema.Struct<{
|
|
46
|
+
readonly type: Schema.Literal<"choice">;
|
|
47
|
+
readonly name: Schema.String;
|
|
48
|
+
readonly instructions: Schema.String;
|
|
49
|
+
readonly choices: Schema.$Array<Schema.Struct<{
|
|
50
|
+
readonly value: Schema.Union<readonly [Schema.String, Schema.Boolean]>;
|
|
51
|
+
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
52
|
+
}>>;
|
|
53
|
+
}>, Schema.Struct<{
|
|
54
|
+
readonly type: Schema.Literal<"score">;
|
|
55
|
+
readonly name: Schema.String;
|
|
56
|
+
readonly instructions: Schema.String;
|
|
57
|
+
readonly levels: Schema.$Array<Schema.Struct<{
|
|
58
|
+
readonly label: Schema.String;
|
|
59
|
+
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
60
|
+
}>>;
|
|
61
|
+
}>]>>;
|
|
62
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
63
|
+
readonly data: Schema.Struct<{
|
|
64
|
+
readonly answers: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
65
|
+
readonly type: Schema.Literal<"predicate">;
|
|
66
|
+
readonly name: Schema.String;
|
|
67
|
+
readonly probability: Schema.Finite;
|
|
68
|
+
}>, Schema.Struct<{
|
|
69
|
+
readonly type: Schema.Literal<"choice">;
|
|
70
|
+
readonly name: Schema.String;
|
|
71
|
+
readonly choice: Schema.Union<readonly [Schema.String, Schema.Boolean]>;
|
|
72
|
+
readonly probabilities: Schema.$Array<Schema.Struct<{
|
|
73
|
+
readonly value: Schema.Union<readonly [Schema.String, Schema.Boolean]>;
|
|
74
|
+
readonly probability: Schema.Finite;
|
|
75
|
+
}>>;
|
|
76
|
+
readonly confidence: Schema.Finite;
|
|
77
|
+
}>, Schema.Struct<{
|
|
78
|
+
readonly type: Schema.Literal<"score">;
|
|
79
|
+
readonly name: Schema.String;
|
|
80
|
+
readonly score: Schema.Finite;
|
|
81
|
+
readonly probabilities: Schema.$Array<Schema.Struct<{
|
|
82
|
+
readonly value: Schema.Int;
|
|
83
|
+
readonly label: Schema.String;
|
|
84
|
+
readonly probability: Schema.Finite;
|
|
85
|
+
}>>;
|
|
86
|
+
readonly confidence: Schema.Finite;
|
|
87
|
+
}>, Schema.Struct<{
|
|
88
|
+
readonly type: Schema.Literal<"error">;
|
|
89
|
+
readonly name: Schema.String;
|
|
90
|
+
readonly reason: Schema.String;
|
|
91
|
+
readonly message: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
92
|
+
}>]>>;
|
|
93
|
+
readonly cost: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
94
|
+
zero: number & import("effect/Brand").Brand<"Money.USD">;
|
|
95
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
96
|
+
zero: number & import("effect/Brand").Brand<"Money.USD">;
|
|
97
|
+
}>, never, never>;
|
|
98
|
+
readonly tokens: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
99
|
+
readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
100
|
+
readonly output: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
101
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
102
|
+
readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
103
|
+
readonly output: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
104
|
+
}>>, never, never>;
|
|
105
|
+
readonly native: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
106
|
+
}>;
|
|
107
|
+
}>>, Schema.toCodecJson<typeof LocationNotFoundError | typeof InvalidRequestError | typeof ServiceUnavailableError | typeof ProviderNotFoundError | typeof ModelNotFoundError | typeof UnsupportedModelError | typeof ProviderRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"generate.image", "POST", "/api/experimental/generate/image", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
108
|
+
readonly model: Schema.Struct<{
|
|
109
|
+
readonly id: Schema.brand<Schema.String, "Model.ID">;
|
|
110
|
+
readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
|
|
111
|
+
opencode: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
112
|
+
anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
113
|
+
openai: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
114
|
+
google: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
115
|
+
googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
116
|
+
githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
117
|
+
amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
118
|
+
azure: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
119
|
+
openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
120
|
+
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
121
|
+
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
122
|
+
};
|
|
123
|
+
readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
|
|
124
|
+
}> & {
|
|
125
|
+
parse: (input: string) => {
|
|
126
|
+
readonly id: string & import("effect/Brand").Brand<"Model.ID">;
|
|
127
|
+
readonly providerID: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
128
|
+
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
readonly prompt: Schema.String;
|
|
132
|
+
readonly images: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
|
|
133
|
+
readonly data: Schema.String;
|
|
134
|
+
readonly mime: Schema.String;
|
|
135
|
+
readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
136
|
+
}>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
137
|
+
readonly data: Schema.String;
|
|
138
|
+
readonly mime: Schema.String;
|
|
139
|
+
readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
140
|
+
}>>>, never, never>;
|
|
141
|
+
readonly n: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
142
|
+
readonly aspect: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<`${number}:${number}`, `${number}:${number}`, never, never>>>, Schema.optionalKey<Schema.Codec<`${number}:${number}`, `${number}:${number}`, never, never>>, never, never>;
|
|
143
|
+
readonly resolution: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Generate.ImageResolution, Generate.ImageResolution, never, never>>>, Schema.optionalKey<Schema.Codec<Generate.ImageResolution, Generate.ImageResolution, never, never>>, never, never>;
|
|
144
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
145
|
+
readonly data: Schema.Struct<{
|
|
146
|
+
readonly images: Schema.$Array<Schema.Struct<{
|
|
147
|
+
readonly data: Schema.String;
|
|
148
|
+
readonly mime: Schema.String;
|
|
149
|
+
readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
150
|
+
readonly type: Schema.Literal<"image">;
|
|
151
|
+
}>>;
|
|
152
|
+
readonly cost: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
153
|
+
zero: number & import("effect/Brand").Brand<"Money.USD">;
|
|
154
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
155
|
+
zero: number & import("effect/Brand").Brand<"Money.USD">;
|
|
156
|
+
}>, never, never>;
|
|
157
|
+
readonly tokens: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
158
|
+
readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
159
|
+
readonly output: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
160
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
161
|
+
readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
162
|
+
readonly output: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
163
|
+
}>>, never, never>;
|
|
164
|
+
readonly native: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
165
|
+
}>;
|
|
166
|
+
}>>, Schema.toCodecJson<typeof LocationNotFoundError | typeof InvalidRequestError | typeof ServiceUnavailableError | typeof ProviderNotFoundError | typeof ModelNotFoundError | typeof UnsupportedModelError | typeof ProviderRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"generate.text", "POST", "/api/experimental/generate/text", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
167
|
+
readonly prompt: Schema.String;
|
|
168
|
+
readonly model: Schema.optional<Schema.Struct<{
|
|
169
|
+
readonly id: Schema.brand<Schema.String, "Model.ID">;
|
|
170
|
+
readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
|
|
171
|
+
opencode: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
172
|
+
anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
173
|
+
openai: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
174
|
+
google: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
175
|
+
googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
176
|
+
githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
177
|
+
amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
178
|
+
azure: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
179
|
+
openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
180
|
+
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
181
|
+
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
182
|
+
};
|
|
183
|
+
readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
|
|
184
|
+
}> & {
|
|
185
|
+
parse: (input: string) => {
|
|
186
|
+
readonly id: string & import("effect/Brand").Brand<"Model.ID">;
|
|
187
|
+
readonly providerID: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
188
|
+
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
189
|
+
};
|
|
190
|
+
}>;
|
|
191
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
192
|
+
readonly data: Schema.Struct<{
|
|
193
|
+
readonly text: Schema.String;
|
|
194
|
+
}>;
|
|
195
|
+
}>>, Schema.toCodecJson<typeof LocationNotFoundError | typeof InvalidRequestError | typeof ServiceUnavailableError | typeof ProviderNotFoundError | typeof ModelNotFoundError | typeof UnsupportedModelError | typeof ProviderRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"generate.textLegacy", "POST", "/api/experimental/generate", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
5
196
|
readonly prompt: Schema.String;
|
|
6
197
|
readonly model: Schema.optional<Schema.Struct<{
|
|
7
198
|
readonly id: Schema.brand<Schema.String, "Model.ID">;
|
|
@@ -30,4 +221,4 @@ export declare const GenerateGroup: HttpApiGroup.HttpApiGroup<"server.generate",
|
|
|
30
221
|
readonly data: Schema.Struct<{
|
|
31
222
|
readonly text: Schema.String;
|
|
32
223
|
}>;
|
|
33
|
-
}>>, Schema.toCodecJson<typeof LocationNotFoundError | typeof InvalidRequestError | typeof ServiceUnavailableError>, never, never>, false>;
|
|
224
|
+
}>>, Schema.toCodecJson<typeof LocationNotFoundError | typeof InvalidRequestError | typeof ServiceUnavailableError | typeof ProviderNotFoundError | typeof ModelNotFoundError | typeof UnsupportedModelError | typeof ProviderRequestError>, never, never>, false>;
|