/**
 * External Sync Orchestrator
 *
 * Coordinates syncing user stories to multiple external tools based on
 * per-US project targeting. Groups USs by their target project and
 * syncs each group to the appropriate external system.
 *
 * @module core/living-docs/external-sync-orchestrator
 * @since v0.33.0
 */
import type { UserStoryData } from './types.js';
import type { USExternalRefsMap } from '../types/increment-metadata.js';
import { Logger } from '../../utils/logger.js';
import type { ToolRegistry, ToolSearchResult, LoadedTool } from '../tools/index.js';
/**
 * Project mapping configuration
 */
export interface ProjectMapping {
    github?: {
        owner: string;
        repo: string;
    };
    jira?: {
        project: string;
        board?: string;
    };
    ado?: {
        project: string;
        areaPath?: string;
    };
}
/**
 * Result of syncing a single US to an external tool
 */
export interface USSyncResult {
    usId: string;
    provider: 'github' | 'jira' | 'ado';
    success: boolean;
    issueNumber?: number | string;
    url?: string;
    error?: string;
}
/**
 * Result of syncing all USs in a project group
 */
export interface ProjectSyncResult {
    projectId: string;
    provider: 'github' | 'jira' | 'ado';
    success: boolean;
    synced: USSyncResult[];
    errors: string[];
}
/**
 * Result of complete cross-project sync
 */
export interface CrossProjectExternalSyncResult {
    success: boolean;
    projects: ProjectSyncResult[];
    externalRefs: USExternalRefsMap;
    summary: {
        totalUSs: number;
        syncedUSs: number;
        failedUSs: number;
        projectCount: number;
    };
}
/**
 * External Sync Orchestrator
 */
export declare class ExternalSyncOrchestrator {
    private projectRoot;
    private logger;
    private projectMappings;
    private toolRegistry?;
    constructor(projectRoot: string, options?: {
        logger?: Logger;
        toolRegistry?: ToolRegistry;
    });
    /**
     * Set the tool registry for intelligent tool selection
     */
    setToolRegistry(registry: ToolRegistry): void;
    /**
     * Search for best sync tool matching project configuration
     *
     * Uses Tool Search Registry to find the optimal sync tool based on
     * project mapping (github, jira, ado).
     *
     * @param projectId - Project ID to find sync tool for
     * @returns Best matching tool result or null
     */
    findSyncTool(projectId: string): Promise<ToolSearchResult | null>;
    /**
     * Get loaded sync tool for a project
     *
     * Combines findSyncTool with lazy loading to get full tool content.
     *
     * @param projectId - Project ID
     * @returns Loaded tool with content or null
     */
    getLoadedSyncTool(projectId: string): Promise<LoadedTool | null>;
    /**
     * Load project mappings from config
     */
    loadProjectMappings(): Promise<void>;
    /**
     * Get project mapping for a project ID
     */
    getProjectMapping(projectId: string): ProjectMapping | undefined;
    /**
     * Group user stories by their target project
     */
    groupUSsByProject(userStories: UserStoryData[], defaultProject: string): Map<string, UserStoryData[]>;
    /**
     * Get preferred provider for a US
     * Priority: US.externalProvider > first available in mapping
     */
    getPreferredProvider(us: UserStoryData, mapping: ProjectMapping): 'github' | 'jira' | 'ado' | null;
    /**
     * Build external refs map from sync results
     */
    buildExternalRefsMap(results: ProjectSyncResult[]): USExternalRefsMap;
    /**
     * Log sync summary
     */
    logSyncSummary(result: CrossProjectExternalSyncResult): void;
    /**
     * Create placeholder sync result for dry-run or when sync is skipped
     */
    createPlaceholderResult(userStories: UserStoryData[], defaultProject: string): CrossProjectExternalSyncResult;
}
//# sourceMappingURL=external-sync-orchestrator.d.ts.map