/** * v0.8.3 §3 — Pre-flight inspection for `solosquad add repo`. * * Detects five risk scenarios that can corrupt a move (or surface broken * paths post-move) — surfaces them in --dry-run / --inspect output so the * user can decide whether to proceed. * * 1. Active processes holding files (lsof / handle.exe) * 2. Symlinks pointing INTO this repo from elsewhere * 3. Repo-internal absolute-path references (configs, docs) to original * 4. Slug collision in the target org * 5. IDE workspace files with absolute-path settings * * Each detector is best-effort: a missing tool (lsof not installed, * handle.exe absent) returns `available: false` rather than throwing. * dry-run never fails on inspection alone — risks are reported as * warnings, the user keeps control. */ export interface FileSizeStats { fileCount: number; totalBytes: number; gitBytes: number; } export interface IdeWorkspaceFinding { path: string; hasAbsolutePathSetting: boolean; } export interface LsofFinding { available: boolean; /** PIDs holding files; empty array if none, undefined if probe failed. */ pids?: number[]; /** Why detection was skipped (tool missing, permission, …). */ note?: string; } export interface InspectionReport { source: string; fileStats: FileSizeStats; ide: IdeWorkspaceFinding[]; symlinksIntoRepo: string[]; internalAbsolutePathHits: string[]; slugCollision: boolean; collisionWith?: string; activeProcesses: LsofFinding; /** Whichever risks are nonzero — for fast "any risk?" check. */ hasAnyRisk: boolean; } export interface InspectOpts { /** The org's repositories/ dir — used to detect slug collisions. */ reposDir?: string; /** Slug to test for collision (defaults to basename). */ slug?: string; /** * Cap on per-file scans for the absolute-path grep — prevents the * inspector from chewing through a multi-gig repo when ripgrep is absent. */ maxFilesToGrep?: number; } export declare function inspectRepo(source: string, opts?: InspectOpts): InspectionReport; export declare function humanBytes(n: number): string; /** * Render the inspection report as a human-readable block for --dry-run / * --inspect output. The exact format is consumed by tests, so don't * change cosmetic strings without updating add-repo-dry-run.test.ts. */ export declare function formatInspectionReport(report: InspectionReport, opts?: { destination?: string; addedFile?: string; }): string;