feat(cliproxy): source model pickers from upstream catalogs

- fetch live provider model definitions through /api/cliproxy/catalog

- overlay CCS preset metadata without keeping UI dropdowns as the source of truth

- wire /cliproxy and quick setup to the upstream-backed catalog path
This commit is contained in:
Tam Nhu Tran
2026-04-08 17:23:35 -04:00
parent db8f955a95
commit 7bbf32ae9a
16 changed files with 425 additions and 92 deletions
+8 -8
View File
@@ -1,21 +1,21 @@
import { Router, Request, Response } from 'express';
import { getAllResolvedCatalogs, getCacheAge } from '../../cliproxy/catalog-cache';
import { getResolvedCatalogSnapshot } from '../../cliproxy/catalog-cache';
const router = Router();
/**
* GET /api/cliproxy/catalog - Get merged model catalogs
* Returns resolved catalogs (cached + static merged)
* Returns resolved catalogs with live -> cache -> static fallback ordering.
*/
router.get('/', (_req: Request, res: Response): void => {
router.get('/', async (_req: Request, res: Response): Promise<void> => {
try {
const catalogs = getAllResolvedCatalogs();
const cacheAge = getCacheAge();
const snapshot = await getResolvedCatalogSnapshot();
res.json({
catalogs,
catalogs: snapshot.catalogs,
source: snapshot.source,
cache: {
synced: cacheAge !== null,
age: cacheAge,
synced: snapshot.source !== 'static' || snapshot.cacheAge !== null,
age: snapshot.cacheAge,
},
});
} catch (error) {