@tanstack/ai-code-mode
1.0.0 · 22 Oct 2026MIT54.1k / weekRepositoryHomepagenpmAtom feed
76 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 1.x · latest line
1.0.0
22 Oct 2026- breaking
TanStack AI 1.0.0. This release removes every API that was deprecated in 0.x. Read the upgrade guide before you upgrade: tanstack.com/ai/latest/docs/migration/v1
Add
@tanstack/ai-code-mode/harnesswithcodeMode({ driver }): a harness plugin that gives the model oneexecute_typescripttool. The model writes a program that calls several tools, and the program runs in the isolate of any@tanstack/ai-isolate-*driver.@tanstack/ai-harnessis an optional peer dependency.The
execute_typescripttool description and the code-mode system prompt now tell the model that the tool returns{ success, result, logs, error }, whereresultis the value its code returned.
Major Changes
- breaking
TanStack AI 1.0.0. This release removes every API that was deprecated in 0.x. Read the upgrade guide before you upgrade: tanstack.com/ai/latest/docs/migration/v1
Removed all
@deprecatedexports, options, fields, and type aliases. Each one has a replacement that already shipped in 0.x.Removed
addToolApprovalResponse()fromChatClientand every chat hook. Resolve the boundtool-approvalinterrupt withresolveInterruptinstead. The devtools eventtools:approval:respondedis also removed.Removed the old wire formats: the CUSTOM
approval-requestedandtool-input-availableevents, the[DONE]SSE line, thedatacopy offorwardedProps, pre-binding interrupt descriptors and theirapproval_requiredandclient_tool_inputreasons, and the STEP events that adapters sent next toREASONING_*events. Use a 1.0 client with a 1.0 server.Removed the
toolNamealias fromTOOL_CALL_STARTchunks. ReadtoolCallNameinstead.threadIdis now required onuseChatand every other chat hook,ChatClient, the generation hooks and clients,chat(),summarize(), the generation functions,codeModeWithSnippets(),selectRelevantSnippets(),CompactionContext, andSummarizeInput. TanStack AI no longer makes a thread id for you. Pass a stable id for each conversation.createChatHookfactory options no longer takethreadId: pass it on each hook call. Octane generation hooks takethreadIdinstead ofid.@tanstack/ai-sandboxremovesresolveDurableThreadIdandDurableThreadIdRequiredError.The published
@tanstack/ai-octane/uitypes are now strict.UI.Messages,UI.Message,UI.Part, andUI.Interruptstype their render children.ToolPropstypespart.inputandpart.outputfor the named tool.toolsComponentsandinterruptsComponentsare required when the chat options declare tools or named interrupts. Code that relied on the old loose types can fail to compile.A connection adapter's
connect()andsend()need the run context (withthreadId) as their fourth argument.ChatClientand the generation clients pass it.@tanstack/ai-sandbox:createToolBridgeCore(),startHostToolBridge(), aToolBridgeProvisioner, andexecuteHostTool()take a requiredthreadId. Bridged tools get it in their context.@tanstack/ai-sandbox: the harness tool bridge andexecuteHostTool()refuse a tool withneedsApproval. Before, the tool ran with no approval. RemoveneedsApproval, or run the tool with an HTTP adapter.stream()andrpcStream()pass the AG-UIRunAgentInputfor the run as the fourth factory argument, the same body the HTTP adapters send. Read it on the server withchatParamsFromRequestBody()orgenerationParamsFromBody(), sothreadId,runId, and interruptresumereach a server function.RunAgentInputis exported from@tanstack/ai/client.A generation
fetchergetsthreadIdandrunIdin its second argument, next tosignalandheaders. Pass them to the server generation call.generationParamsFromBody()andgenerationParamsFromRequest()read the generation input fromforwardedProps. A server that readsbody.datagetsundefined. Readbody.forwardedPropsinstead. They also requirethreadIdandrunIdand return them as strings, the same aschatParamsFromRequestBody()and the AG-UIRunAgentInput. A body that holds only the input is rejected.Removed the readers for data saved in old 0.x formats (old Cloudflare run-log records, a bare
UIMessagefrom client persistence, artifact records withoutblobKey).Removed provider models that are shut down.
@tanstack/ai-react-ui,@tanstack/ai-solid-ui, and@tanstack/ai-vue-uiget no 1.0 release. Import from@tanstack/ai-react/ui,@tanstack/ai-solid/ui, or@tanstack/ai-vue/ui.
Minor Changes
Add
@tanstack/ai-code-mode/harnesswithcodeMode({ driver }): a harness plugin that gives the model oneexecute_typescripttool. The model writes a program that calls several tools, and the program runs in the isolate of any@tanstack/ai-isolate-*driver.By default, only tools that are safe to run without a question move into code mode. These are server tools with no
needsApprovaland no permission resources, which the permission rules allow in plan mode. A safe tool withmetadata.codeMode: truealways moves.includepicks more tools, also tools with permission checks, such as the coding toolsread_file,write_file,edit_file,patch,list_files,grep,bash, andwebfetch. Each call of such a tool in a program gets the same decision frompermissions()as a direct call. The call runs, or it throws an error with the reason, or the program waits for the user to approve it. The approval is a question wait thatsession.answeranswers withonce,always, orreject. A program that can wait gets a timeout of 10 minutes by default.The session log keeps the result of each checked call. After a stop, the next host runs the program again, and a call that finished before the stop does not run twice. A call that the stop cut, and that is not safe to run again, throws in the program.
includenever moves a tool that needs approval, or a tool that the rules deny in the current permission mode. The rules decide again at each turn, so in plan mode the tools that edit stay normal tool calls.directCalls: 'keep'keeps the moved tools in the model's tool list too. The session settingdirectCallschanges it while the session runs.lazy: truelists only the tool names and addsdiscover_tools. A tool name that is not a JavaScript identifier gets a safe name inside the program.
@tanstack/ai-harnessis an optional peer dependency.
Patch Changes
The
execute_typescripttool description and the code-mode system prompt now tell the model that the tool returns{ success, result, logs, error }, whereresultis the value its code returned.The
mcp(),codeMode(), andskills()harness plugins send their warnings to the logger of the host (createHarnessHost({ logger })).
- 0.5.x
0.5.1 – 0.5.55 releases that only update dependencies@tanstack/ai 0.71.0Show each
- 0.5.521 Oct 2026@tanstack/ai 0.71.0
- 0.5.419 Oct 2026@tanstack/ai 0.70.0
- 0.5.313 Oct 2026@tanstack/ai 0.69.0
- 0.5.29 Oct 2026@tanstack/ai 0.68.0
- 0.5.19 Oct 2026@tanstack/ai 0.67.0
0.5.0
8 Oct 2026Add a
debugoption tocreateCodeMode/createCodeModeTool. Failed executions and secret-parameter warnings now go through the@tanstack/aidebug logger instead of hard-codedconsole.error/console.warn, sodebug: { logger }routes them to your ownLoggeranddebug: falsesilences them. Errors still reach the console by default. The success line previously behindCODE_MODE_DEBUG=1now logs under thetoolscategory.
- 0.4.x
0.4.21
6 Oct 2026Pass the chat run's
abortSignaland runtimecontextto the tools that Code Mode calls asexternal_*functions. A tool that listens to the signal now stops its in-flight work when the run stops, for example MCP tools. A call does not start when the run is already aborted.toolCallIdandinputResponseof theexecute_typescriptcall are not passed on.
Patch Changes
Pass the chat run's
abortSignaland runtimecontextto the tools that Code Mode calls asexternal_*functions. A tool that listens to the signal now stops its in-flight work when the run stops, for example MCP tools. A call does not start when the run is already aborted.toolCallIdandinputResponseof theexecute_typescriptcall are not passed on.
0.4.20
5 Oct 2026Keep
enumandconstvalues and property descriptions in the generated Code Mode type stubs. A typed schema such as{ type: 'string', enum: ['a', 'b'] }now renders as'a' | 'b'instead ofstring, and propertydescriptions are emitted as JSDoc, as theincludeDescriptionsoption ofgenerateTypeStubsalready documented.
Patch Changes
Keep
enumandconstvalues and property descriptions in the generated Code Mode type stubs. A typed schema such as{ type: 'string', enum: ['a', 'b'] }now renders as'a' | 'b'instead ofstring, and propertydescriptions are emitted as JSDoc, as theincludeDescriptionsoption ofgenerateTypeStubsalready documented.
0.4.1 – 0.4.1916 releases that only update dependencies@tanstack/ai 0.64.0Show each
- 0.4.192 Oct 2026@tanstack/ai 0.64.0
- 0.4.1827 Sep 2026@tanstack/ai 0.63.0
- 0.4.1624 Sep 2026@tanstack/ai 0.61.0
- 0.4.1424 Sep 2026@tanstack/ai 0.59.0
- 0.4.1321 Sep 2026@tanstack/ai 0.58.0
- 0.4.1221 Sep 2026@tanstack/ai 0.57.0
- 0.4.1017 Sep 2026@tanstack/ai 0.55.0
- 0.4.910 Sep 2026@tanstack/ai 0.54.0
- 0.4.83 Sep 2026@tanstack/ai 0.53.0
- 0.4.728 Aug 2026@tanstack/ai 0.52.0
- 0.4.627 Aug 2026@tanstack/ai 0.51.0
- 0.4.527 Aug 2026@tanstack/ai 0.50.0
- 0.4.424 Aug 2026@tanstack/ai 0.49.0
- 0.4.322 Aug 2026@tanstack/ai 0.48.0
- 0.4.220 Aug 2026@tanstack/ai 0.47.0
- 0.4.119 Aug 2026@tanstack/ai 0.46.0
0.4.0
18 Aug 2026Rename Code Mode "skills" to "snippets" to disambiguate them from agent skills (the
SKILL.mdpackaging system).Breaking — package rename.
@tanstack/ai-code-mode-skillsis now published as@tanstack/ai-code-mode-snippets. Update your dependency and imports. The/storagesubpath is unchanged.Breaking — API rename. Every
Skill/skillidentifier in the package public API becomesSnippet/snippet, for example:Breaking — sandbox hook (
@tanstack/ai-code-mode). ThecreateCodeModeToolconfig optiongetSkillBindingsis renamed togetSnippetBindings(same signature — an optional() => Promise<Record<string, ToolBinding>>returning dynamic bindings merged at execution time).Breaking — wire contract (
@tanstack/ai). The Code Mode custom events are renamed:code_mode:skill_call/_result/_error→code_mode:snippet_*(payload fieldskill→snippet), andskill:registered→snippet:registered. The exported event typesCodeModeSkillCallEvent/CodeModeSkillResultEvent/CodeModeSkillErrorEvent/SkillRegisteredEventare renamed to theirSnippetequivalents.
Minor Changes
Rename Code Mode "skills" to "snippets" to disambiguate them from agent skills (the
SKILL.mdpackaging system).Breaking — package rename.
@tanstack/ai-code-mode-skillsis now published as@tanstack/ai-code-mode-snippets. Update your dependency and imports. The/storagesubpath is unchanged.Breaking — API rename. Every
Skill/skillidentifier in the package public API becomesSnippet/snippet, for example:codeModeWithSkills()→codeModeWithSnippets()skillsToTools()/skillToTool()→snippetsToTools()/snippetToTool()skillsToBindings()/skillsToSimpleBindings()→snippetsToBindings()/snippetsToSimpleBindings()selectRelevantSkills()→selectRelevantSnippets()createSkillManagementTools()→createSnippetManagementTools()createSkillsSystemPrompt()→createSnippetsSystemPrompt()generateSkillTypes()→generateSnippetTypes()createFileSkillStorage()/createMemorySkillStorage()→createFileSnippetStorage()/createMemorySnippetStorage()Types:
Skill,SkillStorage,SkillIndexEntry,SkillStats,SkillBinding,SkillsConfig,CodeModeWithSkillsOptions/Result→ theSnippet…equivalentsOptions:
skills→snippets,skillsAsTools→snippetsAsTools,maxSkillsInContext→maxSnippetsInContextRuntime tools:
search_skills/get_skill/register_skill→search_snippets/get_snippet/register_snippetSandbox bindings are now exposed with the
snippet_prefix (wasskill_)
Breaking — sandbox hook (
@tanstack/ai-code-mode). ThecreateCodeModeToolconfig optiongetSkillBindingsis renamed togetSnippetBindings(same signature — an optional() => Promise<Record<string, ToolBinding>>returning dynamic bindings merged at execution time).Breaking — wire contract (
@tanstack/ai). The Code Mode custom events are renamed:code_mode:skill_call/_result/_error→code_mode:snippet_*(payload fieldskill→snippet), andskill:registered→snippet:registered. The exported event typesCodeModeSkillCallEvent/CodeModeSkillResultEvent/CodeModeSkillErrorEvent/SkillRegisteredEventare renamed to theirSnippetequivalents.
- 0.3.x
0.3.11
10 Aug 2026Add
@tanstack/ai-isolate-quickjs-bun, a Code Mode isolate driver that runs QuickJS natively on the Bun runtime throughbun:ffi(viaquickjs-bun).It implements the same
IsolateDrivercontract as the existing drivers and is a drop-in replacement for@tanstack/ai-isolate-quickjson Bun servers:import { createQuickJSBunIsolateDriver } from '@tanstack/ai-isolate-quickjs-bun' import { createCodeModeTool } from '@tanstack/ai-code-mode' const executeTypescript = createCodeModeTool({ driver: createQuickJSBunIsolateDriver(), tools: [myTool], })Compared to the WASM driver:
The driver requires Bun
>= 1.3.14and throws an error when used on Node.js.It pins
quickjs-bunto an exact version (0.1.2) rather than a range, because that package is still pre-1.0 and compiles QuickJS through TinyCC/bun:ffi— its API and platform support may shift between patch releases (see the package README for the compatibility note and the WindowsQUICKJS_BUN_NATIVE_LIBRARYrequirement).The
@tanstack/ai-code-modeREADME and bundled skill are updated to document the new driver.publish internal dependency ranges as
^x.y.zinstead of exact pinsInternal dependencies on other TanStack AI packages used
workspace:*independenciesandpeerDependencies. pnpm rewrites that to an exact version at publish time, so a released package asked for e.g.@tanstack/ai-utils@0.4.0rather than^0.4.0.Two consequences for consumers:
These fields now use
workspace:^, which publishes as^x.y.z. Every package here is still0.x, so^0.43.1resolves to0.43.xonly — patches dedupe cleanly and no breaking minor is ever pulled in.devDependenciesdeliberately keepworkspace:*: they are never published, and*correctly means "always build against the local copy".
Patch Changes
Add
@tanstack/ai-isolate-quickjs-bun, a Code Mode isolate driver that runs QuickJS natively on the Bun runtime throughbun:ffi(viaquickjs-bun).It implements the same
IsolateDrivercontract as the existing drivers and is a drop-in replacement for@tanstack/ai-isolate-quickjson Bun servers:import { createQuickJSBunIsolateDriver } from '@tanstack/ai-isolate-quickjs-bun' import { createCodeModeTool } from '@tanstack/ai-code-mode' const executeTypescript = createCodeModeTool({ driver: createQuickJSBunIsolateDriver(), tools: [myTool], })Compared to the WASM driver:
Native QuickJS through
bun:ffi— no WebAssembly or asyncify overhead, and no native build step (the QuickJS sources are compiled once per process by Bun's embedded TinyCC).Each context gets a dedicated QuickJS runtime with its own memory and stack limits, so executions on different contexts are not serialized through a shared VM.
Same normalized
MemoryLimitError/StackOverflowError/DisposedErrorcontract, console capture prefixes, and JSON tool-call protocol as the other drivers, plus a normalizedTimeoutErrorfor deadline expiry (the WASM driver surfaces timeouts asInternalError: interrupted).A configurable
maxToolCallslimit (default 1000) bounds output and memory growth from untrusted sandbox code.
The driver requires Bun
>= 1.3.14and throws an error when used on Node.js.It pins
quickjs-bunto an exact version (0.1.2) rather than a range, because that package is still pre-1.0 and compiles QuickJS through TinyCC/bun:ffi— its API and platform support may shift between patch releases (see the package README for the compatibility note and the WindowsQUICKJS_BUN_NATIVE_LIBRARYrequirement).The
@tanstack/ai-code-modeREADME and bundled skill are updated to document the new driver.publish internal dependency ranges as
^x.y.zinstead of exact pinsInternal dependencies on other TanStack AI packages used
workspace:*independenciesandpeerDependencies. pnpm rewrites that to an exact version at publish time, so a released package asked for e.g.@tanstack/ai-utils@0.4.0rather than^0.4.0.Two consequences for consumers:
Duplicate copies. An exact pin cannot dedupe. Installing a newer
@tanstack/aialongside a package pinned to the previous patch produced two copies in the tree, which breaksinstanceofchecks and module-level state, and inflates bundles.Unsatisfiable peers. An exactly pinned
peerDependencyconflicts the moment the internal package ships its next patch, forcing consumers into overrides or--legacy-peer-deps.
These fields now use
workspace:^, which publishes as^x.y.z. Every package here is still0.x, so^0.43.1resolves to0.43.xonly — patches dedupe cleanly and no breaking minor is ever pulled in.devDependenciesdeliberately keepworkspace:*: they are never published, and*correctly means "always build against the local copy".
0.3.9 – 0.3.102 releases that only update dependencies@tanstack/ai 0.43.1Show each
- 0.3.107 Aug 2026@tanstack/ai 0.43.1
- 0.3.94 Aug 2026@tanstack/ai 0.43.0
0.3.8
20 Jul 2026Reading the note…
0.3.7
16 Jul 2026Reading the note…
0.3.6
6 Jul 2026Reading the note…
0.3.5
3 Jul 2026Reading the note…
0.3.4
1 Jul 2026Reading the note…
0.3.3
30 Jun 2026Reading the note…
0.3.2
26 Jun 2026Reading the note…
0.3.1
25 Jun 2026Reading the note…
0.3.0
25 Jun 2026Reading the note…
- 0.2.x
0.2.13
24 Jun 2026Reading the note…
0.2.12
24 Jun 2026Reading the note…
0.2.11
23 Jun 2026Reading the note…
0.2.10
22 Jun 2026Reading the note…
0.2.9
18 Jun 2026Reading the note…
0.2.8
16 Jun 2026Reading the note…
0.2.6
15 Jun 2026Reading the note…
0.2.5
5 Jun 2026Reading the note…
0.2.4
3 Jun 2026Reading the note…
0.2.3
2 Jun 2026Reading the note…
0.2.2
1 Jun 2026Reading the note…
0.2.1
1 Jun 2026Reading the note…