ta
TanStack
GitHub
ai
Workspace
GitHub
CI Pipeline Executions
Current execution
Succeeded
refactor/ai-drop-zod-dependency
Runs and Agents
Timeline
Beta
Configuration
Self-Healing CI
Project Graph
Circular Dependencies
Enterprise
Resource Usage
Analysis
Conformance
Enterprise
Runs
Current run
Succeeded
Tasks
Resource Usage
Insights
Compare tasks
Analytics
Sign in
Toggle sidebar
refactor(ai): remove zod from the dependency graph Bump `@ag-ui/core` to `0.1.1-canary.beta.0`, the only published version that declares zod as an optional peer rather than a runtime dependency. Every prior version (including `0.0.57`) hard-depends on zod, so it was installed transitively for every `@tanstack/ai` consumer. `chatParamsFromRequest` / `chatParamsFromRequestBody` were the sole zod consumers here — they validated request bodies with AG-UI's `RunAgentInputSchema`, which the canary moved to the `@ag-ui/core/schemas` subpath. Since this module is re-exported from the package root, importing that subpath (statically or lazily) would keep zod on the critical path for anyone calling `import { chat } from '@tanstack/ai'`. Instead both helpers now validate the same `RunAgentInput` contract structurally, transcribed from the upstream schema definitions: `tools`/`context` stay required arrays, `parentRunId` / `state` / `forwardedProps` / `resume` optional, and messages discriminate on `role` per variant. `@tanstack/ai` now ships with no schema-validation runtime at all and neither requires nor suggests zod. zod remains fully supported for defining tools. No API change: both helpers keep their signatures, still reject non-conforming bodies with `AGUIError` (`chatParamsFromRequest` still throws a 400 `Response`), and still carry TanStack's canonical `parts` through on messages. Validation failures now name the offending field (`messages[1].content must be a string`) instead of dumping zod issues. Two deliberate behavior notes: - `forwardedProps` is now validated as an object. Upstream typed it `z.any()`, so a non-object previously passed through and violated the declared `Record<string, unknown>` return type. - Unknown fields on individual messages now pass through instead of being stripped by `z.object`, which is more forward-compatible with newer AG-UI message fields. Unknown top-level fields are still dropped by construction, so the `cursor` behavior is unchanged. Also fixes a middleware snippet in the Vercel AI SDK comparison doc. The canary replaced zod-inferred event types with hand-written interfaces, so `'delta' in chunk` no longer filters the `AGUIEvent` union — every member is retained and intersected with `Record<'delta', unknown>`, typing `delta` as `unknown`. The snippet now discriminates on `type`, the real discriminant, which narrows `delta` to `string` with no non-null assertion.
nx run-many --targets=build --exclude=examples/**,testing/**
⌘K
Succeeded
nx run-many --targets=build --exclude=examples/**,testing/**
Click to copy
Linux
4 CPU cores
616d7052
1038
Get faster results
Learn how to enable distribution.
Atomizer enabled
50 groups of tasks optimized.
GitHub
ai
Workspace