/**
 * Sync Profile Types for Multi-Project External Integration
 *
 * Supports multiple projects per provider (GitHub, JIRA, ADO, etc.)
 * with time range filtering and rate limiting protection.
 */
import { SyncSettings } from './sync-settings.js';
export type SyncProvider = 'github' | 'jira' | 'ado';
/**
 * Sync Strategy (v0.13.0+ - Simplified Two-Tier Architecture)
 *
 * Determines how work is organized and synced:
 * - intelligent: Auto-maps user stories to projects based on content analysis (default, 90% of users)
 *                Supports single project (backward compatible) OR multiple projects (auto-classify)
 * - custom: Raw query (JQL/GraphQL/WIQL) for power users (advanced, 10% of users)
 *
 * REMOVED in v0.13.0:
 * - filtered: Too complex (containers, sub-organizations, filters) → Use intelligent instead
 * - simple: Now an alias for 'intelligent' (backward compatibility)
 */
export type SyncStrategy = 'intelligent' | 'custom';
/**
 * Legacy sync strategy (backward compatibility)
 * 'simple' maps to 'intelligent' automatically
 */
export type LegacySyncStrategy = 'simple' | 'intelligent' | 'custom';
/**
 * SpecWeave hierarchy levels for mapping external work items
 *
 * Universal hierarchy (flexible depth):
 * - epic: Top-level strategic container (EP-XXXE) → _epics/ (OPTIONAL)
 * - feature: Feature-level container (FS-XXXE) → FS-XXX/
 * - user_story: Individual user story (us-xxxe.md) - FIXED
 * - task: Task within user story (checkbox in US description) - FIXED
 * - skip: Don't import this work item type
 */
export type SpecWeaveHierarchyLevel = 'epic' | 'feature' | 'user_story' | 'task' | 'skip';
/**
 * Flexible Hierarchy Mapping Configuration (v0.30.6+)
 *
 * UNIVERSAL mapping that works with ANY external tool (ADO/JIRA/GitHub)
 * and ANY hierarchy depth (3/4/5 levels).
 *
 * **Core Principle:**
 * - User Story and Task are FIXED (always the same mapping)
 * - Container levels (Epic/Feature) are FLEXIBLE (configurable per project)
 *
 * **How it works:**
 * 1. `epicLevelTypes` - Types that become TOP containers (_epics/EP-*)
 * 2. `featureLevelTypes` - Types that become FEATURE containers (FS-*)
 * 3. User Story types → us-*.md files (automatic/defaults)
 * 4. Task types → checkboxes in parent US (automatic/defaults)
 *
 * @example ADO Scrum (3 levels: Epic → PBI → Task):
 * ```json
 * {
 *   "epicLevelTypes": [],
 *   "featureLevelTypes": ["Epic"]
 * }
 * ```
 *
 * @example ADO Agile (4 levels: Epic → Feature → US → Task):
 * ```json
 * {
 *   "epicLevelTypes": [],
 *   "featureLevelTypes": ["Epic", "Feature"]
 * }
 * ```
 *
 * @example ADO SAFe (5 levels: Capability → Epic → Feature → US → Task):
 * ```json
 * {
 *   "epicLevelTypes": ["Capability"],
 *   "featureLevelTypes": ["Epic", "Feature"]
 * }
 * ```
 *
 * @example JIRA Standard (3 levels: Epic → Story → Sub-task):
 * ```json
 * {
 *   "epicLevelTypes": [],
 *   "featureLevelTypes": ["Epic"]
 * }
 * ```
 *
 * @example JIRA SAFe (4 levels: Initiative → Epic → Story → Sub-task):
 * ```json
 * {
 *   "epicLevelTypes": ["Initiative"],
 *   "featureLevelTypes": ["Epic"]
 * }
 * ```
 */
export interface HierarchyMappingConfig {
    /**
     * Types that map to SpecWeave EPIC level (_epics/EP-*)
     *
     * These are TOP-LEVEL strategic containers.
     * Leave empty for 3-4 level hierarchies without a strategic layer.
     *
     * Examples:
     * - ADO SAFe: ["Capability"]
     * - JIRA SAFe: ["Initiative"]
     * - Standard projects: [] (no epic level)
     */
    epicLevelTypes: string[];
    /**
     * Types that map to SpecWeave FEATURE level (FS-*)
     *
     * These are feature-level containers that hold user stories.
     * Required - every project needs at least one feature-level type.
     *
     * Examples:
     * - ADO Agile: ["Epic", "Feature"]
     * - ADO Scrum: ["Epic"]
     * - JIRA: ["Epic"]
     */
    featureLevelTypes: string[];
    /**
     * Types that map to SpecWeave USER STORY level (us-*.md)
     *
     * Optional - uses sensible defaults if not provided.
     * Defaults: ["User Story", "Story", "Product Backlog Item", "Requirement", "Bug", "Issue"]
     */
    userStoryTypes?: string[];
    /**
     * Types that map to SpecWeave TASK level (checkboxes in US)
     *
     * Optional - uses sensible defaults if not provided.
     * Defaults: ["Task", "Sub-task"]
     */
    taskTypes?: string[];
}
/**
 * Default User Story types (FIXED across all tools)
 *
 * NOTE: Includes both space-separated ('User Story') and hyphenated ('user-story')
 * forms to handle different external tool conventions and internal type naming.
 */
export declare const DEFAULT_USER_STORY_TYPES: string[];
/**
 * Default Task types (FIXED across all tools)
 */
export declare const DEFAULT_TASK_TYPES: string[];
/**
 * Default ADO hierarchy mapping (Agile - 4 levels)
 *
 * ADO Agile: Epic → Feature → User Story → Task
 * Maps to: feature → feature → user_story → task
 *
 * NOTE: Epic becomes feature (not epic) because most ADO projects
 * don't have a strategic layer above Epic.
 */
export declare const DEFAULT_ADO_HIERARCHY_MAPPING: HierarchyMappingConfig;
/**
 * ADO SAFe hierarchy mapping (5 levels)
 *
 * SAFe: Capability → Epic → Feature → User Story → Task
 * Maps to: epic → feature → feature → user_story → task
 */
export declare const ADO_SAFE_HIERARCHY_MAPPING: HierarchyMappingConfig;
/**
 * ADO Scrum hierarchy mapping (3 levels)
 *
 * Scrum: Epic → Product Backlog Item → Task
 * Maps to: feature → user_story → task
 */
export declare const ADO_SCRUM_HIERARCHY_MAPPING: HierarchyMappingConfig;
/**
 * Default JIRA hierarchy mapping (3 levels)
 *
 * JIRA: Epic/Feature → Story → Sub-task
 * Maps to: feature → user_story → task
 *
 * CRITICAL (v0.35.3): Include 'Feature' to support custom JIRA types
 * Many organizations use custom types like "L3 Feature", "Team Feature", etc.
 * Both "Epic" and "Feature" types should create FS-XXX folders (feature-level)
 */
export declare const DEFAULT_JIRA_HIERARCHY_MAPPING: HierarchyMappingConfig;
/**
 * JIRA SAFe hierarchy mapping (4 levels)
 *
 * SAFe: Initiative → Epic → Story → Sub-task
 * Maps to: epic → feature → user_story → task
 */
export declare const JIRA_SAFE_HIERARCHY_MAPPING: HierarchyMappingConfig;
/**
 * Default GitHub hierarchy mapping (2 levels)
 *
 * GitHub: Milestone → Issue
 * Maps to: feature → user_story
 */
export declare const DEFAULT_GITHUB_HIERARCHY_MAPPING: HierarchyMappingConfig;
/**
 * GitHub Sync Strategy (v0.18.0+ - Multi-Project Spec Sync)
 *
 * Determines how specs are synced to GitHub:
 * - project-per-spec: One GitHub Project per spec (default, current behavior)
 * - team-board: One GitHub Project per team (aggregates multiple specs)
 * - centralized: Parent repo tracks all specs (multi-repo pattern)
 * - distributed: Each team syncs to their repo (microservices)
 */
