Documentation
¶
Index ¶
- Constants
- Variables
- func AlignLine(text string, width int, align TextAlign) string
- func Analogous(c Color, angle float64) (Color, Color)
- func AnimateOpacity(animator *Animator, from, to float64, duration time.Duration, ...) uint64
- func AnimateValue(animator *Animator, from, to float64, duration time.Duration, easing EasingFn, ...) uint64
- func CharWrap(text string, maxWidth int) []string
- func ComputeLayout(node Node, bounds Rect)
- func ContrastRatio(a, b Color) float64
- func DiffProps(old, new map[string]any) map[string]any
- func DisableMouse() string
- func EaseInBack(t float64) float64
- func EaseInBounce(t float64) float64
- func EaseInCubic(t float64) float64
- func EaseInElastic(t float64) float64
- func EaseInExpo(t float64) float64
- func EaseInOutBounce(t float64) float64
- func EaseInOutCubic(t float64) float64
- func EaseInOutExpo(t float64) float64
- func EaseInOutQuad(t float64) float64
- func EaseInQuad(t float64) float64
- func EaseLinear(t float64) float64
- func EaseOutBack(t float64) float64
- func EaseOutBounce(t float64) float64
- func EaseOutCubic(t float64) float64
- func EaseOutElastic(t float64) float64
- func EaseOutExpo(t float64) float64
- func EaseOutQuad(t float64) float64
- func EnableMouse(mode MouseMode) string
- func FormatTable(headers []string, rows [][]string, cols []ColumnAlign) []string
- func IsColorBlindSafe(colors []Color) bool
- func LayoutSegments(segs []StyledSegment, maxWidth int) [][]StyledSegment
- func MeasureSegmentsWidth(segs []StyledSegment) int
- func MeasureWidth(text string) int
- func MeetsWCAG(fg, bg Color, level string) bool
- func PadCenter(text string, width int) string
- func PadLeft(text string, width int) string
- func PadRight(text string, width int) string
- func ParseBasicMouse(data []byte) (bool, int, int, MouseButton, MouseAction)
- func ParseSGRMouse(data []byte) (bool, int, int, MouseButton, MouseAction)
- func RelativeLuminance(c Color) float64
- func RenderText(text string, width int) string
- func ResetAttrs(in AttrMask) string
- func Run(model Node) error
- func RunWithOpts(model Node, opts ...Option) error
- func RuneWidth(r rune) int
- func SendMessage(dest, message string) error
- func Truncate(text string, maxWidth int, withEllipsis bool) string
- func TruncateMiddle(text string, maxWidth int) string
- func Width(w int) string
- func WithProgramMessageRouter(p *Program)
- func WordWrap(text string, maxWidth int) []string
- type Align
- type AnimDirection
- type AnimRepeatMode
- type AnimSequenceGroup
- type AnimTransition
- type AnimTransitionType
- type Animation
- type AnimationGroup
- type AnimationSpec
- type Animator
- func (a *Animator) AddSpring(s *Spring) uint64
- func (a *Animator) AddTween(from, to float64, durationMs uint64, easing EasingFn, apply func(v float64)) uint64
- func (a *Animator) CurrentValue(id uint64) (float64, bool)
- func (a *Animator) Remove(id uint64)
- func (a *Animator) Update(deltaMs uint64) []uint64
- type AttrMask
- type Attrs
- type BaseNode
- func (n *BaseNode) AddChild(child Node)
- func (n *BaseNode) Bounds() Rect
- func (n *BaseNode) Children() []Node
- func (n *BaseNode) Dirty() bool
- func (n *BaseNode) HandleEvent(event Event) Cmd
- func (n *BaseNode) Mount() Cmd
- func (n *BaseNode) RemoveChild(child Node)
- func (n *BaseNode) Render(ctx *RenderContext)
- func (n *BaseNode) SetBounds(r Rect)
- func (n *BaseNode) SetDirty()
- func (n *BaseNode) Style() *Style
- func (n *BaseNode) Unmount()
- type BatchCoalescer
- type BatchMsg
- type BorderStyle
- type BoxNode
- type Breakpoint
- type CapabilityProfile
- type ClearScreenMsg
- type Cmd
- type Color
- func ANSI(code uint8) Color
- func BlendColors(a, b Color, t float64) Color
- func Complementary(c Color) Color
- func Darken(c Color, amount float64) Color
- func HSVToRGB(hsv HSV) Color
- func Hex(hex string) Color
- func Lighten(c Color, amount float64) Color
- func RGB(r, g, b uint8) Color
- func TextColorForBackground(bg Color) Color
- type ColorProfile
- type ColorProfileMsg
- type ColumnAlign
- type Computed
- type DataCallback
- type DataNode
- func (dn *DataNode) Get() any
- func (dn *DataNode) Set(val any)
- func (dn *DataNode) Subscribe(id string, fn DataCallback)
- func (dn *DataNode) SubscribePattern(id uint64, pattern SubscribePattern)
- func (dn *DataNode) Unsubscribe(id string, fn DataCallback)
- func (dn *DataNode) UnsubscribePattern(id uint64)
- type DataStore
- type DiffResult
- type Direction
- type EasingFn
- type Effect
- type EffectRunner
- type EnvMsg
- type Event
- type EventBus
- type EventHandler
- type EventType
- type FrameStats
- type HSV
- type History
- type InterruptMsg
- type Justify
- type Key
- type KeyEvent
- type KickstartMsg
- type LayoutEngine
- type LayoutNode
- type MessageRouter
- type Middleware
- type Minimal
- func (m *Minimal) AddChild(child Node)
- func (m *Minimal) Bounds() Rect
- func (m *Minimal) Children() []Node
- func (m *Minimal) Dirty() bool
- func (m *Minimal) Mount() Cmd
- func (m *Minimal) RemoveChild(child Node)
- func (m *Minimal) SetBounds(r Rect)
- func (m *Minimal) SetDirty()
- func (m *Minimal) Style() *Style
- func (m *Minimal) Unmount()
- type Model
- type MouseAction
- type MouseButton
- type MouseEvent
- type MouseMode
- type MouseState
- type Msg
- type Node
- type Option
- func WithBackspace() Option
- func WithFPS(fps int) Option
- func WithHardTabs() Option
- func WithInput(r io.Reader) Option
- func WithInputEnabled(enabled bool) Option
- func WithOutputWriter(w io.Writer) Option
- func WithSize(w, h int) Option
- func WithTheme(t *Theme) Option
- func WithoutCatchPanics() Option
- func WithoutRenderer() Option
- func WithoutSignalHandler() Option
- type OverlayNode
- type Program
- func (p *Program) DataStore() *DataStore
- func (p *Program) Dirty() bool
- func (p *Program) EventBus() *EventBus
- func (p *Program) Height() int
- func (p *Program) Kernel() *kernel.Kernel
- func (p *Program) Kill()
- func (p *Program) Model() Model
- func (p *Program) Renderer() *Renderer
- func (p *Program) Run() error
- func (p *Program) Send(msg Msg)
- func (p *Program) SetDirty()
- func (p *Program) Theme() *Theme
- func (p *Program) Wait()
- func (p *Program) Width() int
- type QuitMsg
- type RawMsg
- type Rect
- type RenderContext
- type Renderer
- type ResponsiveLayout
- type ResumeMsg
- type RichParser
- type RoutedEvent
- type Runtime
- type RuntimeConfig
- type SSHServer
- type SSHServerConfig
- type SSHSession
- type SceneBuffer
- type SceneCell
- type ScrollNode
- type SemanticColor
- type SemanticColors
- type SequenceMsg
- type SessionHandler
- type Signal
- type Spacing
- type SpacingScale
- type SpacingToken
- type Spring
- type SpringEntry
- type StackNode
- type StaggerFromTo
- type State
- type StateChangeListener
- type StateGraph
- func (sg *StateGraph) DirtyPaths(sinceVersion uint64) []string
- func (sg *StateGraph) Get(path string) (any, bool)
- func (sg *StateGraph) GetNode(path string) *DataNode
- func (sg *StateGraph) Restore(snap map[string]any)
- func (sg *StateGraph) Set(path string, val any) bool
- func (sg *StateGraph) Snapshot() map[string]any
- func (sg *StateGraph) SubscribePath(pattern SubscribePattern, fn StateChangeListener) uint64
- func (sg *StateGraph) Unsubscribe(id uint64)
- func (sg *StateGraph) Version() uint64
- type StateMachine
- type Stream
- type Style
- func (s Style) Apply(text string) string
- func (s Style) Bg(c Color) Style
- func (s Style) Fg(c Color) Style
- func (s Style) MarginAll(v int) Style
- func (s Style) PaddingAll(v int) Style
- func (s Style) Reset() string
- func (s Style) SGR() string
- func (s Style) WithAttrs(flags AttrMask) Style
- func (s Style) WithBorder(bs BorderStyle) Style
- type StyledChar
- type StyledSegment
- type SubscribePattern
- type SuspendMsg
- type TextAlign
- type TextLayout
- type TextNode
- type TextRendererConfig
- type Theme
- type ThemeColors
- type ThemeManager
- func (tm *ThemeManager) Apply(name string) bool
- func (tm *ThemeManager) Current() *Theme
- func (tm *ThemeManager) LoadFile(path string) error
- func (tm *ThemeManager) Names() []string
- func (tm *ThemeManager) OnChange(fn func(old, new *Theme))
- func (tm *ThemeManager) Register(name string, theme *Theme)
- type Transition
- type TreeNode
- func (n *TreeNode) AddChild(child *TreeNode)
- func (n *TreeNode) Emit(event Event)
- func (n *TreeNode) Find(id string) *TreeNode
- func (n *TreeNode) FindByType(nodeType string) []*TreeNode
- func (n *TreeNode) GetProp(key string) any
- func (n *TreeNode) On(event string, handler func(Event))
- func (n *TreeNode) RemoveChild(id string)
- func (n *TreeNode) SetProp(key string, value any)
- type TreeRenderer
- type TweenEntry
- type Typography
- type Vec2
- type WidgetTheme
- type WidgetThemes
- type WindowSizeMsg
Constants ¶
const EllipsisRune = '…'
EllipsisRune is the Unicode ellipsis character.
Variables ¶
var ( ColorBlack = ANSI(0) ColorRed = ANSI(1) ColorGreen = ANSI(2) ColorYellow = ANSI(3) ColorBlue = ANSI(4) ColorMagenta = ANSI(5) ColorCyan = ANSI(6) ColorWhite = ANSI(7) ColorBrightBlack = ANSI(8) ColorBrightRed = ANSI(9) ColorBrightGreen = ANSI(10) ColorBrightYellow = ANSI(11) ColorBrightBlue = ANSI(12) ColorBrightCyan = ANSI(14) ColorBrightWhite = ANSI(15) )
Common ANSI color codes
var ( ColorTransparent = Color{} ColorBlackTrue = RGB(0, 0, 0) ColorWhiteTrue = RGB(255, 255, 255) ColorGray = RGB(128, 128, 128) )
Common true colors
var ( ErrProgramPanic = fmt.Errorf("mofu: program experienced a panic") ErrProgramKilled = fmt.Errorf("mofu: program was killed") ErrInterrupted = fmt.Errorf("mofu: program was interrupted") )
var ( // BorderNone is no border. BorderNone = BorderStyle{} // BorderHidden is a hidden border (same as none). BorderHidden = BorderStyle{} // BorderNormal is a standard box border. BorderNormal = BorderStyle{ Top: '─', Bottom: '─', Left: '│', Right: '│', TopLeft: '┌', TopRight: '┐', BottomLeft: '└', BottomRight: '┘', } // BorderRounded is a rounded corner border. BorderRounded = BorderStyle{ Top: '─', Bottom: '─', Left: '│', Right: '│', TopLeft: '╭', TopRight: '╮', BottomLeft: '╰', BottomRight: '╯', } // BorderThick is a thick border. BorderThick = BorderStyle{ Top: '━', Bottom: '━', Left: '┃', Right: '┃', TopLeft: '┏', TopRight: '┓', BottomLeft: '┗', BottomRight: '┛', } // BorderDouble is a double-line border. BorderDouble = BorderStyle{ Top: '═', Bottom: '═', Left: '║', Right: '║', TopLeft: '╔', TopRight: '╗', BottomLeft: '╚', BottomRight: '╝', } )
Functions ¶
func AnimateOpacity ¶
func AnimateOpacity(animator *Animator, from, to float64, duration time.Duration, setter func(float64)) uint64
AnimateOpacity creates a fade animation (0-1 range).
func AnimateValue ¶
func AnimateValue(animator *Animator, from, to float64, duration time.Duration, easing EasingFn, setter func(float64)) uint64
AnimateValue creates a tween that updates a setter function each frame.
func ComputeLayout ¶
func ContrastRatio ¶
func DisableMouse ¶
func DisableMouse() string
func EaseInBack ¶
EaseInBack accelerates pulling back then shooting forward.
func EaseInBounce ¶
EaseInBounce accelerates with a bounce effect.
func EaseInElastic ¶
EaseInElastic accelerates with an elastic snap.
func EaseInOutBounce ¶
EaseInOutBounce bounce effect in both directions.
func EaseInOutCubic ¶
EaseInOutCubic acceleration until halfway, then deceleration.
func EaseInOutExpo ¶
EaseInOutExpo acceleration until halfway, then deceleration.
func EaseInOutQuad ¶
EaseInOutQuad acceleration until halfway, then deceleration.
func EaseLinear ¶
EaseLinear is the default easing — no acceleration.
func EaseOutBack ¶
EaseOutBack decelerates overshooting then settling.
func EaseOutBounce ¶
EaseOutBounce decelerates with a bounce effect.
func EaseOutElastic ¶
EaseOutElastic decelerates with an elastic snap.
func EnableMouse ¶
func FormatTable ¶
func FormatTable(headers []string, rows [][]string, cols []ColumnAlign) []string
FormatTable formats rows into aligned columns.
func IsColorBlindSafe ¶
func LayoutSegments ¶
func LayoutSegments(segs []StyledSegment, maxWidth int) [][]StyledSegment
LayoutSegments lays out StyledSegments into rows of at most maxWidth.
func MeasureSegmentsWidth ¶
func MeasureSegmentsWidth(segs []StyledSegment) int
MeasureSegmentsWidth sums the cell width across a slice of segments.
func MeasureWidth ¶
MeasureWidth returns the cell count of a string.
func ParseBasicMouse ¶
func ParseBasicMouse(data []byte) (bool, int, int, MouseButton, MouseAction)
func ParseSGRMouse ¶
func ParseSGRMouse(data []byte) (bool, int, int, MouseButton, MouseAction)
func RelativeLuminance ¶
func RenderText ¶
func ResetAttrs ¶
func Run ¶
Run is the simplest way to start a MOFU application. It creates a Program with sensible defaults and runs it.
func RunWithOpts ¶
RunWithOpts starts a MOFU application with options.
func SendMessage ¶
SendMessage delivers a string message to a destination. Destinations follow routing rules used by the Runtime system: literal channel name for local broadcast, "to:<addr>" for a single recipient, or comma-separated list for fan-out.
func TruncateMiddle ¶
TruncateMiddle truncates the middle: "Hello World" → "He…ld" at limit 5.
func WithProgramMessageRouter ¶
func WithProgramMessageRouter(p *Program)
WithProgramMessageRouter connects SendMessage to a Program-level dispatch.
Types ¶
type AnimDirection ¶
type AnimDirection int
AnimDirection controls the animation direction.
const ( AnimForward AnimDirection = iota // 0 to 1 AnimReverse // 1 to 0 AnimAlternate // forward then reverse )
type AnimRepeatMode ¶
type AnimRepeatMode int
AnimRepeatMode controls how animations repeat.
const ( AnimRepeatNone AnimRepeatMode = iota // play once AnimRepeatForever // loop forever AnimRepeatN // loop N times )
type AnimSequenceGroup ¶
type AnimSequenceGroup struct {
// contains filtered or unexported fields
}
AnimSequenceGroup runs animations one after another.
func AnimSequence ¶
func AnimSequence(anims ...*Animation) *AnimSequenceGroup
AnimSequence creates a group that runs animations in order.
func (*AnimSequenceGroup) Done ¶
func (g *AnimSequenceGroup) Done() bool
Done reports whether all animations in the sequence are complete.
func (*AnimSequenceGroup) Update ¶
func (g *AnimSequenceGroup) Update(delta time.Duration)
Update advances the current animation in the sequence.
type AnimTransition ¶
type AnimTransition struct {
Enter AnimationSpec
Exit AnimationSpec
Update AnimationSpec
}
AnimTransition defines enter/exit animations for a widget.
func DefaultAnimTransition ¶
func DefaultAnimTransition() AnimTransition
DefaultAnimTransition returns a transition with fade animations.
func SlideAnimTransition ¶
func SlideAnimTransition() AnimTransition
SlideAnimTransition returns a transition with slide animations.
func (AnimTransition) Animation ¶
func (t AnimTransition) Animation(typ AnimTransitionType, from, to float64) *Animation
Animation creates an Animation for the given transition phase.
type AnimTransitionType ¶
type AnimTransitionType int
AnimTransitionType identifies the transition phase.
const ( AnimTransitionEnter AnimTransitionType = iota AnimTransitionExit AnimTransitionUpdate )
type Animation ¶
type Animation struct {
// contains filtered or unexported fields
}
Animation represents a running animation that produces float64 values.
func NewAnimation ¶
func NewAnimation(spec AnimationSpec, from, to float64) *Animation
NewAnimation creates a new animation from a spec.
func Stagger ¶
func Stagger(spec AnimationSpec, staggerDelay time.Duration, fromTos []StaggerFromTo) []*Animation
Stagger creates animations with staggered delays.
type AnimationGroup ¶
type AnimationGroup struct {
// contains filtered or unexported fields
}
AnimationGroup runs multiple animations simultaneously.
func Parallel ¶
func Parallel(anims ...*Animation) *AnimationGroup
Parallel creates a group that runs all animations simultaneously.
func (*AnimationGroup) Done ¶
func (g *AnimationGroup) Done() bool
Done reports whether all animations in the group are complete.
func (*AnimationGroup) Update ¶
func (g *AnimationGroup) Update(delta time.Duration)
Update advances all animations in the group.
type AnimationSpec ¶
type AnimationSpec struct {
Duration time.Duration
Delay time.Duration
Easing EasingFn
Repeat AnimRepeatMode
RepeatN int
AnimDir AnimDirection
}
AnimationSpec is a declarative animation configuration.
func DefaultAnimationSpec ¶
func DefaultAnimationSpec() AnimationSpec
DefaultAnimationSpec returns a spec with sensible defaults.
type Animator ¶
type Animator struct {
// contains filtered or unexported fields
}
Animator manages active tween/spring animations for a Program.
func (*Animator) AddTween ¶
func (a *Animator) AddTween(from, to float64, durationMs uint64, easing EasingFn, apply func(v float64)) uint64
AddTween registers a tween and returns its ID. Caller supplies Apply(cb) to receive each frame's value.
func (*Animator) CurrentValue ¶
CurrentValue returns the current interpolated value for a tween by ID. Returns (0, false) if not found or not a tween.
type AttrMask ¶
type AttrMask uint16
const ( AttrBold AttrMask = 1 << 0 AttrDim AttrMask = 1 << 1 AttrItalic AttrMask = 1 << 2 AttrUnderline AttrMask = 1 << 3 AttrSlowBlink AttrMask = 1 << 4 AttrRapidBlink AttrMask = 1 << 5 AttrReverse AttrMask = 1 << 6 AttrHidden AttrMask = 1 << 7 AttrStrikethrough AttrMask = 1 << 8 AttrDoubleUnderline AttrMask = 1 << 9 AttrOverline AttrMask = 1 << 10 )
type BaseNode ¶
type BaseNode struct {
// contains filtered or unexported fields
}
BaseNode provides default implementations for all Node methods. Embed this in your struct to get started with minimal boilerplate.
func (*BaseNode) HandleEvent ¶
func (*BaseNode) RemoveChild ¶
func (*BaseNode) Render ¶
func (n *BaseNode) Render(ctx *RenderContext)
type BatchCoalescer ¶
type BatchCoalescer[T any] struct { // contains filtered or unexported fields }
BatchCoalescer coalesces rapid updates into a single update.
func NewBatchCoalescer ¶
func NewBatchCoalescer[T any](signal *Signal[T], interval time.Duration) *BatchCoalescer[T]
NewBatchCoalescer creates a new batch coalescer.
func (*BatchCoalescer[T]) Add ¶
func (b *BatchCoalescer[T]) Add(value T)
Add adds a value to the batch.
type BorderStyle ¶
type BorderStyle struct {
Top, Bottom, Left, Right rune
TopLeft, TopRight, BottomLeft, BottomRight rune
}
BorderStyle defines the characters used to draw borders.
type BoxNode ¶
type BoxNode struct {
BaseNode
}
func (*BoxNode) HandleEvent ¶
func (*BoxNode) Render ¶
func (n *BoxNode) Render(ctx *RenderContext)
type Breakpoint ¶
type Breakpoint struct {
MinWidth int
Layout *LayoutNode
}
Breakpoint defines a layout at a specific width.
type CapabilityProfile ¶
type CapabilityProfile struct {
TrueColor bool
ANSI256 bool
ANSI16 bool
Mouse bool
MouseSGR bool
BracketedPaste bool
Unicode bool
AltScreen bool
SyncOutput bool // CSI 2026
KittyKeyboard bool
Width int
Height int
Terminal string // e.g. "xterm-256color", "wezterm", "iterm2"
}
CapabilityProfile detects and stores terminal capabilities. Use DetectCapabilities to probe the current terminal.
func DetectCapabilities ¶
func DetectCapabilities() CapabilityProfile
DetectCapabilities probes the terminal environment and returns a capability profile. It checks environment variables and falls back to defaults.
func (CapabilityProfile) ColorDepth ¶
func (p CapabilityProfile) ColorDepth() int
ColorDepth returns the maximum color depth supported.
func (CapabilityProfile) SupportsSGRMouse ¶
func (p CapabilityProfile) SupportsSGRMouse() bool
SupportsSGRMouse reports whether the terminal supports SGR extended mouse.
func (CapabilityProfile) SupportsSyncOutput ¶
func (p CapabilityProfile) SupportsSyncOutput() bool
SupportsSyncOutput reports whether the terminal supports CSI 2026.
type Cmd ¶
type Cmd func() Msg
Cmd is an IO operation returning a Msg when complete.
type Color ¶
Color represents a terminal color.
func BlendColors ¶
func Complementary ¶
func TextColorForBackground ¶
type ColorProfile ¶
type ColorProfile struct {
ANSI4Bit, ANSI256, TrueColor Color
}
type ColorProfileMsg ¶
type ColorProfileMsg struct{ Profile string }
ColorProfileMsg carries the detected terminal color profile.
type ColumnAlign ¶
ColumnAlign holds width + alignment for a single column.
type Computed ¶
type Computed[T any] struct { // contains filtered or unexported fields }
Computed is a value derived from signals.
func NewComputed ¶
NewComputed creates a computed value.
type DataCallback ¶
type DataCallback func(oldVal, newVal any)
DataCallback is the legacy callback signature kept for backward compatibility.
type DataNode ¶
type DataNode struct {
ID string
Value any
Source string
Version int64
Updated time.Time
// contains filtered or unexported fields
}
DataNode is a typed state leaf in the graph.
func NewDataNode ¶
NewDataNode constructs a state leaf.
func (*DataNode) Subscribe ¶
func (dn *DataNode) Subscribe(id string, fn DataCallback)
Subscribe registers a callback keyed by owner id.
func (*DataNode) SubscribePattern ¶
func (dn *DataNode) SubscribePattern(id uint64, pattern SubscribePattern)
SubscribePattern records a wildcard subscription id for later notification.
func (*DataNode) Unsubscribe ¶
func (dn *DataNode) Unsubscribe(id string, fn DataCallback)
Unsubscribe removes an exact listener.
func (*DataNode) UnsubscribePattern ¶
UnsubscribePattern removes a pattern listener.
type DataStore ¶
type DataStore struct {
// contains filtered or unexported fields
}
DataStore is a centralized state container with subscriptions.
type DiffResult ¶
type DiffResult struct {
Type string // "add", "remove", "update", "move"
Node *TreeNode
Old *TreeNode
Changes map[string]any
}
DiffResult describes a change between two tree states.
func DiffTrees ¶
func DiffTrees(old, new *TreeNode) []DiffResult
DiffTrees computes the minimal set of changes between two trees.
type Effect ¶
func NewRetryEffect ¶
type EffectRunner ¶
type EffectRunner struct {
// contains filtered or unexported fields
}
EffectRunner runs a side effect when dependencies change.
func NewEffectRunner ¶
func NewEffectRunner(fn func()) *EffectRunner
NewEffectRunner creates a new effect runner.
func (*EffectRunner) OnCleanup ¶
func (e *EffectRunner) OnCleanup(fn func())
OnCleanup registers a cleanup function.
func (*EffectRunner) Run ¶
func (e *EffectRunner) Run()
Run runs the effect and tracks dependencies.
type EventBus ¶
type EventBus struct {
// contains filtered or unexported fields
}
func NewEventBus ¶
func NewEventBus() *EventBus
func (*EventBus) Subscribe ¶
func (eb *EventBus) Subscribe(event string, handler EventHandler)
func (*EventBus) Unsubscribe ¶
type EventHandler ¶
type EventHandler func(Event)
type EventType ¶
type EventType int
EventType identifies the kind of event.
const ( // EventKeyPress is a keyboard event. EventKeyPress EventType = iota // EventMouse is a mouse event. EventMouse // EventResize is a terminal resize event. EventResize // EventData is a data event. EventData // EventAnimation is an animation tick event. EventAnimation // EventSystem is a system event. EventSystem // EventCustom is a custom event. EventCustom )
type FrameStats ¶
type FrameStats struct {
FrameCount int64
RenderTime time.Duration
DirtyCells int
TotalCells int
FPS float64
}
FrameStats holds performance metrics for the current frame.
type History ¶
type History[T any] struct { // contains filtered or unexported fields }
History manages state snapshots for undo/redo.
func NewHistory ¶
NewHistory creates a new history manager.
type Key ¶
type Key int
Key is a keyboard key identifier.
const ( KeyNone Key = iota KeyUp KeyDown KeyRight KeyLeft KeyEnter KeyEsc KeyTab KeySpace KeyBack KeyHome KeyEnd KeyPgUp KeyPgDn KeyInsert KeyDelete KeyF1 KeyF2 KeyF3 KeyF4 KeyF5 KeyF6 KeyF7 KeyF8 KeyF9 KeyF10 KeyF11 KeyF12 KeyShiftTab // Ctrl+key combinations KeyCtrlAt // Ctrl+Space / Ctrl+@ KeyCtrlA // Ctrl+A KeyCtrlB // Ctrl+B KeyCtrlC // Ctrl+C KeyCtrlD // Ctrl+D KeyCtrlE // Ctrl+E KeyCtrlF // Ctrl+F KeyCtrlG // Ctrl+G KeyCtrlJ // Ctrl+J KeyCtrlK // Ctrl+K KeyCtrlL // Ctrl+L KeyCtrlN // Ctrl+N KeyCtrlO // Ctrl+O KeyCtrlP // Ctrl+P KeyCtrlQ // Ctrl+Q KeyCtrlR // Ctrl+R KeyCtrlS // Ctrl+S KeyCtrlT // Ctrl+T KeyCtrlU // Ctrl+U KeyCtrlV // Ctrl+V KeyCtrlW // Ctrl+W KeyCtrlX // Ctrl+X KeyCtrlY // Ctrl+Y KeyCtrlZ // Ctrl+Z KeyCtrlBackslash // Ctrl+\ KeyCtrlCloseBracket // Ctrl+] KeyCtrlCaret // Ctrl+^ KeyCtrlUnderscore // Ctrl+_ )
type KickstartMsg ¶
type KickstartMsg struct{}
KickstartMsg is an internal tick used by the renderer.
type LayoutEngine ¶
type LayoutEngine struct {
// contains filtered or unexported fields
}
LayoutEngine computes layouts for a tree of nodes.
func NewLayoutEngine ¶
func NewLayoutEngine(width, height int) *LayoutEngine
NewLayoutEngine creates a new layout engine.
func (*LayoutEngine) Compute ¶
func (le *LayoutEngine) Compute()
Compute computes the layout for the entire tree.
func (*LayoutEngine) GetBounds ¶
func (le *LayoutEngine) GetBounds(node *LayoutNode) Rect
GetBounds returns the computed bounds for a node.
func (*LayoutEngine) Invalidate ¶
func (le *LayoutEngine) Invalidate()
Invalidate marks the layout as dirty.
func (*LayoutEngine) IsDirty ¶
func (le *LayoutEngine) IsDirty() bool
IsDirty returns whether the layout needs recomputation.
func (*LayoutEngine) Resize ¶
func (le *LayoutEngine) Resize(width, height int)
Resize updates the layout engine dimensions.
func (*LayoutEngine) SetRoot ¶
func (le *LayoutEngine) SetRoot(root *LayoutNode)
SetRoot sets the root layout node.
type LayoutNode ¶
type LayoutNode struct {
Bounds Rect
MinWidth int
MaxWidth int
MinHeight int
MaxHeight int
Grow float64
Shrink float64
Fixed bool
Children []*LayoutNode
}
LayoutNode is a node in the layout tree.
func FixedNode ¶
func FixedNode(width, height int) *LayoutNode
FixedNode creates a fixed-size layout node.
func FlexColumn ¶
func FlexColumn(children []*LayoutNode, gap int) *LayoutNode
FlexColumn creates a vertical flex layout.
func FlexRow ¶
func FlexRow(children []*LayoutNode, gap int) *LayoutNode
FlexRow creates a horizontal flex layout.
type MessageRouter ¶
type MessageRouter struct {
// contains filtered or unexported fields
}
MessageRouter dispatches string messages to destinations.
func NewMessageRouter ¶
func NewMessageRouter(dispatch func(RoutedEvent)) *MessageRouter
NewMessageRouter constructs a router with an optional initial dispatcher.
func (*MessageRouter) SetDispatch ¶
func (r *MessageRouter) SetDispatch(dispatch func(RoutedEvent))
SetDispatch configures the downstream dispatch function.
type Middleware ¶
type Middleware func(SessionHandler) SessionHandler
Middleware wraps a SessionHandler.
func AuthMiddleware ¶
func AuthMiddleware(callback func(sess *SSHSession) bool) Middleware
AuthMiddleware validates SSH connections via public key.
func LoggingMiddleware ¶
func LoggingMiddleware(logger *log.Logger) Middleware
LoggingMiddleware logs SSH session activity. If logger is nil, the default logger is used.
func RateLimitMiddleware ¶
func RateLimitMiddleware(maxConcurrent int) Middleware
RateLimitMiddleware limits concurrent SSH sessions.
type Minimal ¶
type Minimal struct {
// contains filtered or unexported fields
}
Minimal provides default implementations for all Node methods except Render and HandleEvent. Embed this in your model to get started fast.
func (*Minimal) RemoveChild ¶
type Model ¶
type Model = Node
Model is the interface that MOFU programs implement. It is compatible with the legacy Node interface via type alias.
type MouseAction ¶
type MouseAction int
const ( MousePress MouseAction = iota MouseRelease MouseDrag MouseMove )
type MouseButton ¶
type MouseButton int
const ( MouseLeft MouseButton = iota MouseRight MouseMiddle MouseWheelUp MouseWheelDown MouseNone )
type MouseEvent ¶
type MouseEvent struct {
X, Y int
Button MouseButton
Action MouseAction
}
type MouseState ¶
type MouseState struct {
X, Y int
Pressed bool
Button MouseButton
}
type Node ¶
type Node interface {
// Render draws the component within the given bounds.
Render(ctx *RenderContext)
// HandleEvent processes keyboard, mouse, and system events. Return a Cmd to dispatch side effects.
HandleEvent(event Event) Cmd
// Mount is called when the component is added to the tree. Return a Cmd to run on mount.
Mount() Cmd
// Unmount is called when the component is removed from the tree.
Unmount()
// Children returns the component's child nodes.
Children() []Node
// AddChild adds a child node.
AddChild(child Node)
// RemoveChild removes a child node.
RemoveChild(child Node)
// SetDirty marks the component as needing re-render.
SetDirty()
// Dirty reports whether the component needs re-render.
Dirty() bool
// Bounds returns the component's current layout bounds.
Bounds() Rect
// SetBounds sets the component's layout bounds.
SetBounds(Rect)
// Style returns the component's style for rendering.
Style() *Style
}
Node is the core interface for all MOFU components. Every widget must implement this interface. Use Minimal as a base to get default implementations for most methods.
type Option ¶
type Option func(*Program)
func WithBackspace ¶
func WithBackspace() Option
func WithHardTabs ¶
func WithHardTabs() Option
func WithInputEnabled ¶
func WithOutputWriter ¶
func WithoutCatchPanics ¶
func WithoutCatchPanics() Option
func WithoutRenderer ¶
func WithoutRenderer() Option
func WithoutSignalHandler ¶
func WithoutSignalHandler() Option
type OverlayNode ¶
type OverlayNode struct {
BaseNode
}
func NewOverlay ¶
func NewOverlay(children ...Node) *OverlayNode
func (*OverlayNode) HandleEvent ¶
func (n *OverlayNode) HandleEvent(event Event) Cmd
func (*OverlayNode) Mount ¶
func (n *OverlayNode) Mount() Cmd
func (*OverlayNode) Render ¶
func (n *OverlayNode) Render(ctx *RenderContext)
func (*OverlayNode) Unmount ¶
func (n *OverlayNode) Unmount()
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
type Rect ¶
type Rect struct {
X, Y, Width, Height int
}
Rect represents a rectangular region in the terminal grid.
type RenderContext ¶
type RenderContext struct {
Renderer *Renderer
Theme *Theme
Frame int64
Delta time.Duration
Bounds Rect
}
RenderContext is passed to every Render call and provides the renderer, theme, frame info, and bounds.
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
func NewRenderer ¶
func (*Renderer) WriteString ¶
type ResponsiveLayout ¶
type ResponsiveLayout struct {
// contains filtered or unexported fields
}
ResponsiveLayout adapts to terminal size.
func NewResponsiveLayout ¶
func NewResponsiveLayout() *ResponsiveLayout
NewResponsiveLayout creates a responsive layout.
func (*ResponsiveLayout) AddBreakpoint ¶
func (rl *ResponsiveLayout) AddBreakpoint(minWidth int, layout *LayoutNode)
AddBreakpoint adds a layout breakpoint.
func (*ResponsiveLayout) GetLayout ¶
func (rl *ResponsiveLayout) GetLayout(width int) *LayoutNode
GetLayout returns the appropriate layout for the given width.
func (*ResponsiveLayout) SetDefault ¶
func (rl *ResponsiveLayout) SetDefault(layout *LayoutNode)
SetDefault sets the default layout.
type RichParser ¶
type RichParser struct{}
RichParser parses [bracketed-tag] rich text into StyledSegments.
func (*RichParser) ApplyTag ¶
func (rp *RichParser) ApplyTag(tag string, style *Style)
ApplyTag handles a tag. The `tag` label parameter distinguishes it from applyTag method.
func (*RichParser) Parse ¶
func (rp *RichParser) Parse(input string) []StyledSegment
Parse walks the input and produces styled segments.
type RoutedEvent ¶
RoutedEvent carries a message plus routing metadata for tenant dispatch.
type Runtime ¶
type Runtime struct {
ID string
Type string
State string
Config RuntimeConfig
Mounted bool
UpdateHook func()
// contains filtered or unexported fields
}
Runtime is the canonical execution state for a Program.
func NewRuntime ¶
func NewRuntime(id, typ string, cfg RuntimeConfig) *Runtime
NewRuntime builds a Runtime from configuration.
func (*Runtime) DirtyRectangles ¶
DirtyRectangles returns rendered dirty rectangles. This is a no-op placeholder in this revision; the renderer exposes its own dirty-region source of truth.
func (*Runtime) RequestRender ¶
func (r *Runtime) RequestRender()
RequestRender triggers a render. This is a no-op placeholder; runtime callers should use the owning Program's render scheduling.
type RuntimeConfig ¶
RuntimeConfig captures the canonical execution configuration for a Program.
type SSHServer ¶
type SSHServer struct {
// contains filtered or unexported fields
}
SSHServer serves MOFU apps over SSH.
func NewSSHServer ¶
func NewSSHServer(cfg SSHServerConfig) (*SSHServer, error)
NewSSHServer creates a new SSH server.
type SSHServerConfig ¶
type SSHServerConfig struct {
Addr string
HostKey []byte
NewProgram func(*SSHSession) *Program
Middlewares []Middleware
}
SSHServerConfig holds configuration for the SSH server.
type SSHSession ¶
SSHSession wraps an SSH channel to implement io.ReadWriteCloser.
func (*SSHSession) Close ¶
func (s *SSHSession) Close() error
func (*SSHSession) RemoteAddr ¶
func (s *SSHSession) RemoteAddr() string
type SceneBuffer ¶
type SceneBuffer struct {
Cells [][]SceneCell
Width, Height int
// contains filtered or unexported fields
}
func NewSceneBuffer ¶
func NewSceneBuffer(w, h int) *SceneBuffer
func (*SceneBuffer) CellWidth ¶
func (sb *SceneBuffer) CellWidth(ch rune) int
func (*SceneBuffer) Clear ¶
func (sb *SceneBuffer) Clear()
type ScrollNode ¶
type ScrollNode struct {
BaseNode
// contains filtered or unexported fields
}
func NewScroll ¶
func NewScroll(child Node) *ScrollNode
func (*ScrollNode) Children ¶
func (n *ScrollNode) Children() []Node
func (*ScrollNode) HandleEvent ¶
func (n *ScrollNode) HandleEvent(event Event) Cmd
func (*ScrollNode) Mount ¶
func (n *ScrollNode) Mount() Cmd
func (*ScrollNode) Render ¶
func (n *ScrollNode) Render(ctx *RenderContext)
func (*ScrollNode) ScrollBy ¶
func (n *ScrollNode) ScrollBy(dx, dy int)
func (*ScrollNode) ScrollTo ¶
func (n *ScrollNode) ScrollTo(x, y int)
func (*ScrollNode) Unmount ¶
func (n *ScrollNode) Unmount()
type SemanticColor ¶
type SemanticColor int
SemanticColor represents a color with semantic meaning.
const ( SemanticNone SemanticColor = iota SemanticSuccess SemanticWarning SemanticError SemanticInfo SemanticPrimary SemanticSecondary SemanticMuted SemanticAccent )
type SemanticColors ¶
type SessionHandler ¶
type SessionHandler func(sess *SSHSession)
SessionHandler processes a single SSH session.
type Signal ¶
type Signal[T any] struct { // contains filtered or unexported fields }
Signal is a reactive value that notifies subscribers when changed.
func (*Signal[T]) Set ¶
func (s *Signal[T]) Set(value T)
Set updates the value and notifies subscribers.
type Spacing ¶
type Spacing struct{ Top, Right, Bottom, Left int }
Spacing defines padding or margin on all four sides.
func SpacingTokenAll ¶
func SpacingTokenAll(t SpacingToken) Spacing
Spacing returns a Spacing with all sides set to the token value.
type SpacingScale ¶
type SpacingToken ¶
type SpacingToken int
SpacingToken defines a spacing value by semantic name.
const ( SpacingNone SpacingToken = iota SpacingXXS SpacingXS SpacingS SpacingM SpacingL SpacingXL SpacingXXL )
func (SpacingToken) Value ¶
func (t SpacingToken) Value() int
SpacingValue returns the cell count for a spacing token.
type Spring ¶
type Spring struct {
Current float64
Target float64
Velocity float64
Stiffness float64
Damping float64
Mass float64
}
Spring provides damped-spring interpolation for a single float64 value.
func AnimatePosition ¶
AnimatePosition creates a position animation with spring physics.
type SpringEntry ¶
type SpringEntry struct {
Spring *Spring
}
SpringEntry holds state for a single spring.
type StackNode ¶
type StackNode struct {
BaseNode
}
func (*StackNode) HandleEvent ¶
func (*StackNode) Render ¶
func (n *StackNode) Render(ctx *RenderContext)
type StaggerFromTo ¶
type StaggerFromTo struct {
From, To float64
}
StaggerFromTo is a from/to value pair for stagger animations.
type State ¶
type State int
State is the lifecycle state of the Program.
func ProgramState ¶
ProgramState returns the current Program lifecycle state from the active Program instance.
type StateChangeListener ¶
StateChangeListener is called with the path that changed and the new value.
type StateGraph ¶
type StateGraph struct {
// contains filtered or unexported fields
}
StateGraph holds the application state as a path-addressed reactive tree. It is the core differentiator from other TUI frameworks: widgets only redraw when their subscribed paths change.
func NewStateGraph ¶
func NewStateGraph() *StateGraph
NewStateGraph builds an empty reactive state graph.
func (*StateGraph) DirtyPaths ¶
func (sg *StateGraph) DirtyPaths(sinceVersion uint64) []string
DirtyPaths returns paths that changed since sinceVersion, or nil when unchanged.
func (*StateGraph) Get ¶
func (sg *StateGraph) Get(path string) (any, bool)
Get reads the value at path.
func (*StateGraph) GetNode ¶
func (sg *StateGraph) GetNode(path string) *DataNode
GetNode exposes the underlying leaf for advanced callers.
func (*StateGraph) Restore ¶
func (sg *StateGraph) Restore(snap map[string]any)
Restore hydrates the graph from a snapshot, broadcasting changed paths.
func (*StateGraph) Set ¶
func (sg *StateGraph) Set(path string, val any) bool
Set writes a value at path, creating the node when missing. Bubbles the change to exact and pattern subscribers.
func (*StateGraph) Snapshot ¶
func (sg *StateGraph) Snapshot() map[string]any
Snapshot returns a copy of the entire graph.
func (*StateGraph) SubscribePath ¶
func (sg *StateGraph) SubscribePath(pattern SubscribePattern, fn StateChangeListener) uint64
SubscribePath registers fn for changes matching pattern and returns a handle that can be passed to Unsubscribe.
func (*StateGraph) Unsubscribe ¶
func (sg *StateGraph) Unsubscribe(id uint64)
Unsubscribe removes a path listener and its pattern bindings.
func (*StateGraph) Version ¶
func (sg *StateGraph) Version() uint64
Version returns the monotonically increasing graph version.
type StateMachine ¶
type StateMachine struct {
// contains filtered or unexported fields
}
StateMachine tracks lifecycle state transitions and notifies listeners on changes.
func (*StateMachine) History ¶
func (sm *StateMachine) History() []Transition
History returns a copy of recorded transitions.
func (*StateMachine) OnChange ¶
func (sm *StateMachine) OnChange(fn func(from, to State))
OnChange registers a lifecycle hook.
func (*StateMachine) TransitionTo ¶
func (sm *StateMachine) TransitionTo(to State) bool
TransitionTo attempts to change state. It returns whether the transition was accepted.
type Stream ¶
type Stream[T any] struct { // contains filtered or unexported fields }
Stream is a continuous data source with backpressure.
func (*Stream[T]) Done ¶
func (s *Stream[T]) Done() <-chan struct{}
Done returns a channel that's closed when the stream is done.
type Style ¶
type Style struct {
Foreground Color
Background Color
Attrs AttrMask
Border BorderStyle
Margin Spacing
Padding Spacing
Width int
Height int
MinWidth int
MinHeight int
MaxWidth int
MaxHeight int
Align Align
Gap int
Grow float64
Shrink float64
Direction Direction
Opacity float64
OffsetX int
OffsetY int
Gutter int
// contains filtered or unexported fields
}
func DefaultStyle ¶
func DefaultStyle() Style
func SemanticBg ¶
func SemanticBg(sc SemanticColor, theme *Theme) Style
SemanticBg returns a Style with the background set to the semantic color.
func SemanticFg ¶
func SemanticFg(sc SemanticColor, theme *Theme) Style
SemanticFg returns a Style with the foreground set to the semantic color from the given theme. Falls back to a default if theme is nil.
func (Style) PaddingAll ¶
func (Style) WithBorder ¶
func (s Style) WithBorder(bs BorderStyle) Style
type StyledChar ¶
StyledChar is a single character with display width and style.
type StyledSegment ¶
StyledSegment is a run of text sharing one mofu.Style.
func ParseRichText ¶
func ParseRichText(input string) []StyledSegment
ParseRichText parses tagged text.
type SubscribePattern ¶
SubscribePattern describes how a path subscription matches DataNode IDs.
func (SubscribePattern) Matches ¶
func (p SubscribePattern) Matches(id string) bool
Matches reports whether id satisfies the pattern.
func (SubscribePattern) String ¶
func (p SubscribePattern) String() string
type TextLayout ¶
TextLayout holds pre-computed layout for a block of styled text.
func LayoutText ¶
func LayoutText(text string, cfg TextRendererConfig, align TextAlign) TextLayout
LayoutText computes a TextLayout with wrapping + alignment.
type TextRendererConfig ¶
TextRendererConfig controls wrapping, ellipsis, and tab-width.
func DefaultTextRendererConfig ¶
func DefaultTextRendererConfig() TextRendererConfig
DefaultTextRendererConfig returns sensible defaults.
type Theme ¶
type Theme struct {
Name string `json:"name"`
Version string `json:"version,omitempty"`
Colors ThemeColors `json:"colors"`
Semantic SemanticColors `json:"semantic"`
Typography Typography `json:"typography"`
Spacing SpacingScale `json:"spacing"`
Border BorderStyle `json:"-"`
Radius int `json:"radius"`
Widgets WidgetThemes `json:"widgets"`
}
func CatppuccinMocha ¶
func CatppuccinMocha() *Theme
func DefaultTheme ¶
func DefaultTheme() *Theme
func MochiTheme ¶
func MochiTheme() *Theme
type ThemeColors ¶
type ThemeColors struct {
Background Color `json:"background"`
Surface Color `json:"surface"`
Text Color `json:"text"`
TextDim Color `json:"textDim"`
Primary Color `json:"primary"`
Secondary Color `json:"secondary"`
Muted Color `json:"muted"`
Accent Color `json:"accent"`
Success Color `json:"success"`
Warning Color `json:"warning"`
Error Color `json:"error"`
Info Color `json:"info"`
Border Color `json:"border"`
Neutral []Color `json:"neutral,omitempty"`
}
type ThemeManager ¶
type ThemeManager struct {
// contains filtered or unexported fields
}
ThemeManager manages theme registration, switching, and change notifications.
func NewThemeManager ¶
func NewThemeManager(initial *Theme) *ThemeManager
NewThemeManager creates a theme manager with an initial theme.
func (*ThemeManager) Apply ¶
func (tm *ThemeManager) Apply(name string) bool
Apply switches to the named theme. Returns false if not found.
func (*ThemeManager) Current ¶
func (tm *ThemeManager) Current() *Theme
Current returns the currently active theme.
func (*ThemeManager) LoadFile ¶
func (tm *ThemeManager) LoadFile(path string) error
func (*ThemeManager) Names ¶
func (tm *ThemeManager) Names() []string
func (*ThemeManager) OnChange ¶
func (tm *ThemeManager) OnChange(fn func(old, new *Theme))
func (*ThemeManager) Register ¶
func (tm *ThemeManager) Register(name string, theme *Theme)
Register adds a theme with the given name.
type Transition ¶
Transition records a state change.
func (Transition) String ¶
func (t Transition) String() string
func (Transition) Valid ¶
func (t Transition) Valid() bool
Valid returns true if the transition is allowed.
type TreeNode ¶
type TreeNode struct {
ID string
Type string
Props map[string]any
Children []*TreeNode
Parent *TreeNode
Style *Style
Bounds Rect
Visible bool
Focused bool
Dirty bool
// contains filtered or unexported fields
}
TreeNode is a node in the rendering tree.
func NewTreeNode ¶
NewTreeNode creates a new tree node.
func (*TreeNode) FindByType ¶
FindByType finds all nodes of a given type.
func (*TreeNode) RemoveChild ¶
RemoveChild removes a child node.
type TreeRenderer ¶
type TreeRenderer struct {
// contains filtered or unexported fields
}
TreeRenderer renders a tree of nodes to the terminal.
func NewTreeRenderer ¶
func NewTreeRenderer(root *TreeNode, renderer *Renderer, theme *Theme) *TreeRenderer
NewTreeRenderer creates a new tree renderer.
func (*TreeRenderer) FindNode ¶
func (tr *TreeRenderer) FindNode(id string) *TreeNode
FindNode finds a node by ID.
func (*TreeRenderer) Render ¶
func (tr *TreeRenderer) Render(bounds Rect)
Render renders the entire tree.
func (*TreeRenderer) UpdateTree ¶
func (tr *TreeRenderer) UpdateTree(newRoot *TreeNode)
UpdateTree updates the tree and renders changes.
type TweenEntry ¶
type TweenEntry struct {
From, To float64
DurationMs uint64
ElapsedMs uint64
Easing EasingFn
Apply func(v float64) // callback to apply value each frame
}
TweenEntry holds state for a single tween.
type Typography ¶
type Typography struct {
Title, Subtitle, Body, Label, Mono Style
}
type Vec2 ¶
type Vec2 struct {
X, Y float64
}
Vec2 is a 2D point used by layout, scroll, and animation systems.
type WidgetTheme ¶
type WidgetTheme struct {
Normal, Focused, Hover, Pressed, Disabled, Error Style
}
type WidgetThemes ¶
type WidgetThemes struct {
Button WidgetTheme
Input WidgetTheme
List WidgetTheme
Scrollbar WidgetTheme
Checkbox WidgetTheme
Radio WidgetTheme
Progress WidgetTheme
}
type WindowSizeMsg ¶
type WindowSizeMsg struct{ Width, Height int }
WindowSizeMsg carries terminal dimensions.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package agent provides AI-native TUI components for agentic workflows.
|
Package agent provides AI-native TUI components for agentic workflows. |
|
Package ascii provides a procedural ASCII scene engine for MOFU.
|
Package ascii provides a procedural ASCII scene engine for MOFU. |
|
cmd
|
|
|
mofu
command
|
|
|
examples
|
|
|
aiworkflow
command
|
|
|
budget
command
|
|
|
calculator
command
|
|
|
chat
command
|
|
|
counter
command
|
|
|
csvviewer
command
|
|
|
dashboard
command
|
|
|
dockerui
command
|
|
|
email
command
|
|
|
filemanager
command
|
|
|
form
command
|
|
|
gitui
command
|
|
|
kanban
command
|
|
|
logmonitor
command
|
|
|
logviewer
command
|
|
|
markdown
command
|
|
|
monitor
command
|
|
|
musicplayer
command
|
|
|
notepad
command
|
|
|
pomodoro
command
|
|
|
settings
command
|
|
|
stocktracker
command
|
|
|
taskmanager
command
|
|
|
wizard
command
|
|
|
Package kernel provides the execution core for MOFU (Modular Orchestrated Flow Utility).
|
Package kernel provides the execution core for MOFU (Modular Orchestrated Flow Utility). |
|
Package render provides the zero-allocation differential rendering engine for MOFU (Modular Orchestrated Flow Utility).
|
Package render provides the zero-allocation differential rendering engine for MOFU (Modular Orchestrated Flow Utility). |