tui

package
v1.35.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package tui is the terminal front end of `ant beta:sessions connect`: a scrolling transcript above a composer, with a status bar on top and key hints below. Events arrive from internal/sessions/live and are folded into transcript nodes by internal/sessions/timeline.

Files: model.go owns state and the bubbletea loop, input.go the keys and the composer/approval strip, transcript.go the scrolling body, chrome.go the fixed rows around it, and markdown.go, format.go and styles.go the helpers they share.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, session Session, opts Options) error

Run takes over the terminal until the user detaches or ctx ends.

Types

type Options

type Options struct {
	// Verbose starts with tool bodies and token usage expanded (Ctrl-O toggles it).
	Verbose bool
	// ConsoleURL is the session's page in the web Console, shown in the footer.
	ConsoleURL string
}

Options configures what the TUI shows.

type Session

type Session interface {
	Updates() <-chan live.Update
	Snapshot() []live.Event
	Session() *anthropic.BetaManagedAgentsSession
	SendMessage(ctx context.Context, text string) error
	Interrupt(ctx context.Context) error
	Confirm(ctx context.Context, toolUseID string, allow bool, denyMessage string) error
}

Session is what the TUI needs from an attached session; *live.Conn is one. The three senders block on the network and are only called from tea.Cmds.

Jump to

Keyboard shortcuts

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