export type GitHubSyncStrategy = 'project-per-spec' | 'team-board' | 'centralized' | 'distributed';
/**
 * GitHub Configuration (v0.13.0+ - Simplified Multi-Project Architecture)
 * ENHANCED in v0.18.0 with spec-sync strategy support
 *
 * Supports four patterns:
 * 1. Single repo (backward compatible): owner + repo
 * 2. Multiple repos (intelligent mapping): owner + repos[]
 * 3. Master + nested repos (epic-level tracking): owner + masterRepo + repos[]
 * 4. Custom query (power users): customQuery (GitHub search syntax)
 *
 * REMOVED in v0.13.0:
 * - containers: Too complex → Use repos[] instead
 */
export interface GitHubConfig {
    owner?: string;
    repo?: string;
    token?: string;
    repos?: string[];
    masterRepo?: string;
    masterRepoLevel?: 'epic';
    nestedRepoLevel?: 'story-task';
    crossLinking?: boolean;
    confidenceThreshold?: number;
    customQuery?: string;
    /**
     * GitHub sync strategy for specs (v0.18.0+)
     * - project-per-spec: One GitHub Project per spec (default)
     * - team-board: One GitHub Project per team
     * - centralized: Parent repo tracks all
     * - distributed: Each team syncs to their repo
     */
    githubStrategy?: GitHubSyncStrategy;
    /**
     * Team board ID (for team-board strategy)
     * - ID of the GitHub Project that aggregates all specs from this team
     */
    teamBoardId?: number;
    /**
     * Cross-team detection (for distributed strategy)
     * - Auto-detect specs that touch multiple teams
     * - Create issues in multiple repos for cross-team specs
     */
    enableCrossTeamDetection?: boolean;
    /**
     * GitHub Projects V2 number (visible in project URL)
     * e.g., https://github.com/orgs/myorg/projects/5 → projectV2Number: 5
     */
    projectV2Number?: number;
    /**
     * GitHub Projects V2 node ID (for GraphQL mutations)
     * e.g., "PVT_kwDO..."
     */
    projectV2Id?: string;
    /**
     * Enable Projects V2 board sync (default: false)
     * When true, synced issues are added to the specified Project V2
     * with Status and Priority field mapping
     */
    projectV2Enabled?: boolean;
    /**
     * Map spec status values to Projects V2 Status field option names
     * @example { "planned": "Todo", "in-progress": "In Progress", "completed": "Done" }
     */
    statusFieldMapping?: Record<string, string>;
    /**
     * Map spec priority values to Projects V2 Priority field option names
     * @example { "P1": "Urgent", "P2": "High", "P3": "Medium" }
     */
    priorityFieldMapping?: Record<string, string>;
}
/**
 * JIRA Board → SpecWeave Project Mapping (v0.29.0+)
 * Maps a JIRA board to a SpecWeave project for team-based organization
 */
export interface JiraBoardMapping {
    /** JIRA board ID (numeric) */
    boardId: number;
    /** Board display name (e.g., "Frontend Board") */
    boardName: string;
    /** SpecWeave project ID this board maps to (e.g., "FE") */
    specweaveProject: string;
    /** Keywords for auto-classification of user stories to this board/project */
    keywords?: string[];
    /** Board type (for display purposes) */
    boardType?: 'scrum' | 'kanban' | 'simple';
}
/**
 * JIRA Board-Based Team Mapping Configuration (v0.29.0+)
 * Single JIRA project with multiple boards, each mapping to a SpecWeave project
 */
