import type { ISessionClient } from "../platform/ports/session-client.ts"; import type { DispatchTask, NotificationPayload } from "./types.ts"; export declare const NOTIFY_MAX_RETRIES = 3; export declare const NOTIFY_BASE_DELAY_MS = 500; export declare const NOTIFY_MAX_DELAY_MS = 5000; export interface NotifyOpts { maxRetries?: number; baseDelayMs?: number; maxDelayMs?: number; } export declare const DISPATCH_COMPLETION_MARKER = "[BACKGROUND TASK COMPLETED]"; export declare const DISPATCH_ALL_COMPLETE_MARKER = "[ALL BACKGROUND TASKS COMPLETE]"; export declare const DISPATCH_RECOVERY_MARKER = "[RECOVERY: PENDING TASKS DROPPED]"; export declare const DISPATCH_PROGRESS_MILESTONE_MARKER = "[PROGRESS MILESTONE]"; /** * Marker for graph-node-completion reminders injected into the emperor session * by the graph notifier (`src/graph/engine/graph-notify.ts`). Like every other * parent-targeted reminder, it is part of {@link DISPATCH_NOTIFICATION_MARKERS} * so the re-entering chat.message hook recognizes it as a non-user turn and does * NOT reset the auto-continue counter. */ export declare const GRAPH_COMPLETION_MARKER = "[GRAPH NODE COMPLETED]"; /** * Marker for graph-terminal reminders (GRAPH COMPLETE) injected into the emperor * session by the graph terminal notifier (`src/graph/engine/graph-notify.ts`). * Like every other parent-targeted reminder, it is part of * {@link DISPATCH_NOTIFICATION_MARKERS} so the re-entering chat.message hook * recognizes it as a non-user turn. */ export declare const GRAPH_COMPLETE_MARKER = "[GRAPH COMPLETE]"; /** * Marker for graph-terminal reminders (GRAPH BLOCKED) injected into the emperor * session by the graph terminal notifier (`src/graph/engine/graph-notify.ts`). * Distinct from GRAPH_COMPLETE_MARKER so a graph that is blocked-then-resumed-then-completed * produces two distinct terminal reminders with different markers. */ export declare const GRAPH_BLOCKED_MARKER = "[GRAPH BLOCKED]"; /** * Marker for graph-node-stall reminders injected into the emperor session by * the graph stall notifier (`src/graph/engine/graph-notify.ts`). Like every * other parent-targeted reminder, it is part of * {@link DISPATCH_NOTIFICATION_MARKERS} so the re-entering chat.message hook * recognizes it as a non-user turn and does NOT reset the auto-continue * counter. */ export declare const GRAPH_STALL_MARKER = "[GRAPH NODE STALLED]"; /** * Marker for the startup-time "pending approvals" aggregation reminder injected * into the emperor session once when the Pi extension boots (subtask 4). It * summarizes every `blocked` `needs_approval` gate recovered from the persisted * store so a restart never silently drops an awaiting-human decision. Like every * other parent-targeted reminder, it is part of * {@link DISPATCH_NOTIFICATION_MARKERS} so the re-entering chat.message hook * recognizes it as a non-user turn and does NOT reset the auto-continue counter. */ export declare const PENDING_APPROVALS_MARKER = "[PENDING APPROVALS]"; export declare const DISPATCH_NOTIFICATION_MARKERS: readonly ["[BACKGROUND TASK COMPLETED]", "[ALL BACKGROUND TASKS COMPLETE]", "[RECOVERY: PENDING TASKS DROPPED]", "[PROGRESS MILESTONE]", "[GRAPH NODE COMPLETED]", "[GRAPH COMPLETE]", "[GRAPH BLOCKED]", "[GRAPH NODE STALLED]", "[PENDING APPROVALS]"]; export declare function isDispatchNotification(text: string): boolean; export declare function clearSentFinalNotifies(): void; export declare function seedSentFinalNotifies(ids: Iterable): void; export declare function getSentFinalNotifies(): Set; export declare function clearParentQueues(): void; export declare function hasFinalNotifyBeenSent(taskId: string): boolean; export declare function enqueueNotify(parentSessionId: string, fn: () => Promise): Promise; /** * Build `` XML for a completed background task. * Uses intermediate format when tasks remain, final format when all done. */ export declare function buildNotificationText(payload: NotificationPayload): string; /** * Send `` to parent session via `promptAsync`. * Serialized per parent session to prevent race conditions. * `noReply: true` for intermediate; `noReply: false` for final. */ export declare function notifyParent(client: ISessionClient, task: DispatchTask, remainingProvider: (() => number) | number, opts?: NotifyOpts, resultText?: string): Promise; //# sourceMappingURL=notification.d.ts.map