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 sandboxes by id, name, or uri

Restrict returned services to the authenticated user's sandboxes and
update CLI service commands to accept a sandbox parameter.

+28 -7
+6 -2
apps/api/src/xrpc/io/pocketenv/service/addService.ts
··· 9 9 import type { InsertService } from "schema/services"; 10 10 import { consola } from "consola"; 11 11 import type { InsertSandboxPort } from "schema/sandbox-ports"; 12 - import { and, eq } from "drizzle-orm"; 12 + import { and, eq, or } from "drizzle-orm"; 13 13 import { Providers } from "consts"; 14 14 import generateJwt from "lib/generateJwt"; 15 15 ··· 29 29 .leftJoin(schema.users, eq(schema.users.id, schema.sandboxes.userId)) 30 30 .where( 31 31 and( 32 - eq(schema.sandboxes.id, params.sandboxId), 32 + or( 33 + eq(schema.sandboxes.id, params.sandboxId), 34 + eq(schema.sandboxes.name, params.sandboxId), 35 + eq(schema.sandboxes.uri, params.sandboxId), 36 + ), 33 37 eq(schema.users.did, auth.credentials.did), 34 38 ), 35 39 )
+20 -3
apps/api/src/xrpc/io/pocketenv/service/getServices.ts
··· 6 6 } from "lexicon/types/io/pocketenv/service/getServices"; 7 7 import { XRPCError, type HandlerAuth } from "@atproto/xrpc-server"; 8 8 import schema from "schema"; 9 - import { eq } from "drizzle-orm"; 9 + import { and, eq, or } from "drizzle-orm"; 10 10 11 11 export default function (server: Server, ctx: Context) { 12 12 const getServices = async (params: QueryParams, auth: HandlerAuth) => { ··· 17 17 const services = await ctx.db 18 18 .select() 19 19 .from(schema.services) 20 - .where(eq(schema.services.sandboxId, params.sandboxId)) 21 - .execute(); 20 + .leftJoin( 21 + schema.sandboxes, 22 + eq(schema.sandboxes.id, schema.services.sandboxId), 23 + ) 24 + .leftJoin(schema.users, eq(schema.users.id, schema.sandboxes.userId)) 25 + .where( 26 + and( 27 + or( 28 + eq(schema.services.sandboxId, params.sandboxId), 29 + eq(schema.sandboxes.name, params.sandboxId), 30 + eq(schema.sandboxes.uri, params.sandboxId), 31 + ), 32 + eq(schema.users.did, auth.credentials.did), 33 + ), 34 + ) 35 + .execute() 36 + .then((results) => 37 + results.map(({ services }) => services).filter((service) => service), 38 + ); 22 39 23 40 return { 24 41 services: services.map((record) => ({
+2 -2
apps/cli/src/cmd/service.ts
··· 1 - export async function createService() {} 1 + export async function createService(sandbox: string) {} 2 2 3 - export async function listServices() {} 3 + export async function listServices(sandbox: string) {} 4 4 5 5 export async function restartService() {} 6 6