/**
 * alerts/digest.ts — Adaptive notification batching (SDK 1.9.0).
 *
 * Promoted from forge's `src/agents/23-security-auditor/agent.ts`
 * `buildEscalationMessages()` after a 47-alert Telegram flood during the
 * first Dependabot-enabled cycle (2026-05-17). Generalized so any agent
 * dispatching bulk operator alerts (devops, finance, devrel, inbox-monitor,
 * security-auditor) can adopt it without re-implementing the
 * threshold/sort/cap logic.
 *
 * Design notes:
 *  - Pure function — no I/O, no transport dependency. Caller dispatches the
 *    returned strings to Telegram/Slack/email/whatever channel.
 *  - 0 items → no message at all (empty array).
 *  - 1..threshold items → one full-detail message per item.
 *  - More than threshold items → one digest message, sorted by severity
 *    (configurable order), capped at `maxChars`, with truncation footer +
 *    optional details pointer.
 *  - Severities outside the configured order are appended last with a
 *    default bullet emoji.
 *
 * @public
 */
/**
 * A single alert item fed to {@link buildAlertDigest}. All fields except
 * `severity` and `title` are optional — render skips empty lines.
 *
 * @public
 */
export interface AlertItem {
    /**
     * Severity bucket. Built-in semantics: `"critical" | "high" | "medium" |
     * "low"`. Any other string is accepted and ranked according to
     * {@link AlertDigestOptions.severityOrder} (or appended last with a
     * default emoji when not listed).
     */
    readonly severity: "critical" | "high" | "medium" | "low" | (string & Record<never, never>);
    /** Human-readable headline (rendered after the emoji). */
    readonly title: string;
    /** Affected component / repo / file (e.g. `"vauban-org/forge:axios"`). */
    readonly component?: string;
    /** External reference (e.g. `"CVE-2026-0001"`). */
    readonly ref?: string;
    /** Remediation hint shown in individual messages. */
    readonly remediation?: string;
    /** Direct URL for follow-up (shown in individual messages). */
    readonly url?: string;
}
/**
 * Options for {@link buildAlertDigest}. All fields optional with sensible
 * defaults matching forge's prod-validated security-auditor behaviour.
 *
 * @public
 */
export interface AlertDigestOptions {
    /**
     * Header prefix label (e.g. `"SECURITY"`, `"DEVOPS"`). Default
     * `"ALERT"`. Appears in the digest header — ignored in per-item mode.
     */
    readonly label?: string;
    /**
     * Cutoff between per-item and digest modes. `<=` threshold yields N
     * messages, `>` threshold yields a single digest. Default `3`.
     */
    readonly threshold?: number;
    /**
     * Hard cap on the rendered digest length (chars). Default `4000`
     * (Telegram-safe — Telegram limit is 4096).
     */
    readonly maxChars?: number;
    /**
     * Pointer to detailed source (e.g. `"query Brain category=forge_alert"`).
     * Appended on a final line of every digest message when provided.
     */
    readonly detailsPointer?: string;
    /**
     * Severity sort order, highest priority first. Default
     * `["critical", "high", "medium", "low"]`. Severities not listed go
     * after listed ones, in input order.
     */
    readonly severityOrder?: readonly string[];
    /**
     * Per-severity emoji map. Default
     * `{ critical: "🚨", high: "⚠️", medium: "ℹ️", low: "🔵" }`. Missing
     * severities fall back to `"•"`.
     */
    readonly emojiMap?: Readonly<Record<string, string>>;
}
/**
 * Build an adaptive alert digest from a list of items.
 *
 * - 0 items → `[]` (no message at all).
 * - 1..threshold items → one message per item (full detail preserved).
 * - More than threshold → one digest message, severity-sorted, capped at
 *   `maxChars`, with truncation footer `"… +K more"` when items overflow,
 *   followed by `"Details: <detailsPointer>"` when a pointer is provided.
 *
 * Header counts only non-zero severities, in the configured order.
 * Severities not in `severityOrder` are appended last with a default
 * bullet emoji `"•"` (or a user-provided emoji from `emojiMap`).
 *
 * @example
 *   buildAlertDigest([])                             // → []
 *   buildAlertDigest([critical, high, low])          // → 3 messages
 *   buildAlertDigest(arrayOf(50, "high"), {
 *     label: "DEPENDABOT",
 *     detailsPointer: "query Brain category=forge_alert tag=security",
 *   })                                                // → 1 digest message
 *
 * @public
 */
export declare function buildAlertDigest(items: readonly AlertItem[], opts?: AlertDigestOptions): string[];
//# sourceMappingURL=digest.d.ts.map