Skip to content

Commit 490242f

Browse files
authored
ignore: fix typecheck in dev (anomalyco#20702)
1 parent e7e6119 commit 490242f

6 files changed

Lines changed: 72 additions & 71 deletions

File tree

packages/opencode/src/config/config.ts

Lines changed: 18 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -730,77 +730,28 @@ export namespace Config {
730730
})
731731
export type Layout = z.infer<typeof Layout>
732732

733-
export const Model = z
734-
.object({
735-
id: z.string(),
736-
name: z.string(),
737-
family: z.string().optional(),
738-
release_date: z.string(),
739-
attachment: z.boolean(),
740-
reasoning: z.boolean(),
741-
temperature: z.boolean(),
742-
tool_call: z.boolean(),
743-
interleaved: z
744-
.union([
745-
z.literal(true),
746-
z
747-
.object({
748-
field: z.enum(["reasoning_content", "reasoning_details"]),
749-
})
750-
.strict(),
751-
])
752-
.optional(),
753-
cost: z
754-
.object({
755-
input: z.number(),
756-
output: z.number(),
757-
cache_read: z.number().optional(),
758-
cache_write: z.number().optional(),
759-
context_over_200k: z
760-
.object({
761-
input: z.number(),
762-
output: z.number(),
763-
cache_read: z.number().optional(),
764-
cache_write: z.number().optional(),
765-
})
766-
.optional(),
767-
})
768-
.optional(),
769-
limit: z.object({
770-
context: z.number(),
771-
input: z.number().optional(),
772-
output: z.number(),
773-
}),
774-
modalities: z
775-
.object({
776-
input: z.array(z.enum(["text", "audio", "image", "video", "pdf"])),
777-
output: z.array(z.enum(["text", "audio", "image", "video", "pdf"])),
778-
})
779-
.optional(),
780-
experimental: z.boolean().optional(),
781-
status: z.enum(["alpha", "beta", "deprecated"]).optional(),
782-
options: z.record(z.string(), z.any()),
783-
headers: z.record(z.string(), z.string()).optional(),
784-
provider: z.object({ npm: z.string().optional(), api: z.string().optional() }).optional(),
785-
variants: z
786-
.record(
787-
z.string(),
788-
z
789-
.object({
790-
disabled: z.boolean().optional().describe("Disable this variant for the model"),
791-
})
792-
.catchall(z.any()),
793-
)
794-
.optional()
795-
.describe("Variant-specific configuration"),
796-
})
797-
.partial()
798-
799733
export const Provider = ModelsDev.Provider.partial()
800734
.extend({
801735
whitelist: z.array(z.string()).optional(),
802736
blacklist: z.array(z.string()).optional(),
803-
models: z.record(z.string(), Model).optional(),
737+
models: z
738+
.record(
739+
z.string(),
740+
ModelsDev.Model.partial().extend({
741+
variants: z
742+
.record(
743+
z.string(),
744+
z
745+
.object({
746+
disabled: z.boolean().optional().describe("Disable this variant for the model"),
747+
})
748+
.catchall(z.any()),
749+
)
750+
.optional()
751+
.describe("Variant-specific configuration"),
752+
}),
753+
)
754+
.optional(),
804755
options: z
805756
.object({
806757
apiKey: z.string().optional(),

packages/opencode/src/provider/models.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,12 @@ export namespace ModelsDev {
6161
output: z.array(z.enum(["text", "audio", "image", "video", "pdf"])),
6262
})
6363
.optional(),
64+
experimental: z.boolean().optional(),
6465
status: z.enum(["alpha", "beta", "deprecated"]).optional(),
66+
options: z.record(z.string(), z.any()),
67+
headers: z.record(z.string(), z.string()).optional(),
6568
provider: z.object({ npm: z.string().optional(), api: z.string().optional() }).optional(),
69+
variants: z.record(z.string(), z.record(z.string(), z.any())).optional(),
6670
})
6771
export type Model = z.infer<typeof Model>
6872

packages/opencode/src/provider/provider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -903,8 +903,8 @@ export namespace Provider {
903903
npm: model.provider?.npm ?? provider.npm ?? "@ai-sdk/openai-compatible",
904904
},
905905
status: model.status ?? "active",
906-
headers: {},
907-
options: {},
906+
headers: model.headers ?? {},
907+
options: model.options ?? {},
908908
cost: {
909909
input: model.cost?.input ?? 0,
910910
output: model.cost?.output ?? 0,

packages/opencode/src/session/llm.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Provider } from "@/provider/provider"
22
import { Log } from "@/util/log"
3-
import { Effect, Layer, Record, ServiceMap } from "effect"
3+
import { Cause, Effect, Layer, Record, ServiceMap } from "effect"
4+
import * as Queue from "effect/Queue"
45
import * as Stream from "effect/Stream"
56
import { streamText, wrapLanguageModel, type ModelMessage, type Tool, tool, jsonSchema } from "ai"
67
import { mergeDeep, pipe } from "remeda"

packages/sdk/js/src/v2/gen/types.gen.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4168,11 +4168,23 @@ export type ProviderListResponses = {
41684168
input: Array<"text" | "audio" | "image" | "video" | "pdf">
41694169
output: Array<"text" | "audio" | "image" | "video" | "pdf">
41704170
}
4171+
experimental?: boolean
41714172
status?: "alpha" | "beta" | "deprecated"
4173+
options: {
4174+
[key: string]: unknown
4175+
}
4176+
headers?: {
4177+
[key: string]: string
4178+
}
41724179
provider?: {
41734180
npm?: string
41744181
api?: string
41754182
}
4183+
variants?: {
4184+
[key: string]: {
4185+
[key: string]: unknown
4186+
}
4187+
}
41764188
}
41774189
}
41784190
}>

packages/sdk/openapi.json

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4744,10 +4744,29 @@
47444744
},
47454745
"required": ["input", "output"]
47464746
},
4747+
"experimental": {
4748+
"type": "boolean"
4749+
},
47474750
"status": {
47484751
"type": "string",
47494752
"enum": ["alpha", "beta", "deprecated"]
47504753
},
4754+
"options": {
4755+
"type": "object",
4756+
"propertyNames": {
4757+
"type": "string"
4758+
},
4759+
"additionalProperties": {}
4760+
},
4761+
"headers": {
4762+
"type": "object",
4763+
"propertyNames": {
4764+
"type": "string"
4765+
},
4766+
"additionalProperties": {
4767+
"type": "string"
4768+
}
4769+
},
47514770
"provider": {
47524771
"type": "object",
47534772
"properties": {
@@ -4758,6 +4777,19 @@
47584777
"type": "string"
47594778
}
47604779
}
4780+
},
4781+
"variants": {
4782+
"type": "object",
4783+
"propertyNames": {
4784+
"type": "string"
4785+
},
4786+
"additionalProperties": {
4787+
"type": "object",
4788+
"propertyNames": {
4789+
"type": "string"
4790+
},
4791+
"additionalProperties": {}
4792+
}
47614793
}
47624794
},
47634795
"required": [
@@ -4768,7 +4800,8 @@
47684800
"reasoning",
47694801
"temperature",
47704802
"tool_call",
4771-
"limit"
4803+
"limit",
4804+
"options"
47724805
]
47734806
}
47744807
}

0 commit comments

Comments
 (0)