nexrall-code 0.5.174 → 0.5.176

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.
Files changed (2) hide show
  1. package/dist/index.js +17 -21
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -157424,7 +157424,12 @@ function rowsOccupied(text, columns = process.stdout.columns || 80) {
157424
157424
  function reserveBlockRows(previous, showing) {
157425
157425
  return Math.max(0, previous, showing);
157426
157426
  }
157427
- var LIVE_BLOCK_MAX_ROWS = 5;
157427
+ function drainBlockRows(previous, printedRows) {
157428
+ return Math.max(0, previous - Math.max(0, printedRows));
157429
+ }
157430
+ function replayReserveRows(slack, liveRows, pendingRows = 0) {
157431
+ return Math.max(Math.max(0, liveRows), Math.max(0, slack) - Math.max(0, pendingRows));
157432
+ }
157428
157433
  function fillerRowCount(rowsAlreadyPrinted, footerTextValue = "", columns = process.stdout.columns ?? 80, rows = process.stdout.rows, reservedRows = 0, headroom = 2) {
157429
157434
  if (!rows)
157430
157435
  return 0;
@@ -168649,13 +168654,6 @@ function decideCtrlC(state) {
168649
168654
  }
168650
168655
 
168651
168656
  // src/ui/inkTerminal.tsx
168652
- function fillerContent(rows) {
168653
- if (rows <= 0)
168654
- return "";
168655
- if (rows === 1)
168656
- return " ";
168657
- return "\n".repeat(rows - 1);
168658
- }
168659
168657
  function isBusySlashCommand(line) {
168660
168658
  return /^\/[a-z][\w-]*(\s|$)/.test(line.trim());
168661
168659
  }
@@ -168736,6 +168734,7 @@ var App2 = ({ onReady }) => {
168736
168734
  const menuDismissedRef = (0, import_react36.useRef)(null);
168737
168735
  const menuReserveRef = (0, import_react36.useRef)(0);
168738
168736
  const liveReserveRef = (0, import_react36.useRef)(0);
168737
+ const pendingPrintRowsRef = (0, import_react36.useRef)(0);
168739
168738
  const searchReserveRef = (0, import_react36.useRef)(0);
168740
168739
  const [, bumpMenu] = (0, import_react36.useState)(0);
168741
168740
  const [, setPaintTick] = (0, import_react36.useState)(0);
@@ -168827,6 +168826,13 @@ var App2 = ({ onReady }) => {
168827
168826
  if (opts?.isBanner)
168828
168827
  bannerChunkRef.current = bufferRef.current.length;
168829
168828
  bufferRef.current.append(text);
168829
+ if (!opts?.isBanner && !opts?.isFiller && !liveRef.current) {
168830
+ const rows = rowsOccupied(text, process.stdout.columns || 80);
168831
+ const pending = pendingPrintRowsRef.current;
168832
+ const paid = Math.min(pending, rows);
168833
+ pendingPrintRowsRef.current = pending - paid;
168834
+ liveReserveRef.current = drainBlockRows(liveReserveRef.current, rows - paid);
168835
+ }
168830
168836
  setItems((prev) => {
168831
168837
  return [...prev, { id: idCounter++, content: text, isBanner: opts?.isBanner, isFiller: opts?.isFiller }];
168832
168838
  });
@@ -169533,6 +169539,7 @@ var App2 = ({ onReady }) => {
169533
169539
  if (fullscreenRef.current)
169534
169540
  return;
169535
169541
  searchReserveRef.current = 0;
169542
+ pendingPrintRowsRef.current = Math.max(0, pendingRows);
169536
169543
  setItems((prev) => {
169537
169544
  const columns = process.stdout.columns || 80;
169538
169545
  const withoutOldFiller = prev.filter((it) => !it.isFiller);
@@ -169543,19 +169550,8 @@ var App2 = ({ onReady }) => {
169543
169550
  const liveRows = liveRef.current ? rowsOccupied(liveRef.current, columns) : 0;
169544
169551
  const footer2 = footerRef.current ? footerText(footerRef.current) : "";
169545
169552
  const slack = fillerRowCount(printedRows, footer2, columns, void 0, liveRows, 1);
169546
- const seed = Math.min(LIVE_BLOCK_MAX_ROWS, slack);
169547
- liveReserveRef.current = seed;
169548
- const filler = fillerRowCount(
169549
- printedRows,
169550
- footer2,
169551
- columns,
169552
- void 0,
169553
- Math.max(liveRows, seed) + Math.max(0, pendingRows),
169554
- 1
169555
- );
169556
- if (filler <= 0)
169557
- return withoutOldFiller;
169558
- return [...withoutOldFiller, { id: idCounter++, content: fillerContent(filler), isFiller: true }];
169553
+ liveReserveRef.current = replayReserveRows(slack, liveRows, pendingRows);
169554
+ return withoutOldFiller;
169559
169555
  });
169560
169556
  }, []);
169561
169557
  const forceFullRedraw = (0, import_react36.useCallback)(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexrall-code",
3
- "version": "0.5.174",
3
+ "version": "0.5.176",
4
4
  "description": "Nexrall Code — AI coding assistant for your terminal (headless agent for scripts, CI and automation)",
5
5
  "keywords": [
6
6
  "ai",