/** * wait Command - verification after a wait (--verify / --require-work) and exit-code merging * Issue #3964: split out of wait.ts. */ import type { WaitOptions } from '../types'; import { ApiClient } from '../utils/api-client'; /** True when the caller asked for a verdict rather than "the agent stopped". */ export declare function verifyRequested(options: WaitOptions): boolean; /** * Whether this poll outcome should still be handed to the verification gates. * * A completion is the obvious case. NOT_STARTED joins it (Issue #1628) so the * operator gets the gate results instead of a bare "no session": work committed * by an agent whose session has since gone away is still worth reporting. The * verdict is merged rather than substituted — mergeExitCode never lets a passing * run overwrite NOT_STARTED, so "wait never saw this agent" survives to the exit * code even when the gates are green. */ export declare function shouldVerify(exitCode: number, options: WaitOptions): boolean; /** * Read the task this wait is about, before waiting for it (Issue #1620). * * Timing is the whole point. Agents are asked to run the gates themselves * before reporting completion, and doing so moves their task to a terminal * status — after which a verification run started with only a worktree id has * no contract to resolve, judges no scope, and still reports `passed`. Read * while the task is still in flight, the id survives that transition and the * run that follows is judged against the contract it was supposed to judge. * * Never throws: an unreadable ledger costs the attribution, and refusing to * verify over it would cost every gate. The one exception is a client deadline * (`--timeout`, Issue #3983), which is rethrown as the exit 124 it is. * * @returns the task id, or undefined to leave resolution to the server */ export declare function resolveWaitedTaskId(client: ApiClient, worktreeId: string): Promise; /** * Run verification for one worktree after its completion was detected. * * Swallows ApiError into an exit code: with several worktrees in flight, one * unreachable run must not abort the verdicts of the others. */ export declare function verifyAfterWait(client: ApiClient, worktreeId: string, options: WaitOptions, taskId: string | undefined): Promise; /** * Fold one worktree's exit code into the aggregate. * * Ranked codes (see WAIT_EXIT_CODE_PRIORITY) beat unranked infrastructure * codes, and among equals the first one observed stands. */ export declare function mergeExitCode(current: number, candidate: number): number; //# sourceMappingURL=wait-verify.d.ts.map