agent.libx.js 0.93.39 → 0.93.41

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
@@ -8002,7 +8002,9 @@ var MarkdownStream = class {
8002
8002
  this.inFence = r.inFence;
8003
8003
  out += r.out + "\r\n";
8004
8004
  }
8005
- if (this.buf) {
8005
+ const tailIsTableRow = this.tableBuf.length > 0 && !this.inFence && /^\s*\|/.test(this.buf);
8006
+ if (this.buf && !tailIsTableRow) {
8007
+ if (this.tableBuf.length) out += this.flushTable();
8006
8008
  out += renderMdLine(this.buf, this.inFence, this.p, this.cols).out;
8007
8009
  this.lineRows = Math.max(1, Math.ceil(this.buf.length / Math.max(1, this.cols)));
8008
8010
  }
@@ -8010,7 +8012,12 @@ var MarkdownStream = class {
8010
8012
  }
8011
8013
  /** Commit the in-progress line as-is (already on screen), emit any buffered table, and reset for next turn. */
8012
8014
  flush() {
8013
- const out = this.tableBuf.length ? this.flushTable() : "";
8015
+ let out = "";
8016
+ if (this.tableBuf.length && this.buf && !this.inFence && isTableRow(this.buf)) {
8017
+ this.tableBuf.push(this.buf);
8018
+ this.buf = "";
8019
+ }
8020
+ out += this.tableBuf.length ? this.flushTable() : "";
8014
8021
  this.buf = "";
8015
8022
  this.inFence = false;
8016
8023
  this.lineRows = 0;