import type { DiggerConfig, RepoConfig } from "./config.js"; import { type ScanResult } from "./solutionScanner.js"; export interface RepoReadyResult { /** Absolute path to the repo root on disk. */ sourcePath: string; /** Current HEAD commit hash. */ currentHash: string; /** Which mode was used: "local" (Mode B) or "managed" (Mode A). */ mode: "local" | "managed"; /** Non-fatal warning (e.g. fallback from local to managed). */ warning?: string; /** * Non-fatal per-repo error. Set when the repo fails validation (e.g. not a * .NET C# repository — no `.csproj` found) or when a wildcard repo ends up * with zero matched packages. Tools should surface this text verbatim * instead of (or alongside) rendering the repo's contents. */ error?: string; /** * Classifies `error` so callers can decide whether to fall back to stale * cached content. Only `"source-unavailable"` should trigger stale fallback; * `"validation"` and `"wildcard-empty"` are deterministic config-level * errors where stale data would mislead the user. */ errorKind?: "validation" | "wildcard-empty" | "source-unavailable"; } /** * Ensure a repo is on disk and ready to read. * * - **Mode B (local)**: if `localPath` is set and is a valid git repo, use it read-only. * If `localPath` is set but invalid/missing AND `url` is configured, fall back to Mode A with a warning. * - **Mode A (managed)**: clone into `managedSourcePath` if not already there, then fetch. * * For repos with `discoveryMode === "auto"`, calls `discoverPackages()` after the repo * is on disk and mutates `repoConfig.packages` in place. * * For repos with `discoveryMode === "wildcard"`, intersects on-disk candidates with * workspace-scanned package references filtered by `packageFilter`. If the scan has * not been provided (solo `ensureReady` call), it is performed inline for the * current workspace. */ export declare function ensureReady(repoConfig: RepoConfig, config: DiggerConfig, scanResult?: ScanResult): Promise; /** * Ensure all repos in config are ready. Processes repos sequentially to avoid * concurrent git operations competing for network/disk. * * If any repo has `discoveryMode === "wildcard"`, scans the workspace once * up-front and shares the result across all repos — and writes it to the * cache file so other tools (e.g. `dig_status`) can read it without re-scanning. * * Per-repo failures are captured as `error` on the returned result rather than * thrown, so a single bad repo cannot break downstream tools for the others. */ export declare function ensureAllReady(config: DiggerConfig): Promise>; export declare function extractProjectReferenceNames(csprojContent: string): string[]; /** * Extract Include names from CPM-style `` tags — refs whose * version is centralised in `Directory.Packages.props` (no inline `Version` or * `VersionOverride` attribute). Versioned refs are skipped: they signal a * non-CPM pin, where the sibling depends on the published NuGet rather than * the local source. Supports both `Include="X"` and `Include='X'` quoting. */ export declare function extractCpmPackageReferenceNames(csprojContent: string): string[]; //# sourceMappingURL=repoManager.d.ts.map