MCPcopy Create free account
hub / github.com/dwgx/WindsurfAPI / fetchAndMergeModelCatalog

Function fetchAndMergeModelCatalog

src/auth.js:371–388  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

369// ─── Dynamic model catalog from cloud ─────────────────────
370
371async function fetchAndMergeModelCatalog() {
372 // Use the first active account to fetch the catalog.
373 const acct = accounts.find(a => a.status === 'active' && a.apiKey);
374 if (!acct) {
375 log.debug('No active account for model catalog fetch');
376 return;
377 }
378 try {
379 const { getCascadeModelConfigs } = await import('./windsurf-api.js');
380 const { mergeCloudModels } = await import('./models.js');
381 const proxy = getEffectiveProxy(acct.id) || null;
382 const { configs } = await getCascadeModelConfigs(acct.apiKey, proxy);
383 const added = mergeCloudModels(configs);
384 log.info(`Model catalog: ${configs.length} cloud models, ${added} new entries merged`);
385 } catch (e) {
386 log.warn(`Model catalog fetch failed: ${e.message}`);
387 }
388}
389
390async function registerWithCodeium(idToken) {
391 const { WindsurfClient } = await import('./client.js');

Callers 1

initAuthFunction · 0.85

Calls 3

getEffectiveProxyFunction · 0.90
getCascadeModelConfigsFunction · 0.85
mergeCloudModelsFunction · 0.85

Tested by

no test coverage detected