Update types to @ag-ui/core 1.0
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 70/100
- Tipo di issue
- Refactoring
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- nodejs, typescript
- Ambito
- backend-api-design, tooling
Direzione di ricerca
Start by updating the dependency in packages/ai/package.json and running pnpm install. Then, examine packages/ai/src/types.ts to see how AG-UI event types are imported and extended. Add the three new subagent event types to the AGUIEvent union and update EventType in src/client.ts. Update spec-event-keys.ts to include the new keys. Run pnpm test:types and pnpm test:build to verify changes, and add a unit test for toWireChunk as described. Finally, create a changeset for @tanstack/ai.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Task
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.tsalready imports every AG-UI event type from@ag-ui/coreand declares the local events withextends. The three subagent events in PR #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.- 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/schemassubpath does, and we do not use it. This is the layout PR #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.jsonand regeneratepnpm-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
extendsof the imported ones, with the same optionality as the spec (never stricter). - Add
SubagentStartedEvent,SubagentFinishedEvent,SubagentErrorEventto theAGUIEventunion inpackages/ai/src/types.tsasextendsof the package types, and add theSUBAGENT_*entries to theEventTypere-export inpackages/ai/src/client.ts. - Add the three event types and their spec keys (
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. - Changeset for
@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.ts and types.ts.
Verification
pnpm test:typesandpnpm test:buildpass.- A unit test pushes a
SUBAGENT_STARTEDevent and an attributedTEXT_MESSAGE_CONTENTthroughtoWireChunkand asserts the fields stay top-level. - Confirm
pnpm why zodshows no new zod path frompackages/ai.
Related: #520 (Zod 3 conflict, resolved by #1038 and can be closed), #1438 (subagents).
- Lingua principale
- TypeScript
- Stelle
- 3.1k
- Fork
- 331
- Merge medio
- 1g 10h
- PR unite (30g)
- 130
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di TanStack/ai
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
has-pr waiting-on: maintainer
-
waiting-on: maintainer
-
Client tools never execute against spec-compliant AG-UI servers (plain `success` RUN_FINISHED) Apertawaiting-on: maintainer
-
waiting-on: maintainer
Issue simili
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Crush Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
ElementsProject/cln-application#167 · 1 commento · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Quantco/pnpm-licenses#17 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100