You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bump @ag-ui/core in packages/ai from 0.1.1-canary.beta.0 to 1.0.0 and source the AG-UI event types from the package instead of hand-written copies.
Why
packages/ai/src/types.ts already imports every AG-UI event type from @ag-ui/core and declares the local events with extends. The three subagent events in PR feat: add AG-UI subagents to chat() and useChat #1438 are the exception because the pinned canary predates them.
@ag-ui/core@1.0.0 (published 2026-09-17) ships SubagentStartedEvent, SubagentFinishedEvent, SubagentErrorEvent, SubagentInfo, SubagentRunId, the Attributable (subagentRunId) mixin, and SUBAGENT_* members on EventType.
The Zod reason for avoiding the package is gone: 1.0.0 has no dependencies, zod is an optional peer at ^3.25.18 || ^4.0.0, and the main entry does not import zod. Only the /schemas subpath does, and we do not use it. This is the layout PR refactor(ai): remove zod from the dependency graph #1038 adopted via the canary.
Renovate will not offer this bump because the pin is a prerelease.
Scope
Bump the pin in packages/ai/package.json and regenerate pnpm-lock.yaml.
Fix any type errors from event shapes that changed between the canary and 1.0.0. Keep the repo's own event interfaces as extends of the imported ones, with the same optionality as the spec (never stricter).
Add SubagentStartedEvent, SubagentFinishedEvent, SubagentErrorEvent to the AGUIEvent union in packages/ai/src/types.ts as extends of the package types, and add the SUBAGENT_* entries to the EventType re-export in packages/ai/src/client.ts.
Add the three event types and their spec keys (subagentRunId, name, description, parentSubagentRunId, parentToolCallId, parentMessageId, result, outcome, message, code) to packages/ai/src/utilities/spec-event-keys.ts, and subagentRunId to every attributable event, so toWireChunk does not move them into metadata.tanstack.
Changeset for @tanstack/ai (patch or minor, your call; the public StreamChunk union gains three members).
pnpm test:pr green.
Out of scope: the subagent runtime (spawn, router, processor, client handles). That stays in #1438, which should rebase onto this once merged and delete its duplicate interfaces in spawn.ts and types.ts.
Verification
pnpm test:types and pnpm test:build pass.
A unit test pushes a SUBAGENT_STARTED event and an attributed TEXT_MESSAGE_CONTENT through toWireChunk and asserts the fields stay top-level.
Confirm pnpm why zod shows no new zod path from packages/ai.
Related: #520 (Zod 3 conflict, resolved by #1038 and can be closed), #1438 (subagents).
Task
Bump
@ag-ui/coreinpackages/aifrom0.1.1-canary.beta.0to1.0.0and source the AG-UI event types from the package instead of hand-written copies.Why
packages/ai/src/types.tsalready imports every AG-UI event type from@ag-ui/coreand declares the local events withextends. The three subagent events in PR feat: add AG-UI subagents to chat() and useChat #1438 are the exception because the pinned canary predates them.@ag-ui/core@1.0.0(published 2026-09-17) shipsSubagentStartedEvent,SubagentFinishedEvent,SubagentErrorEvent,SubagentInfo,SubagentRunId, theAttributable(subagentRunId) mixin, andSUBAGENT_*members onEventType.dependencies, zod is an optional peer at^3.25.18 || ^4.0.0, and the main entry does not import zod. Only the/schemassubpath does, and we do not use it. This is the layout PR refactor(ai): remove zod from the dependency graph #1038 adopted via the canary.Scope
packages/ai/package.jsonand regeneratepnpm-lock.yaml.extendsof the imported ones, with the same optionality as the spec (never stricter).SubagentStartedEvent,SubagentFinishedEvent,SubagentErrorEventto theAGUIEventunion inpackages/ai/src/types.tsasextendsof the package types, and add theSUBAGENT_*entries to theEventTypere-export inpackages/ai/src/client.ts.subagentRunId,name,description,parentSubagentRunId,parentToolCallId,parentMessageId,result,outcome,message,code) topackages/ai/src/utilities/spec-event-keys.ts, andsubagentRunIdto every attributable event, sotoWireChunkdoes not move them intometadata.tanstack.@tanstack/ai(patch or minor, your call; the publicStreamChunkunion gains three members).pnpm test:prgreen.Out of scope: the subagent runtime (spawn, router, processor, client handles). That stays in #1438, which should rebase onto this once merged and delete its duplicate interfaces in
spawn.tsandtypes.ts.Verification
pnpm test:typesandpnpm test:buildpass.SUBAGENT_STARTEDevent and an attributedTEXT_MESSAGE_CONTENTthroughtoWireChunkand asserts the fields stay top-level.pnpm why zodshows no new zod path frompackages/ai.Related: #520 (Zod 3 conflict, resolved by #1038 and can be closed), #1438 (subagents).