Problem
A payload with a non-array messages object ({messages: {role: "user"}}) throws msgs is not iterable instead of a structured failure.
Where
src/index.mjs (units: payload.messages || [] then for...of).
Acceptance
Add a failing test first passing a non-array messages object, expecting a validation error or coercion instead of TypeError. Then fix.
Problem
A payload with a non-array
messagesobject ({messages: {role: "user"}}) throwsmsgs is not iterableinstead of a structured failure.Where
src/index.mjs(units:payload.messages || []thenfor...of).Acceptance
Add a failing test first passing a non-array
messagesobject, expecting a validation error or coercion instead ofTypeError. Then fix.