/**
 * Project Context Builder
 *
 * Builds a generic project context summary for AI validation by analyzing
 * common patterns across the codebase. This context helps the AI validator
 * understand the project's security architecture without hardcoding any
 * specific framework or vendor.
 *
 * Key areas analyzed:
 * - Authentication & access control patterns
 * - Data access patterns (ORMs, query builders, raw queries)
 * - Secrets & configuration handling
 * - Framework detection
 */
import type { ScanFile } from '../shared/types';
import { type AuthHelperContext, type AuthHelper } from './auth-helper-detector';
import { type OAuthFlowContext } from './oauth-flow-detector';
import { type TRPCRouterContext } from './trpc-analyzer';
export interface ProjectContext {
    /** Summary string for AI prompt injection */
    summary: string;
    /** Authentication & access control patterns */
    auth: AuthContext;
    /** Data access patterns */
    dataAccess: DataAccessContext;
    /** Secrets & configuration patterns */
    secrets: SecretsContext;
    /** Detected frameworks and libraries */
    frameworks: FrameworkContext;
    /** File structure insights */
    structure: StructureContext;
    /** OAuth flow context */
    oauth: OAuthFlowContext;
    /** tRPC router context */
    trpc: TRPCRouterContext;
}
export interface AuthContext {
    /** Whether global auth middleware is detected */
    hasGlobalMiddleware: boolean;
    /** Type of auth provider (clerk, nextauth, auth0, custom, unknown) */
    authProvider?: string;
    /** Middleware file path */
    middlewareFile?: string;
    /** Protected path patterns */
    protectedPaths: string[];
    /** Public/excluded path patterns */
    publicPaths: string[];
    /** Auth helper functions detected (names only) */
    authHelpers: string[];
    /** Full auth helper context with throwing/return info */
    authHelperContext?: AuthHelperContext;
    /** Throwing auth helpers that guarantee authenticated context */
    throwingAuthHelpers: AuthHelper[];
    /** Whether user scoping is used in queries */
    hasUserScoping: boolean;
    /** User scoping patterns found */
    userScopingPatterns: string[];
}
export interface DataAccessContext {
    /** ORM/query builder detected */
    orm?: 'prisma' | 'drizzle' | 'supabase' | 'mongoose' | 'sequelize' | 'typeorm' | 'knex' | 'raw_sql' | 'unknown';
    /** Whether parameterized queries are the default */
    usesParameterizedQueries: boolean;
    /** Database type if detectable */
    databaseType?: 'postgres' | 'mysql' | 'mongodb' | 'sqlite' | 'unknown';
    /** Whether RLS (Row Level Security) is mentioned */
    hasRLS: boolean;
    /** Data validation library detected */
    validationLibrary?: string;
}
export interface SecretsContext {
    /** Uses environment variables for secrets */
    usesEnvVars: boolean;
    /** Uses a secret manager */
    usesSecretManager: boolean;
    /** Secret manager type if detected */
    secretManagerType?: string;
    /** Has .env files */
    hasEnvFiles: boolean;
    /** Uses NEXT_PUBLIC_ pattern (client-exposed) */
    hasClientExposedEnvVars: boolean;
}
export interface FrameworkContext {
    /** Primary framework */
    primary?: 'nextjs' | 'express' | 'fastify' | 'nestjs' | 'django' | 'flask' | 'rails' | 'unknown';
    /** Frontend framework */
    frontend?: 'react' | 'vue' | 'svelte' | 'angular' | 'unknown';
    /** Is this a monorepo? */
    isMonorepo: boolean;
    /** Uses TypeScript */
    usesTypeScript: boolean;
    /** Uses server components (Next.js 13+) */
    usesServerComponents: boolean;
    /** Uses server actions */
    usesServerActions: boolean;
}
export interface StructureContext {
    /** Has API routes */
    hasApiRoutes: boolean;
    /** Has middleware */
    hasMiddleware: boolean;
    /** Has server actions */
    hasServerActions: boolean;
    /** Total files analyzed */
    totalFiles: number;
    /** File types breakdown */
    fileTypes: Record<string, number>;
}
/**
 * Build a comprehensive project context from scanned files
 * This context is used to inform AI validation decisions
 */
export declare function buildProjectContext(files: ScanFile[]): ProjectContext;
/**
 * Generate a compact context string for a single file validation
 * Used when validating findings in a specific file
 */
export declare function getFileValidationContext(file: ScanFile, projectContext: ProjectContext): string;
//# sourceMappingURL=project-context.d.ts.map