/**
 * Azure DevOps Spec Sync
 *
 * CORRECT ARCHITECTURE:
 * - Syncs .specweave/docs/internal/specs/spec-*.md ↔ ADO Features
 * - NOT increments ↔ ADO Work Items (that was wrong!)
 *
 * Mapping:
 * - Spec → ADO Feature
 * - User Story → ADO User Story (child of feature)
 * - Acceptance Criteria → Checklist in User Story description
 *
 * @module ado-spec-sync
 */
import { SpecSyncResult } from '../../../../../src/core/types/spec-metadata.js';
import { SyncCircuitBreaker } from '../../../../../src/core/increment/sync-circuit-breaker.js';
export interface AdoFeature {
    id: number;
    url: string;
    fields: {
        'System.Title': string;
        'System.Description': string;
        'System.State': string;
        'System.Tags': string;
    };
}
export interface AdoUserStory {
    id: number;
    url: string;
    fields: {
        'System.Title': string;
        'System.Description': string;
        'System.State': string;
        'System.Parent': number;
        'System.Tags': string;
    };
}
export interface AdoConfig {
    organization: string;
    project: string;
    personalAccessToken: string;
}
export declare class AdoSpecSync {
    private specManager;
    private client;
    private config;
    private projectRoot;
    private availableTypes;
    private breaker;
    constructor(config: AdoConfig, projectRoot?: string, projectId?: string, breaker?: SyncCircuitBreaker);
    /**
     * Detect available work item types for this ADO project.
     * Basic process has Epic/Issue/Task; Agile/Scrum has Feature/User Story/Bug/Task.
     */
    private detectAvailableTypes;
    /**
     * Resolve a work item type, falling back if not available in the project.
     * Feature → Epic (Basic process), User Story → Issue (Basic process)
     */
    private resolveWorkItemType;
    /**
     * Resolve a work item state name for the given type.
     * Basic process (Issue type) uses: "To Do", "Doing", "Done"
     * Agile/Scrum process uses: "New", "Active", "Closed" / "Resolved" / "Done"
     *
     * Maps canonical states: 'New' → todo, 'Active' → in-progress, 'Closed' → done
     */
    private stateCache;
    private resolveWorkItemState;
    /**
     * Sync spec to ADO Feature (CREATE or UPDATE)
     */
    syncSpecToAdo(specId: string): Promise<SpecSyncResult>;
    /**
     * Sync FROM ADO Feature to spec (bidirectional)
     */
    syncFromAdo(specId: string): Promise<SpecSyncResult>;
    /**
     * Create new ADO Feature for spec
     */
    private createAdoFeature;
    /**
     * Update existing ADO Feature (conditional — only writes changed fields)
     */
    private updateAdoFeature;
    /**
     * Sync user stories as ADO User Stories
     */
    private syncUserStories;
    /**
     * Write ADO work item ID back to living doc US file frontmatter.
     */
    private writeAdoIdToUSFile;
    /**
     * Generate feature description from spec
     */
    private generateFeatureDescription;
    /**
     * Generate story description from user story
     */
    private generateStoryDescription;
    /**
     * Detect conflicts between spec and ADO
     */
    private detectConflicts;
    /**
     * Resolve conflicts
     */
    private resolveConflicts;
    /**
     * Fetch ADO Feature details
     */
    private fetchAdoFeature;
    /**
     * Find story by title pattern
     */
    private findStoryByTitle;
    /**
     * Create ADO User Story
     */
    private createStory;
    /**
     * Update ADO User Story
     */
    private updateStory;
    /**
     * Map SpecWeave priority to ADO priority value
     *
     * ADO Priority field uses 1-4 scale:
     * - 1 = Highest (P0)
     * - 2 = High (P1)
     * - 3 = Medium (P2)
     * - 4 = Low (P3)
     */
    private mapPriorityToAdo;
    /**
     * Map SpecWeave type to ADO work item type
     *
     * Supports: Feature, User Story, Bug, Task
     */
    private mapTypeToAdo;
    /**
     * Check whether the circuit is closed (sync allowed).
     */
    canSync(): boolean;
}
//# sourceMappingURL=ado-spec-sync.d.ts.map