export interface JiraBoardMappingConfig {
    /** JIRA project key (e.g., "CORE") */
    projectKey: string;
    /** Board → SpecWeave project mappings */
    boards: JiraBoardMapping[];
    /** Auto-create boards if they don't exist (default: false) */
    autoCreateBoards?: boolean;
}
/**
 * Jira Configuration (v0.13.0+ - Simplified Multi-Project Architecture)
 * ENHANCED in v0.29.0 with board-based team mapping
 *
 * Supports four patterns:
 * 1. Single project (backward compatible): domain + projectKey
 * 2. Multiple projects (intelligent mapping): domain + projects[]
 * 3. Custom query (power users): domain + customQuery (raw JQL)
 * 4. NEW: Board-based teams (v0.29.0+): domain + boardMapping
 *
 * REMOVED in v0.13.0:
 * - strategy (JiraStrategy): Deprecated → Use intelligent mapping instead
 * - components: Too granular → Use projects[] or customQuery
 * - containers: Too complex → Use projects[] instead
 *
 * Backward Compatibility:
 * - Old config: { domain, projectKey } - still works (intelligent with 1 project)
 * - Old config: { domain, projects } - still works (intelligent with N projects)
 */
export interface JiraConfig {
    domain: string;
    projectKey?: string;
    projects?: string[];
    customQuery?: string;
    /**
     * Pattern 4: Board-based teams (v0.29.0+)
     *
     * Single JIRA project with multiple boards, each board maps to a SpecWeave project.
     * Ideal for enterprise setups where teams share a JIRA project but have separate boards.
     *
     * Example:
     * ```json
     * {
     *   "boardMapping": {
     *     "projectKey": "CORE",
     *     "boards": [
     *       { "boardId": 123, "boardName": "Frontend Board", "specweaveProject": "FE" },
     *       { "boardId": 456, "boardName": "Backend Board", "specweaveProject": "BE" }
     *     ]
     *   }
     * }
     * ```
     */
    boardMapping?: JiraBoardMappingConfig;
    intelligentMapping?: boolean;
    autoCreateEpics?: boolean;
    confidenceThreshold?: number;
    itemTypeMapping?: {
        epic: string;
        story: string;
        task: string;
        subtask: string;
    };
}
/**
 * ADO Area Path → SpecWeave Project Mapping (v0.29.0+)
 * Maps an ADO area path to a SpecWeave project for team-based organization
 */
export interface AdoAreaPathMapping {
    /** Full area path (e.g., "MyProduct\\Frontend" or "MyProduct\\Backend\\API") */
    areaPath: string;
    /** SpecWeave project ID this area path maps to (e.g., "FE") */
    specweaveProject: string;
    /** Keywords for auto-classification of user stories to this area/project */
    keywords?: string[];
    /** Include child area paths (default: true) */
    includeChildren?: boolean;
}
/**
 * ADO Area Path-Based Team Mapping Configuration (v0.29.0+)
 * Single ADO project with area paths mapping to SpecWeave projects
 */
export interface AdoAreaPathMappingConfig {
    /** ADO project name (e.g., "MyProduct") */
    project: string;
    /** Area path → SpecWeave project mappings */
    mappings: AdoAreaPathMapping[];
    /** Auto-create area paths if they don't exist (default: false) */
    autoCreateAreaPaths?: boolean;
}
/**
 * Azure DevOps Configuration (v0.13.0+ - Simplified Multi-Project Architecture)
 * ENHANCED in v0.29.0 with area path → SpecWeave project mapping
 *
 * Supports five patterns:
 * 1. Single project (backward compatible): organization + project
 * 2. Multiple projects (intelligent mapping): organization + projects[]
 * 3. Single project + area paths list (simple): organization + project + areaPaths[]
 * 4. Custom query (power users): organization + customQuery (raw WIQL)
 * 5. NEW: Area path mapping (v0.29.0+): organization + areaPathMapping
 *
 * REMOVED in v0.13.0:
 * - teams: Too granular → Use projects[] or areaPaths[]
 * - areaPaths (Record<string, string>): Changed to string[] for simpler config
 * - iterationPath: Use customQuery for complex filtering
 * - containers: Too complex → Use projects[] or areaPaths[] instead
 *
 * Backward Compatibility:
 * - Old config: { organization, project } - still works (intelligent with 1 project)
 * - Old config: { organization, project, teams } - deprecated, use areaPaths[] instead
 */
