@fractary/faber-cli 1.5.18 → 1.5.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/init.js +1 -1
- package/dist/commands/plan/index.js +1 -1
- package/dist/commands/session.d.ts +15 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +103 -0
- package/dist/commands/workflow/index.d.ts +16 -0
- package/dist/commands/workflow/index.d.ts.map +1 -1
- package/dist/commands/workflow/index.js +174 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -107
- package/package.json +1 -1
package/dist/commands/init.js
CHANGED
|
@@ -11,7 +11,7 @@ import os from 'os';
|
|
|
11
11
|
import path from 'path';
|
|
12
12
|
import { loadYamlConfig, writeYamlConfig, configExists, oldSettingsExists, getConfigPath, getOldSettingsPath } from '../lib/yaml-config.js';
|
|
13
13
|
export function createInitCommand() {
|
|
14
|
-
return new Command('
|
|
14
|
+
return new Command('configure')
|
|
15
15
|
.description('Initialize FABER section in unified config.yaml')
|
|
16
16
|
.option('--force', 'Overwrite existing FABER configuration')
|
|
17
17
|
.option('--json', 'Output as JSON')
|
|
@@ -16,7 +16,7 @@ import path from 'path';
|
|
|
16
16
|
* Create the plan command
|
|
17
17
|
*/
|
|
18
18
|
export function createPlanCommand() {
|
|
19
|
-
return new Command('plan')
|
|
19
|
+
return new Command('workflow-plan')
|
|
20
20
|
.description('Plan workflows for GitHub issues')
|
|
21
21
|
.option('--work-id <ids>', 'Comma-separated list of work item IDs (e.g., "258,259,260")')
|
|
22
22
|
.option('--work-label <labels>', 'Comma-separated label filters (e.g., "workflow:etl,status:approved")')
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session commands - Load and save FABER workflow session context
|
|
3
|
+
*
|
|
4
|
+
* Provides session-load and session-save commands via SessionManager SDK.
|
|
5
|
+
*/
|
|
6
|
+
import { Command } from 'commander';
|
|
7
|
+
/**
|
|
8
|
+
* Create the session-load command
|
|
9
|
+
*/
|
|
10
|
+
export declare function createSessionLoadCommand(): Command;
|
|
11
|
+
/**
|
|
12
|
+
* Create the session-save command
|
|
13
|
+
*/
|
|
14
|
+
export declare function createSessionSaveCommand(): Command;
|
|
15
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/commands/session.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CA4ClD;AAED;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CA2BlD"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session commands - Load and save FABER workflow session context
|
|
3
|
+
*
|
|
4
|
+
* Provides session-load and session-save commands via SessionManager SDK.
|
|
5
|
+
*/
|
|
6
|
+
import { Command } from 'commander';
|
|
7
|
+
import chalk from 'chalk';
|
|
8
|
+
import { SessionManager } from '@fractary/faber';
|
|
9
|
+
/**
|
|
10
|
+
* Create the session-load command
|
|
11
|
+
*/
|
|
12
|
+
export function createSessionLoadCommand() {
|
|
13
|
+
return new Command('session-load')
|
|
14
|
+
.description('Load active workflow session context')
|
|
15
|
+
.option('--work-id <id>', 'Work item ID to find session for')
|
|
16
|
+
.option('--run-id <id>', 'Specific run ID to load')
|
|
17
|
+
.option('--json', 'Output as JSON')
|
|
18
|
+
.action(async (options) => {
|
|
19
|
+
try {
|
|
20
|
+
const sessionManager = new SessionManager();
|
|
21
|
+
const context = sessionManager.loadSession({
|
|
22
|
+
workId: options.workId,
|
|
23
|
+
runId: options.runId,
|
|
24
|
+
});
|
|
25
|
+
if (options.json) {
|
|
26
|
+
console.log(JSON.stringify({ status: 'success', data: context }, null, 2));
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
if (!context.active) {
|
|
30
|
+
console.log(chalk.yellow('No active session found'));
|
|
31
|
+
if (options.workId) {
|
|
32
|
+
console.log(chalk.gray(` No runs found for work item #${options.workId}`));
|
|
33
|
+
}
|
|
34
|
+
if (options.runId) {
|
|
35
|
+
console.log(chalk.gray(` Run not found: ${options.runId}`));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
console.log(chalk.bold('Active Session'));
|
|
40
|
+
if (context.runId) {
|
|
41
|
+
console.log(` Run ID: ${context.runId}`);
|
|
42
|
+
}
|
|
43
|
+
if (context.workId) {
|
|
44
|
+
console.log(` Work ID: ${context.workId}`);
|
|
45
|
+
}
|
|
46
|
+
if (context.state) {
|
|
47
|
+
const state = context.state;
|
|
48
|
+
console.log(` Status: ${state['status'] || 'unknown'}`);
|
|
49
|
+
console.log(` Phase: ${state['current_phase'] || 'unknown'}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
handleSessionError(error, options);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Create the session-save command
|
|
61
|
+
*/
|
|
62
|
+
export function createSessionSaveCommand() {
|
|
63
|
+
return new Command('session-save')
|
|
64
|
+
.description('Save workflow session (set active run)')
|
|
65
|
+
.requiredOption('--run-id <id>', 'Run ID to set as active')
|
|
66
|
+
.option('--work-id <id>', 'Work item ID (for reference)')
|
|
67
|
+
.option('--json', 'Output as JSON')
|
|
68
|
+
.action(async (options) => {
|
|
69
|
+
try {
|
|
70
|
+
const sessionManager = new SessionManager();
|
|
71
|
+
sessionManager.saveSession({
|
|
72
|
+
runId: options.runId,
|
|
73
|
+
workId: options.workId,
|
|
74
|
+
});
|
|
75
|
+
if (options.json) {
|
|
76
|
+
console.log(JSON.stringify({
|
|
77
|
+
status: 'success',
|
|
78
|
+
data: { runId: options.runId, saved: true },
|
|
79
|
+
}, null, 2));
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
console.log(chalk.green(`✓ Session saved`));
|
|
83
|
+
console.log(chalk.gray(` Active run: ${options.runId}`));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
handleSessionError(error, options);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function handleSessionError(error, options) {
|
|
92
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
93
|
+
if (options.json) {
|
|
94
|
+
console.error(JSON.stringify({
|
|
95
|
+
status: 'error',
|
|
96
|
+
error: { code: 'SESSION_ERROR', message },
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
console.error(chalk.red('Error:'), message);
|
|
101
|
+
}
|
|
102
|
+
process.exit(1);
|
|
103
|
+
}
|
|
@@ -28,4 +28,20 @@ export declare function createRecoverCommand(): Command;
|
|
|
28
28
|
* Create the workflow-cleanup command
|
|
29
29
|
*/
|
|
30
30
|
export declare function createCleanupCommand(): Command;
|
|
31
|
+
/**
|
|
32
|
+
* Create the workflow-create command
|
|
33
|
+
*/
|
|
34
|
+
export declare function createWorkflowCreateCommand(): Command;
|
|
35
|
+
/**
|
|
36
|
+
* Create the workflow-update command
|
|
37
|
+
*/
|
|
38
|
+
export declare function createWorkflowUpdateCommand(): Command;
|
|
39
|
+
/**
|
|
40
|
+
* Create the workflow-inspect command
|
|
41
|
+
*/
|
|
42
|
+
export declare function createWorkflowInspectCommand(): Command;
|
|
43
|
+
/**
|
|
44
|
+
* Create the workflow-debugger command
|
|
45
|
+
*/
|
|
46
|
+
export declare function createWorkflowDebuggerCommand(): Command;
|
|
31
47
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/workflow/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/workflow/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAapC;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAkD1C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAiF7C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAyB7C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAoB5C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CA2B9C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CA8B9C;AAED;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,OAAO,CAoCrD;AAED;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,OAAO,CA4BrD;AAED;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,OAAO,CA0CtD;AAED;;GAEG;AACH,wBAAgB,6BAA6B,IAAI,OAAO,CAkDvD"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { Command } from 'commander';
|
|
7
7
|
import chalk from 'chalk';
|
|
8
|
-
import { FaberWorkflow, StateManager } from '@fractary/faber';
|
|
8
|
+
import { FaberWorkflow, StateManager, createWorkflow, updateWorkflow, inspectWorkflow, debugWorkflow, } from '@fractary/faber';
|
|
9
9
|
import { parsePositiveInteger } from '../../utils/validation.js';
|
|
10
10
|
/**
|
|
11
11
|
* Create the workflow-run command
|
|
@@ -264,6 +264,179 @@ export function createCleanupCommand() {
|
|
|
264
264
|
}
|
|
265
265
|
});
|
|
266
266
|
}
|
|
267
|
+
/**
|
|
268
|
+
* Create the workflow-create command
|
|
269
|
+
*/
|
|
270
|
+
export function createWorkflowCreateCommand() {
|
|
271
|
+
return new Command('workflow-create')
|
|
272
|
+
.description('Create a new workflow definition')
|
|
273
|
+
.argument('<name>', 'Workflow name (lowercase, hyphens allowed)')
|
|
274
|
+
.option('--template <id>', 'Copy from existing workflow template')
|
|
275
|
+
.option('--description <text>', 'Workflow description')
|
|
276
|
+
.option('--json', 'Output as JSON')
|
|
277
|
+
.action(async (name, options) => {
|
|
278
|
+
try {
|
|
279
|
+
const result = createWorkflow({
|
|
280
|
+
name,
|
|
281
|
+
template: options.template,
|
|
282
|
+
description: options.description,
|
|
283
|
+
});
|
|
284
|
+
if (options.json) {
|
|
285
|
+
console.log(JSON.stringify({
|
|
286
|
+
status: 'success',
|
|
287
|
+
data: {
|
|
288
|
+
entry: result.entry,
|
|
289
|
+
filePath: result.filePath,
|
|
290
|
+
manifestPath: result.manifestPath,
|
|
291
|
+
},
|
|
292
|
+
}, null, 2));
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
console.log(chalk.green(`✓ Created workflow: ${name}`));
|
|
296
|
+
console.log(chalk.gray(` File: ${result.filePath}`));
|
|
297
|
+
console.log(chalk.gray(` Manifest: ${result.manifestPath}`));
|
|
298
|
+
if (options.template) {
|
|
299
|
+
console.log(chalk.gray(` Template: ${options.template}`));
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
catch (error) {
|
|
304
|
+
handleWorkflowError(error, options);
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Create the workflow-update command
|
|
310
|
+
*/
|
|
311
|
+
export function createWorkflowUpdateCommand() {
|
|
312
|
+
return new Command('workflow-update')
|
|
313
|
+
.description('Update a workflow definition')
|
|
314
|
+
.argument('<name>', 'Workflow name to update')
|
|
315
|
+
.option('--description <text>', 'New description')
|
|
316
|
+
.option('--json', 'Output as JSON')
|
|
317
|
+
.action(async (name, options) => {
|
|
318
|
+
try {
|
|
319
|
+
const entry = updateWorkflow({
|
|
320
|
+
name,
|
|
321
|
+
description: options.description,
|
|
322
|
+
});
|
|
323
|
+
if (options.json) {
|
|
324
|
+
console.log(JSON.stringify({
|
|
325
|
+
status: 'success',
|
|
326
|
+
data: entry,
|
|
327
|
+
}, null, 2));
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
console.log(chalk.green(`✓ Updated workflow: ${name}`));
|
|
331
|
+
if (options.description) {
|
|
332
|
+
console.log(chalk.gray(` Description: ${options.description}`));
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
catch (error) {
|
|
337
|
+
handleWorkflowError(error, options);
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Create the workflow-inspect command
|
|
343
|
+
*/
|
|
344
|
+
export function createWorkflowInspectCommand() {
|
|
345
|
+
return new Command('workflow-inspect')
|
|
346
|
+
.description('Inspect a workflow definition')
|
|
347
|
+
.argument('<name>', 'Workflow name to inspect')
|
|
348
|
+
.option('--json', 'Output as JSON')
|
|
349
|
+
.action(async (name, options) => {
|
|
350
|
+
try {
|
|
351
|
+
const result = inspectWorkflow({ workflowId: name });
|
|
352
|
+
if (options.json) {
|
|
353
|
+
console.log(JSON.stringify({
|
|
354
|
+
status: 'success',
|
|
355
|
+
data: result,
|
|
356
|
+
}, null, 2));
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
console.log(chalk.bold(`Workflow: ${result.entry.id}`));
|
|
360
|
+
if (result.entry.description) {
|
|
361
|
+
console.log(` Description: ${result.entry.description}`);
|
|
362
|
+
}
|
|
363
|
+
console.log(` File: ${result.filePath}`);
|
|
364
|
+
console.log(` File exists: ${result.fileExists ? chalk.green('yes') : chalk.red('no')}`);
|
|
365
|
+
if (result.fileSize !== undefined) {
|
|
366
|
+
console.log(` File size: ${result.fileSize} bytes`);
|
|
367
|
+
}
|
|
368
|
+
if (result.lastModified) {
|
|
369
|
+
console.log(` Last modified: ${result.lastModified}`);
|
|
370
|
+
}
|
|
371
|
+
if (result.content) {
|
|
372
|
+
const content = result.content;
|
|
373
|
+
if (content['phases'] && typeof content['phases'] === 'object') {
|
|
374
|
+
const phases = Object.keys(content['phases']);
|
|
375
|
+
console.log(` Phases: ${phases.join(', ')}`);
|
|
376
|
+
}
|
|
377
|
+
if (content['extends']) {
|
|
378
|
+
console.log(` Extends: ${content['extends']}`);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
catch (error) {
|
|
384
|
+
handleWorkflowError(error, options);
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Create the workflow-debugger command
|
|
390
|
+
*/
|
|
391
|
+
export function createWorkflowDebuggerCommand() {
|
|
392
|
+
return new Command('workflow-debugger')
|
|
393
|
+
.description('Debug a workflow run')
|
|
394
|
+
.option('--run-id <id>', 'Run ID to debug')
|
|
395
|
+
.option('--json', 'Output as JSON')
|
|
396
|
+
.action(async (options) => {
|
|
397
|
+
try {
|
|
398
|
+
if (!options.runId) {
|
|
399
|
+
throw new Error('--run-id is required');
|
|
400
|
+
}
|
|
401
|
+
const report = debugWorkflow(options.runId);
|
|
402
|
+
if (options.json) {
|
|
403
|
+
console.log(JSON.stringify({
|
|
404
|
+
status: 'success',
|
|
405
|
+
data: report,
|
|
406
|
+
}, null, 2));
|
|
407
|
+
}
|
|
408
|
+
else {
|
|
409
|
+
console.log(chalk.bold(`Debug Report: ${report.runId}`));
|
|
410
|
+
console.log(` Found: ${report.found ? chalk.green('yes') : chalk.red('no')}`);
|
|
411
|
+
if (report.state) {
|
|
412
|
+
const state = report.state;
|
|
413
|
+
console.log(chalk.cyan('\nState:'));
|
|
414
|
+
console.log(` Status: ${state['status']}`);
|
|
415
|
+
console.log(` Phase: ${state['current_phase']}`);
|
|
416
|
+
console.log(` Updated: ${state['updated_at']}`);
|
|
417
|
+
}
|
|
418
|
+
if (report.events && report.events.length > 0) {
|
|
419
|
+
console.log(chalk.cyan(`\nEvents: ${report.events.length}`));
|
|
420
|
+
const lastEvents = report.events.slice(-5);
|
|
421
|
+
lastEvents.forEach((e) => console.log(chalk.gray(` ${e}`)));
|
|
422
|
+
if (report.events.length > 5) {
|
|
423
|
+
console.log(chalk.gray(` ... and ${report.events.length - 5} more`));
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
if (report.issues.length > 0) {
|
|
427
|
+
console.log(chalk.yellow('\nIssues:'));
|
|
428
|
+
report.issues.forEach((i) => console.log(chalk.yellow(` - ${i}`)));
|
|
429
|
+
}
|
|
430
|
+
else {
|
|
431
|
+
console.log(chalk.green('\nNo issues detected'));
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
catch (error) {
|
|
436
|
+
handleWorkflowError(error, options);
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
}
|
|
267
440
|
// Helper functions
|
|
268
441
|
function getStateColor(state) {
|
|
269
442
|
switch (state) {
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAMH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAMH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqBpC;;GAEG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAoDxC"}
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,8 @@ import dotenv from 'dotenv';
|
|
|
10
10
|
dotenv.config();
|
|
11
11
|
import { Command } from 'commander';
|
|
12
12
|
import chalk from 'chalk';
|
|
13
|
-
import { createRunCommand, createStatusCommand, createResumeCommand, createPauseCommand, createRecoverCommand, createCleanupCommand } from './commands/workflow/index.js';
|
|
13
|
+
import { createRunCommand, createStatusCommand, createResumeCommand, createPauseCommand, createRecoverCommand, createCleanupCommand, createWorkflowCreateCommand, createWorkflowUpdateCommand, createWorkflowInspectCommand, createWorkflowDebuggerCommand } from './commands/workflow/index.js';
|
|
14
|
+
import { createSessionLoadCommand, createSessionSaveCommand } from './commands/session.js';
|
|
14
15
|
import { createWorkCommand } from './commands/work/index.js';
|
|
15
16
|
import { createRepoCommand } from './commands/repo/index.js';
|
|
16
17
|
import { createLogsCommand } from './commands/logs/index.js';
|
|
@@ -24,7 +25,7 @@ import { createRunsCommand } from './commands/runs.js';
|
|
|
24
25
|
if (process.stdout.isTTY) {
|
|
25
26
|
process.stdout._handle?.setBlocking?.(true);
|
|
26
27
|
}
|
|
27
|
-
const version = '1.5.
|
|
28
|
+
const version = '1.5.20';
|
|
28
29
|
/**
|
|
29
30
|
* Create and configure the main CLI program
|
|
30
31
|
*/
|
|
@@ -37,120 +38,23 @@ export function createFaberCLI() {
|
|
|
37
38
|
// Global options
|
|
38
39
|
program.option('--debug', 'Enable debug output');
|
|
39
40
|
// Workflow commands (top-level)
|
|
40
|
-
program.addCommand(createInitCommand()); //
|
|
41
|
+
program.addCommand(createInitCommand()); // configure
|
|
41
42
|
program.addCommand(createMigrateCommand()); // migrate
|
|
42
43
|
program.addCommand(createConfigCommand()); // config get/path/exists
|
|
43
44
|
program.addCommand(createRunsCommand()); // runs dir/plan-path/state-path
|
|
44
|
-
program.addCommand(createPlanCommand()); // plan
|
|
45
|
+
program.addCommand(createPlanCommand()); // workflow-plan
|
|
45
46
|
program.addCommand(createRunCommand()); // workflow-run
|
|
46
47
|
program.addCommand(createStatusCommand()); // run-inspect
|
|
47
48
|
program.addCommand(createResumeCommand()); // workflow-resume
|
|
48
49
|
program.addCommand(createPauseCommand()); // workflow-pause
|
|
49
50
|
program.addCommand(createRecoverCommand()); // workflow-recover
|
|
50
51
|
program.addCommand(createCleanupCommand()); // workflow-cleanup
|
|
51
|
-
//
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
program
|
|
56
|
-
|
|
57
|
-
.description('(DEPRECATED: Use init)')
|
|
58
|
-
.option('--force', 'Overwrite existing configuration')
|
|
59
|
-
.option('--json', 'Output as JSON')
|
|
60
|
-
.action((options) => {
|
|
61
|
-
showDeprecationWarning('workflow-init', 'init');
|
|
62
|
-
const initCmd = createInitCommand();
|
|
63
|
-
initCmd.parse(['', '', ...Object.entries(options).flatMap(([k, v]) => typeof v === 'boolean' && v ? [`--${k}`] : typeof v === 'string' ? [`--${k}`, v] : [])], { from: 'user' });
|
|
64
|
-
});
|
|
65
|
-
program
|
|
66
|
-
.command('run')
|
|
67
|
-
.description('(DEPRECATED: Use workflow-run)')
|
|
68
|
-
.requiredOption('--work-id <id>', 'Work item ID to process')
|
|
69
|
-
.option('--autonomy <level>', 'Autonomy level', 'supervised')
|
|
70
|
-
.option('--json', 'Output as JSON')
|
|
71
|
-
.action((options) => {
|
|
72
|
-
showDeprecationWarning('run', 'workflow-run');
|
|
73
|
-
const runCmd = createRunCommand();
|
|
74
|
-
runCmd.parse(['', '', '--work-id', options.workId,
|
|
75
|
-
...(options.autonomy ? ['--autonomy', options.autonomy] : []),
|
|
76
|
-
...(options.json ? ['--json'] : [])
|
|
77
|
-
], { from: 'user' });
|
|
78
|
-
});
|
|
79
|
-
program
|
|
80
|
-
.command('workflow-status')
|
|
81
|
-
.description('(DEPRECATED: Use run-inspect)')
|
|
82
|
-
.option('--work-id <id>', 'Work item ID to check')
|
|
83
|
-
.option('--workflow-id <id>', 'Workflow ID to check')
|
|
84
|
-
.option('--verbose', 'Show detailed status')
|
|
85
|
-
.option('--json', 'Output as JSON')
|
|
86
|
-
.action((options) => {
|
|
87
|
-
showDeprecationWarning('workflow-status', 'run-inspect');
|
|
88
|
-
const statusCmd = createStatusCommand();
|
|
89
|
-
statusCmd.parse(['', '', ...Object.entries(options).flatMap(([k, v]) => typeof v === 'boolean' && v ? [`--${k}`] : typeof v === 'string' ? [`--${k}`, v] : [])], { from: 'user' });
|
|
90
|
-
});
|
|
91
|
-
program
|
|
92
|
-
.command('status')
|
|
93
|
-
.description('(DEPRECATED: Use run-inspect)')
|
|
94
|
-
.option('--work-id <id>', 'Work item ID to check')
|
|
95
|
-
.option('--workflow-id <id>', 'Workflow ID to check')
|
|
96
|
-
.option('--verbose', 'Show detailed status')
|
|
97
|
-
.option('--json', 'Output as JSON')
|
|
98
|
-
.action((options) => {
|
|
99
|
-
showDeprecationWarning('status', 'run-inspect');
|
|
100
|
-
const statusCmd = createStatusCommand();
|
|
101
|
-
statusCmd.parse(['', '', ...Object.entries(options).flatMap(([k, v]) => typeof v === 'boolean' && v ? [`--${k}`] : typeof v === 'string' ? [`--${k}`, v] : [])], { from: 'user' });
|
|
102
|
-
});
|
|
103
|
-
program
|
|
104
|
-
.command('run-status')
|
|
105
|
-
.description('(DEPRECATED: Use run-inspect)')
|
|
106
|
-
.option('--work-id <id>', 'Work item ID to check')
|
|
107
|
-
.option('--workflow-id <id>', 'Workflow ID to check')
|
|
108
|
-
.option('--verbose', 'Show detailed status')
|
|
109
|
-
.option('--json', 'Output as JSON')
|
|
110
|
-
.action((options) => {
|
|
111
|
-
showDeprecationWarning('run-status', 'run-inspect');
|
|
112
|
-
const statusCmd = createStatusCommand();
|
|
113
|
-
statusCmd.parse(['', '', ...Object.entries(options).flatMap(([k, v]) => typeof v === 'boolean' && v ? [`--${k}`] : typeof v === 'string' ? [`--${k}`, v] : [])], { from: 'user' });
|
|
114
|
-
});
|
|
115
|
-
program
|
|
116
|
-
.command('resume <workflow_id>')
|
|
117
|
-
.description('(DEPRECATED: Use workflow-resume)')
|
|
118
|
-
.option('--json', 'Output as JSON')
|
|
119
|
-
.action((workflowId, options) => {
|
|
120
|
-
showDeprecationWarning('resume', 'workflow-resume');
|
|
121
|
-
const resumeCmd = createResumeCommand();
|
|
122
|
-
resumeCmd.parse(['', '', workflowId, ...(options.json ? ['--json'] : [])], { from: 'user' });
|
|
123
|
-
});
|
|
124
|
-
program
|
|
125
|
-
.command('pause <workflow_id>')
|
|
126
|
-
.description('(DEPRECATED: Use workflow-pause)')
|
|
127
|
-
.option('--json', 'Output as JSON')
|
|
128
|
-
.action((workflowId, options) => {
|
|
129
|
-
showDeprecationWarning('pause', 'workflow-pause');
|
|
130
|
-
const pauseCmd = createPauseCommand();
|
|
131
|
-
pauseCmd.parse(['', '', workflowId, ...(options.json ? ['--json'] : [])], { from: 'user' });
|
|
132
|
-
});
|
|
133
|
-
program
|
|
134
|
-
.command('recover <workflow_id>')
|
|
135
|
-
.description('(DEPRECATED: Use workflow-recover)')
|
|
136
|
-
.option('--checkpoint <id>', 'Specific checkpoint ID')
|
|
137
|
-
.option('--phase <phase>', 'Recover to specific phase')
|
|
138
|
-
.option('--json', 'Output as JSON')
|
|
139
|
-
.action((workflowId, options) => {
|
|
140
|
-
showDeprecationWarning('recover', 'workflow-recover');
|
|
141
|
-
const recoverCmd = createRecoverCommand();
|
|
142
|
-
recoverCmd.parse(['', '', workflowId, ...Object.entries(options).flatMap(([k, v]) => typeof v === 'boolean' && v ? [`--${k}`] : typeof v === 'string' ? [`--${k}`, v] : [])], { from: 'user' });
|
|
143
|
-
});
|
|
144
|
-
program
|
|
145
|
-
.command('cleanup')
|
|
146
|
-
.description('(DEPRECATED: Use workflow-cleanup)')
|
|
147
|
-
.option('--max-age <days>', 'Delete workflows older than N days', '30')
|
|
148
|
-
.option('--json', 'Output as JSON')
|
|
149
|
-
.action((options) => {
|
|
150
|
-
showDeprecationWarning('cleanup', 'workflow-cleanup');
|
|
151
|
-
const cleanupCmd = createCleanupCommand();
|
|
152
|
-
cleanupCmd.parse(['', '', ...Object.entries(options).flatMap(([k, v]) => typeof v === 'boolean' && v ? [`--${k}`] : typeof v === 'string' ? [`--${k}`, v] : [])], { from: 'user' });
|
|
153
|
-
});
|
|
52
|
+
program.addCommand(createWorkflowCreateCommand()); // workflow-create
|
|
53
|
+
program.addCommand(createWorkflowUpdateCommand()); // workflow-update
|
|
54
|
+
program.addCommand(createWorkflowInspectCommand()); // workflow-inspect
|
|
55
|
+
program.addCommand(createWorkflowDebuggerCommand()); // workflow-debugger
|
|
56
|
+
program.addCommand(createSessionLoadCommand()); // session-load
|
|
57
|
+
program.addCommand(createSessionSaveCommand()); // session-save
|
|
154
58
|
// Subcommand trees
|
|
155
59
|
program.addCommand(createAuthCommand());
|
|
156
60
|
program.addCommand(createWorkCommand());
|