/** * Stopping and removing runs: `/workflow cancel` (spec §6.4) and `/workflow delete` (spec §6.5). * * The two are deliberately sequential — a live run must be cancelled before it can be deleted — so * removal is always a second, deliberate act. */ import type { ActiveRuns } from "../active-runs.ts"; import type { RunStatus } from "../resume-router.ts"; import type { RunStore } from "../types.ts"; import { type NotifyCtx } from "./context.ts"; /** * The live/stopped split the two commands turn on (spec §6.4/§6.5): a live run can be cancelled but * not deleted, a stopped one the reverse. Stated once, so completion (spec §14.4) can filter run-ids * by the rule the handlers enforce instead of carrying a second copy of the status list. */ export declare function isLiveRun(status: RunStatus): boolean; /** * `/workflow cancel [run-id]` (spec §6.4, §10.2). Two distinct cases: * * - **Executing run** — durably record cancellation, then abort its signal; the engine stops at the * next step boundary (spec §8.6). * - **Blocked run** — there is nothing executing to abort, so cancel it *cold*: append * `run-cancelled` to its log. Spec §10.2 requires that stopping * a blocked run works, and the dismissal hint points users straight here. * * Bare targets the sole local execution, or the sole blocked run when none is executing. With several * local executions or blocked runs a run-id is required — in full, by its hash, or by any unique prefix * ({@link resolveRunRef}). */ export declare function handleCancel(ctx: NotifyCtx, activeRuns: ActiveRuns, store: RunStore, runRef: string | undefined): Promise; /** * `/workflow delete ` (spec §6.5) — permanently remove a **stopped** run. A live run * (`in_progress`/`blocked`) is rejected: cancel it first, so the removal is always a deliberate second act. */ export declare function handleDelete(ctx: NotifyCtx, store: RunStore, runRef: string): Promise; //# sourceMappingURL=lifecycle.d.ts.map