New @boocode/ion package (v0.0.1) for inference optimization network. .codesight/ wiki artifacts for codebase documentation. .omo/ work plans for openspec cleanup and enhanced file panel.
55 lines
1.5 KiB
TypeScript
55 lines
1.5 KiB
TypeScript
/**
|
|
* `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<ResumeResult> {
|
|
throw new Error('not implemented yet: resumeWorkflowRun');
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Command handler
|
|
// ---------------------------------------------------------------------------
|
|
|
|
export async function resumeCommand(
|
|
args: string[],
|
|
options: CliOptions,
|
|
): Promise<void> {
|
|
if (args.length === 0) {
|
|
throw new Error('Missing required argument: <run-id>\n\nUsage: workflow resume <run-id> [--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}`);
|
|
}
|
|
} |