🎄 merry christmas: ai sdk v6 beta + tool approval (#1361)

This commit is contained in:
josh 2025-12-19 23:24:24 +00:00 committed by GitHub
parent 6e5b883cf2
commit 4d3ba8d9fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 429 additions and 202 deletions

View file

@ -97,7 +97,6 @@ export const ConfirmationRequest = ({ children }: ConfirmationRequestProps) => {
const { state } = useConfirmation();
// Only show when approval is requested
// @ts-expect-error state only available in AI SDK v6
if (state !== "approval-requested") {
return null;
}
@ -117,9 +116,7 @@ export const ConfirmationAccepted = ({
// Only show when approved and in response states
if (
!approval?.approved ||
// @ts-expect-error state only available in AI SDK v6
(state !== "approval-responded" &&
// @ts-expect-error state only available in AI SDK v6
state !== "output-denied" &&
state !== "output-available")
) {
@ -141,9 +138,7 @@ export const ConfirmationRejected = ({
// Only show when rejected and in response states
if (
approval?.approved !== false ||
// @ts-expect-error state only available in AI SDK v6
(state !== "approval-responded" &&
// @ts-expect-error state only available in AI SDK v6
state !== "output-denied" &&
state !== "output-available")
) {
@ -162,7 +157,6 @@ export const ConfirmationActions = ({
const { state } = useConfirmation();
// Only show when approval is requested
// @ts-expect-error state only available in AI SDK v6
if (state !== "approval-requested") {
return null;
}