@opencode/schema 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.
Files changed (50) hide show
  1. package/dist/agent.d.ts +5 -0
  2. package/dist/config/experimental.d.ts +2 -0
  3. package/dist/config/experimental.js +6 -0
  4. package/dist/config/provider.d.ts +73 -7
  5. package/dist/config/provider.js +10 -15
  6. package/dist/event-manifest.d.ts +128 -366
  7. package/dist/file-diff.d.ts +2 -0
  8. package/dist/file-diff.js +2 -0
  9. package/dist/generate.d.ts +355 -0
  10. package/dist/generate.js +134 -0
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.js +1 -1
  13. package/dist/mcp.d.ts +1 -0
  14. package/dist/mcp.js +2 -0
  15. package/dist/model-compatibility.d.ts +15 -4
  16. package/dist/model-compatibility.js +15 -4
  17. package/dist/model.d.ts +53 -2
  18. package/dist/model.js +9 -7
  19. package/dist/permission.d.ts +0 -9
  20. package/dist/persistent-pty.d.ts +0 -20
  21. package/dist/plugin.d.ts +15 -0
  22. package/dist/plugin.js +11 -1
  23. package/dist/prompt-input.d.ts +3 -36
  24. package/dist/prompt-input.js +2 -6
  25. package/dist/prompt.d.ts +96 -0
  26. package/dist/prompt.js +17 -1
  27. package/dist/provider.d.ts +40 -0
  28. package/dist/provider.js +14 -3
  29. package/dist/session-event.d.ts +320 -852
  30. package/dist/session-event.js +0 -7
  31. package/dist/session-fork.d.ts +2 -2
  32. package/dist/session-id.d.ts +0 -1
  33. package/dist/session-id.js +3 -7
  34. package/dist/session-inbox.d.ts +721 -101
  35. package/dist/session-inbox.js +10 -1
  36. package/dist/session-message.d.ts +998 -31
  37. package/dist/session-message.js +19 -2
  38. package/dist/session-revert.d.ts +64 -27
  39. package/dist/session-status-event.d.ts +0 -8
  40. package/dist/session-transfer.d.ts +23 -24
  41. package/dist/session.d.ts +12 -22
  42. package/dist/usage-limits.d.ts +227 -0
  43. package/dist/usage-limits.js +59 -0
  44. package/dist/v1/legacy-event.d.ts +0 -4
  45. package/dist/v1/permission.d.ts +0 -10
  46. package/dist/v1/session.d.ts +0 -177
  47. package/dist/vcs.d.ts +3 -0
  48. package/dist/vcs.js +2 -0
  49. package/dist/workspace-id.js +0 -2
  50. package/package.json +5 -3
@@ -6,6 +6,8 @@ export declare const Info: Schema.Struct<{
6
6
  readonly additions: Schema.Int;
7
7
  readonly deletions: Schema.Int;
8
8
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
9
+ /** Marks the entry a folder listing adds for itself when it stopped before showing or checking every entry. */
10
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
9
11
  }>;
10
12
  export interface Info extends Schema.Schema.Type<typeof Info> {
11
13
  }
package/dist/file-diff.js CHANGED
@@ -7,6 +7,8 @@ export const Info = Schema.Struct({
7
7
  additions: NonNegativeInt,
8
8
  deletions: NonNegativeInt,
9
9
  status: Schema.Literals(["added", "deleted", "modified"]),
10
+ /** Marks the entry a folder listing adds for itself when it stopped before showing or checking every entry. */
11
+ more: Schema.Literal(true).pipe(optional),
10
12
  }).annotate({ identifier: "FileDiff.Info" });
11
13
  /** V1 snapshot and persisted session diff shape. */
