From b0b0e96bf90e18a5403ccbd862fd90cd11013ad3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 19 Aug 2026 16:27:39 +0000 Subject: [PATCH] ci: Version Packages --- .changeset/billed-usage-unit.md | 13 ---- .changeset/fix-local-process-wait.md | 5 -- .../openrouter-combined-tools-and-schema.md | 7 --- .changeset/preserve-server-reasoning.md | 5 -- .changeset/ssr-thread-identity.md | 11 ---- .changeset/tidy-searches-coexist.md | 18 ------ .changeset/vercel-sandbox-user-agent.md | 5 -- .changeset/websocket-transport.md | 47 --------------- examples/ag-ui/CHANGELOG.md | 9 +++ examples/ag-ui/package.json | 2 +- packages/ai-acp/CHANGELOG.md | 8 +++ packages/ai-acp/package.json | 2 +- packages/ai-angular/CHANGELOG.md | 50 ++++++++++++++++ packages/ai-angular/package.json | 2 +- packages/ai-anthropic/CHANGELOG.md | 15 +++++ packages/ai-anthropic/package.json | 2 +- packages/ai-bedrock/CHANGELOG.md | 8 +++ packages/ai-bedrock/package.json | 2 +- packages/ai-byteplus/CHANGELOG.md | 12 ++++ packages/ai-byteplus/package.json | 2 +- packages/ai-claude-code/CHANGELOG.md | 8 +++ packages/ai-claude-code/package.json | 2 +- packages/ai-client/CHANGELOG.md | 50 ++++++++++++++++ packages/ai-client/package.json | 2 +- packages/ai-code-mode-snippets/CHANGELOG.md | 8 +++ packages/ai-code-mode-snippets/package.json | 2 +- packages/ai-code-mode/CHANGELOG.md | 7 +++ packages/ai-code-mode/package.json | 2 +- packages/ai-codex/CHANGELOG.md | 8 +++ packages/ai-codex/package.json | 2 +- packages/ai-cohere/CHANGELOG.md | 11 ++++ packages/ai-cohere/package.json | 2 +- packages/ai-devtools/CHANGELOG.md | 8 +++ packages/ai-devtools/package.json | 2 +- packages/ai-durable-stream/CHANGELOG.md | 7 +++ packages/ai-durable-stream/package.json | 2 +- packages/ai-elevenlabs/CHANGELOG.md | 7 +++ packages/ai-elevenlabs/package.json | 2 +- packages/ai-event-client/CHANGELOG.md | 6 ++ packages/ai-event-client/package.json | 2 +- packages/ai-fal/CHANGELOG.md | 11 ++++ packages/ai-fal/package.json | 2 +- packages/ai-gemini/CHANGELOG.md | 15 +++++ packages/ai-gemini/package.json | 2 +- packages/ai-grok-build/CHANGELOG.md | 9 +++ packages/ai-grok-build/package.json | 2 +- packages/ai-grok/CHANGELOG.md | 20 +++++++ packages/ai-grok/package.json | 2 +- packages/ai-groq/CHANGELOG.md | 8 +++ packages/ai-groq/package.json | 2 +- packages/ai-mcp/CHANGELOG.md | 7 +++ packages/ai-mcp/package.json | 2 +- packages/ai-memory/CHANGELOG.md | 16 +++++ packages/ai-memory/package.json | 2 +- packages/ai-mistral/CHANGELOG.md | 7 +++ packages/ai-mistral/package.json | 2 +- packages/ai-ollama/CHANGELOG.md | 7 +++ packages/ai-ollama/package.json | 2 +- packages/ai-openai/CHANGELOG.md | 20 +++++++ packages/ai-openai/package.json | 2 +- packages/ai-opencode/CHANGELOG.md | 8 +++ packages/ai-opencode/package.json | 2 +- packages/ai-openrouter/CHANGELOG.md | 23 ++++++++ packages/ai-openrouter/package.json | 2 +- packages/ai-perplexity/CHANGELOG.md | 7 +++ packages/ai-perplexity/package.json | 2 +- packages/ai-persistence/CHANGELOG.md | 11 ++++ packages/ai-persistence/package.json | 2 +- packages/ai-preact/CHANGELOG.md | 10 ++++ packages/ai-preact/package.json | 2 +- packages/ai-react-ui/CHANGELOG.md | 8 +++ packages/ai-react-ui/package.json | 2 +- packages/ai-react/CHANGELOG.md | 50 ++++++++++++++++ packages/ai-react/package.json | 2 +- packages/ai-sandbox-cloudflare/CHANGELOG.md | 9 +++ packages/ai-sandbox-cloudflare/package.json | 2 +- .../ai-sandbox-local-process/CHANGELOG.md | 9 +++ .../ai-sandbox-local-process/package.json | 2 +- packages/ai-sandbox-vercel/CHANGELOG.md | 9 +++ packages/ai-sandbox-vercel/package.json | 2 +- packages/ai-sandbox/CHANGELOG.md | 7 +++ packages/ai-sandbox/package.json | 2 +- packages/ai-solid-ui/CHANGELOG.md | 8 +++ packages/ai-solid-ui/package.json | 2 +- packages/ai-solid/CHANGELOG.md | 50 ++++++++++++++++ packages/ai-solid/package.json | 2 +- packages/ai-svelte/CHANGELOG.md | 50 ++++++++++++++++ packages/ai-svelte/package.json | 2 +- packages/ai-vercel-gateway/CHANGELOG.md | 8 +++ packages/ai-vercel-gateway/package.json | 2 +- packages/ai-vue-ui/CHANGELOG.md | 7 +++ packages/ai-vue-ui/package.json | 2 +- packages/ai-vue/CHANGELOG.md | 50 ++++++++++++++++ packages/ai-vue/package.json | 2 +- packages/ai/CHANGELOG.md | 59 +++++++++++++++++++ packages/ai/package.json | 2 +- packages/openai-base/CHANGELOG.md | 15 +++++ packages/openai-base/package.json | 2 +- 98 files changed, 785 insertions(+), 156 deletions(-) delete mode 100644 .changeset/billed-usage-unit.md delete mode 100644 .changeset/fix-local-process-wait.md delete mode 100644 .changeset/openrouter-combined-tools-and-schema.md delete mode 100644 .changeset/preserve-server-reasoning.md delete mode 100644 .changeset/ssr-thread-identity.md delete mode 100644 .changeset/tidy-searches-coexist.md delete mode 100644 .changeset/vercel-sandbox-user-agent.md delete mode 100644 .changeset/websocket-transport.md diff --git a/.changeset/billed-usage-unit.md b/.changeset/billed-usage-unit.md deleted file mode 100644 index f213423187..0000000000 --- a/.changeset/billed-usage-unit.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -'@tanstack/ai-event-client': minor -'@tanstack/ai': minor -'@tanstack/ai-fal': minor -'@tanstack/ai-grok': minor -'@tanstack/ai-openai': minor -'@tanstack/ai-byteplus': minor -'@tanstack/ai-cohere': minor -'@tanstack/ai-openrouter': minor -'@tanstack/ai-persistence': minor ---- - -Add a self-describing `billed` field to `TokenUsage` so billed quantities carry the unit they are counted in (#816). `usage.billed` is `{ quantity, unit }` with a `BillingUnit` union (`'seconds'`, `'units'`, `'images'`, `'tokens'`, ... open-ended). The deprecated `unitsBilled` / `durationSeconds` counts are still populated for backward compatibility. The fal adapters report `{ quantity, unit: 'units' }`, Grok video `{ quantity, unit: 'seconds' }`, the OpenAI/Grok/BytePlus duration-billed transcription paths `{ quantity, unit: 'seconds' }`, BytePlus Seedream images `{ quantity, unit: 'images' }`, BytePlus Seedance video `{ quantity, unit: 'tokens' }`, and Cohere/OpenRouter rerank `{ quantity, unit: 'units' }` (search units). Persistence sums `billed` when both reports use the same unit. `otelMiddleware` emits the pair as `tanstack.ai.usage.billed_quantity` / `tanstack.ai.usage.billed_unit` span attributes. diff --git a/.changeset/fix-local-process-wait.md b/.changeset/fix-local-process-wait.md deleted file mode 100644 index 4c2bfec80c..0000000000 --- a/.changeset/fix-local-process-wait.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/ai-sandbox-local-process': patch ---- - -Fix local-process spawn handles hanging when the child exits before `wait()` is called. diff --git a/.changeset/openrouter-combined-tools-and-schema.md b/.changeset/openrouter-combined-tools-and-schema.md deleted file mode 100644 index 953df9f5fc..0000000000 --- a/.changeset/openrouter-combined-tools-and-schema.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@tanstack/ai-openrouter': minor ---- - -Add native combined tools + `outputSchema` mode to both OpenRouter text adapters (chat-completions and Responses). When the resolved upstream model supports emitting a schema-constrained final answer alongside tool calls in a single pass, `chat({ outputSchema, tools, stream: true })` now wires the JSON Schema into the same streaming request as the tools and harvests the final-turn JSON, skipping the separate finalization round-trip. - -Because OpenRouter is a routing layer, capability is keyed per resolved upstream model via the new `OPENROUTER_COMBINED_TOOLS_AND_SCHEMA_MODELS` set, exported from `@tanstack/ai-openrouter/model-meta`, which both adapters consult from `supportsCombinedToolsAndSchema()`. The set is derived from each upstream provider's combined-mode gate (Anthropic 4.5+, Gemini 3.x, OpenAI's strict `json_schema` era, Grok 4.x) rather than the broader catalog `responseFormat` flag, so models that advertise structured output but predate native combined mode stay on the legacy finalization path. diff --git a/.changeset/preserve-server-reasoning.md b/.changeset/preserve-server-reasoning.md deleted file mode 100644 index a99b247723..0000000000 --- a/.changeset/preserve-server-reasoning.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/ai': patch ---- - -Preserve reasoning in server chat message history and interrupt snapshots. diff --git a/.changeset/ssr-thread-identity.md b/.changeset/ssr-thread-identity.md deleted file mode 100644 index 26dedc740c..0000000000 --- a/.changeset/ssr-thread-identity.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'@tanstack/ai-client': patch -'@tanstack/ai-react': patch -'@tanstack/ai-preact': patch -'@tanstack/ai-vue': patch -'@tanstack/ai-solid': patch -'@tanstack/ai-svelte': patch -'@tanstack/ai-angular': patch ---- - -Mint omitted `threadId` after the view mounts, not during render. DevTools binds the hook row to `threadId`. Persistence that is on (`true` or a storage adapter) requires a `threadId` at compile time, and throws at runtime if it is missing. Chat and generation clients no longer accept a separate `id` option. Use `threadId`. diff --git a/.changeset/tidy-searches-coexist.md b/.changeset/tidy-searches-coexist.md deleted file mode 100644 index 799f667a38..0000000000 --- a/.changeset/tidy-searches-coexist.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -'@tanstack/ai': patch -'@tanstack/ai-anthropic': patch -'@tanstack/ai-gemini': patch -'@tanstack/ai-grok': patch -'@tanstack/ai-memory': patch -'@tanstack/ai-openai': patch -'@tanstack/ai-openrouter': patch -'@tanstack/openai-base': patch ---- - -Classify Anthropic, Gemini, and OpenAI native tools with stable runtime discriminators so ordinary functions can use the same public names without selecting provider-native behavior. Native tools must come from the adapter factory (`webSearchTool()`, `googleSearchTool()`, and the rest). A reserved `name` alone does not select a native converter. `chat()` throws `DuplicateToolNameError` when a factory tool and a custom function share the same public name. - -Previously the converters picked provider-native behavior by `tool.name`. Tool names are public application identifiers, so a plain function called `web_search`, `google_search`, or `code_execution` was routed into a native converter: it lost its `inputSchema` and was sent as a provider-only payload (and on Anthropic could also flip on `code_execution` / skills beta headers). Native tools are now identified by adapter-owned metadata, which converters strip before building the wire payload, so provider API versions stay confined to the wire converters. - -Also preserves Anthropic `webSearchTool` options (`max_uses`, `allowed_domains`, `blocked_domains`, `user_location`, `cache_control`) on the wire payload. - -Also fixes `googleSearchTool({ searchTypes: … })` being silently dropped on the experimental `geminiTextInteractions()` adapter. The Interactions converter read a snake_case `search_types` array, but the public factory takes the Generate Content shape (`GoogleSearch.searchTypes: { webSearch?, imageSearch? }`), so the field never matched and every request fell back to the provider default of web-search-only. The camelCase config is now translated to the Interactions wire list. diff --git a/.changeset/vercel-sandbox-user-agent.md b/.changeset/vercel-sandbox-user-agent.md deleted file mode 100644 index 1af7df9b15..0000000000 --- a/.changeset/vercel-sandbox-user-agent.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/ai-sandbox-vercel': patch ---- - -Vercel sandbox requests now append a `@tanstack/ai` token to the `user-agent`. diff --git a/.changeset/websocket-transport.md b/.changeset/websocket-transport.md deleted file mode 100644 index ed3cc5cbb4..0000000000 --- a/.changeset/websocket-transport.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -'@tanstack/ai': minor -'@tanstack/ai-client': minor -'@tanstack/ai-react': minor -'@tanstack/ai-solid': minor -'@tanstack/ai-vue': minor -'@tanstack/ai-svelte': minor -'@tanstack/ai-angular': minor ---- - -WebSocket transport: a full-duplex, resumable third transport alongside SSE and -NDJSON, reusing the same delivery-durability seam. - -On the server, `@tanstack/ai` adds `toWebSocketStream(socket, request, { onRun, -durability, batch, heartbeatMs, idleTimeoutMs, debug })` — a portable core that -pumps a conversation over an already-accepted WHATWG `WebSocketLike` server -socket (Node via `ws`, Bun, etc.), and `toWebSocketResponse(request, { onRun, -… })`, a thin wrapper that upgrades via `WebSocketPair` and returns a 101 -`Response` on Cloudflare Workers/Durable Objects (it throws elsewhere, pointing -you at `toWebSocketStream`). Because one socket outlives many `chat()` turns -(client-tool resubmits, follow-up user messages), you pass an `onRun(ctx) => -AsyncIterable` factory instead of a prebuilt stream — the helper -calls it per inbound `RunAgentInput` frame. The socket is conversation-scoped: -it stays open across turns and closes on client close or the idle timeout -(which never fires while a turn is still streaming), with a periodic -`{ type: 'ping' }` heartbeat. An `{ type: 'abort', runId }` control frame -aborts only that turn, leaving the socket open. A turn that fails is surfaced -to the client as a live `RUN_ERROR` frame, mirroring the HTTP transports. Durability is keyed per turn and reuses -the existing `durableStreamSource`, so server→client frames carry the same -`{ id, chunk }` envelope as NDJSON. `resumeWebSocketStream(socket, { adapter })` -and `resumeWebSocketResponse({ adapter })` replay a run read-only from the -durability log (no model call). - -On the client, `webSocket(url, options)` (in `@tanstack/ai-client`, re-exported -from `@tanstack/ai-react`, `-solid`, `-vue`, `-svelte`, and `-angular`) is a -full-duplex `subscribe` + `send` connection adapter for `useChat`. `send()` -writes a `RunAgentInput` frame; `subscribe()` yields inbound chunks, ignores -heartbeats, unwraps durable envelopes, and auto-reconnects a dropped durable run -by reopening with `?runId=&offset=` (browsers can't set a `Last-Event-ID` -handshake header, so the offset rides in the URL). The reconnect bookkeeping -(offset de-dupe, no-progress ceiling → `StreamReconnectLimitError`) is shared -with the HTTP adapters via the new `createReconnectTracker`, and a fatal drop -surfaces to the consumer (`StreamReadError` / `StreamReconnectLimitError`) -instead of hanging. Aborting a run (`stop()` in `useChat`) sends the -`{ type: 'abort', runId }` frame so the server cancels the turn instead of -generating to completion, and `joinRun()` opens its own replay socket so a -rejoin never collides with the live conversation socket. diff --git a/examples/ag-ui/CHANGELOG.md b/examples/ag-ui/CHANGELOG.md index 5df00d28dc..328f421673 100644 --- a/examples/ag-ui/CHANGELOG.md +++ b/examples/ag-ui/CHANGELOG.md @@ -1,5 +1,14 @@ # ag-ui +## 0.0.7 + +### Patch Changes + +- Updated dependencies [[`f6b9d89`](https://github.com/TanStack/ai/commit/f6b9d89e7365f0cb30a41cf3a46b7dd237fbc73c), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai-client@0.24.0 + - @tanstack/ai-react@0.20.0 + - @tanstack/ai-react-ui@0.8.17 + ## 0.0.6 ### Patch Changes diff --git a/examples/ag-ui/package.json b/examples/ag-ui/package.json index c45ecca65f..7ad01211e8 100644 --- a/examples/ag-ui/package.json +++ b/examples/ag-ui/package.json @@ -2,7 +2,7 @@ "name": "ag-ui", "private": true, "type": "module", - "version": "0.0.6", + "version": "0.0.7", "scripts": { "detect-servers": "node scripts/detect-servers.mjs", "predev": "node scripts/detect-servers.mjs", diff --git a/packages/ai-acp/CHANGELOG.md b/packages/ai-acp/CHANGELOG.md index 5f68374d6c..ed35dcaf50 100644 --- a/packages/ai-acp/CHANGELOG.md +++ b/packages/ai-acp/CHANGELOG.md @@ -1,5 +1,13 @@ # @tanstack/ai-acp +## 0.3.1 + +### Patch Changes + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + - @tanstack/ai-sandbox@0.3.4 + ## 0.3.0 ### Minor Changes diff --git a/packages/ai-acp/package.json b/packages/ai-acp/package.json index 7c1833d01a..9da225b754 100644 --- a/packages/ai-acp/package.json +++ b/packages/ai-acp/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-acp", - "version": "0.3.0", + "version": "0.3.1", "description": "Shared Agent Client Protocol (ACP) transport, session, and AG-UI translation for TanStack AI harness adapters.", "author": "", "license": "MIT", diff --git a/packages/ai-angular/CHANGELOG.md b/packages/ai-angular/CHANGELOG.md index 39e2958c14..fa42885841 100644 --- a/packages/ai-angular/CHANGELOG.md +++ b/packages/ai-angular/CHANGELOG.md @@ -1,5 +1,55 @@ # @tanstack/ai-angular +## 0.5.0 + +### Minor Changes + +- [#969](https://github.com/TanStack/ai/pull/969) [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd) - WebSocket transport: a full-duplex, resumable third transport alongside SSE and + NDJSON, reusing the same delivery-durability seam. + + On the server, `@tanstack/ai` adds `toWebSocketStream(socket, request, { onRun, +durability, batch, heartbeatMs, idleTimeoutMs, debug })` — a portable core that + pumps a conversation over an already-accepted WHATWG `WebSocketLike` server + socket (Node via `ws`, Bun, etc.), and `toWebSocketResponse(request, { onRun, +… })`, a thin wrapper that upgrades via `WebSocketPair` and returns a 101 + `Response` on Cloudflare Workers/Durable Objects (it throws elsewhere, pointing + you at `toWebSocketStream`). Because one socket outlives many `chat()` turns + (client-tool resubmits, follow-up user messages), you pass an `onRun(ctx) => +AsyncIterable` factory instead of a prebuilt stream — the helper + calls it per inbound `RunAgentInput` frame. The socket is conversation-scoped: + it stays open across turns and closes on client close or the idle timeout + (which never fires while a turn is still streaming), with a periodic + `{ type: 'ping' }` heartbeat. An `{ type: 'abort', runId }` control frame + aborts only that turn, leaving the socket open. A turn that fails is surfaced + to the client as a live `RUN_ERROR` frame, mirroring the HTTP transports. Durability is keyed per turn and reuses + the existing `durableStreamSource`, so server→client frames carry the same + `{ id, chunk }` envelope as NDJSON. `resumeWebSocketStream(socket, { adapter })` + and `resumeWebSocketResponse({ adapter })` replay a run read-only from the + durability log (no model call). + + On the client, `webSocket(url, options)` (in `@tanstack/ai-client`, re-exported + from `@tanstack/ai-react`, `-solid`, `-vue`, `-svelte`, and `-angular`) is a + full-duplex `subscribe` + `send` connection adapter for `useChat`. `send()` + writes a `RunAgentInput` frame; `subscribe()` yields inbound chunks, ignores + heartbeats, unwraps durable envelopes, and auto-reconnects a dropped durable run + by reopening with `?runId=&offset=` (browsers can't set a `Last-Event-ID` + handshake header, so the offset rides in the URL). The reconnect bookkeeping + (offset de-dupe, no-progress ceiling → `StreamReconnectLimitError`) is shared + with the HTTP adapters via the new `createReconnectTracker`, and a fatal drop + surfaces to the consumer (`StreamReadError` / `StreamReconnectLimitError`) + instead of hanging. Aborting a run (`stop()` in `useChat`) sends the + `{ type: 'abort', runId }` frame so the server cancels the turn instead of + generating to completion, and `joinRun()` opens its own replay socket so a + rejoin never collides with the live conversation socket. + +### Patch Changes + +- [#1154](https://github.com/TanStack/ai/pull/1154) [`f6b9d89`](https://github.com/TanStack/ai/commit/f6b9d89e7365f0cb30a41cf3a46b7dd237fbc73c) - Mint omitted `threadId` after the view mounts, not during render. DevTools binds the hook row to `threadId`. Persistence that is on (`true` or a storage adapter) requires a `threadId` at compile time, and throws at runtime if it is missing. Chat and generation clients no longer accept a separate `id` option. Use `threadId`. + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`f6b9d89`](https://github.com/TanStack/ai/commit/f6b9d89e7365f0cb30a41cf3a46b7dd237fbc73c), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + - @tanstack/ai-client@0.24.0 + ## 0.4.3 ### Patch Changes diff --git a/packages/ai-angular/package.json b/packages/ai-angular/package.json index ae3a5b4fa0..0ae199a25c 100644 --- a/packages/ai-angular/package.json +++ b/packages/ai-angular/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-angular", - "version": "0.4.3", + "version": "0.5.0", "description": "Angular signals integration for TanStack AI streaming chat, structured outputs, and media generation.", "author": "", "license": "MIT", diff --git a/packages/ai-anthropic/CHANGELOG.md b/packages/ai-anthropic/CHANGELOG.md index d708d12a40..bcabe3e8ea 100644 --- a/packages/ai-anthropic/CHANGELOG.md +++ b/packages/ai-anthropic/CHANGELOG.md @@ -1,5 +1,20 @@ # @tanstack/ai-anthropic +## 0.16.7 + +### Patch Changes + +- [#932](https://github.com/TanStack/ai/pull/932) [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b) - Classify Anthropic, Gemini, and OpenAI native tools with stable runtime discriminators so ordinary functions can use the same public names without selecting provider-native behavior. Native tools must come from the adapter factory (`webSearchTool()`, `googleSearchTool()`, and the rest). A reserved `name` alone does not select a native converter. `chat()` throws `DuplicateToolNameError` when a factory tool and a custom function share the same public name. + + Previously the converters picked provider-native behavior by `tool.name`. Tool names are public application identifiers, so a plain function called `web_search`, `google_search`, or `code_execution` was routed into a native converter: it lost its `inputSchema` and was sent as a provider-only payload (and on Anthropic could also flip on `code_execution` / skills beta headers). Native tools are now identified by adapter-owned metadata, which converters strip before building the wire payload, so provider API versions stay confined to the wire converters. + + Also preserves Anthropic `webSearchTool` options (`max_uses`, `allowed_domains`, `blocked_domains`, `user_location`, `cache_control`) on the wire payload. + + Also fixes `googleSearchTool({ searchTypes: … })` being silently dropped on the experimental `geminiTextInteractions()` adapter. The Interactions converter read a snake_case `search_types` array, but the public factory takes the Generate Content shape (`GoogleSearch.searchTypes: { webSearch?, imageSearch? }`), so the field never matched and every request fell back to the provider default of web-search-only. The camelCase config is now translated to the Interactions wire list. + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + ## 0.16.6 ### Patch Changes diff --git a/packages/ai-anthropic/package.json b/packages/ai-anthropic/package.json index 9c460c8ead..84a66285aa 100644 --- a/packages/ai-anthropic/package.json +++ b/packages/ai-anthropic/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-anthropic", - "version": "0.16.6", + "version": "0.16.7", "description": "Anthropic Claude adapter for TanStack AI chat, tool calling, thinking, and structured outputs.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-bedrock/CHANGELOG.md b/packages/ai-bedrock/CHANGELOG.md index ca35178f4e..01823e2e04 100644 --- a/packages/ai-bedrock/CHANGELOG.md +++ b/packages/ai-bedrock/CHANGELOG.md @@ -1,5 +1,13 @@ # @tanstack/ai-bedrock +## 0.2.3 + +### Patch Changes + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + - @tanstack/openai-base@0.9.15 + ## 0.2.2 ### Patch Changes diff --git a/packages/ai-bedrock/package.json b/packages/ai-bedrock/package.json index 973b75e5fc..ad929a5571 100644 --- a/packages/ai-bedrock/package.json +++ b/packages/ai-bedrock/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-bedrock", - "version": "0.2.2", + "version": "0.2.3", "type": "module", "description": "Amazon Bedrock adapter for TanStack AI — OpenAI-compatible chat, responses, tools, and reasoning.", "author": "", diff --git a/packages/ai-byteplus/CHANGELOG.md b/packages/ai-byteplus/CHANGELOG.md index 9d6653f793..a979a30c00 100644 --- a/packages/ai-byteplus/CHANGELOG.md +++ b/packages/ai-byteplus/CHANGELOG.md @@ -1,5 +1,17 @@ # @tanstack/ai-byteplus +## 0.2.0 + +### Minor Changes + +- [#896](https://github.com/TanStack/ai/pull/896) [`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b) - Add a self-describing `billed` field to `TokenUsage` so billed quantities carry the unit they are counted in ([#816](https://github.com/TanStack/ai/issues/816)). `usage.billed` is `{ quantity, unit }` with a `BillingUnit` union (`'seconds'`, `'units'`, `'images'`, `'tokens'`, ... open-ended). The deprecated `unitsBilled` / `durationSeconds` counts are still populated for backward compatibility. The fal adapters report `{ quantity, unit: 'units' }`, Grok video `{ quantity, unit: 'seconds' }`, the OpenAI/Grok/BytePlus duration-billed transcription paths `{ quantity, unit: 'seconds' }`, BytePlus Seedream images `{ quantity, unit: 'images' }`, BytePlus Seedance video `{ quantity, unit: 'tokens' }`, and Cohere/OpenRouter rerank `{ quantity, unit: 'units' }` (search units). Persistence sums `billed` when both reports use the same unit. `otelMiddleware` emits the pair as `tanstack.ai.usage.billed_quantity` / `tanstack.ai.usage.billed_unit` span attributes. + +### Patch Changes + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + - @tanstack/openai-base@0.9.15 + ## 0.1.3 ### Patch Changes diff --git a/packages/ai-byteplus/package.json b/packages/ai-byteplus/package.json index f9e6a54a1f..185f23a728 100644 --- a/packages/ai-byteplus/package.json +++ b/packages/ai-byteplus/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-byteplus", - "version": "0.1.3", + "version": "0.2.0", "description": "BytePlus ModelArk adapter for TanStack AI: Seed LLM chat, Seedance video, Seedream image, and Seed Speech TTS/ASR.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-claude-code/CHANGELOG.md b/packages/ai-claude-code/CHANGELOG.md index 6f54431ef3..39467e1a66 100644 --- a/packages/ai-claude-code/CHANGELOG.md +++ b/packages/ai-claude-code/CHANGELOG.md @@ -1,5 +1,13 @@ # @tanstack/ai-claude-code +## 0.4.1 + +### Patch Changes + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + - @tanstack/ai-sandbox@0.3.4 + ## 0.4.0 ### Minor Changes diff --git a/packages/ai-claude-code/package.json b/packages/ai-claude-code/package.json index 9aa98fbee3..feed08af85 100644 --- a/packages/ai-claude-code/package.json +++ b/packages/ai-claude-code/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-claude-code", - "version": "0.4.0", + "version": "0.4.1", "description": "Claude Code harness adapter for TanStack AI — run Claude Code as a chat backend with local tool execution and stateful sessions.", "author": "", "license": "MIT", diff --git a/packages/ai-client/CHANGELOG.md b/packages/ai-client/CHANGELOG.md index 77a3e475d5..19ecd72881 100644 --- a/packages/ai-client/CHANGELOG.md +++ b/packages/ai-client/CHANGELOG.md @@ -1,5 +1,55 @@ # @tanstack/ai-client +## 0.24.0 + +### Minor Changes + +- [#969](https://github.com/TanStack/ai/pull/969) [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd) - WebSocket transport: a full-duplex, resumable third transport alongside SSE and + NDJSON, reusing the same delivery-durability seam. + + On the server, `@tanstack/ai` adds `toWebSocketStream(socket, request, { onRun, +durability, batch, heartbeatMs, idleTimeoutMs, debug })` — a portable core that + pumps a conversation over an already-accepted WHATWG `WebSocketLike` server + socket (Node via `ws`, Bun, etc.), and `toWebSocketResponse(request, { onRun, +… })`, a thin wrapper that upgrades via `WebSocketPair` and returns a 101 + `Response` on Cloudflare Workers/Durable Objects (it throws elsewhere, pointing + you at `toWebSocketStream`). Because one socket outlives many `chat()` turns + (client-tool resubmits, follow-up user messages), you pass an `onRun(ctx) => +AsyncIterable` factory instead of a prebuilt stream — the helper + calls it per inbound `RunAgentInput` frame. The socket is conversation-scoped: + it stays open across turns and closes on client close or the idle timeout + (which never fires while a turn is still streaming), with a periodic + `{ type: 'ping' }` heartbeat. An `{ type: 'abort', runId }` control frame + aborts only that turn, leaving the socket open. A turn that fails is surfaced + to the client as a live `RUN_ERROR` frame, mirroring the HTTP transports. Durability is keyed per turn and reuses + the existing `durableStreamSource`, so server→client frames carry the same + `{ id, chunk }` envelope as NDJSON. `resumeWebSocketStream(socket, { adapter })` + and `resumeWebSocketResponse({ adapter })` replay a run read-only from the + durability log (no model call). + + On the client, `webSocket(url, options)` (in `@tanstack/ai-client`, re-exported + from `@tanstack/ai-react`, `-solid`, `-vue`, `-svelte`, and `-angular`) is a + full-duplex `subscribe` + `send` connection adapter for `useChat`. `send()` + writes a `RunAgentInput` frame; `subscribe()` yields inbound chunks, ignores + heartbeats, unwraps durable envelopes, and auto-reconnects a dropped durable run + by reopening with `?runId=&offset=` (browsers can't set a `Last-Event-ID` + handshake header, so the offset rides in the URL). The reconnect bookkeeping + (offset de-dupe, no-progress ceiling → `StreamReconnectLimitError`) is shared + with the HTTP adapters via the new `createReconnectTracker`, and a fatal drop + surfaces to the consumer (`StreamReadError` / `StreamReconnectLimitError`) + instead of hanging. Aborting a run (`stop()` in `useChat`) sends the + `{ type: 'abort', runId }` frame so the server cancels the turn instead of + generating to completion, and `joinRun()` opens its own replay socket so a + rejoin never collides with the live conversation socket. + +### Patch Changes + +- [#1154](https://github.com/TanStack/ai/pull/1154) [`f6b9d89`](https://github.com/TanStack/ai/commit/f6b9d89e7365f0cb30a41cf3a46b7dd237fbc73c) - Mint omitted `threadId` after the view mounts, not during render. DevTools binds the hook row to `threadId`. Persistence that is on (`true` or a storage adapter) requires a `threadId` at compile time, and throws at runtime if it is missing. Chat and generation clients no longer accept a separate `id` option. Use `threadId`. + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai-event-client@0.9.0 + - @tanstack/ai@0.46.0 + ## 0.23.3 ### Patch Changes diff --git a/packages/ai-client/package.json b/packages/ai-client/package.json index b20efe15a1..81acd14276 100644 --- a/packages/ai-client/package.json +++ b/packages/ai-client/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-client", - "version": "0.23.3", + "version": "0.24.0", "description": "Framework-agnostic headless client for TanStack AI chat, realtime sessions, streaming transports, and media generations.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-code-mode-snippets/CHANGELOG.md b/packages/ai-code-mode-snippets/CHANGELOG.md index fa63ad0578..78fb24265e 100644 --- a/packages/ai-code-mode-snippets/CHANGELOG.md +++ b/packages/ai-code-mode-snippets/CHANGELOG.md @@ -1,5 +1,13 @@ # @tanstack/ai-code-mode-snippets +## 0.4.1 + +### Patch Changes + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + - @tanstack/ai-code-mode@0.4.1 + ## 0.4.0 ### Minor Changes diff --git a/packages/ai-code-mode-snippets/package.json b/packages/ai-code-mode-snippets/package.json index db5f3806f9..7271539545 100644 --- a/packages/ai-code-mode-snippets/package.json +++ b/packages/ai-code-mode-snippets/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-code-mode-snippets", - "version": "0.4.0", + "version": "0.4.1", "description": "Persistent runtime snippet library for TanStack AI Code Mode agents and sandboxed tool orchestration.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-code-mode/CHANGELOG.md b/packages/ai-code-mode/CHANGELOG.md index 0c8d2a82e5..29aad2ac4e 100644 --- a/packages/ai-code-mode/CHANGELOG.md +++ b/packages/ai-code-mode/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/ai-code-mode +## 0.4.1 + +### Patch Changes + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + ## 0.4.0 ### Minor Changes diff --git a/packages/ai-code-mode/package.json b/packages/ai-code-mode/package.json index 67cdd450c2..ca4572c8dd 100644 --- a/packages/ai-code-mode/package.json +++ b/packages/ai-code-mode/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-code-mode", - "version": "0.4.0", + "version": "0.4.1", "description": "Secure TypeScript Code Mode for TanStack AI agents to execute sandboxed tool orchestration programs.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-codex/CHANGELOG.md b/packages/ai-codex/CHANGELOG.md index 5e41f05f78..f2b941a6e8 100644 --- a/packages/ai-codex/CHANGELOG.md +++ b/packages/ai-codex/CHANGELOG.md @@ -1,5 +1,13 @@ # @tanstack/ai-codex +## 0.4.1 + +### Patch Changes + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + - @tanstack/ai-sandbox@0.3.4 + ## 0.4.0 ### Minor Changes diff --git a/packages/ai-codex/package.json b/packages/ai-codex/package.json index 439e78de95..ac07eccb11 100644 --- a/packages/ai-codex/package.json +++ b/packages/ai-codex/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-codex", - "version": "0.4.0", + "version": "0.4.1", "description": "Codex harness adapter for TanStack AI — run OpenAI Codex as a chat backend with local tool execution and stateful sessions.", "author": "", "license": "MIT", diff --git a/packages/ai-cohere/CHANGELOG.md b/packages/ai-cohere/CHANGELOG.md index 286ed9bdd4..b29eb9ae51 100644 --- a/packages/ai-cohere/CHANGELOG.md +++ b/packages/ai-cohere/CHANGELOG.md @@ -1,5 +1,16 @@ # @tanstack/ai-cohere +## 0.2.0 + +### Minor Changes + +- [#896](https://github.com/TanStack/ai/pull/896) [`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b) - Add a self-describing `billed` field to `TokenUsage` so billed quantities carry the unit they are counted in ([#816](https://github.com/TanStack/ai/issues/816)). `usage.billed` is `{ quantity, unit }` with a `BillingUnit` union (`'seconds'`, `'units'`, `'images'`, `'tokens'`, ... open-ended). The deprecated `unitsBilled` / `durationSeconds` counts are still populated for backward compatibility. The fal adapters report `{ quantity, unit: 'units' }`, Grok video `{ quantity, unit: 'seconds' }`, the OpenAI/Grok/BytePlus duration-billed transcription paths `{ quantity, unit: 'seconds' }`, BytePlus Seedream images `{ quantity, unit: 'images' }`, BytePlus Seedance video `{ quantity, unit: 'tokens' }`, and Cohere/OpenRouter rerank `{ quantity, unit: 'units' }` (search units). Persistence sums `billed` when both reports use the same unit. `otelMiddleware` emits the pair as `tanstack.ai.usage.billed_quantity` / `tanstack.ai.usage.billed_unit` span attributes. + +### Patch Changes + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + ## 0.1.1 ### Patch Changes diff --git a/packages/ai-cohere/package.json b/packages/ai-cohere/package.json index d888e9f1a3..d8940be28f 100644 --- a/packages/ai-cohere/package.json +++ b/packages/ai-cohere/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-cohere", - "version": "0.1.1", + "version": "0.2.0", "description": "Cohere adapter for TanStack AI — multimodal embeddings and document reranking.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-devtools/CHANGELOG.md b/packages/ai-devtools/CHANGELOG.md index 80d36359a9..121eac2802 100644 --- a/packages/ai-devtools/CHANGELOG.md +++ b/packages/ai-devtools/CHANGELOG.md @@ -1,5 +1,13 @@ # @tanstack/ai-devtools-core +## 0.5.4 + +### Patch Changes + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai-event-client@0.9.0 + - @tanstack/ai@0.46.0 + ## 0.5.3 ### Patch Changes diff --git a/packages/ai-devtools/package.json b/packages/ai-devtools/package.json index af598f8a32..87760494c4 100644 --- a/packages/ai-devtools/package.json +++ b/packages/ai-devtools/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-devtools-core", - "version": "0.5.3", + "version": "0.5.4", "description": "Core TanStack AI Devtools plugin for inspecting chat messages, tool calls, streams, and errors.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-durable-stream/CHANGELOG.md b/packages/ai-durable-stream/CHANGELOG.md index 173db60177..f3e4f990fe 100644 --- a/packages/ai-durable-stream/CHANGELOG.md +++ b/packages/ai-durable-stream/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/ai-durable-stream +## 0.1.3 + +### Patch Changes + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + ## 0.1.2 ### Patch Changes diff --git a/packages/ai-durable-stream/package.json b/packages/ai-durable-stream/package.json index 43c8e395e6..69f2161b84 100644 --- a/packages/ai-durable-stream/package.json +++ b/packages/ai-durable-stream/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-durable-stream", - "version": "0.1.2", + "version": "0.1.3", "description": "Delivery durability for TanStack AI over the durable-streams HTTP protocol — a resumable StreamDurability transport sink (append/read/resume) that stores zero delivery events itself.", "author": "", "license": "MIT", diff --git a/packages/ai-elevenlabs/CHANGELOG.md b/packages/ai-elevenlabs/CHANGELOG.md index e2511deff3..80fa64803d 100644 --- a/packages/ai-elevenlabs/CHANGELOG.md +++ b/packages/ai-elevenlabs/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/ai-elevenlabs +## 0.2.38 + +### Patch Changes + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + ## 0.2.37 ### Patch Changes diff --git a/packages/ai-elevenlabs/package.json b/packages/ai-elevenlabs/package.json index d7b36d256b..437447b9e1 100644 --- a/packages/ai-elevenlabs/package.json +++ b/packages/ai-elevenlabs/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-elevenlabs", - "version": "0.2.37", + "version": "0.2.38", "description": "ElevenLabs adapter for TanStack AI realtime voice, text-to-speech, transcription, music, and sound effects.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-event-client/CHANGELOG.md b/packages/ai-event-client/CHANGELOG.md index 4b2a994187..b20116b890 100644 --- a/packages/ai-event-client/CHANGELOG.md +++ b/packages/ai-event-client/CHANGELOG.md @@ -1,5 +1,11 @@ # @tanstack/ai-event-client +## 0.9.0 + +### Minor Changes + +- [#896](https://github.com/TanStack/ai/pull/896) [`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b) - Add a self-describing `billed` field to `TokenUsage` so billed quantities carry the unit they are counted in ([#816](https://github.com/TanStack/ai/issues/816)). `usage.billed` is `{ quantity, unit }` with a `BillingUnit` union (`'seconds'`, `'units'`, `'images'`, `'tokens'`, ... open-ended). The deprecated `unitsBilled` / `durationSeconds` counts are still populated for backward compatibility. The fal adapters report `{ quantity, unit: 'units' }`, Grok video `{ quantity, unit: 'seconds' }`, the OpenAI/Grok/BytePlus duration-billed transcription paths `{ quantity, unit: 'seconds' }`, BytePlus Seedream images `{ quantity, unit: 'images' }`, BytePlus Seedance video `{ quantity, unit: 'tokens' }`, and Cohere/OpenRouter rerank `{ quantity, unit: 'units' }` (search units). Persistence sums `billed` when both reports use the same unit. `otelMiddleware` emits the pair as `tanstack.ai.usage.billed_quantity` / `tanstack.ai.usage.billed_unit` span attributes. + ## 0.8.0 ### Minor Changes diff --git a/packages/ai-event-client/package.json b/packages/ai-event-client/package.json index d17c18dd6f..ae1c70b01c 100644 --- a/packages/ai-event-client/package.json +++ b/packages/ai-event-client/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-event-client", - "version": "0.8.0", + "version": "0.9.0", "description": "Typed event client for TanStack AI devtools, observability, and streamed runtime events.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-fal/CHANGELOG.md b/packages/ai-fal/CHANGELOG.md index b9f4ca9d5b..fa23689836 100644 --- a/packages/ai-fal/CHANGELOG.md +++ b/packages/ai-fal/CHANGELOG.md @@ -1,5 +1,16 @@ # @tanstack/ai-fal +## 0.11.0 + +### Minor Changes + +- [#896](https://github.com/TanStack/ai/pull/896) [`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b) - Add a self-describing `billed` field to `TokenUsage` so billed quantities carry the unit they are counted in ([#816](https://github.com/TanStack/ai/issues/816)). `usage.billed` is `{ quantity, unit }` with a `BillingUnit` union (`'seconds'`, `'units'`, `'images'`, `'tokens'`, ... open-ended). The deprecated `unitsBilled` / `durationSeconds` counts are still populated for backward compatibility. The fal adapters report `{ quantity, unit: 'units' }`, Grok video `{ quantity, unit: 'seconds' }`, the OpenAI/Grok/BytePlus duration-billed transcription paths `{ quantity, unit: 'seconds' }`, BytePlus Seedream images `{ quantity, unit: 'images' }`, BytePlus Seedance video `{ quantity, unit: 'tokens' }`, and Cohere/OpenRouter rerank `{ quantity, unit: 'units' }` (search units). Persistence sums `billed` when both reports use the same unit. `otelMiddleware` emits the pair as `tanstack.ai.usage.billed_quantity` / `tanstack.ai.usage.billed_unit` span attributes. + +### Patch Changes + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + ## 0.10.1 ### Patch Changes diff --git a/packages/ai-fal/package.json b/packages/ai-fal/package.json index e2abc6d7b2..7e9bd7413d 100644 --- a/packages/ai-fal/package.json +++ b/packages/ai-fal/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-fal", - "version": "0.10.1", + "version": "0.11.0", "description": "fal.ai adapter for TanStack AI image, video, audio, speech, and transcription generation.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-gemini/CHANGELOG.md b/packages/ai-gemini/CHANGELOG.md index 7107467063..fd1f7a56a7 100644 --- a/packages/ai-gemini/CHANGELOG.md +++ b/packages/ai-gemini/CHANGELOG.md @@ -1,5 +1,20 @@ # @tanstack/ai-gemini +## 0.24.1 + +### Patch Changes + +- [#932](https://github.com/TanStack/ai/pull/932) [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b) - Classify Anthropic, Gemini, and OpenAI native tools with stable runtime discriminators so ordinary functions can use the same public names without selecting provider-native behavior. Native tools must come from the adapter factory (`webSearchTool()`, `googleSearchTool()`, and the rest). A reserved `name` alone does not select a native converter. `chat()` throws `DuplicateToolNameError` when a factory tool and a custom function share the same public name. + + Previously the converters picked provider-native behavior by `tool.name`. Tool names are public application identifiers, so a plain function called `web_search`, `google_search`, or `code_execution` was routed into a native converter: it lost its `inputSchema` and was sent as a provider-only payload (and on Anthropic could also flip on `code_execution` / skills beta headers). Native tools are now identified by adapter-owned metadata, which converters strip before building the wire payload, so provider API versions stay confined to the wire converters. + + Also preserves Anthropic `webSearchTool` options (`max_uses`, `allowed_domains`, `blocked_domains`, `user_location`, `cache_control`) on the wire payload. + + Also fixes `googleSearchTool({ searchTypes: … })` being silently dropped on the experimental `geminiTextInteractions()` adapter. The Interactions converter read a snake_case `search_types` array, but the public factory takes the Generate Content shape (`GoogleSearch.searchTypes: { webSearch?, imageSearch? }`), so the field never matched and every request fell back to the provider default of web-search-only. The camelCase config is now translated to the Interactions wire list. + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + ## 0.24.0 ### Minor Changes diff --git a/packages/ai-gemini/package.json b/packages/ai-gemini/package.json index 363192d7a6..55e02d00cf 100644 --- a/packages/ai-gemini/package.json +++ b/packages/ai-gemini/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-gemini", - "version": "0.24.0", + "version": "0.24.1", "description": "Google Gemini adapter for TanStack AI chat, images, speech, audio generation, and structured outputs.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-grok-build/CHANGELOG.md b/packages/ai-grok-build/CHANGELOG.md index 6a5924fde7..b7065eaa9a 100644 --- a/packages/ai-grok-build/CHANGELOG.md +++ b/packages/ai-grok-build/CHANGELOG.md @@ -1,5 +1,14 @@ # @tanstack/ai-grok-build +## 0.4.1 + +### Patch Changes + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + - @tanstack/ai-acp@0.3.1 + - @tanstack/ai-sandbox@0.3.4 + ## 0.4.0 ### Minor Changes diff --git a/packages/ai-grok-build/package.json b/packages/ai-grok-build/package.json index 830f22ef40..0c95e4c5f5 100644 --- a/packages/ai-grok-build/package.json +++ b/packages/ai-grok-build/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-grok-build", - "version": "0.4.0", + "version": "0.4.1", "description": "Grok Build harness adapter for TanStack AI — run Grok Build as a chat backend with local tool execution and stateful sessions.", "author": "", "license": "MIT", diff --git a/packages/ai-grok/CHANGELOG.md b/packages/ai-grok/CHANGELOG.md index 28e3ab4dba..cdcffd93a5 100644 --- a/packages/ai-grok/CHANGELOG.md +++ b/packages/ai-grok/CHANGELOG.md @@ -1,5 +1,25 @@ # @tanstack/ai-grok +## 0.16.0 + +### Minor Changes + +- [#896](https://github.com/TanStack/ai/pull/896) [`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b) - Add a self-describing `billed` field to `TokenUsage` so billed quantities carry the unit they are counted in ([#816](https://github.com/TanStack/ai/issues/816)). `usage.billed` is `{ quantity, unit }` with a `BillingUnit` union (`'seconds'`, `'units'`, `'images'`, `'tokens'`, ... open-ended). The deprecated `unitsBilled` / `durationSeconds` counts are still populated for backward compatibility. The fal adapters report `{ quantity, unit: 'units' }`, Grok video `{ quantity, unit: 'seconds' }`, the OpenAI/Grok/BytePlus duration-billed transcription paths `{ quantity, unit: 'seconds' }`, BytePlus Seedream images `{ quantity, unit: 'images' }`, BytePlus Seedance video `{ quantity, unit: 'tokens' }`, and Cohere/OpenRouter rerank `{ quantity, unit: 'units' }` (search units). Persistence sums `billed` when both reports use the same unit. `otelMiddleware` emits the pair as `tanstack.ai.usage.billed_quantity` / `tanstack.ai.usage.billed_unit` span attributes. + +### Patch Changes + +- [#932](https://github.com/TanStack/ai/pull/932) [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b) - Classify Anthropic, Gemini, and OpenAI native tools with stable runtime discriminators so ordinary functions can use the same public names without selecting provider-native behavior. Native tools must come from the adapter factory (`webSearchTool()`, `googleSearchTool()`, and the rest). A reserved `name` alone does not select a native converter. `chat()` throws `DuplicateToolNameError` when a factory tool and a custom function share the same public name. + + Previously the converters picked provider-native behavior by `tool.name`. Tool names are public application identifiers, so a plain function called `web_search`, `google_search`, or `code_execution` was routed into a native converter: it lost its `inputSchema` and was sent as a provider-only payload (and on Anthropic could also flip on `code_execution` / skills beta headers). Native tools are now identified by adapter-owned metadata, which converters strip before building the wire payload, so provider API versions stay confined to the wire converters. + + Also preserves Anthropic `webSearchTool` options (`max_uses`, `allowed_domains`, `blocked_domains`, `user_location`, `cache_control`) on the wire payload. + + Also fixes `googleSearchTool({ searchTypes: … })` being silently dropped on the experimental `geminiTextInteractions()` adapter. The Interactions converter read a snake_case `search_types` array, but the public factory takes the Generate Content shape (`GoogleSearch.searchTypes: { webSearch?, imageSearch? }`), so the field never matched and every request fell back to the provider default of web-search-only. The camelCase config is now translated to the Interactions wire list. + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + - @tanstack/openai-base@0.9.15 + ## 0.15.0 ### Minor Changes diff --git a/packages/ai-grok/package.json b/packages/ai-grok/package.json index 83492636fd..38d2459148 100644 --- a/packages/ai-grok/package.json +++ b/packages/ai-grok/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-grok", - "version": "0.15.0", + "version": "0.16.0", "description": "xAI Grok adapter for TanStack AI chat, image generation, realtime, and structured outputs.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-groq/CHANGELOG.md b/packages/ai-groq/CHANGELOG.md index 999b8fc427..7baed30872 100644 --- a/packages/ai-groq/CHANGELOG.md +++ b/packages/ai-groq/CHANGELOG.md @@ -1,5 +1,13 @@ # @tanstack/ai-groq +## 0.6.3 + +### Patch Changes + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + - @tanstack/openai-base@0.9.15 + ## 0.6.2 ### Patch Changes diff --git a/packages/ai-groq/package.json b/packages/ai-groq/package.json index 9a963eb192..db6e9845ab 100644 --- a/packages/ai-groq/package.json +++ b/packages/ai-groq/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-groq", - "version": "0.6.2", + "version": "0.6.3", "description": "Groq adapter for TanStack AI low-latency chat, tool calling, and structured outputs.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-mcp/CHANGELOG.md b/packages/ai-mcp/CHANGELOG.md index 78453ff112..84b4a11cda 100644 --- a/packages/ai-mcp/CHANGELOG.md +++ b/packages/ai-mcp/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/ai-mcp +## 0.3.2 + +### Patch Changes + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + ## 0.3.1 ### Patch Changes diff --git a/packages/ai-mcp/package.json b/packages/ai-mcp/package.json index 400bc5bfcb..e7719920c0 100644 --- a/packages/ai-mcp/package.json +++ b/packages/ai-mcp/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-mcp", - "version": "0.3.1", + "version": "0.3.2", "description": "Host-side Model Context Protocol client for TanStack AI: discover and run MCP server tools, resources, and prompts in any adapter's chat() loop, with generated end-to-end types.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-memory/CHANGELOG.md b/packages/ai-memory/CHANGELOG.md index b33814d794..c9ce26715b 100644 --- a/packages/ai-memory/CHANGELOG.md +++ b/packages/ai-memory/CHANGELOG.md @@ -1,5 +1,21 @@ # @tanstack/ai-memory +## 0.1.3 + +### Patch Changes + +- [#932](https://github.com/TanStack/ai/pull/932) [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b) - Classify Anthropic, Gemini, and OpenAI native tools with stable runtime discriminators so ordinary functions can use the same public names without selecting provider-native behavior. Native tools must come from the adapter factory (`webSearchTool()`, `googleSearchTool()`, and the rest). A reserved `name` alone does not select a native converter. `chat()` throws `DuplicateToolNameError` when a factory tool and a custom function share the same public name. + + Previously the converters picked provider-native behavior by `tool.name`. Tool names are public application identifiers, so a plain function called `web_search`, `google_search`, or `code_execution` was routed into a native converter: it lost its `inputSchema` and was sent as a provider-only payload (and on Anthropic could also flip on `code_execution` / skills beta headers). Native tools are now identified by adapter-owned metadata, which converters strip before building the wire payload, so provider API versions stay confined to the wire converters. + + Also preserves Anthropic `webSearchTool` options (`max_uses`, `allowed_domains`, `blocked_domains`, `user_location`, `cache_control`) on the wire payload. + + Also fixes `googleSearchTool({ searchTypes: … })` being silently dropped on the experimental `geminiTextInteractions()` adapter. The Interactions converter read a snake_case `search_types` array, but the public factory takes the Generate Content shape (`GoogleSearch.searchTypes: { webSearch?, imageSearch? }`), so the field never matched and every request fell back to the provider default of web-search-only. The camelCase config is now translated to the Interactions wire list. + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai-event-client@0.9.0 + - @tanstack/ai@0.46.0 + ## 0.1.2 ### Patch Changes diff --git a/packages/ai-memory/package.json b/packages/ai-memory/package.json index 8cf368b10d..d3dafd1912 100644 --- a/packages/ai-memory/package.json +++ b/packages/ai-memory/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-memory", - "version": "0.1.2", + "version": "0.1.3", "description": "Pluggable memory adapters for TanStack AI memoryMiddleware", "author": "", "license": "MIT", diff --git a/packages/ai-mistral/CHANGELOG.md b/packages/ai-mistral/CHANGELOG.md index 563f7c0ba0..6980137eb0 100644 --- a/packages/ai-mistral/CHANGELOG.md +++ b/packages/ai-mistral/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/ai-mistral +## 0.3.3 + +### Patch Changes + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + ## 0.3.2 ### Patch Changes diff --git a/packages/ai-mistral/package.json b/packages/ai-mistral/package.json index 5622bb0d10..a40cdc5ca1 100644 --- a/packages/ai-mistral/package.json +++ b/packages/ai-mistral/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-mistral", - "version": "0.3.2", + "version": "0.3.3", "type": "module", "description": "Mistral adapter for TanStack AI", "author": "", diff --git a/packages/ai-ollama/CHANGELOG.md b/packages/ai-ollama/CHANGELOG.md index 5fbca06cb3..7e11f0d6f2 100644 --- a/packages/ai-ollama/CHANGELOG.md +++ b/packages/ai-ollama/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/ai-ollama +## 0.9.2 + +### Patch Changes + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + ## 0.9.1 ### Patch Changes diff --git a/packages/ai-ollama/package.json b/packages/ai-ollama/package.json index cde4f6450b..b4950d4c89 100644 --- a/packages/ai-ollama/package.json +++ b/packages/ai-ollama/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-ollama", - "version": "0.9.1", + "version": "0.9.2", "description": "Ollama adapter for TanStack AI local LLM chat, tool calling, and structured outputs.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-openai/CHANGELOG.md b/packages/ai-openai/CHANGELOG.md index a6fe1bca3e..f87298a806 100644 --- a/packages/ai-openai/CHANGELOG.md +++ b/packages/ai-openai/CHANGELOG.md @@ -1,5 +1,25 @@ # @tanstack/ai-openai +## 0.20.0 + +### Minor Changes + +- [#896](https://github.com/TanStack/ai/pull/896) [`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b) - Add a self-describing `billed` field to `TokenUsage` so billed quantities carry the unit they are counted in ([#816](https://github.com/TanStack/ai/issues/816)). `usage.billed` is `{ quantity, unit }` with a `BillingUnit` union (`'seconds'`, `'units'`, `'images'`, `'tokens'`, ... open-ended). The deprecated `unitsBilled` / `durationSeconds` counts are still populated for backward compatibility. The fal adapters report `{ quantity, unit: 'units' }`, Grok video `{ quantity, unit: 'seconds' }`, the OpenAI/Grok/BytePlus duration-billed transcription paths `{ quantity, unit: 'seconds' }`, BytePlus Seedream images `{ quantity, unit: 'images' }`, BytePlus Seedance video `{ quantity, unit: 'tokens' }`, and Cohere/OpenRouter rerank `{ quantity, unit: 'units' }` (search units). Persistence sums `billed` when both reports use the same unit. `otelMiddleware` emits the pair as `tanstack.ai.usage.billed_quantity` / `tanstack.ai.usage.billed_unit` span attributes. + +### Patch Changes + +- [#932](https://github.com/TanStack/ai/pull/932) [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b) - Classify Anthropic, Gemini, and OpenAI native tools with stable runtime discriminators so ordinary functions can use the same public names without selecting provider-native behavior. Native tools must come from the adapter factory (`webSearchTool()`, `googleSearchTool()`, and the rest). A reserved `name` alone does not select a native converter. `chat()` throws `DuplicateToolNameError` when a factory tool and a custom function share the same public name. + + Previously the converters picked provider-native behavior by `tool.name`. Tool names are public application identifiers, so a plain function called `web_search`, `google_search`, or `code_execution` was routed into a native converter: it lost its `inputSchema` and was sent as a provider-only payload (and on Anthropic could also flip on `code_execution` / skills beta headers). Native tools are now identified by adapter-owned metadata, which converters strip before building the wire payload, so provider API versions stay confined to the wire converters. + + Also preserves Anthropic `webSearchTool` options (`max_uses`, `allowed_domains`, `blocked_domains`, `user_location`, `cache_control`) on the wire payload. + + Also fixes `googleSearchTool({ searchTypes: … })` being silently dropped on the experimental `geminiTextInteractions()` adapter. The Interactions converter read a snake_case `search_types` array, but the public factory takes the Generate Content shape (`GoogleSearch.searchTypes: { webSearch?, imageSearch? }`), so the field never matched and every request fell back to the provider default of web-search-only. The camelCase config is now translated to the Interactions wire list. + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + - @tanstack/openai-base@0.9.15 + ## 0.19.1 ### Patch Changes diff --git a/packages/ai-openai/package.json b/packages/ai-openai/package.json index 9b89c1b5e9..c225f7d8b5 100644 --- a/packages/ai-openai/package.json +++ b/packages/ai-openai/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-openai", - "version": "0.19.1", + "version": "0.20.0", "description": "OpenAI adapter for TanStack AI chat, tools, images, video, speech, transcription, realtime, and structured outputs.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-opencode/CHANGELOG.md b/packages/ai-opencode/CHANGELOG.md index 2c38ed4e3c..77d99e8cf6 100644 --- a/packages/ai-opencode/CHANGELOG.md +++ b/packages/ai-opencode/CHANGELOG.md @@ -1,5 +1,13 @@ # @tanstack/ai-opencode +## 0.3.1 + +### Patch Changes + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + - @tanstack/ai-sandbox@0.3.4 + ## 0.3.0 ### Minor Changes diff --git a/packages/ai-opencode/package.json b/packages/ai-opencode/package.json index 760156dc24..b3a72b4b50 100644 --- a/packages/ai-opencode/package.json +++ b/packages/ai-opencode/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-opencode", - "version": "0.3.0", + "version": "0.3.1", "description": "OpenCode harness adapter for TanStack AI — run OpenCode as a chat backend with local tool execution and stateful sessions.", "author": "", "license": "MIT", diff --git a/packages/ai-openrouter/CHANGELOG.md b/packages/ai-openrouter/CHANGELOG.md index 480b184b8a..b7e02a761a 100644 --- a/packages/ai-openrouter/CHANGELOG.md +++ b/packages/ai-openrouter/CHANGELOG.md @@ -1,5 +1,28 @@ # @tanstack/ai-openrouter +## 0.18.0 + +### Minor Changes + +- [#896](https://github.com/TanStack/ai/pull/896) [`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b) - Add a self-describing `billed` field to `TokenUsage` so billed quantities carry the unit they are counted in ([#816](https://github.com/TanStack/ai/issues/816)). `usage.billed` is `{ quantity, unit }` with a `BillingUnit` union (`'seconds'`, `'units'`, `'images'`, `'tokens'`, ... open-ended). The deprecated `unitsBilled` / `durationSeconds` counts are still populated for backward compatibility. The fal adapters report `{ quantity, unit: 'units' }`, Grok video `{ quantity, unit: 'seconds' }`, the OpenAI/Grok/BytePlus duration-billed transcription paths `{ quantity, unit: 'seconds' }`, BytePlus Seedream images `{ quantity, unit: 'images' }`, BytePlus Seedance video `{ quantity, unit: 'tokens' }`, and Cohere/OpenRouter rerank `{ quantity, unit: 'units' }` (search units). Persistence sums `billed` when both reports use the same unit. `otelMiddleware` emits the pair as `tanstack.ai.usage.billed_quantity` / `tanstack.ai.usage.billed_unit` span attributes. + +- [#836](https://github.com/TanStack/ai/pull/836) [`1d265b0`](https://github.com/TanStack/ai/commit/1d265b0c0741d0d63db2f9779be37a2c8ff4b87b) - Add native combined tools + `outputSchema` mode to both OpenRouter text adapters (chat-completions and Responses). When the resolved upstream model supports emitting a schema-constrained final answer alongside tool calls in a single pass, `chat({ outputSchema, tools, stream: true })` now wires the JSON Schema into the same streaming request as the tools and harvests the final-turn JSON, skipping the separate finalization round-trip. + + Because OpenRouter is a routing layer, capability is keyed per resolved upstream model via the new `OPENROUTER_COMBINED_TOOLS_AND_SCHEMA_MODELS` set, exported from `@tanstack/ai-openrouter/model-meta`, which both adapters consult from `supportsCombinedToolsAndSchema()`. The set is derived from each upstream provider's combined-mode gate (Anthropic 4.5+, Gemini 3.x, OpenAI's strict `json_schema` era, Grok 4.x) rather than the broader catalog `responseFormat` flag, so models that advertise structured output but predate native combined mode stay on the legacy finalization path. + +### Patch Changes + +- [#932](https://github.com/TanStack/ai/pull/932) [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b) - Classify Anthropic, Gemini, and OpenAI native tools with stable runtime discriminators so ordinary functions can use the same public names without selecting provider-native behavior. Native tools must come from the adapter factory (`webSearchTool()`, `googleSearchTool()`, and the rest). A reserved `name` alone does not select a native converter. `chat()` throws `DuplicateToolNameError` when a factory tool and a custom function share the same public name. + + Previously the converters picked provider-native behavior by `tool.name`. Tool names are public application identifiers, so a plain function called `web_search`, `google_search`, or `code_execution` was routed into a native converter: it lost its `inputSchema` and was sent as a provider-only payload (and on Anthropic could also flip on `code_execution` / skills beta headers). Native tools are now identified by adapter-owned metadata, which converters strip before building the wire payload, so provider API versions stay confined to the wire converters. + + Also preserves Anthropic `webSearchTool` options (`max_uses`, `allowed_domains`, `blocked_domains`, `user_location`, `cache_control`) on the wire payload. + + Also fixes `googleSearchTool({ searchTypes: … })` being silently dropped on the experimental `geminiTextInteractions()` adapter. The Interactions converter read a snake_case `search_types` array, but the public factory takes the Generate Content shape (`GoogleSearch.searchTypes: { webSearch?, imageSearch? }`), so the field never matched and every request fell back to the provider default of web-search-only. The camelCase config is now translated to the Interactions wire list. + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + ## 0.17.2 ### Patch Changes diff --git a/packages/ai-openrouter/package.json b/packages/ai-openrouter/package.json index 0a887498df..a37469607b 100644 --- a/packages/ai-openrouter/package.json +++ b/packages/ai-openrouter/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-openrouter", - "version": "0.17.2", + "version": "0.18.0", "description": "TanStack AI adapter for OpenRouter chat, provider tools, structured outputs, and access to hundreds of LLMs.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-perplexity/CHANGELOG.md b/packages/ai-perplexity/CHANGELOG.md index 41fb56b96a..6ecba445bf 100644 --- a/packages/ai-perplexity/CHANGELOG.md +++ b/packages/ai-perplexity/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/ai-perplexity +## 0.2.2 + +### Patch Changes + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + ## 0.2.1 ### Patch Changes diff --git a/packages/ai-perplexity/package.json b/packages/ai-perplexity/package.json index 944fd3c0be..4a409e8145 100644 --- a/packages/ai-perplexity/package.json +++ b/packages/ai-perplexity/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-perplexity", - "version": "0.2.1", + "version": "0.2.2", "description": "Perplexity Search API client and tool for TanStack AI", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-persistence/CHANGELOG.md b/packages/ai-persistence/CHANGELOG.md index 6cb8de811c..abb0226df0 100644 --- a/packages/ai-persistence/CHANGELOG.md +++ b/packages/ai-persistence/CHANGELOG.md @@ -1,5 +1,16 @@ # @tanstack/ai-persistence +## 0.2.0 + +### Minor Changes + +- [#896](https://github.com/TanStack/ai/pull/896) [`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b) - Add a self-describing `billed` field to `TokenUsage` so billed quantities carry the unit they are counted in ([#816](https://github.com/TanStack/ai/issues/816)). `usage.billed` is `{ quantity, unit }` with a `BillingUnit` union (`'seconds'`, `'units'`, `'images'`, `'tokens'`, ... open-ended). The deprecated `unitsBilled` / `durationSeconds` counts are still populated for backward compatibility. The fal adapters report `{ quantity, unit: 'units' }`, Grok video `{ quantity, unit: 'seconds' }`, the OpenAI/Grok/BytePlus duration-billed transcription paths `{ quantity, unit: 'seconds' }`, BytePlus Seedream images `{ quantity, unit: 'images' }`, BytePlus Seedance video `{ quantity, unit: 'tokens' }`, and Cohere/OpenRouter rerank `{ quantity, unit: 'units' }` (search units). Persistence sums `billed` when both reports use the same unit. `otelMiddleware` emits the pair as `tanstack.ai.usage.billed_quantity` / `tanstack.ai.usage.billed_unit` span attributes. + +### Patch Changes + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + ## 0.1.5 ### Patch Changes diff --git a/packages/ai-persistence/package.json b/packages/ai-persistence/package.json index 3282f11f1e..8cbf8ea7d1 100644 --- a/packages/ai-persistence/package.json +++ b/packages/ai-persistence/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-persistence", - "version": "0.1.5", + "version": "0.2.0", "description": "Composable state persistence for TanStack AI messages, runs, interrupts, metadata, and locks.", "author": "", "license": "MIT", diff --git a/packages/ai-preact/CHANGELOG.md b/packages/ai-preact/CHANGELOG.md index ec9af262c1..f46df9e873 100644 --- a/packages/ai-preact/CHANGELOG.md +++ b/packages/ai-preact/CHANGELOG.md @@ -1,5 +1,15 @@ # @tanstack/ai-preact +## 0.12.4 + +### Patch Changes + +- [#1154](https://github.com/TanStack/ai/pull/1154) [`f6b9d89`](https://github.com/TanStack/ai/commit/f6b9d89e7365f0cb30a41cf3a46b7dd237fbc73c) - Mint omitted `threadId` after the view mounts, not during render. DevTools binds the hook row to `threadId`. Persistence that is on (`true` or a storage adapter) requires a `threadId` at compile time, and throws at runtime if it is missing. Chat and generation clients no longer accept a separate `id` option. Use `threadId`. + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`f6b9d89`](https://github.com/TanStack/ai/commit/f6b9d89e7365f0cb30a41cf3a46b7dd237fbc73c), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + - @tanstack/ai-client@0.24.0 + ## 0.12.3 ### Patch Changes diff --git a/packages/ai-preact/package.json b/packages/ai-preact/package.json index 5bd4fbefe1..90fc8f1170 100644 --- a/packages/ai-preact/package.json +++ b/packages/ai-preact/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-preact", - "version": "0.12.3", + "version": "0.12.4", "description": "Preact hooks for TanStack AI streaming chat and typed messages.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-react-ui/CHANGELOG.md b/packages/ai-react-ui/CHANGELOG.md index 8f64310a3f..987407f0c3 100644 --- a/packages/ai-react-ui/CHANGELOG.md +++ b/packages/ai-react-ui/CHANGELOG.md @@ -1,5 +1,13 @@ # @tanstack/ai-react-ui +## 0.8.17 + +### Patch Changes + +- Updated dependencies [[`f6b9d89`](https://github.com/TanStack/ai/commit/f6b9d89e7365f0cb30a41cf3a46b7dd237fbc73c), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai-client@0.24.0 + - @tanstack/ai-react@0.20.0 + ## 0.8.16 ### Patch Changes diff --git a/packages/ai-react-ui/package.json b/packages/ai-react-ui/package.json index 096ab9b71c..28c767708b 100644 --- a/packages/ai-react-ui/package.json +++ b/packages/ai-react-ui/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-react-ui", - "version": "0.8.16", + "version": "0.8.17", "description": "Headless React components for building TanStack AI chat interfaces with streamed message parts.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-react/CHANGELOG.md b/packages/ai-react/CHANGELOG.md index adb4d1f9bb..b9125cbd36 100644 --- a/packages/ai-react/CHANGELOG.md +++ b/packages/ai-react/CHANGELOG.md @@ -1,5 +1,55 @@ # @tanstack/ai-react +## 0.20.0 + +### Minor Changes + +- [#969](https://github.com/TanStack/ai/pull/969) [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd) - WebSocket transport: a full-duplex, resumable third transport alongside SSE and + NDJSON, reusing the same delivery-durability seam. + + On the server, `@tanstack/ai` adds `toWebSocketStream(socket, request, { onRun, +durability, batch, heartbeatMs, idleTimeoutMs, debug })` — a portable core that + pumps a conversation over an already-accepted WHATWG `WebSocketLike` server + socket (Node via `ws`, Bun, etc.), and `toWebSocketResponse(request, { onRun, +… })`, a thin wrapper that upgrades via `WebSocketPair` and returns a 101 + `Response` on Cloudflare Workers/Durable Objects (it throws elsewhere, pointing + you at `toWebSocketStream`). Because one socket outlives many `chat()` turns + (client-tool resubmits, follow-up user messages), you pass an `onRun(ctx) => +AsyncIterable` factory instead of a prebuilt stream — the helper + calls it per inbound `RunAgentInput` frame. The socket is conversation-scoped: + it stays open across turns and closes on client close or the idle timeout + (which never fires while a turn is still streaming), with a periodic + `{ type: 'ping' }` heartbeat. An `{ type: 'abort', runId }` control frame + aborts only that turn, leaving the socket open. A turn that fails is surfaced + to the client as a live `RUN_ERROR` frame, mirroring the HTTP transports. Durability is keyed per turn and reuses + the existing `durableStreamSource`, so server→client frames carry the same + `{ id, chunk }` envelope as NDJSON. `resumeWebSocketStream(socket, { adapter })` + and `resumeWebSocketResponse({ adapter })` replay a run read-only from the + durability log (no model call). + + On the client, `webSocket(url, options)` (in `@tanstack/ai-client`, re-exported + from `@tanstack/ai-react`, `-solid`, `-vue`, `-svelte`, and `-angular`) is a + full-duplex `subscribe` + `send` connection adapter for `useChat`. `send()` + writes a `RunAgentInput` frame; `subscribe()` yields inbound chunks, ignores + heartbeats, unwraps durable envelopes, and auto-reconnects a dropped durable run + by reopening with `?runId=&offset=` (browsers can't set a `Last-Event-ID` + handshake header, so the offset rides in the URL). The reconnect bookkeeping + (offset de-dupe, no-progress ceiling → `StreamReconnectLimitError`) is shared + with the HTTP adapters via the new `createReconnectTracker`, and a fatal drop + surfaces to the consumer (`StreamReadError` / `StreamReconnectLimitError`) + instead of hanging. Aborting a run (`stop()` in `useChat`) sends the + `{ type: 'abort', runId }` frame so the server cancels the turn instead of + generating to completion, and `joinRun()` opens its own replay socket so a + rejoin never collides with the live conversation socket. + +### Patch Changes + +- [#1154](https://github.com/TanStack/ai/pull/1154) [`f6b9d89`](https://github.com/TanStack/ai/commit/f6b9d89e7365f0cb30a41cf3a46b7dd237fbc73c) - Mint omitted `threadId` after the view mounts, not during render. DevTools binds the hook row to `threadId`. Persistence that is on (`true` or a storage adapter) requires a `threadId` at compile time, and throws at runtime if it is missing. Chat and generation clients no longer accept a separate `id` option. Use `threadId`. + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`f6b9d89`](https://github.com/TanStack/ai/commit/f6b9d89e7365f0cb30a41cf3a46b7dd237fbc73c), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + - @tanstack/ai-client@0.24.0 + ## 0.19.3 ### Patch Changes diff --git a/packages/ai-react/package.json b/packages/ai-react/package.json index 66587b0cb0..5eb097cb75 100644 --- a/packages/ai-react/package.json +++ b/packages/ai-react/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-react", - "version": "0.19.3", + "version": "0.20.0", "description": "React hooks for TanStack AI streaming chat, realtime voice, structured outputs, and media generation.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-sandbox-cloudflare/CHANGELOG.md b/packages/ai-sandbox-cloudflare/CHANGELOG.md index 402440cae2..005b4f207c 100644 --- a/packages/ai-sandbox-cloudflare/CHANGELOG.md +++ b/packages/ai-sandbox-cloudflare/CHANGELOG.md @@ -1,5 +1,14 @@ # @tanstack/ai-sandbox-cloudflare +## 0.3.3 + +### Patch Changes + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`880d710`](https://github.com/TanStack/ai/commit/880d710626e77d85442082f95de03fa6cda78b78), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + - @tanstack/ai-sandbox-local-process@0.2.2 + - @tanstack/ai-sandbox@0.3.4 + ## 0.3.2 ### Patch Changes diff --git a/packages/ai-sandbox-cloudflare/package.json b/packages/ai-sandbox-cloudflare/package.json index 83a1584afa..9b966de963 100644 --- a/packages/ai-sandbox-cloudflare/package.json +++ b/packages/ai-sandbox-cloudflare/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-sandbox-cloudflare", - "version": "0.3.2", + "version": "0.3.3", "description": "Cloudflare sandbox provider for TanStack AI — run harness adapters inside Cloudflare Containers (edge) through the uniform SandboxHandle.", "author": "", "license": "MIT", diff --git a/packages/ai-sandbox-local-process/CHANGELOG.md b/packages/ai-sandbox-local-process/CHANGELOG.md index 90e183d5fe..1e17bcf1e7 100644 --- a/packages/ai-sandbox-local-process/CHANGELOG.md +++ b/packages/ai-sandbox-local-process/CHANGELOG.md @@ -1,5 +1,14 @@ # @tanstack/ai-sandbox-local-process +## 0.2.2 + +### Patch Changes + +- [#1119](https://github.com/TanStack/ai/pull/1119) [`880d710`](https://github.com/TanStack/ai/commit/880d710626e77d85442082f95de03fa6cda78b78) - Fix local-process spawn handles hanging when the child exits before `wait()` is called. + +- Updated dependencies []: + - @tanstack/ai-sandbox@0.3.4 + ## 0.2.1 ### Patch Changes diff --git a/packages/ai-sandbox-local-process/package.json b/packages/ai-sandbox-local-process/package.json index 5ffb2fffc6..236575f159 100644 --- a/packages/ai-sandbox-local-process/package.json +++ b/packages/ai-sandbox-local-process/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-sandbox-local-process", - "version": "0.2.1", + "version": "0.2.2", "description": "Local-process sandbox provider for TanStack AI — runs the agent directly on the host through the uniform SandboxHandle (no isolation; trusted/dev use).", "author": "", "license": "MIT", diff --git a/packages/ai-sandbox-vercel/CHANGELOG.md b/packages/ai-sandbox-vercel/CHANGELOG.md index 4f99fbd462..c1eaddbb45 100644 --- a/packages/ai-sandbox-vercel/CHANGELOG.md +++ b/packages/ai-sandbox-vercel/CHANGELOG.md @@ -1,5 +1,14 @@ # @tanstack/ai-sandbox-vercel +## 0.2.2 + +### Patch Changes + +- [#921](https://github.com/TanStack/ai/pull/921) [`3bb0806`](https://github.com/TanStack/ai/commit/3bb0806740759de50de477303679b5e3b66e88a5) - Vercel sandbox requests now append a `@tanstack/ai` token to the `user-agent`. + +- Updated dependencies []: + - @tanstack/ai-sandbox@0.3.4 + ## 0.2.1 ### Patch Changes diff --git a/packages/ai-sandbox-vercel/package.json b/packages/ai-sandbox-vercel/package.json index f716e9a477..4c1de18c06 100644 --- a/packages/ai-sandbox-vercel/package.json +++ b/packages/ai-sandbox-vercel/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-sandbox-vercel", - "version": "0.2.1", + "version": "0.2.2", "description": "Vercel Sandbox provider for TanStack AI — run harness adapters inside isolated Vercel microVM sandboxes through the uniform SandboxHandle.", "author": "", "license": "MIT", diff --git a/packages/ai-sandbox/CHANGELOG.md b/packages/ai-sandbox/CHANGELOG.md index b21ae504e6..d26ae01476 100644 --- a/packages/ai-sandbox/CHANGELOG.md +++ b/packages/ai-sandbox/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/ai-sandbox +## 0.3.4 + +### Patch Changes + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + ## 0.3.3 ### Patch Changes diff --git a/packages/ai-sandbox/package.json b/packages/ai-sandbox/package.json index 0c0cc04c42..4177c32f3b 100644 --- a/packages/ai-sandbox/package.json +++ b/packages/ai-sandbox/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-sandbox", - "version": "0.3.3", + "version": "0.3.4", "description": "Provider-agnostic sandbox layer for TanStack AI — run harness adapters inside isolated sandboxes (defineSandbox, defineWorkspace, withSandbox) with a uniform SandboxHandle, workspace bootstrap, policy, and resumable lifecycle.", "author": "", "license": "MIT", diff --git a/packages/ai-solid-ui/CHANGELOG.md b/packages/ai-solid-ui/CHANGELOG.md index f639360c46..829a04711a 100644 --- a/packages/ai-solid-ui/CHANGELOG.md +++ b/packages/ai-solid-ui/CHANGELOG.md @@ -1,5 +1,13 @@ # @tanstack/ai-solid-ui +## 0.7.16 + +### Patch Changes + +- Updated dependencies [[`f6b9d89`](https://github.com/TanStack/ai/commit/f6b9d89e7365f0cb30a41cf3a46b7dd237fbc73c), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai-client@0.24.0 + - @tanstack/ai-solid@0.17.0 + ## 0.7.15 ### Patch Changes diff --git a/packages/ai-solid-ui/package.json b/packages/ai-solid-ui/package.json index 45c23df1eb..13c56355b8 100644 --- a/packages/ai-solid-ui/package.json +++ b/packages/ai-solid-ui/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-solid-ui", - "version": "0.7.15", + "version": "0.7.16", "description": "Headless Solid components for building TanStack AI chat interfaces with streamed message parts.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-solid/CHANGELOG.md b/packages/ai-solid/CHANGELOG.md index 21c1be2b2e..51a48acbf5 100644 --- a/packages/ai-solid/CHANGELOG.md +++ b/packages/ai-solid/CHANGELOG.md @@ -1,5 +1,55 @@ # @tanstack/ai-solid +## 0.17.0 + +### Minor Changes + +- [#969](https://github.com/TanStack/ai/pull/969) [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd) - WebSocket transport: a full-duplex, resumable third transport alongside SSE and + NDJSON, reusing the same delivery-durability seam. + + On the server, `@tanstack/ai` adds `toWebSocketStream(socket, request, { onRun, +durability, batch, heartbeatMs, idleTimeoutMs, debug })` — a portable core that + pumps a conversation over an already-accepted WHATWG `WebSocketLike` server + socket (Node via `ws`, Bun, etc.), and `toWebSocketResponse(request, { onRun, +… })`, a thin wrapper that upgrades via `WebSocketPair` and returns a 101 + `Response` on Cloudflare Workers/Durable Objects (it throws elsewhere, pointing + you at `toWebSocketStream`). Because one socket outlives many `chat()` turns + (client-tool resubmits, follow-up user messages), you pass an `onRun(ctx) => +AsyncIterable` factory instead of a prebuilt stream — the helper + calls it per inbound `RunAgentInput` frame. The socket is conversation-scoped: + it stays open across turns and closes on client close or the idle timeout + (which never fires while a turn is still streaming), with a periodic + `{ type: 'ping' }` heartbeat. An `{ type: 'abort', runId }` control frame + aborts only that turn, leaving the socket open. A turn that fails is surfaced + to the client as a live `RUN_ERROR` frame, mirroring the HTTP transports. Durability is keyed per turn and reuses + the existing `durableStreamSource`, so server→client frames carry the same + `{ id, chunk }` envelope as NDJSON. `resumeWebSocketStream(socket, { adapter })` + and `resumeWebSocketResponse({ adapter })` replay a run read-only from the + durability log (no model call). + + On the client, `webSocket(url, options)` (in `@tanstack/ai-client`, re-exported + from `@tanstack/ai-react`, `-solid`, `-vue`, `-svelte`, and `-angular`) is a + full-duplex `subscribe` + `send` connection adapter for `useChat`. `send()` + writes a `RunAgentInput` frame; `subscribe()` yields inbound chunks, ignores + heartbeats, unwraps durable envelopes, and auto-reconnects a dropped durable run + by reopening with `?runId=&offset=` (browsers can't set a `Last-Event-ID` + handshake header, so the offset rides in the URL). The reconnect bookkeeping + (offset de-dupe, no-progress ceiling → `StreamReconnectLimitError`) is shared + with the HTTP adapters via the new `createReconnectTracker`, and a fatal drop + surfaces to the consumer (`StreamReadError` / `StreamReconnectLimitError`) + instead of hanging. Aborting a run (`stop()` in `useChat`) sends the + `{ type: 'abort', runId }` frame so the server cancels the turn instead of + generating to completion, and `joinRun()` opens its own replay socket so a + rejoin never collides with the live conversation socket. + +### Patch Changes + +- [#1154](https://github.com/TanStack/ai/pull/1154) [`f6b9d89`](https://github.com/TanStack/ai/commit/f6b9d89e7365f0cb30a41cf3a46b7dd237fbc73c) - Mint omitted `threadId` after the view mounts, not during render. DevTools binds the hook row to `threadId`. Persistence that is on (`true` or a storage adapter) requires a `threadId` at compile time, and throws at runtime if it is missing. Chat and generation clients no longer accept a separate `id` option. Use `threadId`. + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`f6b9d89`](https://github.com/TanStack/ai/commit/f6b9d89e7365f0cb30a41cf3a46b7dd237fbc73c), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + - @tanstack/ai-client@0.24.0 + ## 0.16.3 ### Patch Changes diff --git a/packages/ai-solid/package.json b/packages/ai-solid/package.json index c42dba02db..88e5738083 100644 --- a/packages/ai-solid/package.json +++ b/packages/ai-solid/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-solid", - "version": "0.16.3", + "version": "0.17.0", "description": "Solid hooks for TanStack AI streaming chat, structured outputs, and media generation.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-svelte/CHANGELOG.md b/packages/ai-svelte/CHANGELOG.md index 324c1e4d91..80cf3859d6 100644 --- a/packages/ai-svelte/CHANGELOG.md +++ b/packages/ai-svelte/CHANGELOG.md @@ -1,5 +1,55 @@ # @tanstack/ai-svelte +## 0.17.0 + +### Minor Changes + +- [#969](https://github.com/TanStack/ai/pull/969) [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd) - WebSocket transport: a full-duplex, resumable third transport alongside SSE and + NDJSON, reusing the same delivery-durability seam. + + On the server, `@tanstack/ai` adds `toWebSocketStream(socket, request, { onRun, +durability, batch, heartbeatMs, idleTimeoutMs, debug })` — a portable core that + pumps a conversation over an already-accepted WHATWG `WebSocketLike` server + socket (Node via `ws`, Bun, etc.), and `toWebSocketResponse(request, { onRun, +… })`, a thin wrapper that upgrades via `WebSocketPair` and returns a 101 + `Response` on Cloudflare Workers/Durable Objects (it throws elsewhere, pointing + you at `toWebSocketStream`). Because one socket outlives many `chat()` turns + (client-tool resubmits, follow-up user messages), you pass an `onRun(ctx) => +AsyncIterable` factory instead of a prebuilt stream — the helper + calls it per inbound `RunAgentInput` frame. The socket is conversation-scoped: + it stays open across turns and closes on client close or the idle timeout + (which never fires while a turn is still streaming), with a periodic + `{ type: 'ping' }` heartbeat. An `{ type: 'abort', runId }` control frame + aborts only that turn, leaving the socket open. A turn that fails is surfaced + to the client as a live `RUN_ERROR` frame, mirroring the HTTP transports. Durability is keyed per turn and reuses + the existing `durableStreamSource`, so server→client frames carry the same + `{ id, chunk }` envelope as NDJSON. `resumeWebSocketStream(socket, { adapter })` + and `resumeWebSocketResponse({ adapter })` replay a run read-only from the + durability log (no model call). + + On the client, `webSocket(url, options)` (in `@tanstack/ai-client`, re-exported + from `@tanstack/ai-react`, `-solid`, `-vue`, `-svelte`, and `-angular`) is a + full-duplex `subscribe` + `send` connection adapter for `useChat`. `send()` + writes a `RunAgentInput` frame; `subscribe()` yields inbound chunks, ignores + heartbeats, unwraps durable envelopes, and auto-reconnects a dropped durable run + by reopening with `?runId=&offset=` (browsers can't set a `Last-Event-ID` + handshake header, so the offset rides in the URL). The reconnect bookkeeping + (offset de-dupe, no-progress ceiling → `StreamReconnectLimitError`) is shared + with the HTTP adapters via the new `createReconnectTracker`, and a fatal drop + surfaces to the consumer (`StreamReadError` / `StreamReconnectLimitError`) + instead of hanging. Aborting a run (`stop()` in `useChat`) sends the + `{ type: 'abort', runId }` frame so the server cancels the turn instead of + generating to completion, and `joinRun()` opens its own replay socket so a + rejoin never collides with the live conversation socket. + +### Patch Changes + +- [#1154](https://github.com/TanStack/ai/pull/1154) [`f6b9d89`](https://github.com/TanStack/ai/commit/f6b9d89e7365f0cb30a41cf3a46b7dd237fbc73c) - Mint omitted `threadId` after the view mounts, not during render. DevTools binds the hook row to `threadId`. Persistence that is on (`true` or a storage adapter) requires a `threadId` at compile time, and throws at runtime if it is missing. Chat and generation clients no longer accept a separate `id` option. Use `threadId`. + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`f6b9d89`](https://github.com/TanStack/ai/commit/f6b9d89e7365f0cb30a41cf3a46b7dd237fbc73c), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + - @tanstack/ai-client@0.24.0 + ## 0.16.3 ### Patch Changes diff --git a/packages/ai-svelte/package.json b/packages/ai-svelte/package.json index 7b0548f84c..10b1d7b809 100644 --- a/packages/ai-svelte/package.json +++ b/packages/ai-svelte/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-svelte", - "version": "0.16.3", + "version": "0.17.0", "description": "Svelte 5 bindings for TanStack AI streaming chat, structured outputs, and media generation.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-vercel-gateway/CHANGELOG.md b/packages/ai-vercel-gateway/CHANGELOG.md index 01ecde350d..7645869eba 100644 --- a/packages/ai-vercel-gateway/CHANGELOG.md +++ b/packages/ai-vercel-gateway/CHANGELOG.md @@ -1,5 +1,13 @@ # @tanstack/ai-vercel-gateway +## 0.1.3 + +### Patch Changes + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + - @tanstack/openai-base@0.9.15 + ## 0.1.2 ### Patch Changes diff --git a/packages/ai-vercel-gateway/package.json b/packages/ai-vercel-gateway/package.json index 8514a45f60..4cccf1adab 100644 --- a/packages/ai-vercel-gateway/package.json +++ b/packages/ai-vercel-gateway/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-vercel-gateway", - "version": "0.1.2", + "version": "0.1.3", "description": "Vercel AI Gateway adapter for TanStack AI chat, embeddings, and image generation.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-vue-ui/CHANGELOG.md b/packages/ai-vue-ui/CHANGELOG.md index 39ac4efc26..075fc6c7d7 100644 --- a/packages/ai-vue-ui/CHANGELOG.md +++ b/packages/ai-vue-ui/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/ai-vue-ui +## 0.2.38 + +### Patch Changes + +- Updated dependencies [[`f6b9d89`](https://github.com/TanStack/ai/commit/f6b9d89e7365f0cb30a41cf3a46b7dd237fbc73c), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai-vue@0.17.0 + ## 0.2.37 ### Patch Changes diff --git a/packages/ai-vue-ui/package.json b/packages/ai-vue-ui/package.json index 7e07c2c15d..05d7979f0d 100644 --- a/packages/ai-vue-ui/package.json +++ b/packages/ai-vue-ui/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-vue-ui", - "version": "0.2.37", + "version": "0.2.38", "description": "Headless Vue components for building TanStack AI chat interfaces with streamed message parts.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-vue/CHANGELOG.md b/packages/ai-vue/CHANGELOG.md index e15e1756bf..5e9df58824 100644 --- a/packages/ai-vue/CHANGELOG.md +++ b/packages/ai-vue/CHANGELOG.md @@ -1,5 +1,55 @@ # @tanstack/ai-vue +## 0.17.0 + +### Minor Changes + +- [#969](https://github.com/TanStack/ai/pull/969) [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd) - WebSocket transport: a full-duplex, resumable third transport alongside SSE and + NDJSON, reusing the same delivery-durability seam. + + On the server, `@tanstack/ai` adds `toWebSocketStream(socket, request, { onRun, +durability, batch, heartbeatMs, idleTimeoutMs, debug })` — a portable core that + pumps a conversation over an already-accepted WHATWG `WebSocketLike` server + socket (Node via `ws`, Bun, etc.), and `toWebSocketResponse(request, { onRun, +… })`, a thin wrapper that upgrades via `WebSocketPair` and returns a 101 + `Response` on Cloudflare Workers/Durable Objects (it throws elsewhere, pointing + you at `toWebSocketStream`). Because one socket outlives many `chat()` turns + (client-tool resubmits, follow-up user messages), you pass an `onRun(ctx) => +AsyncIterable` factory instead of a prebuilt stream — the helper + calls it per inbound `RunAgentInput` frame. The socket is conversation-scoped: + it stays open across turns and closes on client close or the idle timeout + (which never fires while a turn is still streaming), with a periodic + `{ type: 'ping' }` heartbeat. An `{ type: 'abort', runId }` control frame + aborts only that turn, leaving the socket open. A turn that fails is surfaced + to the client as a live `RUN_ERROR` frame, mirroring the HTTP transports. Durability is keyed per turn and reuses + the existing `durableStreamSource`, so server→client frames carry the same + `{ id, chunk }` envelope as NDJSON. `resumeWebSocketStream(socket, { adapter })` + and `resumeWebSocketResponse({ adapter })` replay a run read-only from the + durability log (no model call). + + On the client, `webSocket(url, options)` (in `@tanstack/ai-client`, re-exported + from `@tanstack/ai-react`, `-solid`, `-vue`, `-svelte`, and `-angular`) is a + full-duplex `subscribe` + `send` connection adapter for `useChat`. `send()` + writes a `RunAgentInput` frame; `subscribe()` yields inbound chunks, ignores + heartbeats, unwraps durable envelopes, and auto-reconnects a dropped durable run + by reopening with `?runId=&offset=` (browsers can't set a `Last-Event-ID` + handshake header, so the offset rides in the URL). The reconnect bookkeeping + (offset de-dupe, no-progress ceiling → `StreamReconnectLimitError`) is shared + with the HTTP adapters via the new `createReconnectTracker`, and a fatal drop + surfaces to the consumer (`StreamReadError` / `StreamReconnectLimitError`) + instead of hanging. Aborting a run (`stop()` in `useChat`) sends the + `{ type: 'abort', runId }` frame so the server cancels the turn instead of + generating to completion, and `joinRun()` opens its own replay socket so a + rejoin never collides with the live conversation socket. + +### Patch Changes + +- [#1154](https://github.com/TanStack/ai/pull/1154) [`f6b9d89`](https://github.com/TanStack/ai/commit/f6b9d89e7365f0cb30a41cf3a46b7dd237fbc73c) - Mint omitted `threadId` after the view mounts, not during render. DevTools binds the hook row to `threadId`. Persistence that is on (`true` or a storage adapter) requires a `threadId` at compile time, and throws at runtime if it is missing. Chat and generation clients no longer accept a separate `id` option. Use `threadId`. + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`f6b9d89`](https://github.com/TanStack/ai/commit/f6b9d89e7365f0cb30a41cf3a46b7dd237fbc73c), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + - @tanstack/ai-client@0.24.0 + ## 0.16.3 ### Patch Changes diff --git a/packages/ai-vue/package.json b/packages/ai-vue/package.json index 41b727fa0c..f7c4f1062e 100644 --- a/packages/ai-vue/package.json +++ b/packages/ai-vue/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-vue", - "version": "0.16.3", + "version": "0.17.0", "description": "Vue composables for TanStack AI streaming chat, structured outputs, and media generation.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai/CHANGELOG.md b/packages/ai/CHANGELOG.md index 186f611074..05a0b34c2b 100644 --- a/packages/ai/CHANGELOG.md +++ b/packages/ai/CHANGELOG.md @@ -1,5 +1,64 @@ # @tanstack/ai +## 0.46.0 + +### Minor Changes + +- [#896](https://github.com/TanStack/ai/pull/896) [`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b) - Add a self-describing `billed` field to `TokenUsage` so billed quantities carry the unit they are counted in ([#816](https://github.com/TanStack/ai/issues/816)). `usage.billed` is `{ quantity, unit }` with a `BillingUnit` union (`'seconds'`, `'units'`, `'images'`, `'tokens'`, ... open-ended). The deprecated `unitsBilled` / `durationSeconds` counts are still populated for backward compatibility. The fal adapters report `{ quantity, unit: 'units' }`, Grok video `{ quantity, unit: 'seconds' }`, the OpenAI/Grok/BytePlus duration-billed transcription paths `{ quantity, unit: 'seconds' }`, BytePlus Seedream images `{ quantity, unit: 'images' }`, BytePlus Seedance video `{ quantity, unit: 'tokens' }`, and Cohere/OpenRouter rerank `{ quantity, unit: 'units' }` (search units). Persistence sums `billed` when both reports use the same unit. `otelMiddleware` emits the pair as `tanstack.ai.usage.billed_quantity` / `tanstack.ai.usage.billed_unit` span attributes. + +- [#969](https://github.com/TanStack/ai/pull/969) [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd) - WebSocket transport: a full-duplex, resumable third transport alongside SSE and + NDJSON, reusing the same delivery-durability seam. + + On the server, `@tanstack/ai` adds `toWebSocketStream(socket, request, { onRun, +durability, batch, heartbeatMs, idleTimeoutMs, debug })` — a portable core that + pumps a conversation over an already-accepted WHATWG `WebSocketLike` server + socket (Node via `ws`, Bun, etc.), and `toWebSocketResponse(request, { onRun, +… })`, a thin wrapper that upgrades via `WebSocketPair` and returns a 101 + `Response` on Cloudflare Workers/Durable Objects (it throws elsewhere, pointing + you at `toWebSocketStream`). Because one socket outlives many `chat()` turns + (client-tool resubmits, follow-up user messages), you pass an `onRun(ctx) => +AsyncIterable` factory instead of a prebuilt stream — the helper + calls it per inbound `RunAgentInput` frame. The socket is conversation-scoped: + it stays open across turns and closes on client close or the idle timeout + (which never fires while a turn is still streaming), with a periodic + `{ type: 'ping' }` heartbeat. An `{ type: 'abort', runId }` control frame + aborts only that turn, leaving the socket open. A turn that fails is surfaced + to the client as a live `RUN_ERROR` frame, mirroring the HTTP transports. Durability is keyed per turn and reuses + the existing `durableStreamSource`, so server→client frames carry the same + `{ id, chunk }` envelope as NDJSON. `resumeWebSocketStream(socket, { adapter })` + and `resumeWebSocketResponse({ adapter })` replay a run read-only from the + durability log (no model call). + + On the client, `webSocket(url, options)` (in `@tanstack/ai-client`, re-exported + from `@tanstack/ai-react`, `-solid`, `-vue`, `-svelte`, and `-angular`) is a + full-duplex `subscribe` + `send` connection adapter for `useChat`. `send()` + writes a `RunAgentInput` frame; `subscribe()` yields inbound chunks, ignores + heartbeats, unwraps durable envelopes, and auto-reconnects a dropped durable run + by reopening with `?runId=&offset=` (browsers can't set a `Last-Event-ID` + handshake header, so the offset rides in the URL). The reconnect bookkeeping + (offset de-dupe, no-progress ceiling → `StreamReconnectLimitError`) is shared + with the HTTP adapters via the new `createReconnectTracker`, and a fatal drop + surfaces to the consumer (`StreamReadError` / `StreamReconnectLimitError`) + instead of hanging. Aborting a run (`stop()` in `useChat`) sends the + `{ type: 'abort', runId }` frame so the server cancels the turn instead of + generating to completion, and `joinRun()` opens its own replay socket so a + rejoin never collides with the live conversation socket. + +### Patch Changes + +- [#1147](https://github.com/TanStack/ai/pull/1147) [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a) - Preserve reasoning in server chat message history and interrupt snapshots. + +- [#932](https://github.com/TanStack/ai/pull/932) [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b) - Classify Anthropic, Gemini, and OpenAI native tools with stable runtime discriminators so ordinary functions can use the same public names without selecting provider-native behavior. Native tools must come from the adapter factory (`webSearchTool()`, `googleSearchTool()`, and the rest). A reserved `name` alone does not select a native converter. `chat()` throws `DuplicateToolNameError` when a factory tool and a custom function share the same public name. + + Previously the converters picked provider-native behavior by `tool.name`. Tool names are public application identifiers, so a plain function called `web_search`, `google_search`, or `code_execution` was routed into a native converter: it lost its `inputSchema` and was sent as a provider-only payload (and on Anthropic could also flip on `code_execution` / skills beta headers). Native tools are now identified by adapter-owned metadata, which converters strip before building the wire payload, so provider API versions stay confined to the wire converters. + + Also preserves Anthropic `webSearchTool` options (`max_uses`, `allowed_domains`, `blocked_domains`, `user_location`, `cache_control`) on the wire payload. + + Also fixes `googleSearchTool({ searchTypes: … })` being silently dropped on the experimental `geminiTextInteractions()` adapter. The Interactions converter read a snake_case `search_types` array, but the public factory takes the Generate Content shape (`GoogleSearch.searchTypes: { webSearch?, imageSearch? }`), so the field never matched and every request fell back to the provider default of web-search-only. The camelCase config is now translated to the Interactions wire list. + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b)]: + - @tanstack/ai-event-client@0.9.0 + ## 0.45.1 ### Patch Changes diff --git a/packages/ai/package.json b/packages/ai/package.json index 009807d735..e112547753 100644 --- a/packages/ai/package.json +++ b/packages/ai/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai", - "version": "0.45.1", + "version": "0.46.0", "description": "Type-safe TypeScript AI SDK for streaming chat, tool calling, agents, structured outputs, and multimodal generation.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/openai-base/CHANGELOG.md b/packages/openai-base/CHANGELOG.md index 929cfe1521..e000199584 100644 --- a/packages/openai-base/CHANGELOG.md +++ b/packages/openai-base/CHANGELOG.md @@ -1,5 +1,20 @@ # @tanstack/openai-base +## 0.9.15 + +### Patch Changes + +- [#932](https://github.com/TanStack/ai/pull/932) [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b) - Classify Anthropic, Gemini, and OpenAI native tools with stable runtime discriminators so ordinary functions can use the same public names without selecting provider-native behavior. Native tools must come from the adapter factory (`webSearchTool()`, `googleSearchTool()`, and the rest). A reserved `name` alone does not select a native converter. `chat()` throws `DuplicateToolNameError` when a factory tool and a custom function share the same public name. + + Previously the converters picked provider-native behavior by `tool.name`. Tool names are public application identifiers, so a plain function called `web_search`, `google_search`, or `code_execution` was routed into a native converter: it lost its `inputSchema` and was sent as a provider-only payload (and on Anthropic could also flip on `code_execution` / skills beta headers). Native tools are now identified by adapter-owned metadata, which converters strip before building the wire payload, so provider API versions stay confined to the wire converters. + + Also preserves Anthropic `webSearchTool` options (`max_uses`, `allowed_domains`, `blocked_domains`, `user_location`, `cache_control`) on the wire payload. + + Also fixes `googleSearchTool({ searchTypes: … })` being silently dropped on the experimental `geminiTextInteractions()` adapter. The Interactions converter read a snake_case `search_types` array, but the public factory takes the Generate Content shape (`GoogleSearch.searchTypes: { webSearch?, imageSearch? }`), so the field never matched and every request fell back to the provider default of web-search-only. The camelCase config is now translated to the Interactions wire list. + +- Updated dependencies [[`41a5d18`](https://github.com/TanStack/ai/commit/41a5d189082331e052e1f2f5e987848501ffd08b), [`4599019`](https://github.com/TanStack/ai/commit/4599019eb02f72562ef155b69b8f61f9d25d187a), [`3eda66c`](https://github.com/TanStack/ai/commit/3eda66cb132def6346829ba113f315ffdd4edf6b), [`ecd12a4`](https://github.com/TanStack/ai/commit/ecd12a408987bc75649c21aada6948282a2a66dd)]: + - @tanstack/ai@0.46.0 + ## 0.9.14 ### Patch Changes diff --git a/packages/openai-base/package.json b/packages/openai-base/package.json index 142707d922..5f3112a21d 100644 --- a/packages/openai-base/package.json +++ b/packages/openai-base/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/openai-base", - "version": "0.9.14", + "version": "0.9.15", "description": "Shared OpenAI SDK base adapters for TanStack AI providers using Chat Completions and Responses APIs.", "author": "Tanner Linsley", "license": "MIT",