@causyne/agent 1.20.71 → 1.20.73

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.
@@ -392,9 +392,6 @@ export class StageSurface {
392
392
  * the contract in transcript.js.
393
393
  */
394
394
  commit(kind, produce, meta = null) {
395
- if (kind === 'error' || kind === 'turn' || kind === 'approval') {
396
- this.stage.invalidate();
397
- }
398
395
  return this.transcript.append({ kind, produce, meta });
399
396
  }
400
397
 
@@ -441,17 +438,23 @@ export class StageSurface {
441
438
  // entered from Home occupies the available height at every terminal width.
442
439
  // Its short transcript is placed next to the input below.
443
440
  const contentRows = this.transcript.height(contentWidth);
444
- const desired = sessionStageHeight(this.stage.maxHeight, block.length, contentRows, this.fullSession || caret?.inline);
441
+ const minFloor = contentRows > 0 ? MIN_VIEWPORT_ROWS : 0;
442
+ const neededWithFloor = Math.min(this.stage.maxHeight, block.length + minFloor);
443
+ const desired = Math.max(
444
+ sessionStageHeight(this.stage.maxHeight, block.length, contentRows, this.fullSession || caret?.inline),
445
+ neededWithFloor
446
+ );
445
447
  if (desired > this.stage.height) this.stage.grow(desired - this.stage.height);
446
448
 
447
449
  const height = this.stage.height;
448
450
 
449
- // An active prompt block or modal dialog is the focal point of user interaction.
450
- // Never slice the top border, title, or input area when the block fits within the stage height.
451
- // The transcript viewport receives the remaining vertical budget (height - block.length).
452
- const maxBlock = this.messageActionOverlay?.panel.length
453
- ? Math.max(1, height - this.messageActionOverlay.panel.length)
454
- : height;
451
+ // The prompt may not eat the whole band — but only once there is a
452
+ // transcript for it to eat. Trim from the TOP when it would: the status
453
+ // footer and the caret row are the last rows and the ones worth keeping,
454
+ // and an input box that has scrolled its own oldest row off is a smaller lie
455
+ // than a transcript that has vanished.
456
+ const floor = contentRows > 0 ? MIN_VIEWPORT_ROWS : 0;
457
+ const maxBlock = Math.max(1, height - floor);
455
458
  if (block.length > maxBlock) {
456
459
  const cut = block.length - maxBlock;
457
460
  block = block.slice(cut);