@comfanion/usethis_todo 0.1.15-dev.4 → 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 +9 -18
- 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") {
|
|
@@ -127,28 +131,15 @@ const UsethisTodoPlugin: Plugin = async ({ directory, client }) => {
|
|
|
127
131
|
output.title = "📋 Task details"
|
|
128
132
|
}
|
|
129
133
|
|
|
130
|
-
//
|
|
131
|
-
const writeTools = new Set(["usethis_todo_write", "usethis_todo_update"])
|
|
132
|
-
if (writeTools.has(input.tool) && sessionID) {
|
|
133
|
-
try {
|
|
134
|
-
await (client as any)?.tui?.publish?.({
|
|
135
|
-
body: {
|
|
136
|
-
type: "tui.session.select",
|
|
137
|
-
properties: { sessionID },
|
|
138
|
-
},
|
|
139
|
-
})
|
|
140
|
-
} catch {
|
|
141
|
-
// non-fatal — experimental sidebar refresh
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// Publish snapshot into chat (fallback when sidebar doesn't refresh)
|
|
134
|
+
// Publish snapshot into chat (sidebar doesn't refresh from plugin writes)
|
|
146
135
|
const publishTools = new Set([
|
|
147
136
|
"usethis_todo_write",
|
|
148
137
|
"usethis_todo_update",
|
|
149
138
|
"usethis_todo_read",
|
|
150
139
|
"usethis_todo_read_five",
|
|
151
140
|
"usethis_todo_read_by_id",
|
|
141
|
+
"todowrite",
|
|
142
|
+
"todoread",
|
|
152
143
|
])
|
|
153
144
|
|
|
154
145
|
if (!publishTools.has(input.tool)) return
|