Documentation
¶
Overview ¶
Package watch implements the chunk watch TUI dashboard.
Index ¶
- type Continuer
- type Draft
- type Drafter
- type Model
- func (m Model) HasPlan() bool
- func (m Model) Init() tea.Cmd
- func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m Model) View() tea.View
- func (m Model) WithBottomMargin(rows int) Model
- func (m Model) WithConnection(conn chunkd.Connection) Model
- func (m Model) WithContinue(cont Continuer) Model
- func (m Model) WithDrafts(ctx context.Context, dir string, draft Drafter, send Sender) Model
- func (m Model) WithOpener(open func(string) error) Model
- func (m Model) WithPlans(ctx context.Context, planner Planner) Model
- func (m Model) WithRelaunch() Model
- type Planner
- type ProjectEntry
- type Sender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Continuer ¶ added in v0.7.221
Continuer starts a factory run that picks up the work of run runID in the project at root, as `chunk factory build --continue <run>` does with no prompt, and returns the new run's session ID. Errors are shown as typed, so they should read as a sentence.
type Draft ¶ added in v0.7.217
Draft is Claude's draft of a change, made on the developer's machine in a factory run's worktree: the run, what Claude said it did, and the diff it left, summarized per file and in full. Stat is "" when it changed nothing.
type Drafter ¶ added in v0.7.217
Drafter has Claude draft prompt in the project at root, reporting what it does to activity. It returns the draft as far as it got, with an error, when drafting fails or ctx is cancelled. Errors are shown as typed, so they should read as a sentence.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the BubbleTea model for the watch dashboard.
func New ¶
func New(projects []ProjectEntry, watchAll bool) Model
New creates a Model ready to run. When watchAll is true (the default for `chunk watch`; `--focus` turns it off), each poll also checks for projects that have started a run since the dashboard started and adds them, so a run started after the dashboard launches still shows up without a restart.
func (Model) HasPlan ¶ added in v0.7.221
HasPlan is whether the dashboard has a planning screen whose plan has not been sent to the factory.
func (Model) WithBottomMargin ¶ added in v0.7.217
WithBottomMargin returns a copy of m that leaves the terminal's last rows blank. Editors' built-in terminals can report a row or two more than they show, and the rows they hide are the footer's.
func (Model) WithConnection ¶ added in v0.7.196
func (m Model) WithConnection(conn chunkd.Connection) Model
WithConnection returns a copy of m that reports conn as the daemon it talks to. New reads it from the environment; this is for callers and tests that already know.
func (Model) WithContinue ¶ added in v0.7.221
WithContinue returns a copy of m on which r continues the selected run with cont, when it ended with committed work that has not passed its checks.
func (Model) WithDrafts ¶ added in v0.7.217
WithDrafts returns a copy of m on which n opens a prompt for Claude to draft with draft, and the draft can be sent to the factory with send. Drafts are in dir's project, the one the dashboard was opened in, or the selected run's when dir is "". Drafting stops when ctx is cancelled.
func (Model) WithOpener ¶ added in v0.7.221
WithOpener returns a copy of m that opens links with open instead of the default browser.
func (Model) WithPlans ¶ added in v0.7.221
WithPlans returns a copy of m on which p opens the planning screen, for a plan made with Claude through planner and sent to the factory. Plans are made in the project a draft would be. Claude stops when ctx is cancelled.
func (Model) WithRelaunch ¶ added in v0.7.204
WithRelaunch returns a copy of m that starts the daemon again when a poll finds it gone.
type Planner ¶ added in v0.7.221
Planner opens a conversation with Claude about a plan for a change in the project at root: the planning screen's turns, and the send of the plan to the factory. Its error says, as a sentence, why there can be none.
type ProjectEntry ¶
type ProjectEntry struct {
ProjectRoot string
}
ProjectEntry holds everything the watch model needs for one project.