@opencode/schema 2.0.27 → 2.0.29
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/agent.d.ts +1 -0
- package/dist/config/experimental.js +1 -1
- package/dist/config/provider.d.ts +33 -2
- package/dist/config/provider.js +5 -0
- package/dist/config.d.ts +9 -0
- package/dist/config.js +4 -0
- package/dist/model-compatibility.d.ts +35 -0
- package/dist/model-compatibility.js +26 -0
- package/dist/model.d.ts +13 -25
- package/dist/model.js +3 -20
- package/dist/provider.d.ts +27 -0
- package/dist/provider.js +6 -0
- package/package.json +1 -1
package/dist/agent.d.ts
CHANGED
|
@@ -71,6 +71,7 @@ export declare const Info: Schema.Struct<{
|
|
|
71
71
|
readonly type: Schema.Literal<"native">;
|
|
72
72
|
}>]>>, never, never>;
|
|
73
73
|
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
74
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
74
75
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>;
|
|
75
76
|
readonly headers: Schema.$Record<Schema.String, Schema.String>;
|
|
76
77
|
readonly body: Schema.$Record<Schema.String, Schema.Any>;
|
|
@@ -10,7 +10,7 @@ export class Info extends Schema.Class("ConfigExperimental.Info")({
|
|
|
10
10
|
description: "Maximum subagent nesting depth. Defaults to 1.",
|
|
11
11
|
}),
|
|
12
12
|
policies: ConfigPolicy.Info.pipe(Schema.Array, optional).annotate({
|
|
13
|
-
description: "Ordered policies controlling access to configured resources",
|
|
13
|
+
description: "Deprecated: use top-level policies. Ordered policies controlling access to configured resources",
|
|
14
14
|
}),
|
|
15
15
|
}) {
|
|
16
16
|
}
|
|
@@ -14,6 +14,7 @@ export declare const Settings: Schema.StructWithRest<Schema.Struct<{
|
|
|
14
14
|
readonly type: Schema.Literal<"native">;
|
|
15
15
|
}>]>>, never, never>;
|
|
16
16
|
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
17
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
17
18
|
}>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>;
|
|
18
19
|
export type Settings = typeof Settings.Type;
|
|
19
20
|
export declare const ModelSettings: Schema.StructWithRest<Schema.Struct<{
|
|
@@ -26,6 +27,7 @@ export declare const ModelSettings: Schema.StructWithRest<Schema.Struct<{
|
|
|
26
27
|
}>, Schema.Struct<{
|
|
27
28
|
readonly type: Schema.Literal<"native">;
|
|
28
29
|
}>]>>, never, never>;
|
|
30
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
29
31
|
}>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>;
|
|
30
32
|
export type ModelSettings = typeof ModelSettings.Type;
|
|
31
33
|
export declare const Overlays: {
|
|
@@ -43,6 +45,7 @@ export declare const Overlays: {
|
|
|
43
45
|
readonly type: Schema.Literal<"native">;
|
|
44
46
|
}>]>>, never, never>;
|
|
45
47
|
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
48
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
46
49
|
}>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
47
50
|
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>;
|
|
48
51
|
readonly headerTimeout: 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>;
|
|
@@ -57,6 +60,7 @@ export declare const Overlays: {
|
|
|
57
60
|
readonly type: Schema.Literal<"native">;
|
|
58
61
|
}>]>>, never, never>;
|
|
59
62
|
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
63
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
60
64
|
}>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>, never, never>;
|
|
61
65
|
headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
62
66
|
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>;
|
|
@@ -127,6 +131,7 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
|
|
|
127
131
|
}>, Schema.Struct<{
|
|
128
132
|
readonly type: Schema.Literal<"native">;
|
|
129
133
|
}>]>>, never, never>;
|
|
134
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
130
135
|
}>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
131
136
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
132
137
|
readonly type: Schema.Literal<"summary">;
|
|
@@ -137,6 +142,7 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
|
|
|
137
142
|
}>, Schema.Struct<{
|
|
138
143
|
readonly type: Schema.Literal<"native">;
|
|
139
144
|
}>]>>, never, never>;
|
|
145
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
140
146
|
}>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>, never, never>;
|
|
141
147
|
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
142
148
|
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>;
|
|
@@ -152,6 +158,7 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
|
|
|
152
158
|
}>, Schema.Struct<{
|
|
153
159
|
readonly type: Schema.Literal<"native">;
|
|
154
160
|
}>]>>, never, never>;
|
|
161
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
155
162
|
}>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
156
163
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
157
164
|
readonly type: Schema.Literal<"summary">;
|
|
@@ -162,6 +169,7 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
|
|
|
162
169
|
}>, Schema.Struct<{
|
|
163
170
|
readonly type: Schema.Literal<"native">;
|
|
164
171
|
}>]>>, never, never>;
|
|
172
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
165
173
|
}>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>, never, never>;
|
|
166
174
|
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
167
175
|
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,6 +188,7 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
|
|
|
180
188
|
}>, Schema.Struct<{
|
|
181
189
|
readonly type: Schema.Literal<"native">;
|
|
182
190
|
}>]>>, never, never>;
|
|
191
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
183
192
|
}>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
184
193
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
185
194
|
readonly type: Schema.Literal<"summary">;
|
|
@@ -190,6 +199,7 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
|
|
|
190
199
|
}>, Schema.Struct<{
|
|
191
200
|
readonly type: Schema.Literal<"native">;
|
|
192
201
|
}>]>>, never, never>;
|
|
202
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
193
203
|
}>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>, never, never>;
|
|
194
204
|
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
195
205
|
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>;
|
|
@@ -197,21 +207,23 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
|
|
|
197
207
|
readonly family: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.Family">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.Family">>, never, never>;
|
|
198
208
|
readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
199
209
|
readonly compatibility: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
200
|
-
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<import("../model.js").ReasoningField, import("../model.js").ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<import("../model.js").ReasoningField, import("../model.js").ReasoningField, never, never>>, never, never>;
|
|
210
|
+
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>, never, never>;
|
|
201
211
|
readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
202
212
|
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>;
|
|
203
213
|
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
204
214
|
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
205
215
|
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
216
|
+
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
206
217
|
readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
207
218
|
readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
208
219
|
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
209
|
-
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<import("../model.js").ReasoningField, import("../model.js").ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<import("../model.js").ReasoningField, import("../model.js").ReasoningField, never, never>>, never, never>;
|
|
220
|
+
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>, never, never>;
|
|
210
221
|
readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
211
222
|
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>;
|
|
212
223
|
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
213
224
|
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
214
225
|
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
226
|
+
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
215
227
|
readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
216
228
|
readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
217
229
|
}>>, never, never>;
|
|
@@ -235,6 +247,7 @@ declare const Info_base: Schema.Class<Info, Schema.Struct<{
|
|
|
235
247
|
readonly type: Schema.Literal<"native">;
|
|
236
248
|
}>]>>, never, never>;
|
|
237
249
|
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
250
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
238
251
|
}>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
239
252
|
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>;
|
|
240
253
|
readonly headerTimeout: 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>;
|
|
@@ -249,6 +262,7 @@ declare const Info_base: Schema.Class<Info, Schema.Struct<{
|
|
|
249
262
|
readonly type: Schema.Literal<"native">;
|
|
250
263
|
}>]>>, never, never>;
|
|
251
264
|
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
265
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
252
266
|
}>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>, never, never>;
|
|
253
267
|
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
254
268
|
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>;
|
|
@@ -280,6 +294,23 @@ declare const Info_base: Schema.Class<Info, Schema.Struct<{
|
|
|
280
294
|
readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
281
295
|
readonly env: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
|
|
282
296
|
readonly package: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
297
|
+
readonly compatibility: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
298
|
+
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>, never, never>;
|
|
299
|
+
readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
300
|
+
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>;
|
|
301
|
+
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
302
|
+
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
303
|
+
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
304
|
+
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
305
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
306
|
+
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>, never, never>;
|
|
307
|
+
readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
308
|
+
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>;
|
|
309
|
+
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
310
|
+
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
311
|
+
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
312
|
+
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
313
|
+
}>>, never, never>;
|
|
283
314
|
}>, {}>;
|
|
284
315
|
export declare class Info extends Info_base {
|
|
285
316
|
}
|
package/dist/config/provider.js
CHANGED
|
@@ -2,6 +2,7 @@ export * as ConfigProvider from "./provider.js";
|
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
import { Money } from "../money.js";
|
|
4
4
|
import { Capabilities, Compatibility, Family, ID, VariantID } from "../model.js";
|
|
5
|
+
import { ProviderCompatibility } from "../model-compatibility.js";
|
|
5
6
|
import { Provider } from "../provider.js";
|
|
6
7
|
import { optional } from "../schema.js";
|
|
7
8
|
export const Settings = Schema.StructWithRest(Schema.Struct({
|
|
@@ -10,9 +11,11 @@ export const Settings = Schema.StructWithRest(Schema.Struct({
|
|
|
10
11
|
chunkTimeout: Schema.Union([Schema.Finite, Schema.Literal(false)]).pipe(optional),
|
|
11
12
|
compaction: Provider.Compaction.pipe(optional),
|
|
12
13
|
transport: Provider.Transport.pipe(optional),
|
|
14
|
+
encoding: Provider.Encoding.pipe(optional),
|
|
13
15
|
}), [Schema.Record(Schema.String, Schema.UndefinedOr(Schema.Json))]).annotate({ identifier: "Config.Provider.Settings" });
|
|
14
16
|
export const ModelSettings = Schema.StructWithRest(Schema.Struct({
|
|
15
17
|
compaction: Provider.Compaction.pipe(optional),
|
|
18
|
+
encoding: Provider.Encoding.pipe(optional),
|
|
16
19
|
}), [Schema.Record(Schema.String, Schema.UndefinedOr(Schema.Json))]).annotate({ identifier: "Config.Model.Settings" });
|
|
17
20
|
const JsonRecord = Schema.Record(Schema.String, Schema.Json);
|
|
18
21
|
export const Overlays = {
|
|
@@ -80,6 +83,8 @@ export class Info extends Schema.Class("Config.Provider")({
|
|
|
80
83
|
name: Schema.String.pipe(optional),
|
|
81
84
|
env: Schema.String.pipe(Schema.Array, optional),
|
|
82
85
|
package: Schema.String.pipe(optional),
|
|
86
|
+
// Defaults for every model of this provider; model compatibility overrides individual fields.
|
|
87
|
+
compatibility: ProviderCompatibility.pipe(optional),
|
|
83
88
|
...Overlays,
|
|
84
89
|
models: Schema.Record(Schema.String, Model).pipe(optional),
|
|
85
90
|
}) {
|
package/dist/config.d.ts
CHANGED
|
@@ -53,6 +53,15 @@ declare const Info_base: Schema.Class<Info, Schema.Struct<{
|
|
|
53
53
|
readonly resource: Schema.String;
|
|
54
54
|
readonly effect: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
55
55
|
}>>>, never, never>;
|
|
56
|
+
readonly policies: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
|
|
57
|
+
readonly action: Schema.Literals<readonly ["provider.use", "tool.use", "integration.use"]>;
|
|
58
|
+
readonly resource: Schema.String;
|
|
59
|
+
readonly effect: Schema.Literals<readonly ["allow", "deny"]>;
|
|
60
|
+
}>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
61
|
+
readonly action: Schema.Literals<readonly ["provider.use", "tool.use", "integration.use"]>;
|
|
62
|
+
readonly resource: Schema.String;
|
|
63
|
+
readonly effect: Schema.Literals<readonly ["allow", "deny"]>;
|
|
64
|
+
}>>>, never, never>;
|
|
56
65
|
readonly agents: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, typeof ConfigAgent.Info>>>, Schema.optionalKey<Schema.$Record<Schema.String, typeof ConfigAgent.Info>>, never, never>;
|
|
57
66
|
readonly snapshots: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
58
67
|
readonly watcher: Schema.decodeTo<Schema.optional<Schema.toType<typeof ConfigWatcher.Info>>, Schema.optionalKey<typeof ConfigWatcher.Info>, never, never>;
|
package/dist/config.js
CHANGED
|
@@ -13,6 +13,7 @@ import { ConfigLSP } from "./config/lsp.js";
|
|
|
13
13
|
import { ConfigMCP } from "./config/mcp.js";
|
|
14
14
|
import { ConfigModel } from "./config/model.js";
|
|
15
15
|
import { ConfigPlugin } from "./config/plugin.js";
|
|
16
|
+
import { ConfigPolicy } from "./config/policy.js";
|
|
16
17
|
import { ConfigProvider } from "./config/provider.js";
|
|
17
18
|
import { ConfigReference } from "./config/reference.js";
|
|
18
19
|
import { ConfigWebSearch } from "./config/websearch.js";
|
|
@@ -52,6 +53,9 @@ export class Info extends Schema.Class("Config.Info")({
|
|
|
52
53
|
permissions: Permission.Ruleset.pipe(optional).annotate({
|
|
53
54
|
description: "Ordered tool permission rules applied to agent tool use",
|
|
54
55
|
}),
|
|
56
|
+
policies: ConfigPolicy.Info.pipe(Schema.Array, optional).annotate({
|
|
57
|
+
description: "Ordered policies controlling access to providers, tools, and integrations",
|
|
58
|
+
}),
|
|
55
59
|
agents: Schema.Record(Schema.String, ConfigAgent.Info).pipe(optional).annotate({
|
|
56
60
|
description: "Named built-in agent overrides and custom agent definitions",
|
|
57
61
|
}),
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export type ReasoningField = "reasoning" | "reasoning_content" | "reasoning_text" | (string & {});
|
|
3
|
+
export declare const ReasoningField: Schema.Codec<ReasoningField>;
|
|
4
|
+
export declare const MaxTokensField: Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>;
|
|
5
|
+
export type MaxTokensField = typeof MaxTokensField.Type;
|
|
6
|
+
export declare const CacheFormat: Schema.Literals<readonly ["anthropic", "alibaba"]>;
|
|
7
|
+
export type CacheFormat = typeof CacheFormat.Type;
|
|
8
|
+
export interface Compatibility extends Schema.Schema.Type<typeof Compatibility> {
|
|
9
|
+
}
|
|
10
|
+
export declare const Compatibility: Schema.Struct<{
|
|
11
|
+
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. */
|
|
13
|
+
readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
14
|
+
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>;
|
|
15
|
+
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
16
|
+
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
17
|
+
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
18
|
+
/** Prompt-cache marker syntax the endpoint accepts. Overrides the route default; both send `cache_control`, and `alibaba` skips tool definitions. */
|
|
19
|
+
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
20
|
+
/** Supports Anthropic's thinking-prefix mismatch controls. Overrides model-ID detection. */
|
|
21
|
+
readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
22
|
+
/** Supports per-message effort updates. Overrides model-ID detection. */
|
|
23
|
+
readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
24
|
+
}>;
|
|
25
|
+
export interface ProviderCompatibility extends Schema.Schema.Type<typeof ProviderCompatibility> {
|
|
26
|
+
}
|
|
27
|
+
export declare const ProviderCompatibility: Schema.Struct<{
|
|
28
|
+
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<ReasoningField, ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<ReasoningField, ReasoningField, never, never>>, never, never>;
|
|
29
|
+
readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
30
|
+
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>;
|
|
31
|
+
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
32
|
+
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
33
|
+
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
34
|
+
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
35
|
+
}>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Schema, Struct } from "effect";
|
|
2
|
+
import { optional } from "./schema.js";
|
|
3
|
+
export const ReasoningField = Schema.Union([
|
|
4
|
+
Schema.Literals(["reasoning", "reasoning_content", "reasoning_text"]),
|
|
5
|
+
Schema.String,
|
|
6
|
+
]).annotate({ identifier: "Model.ReasoningField" });
|
|
7
|
+
export const MaxTokensField = Schema.Literals(["max_completion_tokens", "max_tokens"]).annotate({
|
|
8
|
+
identifier: "Model.MaxTokensField",
|
|
9
|
+
});
|
|
10
|
+
export const CacheFormat = Schema.Literals(["anthropic", "alibaba"]).annotate({ identifier: "Model.CacheFormat" });
|
|
11
|
+
export const Compatibility = Schema.Struct({
|
|
12
|
+
reasoningField: ReasoningField.pipe(optional),
|
|
13
|
+
/** Require every assistant message to include its reasoning field, even when empty. */
|
|
14
|
+
requireReasoning: Schema.Boolean.pipe(optional),
|
|
15
|
+
maxTokensField: MaxTokensField.pipe(optional),
|
|
16
|
+
requireFinishReason: Schema.Boolean.pipe(optional),
|
|
17
|
+
requireAssistantAfterTool: Schema.Boolean.pipe(optional),
|
|
18
|
+
supportsPromptCacheKey: Schema.Boolean.pipe(optional),
|
|
19
|
+
/** Prompt-cache marker syntax the endpoint accepts. Overrides the route default; both send `cache_control`, and `alibaba` skips tool definitions. */
|
|
20
|
+
cacheFormat: CacheFormat.pipe(optional),
|
|
21
|
+
/** Supports Anthropic's thinking-prefix mismatch controls. Overrides model-ID detection. */
|
|
22
|
+
supportsThinkingBlockBinding: Schema.Boolean.pipe(optional),
|
|
23
|
+
/** Supports per-message effort updates. Overrides model-ID detection. */
|
|
24
|
+
supportsEffortUpdates: Schema.Boolean.pipe(optional),
|
|
25
|
+
}).annotate({ identifier: "Model.Compatibility" });
|
|
26
|
+
export const ProviderCompatibility = Schema.Struct(Struct.omit(Compatibility.fields, ["supportsThinkingBlockBinding", "supportsEffortUpdates"])).annotate({ identifier: "Provider.Compatibility" });
|
package/dist/model.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * as Model from "./model.js";
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
import { Provider } from "./provider.js";
|
|
4
|
+
import { Compatibility, MaxTokensField, ReasoningField } from "./model-compatibility.js";
|
|
4
5
|
export declare const ID: Schema.brand<Schema.String, "Model.ID">;
|
|
5
6
|
export type ID = typeof ID.Type;
|
|
6
7
|
export declare const Event: {
|
|
@@ -98,12 +99,9 @@ export declare const Ref: Schema.Struct<{
|
|
|
98
99
|
};
|
|
99
100
|
export interface Ref extends Schema.Schema.Type<typeof Ref> {
|
|
100
101
|
}
|
|
102
|
+
export { Compatibility, MaxTokensField, ReasoningField };
|
|
101
103
|
export declare const Family: Schema.brand<Schema.String, "Model.Family">;
|
|
102
104
|
export type Family = typeof Family.Type;
|
|
103
|
-
export type ReasoningField = "reasoning" | "reasoning_content" | "reasoning_text" | (string & {});
|
|
104
|
-
export declare const ReasoningField: Schema.Codec<ReasoningField>;
|
|
105
|
-
export declare const MaxTokensField: Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>;
|
|
106
|
-
export type MaxTokensField = typeof MaxTokensField.Type;
|
|
107
105
|
export declare const Settings: Schema.StructWithRest<Schema.Struct<{
|
|
108
106
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
109
107
|
readonly type: Schema.Literal<"summary">;
|
|
@@ -114,6 +112,7 @@ export declare const Settings: Schema.StructWithRest<Schema.Struct<{
|
|
|
114
112
|
}>, Schema.Struct<{
|
|
115
113
|
readonly type: Schema.Literal<"native">;
|
|
116
114
|
}>]>>, never, never>;
|
|
115
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
117
116
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>;
|
|
118
117
|
export type Settings = typeof Settings.Type;
|
|
119
118
|
export declare const Overlays: {
|
|
@@ -127,6 +126,7 @@ export declare const Overlays: {
|
|
|
127
126
|
}>, Schema.Struct<{
|
|
128
127
|
readonly type: Schema.Literal<"native">;
|
|
129
128
|
}>]>>, never, never>;
|
|
129
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
130
130
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
131
131
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
132
132
|
readonly type: Schema.Literal<"summary">;
|
|
@@ -137,25 +137,11 @@ export declare const Overlays: {
|
|
|
137
137
|
}>, Schema.Struct<{
|
|
138
138
|
readonly type: Schema.Literal<"native">;
|
|
139
139
|
}>]>>, never, never>;
|
|
140
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
140
141
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
|
|
141
142
|
headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
142
143
|
body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
|
143
144
|
};
|
|
144
|
-
export interface Compatibility extends Schema.Schema.Type<typeof Compatibility> {
|
|
145
|
-
}
|
|
146
|
-
export declare const Compatibility: Schema.Struct<{
|
|
147
|
-
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<ReasoningField, ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<ReasoningField, ReasoningField, never, never>>, never, never>;
|
|
148
|
-
/** Require every assistant message to include its reasoning field, even when empty. */
|
|
149
|
-
readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
150
|
-
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>;
|
|
151
|
-
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
152
|
-
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
153
|
-
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
154
|
-
/** Supports Anthropic's thinking-prefix mismatch controls. Overrides model-ID detection. */
|
|
155
|
-
readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
156
|
-
/** Supports per-message effort updates. Overrides model-ID detection. */
|
|
157
|
-
readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
158
|
-
}>;
|
|
159
145
|
export interface Capabilities extends Schema.Schema.Type<typeof Capabilities> {
|
|
160
146
|
}
|
|
161
147
|
export declare const Capabilities: Schema.Struct<{
|
|
@@ -207,6 +193,7 @@ export declare const Variant: Schema.Struct<{
|
|
|
207
193
|
}>, Schema.Struct<{
|
|
208
194
|
readonly type: Schema.Literal<"native">;
|
|
209
195
|
}>]>>, never, never>;
|
|
196
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
210
197
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
211
198
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
212
199
|
readonly type: Schema.Literal<"summary">;
|
|
@@ -217,6 +204,7 @@ export declare const Variant: Schema.Struct<{
|
|
|
217
204
|
}>, Schema.Struct<{
|
|
218
205
|
readonly type: Schema.Literal<"native">;
|
|
219
206
|
}>]>>, never, never>;
|
|
207
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
220
208
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
|
|
221
209
|
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
222
210
|
readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
|
@@ -247,6 +235,7 @@ export declare const Info: Schema.Struct<{
|
|
|
247
235
|
}>, Schema.Struct<{
|
|
248
236
|
readonly type: Schema.Literal<"native">;
|
|
249
237
|
}>]>>, never, never>;
|
|
238
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
250
239
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
251
240
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
252
241
|
readonly type: Schema.Literal<"summary">;
|
|
@@ -257,6 +246,7 @@ export declare const Info: Schema.Struct<{
|
|
|
257
246
|
}>, Schema.Struct<{
|
|
258
247
|
readonly type: Schema.Literal<"native">;
|
|
259
248
|
}>]>>, never, never>;
|
|
249
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
260
250
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
|
|
261
251
|
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
262
252
|
readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
|
@@ -305,6 +295,7 @@ export declare const Info: Schema.Struct<{
|
|
|
305
295
|
}>, Schema.Struct<{
|
|
306
296
|
readonly type: Schema.Literal<"native">;
|
|
307
297
|
}>]>>, never, never>;
|
|
298
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
308
299
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
309
300
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
310
301
|
readonly type: Schema.Literal<"summary">;
|
|
@@ -315,6 +306,7 @@ export declare const Info: Schema.Struct<{
|
|
|
315
306
|
}>, Schema.Struct<{
|
|
316
307
|
readonly type: Schema.Literal<"native">;
|
|
317
308
|
}>]>>, never, never>;
|
|
309
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
318
310
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
|
|
319
311
|
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
320
312
|
readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
|
@@ -362,27 +354,23 @@ export declare const Info: Schema.Struct<{
|
|
|
362
354
|
readonly name: Schema.String;
|
|
363
355
|
readonly compatibility: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
364
356
|
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<ReasoningField, ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<ReasoningField, ReasoningField, never, never>>, never, never>;
|
|
365
|
-
/** Require every assistant message to include its reasoning field, even when empty. */
|
|
366
357
|
readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
367
358
|
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>;
|
|
368
359
|
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
369
360
|
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
370
361
|
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
371
|
-
|
|
362
|
+
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
372
363
|
readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
373
|
-
/** Supports per-message effort updates. Overrides model-ID detection. */
|
|
374
364
|
readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
375
365
|
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
376
366
|
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<ReasoningField, ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<ReasoningField, ReasoningField, never, never>>, never, never>;
|
|
377
|
-
/** Require every assistant message to include its reasoning field, even when empty. */
|
|
378
367
|
readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
379
368
|
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>;
|
|
380
369
|
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
381
370
|
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
382
371
|
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
383
|
-
|
|
372
|
+
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
384
373
|
readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
385
|
-
/** Supports per-message effort updates. Overrides model-ID detection. */
|
|
386
374
|
readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
387
375
|
}>>, never, never>;
|
|
388
376
|
readonly package: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
package/dist/model.js
CHANGED
|
@@ -2,6 +2,7 @@ export * as Model from "./model.js";
|
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
import { optional, statics } from "./schema.js";
|
|
4
4
|
import { Provider } from "./provider.js";
|
|
5
|
+
import { Compatibility, MaxTokensField, ReasoningField } from "./model-compatibility.js";
|
|
5
6
|
import { Money } from "./money.js";
|
|
6
7
|
import { ephemeral, inventory } from "./event.js";
|
|
7
8
|
export const ID = Schema.String.pipe(Schema.brand("Model.ID"));
|
|
@@ -32,16 +33,11 @@ export const Ref = Schema.Struct({
|
|
|
32
33
|
});
|
|
33
34
|
},
|
|
34
35
|
})));
|
|
36
|
+
export { Compatibility, MaxTokensField, ReasoningField };
|
|
35
37
|
export const Family = Schema.String.pipe(Schema.brand("Model.Family"));
|
|
36
|
-
export const ReasoningField = Schema.Union([
|
|
37
|
-
Schema.Literals(["reasoning", "reasoning_content", "reasoning_text"]),
|
|
38
|
-
Schema.String,
|
|
39
|
-
]).annotate({ identifier: "Model.ReasoningField" });
|
|
40
|
-
export const MaxTokensField = Schema.Literals(["max_completion_tokens", "max_tokens"]).annotate({
|
|
41
|
-
identifier: "Model.MaxTokensField",
|
|
42
|
-
});
|
|
43
38
|
export const Settings = Schema.StructWithRest(Schema.Struct({
|
|
44
39
|
compaction: Provider.Compaction.pipe(optional),
|
|
40
|
+
encoding: Provider.Encoding.pipe(optional),
|
|
45
41
|
}),
|
|
46
42
|
// Provider packages may define arbitrary model-level options beyond OpenCode's shared compaction policy.
|
|
47
43
|
[Schema.Record(Schema.String, Schema.Any)]).annotate({ identifier: "Model.Settings" });
|
|
@@ -50,19 +46,6 @@ export const Overlays = {
|
|
|
50
46
|
headers: Schema.Record(Schema.String, Schema.String).pipe(optional),
|
|
51
47
|
body: Schema.Record(Schema.String, Schema.Any).pipe(optional),
|
|
52
48
|
};
|
|
53
|
-
export const Compatibility = Schema.Struct({
|
|
54
|
-
reasoningField: ReasoningField.pipe(optional),
|
|
55
|
-
/** Require every assistant message to include its reasoning field, even when empty. */
|
|
56
|
-
requireReasoning: Schema.Boolean.pipe(optional),
|
|
57
|
-
maxTokensField: MaxTokensField.pipe(optional),
|
|
58
|
-
requireFinishReason: Schema.Boolean.pipe(optional),
|
|
59
|
-
requireAssistantAfterTool: Schema.Boolean.pipe(optional),
|
|
60
|
-
supportsPromptCacheKey: Schema.Boolean.pipe(optional),
|
|
61
|
-
/** Supports Anthropic's thinking-prefix mismatch controls. Overrides model-ID detection. */
|
|
62
|
-
supportsThinkingBlockBinding: Schema.Boolean.pipe(optional),
|
|
63
|
-
/** Supports per-message effort updates. Overrides model-ID detection. */
|
|
64
|
-
supportsEffortUpdates: Schema.Boolean.pipe(optional),
|
|
65
|
-
}).annotate({ identifier: "Model.Compatibility" });
|
|
66
49
|
export const Capabilities = Schema.Struct({
|
|
67
50
|
tools: Schema.Boolean,
|
|
68
51
|
input: Schema.Array(Schema.String),
|
package/dist/provider.d.ts
CHANGED
|
@@ -95,6 +95,9 @@ export type Compaction = typeof Compaction.Type;
|
|
|
95
95
|
/** "websocket" on a route without a WebSocket channel warns and falls back to HTTP. */
|
|
96
96
|
export declare const Transport: Schema.Literals<readonly ["http", "websocket"]>;
|
|
97
97
|
export type Transport = typeof Transport.Type;
|
|
98
|
+
/** HTTP request body compression; only endpoints known to decode it should enable it. */
|
|
99
|
+
export declare const Encoding: Schema.Literals<readonly ["zstd", "gzip", "none"]>;
|
|
100
|
+
export type Encoding = typeof Encoding.Type;
|
|
98
101
|
export declare const Settings: Schema.StructWithRest<Schema.Struct<{
|
|
99
102
|
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>;
|
|
100
103
|
readonly headerTimeout: 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>;
|
|
@@ -109,6 +112,7 @@ export declare const Settings: Schema.StructWithRest<Schema.Struct<{
|
|
|
109
112
|
readonly type: Schema.Literal<"native">;
|
|
110
113
|
}>]>>, never, never>;
|
|
111
114
|
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
115
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
112
116
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>;
|
|
113
117
|
export type Settings = typeof Settings.Type;
|
|
114
118
|
export declare const Overlays: {
|
|
@@ -126,6 +130,7 @@ export declare const Overlays: {
|
|
|
126
130
|
readonly type: Schema.Literal<"native">;
|
|
127
131
|
}>]>>, never, never>;
|
|
128
132
|
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
133
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
129
134
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
130
135
|
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>;
|
|
131
136
|
readonly headerTimeout: 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>;
|
|
@@ -140,6 +145,7 @@ export declare const Overlays: {
|
|
|
140
145
|
readonly type: Schema.Literal<"native">;
|
|
141
146
|
}>]>>, never, never>;
|
|
142
147
|
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
148
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
143
149
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
|
|
144
150
|
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
|
body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
|
@@ -161,6 +167,7 @@ export declare const Request: Schema.Struct<{
|
|
|
161
167
|
readonly type: Schema.Literal<"native">;
|
|
162
168
|
}>]>>, never, never>;
|
|
163
169
|
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
170
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
164
171
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>;
|
|
165
172
|
readonly headers: Schema.$Record<Schema.String, Schema.String>;
|
|
166
173
|
readonly body: Schema.$Record<Schema.String, Schema.Any>;
|
|
@@ -182,6 +189,7 @@ export declare const Info: Schema.Struct<{
|
|
|
182
189
|
readonly type: Schema.Literal<"native">;
|
|
183
190
|
}>]>>, never, never>;
|
|
184
191
|
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
192
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
185
193
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
186
194
|
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>;
|
|
187
195
|
readonly headerTimeout: 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>;
|
|
@@ -196,6 +204,7 @@ export declare const Info: Schema.Struct<{
|
|
|
196
204
|
readonly type: Schema.Literal<"native">;
|
|
197
205
|
}>]>>, never, never>;
|
|
198
206
|
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
207
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
199
208
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
|
|
200
209
|
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
201
210
|
readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
|
@@ -241,6 +250,24 @@ export declare const Info: Schema.Struct<{
|
|
|
241
250
|
readonly name: Schema.String;
|
|
242
251
|
readonly activation: Schema.Literals<readonly ["auto", "enabled", "disabled"]>;
|
|
243
252
|
readonly package: Schema.String;
|
|
253
|
+
/** Inherited by every model of this provider; model compatibility overrides individual fields. */
|
|
254
|
+
readonly compatibility: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
255
|
+
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<import("./model-compatibility.js").ReasoningField, import("./model-compatibility.js").ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<import("./model-compatibility.js").ReasoningField, import("./model-compatibility.js").ReasoningField, never, never>>, never, never>;
|
|
256
|
+
readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
257
|
+
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>;
|
|
258
|
+
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
259
|
+
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
260
|
+
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
261
|
+
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
262
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
263
|
+
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<import("./model-compatibility.js").ReasoningField, import("./model-compatibility.js").ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<import("./model-compatibility.js").ReasoningField, import("./model-compatibility.js").ReasoningField, never, never>>, never, never>;
|
|
264
|
+
readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
265
|
+
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>;
|
|
266
|
+
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
267
|
+
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
268
|
+
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
269
|
+
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
270
|
+
}>>, never, never>;
|
|
244
271
|
}> & {
|
|
245
272
|
empty: (id: ID) => Info;
|
|
246
273
|
};
|
package/dist/provider.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * as Provider from "./provider.js";
|
|
2
2
|
import { Effect, Schema } from "effect";
|
|
3
3
|
import { Integration } from "./integration.js";
|
|
4
|
+
import { ProviderCompatibility } from "./model-compatibility.js";
|
|
4
5
|
import { optional, statics } from "./schema.js";
|
|
5
6
|
import { ephemeral, inventory } from "./event.js";
|
|
6
7
|
export const ID = Schema.String.pipe(Schema.brand("Provider.ID"), Schema.annotate({ identifier: "Provider.ID" }), statics((schema) => ({
|
|
@@ -28,12 +29,15 @@ export const Compaction = Schema.Union([
|
|
|
28
29
|
.annotate({ identifier: "Provider.Compaction" });
|
|
29
30
|
/** "websocket" on a route without a WebSocket channel warns and falls back to HTTP. */
|
|
30
31
|
export const Transport = Schema.Literals(["http", "websocket"]).annotate({ identifier: "Provider.Transport" });
|
|
32
|
+
/** HTTP request body compression; only endpoints known to decode it should enable it. */
|
|
33
|
+
export const Encoding = Schema.Literals(["zstd", "gzip", "none"]).annotate({ identifier: "Provider.Encoding" });
|
|
31
34
|
export const Settings = Schema.StructWithRest(Schema.Struct({
|
|
32
35
|
timeout: Schema.Union([Schema.Finite, Schema.Literal(false)]).pipe(optional),
|
|
33
36
|
headerTimeout: Schema.Union([Schema.Finite, Schema.Literal(false)]).pipe(optional),
|
|
34
37
|
chunkTimeout: Schema.Union([Schema.Finite, Schema.Literal(false)]).pipe(optional),
|
|
35
38
|
compaction: Compaction.pipe(optional),
|
|
36
39
|
transport: Transport.pipe(optional),
|
|
40
|
+
encoding: Encoding.pipe(optional),
|
|
37
41
|
}), [Schema.Record(Schema.String, Schema.Any)]).annotate({ identifier: "Provider.Settings" });
|
|
38
42
|
export const Overlays = {
|
|
39
43
|
settings: Settings.pipe(optional),
|
|
@@ -52,6 +56,8 @@ export const Info = Schema.Struct({
|
|
|
52
56
|
name: Schema.String,
|
|
53
57
|
activation: Activation,
|
|
54
58
|
package: Package,
|
|
59
|
+
/** Inherited by every model of this provider; model compatibility overrides individual fields. */
|
|
60
|
+
compatibility: ProviderCompatibility.pipe(optional),
|
|
55
61
|
...Overlays,
|
|
56
62
|
})
|
|
57
63
|
.annotate({ identifier: "Provider.Info" })
|