/** * Web chat media uploads — same on-disk convention as IM adapters so * agents can Read `[图片附件:…]` / `[文件附件:…]` markers. * * Files land under `~/.agim/media/web//`. */ export declare const WEB_MEDIA_MAX_BYTES: number; export declare function getWebMediaRoot(): string; export interface SavedWebMedia { path: string; bytes: number; mime: string; name: string; kind: 'image' | 'file'; } export declare function saveWebChatMedia(opts: { threadId: string; filename: string; mime: string; body: Buffer; }): Promise; export declare function formatMediaMarker(saved: SavedWebMedia): string; /** * Resolve a media path for GET /api/chat/media/file. * Lexical resolve + realpath (symlink escape) must stay under a media root. * When `threadId` is provided, path must live under `…/web//`. */ export declare function resolveSafeWebMediaPath(requested: string, opts?: { threadId?: string; }): string | null; /** Async variant used when callers already await (tests / future). */ export declare function resolveSafeWebMediaPathAsync(requested: string, opts?: { threadId?: string; }): Promise; /** Guess a Content-Type from filename when the on-disk mime is unknown. * HTML / SVG / XML are never served as their native types — browsers * would execute them as a stored XSS when Content-Disposition is inline. */ export declare function guessMediaContentType(filename: string): string; /** True when the file must not be rendered inline by the browser. */ export declare function isUnsafeInlineMedia(filename: string): boolean; export declare function mediaContentDisposition(filename: string): string; /** Replay headers that block MIME sniffing and script execution. */ export declare const MEDIA_SAFE_HEADERS: Record; //# sourceMappingURL=web-media-upload.d.ts.map