API Reference
TodoStore
Defined in: tools/builtin/todo-list.ts:79
The to-do store seam — the state behind the three tools.
Remarks
Swap the shipped InMemoryTodoStore for a file/DB-backed implementation to persist or share a list. Structural violations throw; see the module remarks.
Methods
append()
append(
id,
content,
status): TodoItem;Defined in: tools/builtin/todo-list.ts:84
Add a new item.
Parameters
| Parameter | Type |
|---|---|
id | string |
content | string |
status | "done" | "pending" | "in_progress" | "cancelled" | "failed" |
Returns
Throws
Error if status is invalid or id already exists.
read()
read(includeCompleted): TodoItem[];Defined in: tools/builtin/todo-list.ts:86
Return the items; completed/cancelled are omitted unless includeCompleted.
Parameters
| Parameter | Type |
|---|---|
includeCompleted | boolean |
Returns
TodoItem[]
update()
update(
id,
content,
status): TodoItem;Defined in: tools/builtin/todo-list.ts:92
Update an item's content and/or status; moving failed → in_progress
increments its retry count.
Parameters
| Parameter | Type |
|---|---|
id | string |
content | string | undefined |
status | "done" | "pending" | "in_progress" | "cancelled" | "failed" | undefined |
Returns
Throws
Error if status is invalid or no item has this id.