TanStackOSS
    ai
    fix(ai-vue): use Readonly<ShallowRef<X>> for messages/partial/final Vue's DeepReadonly distributes a recursive mapped type that collapses discriminated unions inside the ref's value. With messages typed as DeepReadonly<ShallowRef<Array<UIMessage<TTools, Person>>>>, the MessagePart union lost its `type` discriminator — every variant's fields became optional and unified, so consumer code like `parts.find(p => p.type === 'structured-output')?.data` would not narrow to Person. Wrapping a ShallowRef in DeepReadonly was contradictory anyway: ShallowRef does not track deep mutations, so enforcing deep readonly on its value adds no reactivity guarantee. Readonly<ShallowRef<X>> makes the ref's .value field readonly while preserving X's structural shape (and its discriminators). The runtime stays readonly(messages) — the public-type cast in use-chat.ts bridges to the new type. Also updates the type-level tests to match the corrected public type.
    nx run-many --targets=build --exclude=examples/**,testing/**
Succeeded
CI Pipeline Execution
Linux
4 CPU cores
745d73af583
100%

Cache hits

31 of 31 tasks used cache.

Get faster results

Learn how to enable distribution.

Atomizer enabled

31 groups of tasks optimized.

© 2026 - Nx Cloud

Terms of ServicePrivacy PolicyChangelogStatusDocsContact Nx CloudPricingCompany@NxDevTools