import { extname } from "path";
/**
 * List of binary document file extensions that should not be read as text
 */
export const BINARY_DOCUMENT_EXTENSIONS = [
    ".pdf",
    ".doc",
    ".docx",
    ".xls",
    ".xlsx",
    ".ppt",
    ".pptx",
    ".odt",
    ".ods",
    ".odp",
    ".rtf",
];
/**
 * Check if a file is a binary document format based on its extension
 * @param filePath - The path to the file
 * @returns true if the file is a binary document format, false otherwise
 */
export function isBinaryDocument(filePath) {
    const fileExtension = extname(filePath).toLowerCase();
    return BINARY_DOCUMENT_EXTENSIONS.includes(fileExtension);
}
/**
 * Get a human-readable error message for unsupported binary document formats
 * @param filePath - The path to the file
 * @returns Error message string
 */
export function getBinaryDocumentError(filePath) {
    const fileExtension = extname(filePath).toLowerCase();
    return `Reading binary document files with extension '${fileExtension}' is not supported. Supported formats include text files, code files, images, and Jupyter notebooks.`;
}
