import { Plugin, Model, Provider } from "@opencode/plugin/effect"; import { fromPromise } from "@opencode/plugin/promise/adapter"; import { Effect } from "effect"; import agents from "../../src/agents/agents.js"; export default Plugin.define({ id: agents.id, effect: (context) => Effect.gen(function* () { const providerID = Provider.ID.make("fixture"); yield* context.provider.transform((editor) => editor.add({ // Copy own fields like the former spread; the editor accepts plain info. info: Object.assign({}, Provider.Info.empty(providerID), { name: "Isolated fixture", activation: "enabled" as const, package: "@opencode/ai/providers/openai-compatible", settings: { baseURL: process.env["FIXTURE_MODEL_URL"] ?? "" }, }), models: ["gpt-6-luna", "gpt-6.1-sol", "gpt-6-astra"].map((id) => Model.Info.default(providerID, Model.ID.make(id)), ), }), ); yield* fromPromise(agents).effect({ ...context, options: { provider: "fixture" } }); }), });