import { type OrgDaemon, type RunningOrg } from './daemon.js'; /** How long an auto-dispatched task is held before it enters the assignee's * mailbox. * * #275: a coordinator routinely calls org_task and, in the same turn, org_send * with the briefing that task is about. Each push is its own mailbox entry and * Mailbox.stream() yields one entry per SDK user turn, so an immediate push * made the assignee's first turn the bare task title with the briefing * stranded behind it — the role saw a title with no context and had to ask for * a resend. Holding the dispatch for a beat lets the same-turn message join * it, and both arrive as one message. Long enough for the rest of a tool-call * batch to land, short enough to be invisible next to an LLM turn. */ export declare const DISPATCH_COALESCE_MS = 500; /** Hold `line` for the assignee, merging it with anything else queued for the * same coalescing window (further dispatches, and same-turn messages folded in * by cross-org.ts's pushMessage). The recipient is resolved again at flush * time so a role replaced during the window gets the message in its new * mailbox rather than the retired one. A line about `taskId` is withdrawn * if the task is cancelled first (dispatch-hold.ts); `received` says the * assignee already has the task (a follow-up, not its dispatch). */ export declare function queueDispatch(running: RunningOrg, assignee: string, line: string | Promise, taskId?: string, received?: boolean): void; /** One message is routed, and counted against the session cap, by the task tags * it opens paragraphs with (messageTaskIds), and a mail's body is never read for * one. A batch therefore puts its task paragraphs first, in arrival order, and * the mail folded in after them, also in arrival order: whatever order the lines * were queued in, the same lines give the same message. */ export declare function batchOrder(lines: string[]): string[]; /** A role can end its turn with its own task still open and nothing notices. * On the 2.15.6 release run the publisher reported its results with org_send * and ended its turn without calling org_task_done: the coordinator waited on * a completion that never came and the run sat still for ~10 minutes until a * human nudged it, because the only backstop is the org-wide idle watchdog * (run_config.idle_minutes — 45 in that org). * * Called when the role's turn ends (its session goes idle / its process * parks). Deliberately narrow, so it stays a nudge and not a second watchdog: * only a 'running' task — which means dispatched, and excludes a task blocked * on a real-world time (org_task_block) and one whose close was refused and * requeued — only when nothing else is queued or coalescing for the assignee * (it would be mid-turn again, possibly on a task it has not received yet), * and at most once per task per dispatch (dispatchReadyTasks re-arms it). * A task the role DID close this turn is terminal by now, so it is skipped by * the same status check. The idle watchdog is untouched. */ export declare function nudgeOpenTasksAtTurnEnd(running: RunningOrg, role: string): void; export declare function dispatchReadyTasks(daemon: OrgDaemon, org: string, running: RunningOrg): void; //# sourceMappingURL=dag-dispatch.d.ts.map