Help us shape the future of Go! Take the 2026 Go Developer Survey

watch

package
v0.7.217 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package watch implements the chunk watch TUI dashboard.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Draft added in v0.7.217

type Draft struct {
	RunID   string
	Summary string
	Stat    string
	Diff    string
}

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

type Drafter func(ctx context.Context, root, prompt string, activity func(string)) (Draft, error)

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) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() tea.View

func (Model) WithBottomMargin added in v0.7.217

func (m Model) WithBottomMargin(rows int) Model

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) WithDrafts added in v0.7.217

func (m Model) WithDrafts(ctx context.Context, dir string, draft Drafter, send Sender) Model

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) WithRelaunch added in v0.7.204

func (m Model) WithRelaunch() Model

WithRelaunch returns a copy of m that starts the daemon again when a poll finds it gone.

type ProjectEntry

type ProjectEntry struct {
	ProjectRoot string
}

ProjectEntry holds everything the watch model needs for one project.

type Sender added in v0.7.217

type Sender func(root, runID string) (string, error)

Sender hands a draft's run to the factory to refine and returns the factory run's session ID.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL