@fractary/faber-cli 1.5.25 → 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`;
|