Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

CHANGELOG.md

691 lines33.9 KB

@tanstack/ai-code-mode

0.4.18

Patch Changes

0.4.17

Patch Changes

  • #1487 04e8d16 - State in the Code Mode system prompt and in the execute_typescript tool description that discover_tools is a separate tool call. It is not a function inside the sandbox. Models no longer call discover_tools from inside execute_typescript and get a ReferenceError.

  • Updated dependencies [a450d00, c54e20c, a56192e, 740ae66, 5099a32, 820429f, 0abae97, 8c68c2d]:

    • @tanstack/ai@0.62.0

0.4.16

Patch Changes

0.4.15

Patch Changes

  • Updated dependencies [ef0a00f]:
    • @tanstack/ai@0.60.0

0.4.14

Patch Changes

0.4.13

Patch Changes

  • Updated dependencies [796f2b5]:
    • @tanstack/ai@0.58.0

0.4.12

Patch Changes

0.4.11

Patch Changes

0.4.10

Patch Changes

0.4.9

Patch Changes

  • #1350 53e2ec0 - docs(skills): type-check the code fences in every package skill with kiira and fix the ones that did not compile

  • Updated dependencies [c17bc95, 53e2ec0, 6269eff]:

    • @tanstack/ai@0.54.0

0.4.8

Patch Changes

  • Updated dependencies [21775ee]:
    • @tanstack/ai@0.53.0

0.4.7

Patch Changes

0.4.6

Patch Changes

0.4.5

Patch Changes

0.4.4

Patch Changes

  • Updated dependencies [b7ebcb0]:
    • @tanstack/ai@0.49.0

0.4.3

Patch Changes

  • Updated dependencies [1c0415b]:
    • @tanstack/ai@0.48.0

0.4.2

Patch Changes

0.4.1

Patch Changes

0.4.0

Minor Changes

  • #1114 0fb8263 - Rename Code Mode "skills" to "snippets" to disambiguate them from agent skills (the SKILL.md packaging system).

    Breaking — package rename. @tanstack/ai-code-mode-skills is now published as @tanstack/ai-code-mode-snippets. Update your dependency and imports. The /storage subpath is unchanged.

    Breaking — API rename. Every Skill/skill identifier in the package public API becomes Snippet/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 → the Snippet… equivalents
    • Options: skills → snippets, skillsAsTools → snippetsAsTools, maxSkillsInContext → maxSnippetsInContext
    • Runtime tools: search_skills / get_skill / register_skill → search_snippets / get_snippet / register_snippet
    • Sandbox bindings are now exposed with the snippet_ prefix (was skill_)

    Breaking — sandbox hook (@tanstack/ai-code-mode). The createCodeModeTool config option getSkillBindings is renamed to getSnippetBindings (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 field skill → snippet), and skill:registered → snippet:registered. The exported event types CodeModeSkillCallEvent / CodeModeSkillResultEvent / CodeModeSkillErrorEvent / SkillRegisteredEvent are renamed to their Snippet equivalents.

Patch Changes

0.3.11

Patch Changes

  • #750 b2b82e4 - Add @tanstack/ai-isolate-quickjs-bun, a Code Mode isolate driver that runs QuickJS natively on the Bun runtime through bun:ffi (via quickjs-bun).

    It implements the same IsolateDriver contract as the existing drivers and is a drop-in replacement for @tanstack/ai-isolate-quickjs on 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 / DisposedError contract, console capture prefixes, and JSON tool-call protocol as the other drivers, plus a normalized TimeoutError for deadline expiry (the WASM driver surfaces timeouts as InternalError: interrupted).
    • A configurable maxToolCalls limit (default 1000) bounds output and memory growth from untrusted sandbox code.

    The driver requires Bun >= 1.3.14 and throws an error when used on Node.js.

    It pins quickjs-bun to 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 Windows QUICKJS_BUN_NATIVE_LIBRARY requirement).

    The @tanstack/ai-code-mode README and bundled skill are updated to document the new driver.

  • #1071 ea9c077 - fix: publish internal dependency ranges as ^x.y.z instead of exact pins

    Internal dependencies on other TanStack AI packages used workspace:* in dependencies and peerDependencies. pnpm rewrites that to an exact version at publish time, so a released package asked for e.g. @tanstack/ai-utils@0.4.0 rather than ^0.4.0.

    Two consequences for consumers:

    • Duplicate copies. An exact pin cannot dedupe. Installing a newer @tanstack/ai alongside a package pinned to the previous patch produced two copies in the tree, which breaks instanceof checks and module-level state, and inflates bundles.
    • Unsatisfiable peers. An exactly pinned peerDependency conflicts 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 still 0.x, so ^0.43.1 resolves to 0.43.x only — patches dedupe cleanly and no breaking minor is ever pulled in.

    devDependencies deliberately keep workspace:*: they are never published, and * correctly means "always build against the local copy".

  • Updated dependencies [59aa8b5, ee07854, b785cc4, 47e2464, dd7ddf1, 6903978, fdb791a, 7aa4ae9, ea9c077]:

    • @tanstack/ai@0.44.0

