@taj-special/dravix-code 1.3.3 → 1.3.4
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/cli/repl.js +16 -4
- package/package.json +1 -1
package/dist/cli/repl.js
CHANGED
|
@@ -3003,6 +3003,8 @@ The summary should feel like a natural conversation close — informative, brief
|
|
|
3003
3003
|
// Trailing newline — skip when read ops follow (they start on current line)
|
|
3004
3004
|
if (hasRenderedContent && readOps.length === 0)
|
|
3005
3005
|
process.stdout.write('\n');
|
|
3006
|
+
// Synchronisation flag: ops/else must wait for readOps to finish
|
|
3007
|
+
let readOpsDone = readOps.length === 0;
|
|
3006
3008
|
// ── Handle read_file ops ──────────────────────────────
|
|
3007
3009
|
// forcedEditMode: block further reads — AI must use existing context
|
|
3008
3010
|
if (readOps.length > 0 && forcedEditMode) {
|
|
@@ -3013,6 +3015,7 @@ The summary should feel like a natural conversation close — informative, brief
|
|
|
3013
3015
|
readFileContinue = true;
|
|
3014
3016
|
}
|
|
3015
3017
|
else if (readOps.length > 0) {
|
|
3018
|
+
readOpsDone = false;
|
|
3016
3019
|
// Absorb blank lines so reading block starts immediately after user message
|
|
3017
3020
|
if (hasRenderedContent) {
|
|
3018
3021
|
// Ensure cursor is on a new line, then absorb excess trailing blank lines
|
|
@@ -3190,18 +3193,22 @@ The summary should feel like a natural conversation close — informative, brief
|
|
|
3190
3193
|
}
|
|
3191
3194
|
process.stdout.write(` ` + BC('╰' + '─'.repeat(boxW - 2) + '╯') + `\n`);
|
|
3192
3195
|
readFileContinue = true;
|
|
3193
|
-
|
|
3196
|
+
readOpsDone = true;
|
|
3194
3197
|
}
|
|
3195
3198
|
catch (e) {
|
|
3196
3199
|
logError('readOps', e);
|
|
3197
|
-
|
|
3200
|
+
readFileContinue = true;
|
|
3201
|
+
readOpsDone = true;
|
|
3198
3202
|
}
|
|
3199
3203
|
})();
|
|
3200
|
-
return;
|
|
3201
3204
|
} // end else if (readOps.length > 0)
|
|
3205
|
+
// Process write/run/mkdir/delete ops — waits for readOps to finish first
|
|
3202
3206
|
if (ops.length > 0) {
|
|
3203
3207
|
(async () => {
|
|
3204
3208
|
try {
|
|
3209
|
+
// Wait for any pending read operations to finish
|
|
3210
|
+
while (!readOpsDone)
|
|
3211
|
+
await new Promise(r => setTimeout(r, 20));
|
|
3205
3212
|
const skippedPaths = new Set();
|
|
3206
3213
|
const runOutputs = [];
|
|
3207
3214
|
const fileOpErrors = [];
|
|
@@ -3340,7 +3347,12 @@ The summary should feel like a natural conversation close — informative, brief
|
|
|
3340
3347
|
})();
|
|
3341
3348
|
}
|
|
3342
3349
|
else {
|
|
3343
|
-
resolve
|
|
3350
|
+
// No ops — just wait for readOps to finish, then resolve
|
|
3351
|
+
(async () => {
|
|
3352
|
+
while (!readOpsDone)
|
|
3353
|
+
await new Promise(r => setTimeout(r, 20));
|
|
3354
|
+
resolve();
|
|
3355
|
+
})();
|
|
3344
3356
|
}
|
|
3345
3357
|
}, (err) => {
|
|
3346
3358
|
clearInterval(spinnerInterval);
|