render

package
v0.40.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package render provides pure rendering functions for message blocks. These functions are stateless and can be used by both streaming and historical message rendering paths, eliminating code duplication.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssistantBlock

func AssistantBlock(content string, width int, theme style.Theme) string

AssistantBlock renders an assistant message with markdown styling.

func ErrorBlock

func ErrorBlock(errorMsg string, ty *herald.Typography, theme style.Theme) string

ErrorBlock renders an error message with herald Caution styling.

func ReasoningBlock

func ReasoningBlock(content string, duration int64, ty *herald.Typography, theme style.Theme) string

ReasoningBlock renders a reasoning/thinking block with muted italic text. If duration > 0, shows "Thought for Xs" label. Otherwise shows just "Thought".

func SystemBlock

func SystemBlock(content string, ty *herald.Typography, theme style.Theme) string

SystemBlock renders a system message with herald Note styling.

func ToolBlock

func ToolBlock(displayName, params, body string, isError bool, width int, ty *herald.Typography, theme style.Theme) string

ToolBlock renders a tool execution result with header and body.

func UserBlock

func UserBlock(content string, ty *herald.Typography, theme style.Theme) string

UserBlock renders a user message with herald Tip styling.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL