(lines, text, state)
| 426 | } |
| 427 | |
| 428 | function appendReasoningText(lines, text, state) { |
| 429 | let displayText = text; |
| 430 | if (displayText.length > MAX_AGENT_TEXT_LENGTH) { |
| 431 | displayText = displayText.substring(0, MAX_AGENT_TEXT_LENGTH) + `... [truncated: showing first ${MAX_AGENT_TEXT_LENGTH} of ${text.length} chars]`; |
| 432 | } |
| 433 | |
| 434 | const textLines = displayText.split("\n"); |
| 435 | for (let i = 0; i < textLines.length; i++) { |
| 436 | if (i === 0) { |
| 437 | state.traceEventCount += 1; |
| 438 | } |
| 439 | const prefix = i === 0 ? `[${state.traceEventCount}] ◐ ` : " "; |
| 440 | if (!appendConversationLine(lines, `${prefix}${textLines[i]}`, state)) { |
| 441 | return; |
| 442 | } |
| 443 | } |
| 444 | appendConversationLine(lines, "", state); |
| 445 | } |
| 446 | |
| 447 | function appendToolExecutionLine(lines, content, toolUsePairs, state) { |
| 448 | const toolName = content.name; |
no test coverage detected