(args: Record<string, unknown>)
| 651 | } |
| 652 | |
| 653 | function getTodoPreview(args: Record<string, unknown>): string | null { |
| 654 | const todos = args.todos; |
| 655 | if (!Array.isArray(todos)) return "todo list"; |
| 656 | if (todos.length === 0) return "empty list"; |
| 657 | const first = todos[0]; |
| 658 | const firstText = |
| 659 | first && typeof first === "object" |
| 660 | ? getToolString(asRecord(first), ["text"]) |
| 661 | : null; |
| 662 | if (firstText) |
| 663 | return todos.length > 1 ? `${firstText} (+${todos.length - 1})` : firstText; |
| 664 | return `${todos.length} item${todos.length === 1 ? "" : "s"}`; |
| 665 | } |
no test coverage detected