0.3.10

Patch Changes

  • Updated dependencies [ed44467]:
    • @tanstack/ai@0.43.1

0.3.9

Patch Changes

  • Updated dependencies [7499171]:
    • @tanstack/ai@0.43.0

0.3.8

Patch Changes

  • Updated dependencies [3e1b510]:
    • @tanstack/ai@0.42.0

0.3.7

Patch Changes

0.3.6

Patch Changes

  • Updated dependencies [5deda27]:
    • @tanstack/ai@0.40.0

0.3.5

Patch Changes

0.3.4

Patch Changes

  • #431 8f8be19 - fix(ai-code-mode): warn when tool parameters look like secrets

    Add warnIfBindingsExposeSecrets() that scans tool input schemas for secret-like parameter names (apiKey, token, password, etc.) and emits console.warn during development. Code Mode executes LLM-generated code — any secrets passed through tool parameters are accessible to generated code.

0.3.3

Patch Changes

0.3.2

Patch Changes

  • Updated dependencies [c1a8732]:
    • @tanstack/ai@0.38.0

0.3.1

Patch Changes

  • #844 a6cceba - Republish all packages with their compiled dist/ output.

    Releases 0.33.0–0.36.0 were published without a dist/ directory: the release workflow relied on an Nx-cached build whose outputs were not materialized to disk before changeset publish packed the tarballs, and files: ["dist"] silently includes nothing when dist/ is absent. The published packages therefore contained only src/, so every export (./dist/esm/*.js) resolved to a missing file and the packages were uninstallable.

    The publish step now runs a fresh, cache-bypassing build of all packages immediately before publishing, guaranteeing compiled artifacts are present in every tarball.

  • Updated dependencies [a6cceba]:

    • @tanstack/ai@0.37.0

0.3.0

Minor Changes

  • #726 fbd3762 - Add lazy tool support (progressive disclosure) to Code Mode. Tools marked lazy: true are kept out of the execute_typescript system prompt and listed in a discoverable catalog; the model fetches their TypeScript signatures on demand via a new discover_tools tool. A shared optional lazyToolsConfig (includeDescription: 'none' | 'first-sentence' | 'full') tunes the catalog detail for both chat() and createCodeMode(). createCodeMode now also returns discoveryTool and a tools array (backward compatible — tool and systemPrompt are unchanged).

Patch Changes

  • Updated dependencies [fbd3762]:
    • @tanstack/ai@0.36.0

0.2.13

Patch Changes

  • Updated dependencies [c04abd3]:
    • @tanstack/ai@0.35.0

0.2.12

Patch Changes

  • Updated dependencies [4188693]:
    • @tanstack/ai@0.34.1

0.2.11

Patch Changes

  • Updated dependencies [31de22b]:
    • @tanstack/ai@0.34.0

0.2.10

Patch Changes

  • #799 81e3aee - fix(code-mode): drop esbuild for edge-safe TypeScript stripping

    @tanstack/ai-code-mode hard-depended on esbuild to strip TypeScript before sandbox execution. esbuild ships a Node-native binary and pulls in Node-only built-ins (e.g. require("pnpapi")), which broke browser bundles and edge runtimes such as Cloudflare Workers/Pages. The default transpiler is now sucrase, a pure-JavaScript transform that is safe to bundle for browsers and edge runtimes.

    sucrase is a type-stripper rather than a down-leveler, so unlike esbuild it does not compile a few exotic constructs: TypeScript value namespace blocks are dropped, decorators / the accessor keyword pass through un-lowered, and post-ES2022 syntax (using, RegExp /v·/d flags) is left as-is (fine on modern V8/Node sandboxes, but may fail on older engines like QuickJS). A new transpile escape hatch on createCodeModeTool lets you swap in a heavier Node-only transpiler (e.g. esbuild) when you need that coverage and don't need edge safety.

  • #794 3bf0dbf - fix(code-mode): validate tool input/output against schemas

    Code mode converted a tool's input/output schema to JSON Schema for the prompt but never validated against it — unlike the normal agent-loop path. A provided inputSchema/outputSchema was effectively just documentation: inner (external_*) tools received raw, un-coerced sandbox args and outputs went unchecked. toolToBinding now runs the same Standard Schema validation, so defaults/coercions apply and invalid input/output throws an agent-readable error.

  • Updated dependencies [2cb0313, 18e5f4d, 21720dd, 243b8fa]:

    • @tanstack/ai@0.33.0

0.2.9

Patch Changes

0.2.8

Patch Changes

  • Updated dependencies [07aaf8b]:
    • @tanstack/ai@0.31.0

0.2.7

Patch Changes

  • #769 1d1bb52 - Add repository metadata (homepage, bugs, funding), fix repository.directory to point at each package, and include an MIT LICENSE file in every published package.

  • Updated dependencies [7103348, 1d1bb52]:

    • @tanstack/ai@0.30.0

0.2.6

Patch Changes

0.2.5

Patch Changes

0.2.4

Patch Changes

  • Updated dependencies [6df32b5]:
    • @tanstack/ai@0.27.0

0.2.3

Patch Changes

  • Updated dependencies []:
    • @tanstack/ai@0.26.1

0.2.2

Patch Changes

  • Updated dependencies [5d6cd28]:
    • @tanstack/ai@0.26.0

0.2.1

Patch Changes

  • Updated dependencies [c251038]:
    • @tanstack/ai@0.25.0

0.2.0

Minor Changes

  • #628 8036b50 - Add typed runtime context for tools and middleware.

    Tools and middleware can now declare the runtime context shape they require, and chat(), ChatClient, and the framework useChat / createChat hooks infer the merged requirement and type-check the context option you pass against it.

    type AppContext = { userId: string; db: Db }
    
    const listNotes = toolDefinition({
      name: 'list_notes' /* ... */,
    }).server<AppContext>((_input, ctx) =>
      ctx.context.db.notes.findMany({ userId: ctx.context.userId }),
    )
    
    chat({
      adapter,
      messages,
      tools: [listNotes],
      context: { userId, db }, // required and type-checked because listNotes declares AppContext
    })

    Runtime context is request-local application state for tool and middleware implementations (authenticated users, database clients, tenancy, feature flags, loggers, browser services). It is never sent to the model and is distinct from the AG-UI RunAgentInput.context protocol field.

    Untyped tools and middleware continue to receive unknown context and do not force a context option. Client tools receive client-local context via ChatClient / useChat; use forwardedProps to hand serializable client data to the server and map it into server context explicitly. See the new Runtime Context guide for details.

    Behavior change: tool output validation now also runs when a tool returns undefined or null. Previously these values bypassed outputSchema validation entirely; now the schema decides whether they are valid, so a tool whose schema forbids undefined/null surfaces a validation error (output-error) instead of silently passing. Tools whose schema permits null/undefined (e.g. nullable or void outputs) are unaffected.

