import { type NotificationPlan } from './planner.js'; import { sendPlatformPush } from './platform-push.js'; export declare class NotificationService { private readonly options; private timer; private draining; private drainAgain; private lastMaintenanceAt; constructor(options: { publish: (type: string, payload: unknown) => void; fetch?: typeof fetch; allowsNotification?: (notification: NotificationPlan['notification']) => boolean; sendPush?: typeof sendPlatformPush; }); start(): void; stop(): void; handleGatewayEvent(type: string, payload: unknown): void; /** Throws on persistence failure so durable producers can retry the handoff. */ persistGatewayEvent(type: string, payload: unknown): { schemaVersion: 1; id: string; type: "work_discovery.completed" | "work_discovery.failed" | "chat.needs_input" | "chat.completed" | "chat.failed" | "task.needs_input" | "task.blocked" | "task.failed" | "task.completed" | "automation.completed" | "automation.failed" | "home.opportunity"; target: { kind: "chat"; conversationId: string; assistant?: boolean | undefined; } | { kind: "task"; taskId: string; } | { kind: "home"; } | { kind: "automation_run"; automationId: string; runId: string; } | { kind: "work_discovery"; runId: string; conversationId: string; }; priority: "normal" | "high"; title: { en: string; zh: string; }; payload: Record; createdAt: number; body?: { en: string; zh: string; } | undefined; } | null; persistPlan(plan: NotificationPlan): { schemaVersion: 1; id: string; type: "work_discovery.completed" | "work_discovery.failed" | "chat.needs_input" | "chat.completed" | "chat.failed" | "task.needs_input" | "task.blocked" | "task.failed" | "task.completed" | "automation.completed" | "automation.failed" | "home.opportunity"; target: { kind: "chat"; conversationId: string; assistant?: boolean | undefined; } | { kind: "task"; taskId: string; } | { kind: "home"; } | { kind: "automation_run"; automationId: string; runId: string; } | { kind: "work_discovery"; runId: string; conversationId: string; }; priority: "normal" | "high"; title: { en: string; zh: string; }; payload: Record; createdAt: number; body?: { en: string; zh: string; } | undefined; } | null; drain(): Promise; private deliverPending; private send; private retryOrFail; }