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.

Decompress sandbox archive to destination

Add decompressDirectory helper that ensures the destination exists
(with mkdir), extracts the downloaded tar.gz to the target using
tar.extract, and exits on error. Use it in sandboxToLocal and remove
the temporary archive; add the mkdir import.

+16 -1
+16 -1
apps/cli/src/cmd/copy.ts
··· 2 2 import { c } from "../theme"; 3 3 import { glob, unlink } from "node:fs/promises"; 4 4 import ignore from "ignore"; 5 - import { readFile, lstat, writeFile } from "node:fs/promises"; 5 + import { readFile, lstat, writeFile, mkdir } from "node:fs/promises"; 6 6 import { join } from "node:path"; 7 7 import * as tar from "tar"; 8 8 import crypto from "node:crypto"; ··· 112 112 return output; 113 113 } catch (error) { 114 114 consola.error("Failed to compress directory:", error); 115 + process.exit(1); 116 + } 117 + } 118 + 119 + async function decompressDirectory(archive: string, destination: string) { 120 + try { 121 + await mkdir(destination, { recursive: true }); 122 + await tar.extract({ 123 + file: archive, 124 + cwd: destination, 125 + }); 126 + } catch (error) { 127 + consola.error("Failed to decompress archive:", error); 115 128 process.exit(1); 116 129 } 117 130 } ··· 248 261 const buffer = Buffer.from(arrayBuffer); 249 262 const tempFile = `${crypto.randomBytes(16).toString("hex")}.tar.gz`; 250 263 await writeFile(tempFile, buffer); 264 + await decompressDirectory(tempFile, destination); 265 + await unlink(tempFile); 251 266 } 252 267 253 268 async function sandboxToSandbox(source: string, destination: string) {