/**
 * Project Detector for Intelligent Living Docs Sync
 *
 * Detects which project an increment belongs to using keyword matching and metadata.
 *
 * @module living-docs/project-detector
 */
import { ParsedSpec } from './content-parser.js';
/**
 * Project context with confidence score
 */
export interface ProjectContext {
    id: string;
    name: string;
    confidence: number;
    reasoning: string[];
    metadata?: Record<string, any>;
}
/**
 * Project configuration from config.json
 */
export interface ProjectConfig {
    id: string;
    name: string;
    description?: string;
    keywords?: string[];
    team?: string;
    techStack?: string[];
    specsFolder?: string;
}
/**
 * Detector options
 */
export interface DetectorOptions {
    configPath?: string;
    fallbackProject?: string;
    confidenceThreshold?: number;
}
/**
 * Project Detector class
 */
export declare class ProjectDetector {
    private options;
    private projects;
    constructor(options?: DetectorOptions);
    /**
     * Create and register a default fallback project
     */
    private createFallbackProject;
    /**
     * Detect repository name from git remote
     * Returns repo name (e.g., "specweave" from "anton-abyzov/specweave")
     * or null if not a git repository
     */
    private detectRepoName;
    /**
     * Load projects from config.json
     */
    private loadProjects;
    /**
     * Detect project for an increment
     */
    detectProject(incrementId: string, spec: ParsedSpec): ProjectContext;
    /**
     * Get all configured projects
     */
    getProjects(): ProjectConfig[];
    /**
     * Get project by ID
     */
    getProject(projectId: string): ProjectConfig | null;
    /**
     * Get specs folder path for a project
     */
    getSpecsFolder(projectId: string): string;
    /**
     * Check if confidence meets threshold for auto-selection
     */
    shouldAutoSelect(context: ProjectContext): boolean;
    /**
     * Create project context from string ID (fallback when no detection needed)
     */
    createContext(projectId: string): ProjectContext;
    /**
     * Ensure project specs folder exists
     */
    ensureSpecsFolder(projectId: string): Promise<string>;
    /**
     * Get folder path for a category
     */
    getCategoryFolder(category: string, projectId?: string): string;
    /**
     * Extract project ID from increment ID if present
     * Format: 0016-{project}-feature-name OR 0016-feature-name
     */
    extractProjectFromIncrementId(incrementId: string): string | null;
    /**
     * Validate project structure exists
     */
    validateProjectStructure(projectId: string): Promise<{
        valid: boolean;
        missing: string[];
    }>;
    /**
     * Create project structure if missing
     */
    createProjectStructure(projectId: string): Promise<void>;
    /**
     * Extract project IDs from per-US **Project**: fields in spec content
     *
     * v0.34.1: New method to support per-US project targeting (ADR-0140)
     *
     * @param spec - Parsed spec with user stories
     * @returns Array of unique project IDs found in user stories
     */
    private extractPerUSProjects;
}
/**
 * Factory function to create detector
 */
export declare function createProjectDetector(options?: DetectorOptions): ProjectDetector;
//# sourceMappingURL=project-detector.d.ts.map