Skip to content

feat(schemas): @tanstack/ai-schemas with nightly OpenAPI sync (closes #619)#622

Open
tombeckenham wants to merge 6 commits into
mainfrom
619-create-schemas-library
Open

feat(schemas): @tanstack/ai-schemas with nightly OpenAPI sync (closes #619)#622
tombeckenham wants to merge 6 commits into
mainfrom
619-create-schemas-library

Conversation

@tombeckenham

@tombeckenham tombeckenham commented May 22, 2026

Copy link
Copy Markdown
Contributor

🎯 Changes

Closes #619.

Adds @tanstack/ai-schemas — per-endpoint JSON Schema + Zod definitions for every supported provider's generation endpoints, generated nightly from upstream OpenAPI specs. Architecture ported from fal-ai/fal-js#212 and generalised to multi-provider.

Why: model-meta.ts covers coarse per-model facts (context window, modalities, pricing) but not the per-endpoint constraint surface — which durations Veo3 accepts, which image sizes Flux2 takes, valid ElevenLabs voice IDs, prompt-length caps. Schemas give runtime code and LLMs a way to shape and validate requests before they hit the network.

Providers: OpenAI, Anthropic, Gemini (Discovery doc → OpenAPI in-pipeline), ElevenLabs, xAI Grok, OpenRouter (incl. async video generation with frame/reference image conditioning), FAL (600+ models, specs committed; CI fetch needs FAL_KEY).

Activity grouping: endpoints are grouped per provider by activity, aligned with the core library's activities — chat, image, video, audio (TTS, transcription, music, SFX in one group), embeddings, moderation:

import { openaiChatEndpointZodMap } from '@tanstack/ai-schemas/openai/chat/zod'
import { elevenlabsAudioEndpointSchemaMap } from '@tanstack/ai-schemas/elevenlabs/audio/json-schema'
import { falVideoEndpointZodMap } from '@tanstack/ai-schemas/fal/video/zod'

Platform/admin endpoints (projects, invites, certificates, fine-tuning, file stores, workspaces) are excluded from generation. JSON Schemas ship self-contained ($ref closures bundled under $defs); binary-response media endpoints (e.g. TTS) map input-only entries. No aggregator barrel — bundlers tree-shake by file.

Pipeline: fetch-schemas@hey-api/openapi-ts (pinned 0.97.2, JSON Schema + Zod 4 plugins, per-activity spec splits with orphan pruning) → generate-endpoint-maps ($defs bundling, endpoint-id-keyed maps). Post-processing fixes three generator/spec issues: hey-api's schema-name discriminator grafts (discriminated unions rejected every valid payload at runtime), multipart/form-data request bodies (transcription/dubbing endpoints were silently missing), and dedup-renamed schema refs dangling in $defs.

Automation: .github/workflows/sync-schemas.yml runs daily at 05:00 UTC and opens an automated PR on diff, following the sync-models.yml pattern. Repo setup: add FAL_KEY to repo secrets (the fetcher must use the plain expand=openapi-3.0 param — the bracketed form is silently ignored upstream).

Coupled updates: docs/advanced/ai-schemas.md (+ docs/config.json), media-generation and adapter-configuration skills, changeset for the initial minor release.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

🤖 Generated with Claude Code

@tombeckenham tombeckenham linked an issue May 22, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 225 files, which is 75 over the limit of 150.

To get a review, narrow the scope:
• coderabbit review --type committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6a50f14b-1399-468e-a888-fa0a46eeaccd

📥 Commits

Reviewing files that changed from the base of the PR and between ff267a5 and 276e808.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (225)
  • .changeset/initial-ai-schemas.md
  • .github/workflows/sync-schemas.yml
  • docs/advanced/ai-schemas.md
  • docs/config.json
  • knip.json
  • packages/ai-schemas/README.md
  • packages/ai-schemas/openapi-ts.config.ts
  • packages/ai-schemas/package.json
  • packages/ai-schemas/scripts/fetch-schemas.ts
  • packages/ai-schemas/scripts/generate-endpoint-maps.ts
  • packages/ai-schemas/scripts/load-all-specs.ts
  • packages/ai-schemas/scripts/merge-openapi-specs.ts
  • packages/ai-schemas/scripts/providers.ts
  • packages/ai-schemas/scripts/providers/anthropic.ts
  • packages/ai-schemas/scripts/providers/elevenlabs.ts
  • packages/ai-schemas/scripts/providers/fal.ts
  • packages/ai-schemas/scripts/providers/gemini.ts
  • packages/ai-schemas/scripts/providers/grok.ts
  • packages/ai-schemas/scripts/providers/index.ts
  • packages/ai-schemas/scripts/providers/openai.ts
  • packages/ai-schemas/scripts/providers/openrouter.ts
  • packages/ai-schemas/scripts/specs/anthropic/anthropic.openapi.json
  • packages/ai-schemas/scripts/specs/elevenlabs/elevenlabs.openapi.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.3d-to-3d.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.audio-to-audio.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.audio-to-text.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.audio-to-video.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.image-to-3d.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.image-to-image.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.image-to-json.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.image-to-text.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.image-to-video.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.json.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.llm.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.speech-to-speech.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.speech-to-text.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.text-to-3d.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.text-to-audio.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.text-to-image.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.text-to-json.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.text-to-speech.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.text-to-video.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.training.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.unknown.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.video-to-audio.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.video-to-text.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.video-to-video.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.vision.json
  • packages/ai-schemas/scripts/specs/fal/fal.models.workflow.json
  • packages/ai-schemas/scripts/specs/gemini/gemini.discovery.json
  • packages/ai-schemas/scripts/specs/gemini/gemini.openapi.json
  • packages/ai-schemas/scripts/specs/grok/grok.openapi.json
  • packages/ai-schemas/scripts/specs/openai/openai.openapi.json
  • packages/ai-schemas/scripts/specs/openrouter/openrouter.openapi.json
  • packages/ai-schemas/scripts/specs/openrouter/openrouter.video-models.json
  • packages/ai-schemas/src/index.ts
  • packages/ai-schemas/src/openai-strict.ts
  • packages/ai-schemas/src/providers/anthropic/chat/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/anthropic/chat/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/anthropic/chat/index.ts
  • packages/ai-schemas/src/providers/anthropic/chat/schemas-index.ts
  • packages/ai-schemas/src/providers/anthropic/chat/schemas.gen.ts
  • packages/ai-schemas/src/providers/anthropic/chat/zod.gen.ts
  • packages/ai-schemas/src/providers/elevenlabs/audio/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/elevenlabs/audio/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/elevenlabs/audio/index.ts
  • packages/ai-schemas/src/providers/elevenlabs/audio/schemas-index.ts
  • packages/ai-schemas/src/providers/elevenlabs/audio/schemas.gen.ts
  • packages/ai-schemas/src/providers/elevenlabs/audio/zod.gen.ts
  • packages/ai-schemas/src/providers/fal/3d/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/fal/3d/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/fal/3d/index.ts
  • packages/ai-schemas/src/providers/fal/3d/schemas-index.ts
  • packages/ai-schemas/src/providers/fal/3d/schemas.gen.ts
  • packages/ai-schemas/src/providers/fal/3d/zod.gen.ts
  • packages/ai-schemas/src/providers/fal/audio/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/fal/audio/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/fal/audio/index.ts
  • packages/ai-schemas/src/providers/fal/audio/schemas-index.ts
  • packages/ai-schemas/src/providers/fal/audio/schemas.gen.ts
  • packages/ai-schemas/src/providers/fal/audio/zod.gen.ts
  • packages/ai-schemas/src/providers/fal/chat/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/fal/chat/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/fal/chat/index.ts
  • packages/ai-schemas/src/providers/fal/chat/schemas-index.ts
  • packages/ai-schemas/src/providers/fal/chat/schemas.gen.ts
  • packages/ai-schemas/src/providers/fal/chat/zod.gen.ts
  • packages/ai-schemas/src/providers/fal/image/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/fal/image/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/fal/image/index.ts
  • packages/ai-schemas/src/providers/fal/image/schemas-index.ts
  • packages/ai-schemas/src/providers/fal/image/schemas.gen.ts
  • packages/ai-schemas/src/providers/fal/image/zod.gen.ts
  • packages/ai-schemas/src/providers/fal/json/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/fal/json/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/fal/json/index.ts
  • packages/ai-schemas/src/providers/fal/json/schemas-index.ts
  • packages/ai-schemas/src/providers/fal/json/schemas.gen.ts
  • packages/ai-schemas/src/providers/fal/json/zod.gen.ts
  • packages/ai-schemas/src/providers/fal/video/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/fal/video/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/fal/video/index.ts
  • packages/ai-schemas/src/providers/fal/video/schemas-index.ts
  • packages/ai-schemas/src/providers/fal/video/schemas.gen.ts
  • packages/ai-schemas/src/providers/fal/video/zod.gen.ts
  • packages/ai-schemas/src/providers/fal/vision/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/fal/vision/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/fal/vision/index.ts
  • packages/ai-schemas/src/providers/fal/vision/schemas-index.ts
  • packages/ai-schemas/src/providers/fal/vision/schemas.gen.ts
  • packages/ai-schemas/src/providers/fal/vision/zod.gen.ts
  • packages/ai-schemas/src/providers/gemini/chat/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/gemini/chat/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/gemini/chat/index.ts
  • packages/ai-schemas/src/providers/gemini/chat/schemas-index.ts
  • packages/ai-schemas/src/providers/gemini/chat/schemas.gen.ts
  • packages/ai-schemas/src/providers/gemini/chat/zod.gen.ts
  • packages/ai-schemas/src/providers/gemini/embeddings/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/gemini/embeddings/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/gemini/embeddings/index.ts
  • packages/ai-schemas/src/providers/gemini/embeddings/schemas-index.ts
  • packages/ai-schemas/src/providers/gemini/embeddings/schemas.gen.ts
  • packages/ai-schemas/src/providers/gemini/embeddings/zod.gen.ts
  • packages/ai-schemas/src/providers/gemini/image/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/gemini/image/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/gemini/image/index.ts
  • packages/ai-schemas/src/providers/gemini/image/schemas-index.ts
  • packages/ai-schemas/src/providers/gemini/image/schemas.gen.ts
  • packages/ai-schemas/src/providers/gemini/image/zod.gen.ts
  • packages/ai-schemas/src/providers/gemini/video/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/gemini/video/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/gemini/video/index.ts
  • packages/ai-schemas/src/providers/gemini/video/schemas-index.ts
  • packages/ai-schemas/src/providers/gemini/video/schemas.gen.ts
  • packages/ai-schemas/src/providers/gemini/video/zod.gen.ts
  • packages/ai-schemas/src/providers/grok/chat/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/grok/chat/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/grok/chat/index.ts
  • packages/ai-schemas/src/providers/grok/chat/schemas-index.ts
  • packages/ai-schemas/src/providers/grok/chat/schemas.gen.ts
  • packages/ai-schemas/src/providers/grok/chat/zod.gen.ts
  • packages/ai-schemas/src/providers/grok/embeddings/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/grok/embeddings/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/grok/embeddings/index.ts
  • packages/ai-schemas/src/providers/grok/embeddings/schemas-index.ts
  • packages/ai-schemas/src/providers/grok/embeddings/schemas.gen.ts
  • packages/ai-schemas/src/providers/grok/embeddings/zod.gen.ts
  • packages/ai-schemas/src/providers/grok/image/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/grok/image/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/grok/image/index.ts
  • packages/ai-schemas/src/providers/grok/image/schemas-index.ts
  • packages/ai-schemas/src/providers/grok/image/schemas.gen.ts
  • packages/ai-schemas/src/providers/grok/image/zod.gen.ts
  • packages/ai-schemas/src/providers/grok/video/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/grok/video/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/grok/video/index.ts
  • packages/ai-schemas/src/providers/grok/video/schemas-index.ts
  • packages/ai-schemas/src/providers/grok/video/schemas.gen.ts
  • packages/ai-schemas/src/providers/grok/video/zod.gen.ts
  • packages/ai-schemas/src/providers/openai/audio/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/openai/audio/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/openai/audio/index.ts
  • packages/ai-schemas/src/providers/openai/audio/schemas-index.ts
  • packages/ai-schemas/src/providers/openai/audio/schemas.gen.ts
  • packages/ai-schemas/src/providers/openai/audio/zod.gen.ts
  • packages/ai-schemas/src/providers/openai/chat/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/openai/chat/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/openai/chat/index.ts
  • packages/ai-schemas/src/providers/openai/chat/schemas-index.ts
  • packages/ai-schemas/src/providers/openai/chat/schemas.gen.ts
  • packages/ai-schemas/src/providers/openai/chat/zod.gen.ts
  • packages/ai-schemas/src/providers/openai/embeddings/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/openai/embeddings/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/openai/embeddings/index.ts
  • packages/ai-schemas/src/providers/openai/embeddings/schemas-index.ts
  • packages/ai-schemas/src/providers/openai/embeddings/schemas.gen.ts
  • packages/ai-schemas/src/providers/openai/embeddings/zod.gen.ts
  • packages/ai-schemas/src/providers/openai/image/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/openai/image/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/openai/image/index.ts
  • packages/ai-schemas/src/providers/openai/image/schemas-index.ts
  • packages/ai-schemas/src/providers/openai/image/schemas.gen.ts
  • packages/ai-schemas/src/providers/openai/image/zod.gen.ts
  • packages/ai-schemas/src/providers/openai/moderation/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/openai/moderation/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/openai/moderation/index.ts
  • packages/ai-schemas/src/providers/openai/moderation/schemas-index.ts
  • packages/ai-schemas/src/providers/openai/moderation/schemas.gen.ts
  • packages/ai-schemas/src/providers/openai/moderation/zod.gen.ts
  • packages/ai-schemas/src/providers/openai/video/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/openai/video/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/openai/video/index.ts
  • packages/ai-schemas/src/providers/openai/video/schemas-index.ts
  • packages/ai-schemas/src/providers/openai/video/schemas.gen.ts
  • packages/ai-schemas/src/providers/openai/video/zod.gen.ts
  • packages/ai-schemas/src/providers/openrouter/audio/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/openrouter/audio/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/openrouter/audio/index.ts
  • packages/ai-schemas/src/providers/openrouter/audio/schemas-index.ts
  • packages/ai-schemas/src/providers/openrouter/audio/schemas.gen.ts
  • packages/ai-schemas/src/providers/openrouter/audio/zod.gen.ts
  • packages/ai-schemas/src/providers/openrouter/chat/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/openrouter/chat/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/openrouter/chat/index.ts
  • packages/ai-schemas/src/providers/openrouter/chat/schemas-index.ts
  • packages/ai-schemas/src/providers/openrouter/chat/schemas.gen.ts
  • packages/ai-schemas/src/providers/openrouter/chat/zod.gen.ts
  • packages/ai-schemas/src/providers/openrouter/embeddings/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/openrouter/embeddings/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/openrouter/embeddings/index.ts
  • packages/ai-schemas/src/providers/openrouter/embeddings/schemas-index.ts
  • packages/ai-schemas/src/providers/openrouter/embeddings/schemas.gen.ts
  • packages/ai-schemas/src/providers/openrouter/embeddings/zod.gen.ts
  • packages/ai-schemas/src/providers/openrouter/video/endpoint-schema-map.ts
  • packages/ai-schemas/src/providers/openrouter/video/endpoint-zod-map.ts
  • packages/ai-schemas/src/providers/openrouter/video/index.ts
  • packages/ai-schemas/src/providers/openrouter/video/schemas-index.ts
  • packages/ai-schemas/src/providers/openrouter/video/schemas.gen.ts
  • packages/ai-schemas/src/providers/openrouter/video/zod.gen.ts
  • packages/ai-schemas/tests/activity-groups.test.ts
  • packages/ai-schemas/tests/openai-strict.test.ts
  • packages/ai-schemas/tsconfig.json
  • packages/ai-schemas/vite.config.ts
  • packages/ai/skills/ai-core/adapter-configuration/SKILL.md
  • packages/ai/skills/ai-core/media-generation/SKILL.md

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 619-create-schemas-library

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

7 package(s) bumped directly, 25 bumped as dependents.

🟥 Major bumps

Package Version Reason
@tanstack/ai-event-client 0.5.4 → 1.0.0 Changeset
@tanstack/ai-fal 0.7.23 → 1.0.0 Changeset
@tanstack/ai-gemini 0.15.1 → 1.0.0 Changeset
@tanstack/ai-openai 0.14.1 → 1.0.0 Changeset
@tanstack/ai-anthropic 0.15.1 → 1.0.0 Dependent
@tanstack/ai-code-mode 0.2.5 → 1.0.0 Dependent
@tanstack/ai-code-mode-skills 0.2.5 → 1.0.0 Dependent
@tanstack/ai-elevenlabs 0.2.20 → 1.0.0 Dependent
@tanstack/ai-grok 0.11.2 → 1.0.0 Dependent
@tanstack/ai-groq 0.4.2 → 1.0.0 Dependent
@tanstack/ai-isolate-node 0.1.30 → 1.0.0 Dependent
@tanstack/ai-isolate-quickjs 0.1.30 → 1.0.0 Dependent
@tanstack/ai-ollama 0.8.1 → 1.0.0 Dependent
@tanstack/ai-openrouter 0.13.1 → 1.0.0 Dependent
@tanstack/ai-preact 0.9.4 → 1.0.0 Dependent
@tanstack/ai-react 0.15.4 → 1.0.0 Dependent
@tanstack/ai-react-ui 0.8.6 → 1.0.0 Dependent
@tanstack/ai-solid 0.13.4 → 1.0.0 Dependent
@tanstack/ai-solid-ui 0.7.6 → 1.0.0 Dependent
@tanstack/ai-svelte 0.13.4 → 1.0.0 Dependent
@tanstack/ai-vue 0.13.4 → 1.0.0 Dependent
@tanstack/openai-base 0.8.1 → 1.0.0 Dependent

🟨 Minor bumps

Package Version Reason
@tanstack/ai 0.28.0 → 0.29.0 Changeset
@tanstack/ai-client 0.16.3 → 0.17.0 Changeset
@tanstack/ai-schemas 0.1.0 → 0.2.0 Changeset

🟩 Patch bumps

Package Version Reason
@tanstack/ai-devtools-core 0.4.8 → 0.4.9 Dependent
@tanstack/ai-isolate-cloudflare 0.2.21 → 0.2.22 Dependent
@tanstack/ai-mcp 0.1.0 → 0.1.1 Dependent
@tanstack/ai-vue-ui 0.2.16 → 0.2.17 Dependent
@tanstack/preact-ai-devtools 0.1.51 → 0.1.52 Dependent
@tanstack/react-ai-devtools 0.2.51 → 0.2.52 Dependent
@tanstack/solid-ai-devtools 0.2.51 → 0.2.52 Dependent

@socket-security

socket-security Bot commented May 22, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​hey-api/​openapi-ts@​0.97.29910010096100

View full report

@nx-cloud

nx-cloud Bot commented May 22, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 276e808

Command Status Duration Result
nx run-many --targets=build --exclude=examples/... ✅ Succeeded 51s View ↗

☁️ Nx Cloud last updated this comment at 2026-06-11 02:37:01 UTC

@pkg-pr-new

pkg-pr-new Bot commented May 22, 2026

Copy link
Copy Markdown

Open in StackBlitz

@tanstack/ai

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai@622

@tanstack/ai-anthropic

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-anthropic@622

@tanstack/ai-client

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-client@622

@tanstack/ai-code-mode

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-code-mode@622

@tanstack/ai-code-mode-skills

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-code-mode-skills@622

@tanstack/ai-devtools-core

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-devtools-core@622

@tanstack/ai-elevenlabs

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-elevenlabs@622

@tanstack/ai-event-client

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-event-client@622

@tanstack/ai-fal

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-fal@622

@tanstack/ai-gemini

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-gemini@622

@tanstack/ai-grok

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-grok@622

@tanstack/ai-groq

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-groq@622

@tanstack/ai-isolate-cloudflare

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-isolate-cloudflare@622

@tanstack/ai-isolate-node

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-isolate-node@622

@tanstack/ai-isolate-quickjs

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-isolate-quickjs@622

@tanstack/ai-mcp

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-mcp@622

@tanstack/ai-ollama

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-ollama@622

@tanstack/ai-openai

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-openai@622

@tanstack/ai-openrouter

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-openrouter@622

@tanstack/ai-preact

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-preact@622

@tanstack/ai-react

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-react@622

@tanstack/ai-react-ui

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-react-ui@622

@tanstack/ai-schemas

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-schemas@622

@tanstack/ai-solid

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-solid@622

@tanstack/ai-solid-ui

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-solid-ui@622

@tanstack/ai-svelte

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-svelte@622

@tanstack/ai-utils

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-utils@622

@tanstack/ai-vue

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-vue@622

@tanstack/ai-vue-ui

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-vue-ui@622

@tanstack/openai-base

npm i https://pkg.pr.new/TanStack/ai/@tanstack/openai-base@622

@tanstack/preact-ai-devtools

npm i https://pkg.pr.new/TanStack/ai/@tanstack/preact-ai-devtools@622

@tanstack/react-ai-devtools

npm i https://pkg.pr.new/TanStack/ai/@tanstack/react-ai-devtools@622

@tanstack/solid-ai-devtools

npm i https://pkg.pr.new/TanStack/ai/@tanstack/solid-ai-devtools@622

commit: 276e808

tombeckenham added a commit that referenced this pull request May 26, 2026
Adds a fifth generic `TModelDurationByName` to `VideoAdapter` plus two
introspection methods on the base class:

- `availableDurations()` returns a `DurationOptions` tagged union
  (`discrete | range | mixed | none`) describing the durations the
  current model accepts.
- `snapDuration(seconds)` coerces raw seconds to the closest valid
  duration for the current model.

`generateVideo({ duration })` is now typed via
`VideoDurationForAdapter<TAdapter>`. The FAL adapter derives its
per-model duration type from the SDK's `EndpointTypeMap`, so e.g.
`falVideo('fal-ai/kling-video/v1.6/standard/text-to-video')` types
`duration` as `'5' | '10'`; `falVideo('fal-ai/veo3')` types it as
`'4s' | '6s' | '8s'`; `falVideo('fal-ai/minimax/video-01')` rejects
the field entirely.

Adapters that have not yet declared their per-model duration map get
sensible defaults (`{ kind: 'none' }`, `undefined`) so existing video
adapters keep working without changes.

Built on top of #622 (`@tanstack/ai-schemas`); once that PR's FAL
pipeline syncs runtime constraint data, the hand-curated map in
`packages/typescript/ai-fal/src/video/video-provider-options.ts` can
be replaced with schema-derived lookups. Follow-up issue #634 covers
building the Gemini Veo adapter directly on this contract.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tombeckenham tombeckenham force-pushed the 619-create-schemas-library branch from 7a05fca to d9904cf Compare June 5, 2026 08:24
@tombeckenham tombeckenham marked this pull request as ready for review June 5, 2026 08:30
@tombeckenham tombeckenham requested a review from a team as a code owner June 5, 2026 08:30
@tombeckenham tombeckenham requested a review from AlemTuzlak June 5, 2026 08:35
@tombeckenham

Copy link
Copy Markdown
Contributor Author

I've got some other ideas around how to do this. Converting to a draft for now

@tombeckenham tombeckenham marked this pull request as draft June 9, 2026 00:12
@tombeckenham tombeckenham marked this pull request as ready for review June 11, 2026 01:36
tombeckenham and others added 2 commits June 11, 2026 11:44
…oses #619)

JSON Schema + Zod definitions for AI provider generation endpoints,
generated from each provider's official OpenAPI spec (or equivalent):
OpenAI, Anthropic, Gemini, ElevenLabs, xAI Grok, and FAL (600+ models).

Endpoints are grouped per provider by activity, aligned with the core
library's activities — chat, image, video, audio (TTS, transcription,
music, SFX in one group), embeddings, moderation — behind
@tanstack/ai-schemas/{provider}/{activity}/{json-schema,zod} subpaths.
Platform/admin endpoints (projects, invites, certificates, fine-tuning,
file stores, workspaces) are excluded from generation. JSON Schemas ship
self-contained with their $ref closures bundled under $defs; binary-
response media endpoints map input-only entries.

Pipeline (ported from fal-ai/fal-js#212, generalised multi-provider):
fetch-schemas (per-provider fetchers) → @hey-api/openapi-ts (pinned,
JSON Schema + Zod 4 plugins, per-activity spec splits with orphan
pruning) → generate-endpoint-maps ($defs bundling, endpoint-id-keyed
maps). Post-processing strips hey-api's schema-name discriminator grafts
(which made discriminated unions reject every valid payload), accepts
multipart/form-data bodies, and resolves dedup-renamed schema refs.

.github/workflows/sync-schemas.yml refreshes specs daily and opens an
automated PR on diff, following the sync-models.yml pattern. FAL specs
are committed like the other providers'; the fetcher needs FAL_KEY
(repo secret) and the plain `expand=openapi-3.0` query param.

Squashed and rebased onto the flattened packages/* monorepo layout;
the package lives at packages/ai-schemas.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pulls the public OpenAPI 3.1 spec from openrouter.ai/openapi.json and
classifies into chat (chat/completions, messages, responses), audio
(speech, transcriptions), and video (/videos — including the
frame_images / input_references image-conditioning shape). Account
management, preset-scoped variants, and rerank drop out of generation.
/embeddings is intentionally unclassified: OpenRouter declares its
schemas inline rather than via $ref, so it can't be mapped to named
exports.

Per-model video constraints (supported_durations, resolutions, aspect
ratios from GET /api/v1/videos/models) are a candidate follow-up —
noted in the provider module.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tombeckenham tombeckenham force-pushed the 619-create-schemas-library branch from ecc6fac to bd3a917 Compare June 11, 2026 02:00
@socket-security

socket-security Bot commented Jun 11, 2026

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm powershell-utils is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: pnpm-lock.yamlnpm/@hey-api/openapi-ts@0.97.2npm/powershell-utils@0.1.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/powershell-utils@0.1.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

tombeckenham and others added 3 commits June 11, 2026 12:14
…chemas

Two gaps noted in the OpenRouter provider land here:

/embeddings was unclassified because OpenRouter declares its request/
response schemas inline rather than via $ref, and the endpoint-map
generator can only map named component schemas. The loader now lifts the
inline shapes into components.schemas as EmbeddingsRequest /
EmbeddingsResponse and re-points the operation, so the endpoint
classifies into a new openrouter/embeddings activity unit.

Per-model video constraints: the fetcher now also caches the public
GET /api/v1/videos/models metadata (supported durations, resolutions,
aspect ratios, sizes, frame images, audio/seed capability, passthrough
allow-lists) as openrouter.video-models.json, sorted by id for stable
nightly diffs. The loader synthesises one constrained
VideoGenerationRequest variant per video model (currently 14), mounted
at synthetic /videos/{model-id} POSTs marked with
x-tanstack-synthetic-video-model so classification never catches real
upstream paths. Constraints become enums; capabilities a model lacks
drop out of its variant; frame-type and passthrough rules land in field
descriptions. The maps expose them as videos/{model-id} entries
alongside the generic videos entry.

Also: the endpoint extractor now falls back 200 → 201 → 202 for JSON
success responses, giving the OpenRouter video job ack (202,
VideoGenerationResponse) and two ElevenLabs dubbing endpoints (201)
real output schemas.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Equivalent of one nightly sync-schemas.yml run, executed locally with
FAL_KEY: refetched all 7 providers' upstream specs (OpenAI, Anthropic,
Gemini, ElevenLabs, xAI Grok, OpenRouter incl. video-models metadata,
FAL with 600+ per-model specs) and regenerated schemas, zod, and
endpoint maps.

Endpoint surface changes are FAL model additions (e.g. bria/genfill/v2,
ideogram/v4/lora); everything else is within-schema drift. No
endpoint-map warnings; tests, types, lint, build, and publint green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Fetchers write plain JSON.stringify output, but the repo's autofix bot
runs `pnpm format` on every PR — so each nightly sync PR earned a
formatting follow-up commit (and a misleading double diff). Normalise
the specs dir with the repo's Prettier at the end of fetch-schemas so
committed specs land in their final form.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

Create schemas library

1 participant