llamaclaw-tide

import "github.com/ruhelavansh-oss/esml/tide"

Index

Variables

var (
    SyntaxKeyword = lipgloss.NewStyle().Foreground(lipgloss.Color("75"))
    SyntaxString  = lipgloss.NewStyle().Foreground(lipgloss.Color("114"))
    SyntaxNumber  = lipgloss.NewStyle().Foreground(lipgloss.Color("220"))
    SyntaxComment = lipgloss.NewStyle().Foreground(lipgloss.Color("240")).Italic(true)
    SyntaxFunc    = lipgloss.NewStyle().Foreground(lipgloss.Color("213"))
    SyntaxOp      = lipgloss.NewStyle().Foreground(lipgloss.Color("208"))
)

var (
    TitleStyle = lipgloss.NewStyle().
               Bold(true).
               Foreground(lipgloss.Color("51"))

    StatusStyle = lipgloss.NewStyle().
                Foreground(lipgloss.Color("245"))

    KeyStyle = lipgloss.NewStyle().
             Bold(true).
             Foreground(lipgloss.Color("226"))

    DimStyle = lipgloss.NewStyle().
             Foreground(lipgloss.Color("240"))

    ErrorStyle = lipgloss.NewStyle().
               Bold(true).
               Foreground(lipgloss.Color("196"))

    SuccessStyle = lipgloss.NewStyle().
                 Bold(true).
                 Foreground(lipgloss.Color("46"))

    WarnStyle = lipgloss.NewStyle().
              Bold(true).
              Foreground(lipgloss.Color("214"))

    BorderStyle = lipgloss.NewStyle().
                Border(lipgloss.RoundedBorder()).
                BorderForeground(lipgloss.Color("63")).
                Padding(1, 2)

    HeaderStyle = lipgloss.NewStyle().
                Bold(true).
                Foreground(lipgloss.Color("51")).
                Background(lipgloss.Color("235")).
                Padding(0, 1)

    FooterStyle = lipgloss.NewStyle().
                Foreground(lipgloss.Color("245")).
                Background(lipgloss.Color("235")).
                Padding(0, 1)

    StatusBarStyle = lipgloss.NewStyle().
                   Foreground(lipgloss.Color("252")).
                   Background(lipgloss.Color("236")).
                   Padding(0, 1)

    PanelBorderStyle = lipgloss.NewStyle().
                     Border(lipgloss.RoundedBorder()).
                     BorderForeground(lipgloss.Color("240"))

    PanelFocusedStyle = lipgloss.NewStyle().
                      Border(lipgloss.RoundedBorder()).
                      BorderForeground(lipgloss.Color("63"))

    LogoStyle = lipgloss.NewStyle().
              Bold(true).
              Foreground(lipgloss.Color("51"))

    PetStyle = lipgloss.NewStyle().
             Foreground(lipgloss.Color("213"))

    // Screen-specific accent colors
    ReplAccent = lipgloss.NewStyle().
               Foreground(lipgloss.Color("46")) // green

    ChatAccent = lipgloss.NewStyle().
               Foreground(lipgloss.Color("39")) // blue

    PipelineAccent = lipgloss.NewStyle().
                   Foreground(lipgloss.Color("214")) // amber

    DoctorAccent = lipgloss.NewStyle().
                 Foreground(lipgloss.Color("196")) // red

    MigrationAccent = lipgloss.NewStyle().
                    Foreground(lipgloss.Color("141")) // purple

    DatasetAccent = lipgloss.NewStyle().
                  Foreground(lipgloss.Color("117")) // cyan

    // Parity status colors
    ParityDone = lipgloss.NewStyle().
               Foreground(lipgloss.Color("46")).
               Bold(true)

    ParityPartial = lipgloss.NewStyle().
                  Foreground(lipgloss.Color("214")).
                  Bold(true)

    ParityMissing = lipgloss.NewStyle().
                  Foreground(lipgloss.Color("196")).
                  Bold(true)

    // Active/inactive borders for panels
    ActiveBorderStyle = lipgloss.NewStyle().
                      Border(lipgloss.ThickBorder()).
                      BorderForeground(lipgloss.Color("63"))

    InactiveBorderStyle = lipgloss.NewStyle().
                        Border(lipgloss.NormalBorder()).
                        BorderForeground(lipgloss.Color("240"))

    // Code block styling
    CodeBlockStyle = lipgloss.NewStyle().
                   Background(lipgloss.Color("235")).
                   Foreground(lipgloss.Color("252")).
                   Padding(0, 1)

    // Badge styles
    BadgeStyle = lipgloss.NewStyle().
               Background(lipgloss.Color("63")).
               Foreground(lipgloss.Color("255")).
               Padding(0, 1).
               Bold(true)

    BadgeDimStyle = lipgloss.NewStyle().
                  Background(lipgloss.Color("238")).
                  Foreground(lipgloss.Color("245")).
                  Padding(0, 1)

    // Agent mode indicator
    AgentOnStyle = lipgloss.NewStyle().
                 Background(lipgloss.Color("22")).
                 Foreground(lipgloss.Color("46")).
                 Padding(0, 1).
                 Bold(true)

    AgentOffStyle = lipgloss.NewStyle().
                  Background(lipgloss.Color("236")).
                  Foreground(lipgloss.Color("240")).
                  Padding(0, 1)

    // Language indicators for REPL
    LangPythonStyle = lipgloss.NewStyle().
                    Foreground(lipgloss.Color("226")).
                    Bold(true)

    LangRStyle = lipgloss.NewStyle().
               Foreground(lipgloss.Color("39")).
               Bold(true)

    LangShellStyle = lipgloss.NewStyle().
                   Foreground(lipgloss.Color("46")).
                   Bold(true)

    LangGoStyle = lipgloss.NewStyle().
                Foreground(lipgloss.Color("117")).
                Bold(true)
)

