@locusai/cli 0.17.8 → 0.17.9
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/bin/locus.js +26 -8
- package/package.json +1 -1
package/bin/locus.js
CHANGED
|
@@ -7928,8 +7928,9 @@ async function handleAIPlan(projectRoot, config, directive, sprintName, flags) {
|
|
|
7928
7928
|
const plansDir = ensurePlansDir(projectRoot);
|
|
7929
7929
|
const planPath = join14(plansDir, `${id}.json`);
|
|
7930
7930
|
const planPathRelative = `.locus/plans/${id}.json`;
|
|
7931
|
+
const displayDirective = directive;
|
|
7931
7932
|
process.stderr.write(`
|
|
7932
|
-
${bold("Planning:")} ${cyan(
|
|
7933
|
+
${bold("Planning:")} ${cyan(displayDirective)}
|
|
7933
7934
|
`);
|
|
7934
7935
|
if (sprintName) {
|
|
7935
7936
|
process.stderr.write(` ${dim(`Sprint: ${sprintName}`)}
|
|
@@ -7938,8 +7939,25 @@ ${bold("Planning:")} ${cyan(directive)}
|
|
|
7938
7939
|
process.stderr.write(`
|
|
7939
7940
|
`);
|
|
7940
7941
|
const prompt = buildPlanningPrompt(projectRoot, config, directive, sprintName, id, planPathRelative);
|
|
7941
|
-
const
|
|
7942
|
-
|
|
7942
|
+
const aiResult = await runAI({
|
|
7943
|
+
prompt,
|
|
7944
|
+
provider: config.ai.provider,
|
|
7945
|
+
model: flags.model ?? config.ai.model,
|
|
7946
|
+
cwd: projectRoot,
|
|
7947
|
+
activity: "planning"
|
|
7948
|
+
});
|
|
7949
|
+
if (aiResult.interrupted) {
|
|
7950
|
+
process.stderr.write(`
|
|
7951
|
+
${yellow("⚡")} Planning interrupted.
|
|
7952
|
+
`);
|
|
7953
|
+
return;
|
|
7954
|
+
}
|
|
7955
|
+
if (!aiResult.success) {
|
|
7956
|
+
process.stderr.write(`
|
|
7957
|
+
${red("✗")} Planning failed: ${aiResult.error}
|
|
7958
|
+
`);
|
|
7959
|
+
return;
|
|
7960
|
+
}
|
|
7943
7961
|
if (!existsSync13(planPath)) {
|
|
7944
7962
|
process.stderr.write(`
|
|
7945
7963
|
${yellow("⚠")} Plan file was not created at ${bold(planPathRelative)}.
|
|
@@ -8279,6 +8297,7 @@ ${green("✓")} Created ${planned.length} issues.${milestoneTitle ? ` Sprint: ${
|
|
|
8279
8297
|
`);
|
|
8280
8298
|
}
|
|
8281
8299
|
var init_plan = __esm(() => {
|
|
8300
|
+
init_run_ai();
|
|
8282
8301
|
init_config();
|
|
8283
8302
|
init_github();
|
|
8284
8303
|
init_terminal();
|
|
@@ -8916,13 +8935,12 @@ async function convertDiscussionToPlan(projectRoot, id) {
|
|
|
8916
8935
|
return;
|
|
8917
8936
|
}
|
|
8918
8937
|
const content = readFileSync12(join16(dir, match), "utf-8");
|
|
8919
|
-
|
|
8920
|
-
|
|
8921
|
-
|
|
8922
|
-
`);
|
|
8938
|
+
const titleMatch = content.match(/^#\s+(.+)/m);
|
|
8939
|
+
const discussionTitle = titleMatch ? titleMatch[1].trim() : id;
|
|
8923
8940
|
await planCommand(projectRoot, [
|
|
8924
|
-
`Create
|
|
8941
|
+
`Create implementation plan from discussion: "${discussionTitle}"
|
|
8925
8942
|
|
|
8943
|
+
DISCUSSION CONTENT:
|
|
8926
8944
|
${content.slice(0, 8000)}`
|
|
8927
8945
|
], {});
|
|
8928
8946
|
}
|