/**
 * TeamTriggerReconciler — keeps the running TriggerEngine in sync with the
 * declarative `Team.triggers` spec.
 *
 * A team's operating cadence (monthly YouTube kickoff, weekly content review,
 * daily EOD reflection, ...) is authored as a list of `TeamTriggerSpec`s on
 * the Team config. This service diffs that spec against whatever the engine
 * currently holds for the given team and converges the two:
 *
 * - **spec-only**: create the trigger on the engine
 * - **engine-only (same team)**: delete the stale trigger
 * - **both**: if the effective config changed, replace; else leave alone
 *
 * Identity is the pair `(teamId, name)` — callers must give each spec a
 * stable `name`. Changing a `name` is treated as delete + create.
 *
 * @module services/v3/team-trigger-reconciler.service
 */
import type { Team } from '../../types/index.js';
import type { TriggerEngine } from './trigger-engine.service.js';
/**
 * Summary of what the reconciler changed for a single team.
 */
export interface ReconcileSummary {
    /** Team that was reconciled */
    teamId: string;
    /** Trigger names that were newly created */
    created: string[];
    /** Trigger names that were replaced due to config drift */
    replaced: string[];
    /** Trigger names that were deleted because the spec no longer lists them */
    deleted: string[];
    /** Trigger names left untouched because the spec matched the running state */
    unchanged: string[];
    /** Trigger names skipped because `enabled: false` */
    skipped: string[];
}
/**
 * Synchronises a team's declarative trigger spec with a running TriggerEngine.
 *
 * @example
 * ```typescript
 * const reconciler = new TeamTriggerReconciler(engine);
 * const summary = await reconciler.reconcile(team);
 * // later, when the team is archived:
 * await reconciler.unregisterAll(team.id);
 * ```
 */
export declare class TeamTriggerReconciler {
    private readonly engine;
    private readonly logger;
    constructor(engine: TriggerEngine);
    /**
     * Reconciles the engine's view of this team's triggers with the Team's
     * declarative spec. Idempotent — running twice with the same spec is a no-op.
     *
     * @param team - Team whose triggers should be synced
     * @returns Summary of changes applied
     */
    reconcile(team: Team): Promise<ReconcileSummary>;
    /**
     * Cancels every trigger the engine holds for the given team. Call this when
     * a team is archived or deleted so no orphaned cadence keeps firing.
     *
     * @param teamId - Owning team's ID
     * @returns Number of triggers removed
     */
    unregisterAll(teamId: string): Promise<number>;
    private toCreateInput;
    /**
     * Shallow drift check — serialise the fields that define runtime behaviour
     * and compare. JSON.stringify is sufficient here because TeamTriggerSpec
     * only holds plain-data shapes.
     */
    private hasDrift;
}
//# sourceMappingURL=team-trigger-reconciler.service.d.ts.map