/**
 * SDK mode path validator implementation.
 *
 * Handles path validation for the nested template structure:
 * - APIs: server/apis/ApiName/api.ts
 * - Pages: client/pages/PageName/index.tsx
 * - App root: client/App.tsx
 * - No scope files in SDK mode
 */
/**
 * Path validator for SDK mode (nested structure).
 *
 * In SDK mode:
 * - APIs are at server/apis/ (e.g., server/apis/MyApi/api.ts)
 * - Pages are at client/pages/ (e.g., client/pages/Home/index.tsx)
 * - App root is client/App.tsx
 * - Scope files do not exist in SDK mode
 */
export class SdkPathValidator {
    apiPrefix = "server/apis";
    pagesPrefix = "client/pages";
    appRoot = "client/App.tsx";
    /**
     * Checks if a path is an API file path.
     * In SDK mode, API files start with "server/apis/".
     */
    isApiFilePath(_filePath) {
        // In SDK mode, API files are regular TypeScript files written via build_writeFile.
        // There is no dedicated writeApi tool, so we don't block writes to server/apis/.
        return false;
    }
    /**
     * Checks if a path is a direct page path (client/pages/xyz.tsx rather than client/pages/xyz/index.tsx).
     * Direct page paths are not allowed - pages must be in subdirectories.
     */
    isDirectPagePath(filePath) {
        return /^client\/pages\/[^/]+\.tsx$/.test(filePath);
    }
    /**
     * Checks if a path is a scope file.
     * SDK mode does not use scope files, so this always returns false.
     */
    isScopeFile(_filePath) {
        return false;
    }
    /**
     * Get directories that are protected from modification.
     * In SDK mode, pages are under client/pages, not at root level.
     */
    getProtectedDirectories() {
        return [".git", "node_modules", ".superblocks"];
    }
    /**
     * Check if a path should bypass blacklist checks.
     * In SDK mode, server/apis/ and client/pages/ directories have special handling.
     */
    shouldBypassBlacklist(relativePath, _firstDir) {
        // server/apis/ directory is allowed for API file operations
        if (relativePath.startsWith("server/apis/")) {
            return true;
        }
        // client/pages/ directory - allow files in subdirectories
        // Direct page paths like client/pages/Foo.tsx will be caught by isDirectPagePath check
        if (relativePath.startsWith("client/pages/")) {
            return true;
        }
        return false;
    }
}
//# sourceMappingURL=sdk-path-validator.js.map