opencode/packages/core/test/plugin/fixtures/variant-source-plugin.ts
Shoubhit Dash e57d9ca390
feat(core): flatten provider config and load native packages (#35563)
Co-authored-by: Dax Raad <d@ironbay.co>
2026-07-06 16:18:56 -04:00

27 lines
824 B
TypeScript

import { define } from "@opencode-ai/plugin/v2/effect"
import { ProviderV2 } from "@opencode-ai/core/provider"
import { Effect } from "effect"
export default define({
id: "variant-source",
effect: (ctx) =>
ctx.catalog
.transform((catalog) => {
catalog.provider.update("configured", (provider) => {
provider.package = ProviderV2.aisdk("@ai-sdk/openai-compatible")
})
catalog.model.update("configured", "glm-5.2", (model) => {
model.modelID = "glm-5.2"
model.package = ProviderV2.aisdk("@ai-sdk/openai-compatible")
model.variants = [
{
id: "high",
settings: {},
headers: { custom: "true" },
body: {},
},
]
})
})
.pipe(Effect.asVoid),
})