@fractary/faber-cli 1.5.13 → 1.5.14

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.
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Runs command - Query FABER run paths
3
+ *
4
+ * This command provides access to run directory and file paths for scripts and tools.
5
+ * It uses the SDK's centralized path definitions, ensuring consistency across all tools.
6
+ *
7
+ * All run files are stored in: .fractary/faber/runs/{run_id}/
8
+ * - plan.json: The execution plan
9
+ * - state.json: The workflow state
10
+ */
11
+ import { Command } from 'commander';
12
+ export declare function createRunsCommand(): Command;
13
+ //# sourceMappingURL=runs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../src/commands/runs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,wBAAgB,iBAAiB,IAAI,OAAO,CAkH3C"}
@@ -0,0 +1,127 @@
1
+ /**
2
+ * Runs command - Query FABER run paths
3
+ *
4
+ * This command provides access to run directory and file paths for scripts and tools.
5
+ * It uses the SDK's centralized path definitions, ensuring consistency across all tools.
6
+ *
7
+ * All run files are stored in: .fractary/faber/runs/{run_id}/
8
+ * - plan.json: The execution plan
9
+ * - state.json: The workflow state
10
+ */
11
+ import { Command } from 'commander';
12
+ import { FABER_RUNS_DIR, getRunsDir, getRunDir, getPlanPath, getStatePath, RELATIVE_PATHS, } from '@fractary/faber';
13
+ export function createRunsCommand() {
14
+ const runsCmd = new Command('runs')
15
+ .description('Query FABER run paths');
16
+ runsCmd
17
+ .command('dir')
18
+ .description('Show runs directory path or specific run directory')
19
+ .argument('[run_id]', 'Run ID (optional - omit for base runs directory)')
20
+ .option('--relative', 'Output relative path instead of absolute')
21
+ .option('--json', 'Output as JSON')
22
+ .action((runId, options) => {
23
+ try {
24
+ if (runId) {
25
+ // Specific run directory
26
+ const absPath = getRunDir(runId);
27
+ const relPath = `${FABER_RUNS_DIR}/${runId}`;
28
+ if (options.json) {
29
+ console.log(JSON.stringify({
30
+ run_id: runId,
31
+ absolute: absPath,
32
+ relative: relPath,
33
+ }, null, 2));
34
+ }
35
+ else {
36
+ console.log(options.relative ? relPath : absPath);
37
+ }
38
+ }
39
+ else {
40
+ // Base runs directory
41
+ const absPath = getRunsDir();
42
+ if (options.json) {
43
+ console.log(JSON.stringify({
44
+ absolute: absPath,
45
+ relative: FABER_RUNS_DIR,
46
+ }, null, 2));
47
+ }
48
+ else {
49
+ console.log(options.relative ? FABER_RUNS_DIR : absPath);
50
+ }
51
+ }
52
+ }
53
+ catch (error) {
54
+ console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
55
+ process.exit(1);
56
+ }
57
+ });
58
+ runsCmd
59
+ .command('plan-path')
60
+ .description('Show plan file path for a run')
61
+ .argument('<run_id>', 'Run ID')
62
+ .option('--relative', 'Output relative path instead of absolute')
63
+ .option('--json', 'Output as JSON')
64
+ .action((runId, options) => {
65
+ try {
66
+ const absPath = getPlanPath(runId);
67
+ const relPath = `${FABER_RUNS_DIR}/${runId}/plan.json`;
68
+ if (options.json) {
69
+ console.log(JSON.stringify({
70
+ run_id: runId,
71
+ absolute: absPath,
72
+ relative: relPath,
73
+ }, null, 2));
74
+ }
75
+ else {
76
+ console.log(options.relative ? relPath : absPath);
77
+ }
78
+ }
79
+ catch (error) {
80
+ console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
81
+ process.exit(1);
82
+ }
83
+ });
84
+ runsCmd
85
+ .command('state-path')
86
+ .description('Show state file path for a run')
87
+ .argument('<run_id>', 'Run ID')
88
+ .option('--relative', 'Output relative path instead of absolute')
89
+ .option('--json', 'Output as JSON')
90
+ .action((runId, options) => {
91
+ try {
92
+ const absPath = getStatePath(runId);
93
+ const relPath = `${FABER_RUNS_DIR}/${runId}/state.json`;
94
+ if (options.json) {
95
+ console.log(JSON.stringify({
96
+ run_id: runId,
97
+ absolute: absPath,
98
+ relative: relPath,
99
+ }, null, 2));
100
+ }
101
+ else {
102
+ console.log(options.relative ? relPath : absPath);
103
+ }
104
+ }
105
+ catch (error) {
106
+ console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
107
+ process.exit(1);
108
+ }
109
+ });
110
+ runsCmd
111
+ .command('paths')
112
+ .description('Show all path templates')
113
+ .option('--json', 'Output as JSON')
114
+ .action((options) => {
115
+ if (options.json) {
116
+ console.log(JSON.stringify(RELATIVE_PATHS, null, 2));
117
+ }
118
+ else {
119
+ console.log('FABER Run Path Templates:');
120
+ console.log(` Runs Directory: ${RELATIVE_PATHS.RUNS_DIR}`);
121
+ console.log(` Run Directory: ${RELATIVE_PATHS.RUN_DIR_TEMPLATE}`);
122
+ console.log(` Plan File: ${RELATIVE_PATHS.PLAN_PATH_TEMPLATE}`);
123
+ console.log(` State File: ${RELATIVE_PATHS.STATE_PATH_TEMPLATE}`);
124
+ }
125
+ });
126
+ return runsCmd;
127
+ }
@@ -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;AAmBpC;;GAEG;AACH,wBAAgB,cAAc,IAAI,OAAO,CA0KxC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAMH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoBpC;;GAEG;AACH,wBAAgB,cAAc,IAAI,OAAO,CA2KxC"}
package/dist/index.js CHANGED
@@ -19,11 +19,12 @@ import { createMigrateCommand } from './commands/migrate.js';
19
19
  import { createPlanCommand } from './commands/plan/index.js';
20
20
  import { createAuthCommand } from './commands/auth/index.js';
21
21
  import { createConfigCommand } from './commands/config.js';
22
+ import { createRunsCommand } from './commands/runs.js';
22
23
  // Force unbuffered output to prevent buffering issues in terminals
23
24
  if (process.stdout.isTTY) {
24
25
  process.stdout._handle?.setBlocking?.(true);
25
26
  }
26
- const version = '1.5.13';
27
+ const version = '1.5.14';
27
28
  /**
28
29
  * Create and configure the main CLI program
29
30
  */
@@ -39,6 +40,7 @@ export function createFaberCLI() {
39
40
  program.addCommand(createInitCommand()); // init
40
41
  program.addCommand(createMigrateCommand()); // migrate
41
42
  program.addCommand(createConfigCommand()); // config get/path/exists
43
+ program.addCommand(createRunsCommand()); // runs dir/plan-path/state-path
42
44
  program.addCommand(createPlanCommand()); // plan
43
45
  program.addCommand(createRunCommand()); // workflow-run
44
46
  program.addCommand(createStatusCommand()); // run-inspect
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fractary/faber-cli",
3
- "version": "1.5.13",
3
+ "version": "1.5.14",
4
4
  "description": "FABER CLI - Command-line interface for FABER development toolkit",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@fractary/core": "^0.5.0",
41
- "@fractary/faber": "^2.3.0",
41
+ "@fractary/faber": "^2.4.0",
42
42
  "ajv": "^8.12.0",
43
43
  "chalk": "^5.0.0",
44
44
  "commander": "^12.0.0",