ui

package
v0.0.0-...-36026b4 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsAllOption

func ContainsAllOption(items []string) bool

ContainsAllOption checks if the ">all" option was selected in a list of items

func RunEditorWithFallback

func RunEditorWithFallback(cfg *types.Config, filePath string) error

RunEditorWithFallback tries to run the user's preferred editor, then falls back to common editors.

Types

type BraveSearchResult

type BraveSearchResult struct {
	Web struct {
		Results []BraveWebResult `json:"results"`
	} `json:"web"`
}

BraveSearchResult represents the top-level structure of the Brave Search API response

type BraveWebResult

type BraveWebResult struct {
	Title       string `json:"title"`
	URL         string `json:"url"`
	Description string `json:"description"`
}

BraveWebResult represents a single web result from the Brave Search API

type Terminal

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

Terminal handles terminal-related operations

func NewTerminal

func NewTerminal(config *types.Config) *Terminal

NewTerminal creates a new terminal handler

func (*Terminal) CodeDump

func (t *Terminal) CodeDump() (string, error)

CodeDump generates a comprehensive code dump of all text files in the current directory

func (*Terminal) CodeDumpFromDir

func (t *Terminal) CodeDumpFromDir(targetDir string) (string, error)

CodeDumpFromDir generates a comprehensive code dump of all text files in the specified directory

func (*Terminal) CodeDumpFromDirForCLI

func (t *Terminal) CodeDumpFromDirForCLI(targetDir string) (string, error)

CodeDumpFromDirForCLI generates a comprehensive code dump for CLI usage with cancellation detection

func (*Terminal) CopyLatestResponseToClipboard

func (t *Terminal) CopyLatestResponseToClipboard(chatHistory []types.ChatHistory) error

CopyLatestResponseToClipboard copies the latest bot response directly to clipboard

func (*Terminal) CopyResponsesInteractive

func (t *Terminal) CopyResponsesInteractive(chatHistory []types.ChatHistory, messages []types.ChatMessage) error

CopyResponsesInteractive allows user to select and copy chat responses to clipboard

func (*Terminal) CopyToClipboard

func (t *Terminal) CopyToClipboard(content string) error

CopyToClipboard copies content to the system clipboard with cross-platform support

func (*Terminal) ExtractSentencesFromChatHistory

func (t *Terminal) ExtractSentencesFromChatHistory(chatHistory []types.ChatHistory, messages []types.ChatMessage) []string

ExtractSentencesFromChatHistory scans the entire chat history and extracts all unique sentences

func (*Terminal) ExtractSentencesFromText

func (t *Terminal) ExtractSentencesFromText(text string) []string

ExtractSentencesFromText extracts all sentences from a given text

func (*Terminal) ExtractURLsFromChatHistory

func (t *Terminal) ExtractURLsFromChatHistory(chatHistory []types.ChatHistory) []string

ExtractURLsFromChatHistory scans the entire chat history and extracts all unique URLs

func (*Terminal) ExtractURLsFromMessages

func (t *Terminal) ExtractURLsFromMessages(messages []types.ChatMessage) []string

ExtractURLsFromMessages scans all chat messages and extracts all unique URLs

func (*Terminal) ExtractURLsFromText

func (t *Terminal) ExtractURLsFromText(text string) []string

ExtractURLsFromText extracts all URLs from a given text using regex

func (*Terminal) FzfMultiSelect

func (t *Terminal) FzfMultiSelect(items []string, prompt string) ([]string, error)

FzfMultiSelect provides a fuzzy finder interface for multiple selections

func (*Terminal) FzfMultiSelectExact

func (t *Terminal) FzfMultiSelectExact(items []string, prompt string) ([]string, error)

FzfMultiSelectExact provides an exact matching fuzzy finder interface for multiple selections

func (*Terminal) FzfMultiSelectForCLI

func (t *Terminal) FzfMultiSelectForCLI(items []string, prompt string) ([]string, error)

FzfMultiSelectForCLI provides a fuzzy finder interface for multiple selections with cancellation detection

func (*Terminal) FzfSelect

func (t *Terminal) FzfSelect(items []string, prompt string) (string, error)

FzfSelect provides a fuzzy finder interface for selection

func (*Terminal) FzfSelectOrQuery

func (t *Terminal) FzfSelectOrQuery(items []string, prompt string) (string, error)

FzfSelectOrQuery provides a fuzzy finder interface that allows for selection or custom query input.

func (*Terminal) GetCurrentDirFilesRecursive

func (t *Terminal) GetCurrentDirFilesRecursive() ([]string, error)

GetCurrentDirFilesRecursive returns all files and directories in the current directory and subdirectories

func (*Terminal) GetDirFilesRecursive

func (t *Terminal) GetDirFilesRecursive(targetDir string) ([]string, error)

GetDirFilesRecursive returns all files and directories in the specified directory and subdirectories

func (*Terminal) IsTerminal

func (t *Terminal) IsTerminal() bool

IsTerminal checks if the input is from a terminal

func (*Terminal) IsURL

func (t *Terminal) IsURL(str string) bool

IsURL is a public method to check if a string is a valid URL

func (*Terminal) LoadFileContent

func (t *Terminal) LoadFileContent(selections []string) (string, error)

LoadFileContent loads and returns content from selected files/directories or URLs

func (*Terminal) PrintError

func (t *Terminal) PrintError(message string)

PrintError prints an error message

func (*Terminal) PrintInfo

func (t *Terminal) PrintInfo(message string)

PrintInfo prints an informational message

func (*Terminal) PrintModelSwitch

func (t *Terminal) PrintModelSwitch(model string)

PrintModelSwitch prints model switch confirmation

func (*Terminal) PrintPlatformSwitch

func (t *Terminal) PrintPlatformSwitch(platform, model string)

PrintPlatformSwitch prints platform switch confirmation

func (*Terminal) PrintSuccess

func (t *Terminal) PrintSuccess(message string)

PrintSuccess prints a success message

func (*Terminal) RecordShellSession

func (t *Terminal) RecordShellSession() (string, error)

RecordShellSession records the entire shell session and returns the content as a string.

func (*Terminal) ScrapeURLs

func (t *Terminal) ScrapeURLs(urls []string) (string, error)

ScrapeURLs scrapes content from multiple URLs

func (*Terminal) ShowHelp

func (t *Terminal) ShowHelp()

ShowHelp displays the help information

func (*Terminal) ShowHelpFzf

func (t *Terminal) ShowHelpFzf() string

ShowHelpFzf displays the help information using fzf for interactive selection. Returns the selected command if it should be executed, empty string otherwise.

func (*Terminal) ShowLoadingAnimation

func (t *Terminal) ShowLoadingAnimation(message string, done chan bool)

ShowLoadingAnimation displays a loading animation

func (*Terminal) WebSearch

func (t *Terminal) WebSearch(query string) (string, error)

WebSearch performs a web search using the Brave Search API

Jump to

Keyboard shortcuts

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