/** * External Change Puller * * Pulls changes from external tools (ADO, JIRA, GitHub) back to SpecWeave. * Implements the pull direction of bidirectional sync. * * Features: * - Fetch recent changes from all configured platforms * - Map external changes to living docs format * - Support for timestamp-based filtering * * @module sync/external-change-puller */ import { Logger } from '../utils/logger.js'; /** * Generic external change interface * Unifies changes from ADO, JIRA, and GitHub */ export interface ExternalChange { platform: 'ado' | 'jira' | 'github'; externalId: string; changedAt: string; changedBy: string; changedFields: Array<{ field: string; oldValue: unknown; newValue: unknown; }>; currentState: { status: string; priority: string | number | null; assignee: string | null; }; } export interface ExternalPullFailure { platform: ExternalChange['platform']; message: string; } /** A rejected fetch must not be mistaken for a complete synchronization. */ export declare class ExternalPullError extends Error { readonly changes: ExternalChange[]; readonly failures: ExternalPullFailure[]; readonly completedPlatforms: ExternalChange['platform'][]; constructor(changes: ExternalChange[], failures: ExternalPullFailure[], completedPlatforms: ExternalChange['platform'][]); } /** * External change puller options */ export interface ExternalChangePullerOptions { /** * Project root directory */ projectRoot: string; /** * Logger instance */ logger?: Logger; /** * Platforms to pull from */ platforms?: Array<'ado' | 'jira' | 'github'>; /** Explicit tracker repository; takes precedence over the checkout remote. */ github?: { owner: string; repo: string; token?: string; }; } /** * ExternalChangePuller - Fetches changes from external tools * * Aggregates changes from all configured external tools and * transforms them into a unified format for processing. */ export declare class ExternalChangePuller { private readonly projectRoot; private readonly logger; private readonly platforms; private readonly github?; constructor(options: ExternalChangePullerOptions); /** * Fetch recent changes from all configured platforms * * @param since - Timestamp to query changes from * @param linkedItems - Optional map of platform -> item IDs to filter * @returns Array of external changes from all platforms * @throws ExternalPullError with successful results when any provider fails */ fetchRecentChanges(since: Date, linkedItems?: { ado?: number[]; jira?: string[]; github?: number[]; }): Promise; /** * Fetch changes from Azure DevOps */ private fetchAdoChanges; /** * Fetch changes from JIRA */ private fetchJiraChanges; /** * Fetch changes from GitHub */ private fetchGitHubChanges; /** * Map external status to SpecWeave status * * Converts platform-specific status values to SpecWeave's status taxonomy. */ mapToSpecWeaveStatus(platform: 'ado' | 'jira' | 'github', externalStatus: string): string; } //# sourceMappingURL=external-change-puller.d.ts.map