/** * `resume` — clear pause and any pane-recovery pin. Does NOT re-arm. * * A running daemon is woken over its loopback control port so the resumed * project is dispatched on a pass that starts immediately instead of after * the five-minute tick (#380); when no daemon is alive there is nothing to * wake and the output says so rather than implying an immediate pass happened. * * Moved out of cli.ts's switch by the per-verb module split (#462); * only the case wrapper, the injected `ctx` lookups and the imports * changed from the original bodies. */ import type { CommandContext } from "./context.ts"; import { armState, clearPaneHaltIfResolvable, releaseHold } from "../fleet.ts"; import { acknowledgeUpgradeRecovery } from "../upgrade-verify.ts"; import { wakeDispatch } from "../wake.ts"; export async function resumeCommand(ctx: CommandContext): Promise { for (const project of ctx.targetProjects()) { // `releaseHold(project)` also removes the host-global sentinel. Record an // unresolved recovery acknowledgement first even when a project-local pause // shadows that global fence; the helper is a no-op when nothing is owed. acknowledgeUpgradeRecovery(); releaseHold(project.name); const pin = clearPaneHaltIfResolvable(project.name); const arm = armState(project.name); process.stdout.write( `resumed — claiming allowed — ${await wakeDispatch(project.name)}\n` + (pin.wasHalted ? `pane recovery pin cleared — ${pin.path}\n` : "no pane recovery pin to clear\n") + (arm.armed ? `ticks remain armed — marker ${arm.path}\n` : "ticks stay disarmed — run `omp-conductor arm`\n"), ); } }