pipeline-moe 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/server.ts
CHANGED
|
@@ -665,23 +665,14 @@ async function main(): Promise<void> {
|
|
|
665
665
|
// ── Providers ──────────────────────────────────────────────────────────────
|
|
666
666
|
|
|
667
667
|
// List all known providers with their auth status (no secrets exposed).
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
.map((m) => ({ id: m.id, name: (m as { name?: string }).name ?? m.id }))
|
|
676
|
-
return {
|
|
677
|
-
name,
|
|
678
|
-
displayName: resolved.modelRegistry.getProviderDisplayName(name),
|
|
679
|
-
...authStatus,
|
|
680
|
-
explicitlyEnabled: explicitlyEnabledProviders.has(name),
|
|
681
|
-
models,
|
|
682
|
-
}
|
|
668
|
+
// Uses the same builder as the SSE "providers" broadcast — a REST-only
|
|
669
|
+
// duplicate here once shipped without supportsOAuth, so clients fetching
|
|
670
|
+
// over REST offered an API-key prompt for OAuth-capable providers.
|
|
671
|
+
app.get("/api/providers", async (_req, res) => {
|
|
672
|
+
res.json({
|
|
673
|
+
providers: await getProviderList(resolved, explicitlyEnabledProviders),
|
|
674
|
+
explicitlyEnabled: Array.from(explicitlyEnabledProviders),
|
|
683
675
|
})
|
|
684
|
-
res.json({ providers, explicitlyEnabled: Array.from(explicitlyEnabledProviders) })
|
|
685
676
|
})
|
|
686
677
|
|
|
687
678
|
// Set an API key for a provider (persisted to auth.json).
|