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
- Variables
- func Density(word, now string) (string, bool)
- func Detail(words string) (level string, session, ok bool)
- func Flag(word string, now bool) (bool, bool)
- func Indicator(word, now string) (string, bool)
- func Level(parts Preset) string
- func Mouse(word, now string) (string, bool)
- func Progress(word, now string) (string, bool)
- func Spinner(indicator string) []string
- func StatusBar(word, now string) (string, bool)
- type Preset
Constants ¶
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.
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.
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.
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.
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.
const ( IndicatorUnicode = "unicode" IndicatorEmoji = "emoji" IndicatorASCII = "ascii" )
A busy indicator is the current style's braille wheel, the moon's phases, or plain strokes.
const SessionScope = "--session"
SessionScope is the word after /detail that applies the level to the current session instead of the profile's settings.
Variables ¶
var Densities = []string{DensityComfortable, DensityCompact, DensityDense}
Densities has the densities from the roomiest to the tightest.
var Details = []string{DetailMinimal, DetailNormal, DetailDetailed, DetailEverything}
Details has the levels that /detail accepts, from the least shown to the most.
var Indicators = []string{IndicatorUnicode, IndicatorEmoji, IndicatorASCII}
Indicators has the busy indicators that /indicator accepts.
var MouseWords = []string{"on", "off", "toggle", "wheel", "buttons", "all"}
MouseWords has the words that /mouse offers, in its usage order.
var Progresses = []string{ProgressOff, ProgressNew, ProgressAll, ProgressVerbose}
Progresses has the tool line settings in the order that /verbose cycles through them.
var StatusWords = []string{"on", "off", "top", "bottom", "toggle"}
StatusWords has the words that /statusbar offers.
Functions ¶
func Density ¶
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 ¶
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 ¶
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 ¶
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 ¶
Level returns the detail level that the parts match, and custom when they do not match any level.
func Mouse ¶
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 ¶
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 ¶
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.