Documentation
¶
Index ¶
- Variables
- func DefaultInput(def bool) string
- func NewLogChannel() <-chan agents.ChannelLog
- func RenderDebug(text string) string
- func RenderError(text string) string
- func RenderErrorDetail(text string) string
- func RenderFocus(text string) string
- func RenderHeader(level int, text string) string
- func RenderInfo(text string) string
- func RenderMarkdown(content string, style string) (string, error)
- func RenderTrace(text string) string
- func RenderWarning(text string) string
- func RenderWithMargin(text string) string
- func RunPaginate(text string) error
- func RunServiceTUI(service string, logCh <-chan agents.ChannelLog, startFn func(t *ServiceTUI)) error
- func ServiceFocusRenderer(unique string) func(string) string
- func ServiceRenderer(unique string) func(string) string
- func Styles() ...
- type ChoiceResult
- type ConfirmResult
- type Entry
- type FlowDoneMsg
- type InputResult
- type LogView
- type SelectResult
- type ServiceErrorMsg
- type ServiceLogMsg
- type ServiceReadyMsg
- type ServiceRunnerModel
- type ServiceState
- type ServiceStateMsg
- type ServiceTUI
- func (t *ServiceTUI) PumpLogs(logCh <-chan agents.ChannelLog)
- func (t *ServiceTUI) SendDone(err error)
- func (t *ServiceTUI) SendError(err error)
- func (t *ServiceTUI) SendLog(level wool.Loglevel, source, message string)
- func (t *ServiceTUI) SendReady(service string, port int)
- func (t *ServiceTUI) SendState(service string, state ServiceState)
- type StatusBar
Constants ¶
This section is empty.
Variables ¶
var ( ColorPrimary = lipgloss.Color("#7C3AED") ColorSecondary = lipgloss.Color("#06B6D4") ColorSuccess = lipgloss.Color("#10B981") ColorWarning = lipgloss.Color("#F59E0B") ColorError = lipgloss.Color("#EF4444") ColorMuted = lipgloss.Color("#6B7280") ColorText = lipgloss.Color("#E5E7EB") ColorSubtle = lipgloss.Color("#374151") ColorBg = lipgloss.Color("#111827") )
Functions ¶
func DefaultInput ¶
DefaultInput returns "(Y/n)" or "(y/N)" based on the default value.
func NewLogChannel ¶
func NewLogChannel() <-chan agents.ChannelLog
NewLogChannel creates a buffered channel and registers a processor so agent logs flow into the channel. Call this before starting agents.
func RenderDebug ¶
RenderDebug renders text in the debug style.
func RenderError ¶
RenderError renders text in the error style with an icon.
func RenderErrorDetail ¶
RenderErrorDetail renders text in the error style without an icon.
func RenderFocus ¶
RenderFocus renders text with a rounded border for emphasis.
func RenderHeader ¶
RenderHeader renders text as a level-1 or level-2 header.
func RenderMarkdown ¶
RenderMarkdown renders markdown content with the given glamour style (e.g. "dark", "light", "auto").
func RenderTrace ¶
RenderTrace renders text in the trace style.
func RenderWarning ¶
RenderWarning renders text in the warning style with an icon.
func RenderWithMargin ¶
RenderWithMargin renders text with a standard display margin.
func RunPaginate ¶
RunPaginate shows text in a paginated view. Blocks until dismissed.
func RunServiceTUI ¶
func RunServiceTUI(service string, logCh <-chan agents.ChannelLog, startFn func(t *ServiceTUI)) error
RunServiceTUI creates and runs an inline TUI for a service. startFn is called in a goroutine to start the service flow; it should call tui.SendReady/SendError when the flow reaches steady state. The TUI blocks until Ctrl+C or SendDone. Returns after the TUI exits. Output remains visible in the terminal after exit for debugging.
func ServiceFocusRenderer ¶
ServiceFocusRenderer returns a render function like ServiceRenderer but with a rounded border added, for focus-level log messages.
func ServiceRenderer ¶
ServiceRenderer returns a render function that applies a deterministic color to text based on the service's unique identifier. Results are cached.
func Styles ¶
func Styles() *struct {
Header lipgloss.Style
StatusBar lipgloss.Style
LogInfo lipgloss.Style
LogWarn lipgloss.Style
LogError lipgloss.Style
LogDebug lipgloss.Style
LogForward lipgloss.Style
LogTrace lipgloss.Style
Service lipgloss.Style
Spinner lipgloss.Style
Muted lipgloss.Style
Bold lipgloss.Style
Viewport lipgloss.Style
}
Styles returns the shared style set.
Types ¶
type ChoiceResult ¶
ChoiceResult holds the outcome of a choice prompt.
type ConfirmResult ¶
ConfirmResult holds the outcome of a confirm prompt.
func RunConfirm ¶
func RunConfirm(message string, defaultValue bool) (ConfirmResult, error)
RunConfirm runs an interactive yes/no prompt.
type FlowDoneMsg ¶
type FlowDoneMsg struct {
Err error
}
FlowDoneMsg signals that the flow has completed (playbook returned).
type InputResult ¶
InputResult holds the outcome of an input prompt.
type LogView ¶
type LogView struct {
// contains filtered or unexported fields
}
LogView is a scrollable log panel that renders styled log entries.
func NewLogView ¶
func NewLogView() LogView
NewLogView creates a LogView with a sensible default size.
func (*LogView) AppendText ¶
AppendText adds a raw styled line to the log viewport.
type SelectResult ¶
SelectResult holds the outcome of a select prompt.
type ServiceErrorMsg ¶
type ServiceErrorMsg struct {
Err error
}
ServiceErrorMsg is sent on a fatal error from the flow.
type ServiceLogMsg ¶
ServiceLogMsg carries a log entry from an agent or service binary.
type ServiceReadyMsg ¶
ServiceReadyMsg is sent when the service has started successfully.
type ServiceRunnerModel ¶
type ServiceRunnerModel struct {
// contains filtered or unexported fields
}
ServiceRunnerModel is a Bubbletea model for running a Codefly service.
func (ServiceRunnerModel) Init ¶
func (m ServiceRunnerModel) Init() tea.Cmd
func (ServiceRunnerModel) View ¶
func (m ServiceRunnerModel) View() string
type ServiceState ¶
type ServiceState int
ServiceState enumerates the phases of a service lifecycle.
const ( StateLoading ServiceState = iota StateInitializing StateStarting StateRunning StateTesting StateStopping StateStopped StateFailed )
func (ServiceState) String ¶
func (s ServiceState) String() string
type ServiceStateMsg ¶
type ServiceStateMsg struct {
State ServiceState
Service string
}
ServiceStateMsg reports a lifecycle state change.
type ServiceTUI ¶
type ServiceTUI struct {
// contains filtered or unexported fields
}
ServiceTUI controls a running service TUI. Callers use Send* methods to push events without knowing about Bubbletea.
func (*ServiceTUI) PumpLogs ¶
func (t *ServiceTUI) PumpLogs(logCh <-chan agents.ChannelLog)
PumpLogs reads from logCh and forwards entries to the TUI. Blocks until the channel is closed; run in a goroutine.
func (*ServiceTUI) SendDone ¶
func (t *ServiceTUI) SendDone(err error)
SendDone signals the flow has completed.
func (*ServiceTUI) SendError ¶
func (t *ServiceTUI) SendError(err error)
SendError reports a fatal error.
func (*ServiceTUI) SendLog ¶
func (t *ServiceTUI) SendLog(level wool.Loglevel, source, message string)
SendLog pushes a log entry into the TUI viewport.
func (*ServiceTUI) SendReady ¶
func (t *ServiceTUI) SendReady(service string, port int)
SendReady marks the service as running.
func (*ServiceTUI) SendState ¶
func (t *ServiceTUI) SendState(service string, state ServiceState)
SendState reports a lifecycle state change.
type StatusBar ¶
type StatusBar struct {
// contains filtered or unexported fields
}
StatusBar renders a bottom bar with service name, state, and elapsed time.
func NewStatusBar ¶
func (*StatusBar) SetState ¶
func (b *StatusBar) SetState(state ServiceState)