MCPcopy Create free account
hub / github.com/block/buzz / getTodoPreview

Function getTodoPreview

desktop/src/features/agents/ui/agentSessionToolClassifier.ts:653–665  ·  view source on GitHub ↗
(args: Record<string, unknown>)

Source from the content-addressed store, hash-verified

651}
652
653function 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}

Callers 1

Calls 2

getToolStringFunction · 0.90
asRecordFunction · 0.90

Tested by

no test coverage detected