@fractary/faber-cli 1.5.1 → 1.5.3

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.
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Workflow commands - FABER workflow execution
3
3
  *
4
- * Provides workflow-run, workflow-status, workflow-resume, workflow-pause commands via FaberWorkflow SDK.
4
+ * Provides workflow-run, run-inspect, workflow-resume, workflow-pause commands via FaberWorkflow SDK.
5
5
  */
6
6
  import { Command } from 'commander';
7
7
  /**
@@ -9,7 +9,7 @@ import { Command } from 'commander';
9
9
  */
10
10
  export declare function createRunCommand(): Command;
11
11
  /**
12
- * Create the workflow-status command
12
+ * Create the run-inspect command
13
13
  */
14
14
  export declare function createStatusCommand(): Command;
15
15
  /**
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Workflow commands - FABER workflow execution
3
3
  *
4
- * Provides workflow-run, workflow-status, workflow-resume, workflow-pause commands via FaberWorkflow SDK.
4
+ * Provides workflow-run, run-inspect, workflow-resume, workflow-pause commands via FaberWorkflow SDK.
5
5
  */
6
6
  import { Command } from 'commander';
7
7
  import chalk from 'chalk';
@@ -60,11 +60,11 @@ export function createRunCommand() {
60
60
  });
61
61
  }
62
62
  /**
63
- * Create the workflow-status command
63
+ * Create the run-inspect command
64
64
  */
65
65
  export function createStatusCommand() {
66
- return new Command('workflow-status')
67
- .description('Show workflow status')
66
+ return new Command('run-inspect')
67
+ .description('Show workflow run status')
68
68
  .option('--work-id <id>', 'Work item ID to check')
69
69
  .option('--workflow-id <id>', 'Workflow ID to check')
70
70
  .option('--verbose', 'Show detailed status')
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqBpC;;GAEG;AACH,wBAAgB,cAAc,IAAI,OAAO,CA4IxC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqBpC;;GAEG;AACH,wBAAgB,cAAc,IAAI,OAAO,CA0KxC"}
package/dist/index.js CHANGED
@@ -21,7 +21,7 @@ if (process.stdout.isTTY) {
21
21
  process.stdout._handle?.setBlocking?.(true);
22
22
  }
23
23
  console.error('[DEBUG] CLI starting, args:', process.argv);
24
- const version = '1.3.2';
24
+ const version = '1.5.2';
25
25
  /**
26
26
  * Create and configure the main CLI program
27
27
  */
@@ -38,7 +38,7 @@ export function createFaberCLI() {
38
38
  program.addCommand(createMigrateCommand()); // migrate
39
39
  program.addCommand(createPlanCommand()); // plan
40
40
  program.addCommand(createRunCommand()); // workflow-run
41
- program.addCommand(createStatusCommand()); // workflow-status
41
+ program.addCommand(createStatusCommand()); // run-inspect
42
42
  program.addCommand(createResumeCommand()); // workflow-resume
43
43
  program.addCommand(createPauseCommand()); // workflow-pause
44
44
  program.addCommand(createRecoverCommand()); // workflow-recover
@@ -71,15 +71,39 @@ export function createFaberCLI() {
71
71
  ...(options.json ? ['--json'] : [])
72
72
  ], { from: 'user' });
73
73
  });
74
+ program
75
+ .command('workflow-status')
76
+ .description('(DEPRECATED: Use run-inspect)')
77
+ .option('--work-id <id>', 'Work item ID to check')
78
+ .option('--workflow-id <id>', 'Workflow ID to check')
79
+ .option('--verbose', 'Show detailed status')
80
+ .option('--json', 'Output as JSON')
81
+ .action((options) => {
82
+ showDeprecationWarning('workflow-status', 'run-inspect');
83
+ const statusCmd = createStatusCommand();
84
+ statusCmd.parse(['', '', ...Object.entries(options).flatMap(([k, v]) => typeof v === 'boolean' && v ? [`--${k}`] : typeof v === 'string' ? [`--${k}`, v] : [])], { from: 'user' });
85
+ });
74
86
  program
75
87
  .command('status')
