@oxecli/oxe 1.0.91 → 1.0.92

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
@@ -240,6 +240,12 @@ export class CLI {
240
240
  else if (typ === "footer") {
241
241
  process.stdout.write(mutedMarkdown(text) + "\n");
242
242
  }
243
+ else if (typ === "warning") {
244
+ process.stdout.write(`\x1b[33m${text}\x1b[0m\n`);
245
+ }
246
+ else if (typ === "error") {
247
+ process.stdout.write(`\x1b[31m${text}\x1b[0m\n`);
248
+ }
243
249
  else {
244
250
  process.stdout.write(mutedMarkdown(text) + "\n");
245
251
  }
@@ -457,7 +463,9 @@ export class CLI {
457
463
  continue;
458
464
  }
459
465
  dockAppendContent(`\x1b[1;36m❯\x1b[0m ${userDisplayText(input, spans)}\n`);
460
- this.lastPrompt = input;
466
+ // Empty the prompt field as soon as the prompt is sent. Only a draft
467
+ // typed while the query runs is restored into the next box.
468
+ this.lastPrompt = "";
461
469
  queryStarted = true;
462
470
  const stopCapture = startDraftCapture(() => engine.interrupt());
463
471
  try {
package/dist/engine.js CHANGED
@@ -484,14 +484,14 @@ export class InferenceEngine {
484
484
  catch (err2) {
485
485
  if (this.interrupted)
486
486
  throw new Error("interrupt");
487
- renderErrorPanel(`API Error: ${err2}`);
487
+ renderErrorPanel(`API Error: ${err2}`, story);
488
488
  return;
489
489
  }
490
490
  }
491
491
  else {
492
492
  if (this.interrupted)
493
493
  throw new Error("interrupt");
494
- renderErrorPanel(`API Error: ${err}`);
494
+ renderErrorPanel(`API Error: ${err}`, story);
495
495
  return;
496
496
  }
497
497
  }
@@ -586,9 +586,13 @@ export class InferenceEngine {
586
586
  // The preceding tool action already leaves the cursor on a blank row, so
587
587
  // no extra newline is needed above; renderPanel ends with its own "\n",
588
588
  // and the prompt adds one leading "\n" -> exactly one blank row below.
589
+ const maxIterationMsg = "⚠ Max tool-call iterations reached for this turn. The work so far is " +
590
+ "saved. If you want the agent to keep going, type continue and the next " +
591
+ "step will resume from where it left off.";
589
592
  renderPanel("[bold yellow]⚠ Max tool-call iterations reached for this turn.[/bold yellow]\n" +
590
593
  "[yellow]The work so far is saved. If you want the agent to keep going, type " +
591
594
  "[bold]continue[/bold] and the next step will resume from where it left off.[/yellow]", "Warning", "", false, "33");
595
+ story.push({ type: "warning", text: maxIterationMsg });
592
596
  if (retryPrompts.length)
593
597
  dropRetryPrompts(conversation, inputItems, retryPrompts);
594
598
  stripOrphanCalls(conversation);
@@ -600,7 +604,7 @@ export class InferenceEngine {
600
604
  if (err?.message === "interrupt" || err?.message === "eof") {
601
605
  throw err;
602
606
  }
603
- renderErrorPanel(`Runtime Exception: ${err}`);
607
+ renderErrorPanel(`Runtime Exception: ${err}`, story);
604
608
  }
605
609
  finally {
606
610
  this.inQuery = false;
@@ -621,8 +625,9 @@ export class InferenceEngine {
621
625
  }
622
626
  }
623
627
  }
624
- function renderErrorPanel(msg) {
628
+ function renderErrorPanel(msg, story) {
625
629
  const text = msg.replace(/\[bold yellow\]|\[yellow\]|\[\/.*?\]/g, "");
626
630
  renderPanel(text, "Error", "", true, "31");
631
+ story.push({ type: "error", text: `Error: ${text}` });
627
632
  }
628
633
  export { renderErrorPanel };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxecli/oxe",
3
- "version": "1.0.91",
3
+ "version": "1.0.92",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },