the universal sandbox runtime for agents and humans.
pocketenv.io
sandbox
openclaw
agent
claude-code
vercel-sandbox
deno-sandbox
cloudflare-sandbox
atproto
sprites
daytona
1import { type InferInsertModel, type InferSelectModel, sql } from "drizzle-orm";
2import { pgTable, text, timestamp, uniqueIndex } from "drizzle-orm/pg-core";
3import sandboxes from "./sandboxes";
4import users from "./users";
5
6const spriteAuth = pgTable(
7 "sprite_auth",
8 {
9 id: text("id").primaryKey().default(sql`xata_id()`),
10 sandboxId: text("sandbox_id")
11 .notNull()
12 .references(() => sandboxes.id, { onDelete: "cascade" }),
13 userId: text("user_id")
14 .notNull()
15 .references(() => users.id),
16 spriteToken: text("sprite_token").notNull(),
17 redactedSpriteToken: text("redacted_sprite_token").notNull(),
18 createdAt: timestamp("created_at").defaultNow().notNull(),
19 },
20 (t) => [uniqueIndex("unique_sprite_auth").on(t.sandboxId, t.userId)],
21);
22
23export type SelectSpriteAuth = InferSelectModel<typeof spriteAuth>;
24export type InsertSpriteAuth = InferInsertModel<typeof spriteAuth>;
25
26export default spriteAuth;