12
14
  export const LegacyInfo = Schema.Struct({
@@ -0,0 +1,355 @@
1
+ export * as Generate from "./generate.js";
2
+ import { Schema } from "effect";
3
+ export interface File extends Schema.Schema.Type<typeof File> {
4
+ }
5
+ export declare const File: Schema.Struct<{
6
+ readonly data: Schema.String;
7
+ readonly mime: Schema.String;
8
+ readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
9
+ }>;
10
+ export interface Usage extends Schema.Schema.Type<typeof Usage> {
11
+ }
12
+ export declare const Usage: Schema.Struct<{
13
+ readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
14
+ readonly output: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
15
+ }>;
16
+ export declare const Native: Schema.$Record<Schema.String, Schema.Unknown>;
17
+ export type Native = typeof Native.Type;
18
+ export type ImageAspect = `${number}:${number}`;
19
+ export declare const ImageAspect: Schema.Codec<ImageAspect>;
20
+ /** Open-ended: providers add size tiers beyond these. */
21
+ export type ImageResolution = "1K" | "2K" | "4K" | (string & {});
22
+ export declare const ImageResolution: Schema.Codec<ImageResolution>;
23
+ export interface ImageRequest extends Schema.Schema.Type<typeof ImageRequest> {
24
+ }
25
+ export declare const ImageRequest: Schema.Struct<{
26
+ readonly model: Schema.Struct<{
27
+ readonly id: Schema.brand<Schema.String, "Model.ID">;
28
+ readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
29
+ opencode: string & import("effect/Brand").Brand<"Provider.ID">;
30
+ anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
31
+ openai: string & import("effect/Brand").Brand<"Provider.ID">;
32
+ google: string & import("effect/Brand").Brand<"Provider.ID">;
33
+ googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
34
+ githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
35
+ amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
36
+ azure: string & import("effect/Brand").Brand<"Provider.ID">;
37
+ openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
38
+ mistral: string & import("effect/Brand").Brand<"Provider.ID">;
39
+ gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
40
+ };
41
+ readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
42
+ }> & {
43
+ parse: (input: string) => {
44
+ readonly id: string & import("effect/Brand").Brand<"Model.ID">;
45
+ readonly providerID: string & import("effect/Brand").Brand<"Provider.ID">;
46
+ readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
47
+ };
48
+ };
49
+ readonly prompt: Schema.String;
50
+ readonly images: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
51
+ readonly data: Schema.String;
52
+ readonly mime: Schema.String;
53
+ readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
54
+ }>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
55
+ readonly data: Schema.String;
56
+ readonly mime: Schema.String;
57
+ readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
58
+ }>>>, never, never>;
59
+ readonly n: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
60
+ 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>;
61
+ readonly resolution: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<ImageResolution, ImageResolution, never, never>>>, Schema.optionalKey<Schema.Codec<ImageResolution, ImageResolution, never, never>>, never, never>;
62
+ }>;
63
+ export interface ImageOutput extends Schema.Schema.Type<typeof ImageOutput> {
64
+ }
65
+ export declare const ImageOutput: Schema.Struct<{
66
+ readonly data: Schema.String;
67
+ readonly mime: Schema.String;
68
+ readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
69
+ readonly type: Schema.Literal<"image">;
70
+ }>;
71
+ export interface ImageResult extends Schema.Schema.Type<typeof ImageResult> {
72
+ }
73
+ export declare const ImageResult: Schema.Struct<{
74
+ readonly images: Schema.$Array<Schema.Struct<{
75
+ readonly data: Schema.String;
76
+ readonly mime: Schema.String;
77
+ readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
78
+ readonly type: Schema.Literal<"image">;
79
+ }>>;
80
+ readonly cost: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.Finite, "Money.USD"> & {
81
+ zero: number & import("effect/Brand").Brand<"Money.USD">;
82
+ }>>, Schema.optionalKey<Schema.brand<Schema.Finite, "Money.USD"> & {
83
+ zero: number & import("effect/Brand").Brand<"Money.USD">;
84
+ }>, never, never>;
85
+ readonly tokens: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
86
+ readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
87
+ readonly output: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
88
+ }>>>, Schema.optionalKey<Schema.Struct<{
89
+ readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
90
+ readonly output: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
91
+ }>>, never, never>;
92
+ readonly native: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
93
+ }>;
94
+ export interface DecisionTextPart extends Schema.Schema.Type<typeof DecisionTextPart> {
95
+ }
96
+ export declare const DecisionTextPart: Schema.Struct<{
97
+ readonly type: Schema.Literal<"text">;
98
+ readonly text: Schema.String;
99
+ }>;
100
+ export interface DecisionJsonPart extends Schema.Schema.Type<typeof DecisionJsonPart> {
101
+ }
102
+ export declare const DecisionJsonPart: Schema.Struct<{
103
+ readonly type: Schema.Literal<"json">;
104
+ readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
105
+ }>;
106
+ export interface DecisionFilePart extends Schema.Schema.Type<typeof DecisionFilePart> {
107
+ }
108
+ export declare const DecisionFilePart: Schema.Struct<{
109
+ readonly data: Schema.String;
110
+ readonly mime: Schema.String;
111
+ readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
112
+ readonly type: Schema.Literal<"file">;
113
+ }>;
114
+ export type DecisionPart = DecisionTextPart | DecisionJsonPart | DecisionFilePart;
115
+ export declare const DecisionPart: Schema.Union<readonly [Schema.Struct<{
116
+ readonly type: Schema.Literal<"text">;
117
+ readonly text: Schema.String;
118
+ }>, Schema.Struct<{
119
+ readonly type: Schema.Literal<"json">;
120
+ readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
121
+ }>, Schema.Struct<{
122
+ readonly data: Schema.String;
123
+ readonly mime: Schema.String;
124
+ readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
125
+ readonly type: Schema.Literal<"file">;
126
+ }>]>;
127
+ export declare const ChoiceValue: Schema.Union<readonly [Schema.String, Schema.Boolean]>;
128
+ export type ChoiceValue = typeof ChoiceValue.Type;
129
+ export interface PredicateQuestion extends Schema.Schema.Type<typeof PredicateQuestion> {
130
+ }
131
+ export declare const PredicateQuestion: Schema.Struct<{
132
+ readonly type: Schema.Literal<"predicate">;
133
+ readonly name: Schema.String;
134
+ readonly instructions: Schema.String;
135
+ }>;
136
+ export interface ChoiceQuestion extends Schema.Schema.Type<typeof ChoiceQuestion> {
137
+ }
138
+ export declare const ChoiceQuestion: Schema.Struct<{
139
+ readonly type: Schema.Literal<"choice">;
140
+ readonly name: Schema.String;
141
+ readonly instructions: Schema.String;
142
+ readonly choices: Schema.$Array<Schema.Struct<{
143
+ readonly value: Schema.Union<readonly [Schema.String, Schema.Boolean]>;
144
+ readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
145
+ }>>;
146
+ }>;
147
+ export interface ScoreQuestion extends Schema.Schema.Type<typeof ScoreQuestion> {
148
+ }
149
+ export declare const ScoreQuestion: Schema.Struct<{
150
+ readonly type: Schema.Literal<"score">;
151
+ readonly name: Schema.String;
152
+ readonly instructions: Schema.String;
153
+ readonly levels: Schema.$Array<Schema.Struct<{
154
+ readonly label: Schema.String;
155
+ readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
156
+ }>>;
157
+ }>;
158
+ export type DecisionQuestion = PredicateQuestion | ChoiceQuestion | ScoreQuestion;
159
+ export declare const DecisionQuestion: Schema.Union<readonly [Schema.Struct<{
160
+ readonly type: Schema.Literal<"predicate">;
161
+ readonly name: Schema.String;
162
+ readonly instructions: Schema.String;
163
+ }>, Schema.Struct<{
164
+ readonly type: Schema.Literal<"choice">;
165
+ readonly name: Schema.String;
166
+ readonly instructions: Schema.String;
167
+ readonly choices: Schema.$Array<Schema.Struct<{
168
+ readonly value: Schema.Union<readonly [Schema.String, Schema.Boolean]>;
169
+ readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
170
+ }>>;
171
+ }>, Schema.Struct<{
172
+ readonly type: Schema.Literal<"score">;
173
+ readonly name: Schema.String;
174
+ readonly instructions: Schema.String;
175
+ readonly levels: Schema.$Array<Schema.Struct<{
176
+ readonly label: Schema.String;
177
+ readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
178
+ }>>;
179
+ }>]>;
180
+ export interface DecisionRequest extends Schema.Schema.Type<typeof DecisionRequest> {
181
+ }
182
+ export declare const DecisionRequest: Schema.Struct<{
183
+ readonly model: Schema.Struct<{
184
+ readonly id: Schema.brand<Schema.String, "Model.ID">;
185
+ readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
186
+ opencode: string & import("effect/Brand").Brand<"Provider.ID">;
187
+ anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
188
+ openai: string & import("effect/Brand").Brand<"Provider.ID">;
189
+ google: string & import("effect/Brand").Brand<"Provider.ID">;
190
+ googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
191
+ githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
192
+ amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
193
+ azure: string & import("effect/Brand").Brand<"Provider.ID">;
194
+ openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
195
+ mistral: string & import("effect/Brand").Brand<"Provider.ID">;
196
+ gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
197
+ };
198
+ readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
199
+ }> & {
200
+ parse: (input: string) => {
201
+ readonly id: string & import("effect/Brand").Brand<"Model.ID">;
202
+ readonly providerID: string & import("effect/Brand").Brand<"Provider.ID">;
203
+ readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
204
+ };
205
+ };
206
+ readonly input: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
207
+ readonly type: Schema.Literal<"text">;
208
+ readonly text: Schema.String;
209
+ }>, Schema.Struct<{
210
+ readonly type: Schema.Literal<"json">;
211
+ readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
212
+ }>, Schema.Struct<{
213
+ readonly data: Schema.String;
214
+ readonly mime: Schema.String;
215
+ readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
216
+ readonly type: Schema.Literal<"file">;
217
+ }>]>>;
218
+ readonly questions: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
219
+ readonly type: Schema.Literal<"predicate">;
220
+ readonly name: Schema.String;
221
+ readonly instructions: Schema.String;
222
+ }>, Schema.Struct<{
223
+ readonly type: Schema.Literal<"choice">;
224
+ readonly name: Schema.String;
225
+ readonly instructions: Schema.String;
226
+ readonly choices: Schema.$Array<Schema.Struct<{
227
+ readonly value: Schema.Union<readonly [Schema.String, Schema.Boolean]>;
228
+ readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
229
+ }>>;
230
+ }>, Schema.Struct<{
231
+ readonly type: Schema.Literal<"score">;
232
+ readonly name: Schema.String;
233
+ readonly instructions: Schema.String;
234
+ readonly levels: Schema.$Array<Schema.Struct<{
235
+ readonly label: Schema.String;
236
+ readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
237
+ }>>;
238
+ }>]>>;
239
+ }>;
240
+ export interface PredicateAnswer extends Schema.Schema.Type<typeof PredicateAnswer> {
241
+ }
242
+ export declare const PredicateAnswer: Schema.Struct<{
243
+ readonly type: Schema.Literal<"predicate">;
244
+ readonly name: Schema.String;
245
+ readonly probability: Schema.Finite;
246
+ }>;
247
+ export interface ChoiceAnswer extends Schema.Schema.Type<typeof ChoiceAnswer> {
248
+ }
249
+ export declare const ChoiceAnswer: Schema.Struct<{
250
+ readonly type: Schema.Literal<"choice">;
251
+ readonly name: Schema.String;
252
+ readonly choice: Schema.Union<readonly [Schema.String, Schema.Boolean]>;
253
+ readonly probabilities: Schema.$Array<Schema.Struct<{
254
+ readonly value: Schema.Union<readonly [Schema.String, Schema.Boolean]>;
255
+ readonly probability: Schema.Finite;
256
+ }>>;
257
+ readonly confidence: Schema.Finite;
258
+ }>;
259
+ export interface ScoreAnswer extends Schema.Schema.Type<typeof ScoreAnswer> {
260
+ }
261
+ export declare const ScoreAnswer: Schema.Struct<{
262
+ readonly type: Schema.Literal<"score">;
263
+ readonly name: Schema.String;
264
+ readonly score: Schema.Finite;
265
+ readonly probabilities: Schema.$Array<Schema.Struct<{
266
+ readonly value: Schema.Int;
267
+ readonly label: Schema.String;
268
+ readonly probability: Schema.Finite;
269
+ }>>;
270
+ readonly confidence: Schema.Finite;
271
+ }>;
272
+ export interface ErrorAnswer extends Schema.Schema.Type<typeof ErrorAnswer> {
273
+ }
274
+ export declare const ErrorAnswer: Schema.Struct<{
275
+ readonly type: Schema.Literal<"error">;
276
+ readonly name: Schema.String;
277
+ readonly reason: Schema.String;
278
+ readonly message: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
279
+ }>;
280
+ export type DecisionAnswer = PredicateAnswer | ChoiceAnswer | ScoreAnswer | ErrorAnswer;
281
+ export declare const DecisionAnswer: Schema.Union<readonly [Schema.Struct<{
282
+ readonly type: Schema.Literal<"predicate">;
283
+ readonly name: Schema.String;
284
+ readonly probability: Schema.Finite;
285
+ }>, Schema.Struct<{
286
+ readonly type: Schema.Literal<"choice">;
287
+ readonly name: Schema.String;
288
+ readonly choice: Schema.Union<readonly [Schema.String, Schema.Boolean]>;
289
+ readonly probabilities: Schema.$Array<Schema.Struct<{
290
+ readonly value: Schema.Union<readonly [Schema.String, Schema.Boolean]>;
291
+ readonly probability: Schema.Finite;
292
+ }>>;
293
+ readonly confidence: Schema.Finite;
294
+ }>, Schema.Struct<{
295
+ readonly type: Schema.Literal<"score">;
296
+ readonly name: Schema.String;
297
+ readonly score: Schema.Finite;
298
+ readonly probabilities: Schema.$Array<Schema.Struct<{
299
+ readonly value: Schema.Int;
300
+ readonly label: Schema.String;
301
+ readonly probability: Schema.Finite;
302
+ }>>;
303
+ readonly confidence: Schema.Finite;
304
+ }>, Schema.Struct<{
305
+ readonly type: Schema.Literal<"error">;
306
+ readonly name: Schema.String;
307
+ readonly reason: Schema.String;
308
+ readonly message: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
309
+ }>]>;
310
+ export interface DecisionResult extends Schema.Schema.Type<typeof DecisionResult> {
311
+ }
312
+ export declare const DecisionResult: Schema.Struct<{
313
+ readonly answers: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
314
+ readonly type: Schema.Literal<"predicate">;
315
+ readonly name: Schema.String;
316
+ readonly probability: Schema.Finite;
317
+ }>, Schema.Struct<{
318
+ readonly type: Schema.Literal<"choice">;
319
+ readonly name: Schema.String;
320
+ readonly choice: Schema.Union<readonly [Schema.String, Schema.Boolean]>;
321
+ readonly probabilities: Schema.$Array<Schema.Struct<{
322
+ readonly value: Schema.Union<readonly [Schema.String, Schema.Boolean]>;
323
+ readonly probability: Schema.Finite;
324
+ }>>;
325
+ readonly confidence: Schema.Finite;
326
+ }>, Schema.Struct<{
327
+ readonly type: Schema.Literal<"score">;
328
+ readonly name: Schema.String;
329
+ readonly score: Schema.Finite;
330
+ readonly probabilities: Schema.$Array<Schema.Struct<{
331
+ readonly value: Schema.Int;
332
+ readonly label: Schema.String;
333
+ readonly probability: Schema.Finite;
334
+ }>>;
335
+ readonly confidence: Schema.Finite;
336
+ }>, Schema.Struct<{
337
+ readonly type: Schema.Literal<"error">;
338
+ readonly name: Schema.String;
339
+ readonly reason: Schema.String;
340
+ readonly message: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
341
+ }>]>>;
342
+ readonly cost: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.Finite, "Money.USD"> & {
343
+ zero: number & import("effect/Brand").Brand<"Money.USD">;
344
+ }>>, Schema.optionalKey<Schema.brand<Schema.Finite, "Money.USD"> & {
345
+ zero: number & import("effect/Brand").Brand<"Money.USD">;
346
+ }>, never, never>;
347
+ readonly tokens: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
348
+ readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
349
+ readonly output: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
350
+ }>>>, Schema.optionalKey<Schema.Struct<{
351
+ readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
352
+ readonly output: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
353
+ }>>, never, never>;
354
+ readonly native: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
355
+ }>;
@@ -0,0 +1,134 @@
1
+ export * as Generate from "./generate.js";
2
+ import { Schema } from "effect";
3
+ import { Model } from "./model.js";
4
+ import { Money } from "./money.js";
5
+ import { Base64 } from "./prompt.js";
6
+ import { PositiveInt, optional } from "./schema.js";
7
+ const description = (text) => ({ description: text });
8
+ export const File = Schema.Struct({
9
+ data: Base64,
10
+ mime: Schema.String,
11
+ name: Schema.String.pipe(optional),
12
+ }).annotate({ identifier: "Generate.File" });
13
+ export const Usage = Schema.Struct({
14
+ input: Schema.Finite.pipe(optional),
15
+ output: Schema.Finite.pipe(optional),
16
+ }).annotate({ identifier: "Generate.Usage", description: "Token counts, when the provider reports them" });
17
+ export const Native = Schema.Record(Schema.String, Schema.Unknown).annotate({
18
+ identifier: "Generate.Native",
19
+ description: "Provider-specific data the shared fields do not cover",
20
+ });
21
+ // The template literal gives clients the type; the pattern also rejects signs and exponents it would allow.
22
+ export const ImageAspect = Schema.TemplateLiteral([Schema.Number, ":", Schema.Number])
23
+ .check(Schema.isPattern(/^\d+(?:\.\d+)?:\d+(?:\.\d+)?$/))
24
+ .annotate({ identifier: "Generate.ImageAspect", description: "Aspect ratio as width:height, for example 16:9" });
25
+ export const ImageResolution = Schema.Union([
26
+ Schema.Literals(["1K", "2K", "4K"]),
27
+ Schema.String,
28
+ ]).annotate({
29
+ identifier: "Generate.ImageResolution",
30
+ description: "Size tier such as 1K, 2K or 4K; 1K is about as many pixels as 1024x1024 at the requested aspect",
31
+ });
32
+ export const ImageRequest = Schema.Struct({
33
+ model: Model.Ref,
34
+ prompt: Schema.String,
35
+ images: Schema.Array(File)
36
+ .pipe(optional)
37
+ .annotate(description("Edit sources or style and subject references, in order")),
38
+ n: PositiveInt.pipe(optional).annotate(description("Number of images to generate; defaults to 1")),
39
+ aspect: ImageAspect.pipe(optional),
40
+ resolution: ImageResolution.pipe(optional),
41
+ }).annotate({ identifier: "Generate.ImageRequest" });
42
+ export const ImageOutput = Schema.Struct({
43
+ type: Schema.Literal("image"),
44
+ ...File.fields,
45
+ }).annotate({ identifier: "Generate.ImageOutput" });
46
+ export const ImageResult = Schema.Struct({
47
+ images: Schema.Array(ImageOutput),
48
+ cost: Money.USD.pipe(optional),
49
+ tokens: Usage.pipe(optional),
50
+ native: Native.pipe(optional),
51
+ }).annotate({ identifier: "Generate.ImageResult" });
52
+ export const DecisionTextPart = Schema.Struct({ type: Schema.Literal("text"), text: Schema.String }).annotate({
53
+ identifier: "Generate.DecisionTextPart",
54
+ });
55
+ export const DecisionJsonPart = Schema.Struct({ type: Schema.Literal("json"), value: Schema.Json }).annotate({
56
+ identifier: "Generate.DecisionJsonPart",
57
+ });
58
+ export const DecisionFilePart = Schema.Struct({
59
+ type: Schema.Literal("file"),
60
+ ...File.fields,
61
+ }).annotate({ identifier: "Generate.DecisionFilePart" });
62
+ export const DecisionPart = Schema.Union([DecisionTextPart, DecisionJsonPart, DecisionFilePart]).annotate({
63
+ identifier: "Generate.DecisionPart",
64
+ });
65
+ export const ChoiceValue = Schema.Union([Schema.String, Schema.Boolean]).annotate({
66
+ identifier: "Generate.ChoiceValue",
67
+ description: 'Choice values are typed: true and "true" are different values',
68
+ });
69
+ const QuestionName = Schema.String.annotate(description("Unique within the request; echoed on the matching answer"));
70
+ export const PredicateQuestion = Schema.Struct({
71
+ type: Schema.Literal("predicate"),
72
+ name: QuestionName,
73
+ instructions: Schema.String,
74
+ }).annotate({ identifier: "Generate.PredicateQuestion", description: "The probability that a statement is true" });
75
+ export const ChoiceQuestion = Schema.Struct({
76
+ type: Schema.Literal("choice"),
77
+ name: QuestionName,
78
+ instructions: Schema.String,
79
+ choices: Schema.Array(Schema.Struct({ value: ChoiceValue, description: Schema.String.pipe(optional) })).check(Schema.isMinLength(1)),
80
+ }).annotate({ identifier: "Generate.ChoiceQuestion", description: "Pick one value from a fixed set" });
81
+ export const ScoreQuestion = Schema.Struct({
82
+ type: Schema.Literal("score"),
83
+ name: QuestionName,
84
+ instructions: Schema.String,
85
+ levels: Schema.Array(Schema.Struct({ label: Schema.String, description: Schema.String.pipe(optional) })).check(Schema.isMinLength(1)),
86
+ }).annotate({ identifier: "Generate.ScoreQuestion", description: "Place the input on ordered levels, lowest first" });
87
+ export const DecisionQuestion = Schema.Union([PredicateQuestion, ChoiceQuestion, ScoreQuestion]).annotate({
88
+ identifier: "Generate.DecisionQuestion",
89
+ });
90
+ export const DecisionRequest = Schema.Struct({
91
+ model: Model.Ref,
92
+ input: Schema.Array(DecisionPart).annotate(description("The evidence every question is asked about, in order")),
93
+ questions: Schema.Array(DecisionQuestion)
94
+ .check(Schema.isMinLength(1))
95
+ .annotate(description("Question names must be unique; duplicates fail with InvalidRequestError")),
96
+ }).annotate({ identifier: "Generate.DecisionRequest" });
97
+ const Probability = Schema.Finite.check(Schema.isBetween({ minimum: 0, maximum: 1 }));
98
+ export const PredicateAnswer = Schema.Struct({
99
+ type: Schema.Literal("predicate"),
100
+ name: Schema.String,
101
+ probability: Probability,
102
+ }).annotate({ identifier: "Generate.PredicateAnswer" });
103
+ export const ChoiceAnswer = Schema.Struct({
104
+ type: Schema.Literal("choice"),
105
+ name: Schema.String,
106
+ choice: ChoiceValue,
107
+ probabilities: Schema.Array(Schema.Struct({ value: ChoiceValue, probability: Probability })),
108
+ confidence: Probability,
109
+ }).annotate({ identifier: "Generate.ChoiceAnswer" });
110
+ export const ScoreAnswer = Schema.Struct({
111
+ type: Schema.Literal("score"),
112
+ name: Schema.String,
113
+ score: Schema.Finite.annotate(description("Probability-weighted level index, so it can fall between levels")),
114
+ probabilities: Schema.Array(Schema.Struct({ value: Schema.Int, label: Schema.String, probability: Probability })),
115
+ confidence: Probability,
116
+ }).annotate({ identifier: "Generate.ScoreAnswer" });
117
+ export const ErrorAnswer = Schema.Struct({
118
+ type: Schema.Literal("error"),
119
+ name: Schema.String,
120
+ reason: Schema.String.annotate(description("Why the question has no answer, for example refusal")),
121
+ message: Schema.String.pipe(optional),
122
+ }).annotate({
123
+ identifier: "Generate.ErrorAnswer",
124
+ description: "This one question has no answer; the other answers still came back",
125
+ });
126
+ export const DecisionAnswer = Schema.Union([PredicateAnswer, ChoiceAnswer, ScoreAnswer, ErrorAnswer]).annotate({
127
+ identifier: "Generate.DecisionAnswer",
128
+ });
129
+ export const DecisionResult = Schema.Struct({
130
+ answers: Schema.Array(DecisionAnswer).annotate(description("One answer per question, in question order")),
131
+ cost: Money.USD.pipe(optional),
132
+ tokens: Usage.pipe(optional),
133
+ native: Native.pipe(optional),
134
+ }).annotate({ identifier: "Generate.DecisionResult" });
package/dist/index.d.ts CHANGED
@@ -36,6 +36,6 @@ export { PersistentPty } from "./persistent-pty.js";
36
36
  export { PtyTicket } from "./pty-ticket.js";
