Documentation
¶
Overview ¶
Package watch implements the fabrik watch TUI for monitoring a single issue.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
func Run(m WatchModel) error
Run runs the bubbletea program with the WatchModel. It injects p.Send into the log follower goroutines before starting.
func StartLogFollower ¶
func StartLogFollower(logDir string, send func(tea.Msg), done <-chan struct{}, getActiveStage func() string)
StartLogFollower launches two goroutines:
- A file-follow goroutine that reads the newest .log file in logDir in real time, calling send(LogLineMsg) for each rendered line.
- A directory-poll goroutine (2s interval) that detects when a new .log file appears (stage transition) and calls send(NewLogFileMsg).
getActiveStage is called by the follow goroutine to determine which stage's log to follow; "" means fall back to the globally newest log file. Both goroutines run until the done channel is closed.
Types ¶
type ClaudeFinishedMsg ¶
type ClaudeFinishedMsg struct {
Err error
}
ClaudeFinishedMsg is sent when the inline Claude subprocess launched via tea.ExecProcess exits. Err is non-nil if Claude exited with an error.
type GitHubOptions ¶
type GitHubOptions struct {
Owner string
Repo string
Client *gh.Client
PollInterval time.Duration
PluginDir string
}
GitHubOptions holds the GitHub API configuration for the watch TUI.
type GitHubPollMsg ¶
type GitHubPollMsg struct{}
GitHubPollMsg is sent by the GitHub poll ticker to trigger a refresh of issue metadata, PR status, CI check runs, and comment count.
type LogLineMsg ¶
type LogLineMsg struct {
Text string
}
LogLineMsg carries a single rendered line of Claude output from the log follower.
type NewLogFileMsg ¶
type NewLogFileMsg struct {
Path string
}
NewLogFileMsg is sent when the log follower detects a new .log file in the issue's log directory, indicating a stage transition.
type StatusMsgMsg ¶
type StatusMsgMsg struct {
Text string
}
StatusMsgMsg carries a transient status message to display in the status bar.
type TickMsg ¶
type TickMsg struct{}
TickMsg is the generic ticker message used for periodic UI refreshes (e.g. elapsed-time display).
type TurnCountMsg ¶
type TurnCountMsg struct {
TurnsUsed int
}
TurnCountMsg is sent by the log follower each time it detects a user event (logical turn start) in the live NDJSON stream, carrying the cumulative per-invocation count.
type WatchModel ¶
type WatchModel struct {
// contains filtered or unexported fields
}
WatchModel is the bubbletea model for the fabrik watch TUI.
func NewModel ¶
func NewModel(issueNumber int, opts GitHubOptions, stagesDir string) WatchModel
NewModel creates a WatchModel for the given issue number. stagesDir is the path to the stages YAML directory; used to build the pipeline order map for tab sorting. If stagesDir is empty or LoadAll fails, tabs fall back to chronological ordering.
func (WatchModel) Init ¶
func (m WatchModel) Init() tea.Cmd
Init starts the GitHub poll ticker and the one-second UI refresh ticker. The log follower goroutines are launched in Run() via p.Send, which is the correct bubbletea pattern for goroutines that need to send messages back.