feat(core): manage configurable plugin generations
This commit is contained in:
parent
f9d1d3b259
commit
a9b7bd9e2f
83 changed files with 1116 additions and 819 deletions
7
packages/core/test/plugin/fixtures/failing-plugin.ts
Normal file
7
packages/core/test/plugin/fixtures/failing-plugin.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { define } from "@opencode-ai/plugin/v2/effect"
|
||||
import { Effect } from "effect"
|
||||
|
||||
export default define({
|
||||
id: "failing-plugin",
|
||||
effect: () => Effect.die("plugin failed"),
|
||||
})
|
||||
29
packages/core/test/plugin/fixtures/variant-source-plugin.ts
Normal file
29
packages/core/test/plugin/fixtures/variant-source-plugin.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import { define } from "@opencode-ai/plugin/v2/effect"
|
||||
import { Effect } from "effect"
|
||||
|
||||
export default define({
|
||||
id: "variant-source",
|
||||
effect: (ctx) =>
|
||||
ctx.catalog
|
||||
.transform((catalog) => {
|
||||
catalog.provider.update("configured", (provider) => {
|
||||
provider.api = { type: "aisdk", package: "@ai-sdk/openai-compatible" }
|
||||
})
|
||||
catalog.model.update("configured", "glm-5.2", (model) => {
|
||||
model.api = {
|
||||
id: "glm-5.2",
|
||||
type: "aisdk",
|
||||
package: "@ai-sdk/openai-compatible",
|
||||
}
|
||||
model.variants = [
|
||||
{
|
||||
id: "high",
|
||||
settings: {},
|
||||
headers: { custom: "true" },
|
||||
body: {},
|
||||
},
|
||||
]
|
||||
})
|
||||
})
|
||||
.pipe(Effect.asVoid),
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue