the universal sandbox runtime for agents and humans. pocketenv.io
sandbox openclaw agent claude-code vercel-sandbox deno-sandbox cloudflare-sandbox atproto sprites daytona
7
fork

Configure Feed

Select the types of activity you want to include in your feed.

Lookup sandbox by id or name in createSandbox

+20 -1
+20 -1
apps/api/src/xrpc/io/pocketenv/sandbox/createSandbox.ts
··· 10 10 import { createAgent } from "lib/agent"; 11 11 import { TID } from "@atproto/common"; 12 12 import schema from "schema"; 13 - import { eq } from "drizzle-orm"; 13 + import { eq, or } from "drizzle-orm"; 14 14 import { 15 15 validateMain, 16 16 type Main, 17 17 } from "lexicon/types/com/atproto/repo/strongRef"; 18 18 import { Providers } from "consts"; 19 + import sandboxes from "schema/sandboxes"; 19 20 20 21 export default function (server: Server, ctx: Context) { 21 22 const createSandbox = async (input: HandlerInput, auth: HandlerAuth) => { ··· 28 29 "Authentication failed, invalid challenge", 29 30 "AuthenticationError", 30 31 ); 32 + } 33 + 34 + if (!input.body.base.startsWith("at://")) { 35 + const [sandbox] = await ctx.db 36 + .select() 37 + .from(sandboxes) 38 + .where( 39 + or( 40 + eq(sandboxes.name, input.body.base), 41 + eq(sandboxes.id, input.body.base), 42 + eq(sandboxes.sandboxId, input.body.base), 43 + ), 44 + ) 45 + .execute(); 46 + if (!sandbox?.uri) { 47 + throw new XRPCError(404, "Sandbox not found", "SandboxNotFoundError"); 48 + } 49 + input.body.base = sandbox.uri; 31 50 } 32 51 33 52 const provider = input.body.provider || Providers.CLOUDFLARE;