export interface AdoConfig {
    organization: string;
    project?: string;
    projects?: string[];
    areaPaths?: string[];
    customQuery?: string;
    /**
     * Pattern 5: Area path mapping (v0.29.0+)
     *
     * Single ADO project with area paths, each area path maps to a SpecWeave project.
     * Ideal for enterprise setups where teams share an ADO project but use area paths.
     *
     * Example:
     * ```json
     * {
     *   "areaPathMapping": {
     *     "project": "MyProduct",
     *     "mappings": [
     *       { "areaPath": "MyProduct\\Frontend", "specweaveProject": "FE" },
     *       { "areaPath": "MyProduct\\Backend", "specweaveProject": "BE" }
     *     ]
     *   }
     * }
     * ```
     */
    areaPathMapping?: AdoAreaPathMappingConfig;
    intelligentMapping?: boolean;
    autoCreateEpics?: boolean;
    confidenceThreshold?: number;
    workItemTypes?: {
        epic: string;
        feature: string;
        story: string;
        task: string;
    };
    /**
     * Hierarchy mapping for importing ADO work items to SpecWeave
     *
     * Maps ADO work item types to SpecWeave hierarchy levels.
     * Enables configurable 4-5 level hierarchy support.
     *
     * @example SAFe configuration:
     * ```json
     * {
     *   "hierarchyMapping": {
     *     "Capability": "epic",
     *     "Epic": "feature",
     *     "Feature": "feature",
     *     "User Story": "user_story",
     *     "Task": "task"
     *   }
     * }
     * ```
     *
     * If not provided, uses DEFAULT_ADO_HIERARCHY_MAPPING.
     */
    hierarchyMapping?: HierarchyMappingConfig;
    /**
     * How to handle orphan items (items without parents)
     *
     * - 'create-feature': Create individual FS-XXXE folders (current behavior, causes bug)
     * - 'skip': Don't import orphan items
     * - 'group': Group all orphans under _orphans/ folder (recommended)
     *
     * Default: 'group' (v0.30.5+)
     */
    orphanHandling?: 'create-feature' | 'skip' | 'group';
    /**
     * Auto-archive items older than N days on import
     *
     * Set to 0 to disable auto-archive on import (recommended for fresh imports).
     * Default: 0 (disabled in v0.30.5+, was 30 before)
     */
    autoArchiveAfterDays?: number;
}
/**
 * Per-User-Story link to a GitHub Issue
 * Stored in spec frontmatter: externalLinks.github.userStories[US-XXX]
 */
export interface GitHubUserStoryLink {
    /** GitHub issue number */
    issueNumber: number;
    /** Full URL to the GitHub issue */
    issueUrl: string;
    /** GitHub node ID for Projects V2 operations */
    issueNodeId?: string;
    /** When this user story was last synced */
    syncedAt: string;
    /** Last conflict info (null if no conflict) */
    lastConflict?: {
        field: string;
        specValue: string;
        githubValue: string;
        resolvedAt?: string;
        resolution?: 'github-wins' | 'spec-wins' | 'manual';
    } | null;
}
/**
 * GitHub sync metadata stored in spec frontmatter
 * under externalLinks.github
 */
export interface GitHubSyncMetadata {
    /** Overall sync status */
    syncStatus: 'synced' | 'dirty' | 'conflicted';
    /** Projects V2 number (if enabled) */
    projectV2Number?: number;
    /** Projects V2 node ID (if enabled) */
    projectV2Id?: string;
    /** Per-User-Story issue links */
    userStories: Record<string, GitHubUserStoryLink>;
    /** Cross-team repos that this spec syncs to */
    crossTeamRepos?: Array<{
        owner: string;
        repo: string;
        relevantStories: string[];
    }>;
}
/**
 * Per-User-Story link to a JIRA Issue
 * Stored in metadata: externalLinks.jira.userStories[US-XXX]
 */
export interface JiraUserStoryLink {
    /** JIRA issue key (e.g., PROJ-123) */
    issueKey: string;
    /** Full URL to the JIRA issue */
    issueUrl: string;
    /** When this user story was last synced */
    syncedAt: string;
}
/**
 * JIRA sync metadata stored in metadata.json
 * under externalLinks.jira
 */
export interface JiraSyncMetadata {
    /** Overall sync status */
    syncStatus: string;
    /** Per-User-Story issue links */
    userStories: Record<string, JiraUserStoryLink>;
}
/**
 * Per-User-Story link to an ADO Work Item
 * Stored in metadata: externalLinks.ado.userStories[US-XXX]
 */
export interface AdoUserStoryLink {
    /** ADO work item ID */
    workItemId: number;
    /** Full URL to the ADO work item */
    workItemUrl: string;
    /** When this user story was last synced */
    syncedAt: string;
}
/**
 * ADO sync metadata stored in metadata.json
 * under externalLinks.ado
 */
export interface AdoSyncMetadata {
    /** Overall sync status */
    syncStatus: string;
    /** Per-User-Story work item links */
    userStories: Record<string, AdoUserStoryLink>;
}
/**
 * Check if GitHub config has Projects V2 enabled
 */
export declare function hasGitHubProjectsV2(config: GitHubConfig): boolean;
export type ProviderConfig = GitHubConfig | JiraConfig | AdoConfig;
export type TimeRangePreset = '1W' | '2W' | '1M' | '3M' | '6M' | '1Y' | 'ALL';
export interface TimeRangeConfig {
    /** Preset time range */
    preset?: TimeRangePreset;
    /** Custom date range */
    custom?: {
        start: string;
        end?: string;
    };
}
export interface TimeRangeEstimate {
    /** Estimated work items to sync */
    items: number;
    /** Estimated API requests */
    apiCalls: number;
    /** Estimated sync duration in minutes */
    durationMinutes: number;
    /** Rate limit impact level */
    rateLimitImpact: 'low' | 'medium' | 'high' | 'critical';
}
export interface RateLimitConfig {
    /** Maximum items to sync in one operation */
    maxItemsPerSync: number;
    /** Warn user when exceeding this threshold */
    warnThreshold: number;
}
export interface RateLimitStatus {
    /** Remaining requests in current window */
    remaining: number;
    /** Total limit per window */
    limit: number;
    /** When the rate limit resets (ISO timestamp) */
    resetAt: string;
    /** Percentage of limit used */
    percentUsed: number;
}
export interface ProviderRateLimits {
    github: {
        limit: 5000;
        window: '1h';
        thresholds: {
            low: 250;
            medium: 1000;
            high: 2500;
        };
    };
    jira: {
        limit: 100;
        window: '1m';
        thresholds: {
            low: 25;
            medium: 50;
            high: 75;
        };
    };
    ado: {
        limit: 200;
        window: '5m';
        thresholds: {
            low: 50;
            medium: 100;
            high: 150;
        };
    };
}
export interface SyncProfile {
    /** Provider type */
    provider: SyncProvider;
    /** Human-readable name */
    displayName: string;
    /** Optional description */
    description?: string;
    /**
     * Sync strategy (v0.10.0+)
     * - simple: One container (default, backward compatible)
     * - filtered: Multiple containers + boards (NEW)
     * - custom: Raw query (NEW)
     *
     * If not specified, defaults to 'simple' for backward compatibility
     */
    strategy?: SyncStrategy;
    /** Provider-specific configuration */
    config: ProviderConfig;
    /** Time range configuration */
    timeRange: {
        /** Default time range for this profile */
        default: TimeRangePreset;
        /** Maximum allowed time range */
        max: TimeRangePreset;
    };
    /** Rate limiting configuration */
    rateLimits?: RateLimitConfig;
    /** Project context (for smart detection) */
    projectContext?: {
        /** Project name (e.g., "SpecWeave", "Client A Mobile") */
        name: string;
        /** Project description */
        description?: string;
        /** Keywords for auto-detection */
        keywords?: string[];
        /** Team/organization name */
        team?: string;
    };
}
export interface SyncProfiles {
    /**
     * Default profile (fallback when increment doesn't specify one)
     *
     * NOTE: This is a FALLBACK, not a constraint. Bulk operations (import/export/status)
     * iterate ALL profiles. Each increment can override via metadata.json.
     */
    defaultProfile?: string;
    /** All available profiles */
    profiles: Record<string, SyncProfile>;
}
export interface IncrementSyncMetadata {
    /** Which profile this increment uses */
    profile: string;
    /** External issue/work item number */
    issueNumber?: number;
    /** External issue/work item key (for JIRA) */
    issueKey?: string;
    /** Direct URL to external issue */
    issueUrl?: string;
    /** Time range used for this sync */
    timeRange: TimeRangePreset | 'custom';
    /** Custom time range (if timeRange === 'custom') */
    customTimeRange?: {
        start: string;
        end?: string;
    };
    /** When sync was created */
    createdAt: string;
    /** Last successful sync timestamp */
    lastSyncAt?: string;
    /** Sync status */
    status?: 'active' | 'paused' | 'failed' | 'completed';
    /** Last sync error (if any) */
    lastError?: {
        message: string;
        timestamp: string;
        rateLimited?: boolean;
    };
}
export interface ProjectContext {
    /** Unique project identifier (kebab-case) */
    id: string;
    /** Project name */
    name: string;
    /** Project description */
    description: string;
    /** Team/organization */
    team?: string;
    /** Keywords for auto-detection */
    keywords: string[];
    /** Project root path (optional, for multi-project setups) */
    projectPath?: string;
    /** Default sync profile for this project */
    defaultSyncProfile?: string;
    /** Project-specific specs folder */
    specsFolder: string;
    /** Related increments (for tracking) */
    increments?: string[];
}
export interface SyncConfiguration {
    /**
     * Default profile (fallback when increment doesn't specify one)
     */
    defaultProfile?: string;
    /** All sync profiles */
    profiles: Record<string, SyncProfile>;
    /** Project contexts */
    projects?: Record<string, ProjectContext>;
    /**
     * Global settings (v0.24.0+ - Three-Permission Architecture)
     *
     * Combines external tool permissions (SyncSettings) with global behavior settings.
     * All permission settings default to false for safety (explicit opt-in required).
     */
    settings?: SyncSettings & {
        /** Auto-detect project from increment description */
        autoDetectProject?: boolean;
        /** Default time range for new syncs */
        defaultTimeRange?: TimeRangePreset;
        /** Enable rate limit protection */
        rateLimitProtection?: boolean;
    };
}
export interface ProfileValidationResult {
    valid: boolean;
    errors: string[];
    warnings?: string[];
}
export interface ProjectDetectionResult {
    /** Matched project (if any) */
    project?: ProjectContext;
    /** Confidence score (0-1) */
    confidence: number;
    /** Matched keywords */
    matchedKeywords: string[];
    /** Suggested sync profile */
    suggestedProfile?: string;
}
/**
 * Check if profile uses intelligent strategy (auto-mapping, default)
 */
