Documentation
¶
Index ¶
- Variables
- func Execute()
- func ProcessImageResult(result *ImageResult, cfg ImageOutputConfig, handler ImageOutputHandler, ...) error
- type AudioCache
- type DefaultImageOutputHandler
- func (h *DefaultImageOutputHandler) PrintCopyError(err error)
- func (h *DefaultImageOutputHandler) PrintCopySuccess()
- func (h *DefaultImageOutputHandler) PrintSaveError(err error)
- func (h *DefaultImageOutputHandler) PrintSaveSuccess(path string)
- func (h *DefaultImageOutputHandler) PrintSuccess(result *ImageResult)
- func (h *DefaultImageOutputHandler) PrintViewerError(err error)
- type ImageOutputConfig
- type ImageOutputHandler
- type ImageResult
- type ImageSaveResult
- type ImageSaver
- type ImageSource
- type RunConfig
- type TempFileManager
- type Theme
Constants ¶
This section is empty.
Variables ¶
var SpinnerFrames = []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}
SpinnerFrames contains the Braille animation frames for loading spinners. Used consistently across chat.go and video.go for visual feedback.
Functions ¶
func ProcessImageResult ¶
func ProcessImageResult(result *ImageResult, cfg ImageOutputConfig, handler ImageOutputHandler, saver *ImageSaver) error
ProcessImageResult processes the image result and handles all output operations.
Types ¶
type AudioCache ¶
AudioCache stores partial transcription results for resume support.
type DefaultImageOutputHandler ¶
type DefaultImageOutputHandler struct{}
DefaultImageOutputHandler prints to stdout/stderr.
func (*DefaultImageOutputHandler) PrintCopyError ¶
func (h *DefaultImageOutputHandler) PrintCopyError(err error)
func (*DefaultImageOutputHandler) PrintCopySuccess ¶
func (h *DefaultImageOutputHandler) PrintCopySuccess()
func (*DefaultImageOutputHandler) PrintSaveError ¶
func (h *DefaultImageOutputHandler) PrintSaveError(err error)
func (*DefaultImageOutputHandler) PrintSaveSuccess ¶
func (h *DefaultImageOutputHandler) PrintSaveSuccess(path string)
func (*DefaultImageOutputHandler) PrintSuccess ¶
func (h *DefaultImageOutputHandler) PrintSuccess(result *ImageResult)
func (*DefaultImageOutputHandler) PrintViewerError ¶
func (h *DefaultImageOutputHandler) PrintViewerError(err error)
type ImageOutputConfig ¶
ImageOutputConfig holds configuration for image output operations.
type ImageOutputHandler ¶
type ImageOutputHandler interface {
PrintSuccess(result *ImageResult)
PrintSaveError(err error)
PrintCopyError(err error)
PrintViewerError(err error)
PrintSaveSuccess(path string)
PrintCopySuccess()
}
ImageOutputHandler handles output operations for image results.
type ImageResult ¶
type ImageResult struct {
Data app.ImageData
Prompt string
Size string
OutputPath string
SaveError error
}
ImageResult represents the structured result of image generation.
type ImageSaveResult ¶
ImageSaveResult contains the result of saving an image.
type ImageSaver ¶
type ImageSaver struct {
// contains filtered or unexported fields
}
ImageSaver handles saving images to disk.
func NewImageSaver ¶
func NewImageSaver(httpClient app.HTTPDoer) *ImageSaver
NewImageSaver creates an ImageSaver with the provided HTTP client.
func (*ImageSaver) Save ¶
func (s *ImageSaver) Save(url, filePath string) *ImageSaveResult
Save downloads an image from URL and saves to file.
type ImageSource ¶
type ImageSource int
ImageSource represents the type of image source (URL or local file)
const ( ImageSourceURL ImageSource = iota ImageSourceFile )
type RunConfig ¶
RunConfig holds runtime configuration collected from flags and config file. Passed to functions instead of accessing globals directly.
func NewRunConfig ¶
func NewRunConfig() RunConfig
NewRunConfig creates RunConfig from viper settings (collected after flag parsing).
type TempFileManager ¶
type TempFileManager struct {
// contains filtered or unexported fields
}
TempFileManager tracks temporary files for cleanup.
func (*TempFileManager) Add ¶
func (m *TempFileManager) Add(path string)
Add registers a file for cleanup.
func (*TempFileManager) AddAll ¶
func (m *TempFileManager) AddAll(paths []string)
AddAll registers multiple files for cleanup.
func (*TempFileManager) Cleanup ¶
func (m *TempFileManager) Cleanup()
Cleanup removes all registered files.
type Theme ¶
type Theme struct {
// Colors
Primary lipgloss.Color
Success lipgloss.Color
Error lipgloss.Color
Subtle lipgloss.Color
Accent lipgloss.Color
White lipgloss.Color
Gold lipgloss.Color
Dark lipgloss.Color
// Common styles
Title lipgloss.Style
Section lipgloss.Style
Divider lipgloss.Style
Dim lipgloss.Style
Info lipgloss.Style
ErrorText lipgloss.Style
HelpText lipgloss.Style
// Chat-specific styles
Prompt lipgloss.Style
AILabel lipgloss.Style
// Command/flag styles (for help)
Command lipgloss.Style
Flag lipgloss.Style
Description lipgloss.Style
Example lipgloss.Style
// Search result styles
ResultTitle lipgloss.Style
ResultLink lipgloss.Style
ResultDate lipgloss.Style
}
Theme holds all lipgloss styles for consistent UI across commands. Centralizes color definitions and style configuration.
func DefaultTheme ¶
func DefaultTheme() *Theme
DefaultTheme returns the default theme with Z.AI colors.
func (*Theme) SpinnerStyle ¶
SpinnerStyle returns a style for the thinking spinner.