import type { ServerResponse } from "node:http"; /** * The claim gate the two pickup routes share (ICI-729). * * Both `POST /api/delegations` onto an existing Todo and `POST * /api/work-items/:id/dispatch` used to ask "does this Todo have a live session?" * and then spawn one — two facts, and a second request fits between them. Both * now take the claim instead, and the answer they get back IS the decision. * * Each returns undefined once it has already answered the caller, the same shape * as `requireTodoRouteId` and the other route guards: `if (!claim) return;`. */ export interface RouteTodoClaim { owner: string; /** Name the session doing the work, so the claim ends when the attempt does * rather than at the end of the lease. */ bind(sessionId: string): void; /** Hand the Todo straight back. Every path that claims and then fails to * spawn calls this, or the Todo would sit unavailable for the whole lease. */ release(): void; } /** * Claim a Todo for a delegation. A Dispatcher handing its own Todo to the * employee it picked is the one caller allowed past a live claim: it is not a * second worker, it is the same work moving on, so it gives its claim up first. * * A delegation that MINTED its Todo claims too. Nothing can be racing it yet, * but the claim is what the next pickup path reads: without one, the second * delegation onto that Todo finds it free and works it a second time. */ export declare function claimTodoForDelegation(res: ServerResponse, workItemId: string, dispatcherCallerId?: string): RouteTodoClaim | undefined; /** * Claim a Todo for the built-in Dispatcher. A Dispatcher already working this * Todo IS the idempotency receipt — repeat clicks get it back rather than a * second one — but anything else holding the Todo is somebody else's work, and * a second Dispatcher on top of it is exactly what this gate exists to refuse. */ export declare function claimTodoForDispatch(res: ServerResponse, workItemId: string): RouteTodoClaim | undefined; //# sourceMappingURL=todo-claim.d.ts.map