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.
67 lines
1.8 KiB
TypeScript
67 lines
1.8 KiB
TypeScript
/**
|
|
* `workflow status` — Show active (running + paused) workflow runs.
|
|
*
|
|
* @example
|
|
* workflow status
|
|
* workflow status --json
|
|
*/
|
|
|
|
import type { CliOptions } from '../utils.js';
|
|
import { printTable, printJson, formatDuration } from '../utils.js';
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Stub: engine integration (not implemented yet)
|
|
// ---------------------------------------------------------------------------
|
|
|
|
interface ActiveRun {
|
|
id: string;
|
|
workflowName: string;
|
|
status: string;
|
|
duration: number; // ms
|
|
currentNode?: string;
|
|
}
|
|
|
|
async function getActiveRuns(_cwd?: string): Promise<ActiveRun[]> {
|
|
throw new Error('not implemented yet: getActiveRuns');
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Command handler
|
|
// ---------------------------------------------------------------------------
|
|
|
|
export async function statusCommand(
|
|
_args: string[],
|
|
options: CliOptions,
|
|
): Promise<void> {
|
|
const runs = await getActiveRuns(options.cwd);
|
|
|
|
if (options.json) {
|
|
printJson(runs);
|
|
return;
|
|
}
|
|
|
|
if (runs.length === 0) {
|
|
console.log('No active workflow runs.');
|
|
return;
|
|
}
|
|
|
|
console.log('Active workflow runs:');
|
|
console.log('');
|
|
|
|
printTable(
|
|
runs.map((r) => ({
|
|
id: r.id,
|
|
workflow: r.workflowName,
|
|
status: r.status,
|
|
duration: formatDuration(r.duration),
|
|
currentNode: r.currentNode ?? '-',
|
|
})),
|
|
[
|
|
{ header: 'ID', field: 'id', minWidth: 26 },
|
|
{ header: 'Workflow', field: 'workflow', minWidth: 20 },
|
|
{ header: 'Status', field: 'status', minWidth: 10 },
|
|
{ header: 'Duration', field: 'duration', minWidth: 10 },
|
|
{ header: 'Current Node', field: 'currentNode', minWidth: 15 },
|
|
],
|
|
);
|
|
} |