message

package
v1.164.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 15 Imported by: 1 module, 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 New

func New(ar *animation.Runtime, msg *types.Message) *messageModel

New creates a new message view

Types

type AssistantSegments added in v1.128.0

type AssistantSegments struct {
	Header []string
	Stable []string
	Tail   []string
}

AssistantSegments is a line-oriented active assistant rendering. Header and Stable are retained by the message view and immutable until the next width change; Tail contains only the mutable markdown block.

type Model

type Model interface {
	layout.Model
	layout.Sizeable
	SetMessage(msg *types.Message) tea.Cmd
	AppendContent(content string) tea.Cmd
	SetSelected(selected bool)
	SetHovered(hovered bool)
	CodeBlocks() []markdown.CodeBlock
	// Finalize releases per-message render state that is only needed while the
	// message is actively streaming. The message content and code-block metadata
	// are preserved; calling View() afterwards still produces correct output
	// without retaining a per-view render cache or IncrementalRenderer.
	Finalize()
	// HasLiveRenderState reports whether this view currently retains a
	// populated renderCache or an IncrementalRenderer instance. Used by tests
	// to assert that finalized views have actually released their per-message
	// render state without reaching into unexported fields via reflection.
	HasLiveRenderState() bool
	// RenderedSegments exposes immutable header/stable blocks separately from
	// the mutable tail so transcript follow-tail rendering need not flatten the
	// complete active response on every chunk.
	RenderedSegments(width int) (AssistantSegments, bool)
}

Model represents a view that can render a message

Jump to

Keyboard shortcuts

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