(value: string)
| 1 | import type { Provider } from "@opencode-ai/sdk/v2" |
| 2 | |
| 3 | export function parse(value: string) { |
| 4 | const [providerID, ...modelID] = value.split("/") |
| 5 | return { providerID, modelID: modelID.join("/") } |
| 6 | } |
| 7 | |
| 8 | export function index(list: Provider[] | undefined) { |
| 9 | return new Map((list ?? []).map((item) => [item.id, item] as const)) |