MCPcopy Create free account
hub / github.com/anomalyco/opencode / parse

Function parse

packages/tui/src/util/model.ts:3–6  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

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

Callers 1

model.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected