Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

2.4 KB
Raw Blame

AI SDK 5 → 7

Branch fix/agent-server-history (on top of the server-owned history change). Guides: ai-sdk.dev migration 5→6 and 6→7.

Versions (one consistent set, all on @ai-sdk/provider-utils 5.0.49, released 2026-09-25)

Package From To Where
ai 5.0.172 7.0.116 erp, ee, jobs — moved to the pnpm catalog
@ai-sdk/openai 2.0.102 4.0.78 catalog
@ai-sdk/anthropic 2.0.74 4.0.65 erp — moved to the catalog
@ai-sdk/react 2.0.174 4.0.119 (pins ai 7.0.116) erp — moved to the catalog

Remove the six unused @ai-sdk-tools/* packages (no imports; they came with #1659) and their patch (patches/@[email protected] + patchedDependencies).

Runtime: v7 needs Node ≥ 22 and is ESM-only. Docker images and CI use Node 22; erp, ee and jobs are "type": "module". The Vercel project's Node version is not in the repo — it must be 22.x before this ships.

Tasks

  • Bump deps (bare pnpm install), drop @ai-sdk-tools/* and the patch.
  • Agent stream (agent.service.ts): system → instructions, stepCountIs → isStepCount, onFinish → onEnd, totalUsage → usage, cachedInputTokens → inputTokenDetails.cacheReadTokens, toUIMessageStreamResponse → createUIMessageStreamResponse({ stream: toUIMessageStream({ stream: result.stream, … }) }), await convertToModelMessages.
  • Tool-part helpers (isToolUIPart / getToolName now cover dynamic tools too) in agent.service.ts, AgentMessage.tsx, useAgentThread.ts.
  • Title generation (generateText): system/prompt per v7.
  • generateObject → generateText({ output: Output.object({ schema }) }) at all seven call sites: inspection balloon analysis, CSV column mapping, quote drag filename parse, ee account mapping, ee Paperless Parts (2), jobs onboarding.
  • useChat / DefaultChatTransport (@ai-sdk/react 4): transport options, regenerate, clearError, stop, status names.
  • Typecheck erp, ee, jobs; agent + catalog tests; biome; ERP production build.
  • Live run of the agent (search, follow-up, Stop, Retry, thread switch, feedback, navigate) and all seven structured schemas against OpenAI. Found: strict mode refused the CSV route's .partial() schema (fixed to one z.string() per field).
  • Rules: chat-ai-sdk-info.md / agent-knowledge-base.md reflect v7 names.