INNER CODE UNIT · TypeScript

defaultProxyFileResolver

Beever-AI/beever-atlas · bot/src/index.ts:473

function defaultProxyFileResolver(platform: string): ProxyFile | null {
  return _chatManager ? resolveProxyFile(_chatManager, platform) : null;
}

/**
 * Fetch each image attachment's bytes SAFELY (via the connection's bridge
 * `proxyFile` — never the adapter `fetchData`, which lacks an SSRF guard and
 * would leak the bot token), run them through the backend vision pipeline, and
 * return `{ filename, extracted_text, mime_type }` for the /ask attachments
 * field.
 *
 * FAIL-OPEN by design: every step is wrapped per-image; on ANY error (no
 * proxyFile for the platform, proxyFile throw, oversize, missing BRIDGE_API_KEY
 * → 401, timeout, non-2xx) the image is skipped and the others continue. Image
 * processing must NEVER abort the reply. Logs lengths/counts only — never bytes
 * or extracted tokens (they can carry PII).
 */
export async function extractImageAttachments(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…