| 439 | } |
| 440 | |
| 441 | _renderToolPanel() { |
| 442 | if (this.toolWidth <= 0) return ''; |
| 443 | let buf = ''; |
| 444 | const col = this.chatWidth + 1; |
| 445 | |
| 446 | // Divider |
| 447 | for (let i = 0; i < this.chatHeight; i++) { |
| 448 | buf += ANSI.moveTo(i + 1, col); |
| 449 | buf += this.theme.border + BOX.vertical + ANSI.reset; |
| 450 | } |
| 451 | |
| 452 | // Tool log content |
| 453 | const startLine = Math.max(0, this.toolLines.length - this.chatHeight); |
| 454 | const visible = this.toolLines.slice(startLine, startLine + this.chatHeight); |
| 455 | |
| 456 | for (let i = 0; i < this.chatHeight; i++) { |
| 457 | buf += ANSI.moveTo(i + 1, col + 1); |
| 458 | const line = visible[i] || ''; |
| 459 | buf += this._truncate(line, this.toolWidth - 1); |
| 460 | } |
| 461 | |
| 462 | return buf; |
| 463 | } |
| 464 | |
| 465 | _renderInput() { |
| 466 | let buf = ''; |