feat(core): migrate native provider config

This commit is contained in:
Shoubhit Dash 2026-06-25 00:17:32 +05:30
commit 62e44a80e7
16 changed files with 358 additions and 99 deletions

View file

@ -11,6 +11,14 @@ export type ID = typeof ID.Type
export const VariantID = Schema.String.pipe(Schema.brand("VariantID"))
export type VariantID = typeof VariantID.Type
export const Package = Schema.Struct({
modelID: ID,
package: Schema.String.pipe(Schema.optional),
aiSDK: Schema.Boolean.pipe(Schema.optional),
...Provider.Overlays,
})
export type Package = typeof Package.Type
export const Ref = Schema.Struct({
id: ID,
providerID: Provider.ID,
@ -68,6 +76,7 @@ export const Info = Schema.Struct({
}),
variants: Schema.Struct({
id: VariantID,
settings: Schema.Record(Schema.String, Schema.Unknown).pipe(Schema.optional),
...ModelRequest.Request.fields,
}).pipe(Schema.Array, Schema.mutable),
time: Schema.Struct({

View file

@ -22,6 +22,19 @@ export const ID = Schema.String.pipe(
)
export type ID = typeof ID.Type
export const Overlays = {
settings: Schema.Record(Schema.String, Schema.Unknown).pipe(Schema.optional),
headers: Schema.Record(Schema.String, Schema.String).pipe(Schema.optional),
body: Schema.Record(Schema.String, Schema.Unknown).pipe(Schema.optional),
}
export const Package = Schema.Struct({
package: Schema.String,
aiSDK: Schema.Boolean.pipe(Schema.optional),
...Overlays,
})
export type Package = typeof Package.Type
export interface AISDK extends Schema.Schema.Type<typeof AISDK> {}
export const AISDK = Schema.Struct({
type: Schema.Literal("aisdk"),
@ -33,6 +46,7 @@ export const AISDK = Schema.Struct({
export interface Native extends Schema.Schema.Type<typeof Native> {}
export const Native = Schema.Struct({
type: Schema.Literal("native"),
package: Schema.String.pipe(Schema.optional),
url: Schema.String.pipe(Schema.optional),
settings: Schema.Record(Schema.String, Schema.Unknown),
})