Help us shape the future of Go! Take the 2026 Go Developer Survey

render

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package render is the print front: an agentturn subscriber that streams a run to a writer as it happens.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean

func Clean(s string) string

Clean removes what would act on a terminal rather than show on it: the C0 controls other than newline and tab (ESC, carriage return, backspace, bell, ...), DEL, the C1 controls, and the bidirectional overrides that make text read as something else. An escape sequence loses its ESC and shows as the harmless text it would have been; removing the one byte, rather than parsing the sequence, is what keeps a sequence cut in two by streaming deltas from working.

func CleanWriter

func CleanWriter(w io.Writer) io.Writer

CleanWriter is w with Clean applied to everything written to it.

Types

type Printer

type Printer struct {
	W io.Writer
	// Think shows reasoning deltas in a [thinking] block.
	Think bool
	// contains filtered or unexported fields
}

Printer writes a run to W. It is an agentturn subscriber; because every event is a barrier it runs on the loop's goroutine and needs no locking of its own.

func (*Printer) Handle

func (p *Printer) Handle(_ context.Context, ev agentturn.Event) error

Handle is the subscriber function.

Jump to

Keyboard shortcuts

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