/** * Umbrella Repository Detector * * Detects umbrella/multi-repo project structures where: * - Multiple independent git repositories are cloned into subdirectories * - Each child repo should be treated as a module * - Clone job has produced a list of repositories * * Detection strategies (in priority order): * 1. Clone job config - reads repos from .specweave/state/jobs//config.json * 2. Umbrella config - reads from config.json umbrella.childRepos * 3. Git directory scan - finds all .git directories as module boundaries * * @module living-docs/umbrella-detector */ import type { ModuleInfo } from './discovery.js'; /** * Child repository configuration */ export interface ChildRepoConfig { /** Unique identifier (usually repo name) */ id: string; /** Relative path from project root */ path: string; /** Display name */ name: string; /** Team this repo belongs to (from ADO area path) */ team?: string; /** ADO area path (e.g., "Acme\\Inventory") */ areaPath?: string; /** When the repo was cloned */ clonedAt?: string; /** Clone status */ status?: 'cloned' | 'failed' | 'skipped'; } /** * Umbrella configuration (stored in config.json) */ export interface UmbrellaConfig { /** Is umbrella mode enabled */ enabled: boolean; /** Child repositories */ childRepos: ChildRepoConfig[]; /** Source of detection */ detectedFrom?: 'clone-job' | 'config' | 'git-scan'; /** When detection occurred */ detectedAt?: string; } /** * Detection result */ export interface UmbrellaDetectionResult { /** Is this an umbrella project */ isUmbrella: boolean; /** Umbrella configuration (if detected) */ config: UmbrellaConfig | null; /** Converted modules (ready for discovery) */ modules: ModuleInfo[]; /** Detection source */ source: 'clone-job' | 'config' | 'git-scan' | 'none'; /** Detection stats */ stats: { totalRepos: number; clonedRepos: number; failedRepos: number; detectionTimeMs: number; }; } /** * Main entry point: Detect umbrella structure * * Tries detection strategies in order: * 1. Clone job config (most accurate) * 2. Config.json umbrella section * 3. Git directory scanning (fallback) */ export declare function detectUmbrellaStructure(projectPath: string, cloneJobId?: string): Promise; /** * Load umbrella structure from clone job config */ export declare function loadFromCloneJob(projectPath: string, jobId: string): Promise; /** * Load umbrella structure from config.json workspace.repos * * Primary config strategy — reads from the unified workspace format (v3.0). * workspace.repos replaces the legacy umbrella.childRepos section. */ export declare function loadFromWorkspaceConfig(projectPath: string): Promise; /** * Load umbrella structure from config.json (legacy umbrella section) */ export declare function loadFromUmbrellaConfig(projectPath: string): Promise; /** * Scan for child repositories by finding .git directories */ export declare function scanForChildRepos(projectPath: string, maxDepth?: number): Promise; /** * Persist umbrella config to config.json * * CRITICAL FIX (v0.31.x): Merges and deduplicates childRepos by id * Bug: Previous code overwrote entire childRepos array, causing duplicates * when persist is called multiple times (e.g., from different detection sources) */ export declare function persistUmbrellaConfig(projectPath: string, umbrellaConfig: UmbrellaConfig): Promise; //# sourceMappingURL=umbrella-detector.d.ts.map