nexrall-code 0.5.19 → 0.5.21
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/index.js +23 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12627,6 +12627,15 @@ Resolve the conflict (remove <<<<<<< / ======= / >>>>>>> markers and keep the in
|
|
|
12627
12627
|
const dirPath = typeof input.path === "string" ? input.path : ".";
|
|
12628
12628
|
try {
|
|
12629
12629
|
const resolved = resolvePath(dirPath, workDir);
|
|
12630
|
+
let stat2;
|
|
12631
|
+
try {
|
|
12632
|
+
stat2 = fs6.statSync(resolved);
|
|
12633
|
+
} catch {
|
|
12634
|
+
return { error: `Path not found: ${resolved}.` };
|
|
12635
|
+
}
|
|
12636
|
+
if (!stat2.isDirectory()) {
|
|
12637
|
+
return { error: `Path is a file, not a directory: ${resolved}. Use read_file to view its contents.` };
|
|
12638
|
+
}
|
|
12630
12639
|
const entries = fs6.readdirSync(resolved, { withFileTypes: true });
|
|
12631
12640
|
const dirs = entries.filter((e2) => e2.isDirectory()).sort((a, b) => a.name.localeCompare(b.name));
|
|
12632
12641
|
const files = entries.filter((e2) => !e2.isDirectory()).sort((a, b) => a.name.localeCompare(b.name));
|
|
@@ -12636,8 +12645,8 @@ Resolve the conflict (remove <<<<<<< / ======= / >>>>>>> markers and keep the in
|
|
|
12636
12645
|
}
|
|
12637
12646
|
for (const f3 of files) {
|
|
12638
12647
|
try {
|
|
12639
|
-
const
|
|
12640
|
-
const size = formatBytes(
|
|
12648
|
+
const stat3 = fs6.statSync(path5.join(resolved, f3.name));
|
|
12649
|
+
const size = formatBytes(stat3.size);
|
|
12641
12650
|
lines.push(`\u{1F4C4} ${f3.name} (${size})`);
|
|
12642
12651
|
} catch {
|
|
12643
12652
|
lines.push(`\u{1F4C4} ${f3.name}`);
|
|
@@ -23930,7 +23939,18 @@ function setAutoApprove(category) {
|
|
|
23930
23939
|
function isAutoApproved(category) {
|
|
23931
23940
|
return autoApproved.has("all") || autoApproved.has(category);
|
|
23932
23941
|
}
|
|
23942
|
+
var _replInterface = null;
|
|
23943
|
+
function setReadlineInterface(rl) {
|
|
23944
|
+
_replInterface = rl;
|
|
23945
|
+
}
|
|
23933
23946
|
function askUser(question) {
|
|
23947
|
+
if (_replInterface) {
|
|
23948
|
+
const rl = _replInterface;
|
|
23949
|
+
process.stderr.write(question);
|
|
23950
|
+
return new Promise((resolve3) => {
|
|
23951
|
+
rl.question("", (answer) => resolve3(answer.trim()));
|
|
23952
|
+
});
|
|
23953
|
+
}
|
|
23934
23954
|
return new Promise((resolve3) => {
|
|
23935
23955
|
const rl = readline2.createInterface({
|
|
23936
23956
|
input: process.stdin,
|
|
@@ -24904,6 +24924,7 @@ ${text}` : "");
|
|
|
24904
24924
|
terminal: true,
|
|
24905
24925
|
prompt: colors.primary.bold("> ")
|
|
24906
24926
|
});
|
|
24927
|
+
setReadlineInterface(rl);
|
|
24907
24928
|
rl.prompt();
|
|
24908
24929
|
let inputBuffer = "";
|
|
24909
24930
|
rl.on("line", async (rawLine) => {
|