@leanandmean/coding-agent 0.74.1-scramjet.60 → 0.74.1-scramjet.61

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.
@@ -3029,7 +3029,31 @@ export class InteractiveMode {
3029
3029
  case "user": {
3030
3030
  const textContent = this.getUserMessageText(message);
3031
3031
  if (textContent) {
3032
- if (this.chatContainer.children.length > 0) {
3032
+ // SCRAMJET-DIVERGENCE: separate user rows from visible committed results without doubling gaps (#579).
3033
+ let committedTailRow;
3034
+ if (this.chatContainer.children.length === 0) {
3035
+ for (let i = this.committedChatContainer.children.length - 1; i >= 0; i--) {
3036
+ const lines = this.committedChatContainer.children[i].render(this.ui.terminal.columns);
3037
+ if (lines.length > 0) {
3038
+ committedTailRow = lines[lines.length - 1];
3039
+ break;
3040
+ }
3041
+ }
3042
+ }
3043
+ const tailNeedsGap = committedTailRow !== undefined &&
3044
+ (stripVTControlCharacters(committedTailRow).trim() !== "" ||
3045
+ [...committedTailRow.matchAll(/\x1b\[([\d;:]*)m/g)].some(([, params]) => {
3046
+ const codes = params.split(";");
3047
+ for (let i = 0; i < codes.length; i++) {
3048
+ const code = Number(codes[i].split(":")[0]);
3049
+ if (code === 48 || (code >= 40 && code <= 47) || (code >= 100 && code <= 107))
3050
+ return true;
3051
+ if (code === 38)
3052
+ i += codes[i + 1] === "2" ? 4 : codes[i + 1] === "5" ? 2 : 0;
3053
+ }
3054
+ return false;
3055
+ }));
3056
+ if (this.chatContainer.children.length > 0 || tailNeedsGap) {
3033
3057
  this.chatContainer.addChild(new Spacer(1));
3034
3058
  }
3035
3059
  // SCRAMJET-DIVERGENCE: scramjet-command block rendering (issue 82)