@fractary/faber-cli 1.3.5 → 1.3.6

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.
@@ -14,6 +14,11 @@ export declare class ConfigManager {
14
14
  * Load configuration
15
15
  */
16
16
  static load(): Promise<FaberConfig>;
17
+ /**
18
+ * Find config file by searching upwards from current directory
19
+ * Similar to how git finds .git directory
20
+ */
21
+ private static findConfigFile;
17
22
  /**
18
23
  * Read Claude Code configuration for worktree location
19
24
  */
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,oBAAoB,CAAC;AAEpE;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAc;IAE5B,OAAO;IAIP;;OAEG;WACU,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC;IAgEzC;;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;;;;GAIG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,oBAAoB,CAAC;AAEpE;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAc;IAE5B,OAAO;IAIP;;OAEG;WACU,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC;IAkEzC;;;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"}
@@ -25,23 +25,25 @@ export class ConfigManager {
25
25
  config.github = {
26
26
  token: process.env.GITHUB_TOKEN,
27
27
  };
28
- // Load from FABER config file
28
+ // Load from FABER config file - search upwards from current directory
29
29
  try {
30
- const faberConfigPath = path.join(process.cwd(), '.fractary', 'settings.json');
31
- const faberConfigContent = await fs.readFile(faberConfigPath, 'utf-8');
32
- const faberConfig = JSON.parse(faberConfigContent);
33
- // Merge with config
34
- if (faberConfig.anthropic) {
35
- config.anthropic = { ...config.anthropic, ...faberConfig.anthropic };
36
- }
37
- if (faberConfig.github) {
38
- config.github = { ...config.github, ...faberConfig.github };
39
- }
40
- if (faberConfig.worktree) {
41
- config.worktree = { ...config.worktree, ...faberConfig.worktree };
42
- }
43
- if (faberConfig.workflow) {
44
- config.workflow = { ...config.workflow, ...faberConfig.workflow };
30
+ const faberConfigPath = await ConfigManager.findConfigFile('.fractary', 'settings.json');
31
+ if (faberConfigPath) {
32
+ const faberConfigContent = await fs.readFile(faberConfigPath, 'utf-8');
33
+ const faberConfig = JSON.parse(faberConfigContent);
34
+ // Merge with config
35
+ if (faberConfig.anthropic) {
36
+ config.anthropic = { ...config.anthropic, ...faberConfig.anthropic };
37
+ }
38
+ if (faberConfig.github) {
39
+ config.github = { ...config.github, ...faberConfig.github };
40
+ }
41
+ if (faberConfig.worktree) {
42
+ config.worktree = { ...config.worktree, ...faberConfig.worktree };
43
+ }
44
+ if (faberConfig.workflow) {
45
+ config.workflow = { ...config.workflow, ...faberConfig.workflow };
46
+ }
45
47
  }
46
48
  }
47
49
  catch (error) {
@@ -72,6 +74,30 @@ export class ConfigManager {
72
74
  }
73
75
  return config;
74
76
  }
77
+ /**
78
+ * Find config file by searching upwards from current directory
79
+ * Similar to how git finds .git directory
80
+ */
81
+ static async findConfigFile(dirName, fileName) {
82
+ let currentDir = process.cwd();
83
+ const root = path.parse(currentDir).root;
84
+ while (true) {
85
+ const configPath = path.join(currentDir, dirName, fileName);
86
+ try {
87
+ await fs.access(configPath);
88
+ return configPath;
89
+ }
90
+ catch (error) {
91
+ // File doesn't exist, try parent directory
92
+ }
93
+ // Check if we've reached the root
94
+ if (currentDir === root) {
95
+ return null;
96
+ }
97
+ // Move to parent directory
98
+ currentDir = path.dirname(currentDir);
99
+ }
100
+ }
75
101
  /**
76
102
  * Read Claude Code configuration for worktree location
77
103
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fractary/faber-cli",
3
- "version": "1.3.5",
3
+ "version": "1.3.6",
4
4
  "description": "FABER CLI - Command-line interface for FABER development toolkit",
5
5
  "main": "dist/index.js",
6
6
  "bin": {