/**
 * MilestoneNotificationSubscriber (DF-1, issue #438)
 *
 * Mirrors `auto-learning.subscriber.ts` exactly — same shape (subscribe
 * to lifecycle events, dispatch idempotently, log on failure) but with a
 * different action: enqueue a `[MILESTONE]` message into the orchestrator's
 * chat queue so orc's Smart Notification Protocol can decide whether to
 * forward to the owner. The QW-3 prompt change (#436, PR #581) adds a
 * dedicated `[MILESTONE]` row to that priority table — always 🟡 Important,
 * never downgraded to ⚪ Info.
 *
 * **Why a backend subscriber when the agent-side prompt path already exists?**
 * The QW-1 prompt change (#434, PR #581) tells agents to call `report-status
 * --status milestone` when they ship. But that only fires when the agent
 * decides to call it. Some lifecycle events (TL `verifyItem(verified)`,
 * `mission:replanned`) happen at the system level WITHOUT going through
 * report-status. The subscriber here is the safety net: any time a
 * verified/replanned event surfaces, the owner gets notified even if the
 * worker forgot to self-surface.
 *
 * Subscribed events (closed-set, mirrors the same Arch Veto V7 + N1
 * rationale as auto-learning):
 *   - `task:verified`        — TL verified a worker's output (shipped artifact)
 *   - `mission:replanned`    — strategy changed (rare, escalate)
 *
 * Idempotency (Arch Veto V1):
 *   `${eventType}:${workItemId}` (or `${eventType}:${missionId}:${eventId}`
 *   for mission events) against an in-memory bounded LRU.
 *
 * No new event types (Arch Veto V7):
 *   Listens only to event types already in `EVENT_TYPES`.
 *
 * Fire-and-forget:
 *   `enqueueNotification()` is async; each dispatch is wrapped so a thrown
 *   error logs but doesn't break the publisher or other subscribers.
 *
 * @module services/notification/milestone-notification.subscriber
 */
import { type ComponentLogger } from '../core/logger.service.js';
import type { EventBusService } from '../event-bus/event-bus.service.js';
import type { EventType } from '../../types/event-bus.types.js';
/** Minimal MessageQueueService surface this subscriber depends on. */
export interface IMessageQueueServiceLike {
    enqueue(input: {
        content: string;
        conversationId: string;
        source: string;
        targetSession?: string;
        sourceMetadata?: Record<string, unknown>;
    }): unknown;
}
/**
 * Events this subscriber listens to. Closed-set per the same Arch N1 rule
 * `auto-learning.subscriber` follows — additions require explicit review.
 */
export declare const MILESTONE_SUBSCRIBED_EVENTS: readonly EventType[];
export interface MilestoneNotificationDependencies {
    eventBus: EventBusService;
    /** Notification sink — typically the orchestrator's MessageQueueService. */
    messageQueueService: IMessageQueueServiceLike;
    /** Optional logger override (defaults to a fresh component logger). */
    logger?: ComponentLogger;
    /** Optional dedup LRU capacity (defaults to {@link DEDUP_LRU_CAPACITY}). */
    dedupCapacity?: number;
    /** Optional override for the orchestrator session name. */
    orchestratorSession?: string;
}
/**
 * MilestoneNotificationSubscriber — surfaces lifecycle milestones to the
 * orchestrator's chat queue with a `[MILESTONE]` envelope.
 */
export declare class MilestoneNotificationSubscriber {
    private readonly eventBus;
    private readonly messageQueueService;
    private readonly logger;
    private readonly dedup;
    private readonly orchestratorSession;
    private unsubscribers;
    private started;
    private pendingDispatches;
    constructor(deps: MilestoneNotificationDependencies);
    /** Subscribe to all configured events. Idempotent. */
    start(): void;
    /** Wait for every in-flight dispatch. Test affordance. */
    flushPending(): Promise<void>;
    /** Detach all subscriptions. */
    stop(): void;
    /** Snapshot of the dedup state. Test affordance. */
    get dedupSize(): number;
    private safeDispatch;
    private dispatchOne;
    /**
     * Best-effort summary extraction from an event payload. Different event
     * types stash human-readable text in different fields; this normalizes.
     */
    private extractSummary;
    private buildEnvelope;
}
//# sourceMappingURL=milestone-notification.subscriber.d.ts.map