Patch Changes

0.1.24

Patch Changes

  • Updated dependencies [94bb9c0]:
    • @tanstack/ai@0.23.1

0.1.23

Patch Changes

0.1.22

Patch Changes

  • Updated dependencies []:
    • @tanstack/ai@0.22.1

0.1.21

Patch Changes

  • Updated dependencies [02f7d04]:
    • @tanstack/ai@0.22.0

0.1.20

Patch Changes

  • Updated dependencies [e144a53]:
    • @tanstack/ai@0.21.3

0.1.19

Patch Changes

  • Refresh package README content and npm metadata for better discoverability. (#626)

  • Updated dependencies [ebeb22e]:

    • @tanstack/ai@0.21.2

0.1.18

Patch Changes

  • Updated dependencies [573f12e]:
    • @tanstack/ai@0.21.1

0.1.17

Patch Changes

  • Adopt @tanstack/eslint-config@0.4.0 and clean up the local override layer. (#607)

    • Bump @tanstack/eslint-config from 0.3.3 to 0.4.0.
    • Drop dead pnpm/enforce-catalog and pnpm/json-enforce-catalog disables (upstream removed eslint-plugin-pnpm in 0.3.1).
    • Drop the no-case-declarations: off override — no current source actually violates it.
    • Drop the no-shadow: off override — upstream sets it to warn, so it surfaces in editors without blocking CI.
    • Remove ~25 unnecessary type assertions across the publishable packages that the upgraded typescript-eslint now catches via no-unnecessary-type-assertion. One deliberately defensive cast in ag-ui-wire.ts is preserved with an inline opt-out and a reason comment.

    No public-API or runtime-behavior changes.

  • Updated dependencies [ec1393d, 188fe11]:

    • @tanstack/ai@0.21.0

0.1.16

Patch Changes

  • Tighten TypeScript safety: enable noImplicitOverride, (#579) noFallthroughCasesInSwitch, and useDefineForClassFields in the root tsconfig.json; add a typed-ESLint block scoped to packages/*/src/** that turns on no-floating-promises, no-misused-promises, await-thenable, switch-exhaustiveness-check, consistent-type-exports, prefer-readonly, and no-non-null-assertion (errors), plus no-explicit-any (warning). @ts-ignore and @ts-nocheck are disallowed in library source via @typescript-eslint/ban-ts-comment, and as unknown as <T> double-casts are blocked by a no-restricted-syntax rule (escape hatches available with an inline reason). Two flags from the original five-flag set — noPropertyAccessFromIndexSignature and exactOptionalPropertyTypes — were tried and rolled back: they produced ~500 lines of bracket- access and conditional-spread churn without catching any real bugs, and exactOptionalPropertyTypes would have forced consumers using it themselves to deal with our internals' style preferences.

    User-visible API surface is unchanged; this is a hardening pass to keep streaming/agent-loop correctness and discriminated-union exhaustiveness honest going forward. See issue #564.

  • Updated dependencies [2ad137b]:

    • @tanstack/ai@0.20.1

0.1.15

Patch Changes

  • Updated dependencies [496db9c]:
    • @tanstack/ai@0.20.0

0.1.14

Patch Changes

  • Updated dependencies [617b5b5]:
    • @tanstack/ai@0.19.1

0.1.13

Patch Changes

  • Updated dependencies [2e0e2eb]:
    • @tanstack/ai@0.19.0

0.1.12

Patch Changes

0.1.11

Patch Changes

0.1.10

Patch Changes

  • Updated dependencies [87f305c]:
    • @tanstack/ai@0.16.0

0.1.9

Patch Changes

0.1.8

Patch Changes

0.1.7

Patch Changes

  • Updated dependencies [c1fd96f]:
    • @tanstack/ai@0.13.0

0.1.6

Patch Changes

  • Updated dependencies [e32583e]:
    • @tanstack/ai@0.12.0

0.1.5

Patch Changes

  • Updated dependencies [633a3d9]:
    • @tanstack/ai@0.11.1

0.1.4

Patch Changes

  • Updated dependencies [12d43e5]:
    • @tanstack/ai@0.11.0

0.1.3

Patch Changes

  • Updated dependencies [c780bc1]:
    • @tanstack/ai@0.10.3

0.1.2

Patch Changes

  • Updated dependencies [4445410]:
    • @tanstack/ai@0.10.2

0.1.1

Patch Changes

  • Add @tanstack/intent agent skills for AI coding assistants (#432)

    Adds 10 skill files covering chat-experience, tool-calling, media-generation, code-mode, structured-outputs, adapter-configuration, ag-ui-protocol, middleware, and custom-backend-integration. Skills guide AI agents to generate correct TanStack AI code patterns and avoid common mistakes.

  • Updated dependencies [1d1c58f]:

    • @tanstack/ai@0.10.1

0.1.0

Minor Changes

  • Add code mode and isolate packages for secure AI code execution (#362)

    Also includes fixes for Ollama tool call argument streaming and usage reporting, OpenAI realtime adapter handling of missing call_id/item_id, realtime client guards for missing toolCallId, and new DevtoolsChatMiddleware type export from ai-event-client.

Patch Changes

  • Updated dependencies [54abae0]:
    • @tanstack/ai@0.10.0