/**
 * File manager for Friday Next channel attachments.
 *
 * Files are copied under the plugin root `attachments/` and served at
 * GET /friday-next/files/{token} so the app can use stable gateway URLs after restarts.
 */
/** Plugin-root `attachments/` directory; created on first use. */
export declare function getAttachmentsDir(): string;
export interface StoredFile {
    id: string;
    /** Path segment for /friday-next/files/{urlToken} (on-disk basename under attachments/). */
    urlToken: string;
    filename: string;
    mimeType: string;
    size: number;
    path: string;
    createdAt: number;
}
/**
 * Read a file from `attachments/` by URL path token (disk basename).
 * Used when the in-memory index was cleared after a gateway restart.
 */
export declare function readAttachmentFileFromDisk(fileToken: string): {
    buffer: Buffer;
    mimeType: string;
    filename: string;
} | null;
/**
 * Copy a local file into `attachments/` and register it (no full-buffer read for the copy path).
 */
/** Expand ~, file://, etc. for paths coming from the agent / message tool. */
export declare function normalizeAgentMediaPath(raw: string): string;
/**
 * Store a file buffer and return its ID and metadata.
 */
export declare function storeFile(buffer: Buffer, filename: string, mimeType: string): StoredFile;
/**
 * Retrieve file metadata by ID or url token.
 */
export declare function getFile(id: string): StoredFile | undefined;
/**
 * Path segment for lookup: raw uuid / urlToken, or token extracted from `/friday-next/files/...`.
 */
export declare function fridayAttachmentLookupKey(ref: string): string;
/**
 * Canonical gateway URL `/friday-next/files/{urlToken}` with extension when stored (for history, MediaUrls).
 */
export declare function fridayFilesPublicUrl(ref: string): string;
export declare function getExternalFileSourceByUrlToken(token: string): string | undefined;
/**
 * Read a file as a Buffer with its MIME type (by id or urlToken).
 */
export declare function readFile(id: string): {
    buffer: Buffer | null;
    mimeType: string;
};
/**
 * Copy a file from a local filesystem path into the Friday Next channel file store
 * and return its /friday-next/files/{token} URL. If the path is already a Friday Next channel
 * file URL (i.e. starts with "/friday-next/files/"), return it as-is.
 */
export declare function resolveMediaUrl(localPath: string): string;
export interface ResolvedAttachment {
    fileName: string;
    url: string;
}
/**
 * Resolve a local path into a Friday-served attachment descriptor.
 * Returns null when source file is missing or cannot be copied.
 */
export declare function resolveMediaAttachment(localPath: string): ResolvedAttachment | null;
/**
 * Guess MIME type from filename extension.
 */
export declare function guessMimeType(filename: string): string;
