/** * The 2.0 canonical ignore block. Mirrors the same paths * peaks-cli's own .gitignore uses; kept in lockstep manually * (the peaks-cli root .gitignore is the source of truth). * * Sentinel: every emitted line carries the marker comment so * the migration can detect "already-migrated" and stay * idempotent. */ export declare const PEAKS_2_0_BLOCK_SENTINEL = "# peaks-cli 2.0 canonical ignore block \u2014 managed by `peaks upgrade --to 2.0`"; export declare const CANONICAL_2_0_PEAKS_BLOCK: string; /** * Returns true when `line` is a wholesale ignore of the entire * `.peaks/` tree (the 1.x pattern that breaks 2.0 tracking). * * Examples that match: `.peaks` `.peaks/` `/.peaks` `/.peaks/` ` .peaks/ ` * Examples that DON'T: `.peaks/_runtime/` `# .peaks/ comment` `.peaks_other` */ export declare function isStaleWholesalePeaksRule(line: string): boolean; export interface MigrateGitignoreContentResult { /** True if at least one stale wholesale .peaks rule was removed OR the canonical block was appended. */ readonly changed: boolean; /** The exact lines that were removed (verbatim, with original whitespace). */ readonly removedRules: readonly string[]; /** The migrated content (always ends with a newline). */ readonly content: string; } /** * Pure function: takes the .gitignore content, returns the * migrated content + diff summary. No I/O. */ export declare function migrateGitignoreContent(input: string): MigrateGitignoreContentResult; export interface MigrateGitignoreFileInput { readonly projectRoot: string; readonly apply?: boolean; } export interface MigrateGitignoreFileResult { /** True if .gitignore is absent (nothing to migrate). */ readonly missing: boolean; /** True if the migration would change the file. */ readonly changed: boolean; /** True only if `apply: true` AND `changed: true`. */ readonly appliedWrite: boolean; /** Absolute path to the timestamped backup file, or null. */ readonly backupPath: string | null; /** Removed lines (verbatim). */ readonly removedRules: readonly string[]; } /** * FS variant: reads .gitignore, runs migration, optionally * writes the result + a timestamped backup of the original. * * Date.now() is used for the backup suffix; in test environments * where determinism matters, the caller can stub Date via vi. */ export declare function migrateGitignoreFile(input: MigrateGitignoreFileInput): MigrateGitignoreFileResult;