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.

Use SERVER_BIN_NAME and colorize logs

+23 -7
+23 -7
apps/api/src/pty/index.ts
··· 15 15 import type { Command } from "@vercel/sandbox"; 16 16 import type { ListenerSocket } from "./pty-tunnel/websocket"; 17 17 import { $ } from "zx"; 18 + import chalk from "chalk"; 18 19 19 20 const router = Router(); 20 21 router.use((req, res, next) => { ··· 81 82 }); 82 83 83 84 if (!(await checkIfServerInstalled(sandbox))) { 84 - await $`bash -c "type /tmp/pty-tunnel-server || curl -L ${PTY_SERVER_DOWNLOAD_URL} | tar xz -C /tmp"`; 85 + await $`bash -c "type /tmp/${SERVER_BIN_NAME} || curl -L ${PTY_SERVER_DOWNLOAD_URL} | tar xz -C /tmp"`; 85 86 86 - consola.info("Uploading pty-tunnel server binary to sandbox", options.id); 87 + consola.info( 88 + "Uploading pty-tunnel server binary to sandbox", 89 + chalk.greenBright(options.id), 90 + ); 87 91 88 92 const pathname = path.join("/tmp", `pty-server-${crypto.randomUUID()}`); 89 93 await sandbox.writeFiles([ 90 94 { 91 95 path: pathname, 92 - content: await fs.readFile("/tmp/pty-tunnel-server"), 96 + content: await fs.readFile(`/tmp/${SERVER_BIN_NAME}`), 93 97 }, 94 98 ]); 95 99 96 - consola.info("Setting up pty-tunnel server binary in sandbox", options.id); 100 + consola.info( 101 + "Setting up pty-tunnel server binary in sandbox", 102 + chalk.greenBright(options.id), 103 + ); 97 104 98 105 await sandbox.runCommand({ 99 106 cmd: "bash", ··· 104 111 sudo: true, 105 112 }); 106 113 107 - consola.info("Pty-tunnel server binary set up in sandbox", options.id); 114 + consola.info( 115 + "Pty-tunnel server binary set up in sandbox", 116 + chalk.greenBright(options.id), 117 + ); 108 118 } 109 119 110 - consola.info("Starting pty-tunnel server in sandbox", options.id); 120 + consola.info( 121 + "Starting pty-tunnel server in sandbox", 122 + chalk.greenBright(options.id), 123 + ); 111 124 112 125 const cmd = await sandbox.runCommand({ 113 126 cmd: SERVER_BIN_NAME, ··· 125 138 detached: true, 126 139 }); 127 140 128 - consola.info("Sandbox environment set up for sandbox", options.id); 141 + consola.info( 142 + "Sandbox environment set up for sandbox", 143 + chalk.greenBright(options.id), 144 + ); 129 145 130 146 return { sandbox, cmd }; 131 147 }