export declare function isIntelligentStrategy(profile: SyncProfile): boolean;
/**
 * Check if profile uses custom strategy (raw query)
 */
export declare function isCustomStrategy(profile: SyncProfile): boolean;
/**
 * Check if GitHub config uses multi-repo pattern
 */
export declare function hasMultipleGitHubRepos(config: GitHubConfig): boolean;
/**
 * Check if GitHub config uses master+nested repos pattern
 */
export declare function hasGitHubMasterNested(config: GitHubConfig): boolean;
/**
 * Check if Jira config uses multi-project pattern
 */
export declare function hasMultipleJiraProjects(config: JiraConfig): boolean;
/**
 * Check if ADO config uses multi-project pattern
 */
export declare function hasMultipleAdoProjects(config: AdoConfig): boolean;
/**
 * Check if ADO config uses area path pattern (single project with area paths)
 */
export declare function hasAdoAreaPaths(config: AdoConfig): boolean;
/**
 * Check if Jira config uses board-based team mapping (v0.29.0+)
 */
export declare function hasJiraBoardMapping(config: JiraConfig): boolean;
/**
 * Check if ADO config uses area path mapping (v0.29.0+)
 */
export declare function hasAdoAreaPathMapping(config: AdoConfig): boolean;
/**
 * Get JIRA board mapping for a SpecWeave project (v0.29.0+)
 *
 * @param config JiraConfig with boardMapping
 * @param specweaveProjectId SpecWeave project ID (e.g., "FE")
 * @returns Board mapping or undefined
 */
