@locusai/cli 0.17.7 → 0.17.8
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 +12 -41
- package/package.json +1 -1
package/bin/locus.js
CHANGED
|
@@ -8760,7 +8760,6 @@ import {
|
|
|
8760
8760
|
writeFileSync as writeFileSync9
|
|
8761
8761
|
} from "node:fs";
|
|
8762
8762
|
import { join as join16 } from "node:path";
|
|
8763
|
-
import { createInterface as createInterface2 } from "node:readline";
|
|
8764
8763
|
function printHelp4() {
|
|
8765
8764
|
process.stderr.write(`
|
|
8766
8765
|
${bold("locus discuss")} — AI-powered architectural discussions
|
|
@@ -8813,12 +8812,8 @@ async function discussCommand(projectRoot, args, flags = {}) {
|
|
|
8813
8812
|
return deleteDiscussion(projectRoot, args[1]);
|
|
8814
8813
|
}
|
|
8815
8814
|
if (args.length === 0) {
|
|
8816
|
-
|
|
8817
|
-
|
|
8818
|
-
printHelp4();
|
|
8819
|
-
return;
|
|
8820
|
-
}
|
|
8821
|
-
return startDiscussion(projectRoot, topic2, flags);
|
|
8815
|
+
printHelp4();
|
|
8816
|
+
return;
|
|
8822
8817
|
}
|
|
8823
8818
|
const topic = args.join(" ").trim();
|
|
8824
8819
|
return startDiscussion(projectRoot, topic, flags);
|
|
@@ -8931,41 +8926,15 @@ ${bold("Converting discussion to plan:")} ${cyan(id)}
|
|
|
8931
8926
|
${content.slice(0, 8000)}`
|
|
8932
8927
|
], {});
|
|
8933
8928
|
}
|
|
8934
|
-
async function promptForTopic() {
|
|
8935
|
-
return new Promise((resolve2) => {
|
|
8936
|
-
const rl = createInterface2({
|
|
8937
|
-
input: process.stdin,
|
|
8938
|
-
output: process.stderr,
|
|
8939
|
-
terminal: true
|
|
8940
|
-
});
|
|
8941
|
-
process.stderr.write(`${bold("Discussion topic:")} `);
|
|
8942
|
-
rl.once("line", (line) => {
|
|
8943
|
-
rl.close();
|
|
8944
|
-
resolve2(line.trim());
|
|
8945
|
-
});
|
|
8946
|
-
rl.once("close", () => resolve2(""));
|
|
8947
|
-
});
|
|
8948
|
-
}
|
|
8949
8929
|
async function promptForAnswers() {
|
|
8950
|
-
|
|
8951
|
-
|
|
8952
|
-
input: process.stdin,
|
|
8953
|
-
output: process.stderr,
|
|
8954
|
-
terminal: true
|
|
8955
|
-
});
|
|
8956
|
-
const lines = [];
|
|
8957
|
-
rl.on("line", (line) => {
|
|
8958
|
-
if (line.trim() === "" && lines.length > 0) {
|
|
8959
|
-
rl.close();
|
|
8960
|
-
resolve2(lines.join(`
|
|
8961
|
-
`).trim());
|
|
8962
|
-
} else {
|
|
8963
|
-
lines.push(line);
|
|
8964
|
-
}
|
|
8965
|
-
});
|
|
8966
|
-
rl.once("close", () => resolve2(lines.join(`
|
|
8967
|
-
`).trim()));
|
|
8930
|
+
const input = new InputHandler({
|
|
8931
|
+
prompt: `${cyan("you")} ${dim(">")} `
|
|
8968
8932
|
});
|
|
8933
|
+
const result = await input.readline();
|
|
8934
|
+
if (result.type === "submit") {
|
|
8935
|
+
return result.text.trim();
|
|
8936
|
+
}
|
|
8937
|
+
return "";
|
|
8969
8938
|
}
|
|
8970
8939
|
function isQuestionsResponse(output) {
|
|
8971
8940
|
const trimmed = output.trimStart();
|
|
@@ -9017,7 +8986,8 @@ ${red("✗")} Discussion failed: ${aiResult.error}
|
|
|
9017
8986
|
}
|
|
9018
8987
|
process.stderr.write(`
|
|
9019
8988
|
${dim("─".repeat(50))}
|
|
9020
|
-
${bold("Your answers:")} ${dim("(
|
|
8989
|
+
${bold("Your answers:")} ${dim("(Shift+Enter for newlines, Enter to submit)")}
|
|
8990
|
+
|
|
9021
8991
|
`);
|
|
9022
8992
|
const answers = await promptForAnswers();
|
|
9023
8993
|
if (!answers.trim()) {
|
|
@@ -9127,6 +9097,7 @@ var init_discuss = __esm(() => {
|
|
|
9127
9097
|
init_config();
|
|
9128
9098
|
init_progress();
|
|
9129
9099
|
init_terminal();
|
|
9100
|
+
init_input_handler();
|
|
9130
9101
|
init_plan();
|
|
9131
9102
|
});
|
|
9132
9103
|
|