forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanifest.ts
More file actions
20 lines (19 loc) · 682 Bytes
/
Copy pathmanifest.ts
File metadata and controls
20 lines (19 loc) · 682 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { Effect } from "effect"
import { PluginV2 } from "../../plugin"
export const ManifestPlugin = PluginV2.define({
id: PluginV2.ID.make("manifest"),
effect: Effect.gen(function* () {
return {
"catalog.transform": Effect.fn(function* (evt) {
for (const item of evt.provider.list()) {
if (item.provider.id !== "manifest") continue
if (item.provider.api.type !== "aisdk") continue
if (item.provider.api.package !== "@ai-sdk/openai-compatible") continue
evt.provider.update(item.provider.id, (provider) => {
provider.request.headers["X-Source"] = "opencode"
})
}
}),
}
}),
})