var (
    TreeSelectedStyle = lipgloss.NewStyle().
                      Bold(true).
                      Foreground(lipgloss.Color("51")).
                      Background(lipgloss.Color("236"))

    TreeLeafStyle = lipgloss.NewStyle().
                  Foreground(lipgloss.Color("252"))

    TreeBranchStyle = lipgloss.NewStyle().
                    Bold(true).
                    Foreground(lipgloss.Color("226"))
)

func Ask

func Ask(cfg LLMConfig, prompt, systemPrompt string) (string, error)

func CopyToClipboard

func CopyToClipboard(text string) error

func ExecLanguage

func ExecLanguage(lang Language, code, projectRoot, pythonPath string, shellOverride ...string) (string, error)

func FindPython

func FindPython(projectRoot string) string

func HandleCLICommand

func HandleCLICommand(cmd string, pythonPath, projectRoot string) (string, bool)

func Highlight

func Highlight(code string, lang Language) string

func HighlightOutput

func HighlightOutput(text string) string

func HighlightPython

func HighlightPython(code string) string

func HighlightR

func HighlightR(code string) string

func PopScreen

func PopScreen() tea.Cmd

func PushScreen

func PushScreen(m tea.Model) tea.Cmd

func RunPython

func RunPython(pythonPath, projectRoot string, args ...string) (string, error)

func RunPythonCode

func RunPythonCode(pythonPath, projectRoot, code string) (string, error)

func RunPythonModule

func RunPythonModule(pythonPath, projectRoot, module string, args ...string) (string, error)

func StreamAsk

func StreamAsk(cfg LLMConfig, prompt, systemPrompt string) tea.Cmd

func StreamOllamaRaw

func StreamOllamaRaw(cfg LLMConfig, prompt, systemPrompt string) (io.ReadCloser, error)

type AppModel

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

func NewApp

func NewApp() AppModel

func (AppModel) Init

func (m AppModel) Init() tea.Cmd

func (AppModel) Update

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

func (AppModel) View

func (m AppModel) View() string

type ChatModel

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

func NewChatModel

func NewChatModel(app *AppModel, llm LLMConfig) ChatModel

func (ChatModel) Init

func (m ChatModel) Init() tea.Cmd

func (ChatModel) Update

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

func (ChatModel) View

func (m ChatModel) View() string

type DatasetModel

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

func NewDatasetModel

func NewDatasetModel(app *AppModel) DatasetModel

func (DatasetModel) Init

func (m DatasetModel) Init() tea.Cmd

func (DatasetModel) Update

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

func (DatasetModel) View

func (m DatasetModel) View() string

type DoctorModel

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

func NewDoctorModel

func NewDoctorModel(app *AppModel) DoctorModel

func (DoctorModel) Init

func (m DoctorModel) Init() tea.Cmd

func (DoctorModel) Update

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

func (DoctorModel) View

func (m DoctorModel) View() string

type HardwareInfo

type HardwareInfo struct {
    OS       string
    Arch     string
    Platform string
    MemoryMB int
    HasGPU   bool
    HasNVMe  bool
    CPUCores int
}

func DetectHardware

func DetectHardware() HardwareInfo

func (HardwareInfo) ShortString

func (hw HardwareInfo) ShortString() string

func (HardwareInfo) SuggestModel

func (hw HardwareInfo) SuggestModel() string

func (HardwareInfo) SuggestTQBits

func (hw HardwareInfo) SuggestTQBits() int

type HelpModel

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

func NewHelpModel

func NewHelpModel(app *AppModel) HelpModel

func (HelpModel) Init

func (m HelpModel) Init() tea.Cmd

func (HelpModel) Update

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

func (HelpModel) View

func (m HelpModel) View() string

type HistoryEntry

type HistoryEntry struct {
    Role string
    Text string
}

type HomeModel

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

func NewHomeModel

func NewHomeModel(app *AppModel) HomeModel

func (HomeModel) Init

func (m HomeModel) Init() tea.Cmd

func (HomeModel) Update

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

func (HomeModel) View

func (m HomeModel) View() string

type IDEModel

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

func NewReplModel

func NewReplModel(app *AppModel) IDEModel

func (IDEModel) Init

func (m IDEModel) Init() tea.Cmd

func (IDEModel) Update

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

func (IDEModel) View

func (m IDEModel) View() string

type LLMConfig

type LLMConfig struct {
    Provider    LLMProvider
    Model       string
    BaseURL     string
    APIKey      string
    Temperature float64
    Hardware    HardwareInfo
    TurboQuant  int
}

func DetectProvider

func DetectProvider() LLMConfig

type LLMProvider

type LLMProvider int

const (
    ProviderNone LLMProvider = iota
    ProviderOllama
    ProviderFreeAPI
    ProviderGemini
    ProviderGemma4
    ProviderFuncGemma
    ProviderOpenAI
    ProviderLocal
)

func (LLMProvider) String

func (p LLMProvider) String() string

type Language

type Language int

const (
    LangPython Language = iota
    LangR
    LangShell
    LangGo
    LangTypeScript
    LangJavaScript
    LangHTML
    LangCSS
    LangLaTeX
    LangLua
)

func DetectLanguage

func DetectLanguage(code string) Language

func (Language) Prefix

func (l Language) Prefix() string

func (Language) String

func (l Language) String() string

type MigrationModel

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

func NewMigrationModel

func NewMigrationModel(app *AppModel) MigrationModel

func (MigrationModel) Init

func (m MigrationModel) Init() tea.Cmd

func (MigrationModel) Update

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

func (MigrationModel) View

func (m MigrationModel) View() string

type PetState

type PetState int

const (
    PetIdle PetState = iota
    PetThinking
    PetHappy
    PetSad
)

type PipelineModel

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

func NewPipelineModel

func NewPipelineModel(app *AppModel) PipelineModel

func (PipelineModel) Init

func (m PipelineModel) Init() tea.Cmd

func (PipelineModel) Update

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

func (PipelineModel) View

func (m PipelineModel) View() string

type ScreenLayout

type ScreenLayout struct {
    Width         int
    Height        int
    HeaderHeight  int
    StatusHeight  int
    ContentHeight int
}

func NewScreenLayout

func NewScreenLayout(w, h int) ScreenLayout

func (ScreenLayout) CenterContent

func (s ScreenLayout) CenterContent(content string) string

func (ScreenLayout) ContentWidth

func (s ScreenLayout) ContentWidth() int

func (ScreenLayout) Header

func (s ScreenLayout) Header(text string) string

func (ScreenLayout) InputHeight

func (s ScreenLayout) InputHeight() int

func (ScreenLayout) LeftWidth

func (s ScreenLayout) LeftWidth(pct float64) int

func (ScreenLayout) PanelHeight

func (s ScreenLayout) PanelHeight() int

func (ScreenLayout) PanelInnerWidth

func (s ScreenLayout) PanelInnerWidth(pct float64) int

func (ScreenLayout) RightWidth

func (s ScreenLayout) RightWidth(pct float64) int

func (ScreenLayout) SinglePanel

func (s ScreenLayout) SinglePanel(content string) string

func (ScreenLayout) SplitPanels

func (s ScreenLayout) SplitPanels(left, right string, leftPct float64, focusLeft bool) string

func (ScreenLayout) StatusBar

func (s ScreenLayout) StatusBar(items ...string) string

func (ScreenLayout) ViewportHeight

func (s ScreenLayout) ViewportHeight() int

type SessionHistory

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

func NewSessionHistory

func NewSessionHistory() *SessionHistory

func (*SessionHistory) Add

func (h *SessionHistory) Add(role, text string)

func (*SessionHistory) All

func (h *SessionHistory) All() string

func (*SessionHistory) Clear

func (h *SessionHistory) Clear()

func (*SessionHistory) CopyAll

func (h *SessionHistory) CopyAll() string

func (*SessionHistory) CopyErrors

func (h *SessionHistory) CopyErrors() string

func (*SessionHistory) CopyInputs

func (h *SessionHistory) CopyInputs() string

func (*SessionHistory) CopyLastN

func (h *SessionHistory) CopyLastN(n int) string

func (*SessionHistory) CopyLastNErrors

func (h *SessionHistory) CopyLastNErrors(n int) string

func (*SessionHistory) CopyOutputs

func (h *SessionHistory) CopyOutputs() string

func (*SessionHistory) Errors

func (h *SessionHistory) Errors() []string

func (*SessionHistory) Inputs

func (h *SessionHistory) Inputs() []string

func (*SessionHistory) LastN

func (h *SessionHistory) LastN(n int) string

func (*SessionHistory) LastNErrors

func (h *SessionHistory) LastNErrors(n int) []string

func (*SessionHistory) Outputs

func (h *SessionHistory) Outputs() []string

func (*SessionHistory) Summary

func (h *SessionHistory) Summary() string

type SettingsModel

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

func NewSettingsModel

func NewSettingsModel(app *AppModel) SettingsModel

func (SettingsModel) Init

func (m SettingsModel) Init() tea.Cmd

func (SettingsModel) Update

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

func (SettingsModel) View

func (m SettingsModel) View() string

type StatsModel

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

func NewStatsModel

func NewStatsModel(app *AppModel) StatsModel

func (StatsModel) Init

func (m StatsModel) Init() tea.Cmd

func (StatsModel) Update

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

func (StatsModel) View

func (m StatsModel) View() string

type TamagotchiModel

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

func NewTamagotchi

func NewTamagotchi() TamagotchiModel

func (TamagotchiModel) ArtFrame

func (t TamagotchiModel) ArtFrame() string

func (TamagotchiModel) MoodHearts

func (t TamagotchiModel) MoodHearts() string

func (*TamagotchiModel) OnError

func (t *TamagotchiModel) OnError()

func (*TamagotchiModel) OnSuccess

func (t *TamagotchiModel) OnSuccess()

func (*TamagotchiModel) SetState

func (t *TamagotchiModel) SetState(s PetState)

func (TamagotchiModel) StateLabel

func (t TamagotchiModel) StateLabel() string

func (*TamagotchiModel) Tick

func (t *TamagotchiModel) Tick()

func (TamagotchiModel) View

func (t TamagotchiModel) View() string

type TreeModel

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

func NewTreeModel

func NewTreeModel(root *TreeNode) TreeModel

func (*TreeModel) CursorDown

func (t *TreeModel) CursorDown()

func (*TreeModel) CursorUp

func (t *TreeModel) CursorUp()

func (*TreeModel) Selected

func (t *TreeModel) Selected() *TreeNode

func (*TreeModel) SetSize

func (t *TreeModel) SetSize(w, h int)

func (*TreeModel) Toggle

func (t *TreeModel) Toggle()

func (*TreeModel) View

func (t *TreeModel) View() string

type TreeNode

type TreeNode struct {
    Label    string
    Children []*TreeNode
    Expanded bool
    IsLeaf   bool
    Data     any
    // contains filtered or unexported fields
}

type VarBridge

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

func NewVarBridge

func NewVarBridge() *VarBridge

func (*VarBridge) AfterExec

func (b *VarBridge) AfterExec(code string, lang Language) []string

func (*VarBridge) InjectSetup

func (b *VarBridge) InjectSetup(lang Language) string

func (*VarBridge) IsEnabled

func (b *VarBridge) IsEnabled() bool

func (*VarBridge) Toggle

func (b *VarBridge) Toggle()

Generated by gomarkdoc