| 605 | } |
| 606 | |
| 607 | function snapQuestion(p: ToolProps<typeof QuestionTool>): ToolSnapshot { |
| 608 | const answers = list<unknown[]>(p.frame.meta.answers) |
| 609 | const items = list<{ question?: string }>(p.frame.input.questions).map((item, i) => { |
| 610 | const answer = list<string>(answers[i]).filter((entry) => typeof entry === "string") |
| 611 | return { |
| 612 | question: item.question || `Question ${i + 1}`, |
| 613 | answer: answer.length > 0 ? answer.join(", ") : "(no answer)", |
| 614 | } |
| 615 | }) |
| 616 | |
| 617 | return { |
| 618 | kind: "question", |
| 619 | items, |
| 620 | tail: "", |
| 621 | } |
| 622 | } |
| 623 | |
| 624 | function scrollBashStart(p: ToolProps<typeof BashTool>): string { |
| 625 | const cmd = p.input.command ?? "" |