Documentation
¶
Overview ¶
Package wizard provides the pre-pipeline onboarding flow: it detects repo state, optionally creates a branch, commits uncommitted changes, and pushes to the no-slop gate, then hands off to the main TUI. It supports both the interactive wizard UI and the non-interactive auto-accept path.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Context context.Context
RepoDir string
CurrentBranch string
DefaultBranch string
// AutoAdvance automatically presses Enter on each active wizard step,
// preserving the interactive TUI while accepting the default path.
AutoAdvance bool
// DisableInput disables Bubble Tea input, which is useful for headless runs
// and tests that drive cancellation through the caller context.
DisableInput bool
// NeedsBranch is true when the user has no usable feature branch yet -
// either they're on the default branch, or HEAD is detached. The branch
// step is only active when this is true.
NeedsBranch bool
IsDirty bool
GateRemote string
// Output overrides the Bubble Tea output writer and is also used for the
// terminal-title reset sequence emitted when the wizard shuts down.
Output io.Writer
CreateBranch func(ctx context.Context, name string) error
CommitAll func(ctx context.Context, msg string) error
Push func(ctx context.Context, branch string) error
SuggestBranch func(ctx context.Context) (string, error)
SuggestCommit func(ctx context.Context) (string, error)
Track func(action string, fields map[string]any)
// WaitForRun, if set, runs after push succeeds and blocks while the
// daemon-created run is still catching up. Keeps the alt screen up so the
// handoff to the attach TUI has no visible gap. Only used by the
// interactive Run path; headless RunAuto ignores it.
WaitForRun func(ctx context.Context, branch string) error
}
Config describes the repo state and dependencies the wizard needs. Callers pre-detect git state so the wizard can decide up-front which steps to skip.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the bubbletea model for the wizard.
func NewModel ¶
NewModel constructs a wizard Model. Which steps end up active depends on the supplied Config: if the current branch already differs from the default, the branch step is skipped; if the working tree is clean, the commit step is skipped; the push step always runs.
func (Model) Init ¶
Init returns the initial Cmd for the active step. State was already prepared in NewModel.
func (Model) Result ¶
Result returns the terminal state of the wizard. Only meaningful once the program has exited.
type Result ¶
type Result struct {
Success bool
Aborted bool
BranchCreated bool
CommitMade bool
Pushed bool
TargetBranch string
Err error
}
Result reports what the wizard did. Success means the wizard completed all required steps: the push to the gate succeeded, and when WaitForRun is set, the daemon handoff completed so the caller can re-attach to pick up the new run.