import { refreshExecutionStatus } from './execution-status.js'; import type { VideoExecutionPollResult, VideoExecutionReport, VideoProductionMode } from './types.js'; /** * Every provider job this project is still waiting for, job id -> its route: * the last report's job AND every per-scene job whose candidate is still * `pending`. `execute-abandon` and `execute-bind` act on the same set, so they * read it from one place — two copies had already begun to drift. */ export declare function jobsWaitedFor(report: VideoExecutionReport | null, candidates: { scenes: Array<{ candidates: Array<{ status: string; route: string; source: { externalJobId?: string; }; }>; }>; } | null): Map; export interface AbandonedJob { externalJobId: string; routeId: string; abandonedScenes: number[]; untouchedScenes: Array<{ sceneIndex: number; status: string; }>; /** Candidates that were `pending` on this job and are now `failed`. */ candidateIds: string[]; } /** * Stop WAITING on jobs the provider has left in flight. `execute-cancel` is * honest about routes with no provider-side cancel (it answers `unsupported` and * changes nothing), which left no way to end a poll that only ends when the * provider says so. This is that lever under its real name: abandoning makes no * provider call, the job keeps running and keeps billing, its clip is never * collected, and it cannot be undone. Without `confirm` it only reports the plan. * * Which jobs: `jobIds` when given; otherwise the last report's job AND every * candidate still `pending` on one of these routes. A per-scene `produce --scene * N` is its own job, and a later submit overwrites the single report, so the * wedged job is usually one only the candidate list still remembers. * * A whole job is abandoned, never some of its scenes: the poll reports `failed` * as soon as one scene has, so a sibling scene that finished later would be * downloaded and never ingested. */ export declare function abandonExecution(projectSlug: string, options?: { root?: string; productionMode?: VideoProductionMode; env?: NodeJS.ProcessEnv; /** Abandon exactly these provider jobs; default is every job still being waited for. */ jobIds?: string[]; /** false/omitted = report the plan and change nothing. */ confirm?: boolean; /** Injectable status poll (tests). Default: the real `refreshExecutionStatus`. */ refreshStatus?: typeof refreshExecutionStatus; }): Promise<{ reportPath: string; report: VideoExecutionReport | null; /** Present once the abandon happened: the status poll that followed it. */ poll?: VideoExecutionPollResult; /** Set when the abandon happened but the status poll after it could not run (for instance a stale director review). The abandon stands. */ statusPollError?: string; abandonment: { /** false = nothing was changed; pass --confirm-abandon to do it. */ applied: boolean; jobs: AbandonedJob[]; /** Jobs a sweep left alone because their saved state could not be read, each with why; the others were still abandoned. */ notAbandoned?: string[]; providerJobsStillRunning: true; canBeUndone: false; }; }>; //# sourceMappingURL=execution-abandon.d.ts.map