@comfanion/usethis_todo 0.1.16-dev.6 → 0.1.16-dev.8
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.
- package/index.ts +9 -4
- package/package.json +1 -1
- package/tools.ts +2 -2
package/index.ts
CHANGED
|
@@ -82,11 +82,16 @@ const UsethisTodoPlugin: Plugin = async ({ directory, client }) => {
|
|
|
82
82
|
// Reads the data our write already stored and returns native JSON format.
|
|
83
83
|
// tool.execute.after on usethis_todo_write auto-invokes this via description hint.
|
|
84
84
|
todowrite: {
|
|
85
|
-
description:
|
|
86
|
-
args:
|
|
87
|
-
async execute(
|
|
85
|
+
description: write.description, // Use same description as write
|
|
86
|
+
args: write.args, // Use same args as write
|
|
87
|
+
async execute(args: any, context: any) {
|
|
88
|
+
// If args provided, perform write first
|
|
89
|
+
if (args.todos && args.todos.length > 0) {
|
|
90
|
+
await write.execute(args, context)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Then return native JSON format
|
|
88
94
|
const todos = await readTodos(context.sessionID, context.directory)
|
|
89
|
-
// Return native format: JSON array → TUI renders checklist + fires todo.updated
|
|
90
95
|
return JSON.stringify(todos.map(t => ({
|
|
91
96
|
id: t.id,
|
|
92
97
|
content: t.content,
|
package/package.json
CHANGED
package/tools.ts
CHANGED
|
@@ -565,13 +565,13 @@ Set merge: false to replace the entire list.`,
|
|
|
565
565
|
const merged = [...byId.values()]
|
|
566
566
|
await writeTodos(merged, context.sessionID, context.directory)
|
|
567
567
|
await logAction(context.directory, "write-merge", `Merged ${args.todos.length} task(s) in session ${context.sessionID}`)
|
|
568
|
-
return formatGraph(analyzeGraph(merged))
|
|
568
|
+
return `✅ Updated ${args.todos.length} task(s)\n\n${formatGraph(analyzeGraph(merged))}`
|
|
569
569
|
} else {
|
|
570
570
|
// REPLACE mode: replace entire list
|
|
571
571
|
const todos = args.todos.map((t: any) => normalizeTodo({ ...t, createdAt: t.createdAt || now, updatedAt: now }))
|
|
572
572
|
await writeTodos(todos, context.sessionID, context.directory)
|
|
573
573
|
await logAction(context.directory, "write", `Created/Updated ${todos.length} tasks in session ${context.sessionID}`)
|
|
574
|
-
return formatGraph(analyzeGraph(todos))
|
|
574
|
+
return `✅ Updated ${todos.length} task(s)\n\n${formatGraph(analyzeGraph(todos))}`
|
|
575
575
|
}
|
|
576
576
|
},
|
|
577
577
|
})
|