Documentation
¶
Overview ¶
Package plan provides plan file selection, parsing, and manipulation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoPlansFound = errors.New("no plans found")
ErrNoPlansFound is returned when no plan files exist in the plans directory.
Functions ¶
func ExtractBranchName ¶
ExtractBranchName derives a branch name from a plan file path. removes the .md extension and strips any leading date prefix (e.g., "2024-01-15-").
func FileHasUncompletedCheckbox ¶ added in v0.24.0
FileHasUncompletedCheckbox returns true if the file contains any uncompleted actionable checkbox (- [ ]). used for malformed plans (no task headers) to avoid treating them as complete. ignores format-description checkboxes (text containing [ ] or [x]) to match HasUncompletedActionableWork behavior.
Types ¶
type Checkbox ¶ added in v0.16.0
Checkbox represents a single checkbox item in a task.
func (Checkbox) IsActionable ¶ added in v0.24.0
IsActionable returns false if checkbox text contains format pattern [ ] or [x] — such checkboxes are description/examples, ignored for completion check.
type Plan ¶ added in v0.16.0
Plan represents a parsed plan file.
func ParsePlanFile ¶ added in v0.16.0
ParsePlanFile reads and parses a plan file from disk.
type Selector ¶
Selector handles plan file selection and resolution.
func NewSelector ¶
NewSelector creates a new Selector with the given plans directory and colors.
func (*Selector) FindRecent ¶
FindRecent finds the most recently modified plan file in the plans directory that was modified after the given start time.
type Task ¶ added in v0.16.0
type Task struct {
Number int `json:"number"`
Title string `json:"title"`
Status TaskStatus `json:"status"`
Checkboxes []Checkbox `json:"checkboxes"`
}
Task represents a task section in a plan.
func (*Task) HasUncompletedActionableWork ¶ added in v0.24.0
HasUncompletedActionableWork returns true if the task has any unchecked actionable checkbox. checkboxes whose text contains [ ] or [x] (format description) are ignored.
type TaskStatus ¶ added in v0.16.0
type TaskStatus string
TaskStatus represents the execution status of a task.
const ( TaskStatusPending TaskStatus = "pending" TaskStatusActive TaskStatus = "active" TaskStatusDone TaskStatus = "done" TaskStatusFailed TaskStatus = "failed" )
task status constants.
func DetermineTaskStatus ¶ added in v0.16.0
func DetermineTaskStatus(checkboxes []Checkbox) TaskStatus
DetermineTaskStatus calculates task status based on checkbox states.