import type { DelegationNotification, DelegationNotificationType } from "./types.js"; export interface RouteResult { parentSessionId: string; notification: DelegationNotification; } export interface PendingNotificationRecord { parentSessionId: string; notification: DelegationNotification; stateRoot: ".hivemind"; retryCount: number; maxRetries: number; expiresAt: number; } export interface NotificationRouterOptions { deliver?: (parentSessionId: string, notification: DelegationNotification) => boolean | Promise; persistPending?: (records: PendingNotificationRecord[]) => void; } /** Routes delegation notifications to their owning parent session. */ export declare class NotificationRouter { private readonly options; private readonly routes; private readonly pendingLimit; private readonly deliveredKeys; private readonly retryState; constructor(options?: NotificationRouterOptions); /** Register a delegation-to-parent route. */ register(delegationId: string, parentSessionId: string): void; /** Resolve a notification target without broadcasting to unrelated parents. */ route(notification: DelegationNotification): RouteResult | undefined; /** Complete an async delivery attempt without duplicating pending records. */ private finalizeDelivery; /** Check retry/TTL state before queueing a failed delivery. Returns false to drop silently. */ private shouldQueuePending; /** Remove a route after terminal completion. */ deregister(delegationId: string): void; /** Queue a pending notification, bounded to the latest 50 entries. */ queuePending(delegationId: string, notification: DelegationNotification): void; /** Replay and clear pending notifications for a parent in FIFO order. */ replayPending(parentSessionId: string): DelegationNotification[]; private persistAllPending; /** Format a compact parent-facing notification line. */ formatNotification(type: DelegationNotificationType, delegationId: string, message: string): string; /** Format a TUI system notification line for live delegation append. Extended with rich fields. */ formatTuiNotification(type: DelegationNotificationType, delegationId: string, agent: string, elapsedMs: number, toolCount?: number, extra?: { path?: string; fileChanges?: string[]; completedAt?: string; }): string; /** Format system notification block for session prompt delivery. Extended with rich fields. */ formatSystemNotification(type: DelegationNotificationType, delegationId: string, agent: string, elapsedMs: number, toolCount?: number, summary?: string, extra?: { path?: string; fileChanges?: string[]; completedAt?: string; }): string; } //# sourceMappingURL=notification-router.d.ts.map