@comfanion/usethis_todo 0.1.16-dev.2 → 0.1.16-dev.3

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.
Files changed (3) hide show
  1. package/index.ts +10 -11
  2. package/package.json +1 -1
  3. package/tools.ts +4 -4
package/index.ts CHANGED
@@ -37,8 +37,8 @@ const UsethisTodoPlugin: Plugin = async ({ directory, client }) => {
37
37
  if (!state?.lastToolCallId) return
38
38
 
39
39
  const prunedToolNames = new Set([
40
- "todowrite",
41
- "todoread",
40
+ "usethis_todo_write",
41
+ "usethis_todo_read",
42
42
  "usethis_todo_read_five",
43
43
  "usethis_todo_read_by_id",
44
44
  ])
@@ -66,19 +66,18 @@ const UsethisTodoPlugin: Plugin = async ({ directory, client }) => {
66
66
  },
67
67
 
68
68
  tool: {
69
- // Native overrides tool named "todowrite"/"todoread" completing
70
- // triggers Bus.publish("todo.updated") sidebar refresh
71
- todowrite: write,
72
- todoread: read,
73
- // Extra tools (no native equivalent)
69
+ // Custom names visible output in TUI
70
+ // NOTE: native "todowrite"/"todoread" names trigger sidebar refresh
71
+ // but TUI hides their output. Using custom names for visibility.
72
+ usethis_todo_write: write,
73
+ usethis_todo_read: read,
74
74
  usethis_todo_read_five: read_five,
75
75
  usethis_todo_read_by_id: read_by_id,
76
76
  },
77
77
 
78
78
  // Set nicer titles in TUI + track prune state
79
79
  "tool.execute.after": async (input, output) => {
80
- const ourTools = new Set(["todowrite", "todoread", "usethis_todo_read_five", "usethis_todo_read_by_id"])
81
- if (!ourTools.has(input.tool)) return
80
+ if (!input.tool.startsWith("usethis_todo_")) return
82
81
 
83
82
  // Update prune state with latest call ID
84
83
  const sessionID = input.sessionID
@@ -91,10 +90,10 @@ const UsethisTodoPlugin: Plugin = async ({ directory, client }) => {
91
90
  const out = output.output || ""
92
91
 
93
92
  // Set a nicer title in TUI
94
- if (input.tool === "todowrite") {
93
+ if (input.tool === "usethis_todo_write") {
95
94
  const match = out.match(/\[(\d+)\/(\d+) done/)
96
95
  output.title = match ? `TODO: ${match[2]} tasks` : "TODO updated"
97
- } else if (input.tool === "todoread") {
96
+ } else if (input.tool === "usethis_todo_read") {
98
97
  const match = out.match(/\[(\d+)\/(\d+) done, (\d+) in progress\]/)
99
98
  output.title = match ? `TODO [${match[1]}/${match[2]} done]` : "TODO list"
100
99
  } else if (input.tool === "usethis_todo_read_five") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comfanion/usethis_todo",
3
- "version": "0.1.16-dev.2",
3
+ "version": "0.1.16-dev.3",
4
4
  "description": "OpenCode plugin: enhanced TODO tools (dual storage + dependency graph)",
5
5
  "type": "module",
6
6
  "main": "./index.ts",
package/tools.ts CHANGED
@@ -2,10 +2,10 @@
2
2
  * TODO Tool with Dependencies & Priority — v4 (unified storage)
3
3
  *
4
4
  * 4 tools:
5
- * todowrite({ todos: [...], merge? }) - create/update TODO list (upsert by default)
6
- * todoread() - read TODO with graph analysis
7
- * todoread_five() - read next 5 tasks with their blockers
8
- * todoread_by_id({ id }) - read task by id with its blockers
5
+ * usethis_todo_write({ todos, merge? }) - create/update TODO list (upsert by default)
6
+ * usethis_todo_read() - read TODO with graph analysis
7
+ * usethis_todo_read_five() - read next 5 tasks with their blockers
8
+ * usethis_todo_read_by_id({ id }) - read task by id with its blockers
9
9
  *
10
10
  * Storage:
11
11
  * Unified: Native OpenCode storage (TUI compatible)