export declare function getJiraBoardForProject(config: JiraConfig, specweaveProjectId: string): JiraBoardMapping | undefined;
/**
 * Get ADO area path mapping for a SpecWeave project (v0.29.0+)
 *
 * @param config AdoConfig with areaPathMapping
 * @param specweaveProjectId SpecWeave project ID (e.g., "FE")
 * @returns Area path mapping or undefined
 */
export declare function getAdoAreaPathForProject(config: AdoConfig, specweaveProjectId: string): AdoAreaPathMapping | undefined;
/**
 * Get all SpecWeave project IDs from JIRA board mapping (v0.29.0+)
 */
export declare function getJiraMappedProjects(config: JiraConfig): string[];
/**
 * Get all SpecWeave project IDs from ADO area path mapping (v0.29.0+)
 */
export declare function getAdoMappedProjects(config: AdoConfig): string[];
/**
 * Get effective strategy (defaults to 'intelligent' if not specified)
 */
export declare function getEffectiveStrategy(profile: SyncProfile): SyncStrategy;
/**
 * DEPRECATED: Use isIntelligentStrategy() instead
 * Kept for backward compatibility only
 */
export declare function isSimpleStrategy(profile: SyncProfile): boolean;
/**
 * Get the default profile name from sync configuration
 *
 * @param config - Sync configuration (SyncProfiles or SyncConfiguration)
 * @returns Default profile name or undefined
 *
 * @example
 * ```typescript
 * const defaultProfile = getDefaultProfile(config.sync);
 * if (defaultProfile) {
 *   const profile = config.sync.profiles[defaultProfile];
 * }
 * ```
 */
export declare function getDefaultProfile(config: Pick<SyncProfiles, 'defaultProfile'> | undefined): string | undefined;
/**
 * Get ALL sync profiles of a specific provider type
 *
 * Use this for bulk operations instead of just using the default profile.
 * This allows sync operations to work across ALL configured profiles.
 *
 * @param config - Sync configuration
 * @param provider - Provider type ('github', 'jira', 'ado')
 * @returns Array of [profileName, profile] tuples
 *
 * @example
 * ```typescript
 * // Sync to ALL GitHub repos, not just "active" one
 * for (const [name, profile] of getProfilesByProvider(config.sync, 'github')) {
 *   await syncToGitHub(profile);
 * }
 * ```
 */
export declare function getProfilesByProvider(config: Pick<SyncProfiles, 'profiles'> | undefined, provider: SyncProvider): Array<[string, SyncProfile]>;
/**
 * Get all configured sync profiles (all providers)
 *
 * @param config - Sync configuration
 * @returns Array of [profileName, profile] tuples
 */
export declare function getAllProfiles(config: Pick<SyncProfiles, 'profiles'> | undefined): Array<[string, SyncProfile]>;
/**
 * Check if sync is configured for ANY profile of a given provider
 *
 * More useful than checking defaultProfile for permission checks.
 *
 * @param config - Sync configuration
 * @param provider - Provider type
 * @returns true if at least one profile exists for this provider
 */
export declare function hasProviderConfigured(config: Pick<SyncProfiles, 'profiles'> | undefined, provider: SyncProvider): boolean;
//# sourceMappingURL=sync-profile.d.ts.map