/** * Smart Source Strategy * * Two-tier approach for including source code in a .bug artifact: * * Tier 1 (Git available): * - git-full: Clean working tree → record commit only (zero files shipped) * - git-patch: Dirty working tree → record commit + diff patch (tiny) * - git-files: Force mode → ship all tracked files * * Tier 2 (No Git): * - full-copy: Ship the entire codebase (excluding heavy dirs like node_modules) * up to a configurable size limit (default 100MB). * If size exceeds the limit → error out, recommend installing git. * * Why not stacktrace extraction? Because the file that appears in the error * is often NOT the file that was changed to cause the bug. Transitive imports, * config files, and build artifacts make guessing unreliable. Ship everything * or use git — no middle ground that loses reproducibility. */ type SourceStrategy = 'git-full' | 'git-patch' | 'git-files' | 'full-copy' | 'exceeded'; export interface SourceStrategyResult { strategy: SourceStrategy; /** Git commit hash (if available) */ commit?: string; /** Git diff patch content (if dirty) */ patch?: string; /** List of relative file paths to include in artifact */ filesToInclude: string[]; /** Total size in bytes of files to include */ totalSize: number; /** Human-readable explanation */ reason: string; /** If true, capture should abort — codebase too large without git */ shouldAbort: boolean; } export interface SourceStrategyOptions { workingDir: string; /** Force include all git files even when commit is available */ forceIncludeFiles?: boolean; /** Max total codebase size to ship without git (bytes). Default 100MB. */ maxCodebaseSize?: number; /** Max individual file size (bytes). Default 2MB. */ maxFileSize?: number; /** Additional exclude patterns */ excludePatterns?: string[]; } /** * Determines the optimal source inclusion strategy. */ export declare function determineSourceStrategy(options: SourceStrategyOptions): SourceStrategyResult; export {}; //# sourceMappingURL=source-strategy.d.ts.map