ui

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package ui centralises Alaska's terminal styling so the rest of the code can stay unopinionated about colour and layout.

Index

Constants

This section is empty.

Variables

View Source
var (
	Accent  = color.New(color.FgCyan).SprintFunc()
	Muted   = color.New(color.FgHiBlack).SprintFunc()
	Success = color.New(color.FgGreen).SprintFunc()
	WarnS   = color.New(color.FgYellow).SprintFunc()
	Err     = color.New(color.FgRed, color.Bold).SprintFunc()
	Role    = color.New(color.FgMagenta).SprintFunc()
	Title   = color.New(color.FgCyan, color.Bold).SprintFunc()
)

SprintFuncs — inline colour for one-off messages.

View Source
var PromptRaw = "\001\033[1;36m\002you ▸\001\033[0m\002 "

PromptRaw is a readline-safe coloured prompt. The \001..\002 delimiters tell readline which bytes are zero-width, so line wrapping stays correct.

Functions

func AssistantFooter

func AssistantFooter(w io.Writer)

AssistantFooter prints a subtle separator after the streamed reply.

func AssistantHeader

func AssistantHeader(w io.Writer, providerName, model string)

AssistantHeader prints a header line before the assistant's streamed reply.

func Banner(w io.Writer, providerName, model string)

Banner prints the ALASKA logo + metadata at REPL startup.

func BoxContent

func BoxContent(w io.Writer, title, content string)

BoxContent renders content inside an accent-coloured rounded box.

func Error

func Error(w io.Writer, format string, a ...any)

func ErrorBox

func ErrorBox(w io.Writer, content string)

ErrorBox renders a red-framed error.

func Info

func Info(w io.Writer, format string, a ...any)

Info / OK / Error — single-line styled messages.

func OK

func OK(w io.Writer, format string, a ...any)

func RenderRoleLabel

func RenderRoleLabel(role string) string

RenderRoleLabel returns a coloured role label (e.g. for /history listing).

func Warn

func Warn(w io.Writer, format string, a ...any)

Types

This section is empty.

Jump to

Keyboard shortcuts

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