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

plan

package
v0.7.222 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package plan is the planning screen: a chat with Claude beside the plan Claude is writing, rendered as markdown. The developer can comment on any part of the plan; comments go to Claude with their next message. When the developer approves the plan it is handed to the factory to build.

The screen is a component: its host passes it messages and draws what Content returns, and it reports that it is done with a ClosedMsg. Screen hosts it as a program of its own.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClosedMsg

type ClosedMsg struct {
	RunID string
}

ClosedMsg is the screen asking its host to close it: the plan was sent to the factory as run RunID, or, when RunID is "", the developer left.

type Model

type Model struct {

	// RunID is the factory run the plan was sent to, once it has been.
	RunID string
	// contains filtered or unexported fields
}

Model is the planning screen.

func New

func New(ctx context.Context, turn Turner, submit Submitter, first string) Model

New returns the planning screen. A non-empty first message is sent as soon as the screen opens.

func (Model) Content

func (m Model) Content() string

Content is the screen as its host draws it: the panes and the footer, filling the size it was last sent.

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) WithBack

func (m Model) WithBack() Model

WithBack returns a copy of m for a host that keeps the screen when it is closed and can open it again as it was: esc, when there is nothing for it to stop or cancel, and ctrl+c close it without asking or stopping Claude.

func (Model) WithBranch

func (m Model) WithBranch(branch string) Model

WithBranch returns a copy of m that names the branch the plan is for in its header.

func (Model) WithTerminal

func (m Model) WithTerminal(dark, disambiguates bool) Model

WithTerminal returns a copy of m for a terminal with a dark background or not, that tells shift+enter from enter or not. The screen learns of a change to either from the messages its host passes on.

type Screen

type Screen struct {
	Model Model
}

Screen runs the planning screen as a program's whole screen, which ends when the screen closes.

func (Screen) Init

func (s Screen) Init() tea.Cmd

func (Screen) Update

func (s Screen) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Screen) View

func (s Screen) View() tea.View

type Submitter

type Submitter func(plan string) (string, error)

Submitter hands an approved plan to the factory and returns the run's ID.

type Turner

type Turner func(ctx context.Context, message string, activity func(string)) (reply, plan string, err error)

Turner sends the developer's message to the planning agent and returns its reply and the plan as it stands after the turn, reporting what the agent does to activity as it goes.

Jump to

Keyboard shortcuts

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