/**
 * YAML mode path validator implementation.
 *
 * Handles path validation for the flat template structure:
 * - APIs: apis/ApiName/api.yaml
 * - Pages: pages/PageName/index.tsx
 * - App root: App.tsx
 * - Scope file: scope.ts
 */
/**
 * Path validator for YAML mode (flat structure).
 *
 * In YAML mode:
 * - APIs are at apis/ (e.g., apis/MyApi/api.yaml)
 * - Pages are at pages/ (e.g., pages/Home/index.tsx)
 * - App root is App.tsx
 * - Scope files (scope.ts) are protected from direct modification
 */
export class YamlPathValidator {
    apiPrefix = "apis";
    pagesPrefix = "pages";
    appRoot = "App.tsx";
    /**
     * Checks if a path is an API file path.
     * In YAML mode, API files start with "apis/".
     */
    isApiFilePath(filePath) {
        return filePath.startsWith("apis/");
    }
    /**
     * Checks if a path is a direct page path (pages/xyz.tsx rather than pages/xyz/index.tsx).
     * Direct page paths are not allowed - pages must be in subdirectories.
     */
    isDirectPagePath(filePath) {
        return /^pages\/[^/]+\.tsx$/.test(filePath);
    }
    /**
     * Checks if a path is a scope file.
     * Scope files are protected from direct modification.
     */
    isScopeFile(filePath) {
        return filePath === "scope.ts" || filePath.endsWith("/scope.ts");
    }
    /**
     * Get directories that are protected from modification.
     */
    getProtectedDirectories() {
        return [".git", "node_modules", ".superblocks", "pages"];
    }
    /**
     * Check if a path should bypass blacklist checks.
     * In YAML mode, apis/ and pages/ directories have special handling.
     */
    shouldBypassBlacklist(_relativePath, firstDir) {
        // apis directory is allowed for virtual file operations
        if (firstDir === "apis") {
            return true;
        }
        // pages directory - allow files in subdirectories
        // Direct page paths like pages/Foo.tsx will be caught by isDirectPagePath check
        if (firstDir === "pages") {
            return true;
        }
        return false;
    }
}
//# sourceMappingURL=yaml-path-validator.js.map