/**
 * Session Sync Executor
 *
 * Executes due sync jobs on Claude Code session start.
 * This is the "pragmatic hybrid" approach - sync runs at session boundaries
 * rather than requiring a daemon or cron.
 *
 * Key features:
 * - Auto-executes due jobs on session start
 * - Non-blocking (runs in background)
 * - Rate-limited (max 1 external sync per session start)
 * - Respects permission gates (canUpdateExternalItems, etc.)
 *
 * @module core/scheduler/session-sync-executor
 */
import { Logger } from '../../utils/logger.js';
/**
 * Session sync executor options
 */
export interface SessionSyncExecutorOptions {
    /**
     * Project root directory
     */
    projectRoot: string;
    /**
     * Logger instance
     */
    logger?: Logger;
    /**
     * Maximum jobs to execute per session start
     * @default 1
     */
    maxJobsPerSession?: number;
    /**
     * Dry run mode (log what would happen, don't execute)
     * @default false
     */
    dryRun?: boolean;
}
/**
 * Execution result for a single session job
 */
export interface SessionJobResult {
    jobId: string;
    success: boolean;
    durationMs: number;
    error?: string;
    skipped?: boolean;
    skipReason?: string;
}
/**
 * Session sync execution summary
 */
export interface SessionSyncResult {
    /**
     * Total jobs found due
     */
    dueJobCount: number;
    /**
     * Jobs executed
     */
    executedJobs: SessionJobResult[];
    /**
     * Jobs skipped (due to gates or limits)
     */
    skippedJobs: SessionJobResult[];
    /**
     * Overall success
     */
    success: boolean;
    /**
     * Total duration
     */
    totalDurationMs: number;
}
/**
 * SessionSyncExecutor - Runs due sync jobs on session start
 *
 * Called by the session-start hook to execute overdue scheduled jobs.
 * This provides a pragmatic "sync on session boundaries" approach.
 */
export declare class SessionSyncExecutor {
    private readonly projectRoot;
    private readonly logger;
    private readonly persistence;
    private readonly maxJobsPerSession;
    private readonly dryRun;
    constructor(options: SessionSyncExecutorOptions);
    /**
     * Execute all due sync jobs
     *
     * Called on session start to run overdue scheduled jobs.
     *
     * @returns Execution summary
     */
    executeDueJobs(): Promise<SessionSyncResult>;
    /**
     * Get jobs that are due for execution
     */
    private getDueJobs;
    /**
     * Check sync permissions from config
     */
    private checkSyncPermissions;
    /**
     * Execute a single job
     */
    private executeJob;
    /**
     * Execute external sync (GitHub/JIRA/ADO)
     *
     * Multi-project support: Each increment can have its own ADO profile
     * stored in metadata.json -> external_sync.ado.profile
     */
    private executeExternalSync;
    /**
     * Execute external pull (fetch changes from GitHub/JIRA/ADO)
     *
     * Pulls status/field updates from external tools back to living docs.
     * Uses timestamp-based conflict resolution (latest wins).
     */
    private executeExternalPull;
    /**
     * Load project config
     */
    private loadConfig;
}
/**
 * Execute session sync from CLI/hook
 *
 * This is the main entry point called by the session-start hook.
 *
 * @param projectRoot - Project root directory
 * @param options - Execution options
 * @returns JSON result for hook consumption
 */
export declare function executeSessionSync(projectRoot: string, options?: {
    dryRun?: boolean;
    silent?: boolean;
}): Promise<string>;
//# sourceMappingURL=session-sync-executor.d.ts.map