open, interoperable sandbox platform for agents and humans 📦 ✨
pocketenv.io
claude-code
atproto
sandbox
openclaw
agent
1import { type InferInsertModel, type InferSelectModel, sql } from "drizzle-orm";
2import {
3 pgTable,
4 text,
5 timestamp,
6 boolean,
7 integer,
8} from "drizzle-orm/pg-core";
9import users from "./users";
10
11const sandboxes = pgTable("sandboxes", {
12 id: text("id").primaryKey().default(sql`sandbox_id()`),
13 base: text("base"),
14 name: text("name").unique().notNull(),
15 displayName: text("display_name"),
16 uri: text("uri").unique(),
17 cid: text("cid").unique(),
18 repo: text("repo"),
19 provider: text("provider").default("cloudflare").notNull(),
20 description: text("description"),
21 topics: text("topics").array(),
22 logo: text("logo"),
23 publicKey: text("public_key").notNull(),
24 readme: text("readme"),
25 userId: text("user_id").references(() => users.id),
26 instanceType: text("instance_type"),
27 vcpus: integer("vcpus"),
28 memory: integer("memory"),
29 disk: integer("disk"),
30 status: text("status").notNull(),
31 keepAlive: boolean("keep_alive").default(false).notNull(),
32 sleepAfter: text("sleep_after"),
33 sandboxId: text("sandbox_id"),
34 installs: integer("installs").default(0).notNull(),
35 startedAt: timestamp("started_at"),
36 createdAt: timestamp("created_at").defaultNow().notNull(),
37 updatedAt: timestamp("updated_at").defaultNow().notNull(),
38});
39
40export type SelectSandbox = InferSelectModel<typeof sandboxes>;
41export type InsertSandbox = InferInsertModel<typeof sandboxes>;
42
43export default sandboxes;