@hasna/todos 0.9.40 → 0.9.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1020,6 +1020,7 @@ __export(exports_tasks, {
1020
1020
  getActiveWork: () => getActiveWork,
1021
1021
  failTask: () => failTask,
1022
1022
  deleteTask: () => deleteTask,
1023
+ decomposeTasks: () => decomposeTasks,
1023
1024
  createTask: () => createTask,
1024
1025
  countTasks: () => countTasks,
1025
1026
  completeTask: () => completeTask,
@@ -1811,6 +1812,36 @@ function getStatus(filters, agentId, db) {
1811
1812
  overdue_recurring: overdueRow.count
1812
1813
  };
1813
1814
  }
1815
+ function decomposeTasks(parentId, subtasks, options, db) {
1816
+ const d = db || getDatabase();
1817
+ const parent = getTask(parentId, d);
1818
+ if (!parent)
1819
+ throw new TaskNotFoundError(parentId);
1820
+ const created = [];
1821
+ const tx = d.transaction(() => {
1822
+ for (const input of subtasks) {
1823
+ const task = createTask({
1824
+ title: input.title,
1825
+ description: input.description,
1826
+ priority: input.priority || parent.priority,
1827
+ parent_id: parentId,
1828
+ project_id: parent.project_id || undefined,
1829
+ plan_id: parent.plan_id || undefined,
1830
+ task_list_id: parent.task_list_id || undefined,
1831
+ assigned_to: input.assigned_to || parent.assigned_to || undefined,
1832
+ estimated_minutes: input.estimated_minutes,
1833
+ tags: input.tags
1834
+ }, d);
1835
+ if (options?.depends_on_prev && created.length > 0) {
1836
+ const prev = created[created.length - 1];
1837
+ addDependency(task.id, prev.id, d);
1838
+ }
1839
+ created.push(task);
1840
+ }
1841
+ });
1842
+ tx();
1843
+ return { parent, subtasks: created };
1844
+ }
1814
1845
  function wouldCreateCycle(taskId, dependsOn, db) {
1815
1846
  const visited = new Set;
1816
1847
  const queue = [dependsOn];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/todos",
3
- "version": "0.9.40",
3
+ "version": "0.9.42",
4
4
  "description": "Universal task management for AI coding agents - CLI + MCP server + interactive TUI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",