fix: support mocked model registry in catalog
This commit is contained in:
@@ -33,8 +33,16 @@ export async function loadModelCatalog(params?: {
|
|||||||
await ensureClawdisModelsJson(cfg);
|
await ensureClawdisModelsJson(cfg);
|
||||||
const agentDir = resolveClawdisAgentDir();
|
const agentDir = resolveClawdisAgentDir();
|
||||||
const authStorage = piSdk.discoverAuthStorage(agentDir);
|
const authStorage = piSdk.discoverAuthStorage(agentDir);
|
||||||
const registry = piSdk.discoverModels(authStorage, agentDir);
|
const registry = piSdk.discoverModels(authStorage, agentDir) as
|
||||||
const entries = registry.getAll();
|
| {
|
||||||
|
getAll: () => Array<{
|
||||||
|
id: string;
|
||||||
|
name?: string;
|
||||||
|
provider: string;
|
||||||
|
}>;
|
||||||
|
}
|
||||||
|
| Array<{ id: string; name?: string; provider: string }>;
|
||||||
|
const entries = Array.isArray(registry) ? registry : registry.getAll();
|
||||||
for (const entry of entries) {
|
for (const entry of entries) {
|
||||||
const id = String(entry?.id ?? "").trim();
|
const id = String(entry?.id ?? "").trim();
|
||||||
if (!id) continue;
|
if (!id) continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user