/**
 * JIRA/ADO Auto-Detection for Init
 *
 * Analyzes external tool structure and recommends optimal organization.
 * Supports 2-level folder structure: specs/{provider-project}/{board-or-area}/
 *
 * @module cli/helpers/init/jira-ado-auto-detect
 */
import { type JiraBoard } from '../../../../plugins/specweave/lib/integrations/jira/jira-board-resolver.js';
import { type AdoAreaPath } from '../../../../plugins/specweave/lib/integrations/ado/ado-board-resolver.js';
import { type HierarchyMappingConfig } from '../../../core/types/sync-profile.js';
/** Detected team organization pattern */
export type TeamPattern = 'tech-stack' | 'squad-based' | 'domain-based' | 'service-based' | 'feature-based' | 'mixed' | 'unknown';
export interface JiraProjectInfo {
    key: string;
    name: string;
    boards: JiraBoard[];
}
export interface AdoProjectInfo {
    name: string;
    areaPaths: AdoAreaPath[];
}
/** Analysis result with detected patterns */
export interface StructureAnalysis {
    pattern: TeamPattern;
    confidence: 'high' | 'medium' | 'low';
    reasoning: string;
    scrumBoardCount: number;
    kanbanBoardCount: number;
    suggestedMapping: string[];
}
export interface JiraStructure {
    projects: JiraProjectInfo[];
    totalBoards: number;
    recommendedMode: 'simple' | 'by-project' | 'by-board' | 'hybrid';
    analysis: StructureAnalysis;
}
export interface AdoStructure {
    projects: AdoProjectInfo[];
    totalAreaPaths: number;
    recommendedMode: 'simple' | 'by-project' | 'by-area';
    analysis: StructureAnalysis;
}
/**
 * Mapping result for JIRA
 */
export interface JiraMappingResult {
    mode: 'simple' | 'by-project' | 'by-board' | 'hybrid';
    /** Project key → board name → specweave folder */
    mappings: Map<string, Map<string, string>>;
    /** Hierarchy mapping for 3-4-5 level support (v0.33.0+) */
    hierarchyMapping?: HierarchyMappingConfig;
}
/**
 * Mapping result for ADO
 */
export interface AdoMappingResult {
    mode: 'simple' | 'by-project' | 'by-area';
    /** Project name → area path → specweave folder */
    mappings: Map<string, Map<string, string>>;
    /** Hierarchy mapping for 3-4-5 level support (v0.33.0+) */
    hierarchyMapping?: HierarchyMappingConfig;
}
/**
 * Hierarchy preset definitions for JIRA
 *
 * Maps JIRA work item types to SpecWeave hierarchy levels.
 */
export declare const JIRA_HIERARCHY_PRESETS: {
    readonly standard: {
        readonly name: "Standard (3 levels: Epic → Story → Sub-task)";
        readonly description: "Most JIRA projects use this structure";
        readonly config: HierarchyMappingConfig;
    };
    readonly safe: {
        readonly name: "SAFe (4 levels: Initiative → Epic → Story → Sub-task)";
        readonly description: "Scaled Agile Framework with strategic Initiatives";
        readonly config: HierarchyMappingConfig;
    };
    readonly custom: {
        readonly name: "Custom (configure manually)";
        readonly description: "Define your own work item type mappings";
        readonly config: HierarchyMappingConfig | null;
    };
};
/**
 * Hierarchy preset definitions for ADO
 *
 * Maps ADO work item types to SpecWeave hierarchy levels.
 */
export declare const ADO_HIERARCHY_PRESETS: {
    readonly agile: {
        readonly name: "Agile (4 levels: Epic → Feature → User Story → Task)";
        readonly description: "Default ADO Agile process template";
        readonly config: HierarchyMappingConfig;
    };
    readonly scrum: {
        readonly name: "Scrum (3 levels: Epic → Product Backlog Item → Task)";
        readonly description: "ADO Scrum process template";
        readonly config: HierarchyMappingConfig;
    };
    readonly safe: {
        readonly name: "SAFe (5 levels: Capability → Epic → Feature → User Story → Task)";
        readonly description: "Scaled Agile Framework with Capabilities";
        readonly config: HierarchyMappingConfig;
    };
    readonly custom: {
        readonly name: "Custom (configure manually)";
        readonly description: "Define your own work item type mappings";
        readonly config: HierarchyMappingConfig | null;
    };
};
/**
 * Prompt user to select JIRA hierarchy mapping
 *
 * Explains the 3/4/5 level hierarchy options and lets user choose
 * how their JIRA work items map to SpecWeave structure.
 */
export declare function selectJiraHierarchyMapping(): Promise<HierarchyMappingConfig>;
/**
 * Prompt user to select ADO hierarchy mapping
 *
 * Explains the 3/4/5 level hierarchy options and lets user choose
 * how their ADO work items map to SpecWeave structure.
 */
export declare function selectAdoHierarchyMapping(): Promise<HierarchyMappingConfig>;
/**
 * Auto-detect JIRA structure: projects and their boards
 */
export declare function detectJiraStructure(): Promise<JiraStructure | null>;
/**
 * Display JIRA structure and get user confirmation
 */
export declare function confirmJiraMapping(structure: JiraStructure): Promise<JiraMappingResult | null>;
/**
 * Auto-detect ADO structure: projects and their area paths
 */
export declare function detectAdoStructure(organization: string, pat: string): Promise<AdoStructure | null>;
/**
 * Display ADO structure and get user confirmation
 */
export declare function confirmAdoMapping(structure: AdoStructure): Promise<AdoMappingResult | null>;
/**
 * Build JIRA coordinator config from mapping result
 */
export declare function buildJiraCoordinatorConfig(baseConfig: {
    host: string;
    email?: string;
    apiToken?: string;
}, mapping: JiraMappingResult): {
    host: string;
    email?: string;
    apiToken?: string;
    mode: 'simple' | 'by-project' | 'by-board' | 'hybrid';
    projectMappings: Array<{
        projectKey: string;
        boardMappings: Array<{
            boardName: string;
            specweaveFolder: string;
        }>;
    }>;
    hierarchyMapping?: HierarchyMappingConfig;
};
/**
 * Build ADO coordinator config from mapping result
 */
export declare function buildAdoCoordinatorConfig(baseConfig: {
    orgUrl: string;
    project: string;
    pat?: string;
}, mapping: AdoMappingResult): {
    orgUrl: string;
    project: string;
    pat?: string;
    mode: 'simple' | 'by-project' | 'by-area';
    projectMappings: Array<{
        projectName: string;
        areaMappings: Array<{
            areaPath: string;
            specweaveFolder: string;
        }>;
    }>;
    hierarchyMapping?: HierarchyMappingConfig;
};
//# sourceMappingURL=jira-ado-auto-detect.d.ts.map