@comfanion/usethis_todo 0.1.15-dev.16 → 0.1.15-dev.18
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 +4 -21
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -69,19 +69,16 @@ const UsethisTodoPlugin: Plugin = async ({ directory, client }) => {
|
|
|
69
69
|
},
|
|
70
70
|
|
|
71
71
|
tool: {
|
|
72
|
-
// Enhanced tools
|
|
72
|
+
// Enhanced tools only — NO native overrides
|
|
73
|
+
// Native todowrite/todoread stay untouched → Bus.publish fires → sidebar works
|
|
73
74
|
usethis_todo_write: write,
|
|
74
75
|
usethis_todo_read: read,
|
|
75
76
|
usethis_todo_read_five: read_five,
|
|
76
77
|
usethis_todo_read_by_id: read_by_id,
|
|
77
78
|
usethis_todo_update: update,
|
|
78
|
-
// Override native tools — our enhanced implementation runs under native names
|
|
79
|
-
// This ensures agent uses our features when it calls todowrite/todoread
|
|
80
|
-
todowrite: write,
|
|
81
|
-
todoread: read,
|
|
82
79
|
},
|
|
83
80
|
|
|
84
|
-
// Set nicer titles in TUI + track prune state
|
|
81
|
+
// Set nicer titles in TUI + track prune state
|
|
85
82
|
"tool.execute.after": async (input, output) => {
|
|
86
83
|
const isEnhanced = input.tool.startsWith("usethis_todo_")
|
|
87
84
|
const isNative = input.tool === "todowrite" || input.tool === "todoread"
|
|
@@ -113,26 +110,12 @@ const UsethisTodoPlugin: Plugin = async ({ directory, client }) => {
|
|
|
113
110
|
output.title = "Task details"
|
|
114
111
|
}
|
|
115
112
|
|
|
116
|
-
//
|
|
113
|
+
// Publish TODO snapshot into chat for write/update ops
|
|
117
114
|
const isWriteOp = input.tool === "usethis_todo_write"
|
|
118
115
|
|| input.tool === "usethis_todo_update"
|
|
119
116
|
|| input.tool === "todowrite"
|
|
120
117
|
if (!isWriteOp) return
|
|
121
118
|
|
|
122
|
-
// 1. Try to force sidebar refresh by re-selecting the current session
|
|
123
|
-
// tui.publish accepts EventTuiSessionSelect which may trigger TUI to re-fetch todos
|
|
124
|
-
try {
|
|
125
|
-
await (client as any)?.tui?.publish?.({
|
|
126
|
-
body: {
|
|
127
|
-
type: "tui.session.select",
|
|
128
|
-
properties: { sessionID: input.sessionID },
|
|
129
|
-
},
|
|
130
|
-
})
|
|
131
|
-
} catch {
|
|
132
|
-
// non-fatal — tui.publish may not be available or may reject
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// 2. Publish TODO snapshot into chat (visible regardless of sidebar state)
|
|
136
119
|
const text = ["## TODO", "", out].join("\n")
|
|
137
120
|
try {
|
|
138
121
|
await client?.session?.prompt?.({
|