/**
 * notify-sweep command — scheduled daily/weekly digest delivery to team
 * Slack channels (D0055 Phase 4, M6).
 *
 * Serves the `daily` and `weekly` cadence channels that the immediate per-report
 * path (M5) does not. It queries a fixed-lookback window of reports (1 day for
 * `daily`, 7 for `weekly` — no per-channel watermark), runs each report through
 * the pure matcher to decide which cadence channels it belongs to (honoring the
 * channel's scope + events filters), builds a per-channel digest from that
 * channel's matched reports, and posts one roll-up per channel via the bot-token
 * Slack adapter.
 *
 * Per-channel scoping is the whole point of the sweep (the M5 `dispatchDigest`
 * primitive is cadence-only): a `repos`-scoped channel sees a roll-up of only
 * its repos' reports. The matcher is reused verbatim so scope/event/cadence
 * semantics live in one place (D0045) rather than being re-implemented against
 * the slim digest projection.
 *
 * Triggered by two crons in `.github/workflows/scheduled-eval.yml`. Without
 * `SLACK_BOT_TOKEN` the command is a no-op, mirroring the composition root's
 * `loadSinks`-style gate.
 *
 * @see packages/core/src/notifications/match.ts — the pure matcher
 * @see packages/eval/src/notifications/service.ts — dispatchScopedDigests
 * @see packages/eval/src/commands/weekly-digest.ts — the command pattern cloned
 */
import { Command } from "commander";
import { type ChannelDelivery, type ChannelDispatchResult, type DigestSummary, type NotificationDelivery, type Report, type Team } from "../_vendor/ailf-core/index.d.ts";
import { type DigestReportEntry } from "../schedules/digest.js";
/** The two scheduled cadences the sweep serves (`immediate` is the M5 path). */
export type SweepCadence = "daily" | "weekly";
/**
 * Injected side effects + clock, so the sweep core is testable without a
 * network or a real clock.
 */
export interface NotifySweepDeps {
    /** Deliver the resolved per-channel digests. Returns one result per channel. */
    dispatch: (items: {
        digest: DigestSummary;
        target: ChannelDelivery;
    }[], cadence: NotificationDelivery) => Promise<ChannelDispatchResult[]>;
    /** Load the reports whose `completedAt >= sinceIso`, oldest-first. */
    loadReports: (sinceIso: string) => Promise<Report[]>;
    /** Load active teams with at least one notification channel. */
    loadTeams: () => Promise<Team[]>;
    /** Progress sink (defaults to a no-op). */
    log?: (line: string) => void;
    /** Current time source (injectable for deterministic window math). */
    now: () => Date;
}
export interface NotifySweepOptions {
    cadence: SweepCadence;
    dryRun: boolean;
    /** Override the per-cadence default lookback window. */
    lookbackDays?: number;
}
/** One channel's resolved roll-up (for the human summary + tests). */
export interface NotifySweepChannelSummary {
    channelKey: string;
    reportCount: number;
    team: string;
}
export interface NotifySweepResult {
    cadence: SweepCadence;
    /** Channels that matched at least one windowed report. */
    channels: NotifySweepChannelSummary[];
    /** Per-channel delivery outcomes; empty on dry-run or empty window. */
    dispatched: ChannelDispatchResult[];
    sinceIso: string;
    windowReportCount: number;
}
/**
 * Core sweep: window → match → per-channel digest → dispatch. Pure of I/O —
 * every side effect arrives through `deps`. Returns the resolved per-channel
 * roll-ups (and, when not a dry-run, their delivery outcomes).
 */
export declare function runNotifySweep(deps: NotifySweepDeps, opts: NotifySweepOptions): Promise<NotifySweepResult>;
/**
 * Project a full Report onto the slim `DigestReportEntry` the digest engine
 * aggregates. `buildDigestSummary` consumes only `scores` + `overallScore`
 * (plus chronological order); the remaining fields carry through for parity
 * with the weekly-digest projection.
 */
export declare function toDigestReportEntry(report: Report): DigestReportEntry;
/**
 * `report notify-sweep --cadence <daily|weekly>` — registered under the
 * `report` group beside `digest`. Wires the real adapters (Content Lake team
 * source, report store, Slack bot-token service) and delegates to
 * `runNotifySweep`.
 */
export declare function createNotifySweepCommand(): Command;
