[AIDX-307] Renamed ciba token vault methods#5
Conversation
| "agents": "^0.0.77", | ||
| "ai": "^4.3.13", | ||
| "agents": "^0.2.11", | ||
| "ai": "^5.0.0", |
There was a problem hiding this comment.
is resume functionality working w/ latest alongside cloudflare here? This is great if so, but was not seeing this behavior when upgrading alongside some of the Vercel + Next.js examples before (and was seeing resume functionality get hung up).
Believe these versions were validated to work elsewhere:
"@ai-sdk/openai": "2.0.24",
"@ai-sdk/react": "2.0.33",
"ai": "5.0.33",
As long as package-lock is checked in and resume works, i suppose it is ok.
Eventually, we will need an update in core auth0-ai-js repo to fully update Vercel to latest (ai@5.0.78 as of now) and ensuring other examples.
We should definitely get a fast follow for this + zod v4 update later (or zod 4 optional)... definitely seems like something we can do!
AIDX-307 Add support for Auth0, fixes to /user endpoint
TEST: tsc muting
| const pendingToolCallConfirmation = agentMessages.some( | ||
| (m: UIMessage) => | ||
| m.parts?.some(() => TokenVaultInterrupt.isInterrupt(toolInterrupt)) || | ||
| TokenVaultInterrupt.isInterrupt(toolInterrupt) | ||
| ); |
There was a problem hiding this comment.
| const pendingToolCallConfirmation = agentMessages.some( | |
| (m: UIMessage) => | |
| m.parts?.some(() => TokenVaultInterrupt.isInterrupt(toolInterrupt)) || | |
| TokenVaultInterrupt.isInterrupt(toolInterrupt) | |
| ); | |
| const pendingToolCallConfirmation = agentMessages.some( | |
| (m: UIMessage) => | |
| m.parts?.some( | |
| (part) => | |
| (part?.type?.startsWith("tool-") && | |
| toolsRequiringConfirmation.includes( | |
| part.type?.split("-")[1] as keyof typeof tools | |
| ) && | |
| "state" in part && | |
| part?.state === "input-available") || | |
| TokenVaultInterrupt.isInterrupt(toolInterrupt) | |
| ) || TokenVaultInterrupt.isInterrupt(toolInterrupt) | |
| ); |
| {agentMessages.map((m: UIMessage, index) => { | ||
| const isUser = m.role === "user"; | ||
| const showAvatar = | ||
| index === 0 || agentMessages[index - 1]?.role !== m.role; |
There was a problem hiding this comment.
seeing duplicate div key's giving some warnings in console below (likely unrelated this change), but suggestion would be:
return (
<div key={`${m.id}-${index}`}>
...
| [key: string]: any; | ||
| } | ||
|
|
||
| type MixinMethods = { |
There was a problem hiding this comment.
I don't like this as it will require the developer to keep it in sync with @auth0/auth0-cloudflare-agents-api. If you don't like this extend syntax, you can just use inherits from AsyncUserConfirmationResumer(OwnedAgent(AuthAgent(AIChatAgent))).
Create the class before extending it.
There was a problem hiding this comment.
in retrospect, i agree. I did not like having to self extend these mixins, and was looking for a vanilla ts way of ensuring that behavior w/ the class extended & exposed. I prefer to keep w/ the npm extend helper, which appears to provide this and gives good type support (and good intellisense).
|
|
||
| app.use( | ||
| auth({ | ||
| domain: process.env.AUTH0_DOMAIN!, |
There was a problem hiding this comment.
This is the default:
https://github.com/auth0-lab/auth0-hono/blob/main/src/config/envConfig.ts#L54-L67
also process.env might be undefined if this is not available, auth0-hono handles the configuration without process.env from cloudflare vars
https://github.com/auth0-lab/cloudflare-agents-starter/blob/main/wrangler.jsonc#L12
…ate' into AIDX-307-rename-ciba-token-vault-methods

Renamed CIBA/Token vault methods according to this file
Updated to AI SDK 5, updated examples:
check-user-calendar:buy-stock:getLocalTime:scheduleTask:show scheduled tasks:cancel scheduled task: