Skip to content

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

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

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

Conversation

@AlemTuzlak

@AlemTuzlakAlemTuzlak commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

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 teamApril 8, 2026 11:36
@coderabbitai

coderabbitaiBot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

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 nameStatusExplanation
Title check✅ PassedThe title accurately and concisely describes the primary change: adding @standard-schema/spec to devDependencies for the ai-client package.
Description check✅ PassedThe description is comprehensive, explaining the motivation, rationale, and testing performed; however, the checklist items are not explicitly marked as completed.
Linked Issues check✅ PassedThe 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✅ PassedAll 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✅ PassedNo 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

github-actionsBot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

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

🟥 Major bumps

PackageVersionReason
@tanstack/ai0.10.3 → 1.0.0Changeset
@tanstack/ai-anthropic0.7.4 → 1.0.0Changeset
@tanstack/ai-event-client0.2.3 → 1.0.0Changeset
@tanstack/ai-gemini0.8.8 → 1.0.0Changeset
@tanstack/ai-grok0.6.5 → 1.0.0Changeset
@tanstack/ai-groq0.1.4 → 1.0.0Changeset
@tanstack/ai-ollama0.6.6 → 1.0.0Changeset
@tanstack/ai-openai0.7.5 → 1.0.0Changeset
@tanstack/ai-openrouter0.7.7 → 1.0.0Changeset
@tanstack/ai-code-mode0.1.3 → 1.0.0Dependent
@tanstack/ai-code-mode-skills0.1.3 → 1.0.0Dependent
@tanstack/ai-elevenlabs0.1.4 → 1.0.0Dependent
@tanstack/ai-fal0.6.13 → 1.0.0Dependent
@tanstack/ai-isolate-node0.1.3 → 1.0.0Dependent
@tanstack/ai-isolate-quickjs0.1.3 → 1.0.0Dependent
@tanstack/ai-preact0.6.15 → 1.0.0Dependent
@tanstack/ai-react0.7.11 → 1.0.0Dependent
@tanstack/ai-react-ui0.6.1 → 1.0.0Dependent
@tanstack/ai-solid0.6.15 → 1.0.0Dependent
@tanstack/ai-solid-ui0.6.1 → 1.0.0Dependent
@tanstack/ai-svelte0.6.15 → 1.0.0Dependent
@tanstack/ai-vue0.6.15 → 1.0.0Dependent

🟩 Patch bumps

PackageVersionReason
@tanstack/ai-client0.7.10 → 0.7.11Changeset
@tanstack/ai-code-mode-models-eval0.0.6 → 0.0.7Dependent
@tanstack/ai-devtools-core0.3.20 → 0.3.21Dependent
@tanstack/ai-isolate-cloudflare0.1.3 → 0.1.4Dependent
@tanstack/ai-vue-ui0.1.26 → 0.1.27Dependent
@tanstack/preact-ai-devtools0.1.24 → 0.1.25Dependent
@tanstack/react-ai-devtools0.2.24 → 0.2.25Dependent
@tanstack/solid-ai-devtools0.2.24 → 0.2.25Dependent
ts-svelte-chat0.1.32 → 0.1.33Dependent
ts-vue-chat0.1.32 → 0.1.33Dependent
vanilla-chat0.0.30 → 0.0.31Dependent

@nx-cloud

nx-cloudBot commented Apr 8, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit c8fa782

CommandStatusDurationResult
nx run-many --targets=build --exclude=examples/**✅ Succeeded2sView ↗

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

@pkg-pr-new

pkg-pr-newBot commented Apr 8, 2026

Copy link
Copy Markdown

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

@AlemTuzlakAlemTuzlak changed the title fix(ai): move @standard-schema/spec to dependenciesfix(ai-client): add @standard-schema/spec to devDependenciesApr 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 mainApr 20, 2026
8 checks passed
@AlemTuzlak
AlemTuzlak deleted the fix/standard-schema-dependency branch April 20, 2026 12:47
@github-actionsgithub-actionsBot mentioned this pull request Apr 20, 2026
Sign up for freeto 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

@AlemTuzlak