(lines, text, state)
| 407 | } |
| 408 | |
| 409 | function appendAgentText(lines, text, state) { |
| 410 | let displayText = text; |
| 411 | if (displayText.length > MAX_AGENT_TEXT_LENGTH) { |
| 412 | displayText = displayText.substring(0, MAX_AGENT_TEXT_LENGTH) + `... [truncated: showing first ${MAX_AGENT_TEXT_LENGTH} of ${text.length} chars]`; |
| 413 | } |
| 414 | |
| 415 | const textLines = displayText.split("\n"); |
| 416 | for (let i = 0; i < textLines.length; i++) { |
| 417 | if (i === 0) { |
| 418 | state.traceEventCount += 1; |
| 419 | } |
| 420 | const prefix = i === 0 ? `[${state.traceEventCount}] ◆ ` : " "; |
| 421 | if (!appendConversationLine(lines, `${prefix}${textLines[i]}`, state)) { |
| 422 | return; |
| 423 | } |
| 424 | } |
| 425 | appendConversationLine(lines, "", state); |
| 426 | } |
| 427 | |
| 428 | function appendReasoningText(lines, text, state) { |
| 429 | let displayText = text; |
no test coverage detected