/** * `workflow resume` — Resume a failed workflow run. * * Skips completed nodes and re-executes from the failure point. * * @example * workflow resume abc123 * workflow resume abc123 --json */ import type { CliOptions } from '../utils.js'; import { printJson } from '../utils.js'; // --------------------------------------------------------------------------- // Stub: engine integration (not implemented yet) // --------------------------------------------------------------------------- interface ResumeResult { runId: string; resumed: boolean; message: string; } async function resumeWorkflowRun(_runId: string): Promise { throw new Error('not implemented yet: resumeWorkflowRun'); } // --------------------------------------------------------------------------- // Command handler // --------------------------------------------------------------------------- export async function resumeCommand( args: string[], options: CliOptions, ): Promise { if (args.length === 0) { throw new Error('Missing required argument: \n\nUsage: workflow resume [--json]'); } const runId = args[0]!; const result = await resumeWorkflowRun(runId); if (options.json) { printJson(result); return; } if (result.resumed) { console.log(`↻ Run ${result.runId} resumed.`); console.log(` ${result.message}`); } else { console.log(`Failed to resume run ${result.runId}: ${result.message}`); } }