/**
 * Origin Metadata Types
 *
 * Defines types for tracking the origin of User Stories and Tasks:
 * - Internal: Created within SpecWeave increments
 * - External: Imported from external tools (GitHub, JIRA, ADO)
 */
export type Origin = 'internal' | 'external';
export type ExternalSource = 'github' | 'jira' | 'ado' | 'unknown';
/**
 * External item metadata (stored in spec.md/tasks.md frontmatter)
 */
export interface ExternalItemMetadata {
    /** User Story or Task ID (e.g., "US-004E", "T-010E") */
    id: string;
    /** Origin type */
    origin: 'external';
    /** External tool source */
    source: ExternalSource;
    /** External ID in source system (e.g., "GH-#638", "JIRA-SPEC-789") */
    external_id: string;
    /** External URL (link to original item) */
    external_url: string;
    /** Timestamp when imported */
    imported_at: string;
    /** External title (original, may differ from SpecWeave format) */
    external_title?: string;
    /** Format preservation flag (if true, preserve original title/description) */
    format_preservation?: boolean;
}
/**
 * Extended spec frontmatter with external items
 */
export interface SpecFrontmatter {
    increment: string;
    title: string;
    type: string;
    priority?: string;
    status?: string;
    created?: string;
    epic?: string;
    test_mode?: string;
    coverage_target?: number;
    /** External items imported into this increment */
    external_items?: ExternalItemMetadata[];
}
/**
 * Extended task frontmatter with external items
 */
export interface TasksFrontmatter {
    total_tasks: number;
    completed: number;
    by_user_story?: Record<string, number>;
    test_mode?: string;
    coverage_target?: number;
    /** External items imported into tasks */
    external_items?: ExternalItemMetadata[];
}
/**
 * Origin badge emojis for living docs
 */
export declare const ORIGIN_BADGES: Record<ExternalSource | 'internal', string>;
/**
 * Get origin badge for display
 *
 * @param source - External source or 'internal'
 * @returns Emoji badge
 *
 * @example
 * getOriginBadge('github') // Returns: '🔗'
 * getOriginBadge('internal') // Returns: '🏠'
 */
export declare function getOriginBadge(source: ExternalSource | 'internal'): string;
/**
 * Format origin for display in living docs
 *
 * @param metadata - External item metadata
 * @returns Formatted origin string (e.g., "🔗 GitHub #638")
 *
 * @example
 * formatOrigin({
 *   id: 'US-004E',
 *   origin: 'external',
 *   source: 'github',
 *   external_id: 'GH-#638',
 *   external_url: 'https://github.com/...',
 *   imported_at: '2025-11-19T10:30:00Z'
 * })
 * // Returns: "🔗 [GitHub #638](https://github.com/...)"
 */
export declare function formatOrigin(metadata: ExternalItemMetadata): string;
/**
 * Check if ID is from external source (has E suffix)
 *
 * @param id - User Story or Task ID
 * @returns True if external, false if internal
 *
 * @example
 * isExternalId('US-004E') // Returns: true
 * isExternalId('US-003') // Returns: false
 * isExternalId('T-010E') // Returns: true
 */
export declare function isExternalId(id: string): boolean;
/**
 * Extract origin from ID suffix
 *
 * @param id - User Story or Task ID
 * @returns Origin type
 *
 * @example
 * getOriginFromId('US-004E') // Returns: 'external'
 * getOriginFromId('US-003') // Returns: 'internal'
 */
export declare function getOriginFromId(id: string): Origin;
/**
 * Parse external ID to extract source and number
 *
 * @param externalId - External ID (e.g., "GH-#638", "JIRA-SPEC-789")
 * @returns Parsed components
 *
 * @example
 * parseExternalId('GH-#638')
 * // Returns: { source: 'github', number: '638' }
 *
 * parseExternalId('JIRA-SPEC-789')
 * // Returns: { source: 'jira', number: 'SPEC-789' }
 */
export declare function parseExternalId(externalId: string): {
    source: ExternalSource;
    number: string;
} | null;
/**
 * Create external item metadata
 */
export declare function createExternalMetadata(params: {
    id: string;
    source: ExternalSource;
    externalId: string;
    externalUrl: string;
    externalTitle?: string;
    formatPreservation?: boolean;
}): ExternalItemMetadata;
/**
 * Validate external item metadata
 *
 * @throws Error if metadata is invalid
 */
export declare function validateExternalMetadata(metadata: ExternalItemMetadata): void;
//# sourceMappingURL=origin-metadata.d.ts.map