Drop unused opencode Zod statics (#26935)

This commit is contained in:
Kit Langton
2026-05-11 17:14:18 -04:00
committed by GitHub
parent d3caac5270
commit fd65d29dcc
34 changed files with 161 additions and 389 deletions

View File

@@ -13,7 +13,6 @@ import { Auth } from "../auth"
import { Env } from "../env"
import { InstallationVersion } from "@opencode-ai/core/installation/version"
import { Flag } from "@opencode-ai/core/flag/flag"
import { zod } from "@opencode-ai/core/effect-zod"
import { namedSchemaError } from "@/util/named-schema-error"
import { iife } from "@/util/iife"
import { Global } from "@opencode-ai/core/global"
@@ -24,7 +23,7 @@ import { EffectBridge } from "@/effect/bridge"
import { InstanceState } from "@/effect/instance-state"
import { AppFileSystem } from "@opencode-ai/core/filesystem"
import { isRecord } from "@/util/record"
import { optionalOmitUndefined, withStatics } from "@opencode-ai/core/schema"
import { optionalOmitUndefined } from "@opencode-ai/core/schema"
import * as ProviderTransform from "./transform"
import { ModelID, ProviderID } from "./schema"
@@ -903,9 +902,7 @@ export const Model = Schema.Struct({
headers: Schema.Record(Schema.String, Schema.String),
release_date: Schema.String,
variants: optionalOmitUndefined(Schema.Record(Schema.String, Schema.Record(Schema.String, Schema.Any))),
})
.annotate({ identifier: "Model" })
.pipe(withStatics((s) => ({ zod: zod(s) })))
}).annotate({ identifier: "Model" })
export type Model = Types.DeepMutable<Schema.Schema.Type<typeof Model>>
export const Info = Schema.Struct({
@@ -916,9 +913,7 @@ export const Info = Schema.Struct({
key: optionalOmitUndefined(Schema.String),
options: Schema.Record(Schema.String, Schema.Any),
models: Schema.Record(Schema.String, Model),
})
.annotate({ identifier: "Provider" })
.pipe(withStatics((s) => ({ zod: zod(s) })))
}).annotate({ identifier: "Provider" })
export type Info = Types.DeepMutable<Schema.Schema.Type<typeof Info>>
const DefaultModelIDs = Schema.Record(Schema.String, Schema.String)
@@ -927,13 +922,13 @@ export const ListResult = Schema.Struct({
all: Schema.Array(Info),
default: DefaultModelIDs,
connected: Schema.Array(Schema.String),
}).pipe(withStatics((s) => ({ zod: zod(s) })))
})
export type ListResult = Types.DeepMutable<Schema.Schema.Type<typeof ListResult>>
export const ConfigProvidersResult = Schema.Struct({
providers: Schema.Array(Info),
default: DefaultModelIDs,
}).pipe(withStatics((s) => ({ zod: zod(s) })))
})
export type ConfigProvidersResult = Types.DeepMutable<Schema.Schema.Type<typeof ConfigProvidersResult>>
export function toPublicInfo(provider: Info): Info {