core: expose v2 model listing API (#25821)
This commit is contained in:
parent
bebe5442a5
commit
8345152319
138 changed files with 8188 additions and 302 deletions
18
packages/core/src/plugin/env.ts
Normal file
18
packages/core/src/plugin/env.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import { Effect } from "effect"
|
||||
import { PluginV2 } from "../plugin"
|
||||
|
||||
export const EnvPlugin = PluginV2.define({
|
||||
id: PluginV2.ID.make("env"),
|
||||
effect: Effect.gen(function* () {
|
||||
return {
|
||||
"provider.update": Effect.fn(function* (evt) {
|
||||
const key = evt.provider.env.find((item) => process.env[item])
|
||||
if (!key) return
|
||||
evt.provider.enabled = {
|
||||
via: "env",
|
||||
name: key,
|
||||
}
|
||||
}),
|
||||
}
|
||||
}),
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue