Refactor CLI input handling in cli.js to streamline the input structure and enhance the OpenAI call process. Introduce a new variable for previous response tracking and update file listing in list_files.js to return sorted file entries directly, improving output consistency.

This commit is contained in:
sebseb7
2025-08-12 04:14:42 +00:00
parent 324aea5775
commit 60e288454c
2 changed files with 17 additions and 17 deletions

View File

@@ -173,7 +173,7 @@ export async function run(args) {
const files = await listEntriesRecursive(resolvedBase, chrootResolved, depth === -1 ? Infinity : depth, includeHidden);
return {
cwd,
files: JSON.stringify(files.sort((a, b) => a[0].localeCompare(b[0]))), // Sort for consistent output
files: files.sort((a, b) => a[0].localeCompare(b[0])), // Sort for consistent output
};
} catch (err) {
return { err: `Failed to list files: ${err?.message || String(err)}` };