| 793 | } |
| 794 | |
| 795 | function scrollTodoFinal(p: ToolProps<typeof TodoWriteTool>): string { |
| 796 | const items = list<{ status?: string }>(p.input.todos) |
| 797 | const time = span(p.frame.state) |
| 798 | if (items.length === 0) { |
| 799 | if (!time) { |
| 800 | return "0 todos" |
| 801 | } |
| 802 | |
| 803 | return `0 todos · ${time}` |
| 804 | } |
| 805 | |
| 806 | const doneN = items.filter((item) => item.status === "completed").length |
| 807 | const runN = items.filter((item) => item.status === "in_progress").length |
| 808 | const left = items.length - doneN - runN |
| 809 | const tail = [`${items.length} total`] |
| 810 | if (doneN > 0) { |
| 811 | tail.push(`${doneN} done`) |
| 812 | } |
| 813 | if (runN > 0) { |
| 814 | tail.push(`${runN} active`) |
| 815 | } |
| 816 | if (left > 0) { |
| 817 | tail.push(`${left} pending`) |
| 818 | } |
| 819 | |
| 820 | if (time) { |
| 821 | tail.push(time) |
| 822 | } |
| 823 | |
| 824 | return tail.join(" · ") |
| 825 | } |
| 826 | |
| 827 | function scrollQuestionStart(_: ToolProps<typeof QuestionTool>): string { |
| 828 | return "" |