refactor(packages): extract model-core package

This commit is contained in:
YeonGyu-Kim
2026-05-21 02:11:37 +09:00
parent f7ceb03efe
commit 2748009ff2
60 changed files with 2155 additions and 1834 deletions
+1 -20
View File
@@ -1,20 +1 @@
export function normalizeModelFormat(
model: string | { providerID: string; modelID: string }
): { providerID: string; modelID: string } | undefined {
if (!model) {
return undefined
}
if (typeof model === "object" && "providerID" in model && "modelID" in model) {
return { providerID: model.providerID, modelID: model.modelID }
}
if (typeof model === "string") {
const parts = model.split("/")
if (parts.length >= 2) {
return { providerID: parts[0], modelID: parts.slice(1).join("/") }
}
}
return undefined
}
export { normalizeModelFormat } from "@oh-my-opencode/model-core"