Loading workspace insights... Statistics interval
7 days30 daysLatest CI Pipeline Executions
c3c78b65 feat(schemas): add OpenRouter provider
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> 2df435fa feat(schemas): add @tanstack/ai-schemas with nightly OpenAPI sync (closes #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> 241b8f9c feat(schemas): add xAI Grok provider
Adds Grok as a provider in the nightly OpenAPI sync. Source is xAI's
first-party OpenAPI spec at docs.x.ai/openapi.json (OpenAPI 3.1.0, 32
endpoints, 168 schemas). Public, no auth required for the spec.
Grok is API-compatible with OpenAI's chat completions at the wire level
but ships an independent schema set (different names, slightly different
shapes, plus xAI-specific endpoints: deferred-completion, documents/search,
per-modality model lists, video edits/extensions, tokenize-text, etc.).
Each provider stays isolated in the schemas package.
Bumps the build script's heap to 8 GB. With six providers now in the
single dts program, the default 4 GB limit was tight. Knip ignores
`vite` for ai-schemas since the script invokes the binary directly.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> 241b8f9c feat(schemas): add xAI Grok provider
Adds Grok as a provider in the nightly OpenAPI sync. Source is xAI's
first-party OpenAPI spec at docs.x.ai/openapi.json (OpenAPI 3.1.0, 32
endpoints, 168 schemas). Public, no auth required for the spec.
Grok is API-compatible with OpenAI's chat completions at the wire level
but ships an independent schema set (different names, slightly different
shapes, plus xAI-specific endpoints: deferred-completion, documents/search,
per-modality model lists, video edits/extensions, tokenize-text, etc.).
Each provider stays isolated in the schemas package.
Bumps the build script's heap to 8 GB. With six providers now in the
single dts program, the default 4 GB limit was tight. Knip ignores
`vite` for ai-schemas since the script invokes the binary directly.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> c6b45c01 refactor(schemas): provider-first subpath exports for tree-shaking
Switches `@tanstack/ai-schemas` from format-first
(`@tanstack/ai-schemas/schemas/openai`, `/zod/gemini`) to provider-first
(`@tanstack/ai-schemas/openai/json-schema`, `/gemini/zod`) and drops the
namespaced aggregator barrels.
With provider-first subpaths and no aggregator, importing one provider's
schemas pulls only that provider's bytes. Importing
`@tanstack/ai-schemas/gemini/json-schema` carries no OpenAI, Anthropic,
ElevenLabs, or FAL code into the consumer's bundle.
The default `.` entry now only re-exports `toOpenAIStrict` (4 KB).
Wildcard exports in package.json:
"./*/json-schema" -> dist/esm/providers/*/schemas-index.{js,d.ts}
"./*/zod" -> dist/esm/providers/*/index.{js,d.ts}
Generator emits a flat layout — `providers/{providerId}` for single-
category providers, `providers/{providerId}-{category}` for FAL
(`fal-image`, `fal-video`, etc.) — so Node's single-segment `*` wildcard
resolves cleanly.
Vite discovers per-provider barrels at build time so the dist mirrors
the provider layout.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>