| 534 | } |
| 535 | |
| 536 | export function renderCliTextTranscript(input: CliTextTranscriptInput = {}): string { |
| 537 | let output = ''; |
| 538 | const renderer = createCliTextProcessor({ |
| 539 | interactive: false, |
| 540 | suppressWarnings: input.suppressWarnings ?? false, |
| 541 | showTestTiming: input.showTestTiming ?? false, |
| 542 | filePathRenderStyle: input.filePathRenderStyle ?? 'list', |
| 543 | includeHeaderDetails: input.includeHeaderDetails ?? true, |
| 544 | includeNextSteps: input.includeNextSteps ?? true, |
| 545 | sink: { |
| 546 | clearTransient(): void {}, |
| 547 | updateTransient(): void {}, |
| 548 | writeDurable(text: string): void { |
| 549 | output += `${formatCliTextBlock(text)}\n`; |
| 550 | }, |
| 551 | writeSection(text: string): void { |
| 552 | output += `\n${formatCliTextBlock(text)}\n`; |
| 553 | }, |
| 554 | }, |
| 555 | }); |
| 556 | |
| 557 | for (const item of input.items ?? []) { |
| 558 | renderer.onFragment(item); |
| 559 | } |
| 560 | if (input.structuredOutput) { |
| 561 | renderer.setStructuredOutput(input.structuredOutput); |
| 562 | } |
| 563 | if (input.nextSteps && input.nextSteps.length > 0) { |
| 564 | renderer.setNextSteps(input.nextSteps, input.nextStepsRuntime ?? 'cli'); |
| 565 | } |
| 566 | renderer.finalize(); |
| 567 | |
| 568 | return output; |
| 569 | } |
| 570 | |
| 571 | function phaseDisplayMessage(phase: BuildRunPhase): string { |
| 572 | switch (phase) { |