76
- .description('(DEPRECATED: Use workflow-status)')
88
+ .description('(DEPRECATED: Use run-inspect)')
89
+ .option('--work-id <id>', 'Work item ID to check')
90
+ .option('--workflow-id <id>', 'Workflow ID to check')
91
+ .option('--verbose', 'Show detailed status')
92
+ .option('--json', 'Output as JSON')
93
+ .action((options) => {
94
+ showDeprecationWarning('status', 'run-inspect');
95
+ const statusCmd = createStatusCommand();
96
+ statusCmd.parse(['', '', ...Object.entries(options).flatMap(([k, v]) => typeof v === 'boolean' && v ? [`--${k}`] : typeof v === 'string' ? [`--${k}`, v] : [])], { from: 'user' });
97
+ });
98
+ program
99
+ .command('run-status')
100
+ .description('(DEPRECATED: Use run-inspect)')
77
101
  .option('--work-id <id>', 'Work item ID to check')
78
102
  .option('--workflow-id <id>', 'Workflow ID to check')
79
103
  .option('--verbose', 'Show detailed status')
80
104
  .option('--json', 'Output as JSON')
81
105
  .action((options) => {
82
- showDeprecationWarning('status', 'workflow-status');
106
+ showDeprecationWarning('run-status', 'run-inspect');
83
107
  const statusCmd = createStatusCommand();
84
108
  statusCmd.parse(['', '', ...Object.entries(options).flatMap(([k, v]) => typeof v === 'boolean' && v ? [`--${k}`] : typeof v === 'string' ? [`--${k}`, v] : [])], { from: 'user' });
85
109
  });
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,WAAW,EAAiB,eAAe,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGpG;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAc;IAE5B,OAAO;IAIP;;;OAGG;WACU,IAAI,IAAI,OAAO,CAAC,WAAW,GAAG;QAAE,SAAS,CAAC,EAAE,eAAe,CAAC;QAAC,MAAM,CAAC,EAAE,YAAY,CAAA;KAAE,CAAC;IAkFlG;;;OAGG;mBACkB,cAAc;IAwBnC;;OAEG;mBACkB,8BAA8B;IAoBnD;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAyBnC;;OAEG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,WAAW,GAAG,GAAG;CAGjC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,WAAW,EAAiB,eAAe,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGpG;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAc;IAE5B,OAAO;IAIP;;;OAGG;WACU,IAAI,IAAI,OAAO,CAAC,WAAW,GAAG;QAAE,SAAS,CAAC,EAAE,eAAe,CAAC;QAAC,MAAM,CAAC,EAAE,YAAY,CAAA;KAAE,CAAC;IAyGlG;;;OAGG;mBACkB,cAAc;IAwBnC;;OAEG;mBACkB,8BAA8B;IAoBnD;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAyBnC;;OAEG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,WAAW,GAAG,GAAG;CAGjC"}
@@ -40,11 +40,32 @@ export class ConfigManager {
40
40
  model: unifiedConfig.anthropic?.model,
41
41
  max_tokens: unifiedConfig.anthropic?.max_tokens,
42
42
  };
43
- // Extract github config (from top level)
43
+ // Extract github config (from top level, with fallbacks to work/repo sections)
44
+ // Priority: github section > work.handlers.github > repo section > codex > parse from repo string
45
+ const anyConfig = unifiedConfig; // Allow access to plugin-specific sections
46
+ let organization = unifiedConfig.github?.organization
47
+ || anyConfig.work?.handlers?.github?.owner
48
+ || anyConfig.work?.github?.organization
49
+ || anyConfig.repo?.organization
50
+ || anyConfig.codex?.organization;
51
+ let project = unifiedConfig.github?.project
52
+ || anyConfig.work?.handlers?.github?.repo
53
+ || anyConfig.work?.github?.project
54
+ || anyConfig.repo?.project
55
+ || anyConfig.codex?.project;
56
+ // If still not found, try to parse from repo string (owner/repo format)
57
+ const repoString = unifiedConfig.github?.repo || anyConfig.repo?.repo;
58
+ if ((!organization || !project) && repoString) {
59
+ const repoParts = repoString.split('/');
60
+ if (repoParts.length === 2) {
61
+ organization = organization || repoParts[0];
62
+ project = project || repoParts[1];
63
+ }
64
+ }
44
65
  let github = {
45
66
  token: process.env.GITHUB_TOKEN || unifiedConfig.github?.token,
46
- organization: unifiedConfig.github?.organization,
47
- project: unifiedConfig.github?.project,
67
+ organization,
68
+ project,
48
69
  repo: unifiedConfig.github?.repo,
49
70
  app: unifiedConfig.github?.app,
50
71
  };
