tui

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachAuthHeaders added in v0.6.1

func AttachAuthHeaders(urlStr string, cfg *config.Config, headers map[string]string) map[string]string

AttachAuthHeaders adds authentication headers for known domains. Currently supports Hugging Face and CivitAI tokens from environment.

func New

func New(cfg *config.Config, st *state.DB, version string) tea.Model

func NormalizeCivitAIURL added in v0.6.1

func NormalizeCivitAIURL(raw string) string

NormalizeCivitAIURL converts civitai.com model page URLs to civitai:// URIs. Example: https://civitai.com/models/12345?modelVersionId=67890

-> civitai://model/12345?version=67890

Returns the normalized URI if the input is a CivitAI model page URL, otherwise returns the original input unchanged.

func NormalizeHuggingFaceURL added in v0.6.1

func NormalizeHuggingFaceURL(raw string) string

NormalizeHuggingFaceURL converts huggingface.co blob URLs to hf:// URIs. Example: https://huggingface.co/owner/repo/blob/main/path/to/file.bin

-> hf://owner/repo/path/to/file.bin?rev=main

Returns the normalized URI if the input is a HF blob URL, otherwise returns the original input unchanged.

func NormalizeURL added in v0.6.1

func NormalizeURL(raw string) string

NormalizeURL normalizes various URL formats to their URI equivalents. Handles both CivitAI model pages and Hugging Face blob URLs.

func ResolveAndAttachAuth added in v0.6.1

func ResolveAndAttachAuth(ctx context.Context, raw string, cfg *config.Config, existingHeaders map[string]string) (resolvedURL string, headers map[string]string, err error)

ResolveAndAttachAuth resolves a URL/URI and attaches authentication headers. This is the main function for preparing downloads - it handles: - URL normalization (CivitAI, Hugging Face) - URI resolution (hf://, civitai://) - Authentication header attachment

Returns the resolved URL and headers ready for download.

func ResolveWithMeta added in v0.6.1

func ResolveWithMeta(ctx context.Context, raw string, cfg *config.Config) (resolvedURL, fileName, suggested, civType string, err error)

ResolveWithMeta resolves a URL/URI using the resolver and returns metadata. Handles hf://, civitai://, and direct HTTP(S) URLs. For CivitAI model page URLs and HF blob URLs, normalizes them first. Returns full Resolved struct for HF quantization support.

func ResolveWithMetaFull added in v0.6.1

func ResolveWithMetaFull(ctx context.Context, raw string, cfg *config.Config) (*resolver.Resolved, error)

ResolveWithMetaFull resolves a URL/URI and returns the full Resolved struct. This is needed for quantization support where we need AvailableQuantizations.

Types

type Model added in v0.6.1

type Model struct {
	// contains filtered or unexported fields
}

func (*Model) Init added in v0.6.1

func (m *Model) Init() tea.Cmd

func (*Model) Update added in v0.6.1

func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Model) View added in v0.6.1

func (m *Model) View() string

type Theme added in v0.6.1

type Theme struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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