37
37
  export { Question } from "./question.js";
38
38
  export { Workspace } from "./workspace.js";
39
- export { Prompt, PromptMention, FileSource, FileAttachment, AgentAttachment } from "./prompt.js";
39
+ export { Prompt, PromptMention, FileSource, FileAttachment, MediaRef, MediaFileAttachment, Attachment, AgentAttachment, } from "./prompt.js";
40
40
  export { PromptInput } from "./prompt-input.js";
41
41
  export * from "./schema.js";
package/dist/index.js CHANGED
@@ -36,6 +36,6 @@ export { PersistentPty } from "./persistent-pty.js";
36
36
  export { PtyTicket } from "./pty-ticket.js";
37
37
  export { Question } from "./question.js";
38
38
  export { Workspace } from "./workspace.js";
39
- export { Prompt, PromptMention, FileSource, FileAttachment, AgentAttachment } from "./prompt.js";
39
+ export { Prompt, PromptMention, FileSource, FileAttachment, MediaRef, MediaFileAttachment, Attachment, AgentAttachment, } from "./prompt.js";
40
40
  export { PromptInput } from "./prompt-input.js";
41
41
  export * from "./schema.js";
package/dist/mcp.d.ts CHANGED
@@ -76,6 +76,7 @@ export declare const Server: Schema.Struct<{
76
76
  readonly status: Schema.Literal<"needs_auth">;
77
77
  readonly error: Schema.String;
78
78
  }>]>;
