@oxecli/oxe 1.0.34 → 1.0.35
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.js +3 -1
- package/dist/engine.js +12 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -76,7 +76,9 @@ export class CLI {
|
|
|
76
76
|
// clear downward so the whole panel disappears and the cursor lands back
|
|
77
77
|
// on the fresh line before the prompt.
|
|
78
78
|
const n = panel.split("\n").length;
|
|
79
|
-
|
|
79
|
+
// Include the leading separator row in the cleanup so the next prompt
|
|
80
|
+
// creates exactly one fresh separator instead of duplicating it.
|
|
81
|
+
process.stdout.write(`\x1b[${n + 1}A\r\x1b[J`);
|
|
80
82
|
}
|
|
81
83
|
}
|
|
82
84
|
async awaitRawCloseKey() {
|
package/dist/engine.js
CHANGED
|
@@ -438,6 +438,10 @@ export class InferenceEngine {
|
|
|
438
438
|
}
|
|
439
439
|
async executeQuery(userPrompt, inputItems, story, pasteSpans) {
|
|
440
440
|
this.inQuery = true;
|
|
441
|
+
// A completed status line belongs to the previous turn. Never let its
|
|
442
|
+
// replacement state reach the next user prompt.
|
|
443
|
+
this.workActive = false;
|
|
444
|
+
this.workRows = 0;
|
|
441
445
|
this.interrupted = false;
|
|
442
446
|
this.queryHasOutput = false;
|
|
443
447
|
this.activeAbort = new AbortController();
|
|
@@ -552,6 +556,8 @@ export class InferenceEngine {
|
|
|
552
556
|
dropRetryPrompts(conversation, inputItems, retryPrompts);
|
|
553
557
|
process.stdout.write(aiMarkdown(emptyMessage) + "\n");
|
|
554
558
|
process.stdout.write("\n" + summary() + "\n");
|
|
559
|
+
this.workActive = false;
|
|
560
|
+
this.workRows = 0;
|
|
555
561
|
return;
|
|
556
562
|
}
|
|
557
563
|
if (!calls.length) {
|
|
@@ -560,6 +566,8 @@ export class InferenceEngine {
|
|
|
560
566
|
story.push({ type: "footer", text: footerText() });
|
|
561
567
|
attachFooter(conversation);
|
|
562
568
|
attachFooter(inputItems);
|
|
569
|
+
this.workActive = false;
|
|
570
|
+
this.workRows = 0;
|
|
563
571
|
return;
|
|
564
572
|
}
|
|
565
573
|
if (text.trim())
|
|
@@ -603,6 +611,10 @@ export class InferenceEngine {
|
|
|
603
611
|
stripOrphanCalls(inputItems);
|
|
604
612
|
}
|
|
605
613
|
catch (err) {
|
|
614
|
+
if (this.interrupted) {
|
|
615
|
+
this.workActive = false;
|
|
616
|
+
this.workRows = 0;
|
|
617
|
+
}
|
|
606
618
|
if (this.interrupted)
|
|
607
619
|
throw new Error("interrupt");
|
|
608
620
|
if (err?.message === "interrupt" || err?.message === "eof") {
|