feat(plugin): add v2 effect host (#33111)
This commit is contained in:
parent
7a9337da8a
commit
c780d7cee7
139 changed files with 3740 additions and 1943 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { EOL } from "os"
|
||||
import { Effect, Option } from "effect"
|
||||
import { Effect } from "effect"
|
||||
import { Catalog } from "@opencode-ai/core/catalog"
|
||||
import { LocationServiceMap } from "@opencode-ai/core/location-layer"
|
||||
import { Location } from "@opencode-ai/core/location"
|
||||
|
|
@ -19,15 +19,13 @@ export const V2Command = effectCmd({
|
|||
const all = (yield* catalog.provider.all()).sort((a, b) => a.id.localeCompare(b.id))
|
||||
const result = {
|
||||
providers,
|
||||
default: catalog.model
|
||||
.default()
|
||||
.pipe(Effect.map(Option.map((item) => item.id)), Effect.map(Option.getOrUndefined)),
|
||||
default: catalog.model.default().pipe(Effect.map((item) => item?.id)),
|
||||
small: Object.fromEntries(
|
||||
yield* Effect.all(
|
||||
all.map((provider) =>
|
||||
Effect.map(
|
||||
catalog.model.small(provider.id),
|
||||
(model) => [provider.id, Option.getOrUndefined(Option.map(model, (item) => item.id))] as const,
|
||||
(model) => [provider.id, model?.id] as const,
|
||||
),
|
||||
),
|
||||
{ concurrency: "unbounded" },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue