Documentation
¶
Index ¶
- Constants
- Variables
- func FormatContainerStatus(status string) string
- func HasUnicodeSupport() bool
- func HelpText() string
- func ParseSlashCommand(input string) (cmd, arg string)
- func SessionsBaseDir() string
- func SidebarTickCmd() tea.Cmd
- func ToggleTheme()
- type AutocompleteState
- type ChatMessage
- type ChatMessageKind
- type ChatView
- func (c *ChatView) AddMessage(kind ChatMessageKind, content string)
- func (c *ChatView) AppendStream(text string)
- func (c *ChatView) FlushStream()
- func (c *ChatView) ScrollDown()
- func (c *ChatView) ScrollUp()
- func (c *ChatView) SetAgentRunning(running bool)
- func (c *ChatView) SetFocus(f bool)
- func (c *ChatView) SetSize(w, h int)
- func (c *ChatView) TickThinking()
- func (c ChatView) View() string
- type Command
- type ExitMsg
- type KeyMap
- type Model
- type OnboardDoneMsg
- type OnboardingModel
- type SessionBrowserCloseMsg
- type SessionBrowserModel
- type SessionBrowserMsg
- type SessionDetailCloseMsg
- type SessionDetailModel
- type SessionDetailOpenMsg
- type Sidebar
- type SidebarPanel
- type SidebarRefresher
- type SidebarTickMsg
- type SpinTickMsg
- type Spinner
- type StatusBar
Constants ¶
View Source
const TickInterval = 80 * time.Millisecond
Variables ¶
View Source
var ( ColorPrimary = lipgloss.AdaptiveColor{Light: "#00AA44", Dark: "#00FF66"} ColorText = lipgloss.AdaptiveColor{Light: "#0A2912", Dark: "#E0FFE9"} ColorDim = lipgloss.AdaptiveColor{Light: "#2D663B", Dark: "#009944"} ColorBg = lipgloss.AdaptiveColor{Light: "#F0FFF4", Dark: "#050B07"} ColorPanel = lipgloss.AdaptiveColor{Light: "#DCF5E3", Dark: "#0D1C13"} ColorInput = lipgloss.AdaptiveColor{Light: "#E6F7EB", Dark: "#12241A"} ColorSuccess = lipgloss.AdaptiveColor{Light: "#008833", Dark: "#00FF66"} ColorError = lipgloss.AdaptiveColor{Light: "#CC0033", Dark: "#FF2A55"} ColorWarning = lipgloss.AdaptiveColor{Light: "#88A800", Dark: "#CCFF00"} ColorTool = lipgloss.AdaptiveColor{Light: "#008B8B", Dark: "#00FFCC"} ColorBorder = lipgloss.AdaptiveColor{Light: "#99CCAA", Dark: "#004D25"} )
View Source
var ( AppLogo = "DockCode" IconPending = "◦" IconSuccess = "✓" IconError = "✗" IconUser = "▸ You" IconAgent = "◈ Matrix" IconInfo = "◆ Info" IconErrMsg = "✖ Error" IconTool = "⚙ Tool" SpinnerFrames = []string{"⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷"} )
View Source
var ( StyleBase = lipgloss.NewStyle(). Foreground(ColorText) StyleDim = lipgloss.NewStyle(). Foreground(ColorDim) StylePrimary = lipgloss.NewStyle(). Foreground(ColorPrimary). Bold(true) StyleSuccess = lipgloss.NewStyle(). Foreground(ColorSuccess) StyleError = lipgloss.NewStyle(). Foreground(ColorError) StyleWarning = lipgloss.NewStyle().Foreground(ColorWarning) StyleTool = lipgloss.NewStyle(). Foreground(ColorTool) StyleBold = lipgloss.NewStyle(). Bold(true) StyleActiveBorder = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(ColorPrimary) StyleInactiveBorder = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(ColorBorder) StyleActiveTab = lipgloss.NewStyle(). Background(ColorPrimary). Foreground(lipgloss.AdaptiveColor{Light: "#FFFFFF", Dark: "#050B07"}). Bold(true). Padding(0, 1) StyleInactiveTab = lipgloss.NewStyle(). Foreground(ColorDim). Padding(0, 1) StyleStatusBar = lipgloss.NewStyle(). Background(ColorPanel). Foreground(ColorText). Padding(0, 1) StyleInput = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(ColorBorder). Padding(0, 1) StyleInputFocused = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(ColorPrimary). Padding(0, 1) StyleUserPrefix = lipgloss.NewStyle().Foreground(ColorPrimary).Bold(true) StyleAgentPrefix = lipgloss.NewStyle().Foreground(ColorSuccess).Bold(true) StyleInfoPrefix = lipgloss.NewStyle().Foreground(ColorTool) StyleErrPrefix = lipgloss.NewStyle().Foreground(ColorError).Bold(true) StyleToolPrefix = lipgloss.NewStyle().Foreground(ColorTool).Bold(true) )
View Source
var AllCommands = []Command{
{"/help", "Show all available commands"},
{"/exit", "Gracefully exit DockCode"},
{"/clear", "Clear chat and reset session memory"},
{"/newchat", "Start a new chat session"},
{"/settoken", "Set a new API token"},
{"/seturl", "Set a new API base URL"},
{"/model", "Interactive model picker"},
{"/models", "List available models in chat"},
{"/config", "Show current configuration"},
{"/theme", "Toggle dark/light theme"},
{"/sessions", "Open session browser"},
{"/session rename", "Rename current session"},
{"/session delete", "Delete current session"},
{"/session export", "Export chat to markdown file"},
{"/session tag", "Tag current session"},
{"/containers", "Focus containers sidebar panel"},
{"/images", "Focus images sidebar panel"},
{"/volumes", "Focus volumes sidebar panel"},
{"/networks", "Focus networks sidebar panel"},
{"/logs", "Stream container logs (usage: /logs <name>)"},
{"/stop", "Stop a container (usage: /stop <name>)"},
{"/rm", "Remove a container (usage: /rm <name>)"},
}
View Source
var IsDarkMode = true
Functions ¶
func FormatContainerStatus ¶
func HasUnicodeSupport ¶
func HasUnicodeSupport() bool
func ParseSlashCommand ¶
func SessionsBaseDir ¶
func SessionsBaseDir() string
func SidebarTickCmd ¶
func ToggleTheme ¶
func ToggleTheme()
Types ¶
type AutocompleteState ¶
func NewAutocompleteState ¶
func NewAutocompleteState() AutocompleteState
func (*AutocompleteState) Current ¶
func (a *AutocompleteState) Current() string
func (*AutocompleteState) Hide ¶
func (a *AutocompleteState) Hide()
func (*AutocompleteState) MoveDown ¶
func (a *AutocompleteState) MoveDown()
func (*AutocompleteState) MoveUp ¶
func (a *AutocompleteState) MoveUp()
func (*AutocompleteState) Update ¶
func (a *AutocompleteState) Update(input string)
func (AutocompleteState) View ¶
func (a AutocompleteState) View(width int) string
type ChatMessage ¶
type ChatMessage struct {
Kind ChatMessageKind
Content string
}
type ChatMessageKind ¶
type ChatMessageKind int
const ( KindUser ChatMessageKind = iota KindAssistant KindToolStart KindToolDone KindInfo KindError )
type ChatView ¶
type ChatView struct {
// contains filtered or unexported fields
}
func NewChatView ¶
func NewChatView() ChatView
func (*ChatView) AddMessage ¶
func (c *ChatView) AddMessage(kind ChatMessageKind, content string)
func (*ChatView) AppendStream ¶
func (*ChatView) FlushStream ¶
func (c *ChatView) FlushStream()
func (*ChatView) ScrollDown ¶
func (c *ChatView) ScrollDown()
func (*ChatView) SetAgentRunning ¶
func (*ChatView) TickThinking ¶
func (c *ChatView) TickThinking()
type KeyMap ¶
type KeyMap struct {
Send key.Binding
Tab key.Binding
ShiftTab key.Binding
ScrollUp key.Binding
ScrollDown key.Binding
Quit key.Binding
Escape key.Binding
Enter key.Binding
Panel1 key.Binding
Panel2 key.Binding
Panel3 key.Binding
Panel4 key.Binding
}
func DefaultKeyMap ¶
func DefaultKeyMap() KeyMap
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func NewModel ¶
func NewModel( ctx context.Context, cancel context.CancelFunc, cfg *config.Manager, dockerClient *docker.Client, llmClient *llm.Client, sess *agent.Session, sessIdx *agent.SessionIndex, sup *concurrency.Supervisor, ) Model
func (*Model) SetProgram ¶
type OnboardDoneMsg ¶
type OnboardingModel ¶
type OnboardingModel struct {
// contains filtered or unexported fields
}
func NewOnboardingModel ¶
func NewOnboardingModel(ctx context.Context, cfg *config.Manager) OnboardingModel
func (OnboardingModel) Init ¶
func (m OnboardingModel) Init() tea.Cmd
func (OnboardingModel) View ¶
func (m OnboardingModel) View() string
type SessionBrowserCloseMsg ¶
type SessionBrowserCloseMsg struct{}
type SessionBrowserModel ¶
type SessionBrowserModel struct {
// contains filtered or unexported fields
}
func NewSessionBrowserModel ¶
func NewSessionBrowserModel(index *agent.SessionIndex) SessionBrowserModel
func (SessionBrowserModel) Init ¶
func (m SessionBrowserModel) Init() tea.Cmd
func (SessionBrowserModel) View ¶
func (m SessionBrowserModel) View() string
type SessionBrowserMsg ¶
type SessionBrowserMsg struct{ SessionID string }
type SessionDetailCloseMsg ¶
type SessionDetailCloseMsg struct{}
type SessionDetailModel ¶
type SessionDetailModel struct {
// contains filtered or unexported fields
}
func NewSessionDetailModel ¶
func NewSessionDetailModel( summary agent.SessionSummary, chatMD string, agentMD string, ) SessionDetailModel
func (SessionDetailModel) Init ¶
func (m SessionDetailModel) Init() tea.Cmd
func (SessionDetailModel) View ¶
func (m SessionDetailModel) View() string
type SessionDetailOpenMsg ¶
type SessionDetailOpenMsg struct{ SessionID string }
type Sidebar ¶
type Sidebar struct {
// contains filtered or unexported fields
}
func NewSidebar ¶
func NewSidebar() Sidebar
func (*Sidebar) SetPanel ¶
func (s *Sidebar) SetPanel(p SidebarPanel)
func (*Sidebar) Update ¶
func (s *Sidebar) Update(msg agent.SidebarRefreshMsg)
type SidebarPanel ¶
type SidebarPanel int
const ( PanelContainers SidebarPanel = iota PanelImages PanelVolumes PanelNetworks )
type SidebarRefresher ¶
type SidebarRefresher struct {
// contains filtered or unexported fields
}
func NewSidebarRefresher ¶
func (*SidebarRefresher) Start ¶
func (r *SidebarRefresher) Start()
func (*SidebarRefresher) Stop ¶
func (r *SidebarRefresher) Stop()
type SidebarTickMsg ¶
type SidebarTickMsg struct{}
type SpinTickMsg ¶
type SpinTickMsg struct{}
type Spinner ¶
type Spinner struct {
// contains filtered or unexported fields
}
func NewSpinner ¶
func NewSpinner() Spinner
Click to show internal directories.
Click to hide internal directories.