/** * Which lines held in a dispatch coalescing window (decisions.ts's * queueDispatch) belong to which task, so a cancel can withdraw them. * * A dispatch is held for DISPATCH_COALESCE_MS, and longer while its skill * suggestion resolves, but a cancel notice goes straight to the mailbox: the * assignee could read "CANCELLED" for a task it had not been given, then * receive the task and start it. A task the assignee never received is now * withdrawn from the window and needs no notice; a held line for a task that * was cancelled meanwhile is dropped at delivery. */ import type { RunningOrg } from './daemon.js'; type Line = string | Promise; type Held = NonNullable extends Map ? E : never; /** Record that `line`, held in `entry`, is about `taskId`; `received` when * it is a follow-up on a task the assignee already has, not its dispatch. */ export declare function holdTaskLine(running: RunningOrg, entry: Held, line: Line, taskId: string, received: boolean): void; /** Await every held line, again while lines keep joining or leaving, and * return the settled snapshot with its resolved text. */ export declare function resolveHeld(entry: Held): Promise<{ held: Line[]; lines: string[]; }>; /** The resolved lines still worth delivering: a line about a task that is * cancelled by now is dropped. The tasks of the delivered lines are recorded. */ export declare function settleHeld(running: RunningOrg, entry: Held, held: Line[], lines: string[]): string[]; /** Withdraw every line held for `taskId` in `assignee`'s window. `received` * says whether the assignee has had a line about the task before. */ export declare function withdrawHeldTask(running: RunningOrg, assignee: string, taskId: string): { withdrawn: boolean; received: boolean; }; export {}; //# sourceMappingURL=dispatch-hold.d.ts.map