@opencode/schema 2.0.30 → 2.0.32
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 +72 -0
- package/dist/config/provider.js +18 -0
- package/dist/model.d.ts +4 -0
- package/dist/model.js +2 -0
- package/package.json +2 -1
|
@@ -110,15 +110,86 @@ declare const Limit_base: Schema.Class<Limit, Schema.Struct<{
|
|
|
110
110
|
}>, {}>;
|
|
111
111
|
declare class Limit extends Limit_base {
|
|
112
112
|
}
|
|
113
|
+
export declare const Reasoning: Schema.Union<readonly [Schema.Struct<{
|
|
114
|
+
readonly supported: Schema.Literal<false>;
|
|
115
|
+
}>, Schema.Struct<{
|
|
116
|
+
readonly supported: Schema.Literal<true>;
|
|
117
|
+
readonly toggle: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
118
|
+
readonly effort: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
|
|
119
|
+
readonly budget: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
120
|
+
readonly min: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
121
|
+
readonly max: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
122
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
123
|
+
readonly min: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
124
|
+
readonly max: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
125
|
+
}>>, never, never>;
|
|
126
|
+
}>]>;
|
|
127
|
+
export type Reasoning = typeof Reasoning.Type;
|
|
113
128
|
declare const Model_base: Schema.Class<Model, Schema.Struct<{
|
|
114
129
|
readonly capabilities: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
115
130
|
readonly tools: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
116
131
|
readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
|
|
117
132
|
readonly output: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
|
|
133
|
+
readonly temperature: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
134
|
+
readonly reasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
135
|
+
readonly supported: Schema.Literal<false>;
|
|
136
|
+
}>, Schema.Struct<{
|
|
137
|
+
readonly supported: Schema.Literal<true>;
|
|
138
|
+
readonly toggle: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
139
|
+
readonly effort: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
|
|
140
|
+
readonly budget: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
141
|
+
readonly min: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
142
|
+
readonly max: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
143
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
144
|
+
readonly min: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
145
|
+
readonly max: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
146
|
+
}>>, never, never>;
|
|
147
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
148
|
+
readonly supported: Schema.Literal<false>;
|
|
149
|
+
}>, Schema.Struct<{
|
|
150
|
+
readonly supported: Schema.Literal<true>;
|
|
151
|
+
readonly toggle: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
152
|
+
readonly effort: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
|
|
153
|
+
readonly budget: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
154
|
+
readonly min: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
155
|
+
readonly max: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
156
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
157
|
+
readonly min: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
158
|
+
readonly max: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
159
|
+
}>>, never, never>;
|
|
160
|
+
}>]>>, never, never>;
|
|
118
161
|
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
119
162
|
readonly tools: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
120
163
|
readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
|
|
121
164
|
readonly output: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
|
|
165
|
+
readonly temperature: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
166
|
+
readonly reasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
167
|
+
readonly supported: Schema.Literal<false>;
|
|
168
|
+
}>, Schema.Struct<{
|
|
169
|
+
readonly supported: Schema.Literal<true>;
|
|
170
|
+
readonly toggle: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
171
|
+
readonly effort: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
|
|
172
|
+
readonly budget: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
173
|
+
readonly min: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
174
|
+
readonly max: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
175
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
176
|
+
readonly min: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
177
|
+
readonly max: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
178
|
+
}>>, never, never>;
|
|
179
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
180
|
+
readonly supported: Schema.Literal<false>;
|
|
181
|
+
}>, Schema.Struct<{
|
|
182
|
+
readonly supported: Schema.Literal<true>;
|
|
183
|
+
readonly toggle: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
184
|
+
readonly effort: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
|
|
185
|
+
readonly budget: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
186
|
+
readonly min: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
187
|
+
readonly max: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
188
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
189
|
+
readonly min: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
190
|
+
readonly max: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
191
|
+
}>>, never, never>;
|
|
192
|
+
}>]>>, never, never>;
|
|
122
193
|
}>>, never, never>;
|
|
123
194
|
readonly variants: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
|
|
124
195
|
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
|
|
@@ -206,6 +277,7 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
|
|
|
206
277
|
readonly modelID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.ID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.ID">>, never, never>;
|
|
207
278
|
readonly family: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.Family">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.Family">>, never, never>;
|
|
208
279
|
readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
280
|
+
readonly releaseDate: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
209
281
|
readonly compatibility: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
210
282
|
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>;
|
|
211
283
|
readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
package/dist/config/provider.js
CHANGED
|
@@ -54,10 +54,26 @@ class Limit extends Schema.Class("Config.Model.Limit")({
|
|
|
54
54
|
output: Schema.Int.pipe(optional),
|
|
55
55
|
}) {
|
|
56
56
|
}
|
|
57
|
+
// models.dev v2's `capabilities.reasoning`. OpenCode builds the model's variants from it; no control means none.
|
|
58
|
+
export const Reasoning = Schema.Union([
|
|
59
|
+
Schema.Struct({ supported: Schema.Literal(false) }),
|
|
60
|
+
Schema.Struct({
|
|
61
|
+
supported: Schema.Literal(true),
|
|
62
|
+
toggle: Schema.Boolean.pipe(optional),
|
|
63
|
+
effort: Schema.String.pipe(Schema.Array, optional),
|
|
64
|
+
budget: Schema.Struct({
|
|
65
|
+
min: Schema.Int.pipe(optional),
|
|
66
|
+
max: Schema.Int.pipe(optional),
|
|
67
|
+
}).pipe(optional),
|
|
68
|
+
}),
|
|
69
|
+
]).annotate({ identifier: "Config.Model.Reasoning" });
|
|
57
70
|
class Model extends Schema.Class("Config.Model")({
|
|
58
71
|
modelID: ID.pipe(optional),
|
|
59
72
|
family: Family.pipe(optional),
|
|
60
73
|
name: Schema.String.pipe(optional),
|
|
74
|
+
releaseDate: Schema.String.check(Schema.isPattern(/^\d{4}-\d{2}(-\d{2})?$/u))
|
|
75
|
+
.annotate({ description: "Release date as YYYY-MM-DD or YYYY-MM" })
|
|
76
|
+
.pipe(optional),
|
|
61
77
|
compatibility: Compatibility.pipe(optional),
|
|
62
78
|
package: Schema.String.pipe(optional),
|
|
63
79
|
...ModelOverlays,
|
|
@@ -66,6 +82,8 @@ class Model extends Schema.Class("Config.Model")({
|
|
|
66
82
|
tools: optional(fields.tools),
|
|
67
83
|
input: optional(fields.input),
|
|
68
84
|
output: optional(fields.output),
|
|
85
|
+
temperature: fields.temperature,
|
|
86
|
+
reasoning: Reasoning.pipe(optional),
|
|
69
87
|
}))
|
|
70
88
|
.annotate({ identifier: "Config.Model.Capabilities" })
|
|
71
89
|
.pipe(optional),
|
package/dist/model.d.ts
CHANGED
|
@@ -148,6 +148,8 @@ export declare const Capabilities: Schema.Struct<{
|
|
|
148
148
|
readonly tools: Schema.Boolean;
|
|
149
149
|
readonly input: Schema.$Array<Schema.String>;
|
|
150
150
|
readonly output: Schema.$Array<Schema.String>;
|
|
151
|
+
/** Whether the model accepts a sampling temperature. Unknown when unset. */
|
|
152
|
+
readonly temperature: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
151
153
|
}> & {
|
|
152
154
|
default: () => {
|
|
153
155
|
tools: true;
|
|
@@ -217,6 +219,8 @@ export declare const Info: Schema.Struct<{
|
|
|
217
219
|
readonly tools: Schema.Boolean;
|
|
218
220
|
readonly input: Schema.$Array<Schema.String>;
|
|
219
221
|
readonly output: Schema.$Array<Schema.String>;
|
|
222
|
+
/** Whether the model accepts a sampling temperature. Unknown when unset. */
|
|
223
|
+
readonly temperature: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
220
224
|
}> & {
|
|
221
225
|
default: () => {
|
|
222
226
|
tools: true;
|
package/dist/model.js
CHANGED
|
@@ -50,6 +50,8 @@ export const Capabilities = Schema.Struct({
|
|
|
50
50
|
tools: Schema.Boolean,
|
|
51
51
|
input: Schema.Array(Schema.String),
|
|
52
52
|
output: Schema.Array(Schema.String),
|
|
53
|
+
/** Whether the model accepts a sampling temperature. Unknown when unset. */
|
|
54
|
+
temperature: Schema.Boolean.pipe(optional),
|
|
53
55
|
})
|
|
54
56
|
.annotate({ identifier: "Model.Capabilities" })
|
|
55
57
|
.pipe(statics(() => ({
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode/schema",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.32",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"build": "bun run script/build.ts",
|
|
30
|
+
"test": "bun test --only-failures",
|
|
30
31
|
"typecheck": "tsgo --noEmit"
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|