toggle

package
v2.0.5-main.4 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2026 License: MIT Imports: 3 Imported by: ? 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

Overview

Package toggle has the words for the terminal app's switches: the value that each word typed after a switch's slash command sets, the values each switch accepts, and the spinner frames for each busy indicator.

Index

Constants

View Source
const (
	StatusTop    = "top"
	StatusBottom = "bottom"
	StatusOff    = "off"
)

A window's status line shows as dials on the bar at the top of the terminal, on the bottom edge of the window's frame, or nowhere.

View Source
const (
	DensityComfortable = "comfortable"
	DensityCompact     = "compact"
	DensityDense       = "dense"
)

A window's transcript density sets a blank row between its parts and inside them, only between its parts, or nowhere.

View Source
const (
	ProgressOff     = "off"
	ProgressNew     = "new"
	ProgressAll     = "all"
	ProgressVerbose = "verbose"
)

A transcript hides tool calls, shows a line when the tool changes, shows a line per call, or opens every call with its full input and output.

View Source
const (
	DetailMinimal    = "minimal"
	DetailNormal     = "normal"
	DetailDetailed   = "detailed"
	DetailEverything = "everything"
	DetailCustom     = "custom"
)

A transcript's detail level, from alpha's levels, sets how much of the agent's work it shows: only replies, each call as a folded line, calls and reasoning open, or every call with its full input and output. The level is custom after its parts were set one by one.

View Source
const (
	FoldHidden = "hidden"
	FoldFolded = "folded"
	FoldOpen   = "open"
	// FoldDetail folds the parts by the detail level.
	FoldDetail = "detail"
)

A transcript's reasoning shows hidden, folded to a line, or open.

View Source
const (
	IndicatorUnicode = "unicode"
	IndicatorEmoji   = "emoji"
	IndicatorASCII   = "ascii"
)

A busy indicator is the current style's braille wheel, the moon's phases, or plain strokes.

View Source
const SessionScope = "--session"

SessionScope is the word after /detail that applies the level to the current session instead of the profile's settings.

Variables

Densities has the densities from the roomiest to the tightest.

Details has the levels that /detail accepts, from the least shown to the most.

Indicators has the busy indicators that /indicator accepts.

View Source
var MouseWords = []string{"on", "off", "toggle", "wheel", "buttons", "all"}

MouseWords has the words that /mouse offers, in its usage order.

Progresses has the tool line settings in the order that /verbose cycles through them.

View Source
var StatusWords = []string{"on", "off", "top", "bottom", "toggle"}

StatusWords has the words that /statusbar offers.

Functions

func Density

func Density(word, now string) (string, bool)

Density returns the density that the word requests, the way alpha's /density reads it: no word and toggle go from comfortable to compact and from any other density back to comfortable, on means compact, off means comfortable, and a density's name selects it. It returns false when /density does not accept the word.

func Detail

func Detail(words string) (level string, session, ok bool)

Detail returns the level and the scope that the words after /detail request: a level's name, or no level to show the current level, and --session to apply it only to this session, in either order. Any other word, or a second level, returns false.

func Flag

func Flag(word string, now bool) (bool, bool)

Flag turns a switch on or off by the word typed after its slash command, the way alpha's switches read it: no word and toggle flip it, and on and off set it. Any other word returns false.

func Indicator

func Indicator(word, now string) (string, bool)

Indicator returns the busy indicator that the word requests: no word moves to the next indicator, and an indicator's name selects it. Any other word returns false.

func Level

func Level(parts Preset) string

Level returns the detail level that the parts match, and custom when they do not match any level.

func Mouse

func Mouse(word, now string) (string, bool)

Mouse returns the mouse tracking that the word requests: no word and toggle turn tracking off, or on for every move when it is off. It returns false when /mouse does not accept the word.

func Progress

func Progress(word, now string) (string, bool)

Progress returns the tool line setting that the word requests: no word moves to the next setting, and after verbose back to off, like alpha's /verbose, and a setting's name selects it. It returns false when /verbose does not accept the word.

func Spinner

func Spinner(indicator string) []string

Spinner returns the spinner frames for the busy indicator: the moon's phases, each shown for two frames, because alpha turns them at half the pace, or four strokes. It returns nil when the indicator is the current style's wheel.

func StatusBar

func StatusBar(word, now string) (string, bool)

StatusBar returns the status line's position that the word requests, the way alpha's /statusbar reads it: no word and toggle turn the status line off, or on at the top when it is off, and on means the top. It returns false when /statusbar does not accept the word.

Types

type Preset

type Preset struct {
	Progress, Reasoning string
	Open                bool
}

Preset is the set of parts that a detail level sets: the tool lines, the reasoning's display, and whether calls and their results open.

func Of

func Of(level string) (Preset, bool)

The Of function returns the parts that the detail level sets, and false when the level is custom or any other word.

Jump to

Keyboard shortcuts

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