@comfanion/usethis_todo 0.1.15-dev.5 → 0.1.15-dev.6
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 +8 -2
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -90,11 +90,15 @@ const UsethisTodoPlugin: Plugin = async ({ directory, client }) => {
|
|
|
90
90
|
},
|
|
91
91
|
|
|
92
92
|
tool: {
|
|
93
|
+
// Enhanced tools (original names)
|
|
93
94
|
usethis_todo_write: write,
|
|
94
95
|
usethis_todo_read: read,
|
|
95
96
|
usethis_todo_read_five: read_five,
|
|
96
97
|
usethis_todo_read_by_id: read_by_id,
|
|
97
98
|
usethis_todo_update: update,
|
|
99
|
+
// Override native tools — server may emit todo.updated for these names
|
|
100
|
+
todowrite: write,
|
|
101
|
+
todoread: read,
|
|
98
102
|
},
|
|
99
103
|
|
|
100
104
|
// UI niceties + publish snapshot into the chat
|
|
@@ -112,13 +116,13 @@ const UsethisTodoPlugin: Plugin = async ({ directory, client }) => {
|
|
|
112
116
|
const out = output.output || ""
|
|
113
117
|
|
|
114
118
|
// Set a nicer title in TUI
|
|
115
|
-
if (input.tool === "usethis_todo_write") {
|
|
119
|
+
if (input.tool === "usethis_todo_write" || input.tool === "todowrite") {
|
|
116
120
|
const match = out.match(/\[(\d+)\/(\d+) done/)
|
|
117
121
|
output.title = match ? `📋 TODO: ${match[2]} tasks` : "📋 TODO updated"
|
|
118
122
|
} else if (input.tool === "usethis_todo_update") {
|
|
119
123
|
const match = out.match(/^✅ (.+)$/m)
|
|
120
124
|
output.title = match ? `📝 ${match[1]}` : "📝 Task updated"
|
|
121
|
-
} else if (input.tool === "usethis_todo_read") {
|
|
125
|
+
} else if (input.tool === "usethis_todo_read" || input.tool === "todoread") {
|
|
122
126
|
const match = out.match(/\[(\d+)\/(\d+) done, (\d+) in progress\]/)
|
|
123
127
|
output.title = match ? `📋 TODO [${match[1]}/${match[2]} done]` : "📋 TODO list"
|
|
124
128
|
} else if (input.tool === "usethis_todo_read_five") {
|
|
@@ -134,6 +138,8 @@ const UsethisTodoPlugin: Plugin = async ({ directory, client }) => {
|
|
|
134
138
|
"usethis_todo_read",
|
|
135
139
|
"usethis_todo_read_five",
|
|
136
140
|
"usethis_todo_read_by_id",
|
|
141
|
+
"todowrite",
|
|
142
|
+
"todoread",
|
|
137
143
|
])
|
|
138
144
|
|
|
139
145
|
if (!publishTools.has(input.tool)) return
|