79
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
79
80
  readonly integrationID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Integration.ID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Integration.ID">>, never, never>;
80
81
  }>;
81
82
  export interface Resource extends Schema.Schema.Type<typeof Resource> {
package/dist/mcp.js CHANGED
@@ -77,6 +77,8 @@ export const Status = Schema.Union([Connected, Pending, Disabled, Failed, NeedsA
77
77
  export const Server = Schema.Struct({
78
78
  name: Schema.String,
79
79
  status: Status,
80
+ // Display title from the connected server's `serverInfo.title`; absent while disconnected or when not provided.
81
+ title: optional(Schema.String),
80
82
  // Set for remote servers registered as OAuth integrations; lets clients act on the right integration
81
83
  // without matching by name, which could collide with provider or plugin integrations.
82
84
  integrationID: optional(IntegrationID),
@@ -3,26 +3,36 @@ export type ReasoningField = "reasoning" | "reasoning_content" | "reasoning_text
3
3
  export declare const ReasoningField: Schema.Codec<ReasoningField>;
4
4
  export declare const MaxTokensField: Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>;
5
5
  export type MaxTokensField = typeof MaxTokensField.Type;
6
+ /** Where a System One decision host reads media, from models.dev `compatibility.media_input`. */
7
+ export declare const MediaInput: Schema.Literals<readonly ["assets", "state", "root"]>;
8
+ export type MediaInput = typeof MediaInput.Type;
6
9
  export declare const CacheFormat: Schema.Literals<readonly ["anthropic", "alibaba"]>;
7
10
  export type CacheFormat = typeof CacheFormat.Type;
8
11
  export interface Compatibility extends Schema.Schema.Type<typeof Compatibility> {
9
12
  }
10
13
  export declare const Compatibility: Schema.Struct<{
14
+ /** OpenAI Chat: assistant-message field that carries reasoning. Unset uses the streamed field, else `reasoning_content`. */
11
15
  readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<ReasoningField, ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<ReasoningField, ReasoningField, never, never>>, never, never>;
12
- /** Require every assistant message to include its reasoning field, even when empty. */
16
+ /** OpenAI Chat: send the reasoning field on every prior assistant message, even when empty. */
13
17
  readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
18
+ /** OpenAI Chat: body field for the output token limit. Unset detects it from the provider. */
14
19
  readonly maxTokensField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>>, Schema.optionalKey<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>, never, never>;
20
+ /** OpenAI Chat: fail a stream that ends without `finish_reason`. Defaults to true. */
15
21
  readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
22
+ /** OpenAI Chat: insert an assistant message between a tool result and the next user message. */
16
23
  readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
24
+ /** OpenAI Chat, OpenAI Responses and Mistral: whether the endpoint accepts `prompt_cache_key`. */
17
25
  readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
18
- /** Request usage in the stream with `stream_options.include_usage`. Defaults to true. */
26
+ /** OpenAI Chat: request usage in the stream with `stream_options.include_usage`. Defaults to true. */
19
27
  readonly streamUsage: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
20
28
  /** Prompt-cache marker syntax the endpoint accepts. Overrides the route default; both send `cache_control`, and `alibaba` skips tool definitions. */
21
29
  readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
22
- /** Supports Anthropic's thinking-prefix mismatch controls. Overrides model-ID detection. */
30
+ /** Anthropic Messages and Bedrock Converse: supports Anthropic's thinking-prefix mismatch controls. Overrides model-ID detection. */
23
31
  readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
24
- /** Supports per-message effort updates. Overrides model-ID detection. */
32
+ /** Anthropic Messages and OpenAI Responses: supports per-message effort updates. Overrides model-ID detection. */
25
33
  readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
34
+ /** System One: where the decision host reads media. Unset keeps the route default. */
35
+ readonly mediaInput: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["assets", "state", "root"]>>>, Schema.optionalKey<Schema.Literals<readonly ["assets", "state", "root"]>>, never, never>;
26
36
  }>;
27
37
  export interface ProviderCompatibility extends Schema.Schema.Type<typeof ProviderCompatibility> {
28
38
  }
@@ -35,4 +45,5 @@ export declare const ProviderCompatibility: Schema.Struct<{
35
45
  readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
36
46
  readonly streamUsage: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
37
47
  readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
48
+ readonly mediaInput: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["assets", "state", "root"]>>>, Schema.optionalKey<Schema.Literals<readonly ["assets", "state", "root"]>>, never, never>;
38
49
  }>;
@@ -7,22 +7,33 @@ export const ReasoningField = Schema.Union([
7
7
  export const MaxTokensField = Schema.Literals(["max_completion_tokens", "max_tokens"]).annotate({
8
8
  identifier: "Model.MaxTokensField",
9
9
  });
10
+ /** Where a System One decision host reads media, from models.dev `compatibility.media_input`. */
11
+ export const MediaInput = Schema.Literals(["assets", "state", "root"]).annotate({
12
+ identifier: "Model.MediaInput",
13
+ });
10
14
  export const CacheFormat = Schema.Literals(["anthropic", "alibaba"]).annotate({ identifier: "Model.CacheFormat" });
11
15
  export const Compatibility = Schema.Struct({
16
+ /** OpenAI Chat: assistant-message field that carries reasoning. Unset uses the streamed field, else `reasoning_content`. */
12
17
  reasoningField: ReasoningField.pipe(optional),
13
- /** Require every assistant message to include its reasoning field, even when empty. */
18
+ /** OpenAI Chat: send the reasoning field on every prior assistant message, even when empty. */
14
19
  requireReasoning: Schema.Boolean.pipe(optional),
20
+ /** OpenAI Chat: body field for the output token limit. Unset detects it from the provider. */
15
21
  maxTokensField: MaxTokensField.pipe(optional),
22
+ /** OpenAI Chat: fail a stream that ends without `finish_reason`. Defaults to true. */
16
23
  requireFinishReason: Schema.Boolean.pipe(optional),
24
+ /** OpenAI Chat: insert an assistant message between a tool result and the next user message. */
17
25
  requireAssistantAfterTool: Schema.Boolean.pipe(optional),
26
+ /** OpenAI Chat, OpenAI Responses and Mistral: whether the endpoint accepts `prompt_cache_key`. */
18
27
  supportsPromptCacheKey: Schema.Boolean.pipe(optional),
19
- /** Request usage in the stream with `stream_options.include_usage`. Defaults to true. */
28
+ /** OpenAI Chat: request usage in the stream with `stream_options.include_usage`. Defaults to true. */
20
29
  streamUsage: Schema.Boolean.pipe(optional),
21
30
  /** Prompt-cache marker syntax the endpoint accepts. Overrides the route default; both send `cache_control`, and `alibaba` skips tool definitions. */
22
31
  cacheFormat: CacheFormat.pipe(optional),
23
- /** Supports Anthropic's thinking-prefix mismatch controls. Overrides model-ID detection. */
32
+ /** Anthropic Messages and Bedrock Converse: supports Anthropic's thinking-prefix mismatch controls. Overrides model-ID detection. */
24
33
  supportsThinkingBlockBinding: Schema.Boolean.pipe(optional),
25
- /** Supports per-message effort updates. Overrides model-ID detection. */
34
+ /** Anthropic Messages and OpenAI Responses: supports per-message effort updates. Overrides model-ID detection. */
26
35
  supportsEffortUpdates: Schema.Boolean.pipe(optional),
36
+ /** System One: where the decision host reads media. Unset keeps the route default. */
37
+ mediaInput: MediaInput.pipe(optional),
27
38
  }).annotate({ identifier: "Model.Compatibility" });
28
39
  export const ProviderCompatibility = Schema.Struct(Struct.omit(Compatibility.fields, ["supportsThinkingBlockBinding", "supportsEffortUpdates"])).annotate({ identifier: "Provider.Compatibility" });