2026-04-17 20:59:24 +00:00
|
|
|
import { Schema } from "effect"
|
2026-04-16 16:40:16 +00:00
|
|
|
import z from "zod"
|
2026-05-11 21:14:18 +00:00
|
|
|
import { ZodOverride } from "@opencode-ai/core/effect-zod"
|
2026-04-16 16:40:16 +00:00
|
|
|
|
2026-04-17 20:59:24 +00:00
|
|
|
// The original Zod schema carried an external $ref pointing at the models.dev
|
|
|
|
|
// JSON schema. That external reference is not a named SDK component — it is a
|
|
|
|
|
// literal pointer to an outside schema — so the walker cannot re-derive it
|
|
|
|
|
// from AST metadata. Preserve the exact original Zod via ZodOverride.
|
|
|
|
|
export const ConfigModelID = Schema.String.annotate({
|
|
|
|
|
[ZodOverride]: z.string().meta({ $ref: "https://models.dev/model-schema.json#/$defs/Model" }),
|
2026-05-11 21:14:18 +00:00
|
|
|
})
|
2026-04-17 20:59:24 +00:00
|
|
|
|
|
|
|
|
export type ConfigModelID = Schema.Schema.Type<typeof ConfigModelID>
|