Update next version#146
Merged
alex-grover merged 4 commits intomainfrom Apr 30, 2026
Merged
Conversation
Closes #142
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…cts don't cover the three new `ToolUIPart['state']` values ('approval-requested', 'approval-responded', 'output-denied') introduced in the `ai` v5→v6 upgrade.
This commit fixes the issue reported at examples/v0-clone/components/ai-elements/tool.tsx:54
**Bug explanation:**
The `ai` package was upgraded from v5.0.22 to v6.0.172. In v6, the `ToolUIPart['state']` union type was expanded from 4 states to 7 states, adding: `'approval-requested'`, `'approval-responded'`, and `'output-denied'`.
In `examples/v0-clone/components/ai-elements/tool.tsx`, the `getStatusBadge` function accepts `status: ToolUIPart['state']` and indexes into two `as const` objects (`labels` and `icons`) that only have entries for the original 4 states. TypeScript correctly flags this as an error at line 54 (`icons[status]`) and line 55 (`labels[status]`) because the full union type cannot be used to safely index an object that's missing 3 of the possible keys.
The exact build error from the Vercel deployment log:
```
Type error: Element implicitly has an 'any' type because expression of type '"input-streaming" | "input-available" | "approval-requested" | "approval-responded" | "output-available" | "output-error" | "output-denied"' can't be used to index type '{ readonly 'input-streaming': Element; readonly 'input-available': Element; readonly 'output-available': Element; readonly 'output-error': Element; }'.
```
**Fix explanation:**
Added the three missing states to both the `labels` and `icons` objects:
- `'approval-requested'`: Uses `ClockIcon` (yellow) with label "Approval Requested" — represents a pending approval, analogous to a waiting state.
- `'approval-responded'`: Uses `CheckCircleIcon` (blue) with label "Approved" — the approval has been given.
- `'output-denied'`: Uses `XCircleIcon` (red) with label "Denied" — the output was denied, similar styling to errors.
All icons used (`ClockIcon`, `CheckCircleIcon`, `XCircleIcon`) were already imported, so no import changes were needed. The objects now cover the complete `ToolUIPart['state']` union, resolving the TypeScript error.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: alex-grover <hello@alexgrover.me>
rickeyswuave
approved these changes
Apr 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #142