Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix: update Node.js engine version to 22.x in package.json

nirholase9147e11d3bb
diff --git a/api/auth/siwe/verify.js b/api/auth/siwe/verify.js
index 3dd4b22c2..b5b420367 100644
--- a/api/auth/siwe/verify.js
+++ b/api/auth/siwe/verify.js
@@ -146,14 +146,23 @@ export default wrap(async (req, res) => {
// before user_wallets existed, or by a different flow that only set the
// users column. Reconcile by backfilling user_wallets.
const placeholderEmail = `wallet-${addrLower}@wallet.local`;
+ // Include soft-deleted rows so we can reject them with a clear error
+ // instead of colliding on the email unique constraint.
const [existingUser] = await sql`
- select id from users
- where (wallet_address = ${addrLower} or email = ${placeholderEmail})
- and deleted_at is null
+ select id, deleted_at from users
+ where wallet_address = ${addrLower} or email = ${placeholderEmail}
limit 1
`;
if (existingUser) {
+ if (existingUser.deleted_at) {
+ return error(
+ res,
+ 403,
+ 'account_deleted',
+ 'this wallet is linked to a deleted account',
+ );
+ }
userId = existingUser.id;
await sql`
update users set wallet_address = ${addrLower}
@@ -168,20 +177,28 @@ export default wrap(async (req, res) => {
`;
} else {
// Create a new passwordless user. Email is synthesized and placeholder —
- // user can set a real email + password later.
+ // user can set a real email + password later. ON CONFLICT guards
+ // against two concurrent verifies racing past the lookup above.
const [user] = await sql`
insert into users (email, display_name, wallet_address)
values (${placeholderEmail}, ${shortAddr(claimed)}, ${addrLower})
- returning id
+ on conflict (email) do update
+ set wallet_address = ${addrLower}
+ returning id, (xmax = 0) as inserted
`;
userId = user.id;
await sql`
insert into user_wallets (user_id, address, chain_id, is_primary)
values (${userId}, ${addrLower}, ${chainId}, true)
+ on conflict (address) do update
+ set last_used_at = now(),
+ chain_id = coalesce(${chainId}, user_wallets.chain_id)
`;
- queueMicrotask(() =>
- sendWelcomeEmail({ to: placeholderEmail, displayName: shortAddr(claimed) }),
- );
+ if (user.inserted) {
+ queueMicrotask(() =>
+ sendWelcomeEmail({ to: placeholderEmail, displayName: shortAddr(claimed) }),
+ );
+ }
}
}
diff --git a/package.json b/package.json
index ce5463580..38ea3e721 100644
--- a/package.json
+++ b/package.json
@@ -10,7 +10,7 @@
"serialize-javascript": ">=7.0.5"
},
"engines": {
- "node": ">=20.0.0"
+ "node": "22.x"
},
"keywords": [
"3d-viewer",