-
Notifications
You must be signed in to change notification settings - Fork 9
[AIDX-307] Renamed ciba token vault methods #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[AIDX-307] Renamed ciba token vault methods #5
Conversation
package.json
Outdated
| "agents": "^0.0.77", | ||
| "ai": "^4.3.13", | ||
| "agents": "^0.2.11", | ||
| "ai": "^5.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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) | |
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| {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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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}`}>
...
src/agent/chat.ts
Outdated
| [key: string]: any; | ||
| } | ||
|
|
||
| type MixinMethods = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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).
src/server.ts
Outdated
|
|
||
| app.use( | ||
| auth({ | ||
| domain: process.env.AUTH0_DOMAIN!, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
…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: