@fractary/faber-cli 1.5.24 → 1.5.26
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/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/plan/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/plan/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsDpC;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAqB3C"}
|
|
@@ -10,6 +10,7 @@ import { RepoClient } from '../../lib/repo-client.js';
|
|
|
10
10
|
import { ConfigManager } from '../../lib/config.js';
|
|
11
11
|
import { prompt } from '../../utils/prompt.js';
|
|
12
12
|
import { validateWorkIds, validateLabels, validateWorkflowName, validatePlanId, } from '../../utils/validation.js';
|
|
13
|
+
import { getRunDir, getPlanPath } from '@fractary/faber';
|
|
13
14
|
import fs from 'fs/promises';
|
|
14
15
|
import path from 'path';
|
|
15
16
|
/**
|
|
@@ -391,12 +392,9 @@ async function planSingleIssue(issue, config, repoClient, anthropicClient, optio
|
|
|
391
392
|
if (!options.noWorktree) {
|
|
392
393
|
// Validate plan ID format (prevent path traversal via malicious plan IDs)
|
|
393
394
|
validatePlanId(planId);
|
|
394
|
-
const
|
|
395
|
-
await fs.mkdir(
|
|
396
|
-
|
|
397
|
-
const planPath = path.join(planDir, `${planId}.json`);
|
|
398
|
-
// Note: path.join automatically normalizes and prevents basic traversal,
|
|
399
|
-
// but we validate the plan ID format as an additional layer of defense
|
|
395
|
+
const runDir = getRunDir(planId, worktreePath);
|
|
396
|
+
await fs.mkdir(runDir, { recursive: true });
|
|
397
|
+
const planPath = getPlanPath(planId, worktreePath);
|
|
400
398
|
await fs.writeFile(planPath, JSON.stringify(plan, null, 2));
|
|
401
399
|
if (outputFormat === 'text') {
|
|
402
400
|
console.log(chalk.gray(` → Plan written to ${planPath}`));
|
|
@@ -486,7 +484,7 @@ function generatePlanComment(plan, workflow, worktreePath, planId, issueNumber)
|
|
|
486
484
|
}
|
|
487
485
|
comment += `---\n\n`;
|
|
488
486
|
comment += `### Plan Location\n\n`;
|
|
489
|
-
const planPath = `${worktreePath}/.fractary/
|
|
487
|
+
const planPath = `${worktreePath}/.fractary/faber/runs/${planId}/plan.json`;
|
|
490
488
|
comment += `| File | Path |\n`;
|
|
491
489
|
comment += `|------|------|\n`;
|
|
492
490
|
comment += `| Plan | \`${planPath}\` |\n\n`;
|
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;IAsHlG;;;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
|
@@ -73,14 +73,22 @@ export class ConfigManager {
|
|
|
73
73
|
repo: unifiedConfig.github?.repo,
|
|
74
74
|
app: unifiedConfig.github?.app,
|
|
75
75
|
};
|
|
76
|
-
// Extract FABER-specific config
|
|
76
|
+
// Extract FABER-specific config, supporting both v2.1 (workflows/runs) and legacy (workflow/worktree)
|
|
77
77
|
const faberConfig = unifiedConfig.faber || {};
|
|
78
|
+
// Normalize: map v2.1 format to internal representation, with legacy fallback
|
|
79
|
+
const resolvedWorkflow = faberConfig.workflow || {};
|
|
80
|
+
if (faberConfig.workflows) {
|
|
81
|
+
resolvedWorkflow.default = resolvedWorkflow.default || faberConfig.workflows.default;
|
|
82
|
+
resolvedWorkflow.config_path = resolvedWorkflow.config_path || faberConfig.workflows.path;
|
|
83
|
+
}
|
|
78
84
|
// Build the result config (keeping anthropic and github for backward compatibility)
|
|
79
85
|
const config = {
|
|
80
86
|
anthropic,
|
|
81
87
|
github,
|
|
82
88
|
worktree: faberConfig.worktree,
|
|
83
|
-
workflow:
|
|
89
|
+
workflow: resolvedWorkflow,
|
|
90
|
+
workflows: faberConfig.workflows,
|
|
91
|
+
runs: faberConfig.runs,
|
|
84
92
|
backlog_management: faberConfig.backlog_management,
|
|
85
93
|
};
|
|
86
94
|
// Read Claude Code configuration for worktree location
|
|
@@ -101,7 +109,6 @@ export class ConfigManager {
|
|
|
101
109
|
};
|
|
102
110
|
}
|
|
103
111
|
if (!config.workflow?.config_path) {
|
|
104
|
-
// Always use the canonical workflow path - no legacy fallback
|
|
105
112
|
const workflowPath = path.join(process.cwd(), '.fractary', 'faber', 'workflows');
|
|
106
113
|
config.workflow = {
|
|
107
114
|
...config.workflow,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yaml-config.d.ts","sourceRoot":"","sources":["../../src/lib/yaml-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,YAAY,EACV,eAAe,EACf,eAAe,EACf,YAAY,EACZ,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"yaml-config.d.ts","sourceRoot":"","sources":["../../src/lib/yaml-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,YAAY,EACV,eAAe,EACf,eAAe,EACf,YAAY,EACZ,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAgH3E;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,OAAO,GAAE,iBAAsB,GAAG,aAAa,GAAG,IAAI,CAoDpF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,aAAa,EACrB,WAAW,CAAC,EAAE,MAAM,GACnB,IAAI,CAkBN;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,UAAO,GAAG,MAAM,CAgD7E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,QAAQ,GAAE,MAAsB,GAAG,MAAM,CAoDxE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAI1D;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAG1D;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAI/D;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAG/D"}
|
package/dist/lib/yaml-config.js
CHANGED
|
@@ -51,6 +51,24 @@ const unifiedConfigSchema = {
|
|
|
51
51
|
faber: {
|
|
52
52
|
type: 'object',
|
|
53
53
|
properties: {
|
|
54
|
+
// Current format (v2.1) - created by fractary-faber config init
|
|
55
|
+
workflows: {
|
|
56
|
+
type: 'object',
|
|
57
|
+
properties: {
|
|
58
|
+
path: { type: 'string' },
|
|
59
|
+
default: { type: 'string' },
|
|
60
|
+
autonomy: { type: 'string', enum: ['dry-run', 'assisted', 'guarded', 'autonomous'] },
|
|
61
|
+
},
|
|
62
|
+
additionalProperties: false,
|
|
63
|
+
},
|
|
64
|
+
runs: {
|
|
65
|
+
type: 'object',
|
|
66
|
+
properties: {
|
|
67
|
+
path: { type: 'string' },
|
|
68
|
+
},
|
|
69
|
+
additionalProperties: false,
|
|
70
|
+
},
|
|
71
|
+
// Legacy format (v2.0) - kept for backward compatibility
|
|
54
72
|
worktree: {
|
|
55
73
|
type: 'object',
|
|
56
74
|
properties: {
|