TypeScript requires Zod v4 (
npm install zod@4).How it maps
The SDK converts your schema into the task’soutput.schema (a flat, canonical research
schema) on the way in. On the way out it flattens each “cell” row (fields come back as
{value, source_id}) to plain values and validates them against your schema. Rows that
fail validation are dropped, so result.output only contains well-formed objects. The raw
rows (with sources and provenance) remain available on result.rows.
A schema with no wrapper is treated as the row itself, so result.output is then a list of
that model.
Under the hood
This is the sameoutput.schema you can pass directly via a task spec.
The SDK schema is a convenience over it. Supported field types resolve to str, int,
float, bool, and list[...].