@riverai7z/pi-todo 0.1.0 → 0.1.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/DESIGN.md +6 -6
- package/README.md +1 -1
- package/index.ts +9 -155
- package/package.json +1 -1
package/DESIGN.md
CHANGED
|
@@ -29,14 +29,14 @@ TaskState
|
|
|
29
29
|
Allowed status transitions:
|
|
30
30
|
|
|
31
31
|
```text
|
|
32
|
-
pending
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
in_progress may return to pending when work is released. Completed work may be reopened as pending or in_progress when verification or new requirements reveal more work. Deleted is terminal.
|
|
32
|
+
pending → in_progress | completed | deleted
|
|
33
|
+
in_progress → pending | completed | deleted
|
|
34
|
+
completed → pending | in_progress | deleted
|
|
35
|
+
deleted → (none)
|
|
38
36
|
```
|
|
39
37
|
|
|
38
|
+
This permits direct completion, releasing active work back to pending, and reopening completed work. Deleted is terminal.
|
|
39
|
+
|
|
40
40
|
## Persistence and branch semantics
|
|
41
41
|
|
|
42
42
|
No project task file is written. Every tool result stores a complete snapshot in `details`:
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Claude Code-style structured task management for Pi.
|
|
|
9
9
|
- `TaskGet`
|
|
10
10
|
- `TaskList`
|
|
11
11
|
- `TaskUpdate`
|
|
12
|
-
-
|
|
12
|
+
- Any non-deleted status (`pending`, `in_progress`, `completed`) can move to either other non-deleted status or terminal `deleted`.
|
|
13
13
|
- Owners, metadata, `blocks`/`blockedBy` dependencies, cycle rejection, and unresolved-blocker filtering.
|
|
14
14
|
- Session-local state reconstructed from tool-result `details`, so `/reload`, compaction, `/tree`, and forks preserve branch semantics without project files.
|
|
15
15
|
- Live responsive task overlay above the editor, with blocked work deprioritized and categorized overflow.
|
package/index.ts
CHANGED
|
@@ -55,6 +55,8 @@ const TaskUpdateSchema = Type.Object({
|
|
|
55
55
|
),
|
|
56
56
|
addBlocks: Type.Optional(Type.Array(Type.String(), { description: "Task IDs that this task blocks" })),
|
|
57
57
|
addBlockedBy: Type.Optional(Type.Array(Type.String(), { description: "Task IDs that block this task" })),
|
|
58
|
+
removeBlocks: Type.Optional(Type.Array(Type.String(), { description: "Task IDs this task no longer blocks" })),
|
|
59
|
+
removeBlockedBy: Type.Optional(Type.Array(Type.String(), { description: "Task IDs that no longer block this task" })),
|
|
58
60
|
owner: Type.Optional(Type.String({ description: "New owner for the task" })),
|
|
59
61
|
metadata: Type.Optional(
|
|
60
62
|
Type.Record(Type.String(), Type.Unknown(), {
|
|
@@ -65,163 +67,13 @@ const TaskUpdateSchema = Type.Object({
|
|
|
65
67
|
|
|
66
68
|
type TaskUpdateParams = Static<typeof TaskUpdateSchema>;
|
|
67
69
|
|
|
68
|
-
const TASK_CREATE_DESCRIPTION = `
|
|
69
|
-
It also helps the user understand the progress of the task and overall progress of their requests.
|
|
70
|
+
const TASK_CREATE_DESCRIPTION = `Create a tracked task for multi-step or non-trivial work, a user-requested task list, or multiple requested items. Skip single trivial or conversational requests. Check TaskList first to avoid duplicates. Use a concise imperative subject, detailed description, and optional present-continuous activeForm. New tasks start pending; mark them in_progress before work and completed only when fully done.`;
|
|
70
71
|
|
|
71
|
-
|
|
72
|
+
const TASK_GET_DESCRIPTION = `Get one task's full details and dependencies by ID. Read it before starting or updating work to confirm current requirements and that blockedBy has no unresolved tasks. Use TaskList for an overview.`;
|
|
72
73
|
|
|
73
|
-
Use
|
|
74
|
+
const TASK_LIST_DESCRIPTION = `List all non-deleted tasks with ID, status, subject, owner, and unresolved blockers. Use it to avoid duplicates, check progress, find available pending work, and pick newly unblocked work after completion. Prefer the lowest-ID unowned, unblocked task; use TaskGet for full details.`;
|
|
74
75
|
|
|
75
|
-
|
|
76
|
-
- Non-trivial and complex tasks - Tasks that require careful planning or multiple operations
|
|
77
|
-
- Plan mode - When using plan mode, create a task list to track the work
|
|
78
|
-
- User explicitly requests todo list - When the user directly asks you to use the todo list
|
|
79
|
-
- User provides multiple tasks - When users provide a list of things to be done (numbered or comma-separated)
|
|
80
|
-
- After receiving new instructions - Immediately capture user requirements as tasks
|
|
81
|
-
- When you start working on a task - Mark it as in_progress BEFORE beginning work
|
|
82
|
-
- After completing a task - Mark it as completed and add any new follow-up tasks discovered during implementation
|
|
83
|
-
|
|
84
|
-
## When NOT to Use This Tool
|
|
85
|
-
|
|
86
|
-
Skip using this tool when:
|
|
87
|
-
- There is only a single, straightforward task
|
|
88
|
-
- The task is trivial and tracking it provides no organizational benefit
|
|
89
|
-
- The task can be completed in less than 3 trivial steps
|
|
90
|
-
- The task is purely conversational or informational
|
|
91
|
-
|
|
92
|
-
NOTE that you should not use this tool if there is only one trivial task to do. In this case you are better off just doing the task directly.
|
|
93
|
-
|
|
94
|
-
## Task Fields
|
|
95
|
-
|
|
96
|
-
- **subject**: A brief, actionable title in imperative form (e.g., "Fix authentication bug in login flow")
|
|
97
|
-
- **description**: What needs to be done
|
|
98
|
-
- **activeForm** (optional): Present continuous form shown in the spinner when the task is in_progress (e.g., "Fixing authentication bug"). If omitted, the spinner shows the subject instead.
|
|
99
|
-
|
|
100
|
-
All tasks are created with status \`pending\`.
|
|
101
|
-
|
|
102
|
-
## Tips
|
|
103
|
-
|
|
104
|
-
- Create tasks with clear, specific subjects that describe the outcome
|
|
105
|
-
- After creating tasks, use TaskUpdate to set up dependencies (blocks/blockedBy) if needed
|
|
106
|
-
- Check TaskList first to avoid creating duplicate tasks`;
|
|
107
|
-
|
|
108
|
-
const TASK_GET_DESCRIPTION = `Use this tool to retrieve a task by its ID from the task list.
|
|
109
|
-
|
|
110
|
-
## When to Use This Tool
|
|
111
|
-
|
|
112
|
-
- When you need the full description and context before starting work on a task
|
|
113
|
-
- To understand task dependencies (what it blocks, what blocks it)
|
|
114
|
-
- After being assigned a task, to get complete requirements
|
|
115
|
-
|
|
116
|
-
## Output
|
|
117
|
-
|
|
118
|
-
Returns full task details:
|
|
119
|
-
- **subject**: Task title
|
|
120
|
-
- **description**: Detailed requirements and context
|
|
121
|
-
- **status**: 'pending', 'in_progress', or 'completed'
|
|
122
|
-
- **blocks**: Tasks waiting on this one to complete
|
|
123
|
-
- **blockedBy**: Tasks that must complete before this one can start
|
|
124
|
-
|
|
125
|
-
## Tips
|
|
126
|
-
|
|
127
|
-
- After fetching a task, verify its blockedBy list is empty before beginning work.
|
|
128
|
-
- Use TaskList to see all tasks in summary form.`;
|
|
129
|
-
|
|
130
|
-
const TASK_LIST_DESCRIPTION = `Use this tool to list all tasks in the task list.
|
|
131
|
-
|
|
132
|
-
## When to Use This Tool
|
|
133
|
-
|
|
134
|
-
- To see what tasks are available to work on (status: 'pending', no owner, not blocked)
|
|
135
|
-
- To check overall progress on the project
|
|
136
|
-
- To find tasks that are blocked and need dependencies resolved
|
|
137
|
-
- After completing a task, to check for newly unblocked work or claim the next available task
|
|
138
|
-
- **Prefer working on tasks in ID order** (lowest ID first) when multiple tasks are available, as earlier tasks often set up context for later ones
|
|
139
|
-
|
|
140
|
-
## Output
|
|
141
|
-
|
|
142
|
-
Returns a summary of each task:
|
|
143
|
-
- **id**: Task identifier (use with TaskGet, TaskUpdate)
|
|
144
|
-
- **subject**: Brief description of the task
|
|
145
|
-
- **status**: 'pending', 'in_progress', or 'completed'
|
|
146
|
-
- **owner**: Agent ID if assigned, empty if available
|
|
147
|
-
- **blockedBy**: List of open task IDs that must be resolved first (tasks with blockedBy cannot be claimed until dependencies resolve)
|
|
148
|
-
|
|
149
|
-
Use TaskGet with a specific task ID to view full details including description and comments.`;
|
|
150
|
-
|
|
151
|
-
const TASK_UPDATE_DESCRIPTION = `Use this tool to update a task in the task list.
|
|
152
|
-
|
|
153
|
-
## When to Use This Tool
|
|
154
|
-
|
|
155
|
-
**Mark tasks as resolved:**
|
|
156
|
-
- When you have completed the work described in a task
|
|
157
|
-
- When a task is no longer needed or has been superseded
|
|
158
|
-
- IMPORTANT: Always mark your assigned tasks as resolved when you finish them
|
|
159
|
-
- After resolving, call TaskList to find your next task
|
|
160
|
-
|
|
161
|
-
- ONLY mark a task as completed when you have FULLY accomplished it
|
|
162
|
-
- If you encounter errors, blockers, or cannot finish, keep the task as in_progress
|
|
163
|
-
- When blocked, create a new task describing what needs to be resolved
|
|
164
|
-
- Never mark a task as completed if:
|
|
165
|
-
- Tests are failing
|
|
166
|
-
- Implementation is partial
|
|
167
|
-
- You encountered unresolved errors
|
|
168
|
-
- You couldn't find necessary files or dependencies
|
|
169
|
-
|
|
170
|
-
**Delete tasks:**
|
|
171
|
-
- When a task is no longer relevant or was created in error
|
|
172
|
-
- Setting status to \`deleted\` hides the task as a terminal tombstone in this Pi extension
|
|
173
|
-
|
|
174
|
-
**Update task details:**
|
|
175
|
-
- When requirements change or become clearer
|
|
176
|
-
- When establishing dependencies between tasks
|
|
177
|
-
|
|
178
|
-
## Fields You Can Update
|
|
179
|
-
|
|
180
|
-
- **status**: The task status (see Status Workflow below)
|
|
181
|
-
- **subject**: Change the task title (imperative form, e.g., "Run tests")
|
|
182
|
-
- **description**: Change the task description
|
|
183
|
-
- **activeForm**: Present continuous form shown in spinner when in_progress (e.g., "Running tests")
|
|
184
|
-
- **owner**: Change the task owner (agent name)
|
|
185
|
-
- **metadata**: Merge metadata keys into the task (set a key to null to delete it)
|
|
186
|
-
- **addBlocks**: Mark tasks that cannot start until this one completes
|
|
187
|
-
- **addBlockedBy**: Mark tasks that must complete before this one can start
|
|
188
|
-
|
|
189
|
-
## Status Workflow
|
|
190
|
-
|
|
191
|
-
Status progresses: \`pending\` → \`in_progress\` → \`completed\`
|
|
192
|
-
|
|
193
|
-
Use \`deleted\` to hide a task as a terminal tombstone.
|
|
194
|
-
|
|
195
|
-
## Staleness
|
|
196
|
-
|
|
197
|
-
Make sure to read a task's latest state using \`TaskGet\` before updating it.
|
|
198
|
-
|
|
199
|
-
## Examples
|
|
200
|
-
|
|
201
|
-
Mark task as in progress when starting work:
|
|
202
|
-
\`\`\`json
|
|
203
|
-
{"taskId": "1", "status": "in_progress"}
|
|
204
|
-
\`\`\`
|
|
205
|
-
|
|
206
|
-
Mark task as completed after finishing work:
|
|
207
|
-
\`\`\`json
|
|
208
|
-
{"taskId": "1", "status": "completed"}
|
|
209
|
-
\`\`\`
|
|
210
|
-
|
|
211
|
-
Delete a task:
|
|
212
|
-
\`\`\`json
|
|
213
|
-
{"taskId": "1", "status": "deleted"}
|
|
214
|
-
\`\`\`
|
|
215
|
-
|
|
216
|
-
Claim a task by setting owner:
|
|
217
|
-
\`\`\`json
|
|
218
|
-
{"taskId": "1", "owner": "my-name"}
|
|
219
|
-
\`\`\`
|
|
220
|
-
|
|
221
|
-
Set up task dependencies:
|
|
222
|
-
\`\`\`json
|
|
223
|
-
{"taskId": "2", "addBlockedBy": ["1"]}
|
|
224
|
-
\`\`\``;
|
|
76
|
+
const TASK_UPDATE_DESCRIPTION = `Update one existing task after reading its latest state with TaskGet. Mark in_progress before work; mark completed only when fully accomplished and verified—keep in_progress if work is partial, blocked, or failing. Status transitions: pending → in_progress/completed/deleted; in_progress → pending/completed/deleted; completed → pending/in_progress/deleted; deleted is terminal. Use deleted for irrelevant or mistaken tasks. Add or remove dependency edges with addBlocks, addBlockedBy, removeBlocks, and removeBlockedBy; self-dependencies, missing additions, and cycles are rejected. Metadata is merged; null deletes a key. Provide at least one change.`;
|
|
225
77
|
|
|
226
78
|
function textResult(text: string, details: TaskSnapshot) {
|
|
227
79
|
return { content: [{ type: "text" as const, text }], details };
|
|
@@ -261,7 +113,9 @@ function hasUpdate(params: TaskUpdateParams): boolean {
|
|
|
261
113
|
params.owner !== undefined ||
|
|
262
114
|
params.metadata !== undefined ||
|
|
263
115
|
(params.addBlocks?.length ?? 0) > 0 ||
|
|
264
|
-
(params.addBlockedBy?.length ?? 0) > 0
|
|
116
|
+
(params.addBlockedBy?.length ?? 0) > 0 ||
|
|
117
|
+
(params.removeBlocks?.length ?? 0) > 0 ||
|
|
118
|
+
(params.removeBlockedBy?.length ?? 0) > 0
|
|
265
119
|
);
|
|
266
120
|
}
|
|
267
121
|
|