From 305cd3d5077c7e6e2a512b77ac95435081e3e825 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sat, 8 Nov 2025 16:32:23 -0500 Subject: Add optional namespace field to tasks Tasks can now be associated with specific namespaces in the monorepo: - Added taskNamespace (Maybe Text) field to Task data type - Updated createTask to accept optional namespace parameter - Added --namespace CLI option to task create command - Display namespace in task list output (e.g., [Omni/Task]) - Updated tests to pass Nothing for namespace - Updated AGENTS.md documentation Example usage: task create "Fix bug" project --namespace="Omni/Task" Completed task: t-j0k1L2 Amp-Thread-ID: https://ampcode.com/threads/T-85f4ee29-a529-4f59-ac6f-6ffec75b6a56 Co-authored-by: Amp --- Omni/Task/Core.hs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Omni/Task/Core.hs') diff --git a/Omni/Task/Core.hs b/Omni/Task/Core.hs index f49a8d2..f67c076 100644 --- a/Omni/Task/Core.hs +++ b/Omni/Task/Core.hs @@ -18,6 +18,7 @@ data Task = Task { taskId :: Text, taskTitle :: Text, taskProject :: Text, + taskNamespace :: Maybe Text, -- Optional namespace (e.g., "Omni/Task", "Biz/Cloud") taskStatus :: Status, taskDependencies :: [Text], -- List of task IDs this depends on taskCreatedAt :: UTCTime, @@ -95,8 +96,8 @@ saveTask task = do BLC.appendFile ".tasks/tasks.jsonl" (json <> "\n") -- Create a new task -createTask :: Text -> Text -> [Text] -> IO Task -createTask title project deps = do +createTask :: Text -> Text -> Maybe Text -> [Text] -> IO Task +createTask title project namespace deps = do tid <- generateId now <- getCurrentTime let task = @@ -104,6 +105,7 @@ createTask title project deps = do { taskId = tid, taskTitle = title, taskProject = project, + taskNamespace = namespace, taskStatus = Open, taskDependencies = deps, taskCreatedAt = now, @@ -169,6 +171,11 @@ printTask t = <> " (" <> taskProject t <> ")" + <> namespaceInfo + where + namespaceInfo = case taskNamespace t of + Nothing -> "" + Just ns -> " [" <> ns <> "]" -- Export tasks: Consolidate JSONL file (remove duplicates, keep latest version) exportTasks :: IO () -- cgit v1.2.3