Documentation
¶
Overview ¶
Package input provides terminal input collection for interactive plan creation.
Index ¶
Constants ¶
const ( ActionAccept = "accept" ActionRevise = "revise" ActionReject = "reject" )
draft review action constants
Variables ¶
This section is empty.
Functions ¶
func AskYesNo ¶ added in v0.6.0
AskYesNo prompts with y/N and returns true for yes. defaults to no on EOF, empty input, context cancellation, or any read error.
func ReadLineWithContext ¶ added in v0.6.0
ReadLineWithContext reads a line from reader with context cancellation support. returns the line (including newline), error, or context error if canceled. this allows Ctrl+C (SIGINT) to interrupt blocking stdin reads.
Types ¶
type Collector ¶
type Collector interface {
// AskQuestion presents a question with options and returns the selected answer.
// Returns the selected option text or error if selection fails.
AskQuestion(ctx context.Context, question string, options []string) (string, error)
// AskDraftReview presents a plan draft for review with Accept/Revise/Reject options.
// Returns the selected action ("accept", "revise", or "reject") and feedback text (empty for accept/reject).
AskDraftReview(ctx context.Context, question string, planContent string) (action string, feedback string, err error)
}
Collector provides interactive input collection for plan creation.
type TerminalCollector ¶
type TerminalCollector struct {
// contains filtered or unexported fields
}
TerminalCollector implements Collector using fzf (if available) or numbered selection fallback.
func NewTerminalCollector ¶
func NewTerminalCollector(noColor bool) *TerminalCollector
NewTerminalCollector creates a new TerminalCollector with specified options.
func (*TerminalCollector) AskDraftReview ¶ added in v0.6.0
func (c *TerminalCollector) AskDraftReview(ctx context.Context, question, planContent string) (string, string, error)
AskDraftReview presents a plan draft for review with Accept/Revise/Reject options. Shows the rendered plan content, then prompts for action selection. If Revise is selected, prompts for feedback text. Returns action ("accept", "revise", "reject") and feedback (empty for accept/reject).
func (*TerminalCollector) AskQuestion ¶
func (c *TerminalCollector) AskQuestion(ctx context.Context, question string, options []string) (string, error)
AskQuestion presents options using fzf if available, otherwise falls back to numbered selection.