Skip to content

feat(typescript-sdk): add Standard Schema v1 support for inputValidat…#3336

Open
MistakenPirate wants to merge 2 commits intohatchet-dev:mainfrom
MistakenPirate:feat/standard-schema-support
Open

feat(typescript-sdk): add Standard Schema v1 support for inputValidat…#3336
MistakenPirate wants to merge 2 commits intohatchet-dev:mainfrom
MistakenPirate:feat/standard-schema-support

Conversation

@MistakenPirate
Copy link

@MistakenPirate MistakenPirate commented Mar 19, 2026

Description

Adds Standard Schema v1 support to the TypeScript SDK's inputValidator and waitForEvent payloadSchema. This removes the Zod v3 lock-in and allows any Standard Schema compliant library (Zod v4, Valibot, ArkType, etc.) to be used for input validation.

Fixes # (issue)

Type of change

  • New feature (non-breaking change which adds functionality)

What's Changed

  • Added StandardSchemaV1 types (inlined from spec) and runtime utilities in standard-schema.ts
  • Widened inputValidator type to accept z.ZodType | StandardSchemaV1
  • Updated waitForEvent to accept Standard Schema for payloadSchema with proper overloads
  • Replaced direct zodToJsonSchema / .parse() calls with unified helpers (schemaToJsonSchema, validateWithSchema)
  • Exported StandardSchemaV1 and StandardSchemaValidationError from the v1 barrel
  • Fully backward compatible, existing Zod v3 schemas work as before

@vercel
Copy link

vercel bot commented Mar 19, 2026

@MistakenPirate is attempting to deploy a commit to the Hatchet Team on Vercel.

A member of the Team first needs to authorize it.

@promptless-for-oss
Copy link

📝 Documentation updates detected!

New suggestion: Document Standard Schema v1 support for TypeScript SDK inputValidator and waitForEvent


Tip: Planning a big docs refactor? Use Deep Analysis to get help with the heavy lifting 🔍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants