/**
 * Shared types for the IDE tab.
 *
 * These mirror the core `FileTreeEntry` / `ReadFileResult` / `FileChangeEvent`
 * shapes returned by `/api/applications/[id]/files*`. Kept local to the
 * component so the web layer never imports from `@shepai/core` directly.
 */
/* ------------------------------------------------------------------ */
/*  Extension helpers                                                  */
/* ------------------------------------------------------------------ */
const IMAGE_EXTENSIONS = new Set([
    'png',
    'jpg',
    'jpeg',
    'gif',
    'webp',
    'avif',
    'bmp',
    'ico',
    'svg',
]);
const MARKDOWN_EXTENSIONS = new Set(['md', 'mdx', 'markdown']);
function extensionOf(filePath) {
    const base = filePath.split('/').pop() ?? filePath;
    const dot = base.lastIndexOf('.');
    if (dot === -1)
        return '';
    return base.slice(dot + 1).toLowerCase();
}
export function isImagePath(filePath) {
    return IMAGE_EXTENSIONS.has(extensionOf(filePath));
}
export function isMarkdownPath(filePath) {
    return MARKDOWN_EXTENSIONS.has(extensionOf(filePath));
}
