Documentation
¶
Overview ¶
Package taskadd provides AI-powered natural language task creation. It converts a free-form description into a fully structured Task with title, description, priority, estimated minutes, tags, and suggested dependencies derived from the existing plan.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateTaskPrompt ¶
GenerateTaskPrompt builds the AI prompt that converts a free-form task description into a structured TaskSpec. existingPlan may be nil when no plan exists yet.
Types ¶
type TaskSpec ¶
type TaskSpec struct {
Title string `json:"title"`
Description string `json:"description"`
Priority int `json:"priority"`
Role string `json:"role"`
EstimatedMinutes int `json:"estimated_minutes"`
Tags []string `json:"tags"`
SuggestedDependsOn []int `json:"suggested_depends_on"`
Rationale string `json:"rationale"`
}
TaskSpec holds the AI-structured representation of a new task.
func Enrich ¶
func Enrich(ctx context.Context, p provider.Provider, opts provider.Options, description string, existingPlan *pm.Plan) (*TaskSpec, error)
Enrich calls the AI provider to convert a free-form description into a structured TaskSpec using the existing plan for dependency context.
func ParseTaskResponse ¶
ParseTaskResponse parses the AI's JSON response into a TaskSpec. It tolerates leading/trailing whitespace and extracts the first JSON object it finds in the response.
func Refine ¶
func Refine( ctx context.Context, p provider.Provider, opts provider.Options, description string, spec *TaskSpec, existingPlan *pm.Plan, scanner *bufio.Scanner, ) (*TaskSpec, bool, error)
Refine runs the interactive refinement REPL. It returns the (possibly modified) spec, whether the user accepted, and any error. Pass a nil scanner to use os.Stdin via bufio.