Merged
Conversation
AlemTuzlak
approved these changes
Apr 23, 2026
845bc49 to
ad562ab
Compare
ad562ab to
8eff30c
Compare
AlemTuzlak
approved these changes
Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@tanstack/ai@0.14.0
Minor Changes
feat: add generateAudio activity for music and sound-effect generation (#463)
Adds a new
audioactivity kind alongside the existingttsandtranscriptionactivities:generateAudio()/createAudioOptions()functionsAudioAdapterinterface andBaseAudioAdapterbase classAudioGenerationOptions/AudioGenerationResult/GeneratedAudiotypesaudio:request:started,audio:request:completed, andaudio:usagedevtools eventsfeat: add
useGenerateAudiohook and streaming support forgenerateAudio()(#463)Closes the parity gap between audio generation and the other media
activities (image, speech, video, transcription, summarize):
generateAudio()now acceptsstream: true, returning anAsyncIterable<StreamChunk>that can be piped throughtoServerSentEventsResponse().AudioGenerateInputtype added to@tanstack/ai-client.useGenerateAudiohook added to@tanstack/ai-react,@tanstack/ai-solid, and@tanstack/ai-vue; matchingcreateGenerateAudioadded to@tanstack/ai-svelte. All follow the same{ generate, result, isLoading, error, status, stop, reset }shape asthe existing media hooks and support both
connection(SSE) andfetchertransports.Tighten
GeneratedImageandGeneratedAudioto enforce exactly one ofurlorb64Jsonvia a mutually-exclusiveGeneratedMediaSourceunion. (#463)Both types previously declared
url?andb64Json?as independently optional, which allowed meaningless{}values and objects that set both fields. They now require exactly one:Existing read patterns like
img.url || \data:image/png;base64,${img.b64Json}`continue to work unchanged. The only runtime-visible change is that the@tanstack/ai-openrouterand@tanstack/ai-falimage adapters no longer populateurlwith a synthesizeddata:image/png;base64,...URI when the provider returns base64 — they return{ b64Json }only. Consumers that want a data URI should build it fromb64Json` at render time.Patch Changes
refactor(ai, ai-openai): narrow error handling before logging (#465)
catch (error: any)sites instream-to-response.ts,activities/stream-generation-result.ts, andactivities/generateVideo/index.tsare now narrowed tounknownand funnel through a sharedtoRunErrorPayload(error, fallback)helper that extractsmessage/codewithout leaking the original error object (which can carry request state from an SDK).Replaced four
console.errorcalls in the OpenAI text adapter'schatStreamcatch block that dumped the full error object to stdout. SDK errors can carry the original request including auth headers, so the library now logs only the narrowed{ message, code }payload via the internal logger — any user-supplied logger receives the sanitized shape, not the raw SDK error.Updated dependencies []:
@tanstack/ai-client@0.8.0
Minor Changes
feat: add
useGenerateAudiohook and streaming support forgenerateAudio()(#463)Closes the parity gap between audio generation and the other media
activities (image, speech, video, transcription, summarize):
generateAudio()now acceptsstream: true, returning anAsyncIterable<StreamChunk>that can be piped throughtoServerSentEventsResponse().AudioGenerateInputtype added to@tanstack/ai-client.useGenerateAudiohook added to@tanstack/ai-react,@tanstack/ai-solid, and@tanstack/ai-vue; matchingcreateGenerateAudioadded to@tanstack/ai-svelte. All follow the same{ generate, result, isLoading, error, status, stop, reset }shape asthe existing media hooks and support both
connection(SSE) andfetchertransports.Patch Changes
fix(ai-client): prevent drainPostStreamActions re-entrancy stealing queued actions (#429)
When multiple client tools complete in the same round, nested
drainPostStreamActions()calls fromstreamResponse()'sfinallyblock could steal queued actions, permanently stalling the conversation. Added a re-entrancy guard and ashouldAutoSend()check requiring tool-call parts before triggering continuation.Updated dependencies [
54523f5,54523f5,af9eb7b,54523f5]:@tanstack/ai-fal@0.7.0
Minor Changes
feat: add audio, speech, and transcription adapters to @tanstack/ai-fal (#463)
Adds three new tree-shakeable adapters alongside the existing
falImage()andfalVideo():falSpeech()— text-to-speech via models like Googlefal-ai/gemini-3.1-flash-tts,fal-ai/elevenlabs/tts/eleven-v3,fal-ai/minimax/speech-2.6-hd,fal-ai/kokoro/*falTranscription()— speech-to-text viafal-ai/whisper,fal-ai/wizper,fal-ai/speech-to-text/turbo,fal-ai/elevenlabs/speech-to-textfalAudio()— music and sound-effect generation viafal-ai/minimax-music/v2.6,fal-ai/diffrhythm,fal-ai/lyria2,fal-ai/stable-audio-25/text-to-audio,fal-ai/elevenlabs/sound-effects/v2Patch Changes
Tighten
GeneratedImageandGeneratedAudioto enforce exactly one ofurlorb64Jsonvia a mutually-exclusiveGeneratedMediaSourceunion. (#463)Both types previously declared
url?andb64Json?as independently optional, which allowed meaningless{}values and objects that set both fields. They now require exactly one:Existing read patterns like
img.url || \data:image/png;base64,${img.b64Json}`continue to work unchanged. The only runtime-visible change is that the@tanstack/ai-openrouterand@tanstack/ai-falimage adapters no longer populateurlwith a synthesizeddata:image/png;base64,...URI when the provider returns base64 — they return{ b64Json }only. Consumers that want a data URI should build it fromb64Json` at render time.Updated dependencies [
54523f5,54523f5,af9eb7b,54523f5]:@tanstack/ai-gemini@0.10.0
Minor Changes
feat(ai-gemini): add Lyria 3 Pro / Clip audio adapter and Gemini 3.1 Flash TTS (#463)
New adapter:
geminiAudio()for Google Lyria music generation — supportslyria-3-pro-preview(full-length songs, MP3/WAV 48 kHz stereo) andlyria-3-clip-preview(30-second MP3 clips)Enhanced:
gemini-3.1-flash-tts-previewto the TTS model list (70+ languages, 200+ audio tags for expressive control)multiSpeakerVoiceConfigtoGeminiTTSProviderOptionsfor 2-speaker dialogue generationPatch Changes
Tighten
GeneratedImageandGeneratedAudioto enforce exactly one ofurlorb64Jsonvia a mutually-exclusiveGeneratedMediaSourceunion. (#463)Both types previously declared
url?andb64Json?as independently optional, which allowed meaningless{}values and objects that set both fields. They now require exactly one:Existing read patterns like
img.url || \data:image/png;base64,${img.b64Json}`continue to work unchanged. The only runtime-visible change is that the@tanstack/ai-openrouterand@tanstack/ai-falimage adapters no longer populateurlwith a synthesizeddata:image/png;base64,...URI when the provider returns base64 — they return{ b64Json }only. Consumers that want a data URI should build it fromb64Json` at render time.Updated dependencies [
54523f5,54523f5,af9eb7b,54523f5]:@tanstack/ai-grok@0.7.0
Minor Changes
feat(ai-grok): add audio and speech adapters for xAI (#506)
Add three new tree-shakeable adapters that wrap xAI's audio APIs:
grokSpeech/createGrokSpeech— text-to-speech viaPOST /v1/tts. Supports the 5 xAI voices (eve,ara,rex,sal,leo), MP3/WAV/PCM/μ-law/A-law codecs, and thelanguage,sample_rate,bit_rate,optimize_streaming_latency,text_normalizationprovider options.grokTranscription/createGrokTranscription— speech-to-text viaPOST /v1/stt. Passes throughlanguage,diarize,multichannel,channels,audio_format, andsample_rate; maps xAI's word-level timestamps toTranscriptionResult.words.grokRealtime/grokRealtimeToken— Voice Agent (realtime) adapter forwss://api.x.ai/v1/realtimewith ephemeral tokens via/v1/realtime/client_secrets. Supports thegrok-voice-fast-1.0andgrok-voice-think-fast-1.0models.New model identifier exports:
GROK_TTS_MODELS,GROK_TRANSCRIPTION_MODELS,GROK_REALTIME_MODELSand their corresponding types.Patch Changes
Tighten
GeneratedImageandGeneratedAudioto enforce exactly one ofurlorb64Jsonvia a mutually-exclusiveGeneratedMediaSourceunion. (#463)Both types previously declared
url?andb64Json?as independently optional, which allowed meaningless{}values and objects that set both fields. They now require exactly one:Existing read patterns like
img.url || \data:image/png;base64,${img.b64Json}`continue to work unchanged. The only runtime-visible change is that the@tanstack/ai-openrouterand@tanstack/ai-falimage adapters no longer populateurlwith a synthesizeddata:image/png;base64,...URI when the provider returns base64 — they return{ b64Json }only. Consumers that want a data URI should build it fromb64Json` at render time.Updated dependencies [
54523f5,54523f5,af9eb7b,54523f5]:@tanstack/ai-react@0.8.0
Minor Changes
feat: add
useGenerateAudiohook and streaming support forgenerateAudio()(#463)Closes the parity gap between audio generation and the other media
activities (image, speech, video, transcription, summarize):
generateAudio()now acceptsstream: true, returning anAsyncIterable<StreamChunk>that can be piped throughtoServerSentEventsResponse().AudioGenerateInputtype added to@tanstack/ai-client.useGenerateAudiohook added to@tanstack/ai-react,@tanstack/ai-solid, and@tanstack/ai-vue; matchingcreateGenerateAudioadded to@tanstack/ai-svelte. All follow the same{ generate, result, isLoading, error, status, stop, reset }shape asthe existing media hooks and support both
connection(SSE) andfetchertransports.Patch Changes
fix(ai-react, ai-preact, ai-vue, ai-solid): propagate
useChatcallback changes (#465)onResponse,onChunk, andonCustomEventwere captured by reference at client creation time. When a parent component re-rendered with fresh closures, theChatClientkept calling the originals. Every framework now wraps these callbacks so the latestoptions.xxxis read at call time (viaoptionsRef.currentin React/Preact, and direct option access in Vue/Solid, matching the pattern already used foronFinish/onError). Clearing a callback (setting it toundefined) now correctly no-ops instead of continuing to invoke the stale handler.Updated dependencies [
54523f5,54523f5,af9eb7b,008f015,54523f5]:@tanstack/ai-solid@0.7.0
Minor Changes
feat: add
useGenerateAudiohook and streaming support forgenerateAudio()(#463)Closes the parity gap between audio generation and the other media
activities (image, speech, video, transcription, summarize):
generateAudio()now acceptsstream: true, returning anAsyncIterable<StreamChunk>that can be piped throughtoServerSentEventsResponse().AudioGenerateInputtype added to@tanstack/ai-client.useGenerateAudiohook added to@tanstack/ai-react,@tanstack/ai-solid, and@tanstack/ai-vue; matchingcreateGenerateAudioadded to@tanstack/ai-svelte. All follow the same{ generate, result, isLoading, error, status, stop, reset }shape asthe existing media hooks and support both
connection(SSE) andfetchertransports.Patch Changes
fix(ai-react, ai-preact, ai-vue, ai-solid): propagate
useChatcallback changes (#465)onResponse,onChunk, andonCustomEventwere captured by reference at client creation time. When a parent component re-rendered with fresh closures, theChatClientkept calling the originals. Every framework now wraps these callbacks so the latestoptions.xxxis read at call time (viaoptionsRef.currentin React/Preact, and direct option access in Vue/Solid, matching the pattern already used foronFinish/onError). Clearing a callback (setting it toundefined) now correctly no-ops instead of continuing to invoke the stale handler.Updated dependencies [
54523f5,54523f5,af9eb7b,008f015,54523f5]:@tanstack/ai-svelte@0.7.0
Minor Changes
feat: add
useGenerateAudiohook and streaming support forgenerateAudio()(#463)Closes the parity gap between audio generation and the other media
activities (image, speech, video, transcription, summarize):
generateAudio()now acceptsstream: true, returning anAsyncIterable<StreamChunk>that can be piped throughtoServerSentEventsResponse().AudioGenerateInputtype added to@tanstack/ai-client.useGenerateAudiohook added to@tanstack/ai-react,@tanstack/ai-solid, and@tanstack/ai-vue; matchingcreateGenerateAudioadded to@tanstack/ai-svelte. All follow the same{ generate, result, isLoading, error, status, stop, reset }shape asthe existing media hooks and support both
connection(SSE) andfetchertransports.Patch Changes
54523f5,54523f5,af9eb7b,008f015,54523f5]:@tanstack/ai-vue@0.7.0
Minor Changes
feat: add
useGenerateAudiohook and streaming support forgenerateAudio()(#463)Closes the parity gap between audio generation and the other media
activities (image, speech, video, transcription, summarize):
generateAudio()now acceptsstream: true, returning anAsyncIterable<StreamChunk>that can be piped throughtoServerSentEventsResponse().AudioGenerateInputtype added to@tanstack/ai-client.useGenerateAudiohook added to@tanstack/ai-react,@tanstack/ai-solid, and@tanstack/ai-vue; matchingcreateGenerateAudioadded to@tanstack/ai-svelte. All follow the same{ generate, result, isLoading, error, status, stop, reset }shape asthe existing media hooks and support both
connection(SSE) andfetchertransports.Patch Changes
fix(ai-react, ai-preact, ai-vue, ai-solid): propagate
useChatcallback changes (#465)onResponse,onChunk, andonCustomEventwere captured by reference at client creation time. When a parent component re-rendered with fresh closures, theChatClientkept calling the originals. Every framework now wraps these callbacks so the latestoptions.xxxis read at call time (viaoptionsRef.currentin React/Preact, and direct option access in Vue/Solid, matching the pattern already used foronFinish/onError). Clearing a callback (setting it toundefined) now correctly no-ops instead of continuing to invoke the stale handler.Updated dependencies [
54523f5,54523f5,af9eb7b,008f015,54523f5]:@tanstack/ai-anthropic@0.8.2
Patch Changes
54523f5,54523f5,af9eb7b,54523f5]:@tanstack/ai-code-mode@0.1.8
Patch Changes
54523f5,54523f5,af9eb7b,54523f5]:@tanstack/ai-code-mode-skills@0.1.8
Patch Changes
54523f5,54523f5,af9eb7b,54523f5]:@tanstack/ai-devtools-core@0.3.25
Patch Changes
54523f5,54523f5,af9eb7b,54523f5]:@tanstack/ai-elevenlabs@0.1.8
Patch Changes
54523f5,54523f5,af9eb7b,008f015,54523f5]:@tanstack/ai-event-client@0.2.8
Patch Changes
54523f5,54523f5,af9eb7b,54523f5]:@tanstack/ai-groq@0.1.8
Patch Changes
54523f5,54523f5,af9eb7b,54523f5]:@tanstack/ai-isolate-cloudflare@0.1.8
Patch Changes
feat(ai-isolate-cloudflare): support production deployments and close tool-name injection vector (#465)
The Worker now documents production-capable
unsafe_evalusage (previously the code, wrangler.toml, and README all described it as dev-only). Tool names are validated against a strict identifier regex before being interpolated into the generated wrapper code, so a malicious tool name likefoo'); process.exit(1); (function bar() {is rejected at generation time rather than breaking out of the wrapping function.Updated dependencies []:
@tanstack/ai-isolate-node@0.1.8
Patch Changes
@tanstack/ai-isolate-quickjs@0.1.8
Patch Changes
@tanstack/ai-ollama@0.6.10
Patch Changes
refactor(ai-ollama): extract tool conversion into
src/tools/matching peer adapters (#465)Tool handling lived inline inside the text adapter with raw type casts. It is now split into a dedicated
tool-converter.ts/function-tool.tspair (mirroring the structure used byai-openai,ai-anthropic,ai-grok, andai-groq) and re-exported from the package index asconvertFunctionToolToAdapterFormatandconvertToolsToProviderFormat. Runtime behavior is unchanged.Updated dependencies [
54523f5,54523f5,af9eb7b,54523f5]:@tanstack/ai-openai@0.8.2
Patch Changes
refactor(ai, ai-openai): narrow error handling before logging (#465)
catch (error: any)sites instream-to-response.ts,activities/stream-generation-result.ts, andactivities/generateVideo/index.tsare now narrowed tounknownand funnel through a sharedtoRunErrorPayload(error, fallback)helper that extractsmessage/codewithout leaking the original error object (which can carry request state from an SDK).Replaced four
console.errorcalls in the OpenAI text adapter'schatStreamcatch block that dumped the full error object to stdout. SDK errors can carry the original request including auth headers, so the library now logs only the narrowed{ message, code }payload via the internal logger — any user-supplied logger receives the sanitized shape, not the raw SDK error.Tighten
GeneratedImageandGeneratedAudioto enforce exactly one ofurlorb64Jsonvia a mutually-exclusiveGeneratedMediaSourceunion. (#463)Both types previously declared
url?andb64Json?as independently optional, which allowed meaningless{}values and objects that set both fields. They now require exactly one:Existing read patterns like
img.url || \data:image/png;base64,${img.b64Json}`continue to work unchanged. The only runtime-visible change is that the@tanstack/ai-openrouterand@tanstack/ai-falimage adapters no longer populateurlwith a synthesizeddata:image/png;base64,...URI when the provider returns base64 — they return{ b64Json }only. Consumers that want a data URI should build it fromb64Json` at render time.Updated dependencies [
54523f5,54523f5,af9eb7b,008f015,54523f5]:@tanstack/ai-openrouter@0.8.2
Patch Changes
Tighten
GeneratedImageandGeneratedAudioto enforce exactly one ofurlorb64Jsonvia a mutually-exclusiveGeneratedMediaSourceunion. (#463)Both types previously declared
url?andb64Json?as independently optional, which allowed meaningless{}values and objects that set both fields. They now require exactly one:Existing read patterns like
img.url || \data:image/png;base64,${img.b64Json}`continue to work unchanged. The only runtime-visible change is that the@tanstack/ai-openrouterand@tanstack/ai-falimage adapters no longer populateurlwith a synthesizeddata:image/png;base64,...URI when the provider returns base64 — they return{ b64Json }only. Consumers that want a data URI should build it fromb64Json` at render time.Updated dependencies [
54523f5,54523f5,af9eb7b,54523f5]:@tanstack/ai-preact@0.6.20
Patch Changes
fix(ai-react, ai-preact, ai-vue, ai-solid): propagate
useChatcallback changes (#465)onResponse,onChunk, andonCustomEventwere captured by reference at client creation time. When a parent component re-rendered with fresh closures, theChatClientkept calling the originals. Every framework now wraps these callbacks so the latestoptions.xxxis read at call time (viaoptionsRef.currentin React/Preact, and direct option access in Vue/Solid, matching the pattern already used foronFinish/onError). Clearing a callback (setting it toundefined) now correctly no-ops instead of continuing to invoke the stale handler.Updated dependencies [
54523f5,54523f5,af9eb7b,008f015,54523f5]:@tanstack/ai-react-ui@0.6.2
Patch Changes
54523f5,008f015,af9eb7b]:@tanstack/ai-solid-ui@0.6.2
Patch Changes
54523f5,008f015,af9eb7b]:@tanstack/ai-vue-ui@0.1.31
Patch Changes
54523f5,af9eb7b]:@tanstack/preact-ai-devtools@0.1.29
Patch Changes
@tanstack/react-ai-devtools@0.2.29
Patch Changes
@tanstack/solid-ai-devtools@0.2.29
Patch Changes
ts-svelte-chat@0.1.37
Patch Changes
54523f5,54523f5,af9eb7b,008f015,54523f5,54523f5,af9eb7b]:ts-vue-chat@0.1.37
Patch Changes
54523f5,54523f5,af9eb7b,008f015,54523f5,54523f5,af9eb7b,af9eb7b]:vanilla-chat@0.0.35
Patch Changes
54523f5,008f015]:@tanstack/ai-code-mode-models-eval@0.0.11
Patch Changes
54523f5,54523f5,af9eb7b,54523f5,54523f5,2e4c942,af9eb7b]: