Skip to content

fix(ai-client): add @standard-schema/spec to devDependencies#428

Merged
AlemTuzlak merged 6 commits intomainfrom
fix/standard-schema-dependency
Apr 20, 2026
Merged

fix(ai-client): add @standard-schema/spec to devDependencies#428
AlemTuzlak merged 6 commits intomainfrom
fix/standard-schema-dependency

Conversation

@AlemTuzlak
Copy link
Copy Markdown
Contributor

@AlemTuzlak AlemTuzlak commented Apr 8, 2026

Summary

Adds @standard-schema/spec to @tanstack/ai-client's devDependencies so TypeScript can follow through the InferToolInput / InferToolOutput chain at build time. Types-only dep — zero runtime cost.

Without it, @tanstack/ai-client's published .d.ts files reference types from @tanstack/ai that depend on StandardJSONSchemaV1, and the resolution silently degrades to any/unknown at the consumer site. That's what causes toolDefinition(...).client((input) => ...) to show input: unknown in user code.

Kept as a devDep intentionally — it's only needed during @tanstack/ai-client's own type checking / build, not shipped at runtime.

Fixes #235

Test plan

  • pnpm test:types on @tanstack/ai and @tanstack/ai-client
  • pnpm test:lib on both (198 tests on ai-client)

Summary by CodeRabbit

  • Bug Fixes

    • Restored correct type inference for tool input/output and chat return types to avoid them resolving to unknown.
  • Chores

    • Added a development dependency and updated workspace/configuration entries to support the fix.
  • Release

    • Marked as a patch release.

Without this package installed, all types that depend on StandardJSONSchemaV1
silently degrade to any. Moving from devDependencies to dependencies ensures
consumers get it transitively.

Fixes #235
@AlemTuzlak AlemTuzlak requested a review from a team April 8, 2026 11:36
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 8, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fc929feb-b557-4556-a5d7-e66da933a297

📥 Commits

Reviewing files that changed from the base of the PR and between 3f5d6d4 and c8fa782.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • knip.json
✅ Files skipped from review due to trivial changes (1)
  • knip.json

📝 Walkthrough

Walkthrough

Adds @standard-schema/spec as a devDependency for the @tanstack/ai-client TypeScript package and records a changeset; also updates knip.json to ignore that dependency. Changes target build-time type resolution for tool input/output inference.

Changes

Cohort / File(s) Summary
Changeset Entry
​.changeset/fix-standard-schema-dependency.md
Adds a new changeset declaring a patch release for @tanstack/ai-client that documents adding @standard-schema/spec to devDependencies.
Package Configuration
packages/typescript/ai-client/package.json
Adds @standard-schema/spec@^1.1.0 to devDependencies. No public API or runtime code changed.
Lint/Tooling Config
knip.json
Adds a workspace entry for packages/typescript/ai-client with ignoreDependencies: ["@standard-schema/spec"] to avoid knip warnings for the new devDependency.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐇 I found a spec to help types bloom,
No more unknowns in the typing room,
Dev deps added, tidy and neat,
Tool inputs now match — oh what a treat! 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the primary change: adding @standard-schema/spec to devDependencies for the ai-client package.
Description check ✅ Passed The description is comprehensive, explaining the motivation, rationale, and testing performed; however, the checklist items are not explicitly marked as completed.
Linked Issues check ✅ Passed The PR successfully addresses issue #235 by adding @standard-schema/spec to devDependencies, which resolves the type inference problem for tool input/output in .client and .server handlers.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the type inference issue: adding the dependency, updating package.json, and configuring Knip; no unrelated modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/standard-schema-dependency

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

🚀 Changeset Version Preview

10 package(s) bumped directly, 23 bumped as dependents.

🟥 Major bumps

Package Version Reason
@tanstack/ai 0.10.3 → 1.0.0 Changeset
@tanstack/ai-anthropic 0.7.4 → 1.0.0 Changeset
@tanstack/ai-event-client 0.2.3 → 1.0.0 Changeset
@tanstack/ai-gemini 0.8.8 → 1.0.0 Changeset
@tanstack/ai-grok 0.6.5 → 1.0.0 Changeset
@tanstack/ai-groq 0.1.4 → 1.0.0 Changeset
@tanstack/ai-ollama 0.6.6 → 1.0.0 Changeset
@tanstack/ai-openai 0.7.5 → 1.0.0 Changeset
@tanstack/ai-openrouter 0.7.7 → 1.0.0 Changeset
@tanstack/ai-code-mode 0.1.3 → 1.0.0 Dependent
@tanstack/ai-code-mode-skills 0.1.3 → 1.0.0 Dependent
@tanstack/ai-elevenlabs 0.1.4 → 1.0.0 Dependent
@tanstack/ai-fal 0.6.13 → 1.0.0 Dependent
@tanstack/ai-isolate-node 0.1.3 → 1.0.0 Dependent
@tanstack/ai-isolate-quickjs 0.1.3 → 1.0.0 Dependent
@tanstack/ai-preact 0.6.15 → 1.0.0 Dependent
@tanstack/ai-react 0.7.11 → 1.0.0 Dependent
@tanstack/ai-react-ui 0.6.1 → 1.0.0 Dependent
@tanstack/ai-solid 0.6.15 → 1.0.0 Dependent
@tanstack/ai-solid-ui 0.6.1 → 1.0.0 Dependent
@tanstack/ai-svelte 0.6.15 → 1.0.0 Dependent
@tanstack/ai-vue 0.6.15 → 1.0.0 Dependent

