@fractary/faber-cli 1.5.2 → 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.
package/dist/lib/config.d.ts.map
CHANGED
|
@@ -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;
|
|
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"}
|
package/dist/lib/config.js
CHANGED
|
@@ -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
|
|
47
|
-
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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 {
|