/** * Resolves model-supplied outbound attachment bytes for connector delivery. * * `data:` URLs are decoded in-process. Canonical media-store handles * (`/api/media/.`) use the caller's local fetch. http(s) URLs go * through the SSRF-guarded media fetcher. Filesystem paths, `file:` URLs, and * other schemes are rejected without reading the host disk. Connectors must * send the returned bytes and must not pass the original URL to discord.js, * Telegram, or `fs`. */ import type { PinnedLookupFetchLike } from "../network/fetch-guard.js"; import type { LookupFn } from "../network/ssrf.js"; import { type ResolvedAttachmentBytes } from "./attachments.js"; import { type FetchLike } from "./fetch.js"; /** DNS, transport, and size injection for outbound attachment resolution. */ export type ResolveOutboundAttachmentOptions = { maxBytes?: number; timeoutMs?: number; fetchImpl?: FetchLike; lookupFn?: LookupFn; pinnedFetchImpl?: PinnedLookupFetchLike; /** * Authenticated fetch used only for canonical media-store handles. Remote * http(s) URLs never use this seam; they go through the SSRF guard. */ localFetch?: FetchLike; }; /** Host/path preview for logs; never includes a `data:` payload. */ export declare function summarizeOutboundAttachmentUrl(url: string): { scheme: string; host?: string; path?: string; }; /** * Resolve outbound attachment bytes. Never treats the URL as a local filesystem * path and never falls back to an unguarded http(s) fetch. */ export declare function resolveOutboundAttachmentBytes(url: string, opts?: ResolveOutboundAttachmentOptions): Promise;