refactor(open-sse): registry consolidation + DRY media/oauth/adhoc cleanup
- Single-source registry: oauth clientId/tokenUrl, usage URLs, image/embed configs, search defaultModel, codex fixedPort, google token url derive. - Remove 29 unused OmniRoute providers (registry 100→71); media intact. - De-adhoc: codex literals → registry format/oauth flags; reasoningInject, image/embed openrouter headers + xai bodyFields config-driven. - Add REGISTRY_TEMPLATE.js + expand PROVIDER_DEFAULTS/schema JSDoc. - Baselines updated; PROVIDERS 62 + alias 90 byte-for-byte, golden snapshots. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
9105dd0e25
commit
bb9e9aa91f
166 files changed
+3089
-3067
No files matched your search
@@ -3,6 +3,15 @@ export function encodeDataUri(mimeType, base64) {
|
||||
return `data:${mimeType};base64,${base64}`;
|
||||
}
|
||||
|
||||
// Parse a base64 data URI → { mimeType, base64 }, or null if not a data URI.
|
||||
// [\s\S] tolerates newlines inside the base64 payload.
|
||||
const DATA_URI_RE = /^data:([^;]+);base64,([\s\S]+)$/;
|
||||
export function parseDataUri(url) {
|
||||
if (typeof url !== "string") return null;
|
||||
const m = url.match(DATA_URI_RE);
|
||||
return m ? { mimeType: m[1], base64: m[2] } : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a remote image URL and return it as a base64 data URI.
|
||||
* Used when upstream providers (Codex, etc.) require inline base64 images
|
||||
|
||||
Reference in new issue
Block a user