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.

Compress files and archive directory contents

Make compressDirectory handle single files by creating a tar.gz
named with the file's SHA256. Update the sandbox tar invocation to
use `-C <dir> .` so the archive contains the directory's contents
instead of the directory itself.

+19 -2
+1 -1
apps/cf-sandbox/src/index.ts
··· 1050 1050 sandbox = await createSandbox("cloudflare", { 1051 1051 id: record.sandboxId!, 1052 1052 }); 1053 - await sandbox.sh`cd /tmp && tar czvf ${uuid}.tar.gz -C $(dirname ${params.directoryPath}) $(basename ${params.directoryPath}) && curl -X POST "https://sandbox.pocketenv.io/cp?uuid=${uuid}" -H "Authorization: ${token}" -F "file=@${uuid}.tar.gz" && rm ${uuid}.tar.gz`; 1053 + await sandbox.sh`cd /tmp && tar czvf ${uuid}.tar.gz -C ${params.directoryPath} . && curl -X POST "https://sandbox.pocketenv.io/cp?uuid=${uuid}" -H "Authorization: ${token}" -F "file=@${uuid}.tar.gz" && rm ${uuid}.tar.gz`; 1054 1054 1055 1055 return c.json({ uuid }); 1056 1056 });
+17
apps/cli/src/cmd/copy.ts
··· 57 57 58 58 async function compressDirectory(source: string): Promise<string> { 59 59 try { 60 + if ((await lstat(source)).isFile()) { 61 + const output = `${crypto 62 + .createHash("sha256") 63 + .update(source) 64 + .digest("hex")}.tar.gz`; 65 + await tar.create( 66 + { 67 + file: output, 68 + gzip: { 69 + level: 6, 70 + }, 71 + }, 72 + [source], 73 + ); 74 + return output; 75 + } 76 + 60 77 const ig = await loadIgnore( 61 78 ".pocketenvignore", 62 79 ".gitignore",
+1 -1
apps/sandbox/src/index.ts
··· 1006 1006 const params = await c.req.json<PushDirectoryParams>(); 1007 1007 await pushSchema.parseAsync(params); 1008 1008 const uuid = crypto.randomUUID(); 1009 - await sandbox.sh`cd /tmp && tar czvf ${uuid}.tar.gz -C $(dirname ${params.directoryPath}) $(basename ${params.directoryPath}) && curl -X POST "https://sandbox.pocketenv.io/cp?uuid=${uuid}" -H "Authorization: ${token}" -F "file=@${uuid}.tar.gz" && rm ${uuid}.tar.gz`; 1009 + await sandbox.sh`cd /tmp && tar czvf ${uuid}.tar.gz -C ${params.directoryPath} . && curl -X POST "https://sandbox.pocketenv.io/cp?uuid=${uuid}" -H "Authorization: ${token}" -F "file=@${uuid}.tar.gz" && rm ${uuid}.tar.gz`; 1010 1010 return c.json({ success: true, uuid: uuid.toString() }); 1011 1011 }); 1012 1012