@oxecli/oxe 1.0.33 → 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 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
- process.stdout.write(`\x1b[${n}A\r\x1b[J`);
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
@@ -159,6 +159,15 @@ export class InferenceEngine {
159
159
  process.stdout.write(mutedMarkdown(text) + "\n\n");
160
160
  this.workRows = displayRows(text) + 1;
161
161
  }
162
+ clearWorkLine() {
163
+ if (!this.workActive || this.workRows < 1)
164
+ return;
165
+ for (let i = 0; i < this.workRows; i++) {
166
+ process.stdout.write("\x1b[1A\x1b[2K");
167
+ }
168
+ this.workActive = false;
169
+ this.workRows = 0;
170
+ }
162
171
  async streamOnce(inputItems, stats, story, previousResponseId) {
163
172
  let content = "";
164
173
  let committedLen = 0;
@@ -294,7 +303,10 @@ export class InferenceEngine {
294
303
  // the elapsed "Thought for Xs" (mirrors Python's `still_thinking` handling).
295
304
  const stillThinking = thinkingStart !== null;
296
305
  finishThinking(stillThinking);
297
- reportWorking();
306
+ if (this.interrupted && !this.queryHasOutput)
307
+ this.clearWorkLine();
308
+ else
309
+ reportWorking();
298
310
  if (content.slice(committedLen))
299
311
  printAiChunk(content.slice(committedLen));
300
312
  }
@@ -426,6 +438,10 @@ export class InferenceEngine {
426
438
  }
427
439
  async executeQuery(userPrompt, inputItems, story, pasteSpans) {
428
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;
429
445
  this.interrupted = false;
430
446
  this.queryHasOutput = false;
431
447
  this.activeAbort = new AbortController();
@@ -540,6 +556,8 @@ export class InferenceEngine {
540
556
  dropRetryPrompts(conversation, inputItems, retryPrompts);
541
557
  process.stdout.write(aiMarkdown(emptyMessage) + "\n");
542
558
  process.stdout.write("\n" + summary() + "\n");
559
+ this.workActive = false;
560
+ this.workRows = 0;
543
561
  return;
544
562
  }
545
563
  if (!calls.length) {
@@ -548,6 +566,8 @@ export class InferenceEngine {
548
566
  story.push({ type: "footer", text: footerText() });
549
567
  attachFooter(conversation);
550
568
  attachFooter(inputItems);
569
+ this.workActive = false;
570
+ this.workRows = 0;
551
571
  return;
552
572
  }
553
573
  if (text.trim())
@@ -591,14 +611,9 @@ export class InferenceEngine {
591
611
  stripOrphanCalls(inputItems);
592
612
  }
593
613
  catch (err) {
594
- if (this.interrupted && !this.queryHasOutput) {
595
- const fallback = "What else can I help with?";
596
- process.stdout.write(aiMarkdown(fallback) + "\n\n" + summary() + "\n");
597
- story.push({ type: "assistant", text: fallback });
598
- story.push({ type: "footer", text: footerText() });
599
- attachFooter(conversation);
600
- attachFooter(inputItems);
601
- return;
614
+ if (this.interrupted) {
615
+ this.workActive = false;
616
+ this.workRows = 0;
602
617
  }
603
618
  if (this.interrupted)
604
619
  throw new Error("interrupt");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxecli/oxe",
3
- "version": "1.0.33",
3
+ "version": "1.0.35",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },