diff --git a/.sandbox/cloudflare/Dockerfile b/.sandbox/cloudflare/Dockerfile index dbcc12cc..337a498b 100644 --- a/.sandbox/cloudflare/Dockerfile +++ b/.sandbox/cloudflare/Dockerfile @@ -1,7 +1,21 @@ -FROM docker.io/cloudflare/sandbox:0.7.0 +FROM node:24-slim + +COPY --from=docker.io/cloudflare/sandbox:0.7.0 /container-server/sandbox /sandbox RUN apt-get update && apt-get install -y --no-install-recommends \ - openssh-client + openssh-client \ + git \ + curl \ + ca-certificates + +RUN curl -fsSL https://openclaw.ai/install.sh | bash || true + +RUN npm install -g @anthropic-ai/claude-code + +WORKDIR /workspace # Required during local development to access exposed ports EXPOSE 8080 +EXPOSE 3000 + +ENTRYPOINT ["/sandbox"] diff --git a/.sandbox/cloudflare/src/index.ts b/.sandbox/cloudflare/src/index.ts index 08c7b530..f68dabd8 100644 --- a/.sandbox/cloudflare/src/index.ts +++ b/.sandbox/cloudflare/src/index.ts @@ -31,8 +31,19 @@ export default { const clone = await sandbox.exec( "git clone git@tangled.org:rocksky.app/rocksky rocksky -b main", ); - consola.log(clone.stdout); + consola.info(clone.stdout); const ls = await sandbox.exec("ls -la rocksky"); + consola.info(ls.stdout); + + const node = await sandbox.exec("node -v"); + consola.info(`Node version in sandbox: ${node.stdout.trim()}`); + + const claude = await sandbox.exec("claude --version"); + consola.info(`Claude version in sandbox: ${claude.stdout.trim()}`); + + const openclaw = await sandbox.exec("openclaw --version"); + consola.info(`OpenClaw version in sandbox: ${openclaw.stdout.trim()}`); + return Response.json({ output: ls.stdout, error: ls.stderr, diff --git a/.sandbox/daytona/.dockerignore b/.sandbox/daytona/.dockerignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/.sandbox/daytona/.dockerignore @@ -0,0 +1 @@ +node_modules diff --git a/.sandbox/daytona/Dockerfile b/.sandbox/daytona/Dockerfile new file mode 100644 index 00000000..179e268d --- /dev/null +++ b/.sandbox/daytona/Dockerfile @@ -0,0 +1,3 @@ +FROM daytonaio/sandbox:0.5.2 + +RUN curl -fsSL https://openclaw.ai/install.sh | bash || true diff --git a/.sandbox/daytona/index.ts b/.sandbox/daytona/index.ts index 09ced227..4d9cb6de 100644 --- a/.sandbox/daytona/index.ts +++ b/.sandbox/daytona/index.ts @@ -31,6 +31,9 @@ async function main() { consola.info("SSH keys uploaded to sandbox."); + const openclaw = await sandbox.process.executeCommand("which openclaw"); + consola.log(openclaw.result); + await sandbox.process.executeCommand("chmod 600 ${HOME}/.ssh/id_rsa"); await sandbox.process.executeCommand( "ssh-keyscan -t rsa tangled.org >> ${HOME}/.ssh/known_hosts", diff --git a/.sandbox/deno/deno.json b/.sandbox/deno/deno.json index bf8ff08b..a745b974 100644 --- a/.sandbox/deno/deno.json +++ b/.sandbox/deno/deno.json @@ -7,5 +7,8 @@ "@std/assert": "jsr:@std/assert@1", "chalk": "npm:chalk@^5.6.2", "consola": "npm:consola@^3.4.2" + }, + "deploy": { + "org": "tsirysndr" } } diff --git a/.sandbox/deno/main.ts b/.sandbox/deno/main.ts index 89276359..4f253bbe 100644 --- a/.sandbox/deno/main.ts +++ b/.sandbox/deno/main.ts @@ -3,9 +3,14 @@ import consola from "consola"; import chalk from "chalk"; export async function main() { - const HOME = "/home/app"; + await using sandbox = await Sandbox.create({ + root: Deno.env.get("SANDBOX_ROOT"), + }); + + const HOME = await sandbox.env.get("HOME"); + const PATH = await sandbox.env.get("PATH"); + await sandbox.env.set("PATH", `${HOME}/.npm-global/bin:/usr/bin:${PATH}`); - await using sandbox = await Sandbox.create(); consola.info("Sandbox created with ID:", chalk.greenBright(sandbox.id)); await sandbox.sh`mkdir -p $HOME/.ssh`; @@ -32,6 +37,9 @@ export async function main() { await sandbox.sh`git clone git@tangled.org:rocksky.app/rocksky rocksky -b main`; await sandbox.sh`ls -la rocksky`; + await sandbox.sh`which claude`; + await sandbox.sh`which openclaw`; + await sandbox.close(); } diff --git a/.sandbox/vercel/index.ts b/.sandbox/vercel/index.ts index 2349f6a7..1183dae7 100644 --- a/.sandbox/vercel/index.ts +++ b/.sandbox/vercel/index.ts @@ -25,6 +25,17 @@ await sandbox.writeFiles([ consola.info("SSH keys uploaded to sandbox."); +consola.info("Installing openclaw..."); + +await sandbox.runCommand({ + cmd: "sh", + args: ["-c", "curl -fsSL https://openclaw.ai/install.sh | bash || true"], + stdout: process.stdout, + stderr: process.stderr, +}); + +consola.info("Configuring SSH and Git..."); + await sandbox.runCommand({ cmd: "chmod", args: ["600", `${HOME}/.ssh/id_rsa`], @@ -77,6 +88,7 @@ await sandbox.runCommand({ }); try { + // await sandbox.snapshot(); // await sandbox.stop(); } catch (e) { consola.error("Error stopping Vercel Sandbox:", e);