opencode-session-todo 0.2.0 → 0.2.1
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/USAGE.md +3 -1
- package/dist/tui.js +0 -11
- package/package.json +1 -1
- package/src/instructions.ts +6 -0
- package/tui.tsx +0 -10
package/USAGE.md
CHANGED
|
@@ -23,6 +23,9 @@ Reopen the TUI after configuration changes. `sidebarLimit` is a positive integer
|
|
|
23
23
|
|
|
24
24
|
Only root sessions expose these tools and receive the TODO lifecycle instructions. Subagents see neither tool.
|
|
25
25
|
|
|
26
|
+
Agents start a TODO list when they have more than one work item to track, not for a straightforward
|
|
27
|
+
question or a single work item. Existing unfinished work remains tracked through completion.
|
|
28
|
+
|
|
26
29
|
- `todoread({})` reads the current session's tasks and file path. Missing files return an empty list.
|
|
27
30
|
- `todowrite({ previous, todos })` replaces the ordered list only when the stored list still equals `previous`; take `previous` from the latest `todoread` or `todowrite` result. A mismatch fails with an instruction to `todoread` and retry. The result reports a before/after diff. An empty `todos` array clears the list.
|
|
28
31
|
|
|
@@ -46,7 +49,6 @@ cannot begin with a priority/date, and cannot contain `status:` or `pri:` tokens
|
|
|
46
49
|
with the active task first.
|
|
47
50
|
- **Show all …**, `/todos`, or **Ctrl+P → Toggle session todos** opens the full scrollable panel.
|
|
48
51
|
- Close with **Close ×**, **Esc** while focused, or the same command-palette action.
|
|
49
|
-
- Update toasts show only added or changed tasks, one line each, with the new status and priority.
|
|
50
52
|
- Manual file edits appear within two seconds. Collapsing does not change the tasks.
|
|
51
53
|
|
|
52
54
|
## Storage
|
package/dist/tui.js
CHANGED
|
@@ -137,16 +137,6 @@ var tui_default = Plugin.define({
|
|
|
137
137
|
open: true
|
|
138
138
|
}
|
|
139
139
|
});
|
|
140
|
-
const notify = api.events.on("updated", (event) => {
|
|
141
|
-
if (event.data.summary === "")
|
|
142
|
-
return;
|
|
143
|
-
ctx.ui.toast.show({
|
|
144
|
-
title: "TODO updated",
|
|
145
|
-
message: event.data.summary,
|
|
146
|
-
variant: "info",
|
|
147
|
-
sessionID: event.data.sessionID
|
|
148
|
-
});
|
|
149
|
-
});
|
|
150
140
|
const List = (props) => {
|
|
151
141
|
const [view, setView] = createSignal({
|
|
152
142
|
status: "loading"
|
|
@@ -423,7 +413,6 @@ var tui_default = Plugin.define({
|
|
|
423
413
|
return () => {
|
|
424
414
|
sidebar();
|
|
425
415
|
panel();
|
|
426
|
-
notify();
|
|
427
416
|
};
|
|
428
417
|
}
|
|
429
418
|
});
|
package/package.json
CHANGED
package/src/instructions.ts
CHANGED
|
@@ -14,6 +14,12 @@ Read this session’s saved TODO list and storage path.
|
|
|
14
14
|
|
|
15
15
|
export const TodoLifecycleInstructions: string = `### TODO lifecycle
|
|
16
16
|
|
|
17
|
+
- You MUST create a TODO list when you have more than one work item to track.
|
|
18
|
+
- You MUST NOT create a TODO list for a straightforward question or a single work item.
|
|
19
|
+
- You MUST NOT split a single work item into artificial steps just to justify a TODO list.
|
|
20
|
+
|
|
21
|
+
The following rules apply only when a TODO list is needed or already tracks unfinished work.
|
|
22
|
+
|
|
17
23
|
- You MUST keep this session's TODO list synchronized with the requested work and its actual progress.
|
|
18
24
|
- You MUST preserve existing tasks, order, statuses, and priorities unless actual progress or the user's instructions require a change.
|
|
19
25
|
- You MUST mark a task in_progress before starting it. You MUST keep at most one task in_progress.
|
package/tui.tsx
CHANGED
|
@@ -65,15 +65,6 @@ export default Plugin.define({
|
|
|
65
65
|
const [sidebarView, updateSidebarView] = ctx.storage.store("sidebar", {
|
|
66
66
|
initial: { open: true },
|
|
67
67
|
})
|
|
68
|
-
const notify: () => void = api.events.on("updated", (event): void => {
|
|
69
|
-
if (event.data.summary === "") return
|
|
70
|
-
ctx.ui.toast.show({
|
|
71
|
-
title: "TODO updated",
|
|
72
|
-
message: event.data.summary,
|
|
73
|
-
variant: "info",
|
|
74
|
-
sessionID: event.data.sessionID,
|
|
75
|
-
})
|
|
76
|
-
})
|
|
77
68
|
const List = (props: Props): JSX.Element => {
|
|
78
69
|
const [view, setView] = createSignal<View>({ status: "loading" })
|
|
79
70
|
createEffect((): void => {
|
|
@@ -287,7 +278,6 @@ export default Plugin.define({
|
|
|
287
278
|
return (): void => {
|
|
288
279
|
sidebar()
|
|
289
280
|
panel()
|
|
290
|
-
notify()
|
|
291
281
|
}
|
|
292
282
|
},
|
|
293
283
|
})
|