Table of Contents

Class ChatRenderer

Namespace
JD.AI.Rendering
Assembly
JD.AI.dll

Renders chat messages, tool outputs, and status to the terminal using Spectre.Console markup.

public static class ChatRenderer
Inheritance
ChatRenderer
Inherited Members

Properties

CurrentOutputStyle

public static OutputStyle CurrentOutputStyle { get; }

Property Value

OutputStyle

CurrentTheme

public static TuiTheme CurrentTheme { get; }

Property Value

TuiTheme

Methods

ApplyTheme(TuiTheme)

Apply a named terminal theme for future output.

public static void ApplyTheme(TuiTheme theme)

Parameters

theme TuiTheme

BeginStreaming()

Begin an assistant streaming block (response content).

public static void BeginStreaming()

BeginThinking()

Begin a thinking/reasoning block (dim gray output).

public static void BeginThinking()

Confirm(string)

Ask the user for confirmation.

[ExcludeFromCodeCoverage]
public static bool Confirm(string message)

Parameters

message string

Returns

bool

ConfirmWorkflow(string)

Workflow confirmation prompt. Defaults to No (Enter/N/Escape = decline).

public static bool ConfirmWorkflow(string message)

Parameters

message string

Returns

bool

DimInputLine(string)

Dim the already-visible user input line in-place. Moves the cursor up to the prompt line, rewrites it in dim, then returns to the next line for output.

[ExcludeFromCodeCoverage]
public static void DimInputLine(string text)

Parameters

text string

EndStreaming()

End the streaming block. Safe to call multiple times — subsequent calls are no-ops once the state has already been reset.

public static void EndStreaming()

EndThinking()

End a thinking/reasoning block.

public static void EndThinking()

PauseStreaming()

Pause the streaming indicator so it doesn't overwrite interactive prompts. Text continues to buffer but no indicator line is written until ResumeStreaming().

public static void PauseStreaming()

ReadInput(InteractiveInput?)

Prompt for user input with interactive completions.

[ExcludeFromCodeCoverage]
public static string? ReadInput(InteractiveInput? input = null)

Parameters

input InteractiveInput

Returns

string

ReadInputStructured(InteractiveInput)

Prompt for user input, returning structured result with attachments.

[ExcludeFromCodeCoverage]
public static InputResult? ReadInputStructured(InteractiveInput input)

Parameters

input InteractiveInput

Returns

InputResult

RenderAssistantMessage(string)

Render an assistant text response.

public static void RenderAssistantMessage(string text)

Parameters

text string

RenderBanner(string, string, int, IReadOnlyList<WelcomeIndicator>?, WelcomeBannerDetails?, WelcomePanelSettings?)

Render the startup banner with detected providers.

public static void RenderBanner(string modelName, string providerName, int totalModels, IReadOnlyList<WelcomeIndicator>? indicators = null, WelcomeBannerDetails? details = null, WelcomePanelSettings? welcomeSettings = null)

Parameters

modelName string
providerName string
totalModels int
indicators IReadOnlyList<WelcomeIndicator>
details WelcomeBannerDetails
welcomeSettings WelcomePanelSettings

RenderError(string)

Render an error message.

public static void RenderError(string text)

Parameters

text string

RenderInfo(string)

Render a system/info message.

public static void RenderInfo(string text)

Parameters

text string

RenderModeBar(PermissionMode)

Render a mode indicator bar above the input prompt.

public static void RenderModeBar(PermissionMode mode)

Parameters

mode PermissionMode

RenderStatusBar(string, string, long)

Render the status bar line.

public static void RenderStatusBar(string provider, string model, long tokens)

Parameters

provider string
model string
tokens long

RenderSystemPromptWarning(int, int, int, int)

Render a system prompt size warning below the welcome banner.

public static void RenderSystemPromptWarning(int actualTokens, int budgetTokens, int budgetPercent, int contextWindow)

Parameters

actualTokens int
budgetTokens int
budgetPercent int
contextWindow int

RenderToolCall(string, string?, string)

Render a tool invocation and its result.

public static void RenderToolCall(string toolName, string? args, string result)

Parameters

toolName string
args string
result string

RenderTurnMetrics(long, int, long, SpinnerStyle, long?, string?)

Render a turn completion metrics line, styled per style.

public static void RenderTurnMetrics(long elapsedMs, int tokens, long bytes, SpinnerStyle style = SpinnerStyle.Normal, long? ttftMs = null, string? model = null)

Parameters

elapsedMs long
tokens int
bytes long
style SpinnerStyle
ttftMs long?
model string

RenderUserMessage(string)

Render a user message.

public static void RenderUserMessage(string text)

Parameters

text string

RenderWarning(string)

Render a warning message.

public static void RenderWarning(string text)

Parameters

text string

ResumeStreaming()

Resume the streaming indicator after a pause, rendering any text buffered during the pause.

public static void ResumeStreaming()

SetOutputStyle(OutputStyle)

Set assistant output rendering style.

public static void SetOutputStyle(OutputStyle style)

Parameters

style OutputStyle

WriteStreamingChunk(string)

Write a streaming text chunk (raw, inline).

public static void WriteStreamingChunk(string text)

Parameters

text string

WriteThinkingChunk(string)

Write a thinking/reasoning chunk as dim gray text.

public static void WriteThinkingChunk(string text)

Parameters

text string