Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
import { retainRemoteFilePreview } from '@/session/remoteMediaDiskCacheExpo';
/** WKWebView cannot load a data URI through its native file-URL loader. */
export async function preparePdfPreviewSource(url: string): Promise<{ uri: string; release(): void }> {
if (!/^(https?:\/\/|file:\/\/)/i.test(url) && !url.startsWith('data:application/pdf;base64,'))
throw new Error('INVALID_PDF_URL');
return retainRemoteFilePreview(url, 'application/pdf', 'preview.pdf');
}