rlm-cli 0.2.23 → 0.2.24

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/viewer.js +15 -14
  2. package/package.json +1 -1
package/dist/viewer.js CHANGED
@@ -336,16 +336,18 @@ function renderIteration(state) {
336
336
  if (state.scrollY < 0)
337
337
  state.scrollY = 0;
338
338
  const from = state.scrollY;
339
- const to = Math.min(allLines.length, from + viewable);
339
+ // Reserve lines for scroll indicators when needed
340
+ const hasScrollUp = from > 0;
341
+ const hasScrollDown = (from + viewable) < allLines.length;
342
+ const contentLines = viewable - (hasScrollUp ? 1 : 0) - (hasScrollDown ? 1 : 0);
343
+ const to = Math.min(allLines.length, from + contentLines);
340
344
  W(c.cursorHome, c.clearScreen, c.hideCursor);
341
- // Scroll indicator at top
342
- if (from > 0) {
345
+ if (hasScrollUp) {
343
346
  W(` ${c.dim}^ scroll up (${from} lines above)${c.reset}\n`);
344
347
  }
345
348
  for (let i = from; i < to; i++)
346
349
  W(allLines[i] + "\n");
347
- if (to < allLines.length) {
348
- // Replace last visible line with scroll indicator
350
+ if (hasScrollDown) {
349
351
  W(` ${c.dim}v scroll down (${allLines.length - to} lines below)${c.reset}\n`);
350
352
  }
351
353
  // Footer
@@ -517,18 +519,17 @@ function renderSubQueryDetail(state) {
517
519
  if (state.scrollY < 0)
518
520
  state.scrollY = 0;
519
521
  const from = state.scrollY;
520
- const to = Math.min(allLines.length, from + viewable);
522
+ const hasScrollUp = from > 0;
523
+ const hasScrollDown = (from + viewable) < allLines.length;
524
+ const contentLines = viewable - (hasScrollUp ? 1 : 0) - (hasScrollDown ? 1 : 0);
525
+ const to = Math.min(allLines.length, from + contentLines);
521
526
  W(c.cursorHome, c.clearScreen, c.hideCursor);
522
- if (from > 0) {
527
+ if (hasScrollUp) {
523
528
  W(` ${c.dim}^ scroll up (${from} lines above)${c.reset}\n`);
524
- for (let i = from + 1; i < to; i++)
525
- W(allLines[i] + "\n");
526
529
  }
527
- else {
528
- for (let i = from; i < to; i++)
529
- W(allLines[i] + "\n");
530
- }
531
- if (to < allLines.length) {
530
+ for (let i = from; i < to; i++)
531
+ W(allLines[i] + "\n");
532
+ if (hasScrollDown) {
532
533
  W(` ${c.dim}v scroll down (${allLines.length - to} lines below)${c.reset}\n`);
533
534
  }
534
535
  // Footer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rlm-cli",
3
- "version": "0.2.23",
3
+ "version": "0.2.24",
4
4
  "description": "Standalone CLI for Recursive Language Models (RLMs) — implements Algorithm 1 from arXiv:2512.24601",
5
5
  "type": "module",
6
6
  "bin": {