import type { Database as DatabaseType } from "better-sqlite3"; /** PLA-157: why a stopped Todo stopped, and what ends the wait. * * A Todo held by a quota window and a Todo held by a human decision both sit in * `blocked`/`escalated`, so the board cannot tell a clock-wait from a you-wait * and its "N waiting" count is a lie. `parked_until` names the moment a * clock-wait is over; `unblock_what`/`unblock_who` name the person and the act * that ends a human-wait. * * Additive, never columns on `work_items`: the exact-shape verifier refuses any * drift in an existing table, so a new table is the only extension a deployed * database can survive. * * The row belongs to the stop, not to the Todo — `transition()` deletes it the * moment the Todo is no longer stopped, so a countdown can never outlive the * wait it was counting. */ export declare const WORK_ITEM_STOP_CAUSE_DDL = "\nCREATE TABLE IF NOT EXISTS work_item_stop_cause (\n work_item_id TEXT PRIMARY KEY REFERENCES work_items(id) ON DELETE CASCADE,\n parked_until TEXT,\n unblock_what TEXT,\n unblock_who TEXT,\n updated_at TEXT NOT NULL\n)"; /** What has to happen, and who has to do it. Free text: the point is that a * human reading the card knows whether it is their move. */ export interface TodoUnblockHint { what: string; who: string; } export interface TodoStopCause { /** ISO; present only while the park is still in the future. */ parkedUntil?: string; unblockHint?: TodoUnblockHint; } /** The message every surface refuses a malformed hint with — one validator, so * the HTTP route and the MCP tool cannot accept what the other rejects. */ export declare const UNBLOCK_HINT_ERROR = "unblockHint must be an object with non-empty what and who strings, and no other keys"; export declare const PARKED_UNTIL_ERROR = "parkedUntil must be an ISO-8601 timestamp"; export declare const UNBLOCK_HINT_REQUIRED = "unblockHint {what, who} is required when escalating a Todo \u2014 an escalation nobody can act on is not an escalation"; /** `undefined` when the caller said nothing, `null` when what it said is not a * hint — an escalation stored with half a hint reads as an answer nobody gave. */ export declare function parseUnblockHint(value: unknown): TodoUnblockHint | null | undefined; /** `undefined` when the caller said nothing, `null` when the value is not a * timestamp this process can compare against the clock. */ export declare function parseParkedUntil(value: unknown): string | null | undefined; /** Expiry is what the clock says, not what a sweeper got around to. A park that * has passed — or one that will not parse, because fail-open is the only safe * direction for a field that hides work from the operator — is not a park. */ export declare function isParked(parkedUntil: string | null | undefined, now?: number): boolean; /** The Todo's stop cause, or undefined when it has none left to tell. Takes the * caller's `db` so it reads inside the caller's transaction. */ export declare function readStopCause(db: DatabaseType, workItemId: string, now?: number): TodoStopCause | undefined; /** Replace the Todo's stop cause. Called inside the status write's transaction, * so the cause and the stop it explains commit together or not at all. */ export declare function writeStopCause(db: DatabaseType, workItemId: string, cause: TodoStopCause, at: string): void; /** Drop the cause when the Todo is no longer stopped. Unlike the block record * this does NOT survive the unblock: it describes one wait, and that wait is * over the moment the Todo moves. */ export declare function clearStopCause(db: DatabaseType, workItemId: string): void; //# sourceMappingURL=stop-cause.d.ts.map