🟩 Patch bumps

Package Version Reason
@tanstack/ai-client 0.7.10 → 0.7.11 Changeset
@tanstack/ai-code-mode-models-eval 0.0.6 → 0.0.7 Dependent
@tanstack/ai-devtools-core 0.3.20 → 0.3.21 Dependent
@tanstack/ai-isolate-cloudflare 0.1.3 → 0.1.4 Dependent
@tanstack/ai-vue-ui 0.1.26 → 0.1.27 Dependent
@tanstack/preact-ai-devtools 0.1.24 → 0.1.25 Dependent
@tanstack/react-ai-devtools 0.2.24 → 0.2.25 Dependent
@tanstack/solid-ai-devtools 0.2.24 → 0.2.25 Dependent
ts-svelte-chat 0.1.32 → 0.1.33 Dependent
ts-vue-chat 0.1.32 → 0.1.33 Dependent
vanilla-chat 0.0.30 → 0.0.31 Dependent

@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Apr 8, 2026

View your CI Pipeline Execution ↗ for commit c8fa782

Command Status Duration Result
nx run-many --targets=build --exclude=examples/** ✅ Succeeded 2s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-20 11:44:20 UTC

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 8, 2026

Open in StackBlitz

@tanstack/ai

npm i https://pkg.pr.new/@tanstack/ai@428

@tanstack/ai-anthropic

npm i https://pkg.pr.new/@tanstack/ai-anthropic@428

@tanstack/ai-client

npm i https://pkg.pr.new/@tanstack/ai-client@428

@tanstack/ai-code-mode

npm i https://pkg.pr.new/@tanstack/ai-code-mode@428

@tanstack/ai-code-mode-skills

npm i https://pkg.pr.new/@tanstack/ai-code-mode-skills@428

@tanstack/ai-devtools-core

npm i https://pkg.pr.new/@tanstack/ai-devtools-core@428

@tanstack/ai-elevenlabs

npm i https://pkg.pr.new/@tanstack/ai-elevenlabs@428

@tanstack/ai-event-client

npm i https://pkg.pr.new/@tanstack/ai-event-client@428

@tanstack/ai-fal

npm i https://pkg.pr.new/@tanstack/ai-fal@428

@tanstack/ai-gemini

npm i https://pkg.pr.new/@tanstack/ai-gemini@428

@tanstack/ai-grok

npm i https://pkg.pr.new/@tanstack/ai-grok@428

@tanstack/ai-groq

npm i https://pkg.pr.new/@tanstack/ai-groq@428

@tanstack/ai-isolate-cloudflare

npm i https://pkg.pr.new/@tanstack/ai-isolate-cloudflare@428

@tanstack/ai-isolate-node

npm i https://pkg.pr.new/@tanstack/ai-isolate-node@428

@tanstack/ai-isolate-quickjs

npm i https://pkg.pr.new/@tanstack/ai-isolate-quickjs@428

@tanstack/ai-ollama

npm i https://pkg.pr.new/@tanstack/ai-ollama@428

@tanstack/ai-openai

npm i https://pkg.pr.new/@tanstack/ai-openai@428

@tanstack/ai-openrouter

npm i https://pkg.pr.new/@tanstack/ai-openrouter@428

@tanstack/ai-preact

npm i https://pkg.pr.new/@tanstack/ai-preact@428

@tanstack/ai-react

npm i https://pkg.pr.new/@tanstack/ai-react@428

@tanstack/ai-react-ui

npm i https://pkg.pr.new/@tanstack/ai-react-ui@428

@tanstack/ai-solid

npm i https://pkg.pr.new/@tanstack/ai-solid@428

@tanstack/ai-solid-ui

npm i https://pkg.pr.new/@tanstack/ai-solid-ui@428

@tanstack/ai-svelte

npm i https://pkg.pr.new/@tanstack/ai-svelte@428

@tanstack/ai-vue

npm i https://pkg.pr.new/@tanstack/ai-vue@428

@tanstack/ai-vue-ui

npm i https://pkg.pr.new/@tanstack/ai-vue-ui@428

@tanstack/preact-ai-devtools

npm i https://pkg.pr.new/@tanstack/preact-ai-devtools@428

@tanstack/react-ai-devtools

npm i https://pkg.pr.new/@tanstack/react-ai-devtools@428

@tanstack/solid-ai-devtools

npm i https://pkg.pr.new/@tanstack/solid-ai-devtools@428

commit: c8fa782

@AlemTuzlak AlemTuzlak changed the title fix(ai): move @standard-schema/spec to dependencies fix(ai-client): add @standard-schema/spec to devDependencies Apr 20, 2026
It's not imported directly in ai-client's source, but is needed at
build time so TypeScript can resolve the forward references to
`StandardJSONSchemaV1` that live inside `InferToolInput` /
`InferToolOutput` (both imported from @tanstack/ai and re-used in
ai-client's public .d.ts surface). Knip's static import graph can't
see that, so whitelist the dep here.
@AlemTuzlak AlemTuzlak merged commit 1d6f3be into main Apr 20, 2026
8 checks passed
@AlemTuzlak AlemTuzlak deleted the fix/standard-schema-dependency branch April 20, 2026 12:47
@github-actions github-actions bot mentioned this pull request Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tool definition does not infer types in .server and .client

1 participant