@@ -62,7 +62,7 @@ export class PrivateKeyLoader {
62
62
  }
63
63
  }
64
64
  throw new Error('GitHub App private key not found. ' +
65
- "Configure 'private_key_path' in .fractary/settings.json or set GITHUB_APP_PRIVATE_KEY env var");
65
+ "Configure 'private_key_path' in .fractary/config.yaml or set GITHUB_APP_PRIVATE_KEY env var");
66
66
  }
67
67
  /**
68
68
  * Validate private key format.
@@ -145,10 +145,10 @@ export class GitHubAppAuth {
145
145
  async validate() {
146
146
  // Validate required fields
147
147
  if (!this.config.id) {
148
- throw new Error("GitHub App ID is required. Configure 'app.id' in .fractary/settings.json");
148
+ throw new Error("GitHub App ID is required. Configure 'app.id' in .fractary/config.yaml");
149
149
  }
150
150
  if (!this.config.installation_id) {
151
- throw new Error("GitHub App Installation ID is required. Configure 'app.installation_id' in .fractary/settings.json");
151
+ throw new Error("GitHub App Installation ID is required. Configure 'app.installation_id' in .fractary/config.yaml");
152
152
  }
153
153
  // Validate private key can be loaded
154
154
  await PrivateKeyLoader.load(this.config);
@@ -42,7 +42,7 @@ function getTokenProvider(faberConfig) {
42
42
  }
43
43
  throw new Error('GitHub authentication not configured. Either:\n' +
44
44
  ' 1. Set GITHUB_TOKEN environment variable, or\n' +
45
- ' 2. Configure GitHub App in .fractary/settings.json:\n' +
45
+ ' 2. Configure GitHub App in .fractary/config.yaml:\n' +
46
46
  ' {\n' +
47
47
  ' "github": {\n' +
48
48
  ' "app": {\n' +
@@ -90,7 +90,7 @@ export async function validateGitHubAuth(faberConfig) {
90
90
  }
91
91
  // Validate PAT
92
92
  if (!faberConfig.github?.token) {
93
- throw new Error('GitHub token not found. Set GITHUB_TOKEN environment variable or configure in .fractary/settings.json');
93
+ throw new Error('GitHub token not found. Set GITHUB_TOKEN environment variable or configure in .fractary/config.yaml');
94
94
  }
95
95
  }
96
96
  /**
@@ -114,7 +114,7 @@ export function createWorkConfig(faberConfig) {
114
114
  const owner = faberConfig.github?.organization;
115
115
  const repo = faberConfig.github?.project;
116
116
  if (!owner || !repo) {
117
- throw new Error('GitHub organization and project must be configured in .fractary/settings.json');
117
+ throw new Error('GitHub organization and project must be configured in .fractary/config.yaml');
118
118
  }
119
119
  // Get token provider (validates auth config)
120
120
  const provider = getTokenProvider(faberConfig);
@@ -151,7 +151,7 @@ export async function createWorkConfigAsync(faberConfig) {
151
151
  const owner = faberConfig.github?.organization;
152
152
  const repo = faberConfig.github?.project;
153
153
  if (!owner || !repo) {
154
- throw new Error('GitHub organization and project must be configured in .fractary/settings.json');
154
+ throw new Error('GitHub organization and project must be configured in .fractary/config.yaml');
155
155
  }
156
156
  const token = await getToken(faberConfig);
157
157
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fractary/faber-cli",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
4
4
  "description": "FABER CLI - Command-line interface for FABER development toolkit",
5
5
  "main": "dist/index.js",
6
6
  "bin": {