Problem
A non-string text block ({type: "text", text: 123}) crashes analyzePayload with u.text.slice is not a function.
Where
src/index.mjs (biggest mapping calls u.text.slice(0, 80) with no coercion).
Acceptance
Add a failing test first passing [{role: "user", content: [{type: "text", text: 123}]}], expecting no throw and text counted via String(). Then fix.
Problem
A non-string text block (
{type: "text", text: 123}) crashesanalyzePayloadwithu.text.slice is not a function.Where
src/index.mjs(biggestmapping callsu.text.slice(0, 80)with no coercion).Acceptance
Add a failing test first passing
[{role: "user", content: [{type: "text", text: 123}]}], expecting no throw and text counted viaString(). Then fix.