render

package
v1.261006.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MPL-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterToolRenderer

func RegisterToolRenderer(name string, fn ToolRenderer)

RegisterToolRenderer registers a renderer for a tool name.

func RegisterToolResultRenderer

func RegisterToolResultRenderer(name string, fn ToolResultRenderer)

RegisterToolResultRenderer registers a result renderer for a tool name.

Types

type Formatter

type Formatter interface {
	Format(msg claude.Message) string
}

Formatter converts messages to structured text

type TextFormatter

type TextFormatter struct {
	IncludeTimestamp bool
	Verbose          bool
	ShowToolDetails  bool
	// contains filtered or unexported fields
}

TextFormatter implements Formatter using built-in formatting

func NewTextFormatter

func NewTextFormatter() *TextFormatter

NewTextFormatter creates a new text formatter

func (*TextFormatter) Format

func (f *TextFormatter) Format(msg claude.Message) string

Format formats a message

func (*TextFormatter) SetIncludeTimestamp

func (f *TextFormatter) SetIncludeTimestamp(include bool)

SetIncludeTimestamp sets whether to include timestamps in output

func (*TextFormatter) SetShowToolDetails

func (f *TextFormatter) SetShowToolDetails(show bool)

SetShowToolDetails sets whether to show tool details

func (*TextFormatter) SetVerbose

func (f *TextFormatter) SetVerbose(verbose bool)

SetVerbose sets verbose mode for detailed output

type ToolRenderer

type ToolRenderer func(name string, input map[string]interface{}) string

ToolRenderer renders a tool_use call to a single (possibly multi-line) string.

type ToolResultRenderer

type ToolResultRenderer func(name string, m *claude.ToolResultMessage) string

ToolResultRenderer renders a tool_result message to a single (possibly multi-line) string. The tool name is looked up via ToolUseID by the formatter.

type ToolUseRef

type ToolUseRef struct {
	ID    string
	Name  string
	Input map[string]interface{}
}

ToolUseRef is a lightweight view of a tool_use block used for grouping.

Jump to

Keyboard shortcuts

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