diff --git a/README.md b/README.md index a62f1378d4f67b405a3a8d550ff0996416048341..ceb2ef68614b1e95718583b655f16243a33135b8 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,7 @@ lune goal show KEY [--json] - `-a, --area` — area key from config - `-g, --goal` — goal key (requires area) -- `-s, --status` — later, next, started, waiting, completed +- `-s, --status` — later, next, in-progress, waiting, completed - `-n, --note` — task note (use `-` for stdin) - `-p, --priority` — lowest, low, normal, high, highest - `-e, --estimate` — time estimate in minutes (0-720) diff --git a/cmd/task/add.go b/cmd/task/add.go index 7075e75bee004693ef7e533f305355888bf5b759..36d9efb861cf1c26294140c994796caf66037af5 100644 --- a/cmd/task/add.go +++ b/cmd/task/add.go @@ -42,7 +42,7 @@ Use "-" as NAME to read the task name from stdin.`, func init() { AddCmd.Flags().StringP("area", "a", "", "Area key (from config)") AddCmd.Flags().StringP("goal", "g", "", "Goal key (from config)") - AddCmd.Flags().StringP("status", "s", "", "Status: later, next, started, waiting") + AddCmd.Flags().StringP("status", "s", "", "Status: later, next, in-progress, waiting") AddCmd.Flags().StringP("note", "n", "", "Task note (use - for stdin)") AddCmd.Flags().StringP("priority", "p", "", "Priority: lowest, low, normal, high, highest") AddCmd.Flags().IntP("estimate", "e", 0, "Estimate in minutes (0-720)") @@ -55,12 +55,9 @@ func init() { _ = AddCmd.RegisterFlagCompletionFunc("area", completion.Areas) _ = AddCmd.RegisterFlagCompletionFunc("goal", completion.Goals) - _ = AddCmd.RegisterFlagCompletionFunc("status", - completion.Static("later", "next", "started", "waiting")) - _ = AddCmd.RegisterFlagCompletionFunc("priority", - completion.Static("lowest", "low", "normal", "high", "highest")) - _ = AddCmd.RegisterFlagCompletionFunc("motivation", - completion.Static("must", "should", "want")) + _ = AddCmd.RegisterFlagCompletionFunc("status", completion.TaskStatuses) + _ = AddCmd.RegisterFlagCompletionFunc("priority", completion.Priorities) + _ = AddCmd.RegisterFlagCompletionFunc("motivation", completion.Motivations) } func runAdd(cmd *cobra.Command, args []string) error { diff --git a/cmd/task/list.go b/cmd/task/list.go index a775205662dd9ef121f05ac4f1e9f581f0076633..cb70ab200567add4d345eb9a93761a32f6a9cabe 100644 --- a/cmd/task/list.go +++ b/cmd/task/list.go @@ -45,8 +45,7 @@ func init() { ListCmd.Flags().Bool("json", false, "Output as JSON") _ = ListCmd.RegisterFlagCompletionFunc("area", completion.Areas) - _ = ListCmd.RegisterFlagCompletionFunc("status", - completion.Static("later", "next", "started", "waiting", "completed")) + _ = ListCmd.RegisterFlagCompletionFunc("status", completion.TaskStatuses) } func runList(cmd *cobra.Command, _ []string) error { diff --git a/cmd/task/update.go b/cmd/task/update.go index 43d935a397c6c502e72f6a9839378fc91cd61815..43e00d78ca5a0d825607673a82c926c50aa3f407 100644 --- a/cmd/task/update.go +++ b/cmd/task/update.go @@ -33,7 +33,7 @@ func init() { UpdateCmd.Flags().String("name", "", "New task name (use - for stdin)") UpdateCmd.Flags().StringP("area", "a", "", "Move to area key") UpdateCmd.Flags().StringP("goal", "g", "", "Move to goal key") - UpdateCmd.Flags().StringP("status", "s", "", "Status: later, next, started, waiting, completed") + UpdateCmd.Flags().StringP("status", "s", "", "Status: later, next, in-progress, waiting, completed") UpdateCmd.Flags().StringP("note", "n", "", "Task note (use - for stdin)") UpdateCmd.Flags().StringP("priority", "p", "", "Priority: lowest, low, normal, high, highest") UpdateCmd.Flags().IntP("estimate", "e", 0, "Estimate in minutes (0-720)") @@ -46,12 +46,9 @@ func init() { _ = UpdateCmd.RegisterFlagCompletionFunc("area", completion.Areas) _ = UpdateCmd.RegisterFlagCompletionFunc("goal", completion.Goals) - _ = UpdateCmd.RegisterFlagCompletionFunc("status", - completion.Static("later", "next", "started", "waiting", "completed")) - _ = UpdateCmd.RegisterFlagCompletionFunc("priority", - completion.Static("lowest", "low", "normal", "high", "highest")) - _ = UpdateCmd.RegisterFlagCompletionFunc("motivation", - completion.Static("must", "should", "want")) + _ = UpdateCmd.RegisterFlagCompletionFunc("status", completion.TaskStatuses) + _ = UpdateCmd.RegisterFlagCompletionFunc("priority", completion.Priorities) + _ = UpdateCmd.RegisterFlagCompletionFunc("motivation", completion.Motivations) } func runUpdate(cmd *cobra.Command, args []string) error { diff --git a/internal/completion/completion.go b/internal/completion/completion.go index 99938cb5e3d06f052822abb546682b262ed22947..73dfd6bb3b997efda7328366f841232e7737e1d8 100644 --- a/internal/completion/completion.go +++ b/internal/completion/completion.go @@ -81,15 +81,14 @@ func Habits(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDi // Relationships returns relationship strength options for shell completion. func Relationships(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { - return []string{ - "family", - "intimate-friends", - "close-friends", - "casual-friends", - "acquaintances", - "business-contacts", - "almost-strangers", - }, cobra.ShellCompDirectiveNoFileComp + rs := lunatask.AllRelationshipStrengths() + keys := make([]string, len(rs)) + + for i, r := range rs { + keys[i] = string(r) + } + + return keys, cobra.ShellCompDirectiveNoFileComp } // Workflows returns workflow options for shell completion. @@ -103,3 +102,39 @@ func Workflows(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCom return keys, cobra.ShellCompDirectiveNoFileComp } + +// TaskStatuses returns task status options for shell completion. +func TaskStatuses(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { + statuses := lunatask.AllTaskStatuses() + keys := make([]string, len(statuses)) + + for i, s := range statuses { + keys[i] = string(s) + } + + return keys, cobra.ShellCompDirectiveNoFileComp +} + +// Priorities returns priority options for shell completion. +func Priorities(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { + priorities := lunatask.AllPriorities() + keys := make([]string, len(priorities)) + + for i, p := range priorities { + keys[i] = p.String() + } + + return keys, cobra.ShellCompDirectiveNoFileComp +} + +// Motivations returns motivation options for shell completion. +func Motivations(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { + motivations := lunatask.AllMotivations() + keys := make([]string, len(motivations)) + + for i, m := range motivations { + keys[i] = string(m) + } + + return keys, cobra.ShellCompDirectiveNoFileComp +} diff --git a/internal/mcp/resources/tasks/filters.go b/internal/mcp/resources/tasks/filters.go index f399d9d94c7438affafadc96ccc0fe9daec65497..845ed8f36cb9dd9d8ddae6f6da9845f95732eb5e 100644 --- a/internal/mcp/resources/tasks/filters.go +++ b/internal/mcp/resources/tasks/filters.go @@ -83,7 +83,7 @@ func FilterHighPriority(tasks []lunatask.Task) []lunatask.Task { // FilterNow returns tasks that need attention now. // Matches tasks where ANY of: -// - Status = "started" +// - Status = in-progress // - Priority = highest // - Motivation = "must" // - Eisenhower = urgent AND important. @@ -106,7 +106,7 @@ func isNow(task *lunatask.Task) bool { return false } - // Status = started + // Status = in-progress if task.Status != nil && *task.Status == lunatask.StatusInProgress { return true } diff --git a/internal/mcp/resources/tasks/handler.go b/internal/mcp/resources/tasks/handler.go index 61b6f0daed4645d6e555fb7f04148c5bb9c1fbcc..9a29eebef2c81275b41eb71f4b837b892b942094 100644 --- a/internal/mcp/resources/tasks/handler.go +++ b/internal/mcp/resources/tasks/handler.go @@ -55,7 +55,7 @@ const ( HighPriorityDescription = `Tasks with highest priority.` - NowDescription = `Tasks needing immediate attention: started, highest priority, must-do, or urgent+important.` + NowDescription = `Tasks needing immediate attention: in-progress, highest priority, must-do, or urgent+important.` RecentCompletionsDescription = `Tasks completed in the last 72 hours.` diff --git a/internal/mcp/tools/crud/query.go b/internal/mcp/tools/crud/query.go index e2c511b08e760f2934e2c596b3e1a86260370aa6..9a00c064283d71ed6bdf0649a430f9b7eb7daa77 100644 --- a/internal/mcp/tools/crud/query.go +++ b/internal/mcp/tools/crud/query.go @@ -215,7 +215,7 @@ func (h *Handler) listTasks( if input.Status != nil { if _, err := lunatask.ParseTaskStatus(*input.Status); err != nil { - return shared.ErrorResult("invalid status: must be later, next, started, waiting, or completed"), + return shared.ErrorResult("invalid status: must be later, next, in-progress, waiting, or completed"), QueryOutput{Entity: EntityTask}, nil } }