Minor Changes
- #1138
36e2020Thanks @threepointone! - Drop Zod v3 from peer dependency range — now requireszod ^4.0.0. Replace dynamicimport("ai")withz.fromJSONSchema()from Zod 4 for MCP tool schema conversion, removing theairuntime dependency from the agents core. RemoveensureJsonSchema().
Patch Changes
-
#1149
47ce125Thanks @threepointone! - feat: add TanStack AI integration (@cloudflare/codemode/tanstack-ai)New entry point for using codemode with TanStack AI's
chat()instead of the Vercel AI SDK'sstreamText().import { createCodeTool, tanstackTools, } from "@cloudflare/codemode/tanstack-ai"; import { chat } from "@tanstack/ai"; const codeTool = createCodeTool({ tools: [tanstackTools(myServerTools)], executor, }); const stream = chat({ adapter, tools: [codeTool], messages });
Exports:
createCodeTool— returns a TanStack AIServerTool(viatoolDefinition().server())tanstackTools— converts aTanStackTool[]into aToolProviderwith pre-generated typesgenerateTypes— generates TypeScript type definitions from TanStack AI toolsresolveProvider— re-exported framework-agnostic provider resolver
Internal cleanup: extracted
resolveProviderinto a framework-agnosticresolve.tsmodule so the main entry (@cloudflare/codemode) no longer pulls in theaipackage at runtime. Shared constants and helpers moved toshared.tsto avoid duplication between the AI SDK and TanStack AI entry points.