summaryrefslogtreecommitdiff
path: root/Omni/Task.hs
diff options
context:
space:
mode:
authorOmni Worker <bot@omni.agent>2025-11-21 22:59:58 -0500
committerOmni Worker <bot@omni.agent>2025-11-21 22:59:58 -0500
commit57635a9fbe5e217acd5ad609d7d9b97ce5cef232 (patch)
treef2285e63a80e3e7f370a99c4826230be4e9825b2 /Omni/Task.hs
parent6f4b2c97a24967508f3970b46999052fd1f44e67 (diff)
feat(task): support updating deps in task update
Amp-Thread-ID: https://ampcode.com/threads/T-79499d9e-f4f4-40de-893c-524c32a45483 Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'Omni/Task.hs')
-rw-r--r--Omni/Task.hs21
1 files changed, 19 insertions, 2 deletions
diff --git a/Omni/Task.hs b/Omni/Task.hs
index 36b318b..f19ab73 100644
--- a/Omni/Task.hs
+++ b/Omni/Task.hs
@@ -44,7 +44,7 @@ Usage:
task list [options]
task ready [--json]
task show <id> [--json]
- task update <id> <status> [--json]
+ task update <id> <status> [--deps=<ids>] [--dep-type=<type>] [--json]
task deps <id> [--json]
task tree [<id>] [--json]
task progress <id> [--json]
@@ -214,13 +214,30 @@ move args
| args `Cli.has` Cli.command "update" = do
tid <- getArgText args "id"
statusStr <- getArgText args "status"
+
+ -- Handle update dependencies
+ (deps, depType) <- do
+ -- Parse --deps and --dep-type
+ ids <- case Cli.getArg args (Cli.longOption "deps") of
+ Nothing -> pure []
+ Just depStr -> pure <| T.splitOn "," (T.pack depStr)
+ dtype <- case Cli.getArg args (Cli.longOption "dep-type") of
+ Nothing -> pure Blocks
+ Just "blocks" -> pure Blocks
+ Just "discovered-from" -> pure DiscoveredFrom
+ Just "parent-child" -> pure ParentChild
+ Just "related" -> pure Related
+ Just other -> panic <| "Invalid dependency type: " <> T.pack other <> ". Use: blocks, discovered-from, parent-child, or related"
+ pure (map (\d -> Dependency {depId = d, depType = dtype}) ids, dtype)
+
let newStatus = case statusStr of
"open" -> Open
"in-progress" -> InProgress
"review" -> Review
"done" -> Done
_ -> panic "Invalid status. Use: open, in-progress, review, or done"
- updateTaskStatus tid newStatus
+
+ updateTaskStatus tid newStatus deps
if isJsonMode args
then outputSuccess <| "Updated task " <> tid
else do