Upgrade dependencies to latest (AI SDK v7) and keep GLM 4.6 + Qwen 3 working (#47)

Merged
HB
2mo ago
+3836-2918

Summary

Issue #47 asks for GLM 4.6 (Z.ai) and Qwen 3 (Alibaba Cloud) support. Those providers already exist in the tree — ZaiProvider (GLM 4.6 / 4.5 / 4.5 Air) and QwenProvider (Qwen3 Max / Qwen3 Coder Plus / Qwen Plus / Qwen Turbo) — and both are registered in allProviders, exported, documented, and covered by tests/providers.qwenZai.test.ts.

They already do the right thing per the request: each re-uses an existing AI SDK provider (@ai-sdk/openai-compatible, the AI-SDK-recommended path for the OpenAI-compatible DashScope and Z.ai endpoints) and makes no direct API calls. Purpose-built community packages (qwen-ai-provider, zhipu-ai-provider) were evaluated and rejected — they are version-misaligned with this project's AI SDK (one still targets @ai-sdk/provider v1 / LanguageModelV1).

So the substance of this PR is bringing the whole dependency stack up to latest so those providers (and the rest of the library) keep working on current tooling, then verifying the result end-to-end.

Dependency upgrades

  • AI SDK v5 → v7: ai, @ai-sdk/provider (v2 → v4), and every @ai-sdk/* provider, plus @openrouter/ai-sdk-provider, ollama-ai-provider-v2, and ai-sdk-provider-claude-code. v7 providers now emit LanguageModelV4 (specificationVersion: "v4"), so the createInstance contract was renamed LanguageModelV2 → LanguageModelV4 across the base class, all 16 providers, and getSdkLanguageModel. Peer floors were raised to the majors that emit LanguageModelV4.
  • React toolchain: React 19.2.7, react-hook-form 7.81, Vite 8, Vitest 4, @vitejs/plugin-react 6, vite-plugin-dts 5 (rollupTypes → bundleTypes, now needs @microsoft/api-extractor), jsdom 29, Testing Library, prettier 3.9.
  • Linting: ESLint 10, typescript-eslint 8.64, unicorn 71, react-hooks 7, sonarjs 4. Migrated eslint-plugin-import → eslint-plugin-import-x because the former's latest (2.32.0) crashes on ESLint 10 (its order rule calls the removed sourceCode.getTokenOrCommentBefore API).
  • Storybook 9 → 10 (all addons + eslint-plugin-storybook), which also cleared most pnpm audit findings.

Deliberate holds and decisions

  • TypeScript stays on 5.9.x. typescript-eslint's latest still pins its peer to typescript ">=4.8.4 <6.1.0", so TypeScript 7 would break the lint pass.
  • Tailwind stays on 3.x (3.4.19). The library ships a JS tailwind-preset as public API; Tailwind 4's CSS-first rewrite would be a breaking change for consumers and a rewrite of the theming / VSCode-integration layer — out of scope for a dependency bump and best decided on its own.
  • pnpm-workspace.yaml added. pnpm 11 no longer reads settings from the package.json pnpm field. It carries a rollup security override (dev/build tooling only — nothing overridden ships in the published package), an explicit build-script opt-out, and minimumReleaseAge: 0.
  • ⚠️ Breaking for consumers: the AI SDK peer ranges now require the provider majors that emit LanguageModelV4, and createInstance returns LanguageModelV4. Consumers must be on AI SDK v7-era providers. Suggest a minor version bump on the next release (left for the maintainer's np flow).

Verification

Every CI gate passes locally against the upgraded tree:

checkresult
tsc -b (typecheck)✅
eslint .✅
prettier --check✅
vitest (34 passed, 4 skipped)✅
vite build + packaging (publint + attw)✅
pnpm audit --audit-level=moderate✅ no known vulnerabilities
pnpm install --frozen-lockfile✅
storybook build✅

Docs, the package description, and the Storybook intro were updated from "AI SDK v5 / LanguageModelV2" to "AI SDK v7 / LanguageModelV4".

Closes #47

🤖 Generated with Claude Code

https://claude.ai/code/session_015oj8aXYorx82K6sUbvK258


Generated by Claude Code