cpuos

Recipe · node base

Web app preview sandbox recipe

A Node recipe for agent-built web previews, with scoped ports, bounded server lifetimes and a separate production build before review.

When to use this profile

Use a preview recipe when a user needs to inspect a generated interface while the agent edits it. The dev server runs inside the task environment and exposes only its selected application port through the runtime's authenticated preview mechanism. A development preview is for review; validate a production build separately before deploying anything.

Prepare a repeatable environment

  • Pin dependencies and configure the framework's allowed preview host if required.
  • Bind the server to the guest interface and use one explicit application port.
  • Keep production credentials out of both server and browser environment variables.
Command inside a prepared Linux guest
pnpm --dir /work/project dev --host 0.0.0.0 --port 3000

Return results the agent can use

  • A preview endpoint when supported by the connected runtime.
  • A production-build result and the source diff.
  • Screenshots or a short review checklist for the changed interface.

Load the preview through an authorized test session, confirm unauthorized access is denied, and build the same source in production mode before exporting the patch.

Resources and boundaries

Start with 2 vCPU and 4 GB of RAM, then measure peak memory and task duration on a representative fixture. These are workload planning values, not a benchmark or a provisioned configuration. Use the sandbox cost calculator to estimate running time and retained snapshots.

  • A preview endpoint needs access control; an obscure URL is not authorization.
  • Development servers can expose debug information and should stop when the task ends.
  • Watchers and hot reload use memory even while the model waits; include that time in cost estimates.

Keep model inference separate from this execution profile. A hosted model or gpuOS can decide the next action while the CPU environment runs it. The quickstart describes the account workflow and the proposed runtime contract.

Questions

Is this a separate built-in template?
This is a workload recipe based on the node profile. It adds preparation and execution guidance, not a separate built-in image or a new backend runtime.
Can I run the command now?
The command runs in a Linux environment where the listed dependencies and input files are prepared. cpuOS SDK examples describe a proposed contract; confirm runtime access and package versions before integration.
How should I choose CPU and memory?
Use the starting profile to run a representative fixture, measure peak memory and elapsed time, and add room for package installation, worker processes and larger inputs. Enforce a task timeout separately.

Related guides

Plan your web app preview task

Create a workspace and choose a profile. Connect an execution backend before running code.

gpuOS · where models think

Need the model too? Run it on gpuOS

gpuOS serves open models on your own GPUs behind one OpenAI-compatible API. The model reasons on gpuOS, the agent acts in a cpuOS sandbox.