mirror of
https://github.com/TanStack/ai.git
synced 2026-11-16 19:38:41 +00:00
12 commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
22f7c73123 |
chore(deps): update build & test tooling (#2161)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> |
||
|
|
0ff927b397 |
fix(ai-cloudflare): replace glm-5.3-flash with deepseek v4.1 flash ahead of retirement (#2099)
* fix(ai-cloudflare): replace glm-5.3-flash with deepseek v4.1 flash ahead of retirement Workers AI retires @cf/zai-org/glm-5.3-flash on November 20, 2026. Move docs, examples, and generator templates to @cf/deepseek-ai/deepseek-v4.1-flash-1017 and add its reasoning levels. * test(ai-cloudflare): lock deepseek v4.1 flash reasoning wire The replacement id was not what the reasoning request probe called, so deleting the new map row stayed green. --------- Co-authored-by: Tom Beckenham <34339192+tombeckenham@users.noreply.github.com> |
||
|
|
a40b2326c1 |
chore(deps): update dependency @vitejs/plugin-react to v6 (#2005)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> |
||
|
|
f7e7cce8f2 |
feat(ai-neon, openai-base): add the Neon AI Gateway adapter (#1851)
* feat(openai-base): add a streamOptions hook to the Chat Completions adapter A subclass can return undefined for a backend that rejects stream_options. The default still asks for the usage-only tail chunk. * feat(ai-neon): add a Neon AI Gateway adapter neonText sends Claude to the Anthropic Messages route, codex and *-pro models to the Responses route, and every other model to Chat Completions. Adds neonEmbedding, neonSummarize, and a daily catalog sync from neon.com/models. * test(e2e): add neon, neon-anthropic, and neon-responses rows * docs: add the Neon AI Gateway adapter page * fix(ai-neon): address sampling and route capability review * fix(ai-neon): complete route typing and usage normalization * fix(ai-neon): pass threadId to chat() and useChat, now required on main * ci: apply automated fixes --------- Co-authored-by: Tom Beckenham <34339192+tombeckenham@users.noreply.github.com> Co-authored-by: Alem Tuzlak <t.zlak@hotmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> |
||
|
|
fe83aa05fe |
fix(models): remove model ids that providers have retired (#1868)
* fix(models): remove model ids that providers have retired Each removed id 404s on the provider's model API (or is listed as shut down on its deprecations page) and is absent from modelschemas and OpenRouter. Code paths, types, docs, skills, examples, and tests that only served those models go with them. * ci: apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> |
||
|
|
f1b3f65a59 |
refactor!: remove every deprecated API and release all packages as 1.0.0 (#1840)
* feat!: remove deprecated APIs for 1.0
Remove every deprecated export, option, field, and type alias from all
packages, and the internal code that only served them. Remove old wire
formats, readers for old saved data, shut-down provider models, and the
@tanstack/ai-react-ui, ai-solid-ui, and ai-vue-ui packages.
* docs: add the 1.0 upgrade guide and remove deprecated APIs from docs
* chore: add the 1.0.0 major changeset for all packages
* ci: apply automated fixes
* fix(ai): read the generation input from forwardedProps
The 1.0 client does not send the data copy of forwardedProps.
generationParamsFromBody still required body.data, so every
generation request to a route that used it failed. The envelope is
now found by forwardedProps, and the input comes from forwardedProps.
* fix(examples, testing): read request input from forwardedProps
Server routes in the examples, the e2e app, and the panel still read
body.data. The 1.0 client sends the input only in forwardedProps, so
these routes now read forwardedProps and no longer fall back to data.
* test(e2e): use the same client tool output schema on server and browser
The server definitions of show_notification and display_chart had no
outputSchema, but the browser tools had one. The schema hashes did not
match, so the client treated the pause as a generic interrupt and did
not resume after the tool ran. The removed pre-binding fallback hid
this before.
* fix(ai-vertex): use the same @google/genai copy as ai-gemini
The lockfile moved the ai-vertex dev copy of @google/genai to another
peer set. The vertex tests mock @google/genai, but ai-gemini loaded
the other copy, so the mock did not apply and the tests failed.
* docs(ai): remove container.skills from the Anthropic skill reference
1.0 removed modelOptions.container.skills, so the code block failed
the kiira type check. Skills go on codeExecutionTool instead.
* fix(testing): send the audio request input as the plain body
The /api/audio route reads its input from forwardedProps or from the
plain body. The audio page and the devtools generation hooks page still
wrapped the input in { data }, so the route got no provider and failed.
* chore: remove the last deprecated leftovers for 1.0
- Stop reading the 0.x interrupt reasons approval_required and
client_tool_input in the stream processor. The kind comes from
metadata.kind only. These reasons are no longer reserved for MCP input.
- Rewrite the tests that asserted the old reason aliases.
- Remove the deprecated pending alias from the useChat test titles.
- Reword comments, the codemods README, the adapter skill, and CLAUDE.md
that still described removed or deprecated APIs.
- Move the testing panel chunk tables and sample traces to AG-UI events.
- Remove the unused deprecated setHandler from the group chat example.
* docs: regenerate the API reference for 1.0
This removes the pages and members of the deprecated APIs.
* chore: name the removed interrupt reasons in the changeset
* refactor!: remove the toolName alias from TOOL_CALL_START
TOOL_CALL_START now carries the tool name only in toolCallName, the
AG-UI field. The adapter extra toolName is also gone, so adapters no
longer send it on TOOL_CALL_START or TOOL_CALL_END. The stream
normalizer no longer copies toolName into toolCallName, and the client
no longer adds toolName back on inbound chunks.
* docs: regenerate the API reference without the toolName alias
* test(e2e): read toolCallName on TOOL_CALL_START in the webFetch spec
* docs: rewrite the docs so you can set up each feature in a few minutes (#1843)
* docs: rewrite the docs so a reader can set up each feature in a few minutes
Rewrite every hand-written docs page in plain, friendly English. Each
page starts with the problem and a short setup that runs. The deep
details move to an Advanced part, or to a new advanced page next to it.
- Add 23 advanced pages and their nav entries.
- Correct facts that did not match the source code.
- Keep page URLs and the anchors that other pages link to.
* docs: fix the code samples that failed the kiira type check
* docs: rewrite the computer use pages and use gpt-6.1-sol in the samples
* docs: show the interrupt flow in the tool approval diagram
* docs: read toolCallName on TOOL_CALL_START in the OpenAI samples
* refactor!: require threadId on chat and generation APIs
threadId is now required on every chat and generation entry point.
TanStack AI no longer makes a thread id for you.
- Client: ChatClient, useChat and the other chat hooks, the hook that
createChatHook returns, GenerationClient, VideoGenerationClient, and
every generation hook in each framework.
- Server: chat(), summarize(), getVideoJobStatus(), and the generation
functions. TextOptions, SummarizationOptions, and ToolExecutionContext
now carry a string threadId.
- Remove the fallbacks that made up thread ids in core, the clients, the
framework hooks, and the provider adapters.
- createChatOptions() keeps threadId optional. chat() still needs it.
- Remove resolveDurableThreadId and DurableThreadIdRequiredError from
@tanstack/ai-sandbox.
- Update tests, examples, testing apps, skills, READMEs, the migration
guide, and the changeset.
* docs: regenerate the API reference for required threadId
* docs: pass threadId in every sample now that it is required
* test: pass threadId in the Mistral test and the code mode eval
* feat(ai-client)!: pass threadId to the generation fetcher
* refactor(ai)!: make threadId optional on subagent bound calls
* refactor!: stop making up thread ids
* refactor!: take the threadId in toJsonResponse for structured output
* revert: toJsonResponse does not need a threadId for structured output
A structured-output response wraps the object in its own run events.
Nothing resumes or saves that thread, so the caller does not pass a
threadId. Keep the removed fake-text fallback and the real thread ids
in the ts-react-chat server functions.
* fix!: apply threadId only where it is used
- getVideoJobStatus(): threadId is optional again. Only middleware reads it.
Plain status polls in docs, READMEs, the skill, and apps drop it.
- createComputerUse: a call with no threadId uses the fixed
'computer-use:shared' thread again.
- @tanstack/ai-sandbox: the tool bridge and executeHostTool() take a
required threadId and put it in each tool context. The harness adapters
and the Cloudflare coordinators pass the run's thread id.
- ChatClient passes its threadId to client tool execution.
- Code Mode bindings always get a context. The threadId comes from the
parent context. A tool gets no context when there is no threadId.
- Compaction and snippet selection run their internal chat() calls on
`${threadId}:compaction` and `${threadId}:snippets`.
- Connection adapters: the run context is a required fourth argument of
connect() and send(). The runtime error stays for untyped callers.
* docs: regenerate the API reference for getVideoJobStatus
* fix(ai)!: ToolExecutionContext.threadId is optional outside a chat
registerWebMCPTools and the ai-mcp server run tools with no chat, so
there is no thread id. Every chat path still sets it: chat(), ChatClient
client tools, the sandbox bridges, and the Code Mode bindings.
- Code Mode bindings use ToolExecutionContext again. ToolBindingContext
is gone, and a tool always gets the binding context.
- Docs say when threadId is missing.
* docs: regenerate the API reference for ToolExecutionContext.threadId
* docs: pass threadId in samples that kiira could not check
Samples that pass a value from a relative import (./tools) into chat() or
createChatClientOptions() were not type-checked in full: kiira hides the
unresolved-import error, and TypeScript then drops every other error in that
call. Add the missing threadId, drop the removed useChat id option, and fix
the ag-ui-compliance prose that said the runtime makes a thread id.
Also correct the kiira snippet lesson, which called the binding a usable any.
* fix: reject 0.x Cloudflare run records and wire byok in Octane useChat
- ai-sandbox-cloudflare: a rec: value in the 0.x layout (done/error
status) now throws a clear "migrate first" error. Read as-is it looked
like a live run, and the stall watchdog marked finished runs failed.
list() skips such records with a log line, so one old record cannot
stop the watchdog for live runs.
- ai-octane: useChat passes byok and byokProvider to ChatClient, like
the other framework hooks. The option was typed but dropped.
- ai-mistral, ai-octane: published dependencies use workspace:^, so 1.0
does not pin ai-utils and ai-client to an exact version.
- ai-solid: the README was a copy of the React one. Rewrite it for Solid
and 1.0 (threadId, interrupts).
Co-Authored-By: Claude <noreply@anthropic.com>
* docs: fix 1.0 samples and claims found in the full PR review
- Pass threadId in every sample and JSDoc @example that calls chat(),
summarize(), a generate* function, a client, or a hook. Regenerate
docs/reference.
- Server samples read the 1.0 request: generationParamsFromRequest and
forwardedProps, not a top-level prompt or body.data. Custom transport
samples forward runContext instead of making ids up.
- Fix samples that ran but did the wrong thing: Claude Code and Codex
session resume, generation runId, the hardcoded video thread, the
aborted status, shared 'thread-1' helpers in skills, the Svelte
quick-start submit, apply-answers, the subagents tutorial.
- Correct claims the code does not support: sandbox policy, tool bridge
host, sandbox key, harness tool checks, Gemini structured streaming,
WebSocket resume, mcp-input reasons, openai-compatible features,
OpenAI sampling params, the 0.x Cloudflare run-log migration, blobKey.
- Fix stale comments that named removed APIs.
Co-Authored-By: Claude <noreply@anthropic.com>
* docs: define persistence and sandbox inline so kiira checks the calls
The video persistence route and the harness structured-output skill
sample imported persistence and sandbox from relative modules. kiira
hides the unresolved import, and TypeScript then drops every other error
in the call that uses the value. Build both values in the same fence.
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(ai-sandbox): refuse needsApproval tools in the harness tool bridge
The bridge called execute() directly, so a needsApproval tool ran with no
approval through every harness adapter. It cannot pause for an approval
round-trip, so fail fast with a clear error, as the docs already state.
Closes #1854
* test(ai-vertex): dedupe @google/genai so the factory mock applies
pnpm resolves two copies of @google/genai 2.10.0, one per zod peer
(4.3.6 for ai-gemini, 4.6.5 for ai-vertex). The vertex tests mock the
copy ai-vertex sees, but ai-gemini constructs GoogleGenAI from its own,
so the mock did not apply and factories.test.ts failed.
|
||
|
|
632fd806bb |
chore: refresh Start example dependencies (#1592)
* chore: refresh Start example dependencies * ci: apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> |
||
|
|
682e0d7c4d |
fix: drop Nitro from public React Start examples (#1414) | ||
|
|
28fe4df4d5 |
fix: give public React examples a standalone tsconfig (#1413) | ||
|
|
e300654c32 |
chore: drop byokProvider from the Nx React app generator (#1411)
Generated labs now pass byok and forwardedProps only. The client reads the provider slug from forwardedProps.provider. |
||
|
|
62ba217d31 |
feat: add a Basic Chat tutorial and example (#1408)
* feat: add a Basic Chat tutorial and example Add a slim OpenRouter + BYOK Start app at examples/react/basic-chat and a Tutorial tab walkthrough that matches those files. * refactor: inline Basic Chat route and gpt-5.5 model Put chat() in the API route, pass openai/gpt-5.5 to createOpenRouterText, and set forwardedProps on useChat. * docs: rewrite Basic Chat tutorial as a Start walkthrough Create a Start app, install packages, then BYOK, useChat, and a two-step server route. * docs: drop @tanstack/ai-client from the Basic Chat install list * feat: re-export client and BYOK from framework packages Add a /byok subpath on React, Vue, Solid, Svelte, Preact, Angular, Octane, and Remix. Re-export ChatClient and the rest of the headless client from each package root so apps do not need @tanstack/ai-client. * ci: apply automated fixes * docs: put the key form in its own file and drop forwardedProps The tutorial now says to export OpenRouterKeyForm from src/components, import it on the index route, and create src/routes/api.chat.ts next to index.tsx. * docs: link the Basic Chat GitHub example at the end of the tutorial * chore: add add-example-tutorial skill for public examples Encode the Basic Chat end-state so the next tutorial ships the same app layout, walkthrough order, and tanstack.com sibling PR. * ci: apply automated fixes * chore: generate public examples under examples/react and rewrite the tutorial skill * ci: apply automated fixes * chore: stop requiring a tanstack.com PR for new React tutorials * ci: apply automated fixes * chore: drop tanstack.com from the example-tutorial skill * ci: apply automated fixes * docs: ignore Start-route snippets in the Basic Chat tutorial for kiira --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> |
||
|
|
5b8858cb1e |
feat: add an Nx generator for React playground apps (#1399)
* feat: add an Nx generator for React playground apps Add a local @tanstack/workspace-plugin with a react-app generator. The generator writes a thin TanStack Start chat lab under examples/<name>/ with BYOK, a model picker, and chat(). * fix: declare @nx/devkit on the workspace plugin Knip failed because root listed unused @nx/devkit and @nx/plugin. The generator is the only import of @nx/devkit. @nx/plugin had no imports. |