@opencode/schema 0.0.0-dev-19829 → 0.0.0-dev-19836
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/config/provider.d.ts +12 -18
- package/dist/config/provider.js +10 -2
- package/dist/model.d.ts +37 -18
- package/dist/model.js +12 -2
- package/package.json +1 -1
|
@@ -15,6 +15,18 @@ export declare const Settings: Schema.StructWithRest<Schema.Struct<{
|
|
|
15
15
|
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
16
16
|
}>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>;
|
|
17
17
|
export type Settings = typeof Settings.Type;
|
|
18
|
+
export declare const ModelSettings: Schema.StructWithRest<Schema.Struct<{
|
|
19
|
+
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
20
|
+
readonly type: Schema.Literal<"summary">;
|
|
21
|
+
}>, Schema.Struct<{
|
|
22
|
+
readonly type: Schema.Literal<"native">;
|
|
23
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
24
|
+
readonly type: Schema.Literal<"summary">;
|
|
25
|
+
}>, Schema.Struct<{
|
|
26
|
+
readonly type: Schema.Literal<"native">;
|
|
27
|
+
}>]>>, never, never>;
|
|
28
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>;
|
|
29
|
+
export type ModelSettings = typeof ModelSettings.Type;
|
|
18
30
|
export declare const Overlays: {
|
|
19
31
|
settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
|
|
20
32
|
readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
@@ -115,8 +127,6 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
|
|
|
115
127
|
}>, never, never>;
|
|
116
128
|
readonly variants: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
|
|
117
129
|
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
|
|
118
|
-
readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
119
|
-
readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
120
130
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
121
131
|
readonly type: Schema.Literal<"summary">;
|
|
122
132
|
}>, Schema.Struct<{
|
|
@@ -126,10 +136,7 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
|
|
|
126
136
|
}>, Schema.Struct<{
|
|
127
137
|
readonly type: Schema.Literal<"native">;
|
|
128
138
|
}>]>>, never, never>;
|
|
129
|
-
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
130
139
|
}>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
131
|
-
readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
132
|
-
readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
133
140
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
134
141
|
readonly type: Schema.Literal<"summary">;
|
|
135
142
|
}>, Schema.Struct<{
|
|
@@ -139,15 +146,12 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
|
|
|
139
146
|
}>, Schema.Struct<{
|
|
140
147
|
readonly type: Schema.Literal<"native">;
|
|
141
148
|
}>]>>, never, never>;
|
|
142
|
-
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
143
149
|
}>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>, never, never>;
|
|
144
150
|
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
145
151
|
readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
|
146
152
|
readonly id: Schema.brand<Schema.String, "Model.VariantID">;
|
|
147
153
|
}>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
148
154
|
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
|
|
149
|
-
readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
150
|
-
readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
151
155
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
152
156
|
readonly type: Schema.Literal<"summary">;
|
|
153
157
|
}>, Schema.Struct<{
|
|
@@ -157,10 +161,7 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
|
|
|
157
161
|
}>, Schema.Struct<{
|
|
158
162
|
readonly type: Schema.Literal<"native">;
|
|
159
163
|
}>]>>, never, never>;
|
|
160
|
-
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
161
164
|
}>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
162
|
-
readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
163
|
-
readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
164
165
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
165
166
|
readonly type: Schema.Literal<"summary">;
|
|
166
167
|
}>, Schema.Struct<{
|
|
@@ -170,7 +171,6 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
|
|
|
170
171
|
}>, Schema.Struct<{
|
|
171
172
|
readonly type: Schema.Literal<"native">;
|
|
172
173
|
}>]>>, never, never>;
|
|
173
|
-
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
174
174
|
}>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>, never, never>;
|
|
175
175
|
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
176
176
|
readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
|
@@ -180,8 +180,6 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
|
|
|
180
180
|
readonly disabled: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
181
181
|
readonly limit: Schema.decodeTo<Schema.optional<Schema.toType<typeof Limit>>, Schema.optionalKey<typeof Limit>, never, never>;
|
|
182
182
|
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
|
|
183
|
-
readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
184
|
-
readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
185
183
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
186
184
|
readonly type: Schema.Literal<"summary">;
|
|
187
185
|
}>, Schema.Struct<{
|
|
@@ -191,10 +189,7 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
|
|
|
191
189
|
}>, Schema.Struct<{
|
|
192
190
|
readonly type: Schema.Literal<"native">;
|
|
193
191
|
}>]>>, never, never>;
|
|
194
|
-
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
195
192
|
}>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
196
|
-
readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
197
|
-
readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
198
193
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
199
194
|
readonly type: Schema.Literal<"summary">;
|
|
200
195
|
}>, Schema.Struct<{
|
|
@@ -204,7 +199,6 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
|
|
|
204
199
|
}>, Schema.Struct<{
|
|
205
200
|
readonly type: Schema.Literal<"native">;
|
|
206
201
|
}>]>>, never, never>;
|
|
207
|
-
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
208
202
|
}>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>, never, never>;
|
|
209
203
|
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
210
204
|
readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
package/dist/config/provider.js
CHANGED
|
@@ -10,12 +10,20 @@ export const Settings = Schema.StructWithRest(Schema.Struct({
|
|
|
10
10
|
compaction: Provider.Compaction.pipe(optional),
|
|
11
11
|
transport: Provider.Transport.pipe(optional),
|
|
12
12
|
}), [Schema.Record(Schema.String, Schema.UndefinedOr(Schema.Json))]).annotate({ identifier: "Config.Provider.Settings" });
|
|
13
|
+
export const ModelSettings = Schema.StructWithRest(Schema.Struct({
|
|
14
|
+
compaction: Provider.Compaction.pipe(optional),
|
|
15
|
+
}), [Schema.Record(Schema.String, Schema.UndefinedOr(Schema.Json))]).annotate({ identifier: "Config.Model.Settings" });
|
|
13
16
|
const JsonRecord = Schema.Record(Schema.String, Schema.Json);
|
|
14
17
|
export const Overlays = {
|
|
15
18
|
settings: Settings.pipe(optional),
|
|
16
19
|
headers: Schema.Record(Schema.String, Schema.String).pipe(optional),
|
|
17
20
|
body: JsonRecord.pipe(optional),
|
|
18
21
|
};
|
|
22
|
+
const ModelOverlays = {
|
|
23
|
+
settings: ModelSettings.pipe(optional),
|
|
24
|
+
headers: Schema.Record(Schema.String, Schema.String).pipe(optional),
|
|
25
|
+
body: JsonRecord.pipe(optional),
|
|
26
|
+
};
|
|
19
27
|
export class Request extends Schema.Class("Config.Provider.Request")({
|
|
20
28
|
headers: Overlays.headers,
|
|
21
29
|
body: Overlays.body,
|
|
@@ -48,11 +56,11 @@ class Model extends Schema.Class("Config.Model")({
|
|
|
48
56
|
name: Schema.String.pipe(optional),
|
|
49
57
|
compatibility: Compatibility.pipe(optional),
|
|
50
58
|
package: Schema.String.pipe(optional),
|
|
51
|
-
...
|
|
59
|
+
...ModelOverlays,
|
|
52
60
|
capabilities: Capabilities.pipe(optional),
|
|
53
61
|
variants: Schema.Struct({
|
|
54
62
|
id: VariantID,
|
|
55
|
-
...
|
|
63
|
+
...ModelOverlays,
|
|
56
64
|
}).pipe(Schema.Array, optional),
|
|
57
65
|
cost: Schema.Union([Cost, Cost.pipe(Schema.Array)]).pipe(optional),
|
|
58
66
|
disabled: Schema.Boolean.pipe(optional),
|
package/dist/model.d.ts
CHANGED
|
@@ -104,6 +104,43 @@ export type ReasoningField = "reasoning" | "reasoning_content" | "reasoning_text
|
|
|
104
104
|
export declare const ReasoningField: Schema.Codec<ReasoningField>;
|
|
105
105
|
export declare const MaxTokensField: Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>;
|
|
106
106
|
export type MaxTokensField = typeof MaxTokensField.Type;
|
|
107
|
+
export declare const Settings: Schema.StructWithRest<Schema.Struct<{
|
|
108
|
+
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
109
|
+
readonly type: Schema.Literal<"summary">;
|
|
110
|
+
}>, Schema.Struct<{
|
|
111
|
+
readonly type: Schema.Literal<"native">;
|
|
112
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
113
|
+
readonly type: Schema.Literal<"summary">;
|
|
114
|
+
}>, Schema.Struct<{
|
|
115
|
+
readonly type: Schema.Literal<"native">;
|
|
116
|
+
}>]>>, never, never>;
|
|
117
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>;
|
|
118
|
+
export type Settings = typeof Settings.Type;
|
|
119
|
+
export declare const Overlays: {
|
|
120
|
+
settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
|
|
121
|
+
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
122
|
+
readonly type: Schema.Literal<"summary">;
|
|
123
|
+
}>, Schema.Struct<{
|
|
124
|
+
readonly type: Schema.Literal<"native">;
|
|
125
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
126
|
+
readonly type: Schema.Literal<"summary">;
|
|
127
|
+
}>, Schema.Struct<{
|
|
128
|
+
readonly type: Schema.Literal<"native">;
|
|
129
|
+
}>]>>, never, never>;
|
|
130
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
131
|
+
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
132
|
+
readonly type: Schema.Literal<"summary">;
|
|
133
|
+
}>, Schema.Struct<{
|
|
134
|
+
readonly type: Schema.Literal<"native">;
|
|
135
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
136
|
+
readonly type: Schema.Literal<"summary">;
|
|
137
|
+
}>, Schema.Struct<{
|
|
138
|
+
readonly type: Schema.Literal<"native">;
|
|
139
|
+
}>]>>, never, never>;
|
|
140
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
|
|
141
|
+
headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
142
|
+
body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
|
143
|
+
};
|
|
107
144
|
export interface Compatibility extends Schema.Schema.Type<typeof Compatibility> {
|
|
108
145
|
}
|
|
109
146
|
export declare const Compatibility: Schema.Struct<{
|
|
@@ -157,8 +194,6 @@ export interface Variant extends Schema.Schema.Type<typeof Variant> {
|
|
|
157
194
|
}
|
|
158
195
|
export declare const Variant: Schema.Struct<{
|
|
159
196
|
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
|
|
160
|
-
readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
161
|
-
readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
162
197
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
163
198
|
readonly type: Schema.Literal<"summary">;
|
|
164
199
|
}>, Schema.Struct<{
|
|
@@ -168,10 +203,7 @@ export declare const Variant: Schema.Struct<{
|
|
|
168
203
|
}>, Schema.Struct<{
|
|
169
204
|
readonly type: Schema.Literal<"native">;
|
|
170
205
|
}>]>>, never, never>;
|
|
171
|
-
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
172
206
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
173
|
-
readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
174
|
-
readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
175
207
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
176
208
|
readonly type: Schema.Literal<"summary">;
|
|
177
209
|
}>, Schema.Struct<{
|
|
@@ -181,7 +213,6 @@ export declare const Variant: Schema.Struct<{
|
|
|
181
213
|
}>, Schema.Struct<{
|
|
182
214
|
readonly type: Schema.Literal<"native">;
|
|
183
215
|
}>]>>, never, never>;
|
|
184
|
-
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
185
216
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
|
|
186
217
|
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
187
218
|
readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
|
@@ -203,8 +234,6 @@ export declare const Info: Schema.Struct<{
|
|
|
203
234
|
};
|
|
204
235
|
readonly variants: Schema.$Array<Schema.Struct<{
|
|
205
236
|
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
|
|
206
|
-
readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
207
|
-
readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
208
237
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
209
238
|
readonly type: Schema.Literal<"summary">;
|
|
210
239
|
}>, Schema.Struct<{
|
|
@@ -214,10 +243,7 @@ export declare const Info: Schema.Struct<{
|
|
|
214
243
|
}>, Schema.Struct<{
|
|
215
244
|
readonly type: Schema.Literal<"native">;
|
|
216
245
|
}>]>>, never, never>;
|
|
217
|
-
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
218
246
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
219
|
-
readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
220
|
-
readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
221
247
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
222
248
|
readonly type: Schema.Literal<"summary">;
|
|
223
249
|
}>, Schema.Struct<{
|
|
@@ -227,7 +253,6 @@ export declare const Info: Schema.Struct<{
|
|
|
227
253
|
}>, Schema.Struct<{
|
|
228
254
|
readonly type: Schema.Literal<"native">;
|
|
229
255
|
}>]>>, never, never>;
|
|
230
|
-
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
231
256
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
|
|
232
257
|
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
233
258
|
readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
|
@@ -267,8 +292,6 @@ export declare const Info: Schema.Struct<{
|
|
|
267
292
|
readonly output: Schema.Int;
|
|
268
293
|
}>;
|
|
269
294
|
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
|
|
270
|
-
readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
271
|
-
readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
272
295
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
273
296
|
readonly type: Schema.Literal<"summary">;
|
|
274
297
|
}>, Schema.Struct<{
|
|
@@ -278,10 +301,7 @@ export declare const Info: Schema.Struct<{
|
|
|
278
301
|
}>, Schema.Struct<{
|
|
279
302
|
readonly type: Schema.Literal<"native">;
|
|
280
303
|
}>]>>, never, never>;
|
|
281
|
-
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
282
304
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
283
|
-
readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
284
|
-
readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
285
305
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
286
306
|
readonly type: Schema.Literal<"summary">;
|
|
287
307
|
}>, Schema.Struct<{
|
|
@@ -291,7 +311,6 @@ export declare const Info: Schema.Struct<{
|
|
|
291
311
|
}>, Schema.Struct<{
|
|
292
312
|
readonly type: Schema.Literal<"native">;
|
|
293
313
|
}>]>>, never, never>;
|
|
294
|
-
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
295
314
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
|
|
296
315
|
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
297
316
|
readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
package/dist/model.js
CHANGED
|
@@ -40,6 +40,16 @@ export const ReasoningField = Schema.Union([
|
|
|
40
40
|
export const MaxTokensField = Schema.Literals(["max_completion_tokens", "max_tokens"]).annotate({
|
|
41
41
|
identifier: "Model.MaxTokensField",
|
|
42
42
|
});
|
|
43
|
+
export const Settings = Schema.StructWithRest(Schema.Struct({
|
|
44
|
+
compaction: Provider.Compaction.pipe(optional),
|
|
45
|
+
}),
|
|
46
|
+
// Provider packages may define arbitrary model-level options beyond OpenCode's shared compaction policy.
|
|
47
|
+
[Schema.Record(Schema.String, Schema.Any)]).annotate({ identifier: "Model.Settings" });
|
|
48
|
+
export const Overlays = {
|
|
49
|
+
settings: Settings.pipe(optional),
|
|
50
|
+
headers: Schema.Record(Schema.String, Schema.String).pipe(optional),
|
|
51
|
+
body: Schema.Record(Schema.String, Schema.Any).pipe(optional),
|
|
52
|
+
};
|
|
43
53
|
export const Compatibility = Schema.Struct({
|
|
44
54
|
reasoningField: ReasoningField.pipe(optional),
|
|
45
55
|
/** Require every assistant message to include its reasoning field, even when empty. */
|
|
@@ -72,7 +82,7 @@ export const Cost = Schema.Struct({
|
|
|
72
82
|
}).annotate({ identifier: "Model.Cost" });
|
|
73
83
|
export const Variant = Schema.Struct({
|
|
74
84
|
id: VariantID,
|
|
75
|
-
...
|
|
85
|
+
...Overlays,
|
|
76
86
|
}).annotate({ identifier: "Model.Variant" });
|
|
77
87
|
export const Info = Schema.Struct({
|
|
78
88
|
id: ID,
|
|
@@ -83,7 +93,7 @@ export const Info = Schema.Struct({
|
|
|
83
93
|
name: Schema.String,
|
|
84
94
|
compatibility: Compatibility.pipe(optional),
|
|
85
95
|
package: Provider.Package.pipe(optional),
|
|
86
|
-
...
|
|
96
|
+
...Overlays,
|
|
87
97
|
capabilities: Capabilities,
|
|
88
98
|
variants: Schema.Array(Variant),
|
|
89
99
|
time: Schema.Struct({
|