Conversation
- Replace dockerode with secure-exec for widget build and serve - Each widget gets its own NodeRuntime (V8 isolate) with in-memory filesystem - Widget files are written to virtual filesystem, built with Vite, served via HTTP server inside the isolate - Proxy route uses runtime.network.fetch() instead of Docker container port forwarding - Update system prompt to reference Secure Exec instead of Docker - Remove dockerode and @types/dockerode dependencies - Update AGENTS.md to reflect new architecture (no Docker required) Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>
….config Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>
isolated-vm (transitive dep of secure-exec) ships prebuilts for Node 22 (ABI 137) but its source fails to compile on Node 20 CI runners due to V8 header incompatibility. Co-authored-by: Ismail Pelaseyed <homanp@users.noreply.github.com>
…fetch - Use NodeFileSystem (real host FS) so build tools (npm, vite) work - Shared base template with npm deps + shadcn components created once - Each widget sandbox copies base, agent writes into it, vite builds - SecureExec runtime serves built files via HTTP inside the sandbox - Use async exec for npm/vite to avoid blocking event loop - Use host fetch instead of runtime.network.fetch for server healthcheck and widget proxying (server binds to host loopback)
- Upgrade secure-exec from placeholder 0.0.1 to 0.1.0 - Fix Turbopack external resolution by removing secure-exec from serverExternalPackages (ESM-only, no main field) - Forward tool-result events to clear stale action labels in chat UI - Replace DigitalOcean Droplet deploy with Railway in CI workflow - Remove Docker files (Dockerfile, docker-compose, Caddyfile, .dockerignore, docker/widget-base) no longer needed with secure-exec sandboxing - Clean up Makefile to remove Docker targets Made-with: Cursor
Return auto-refreshing loading page instead of a hard 404 when the widget code isn't in the DB yet. The bootstrap POST and sync run async, so the iframe can load before the DB is populated. Made-with: Cursor
…tandalone output - Exclude drizzle.config.ts and data/ from tsconfig (pre-existing type errors that fail production builds) - Remove output: "standalone" from next.config.ts (was needed for Docker, incompatible with Railway's npm start) Made-with: Cursor
Remove Docker from prerequisites, simplify setup instructions, and update architecture diagram to reflect V8 isolate sandboxing. Made-with: Cursor
Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replace the Docker-based widget build and serve system with Secure Exec — a V8 isolate-based secure Node.js execution library. Each widget now runs in its own
NodeRuntimesandbox instead of a shared Docker container.Architecture:
NodeRuntimeserves the built files via HTTP.Changes:
src/lib/widget-runner.ts— Complete rewrite. Each widget sandbox:vite buildruns in the sandbox to produce static assetsSecureExecNodeRuntimeserves the built files via an HTTP file serversrc/app/api/widget/[id]/[[...path]]/route.ts— Updated proxy route to usefetchFromWidget()which fetches from the sandbox's HTTP serversrc/app/api/chat/route.ts— Updated system prompt to reference Secure Exec instead of Dockernext.config.ts— Addedsecure-execand@secure-exec/*toserverExternalPackages, removeddockerodepackage.json— Addedsecure-exec, removeddockerodeand@types/dockerode.github/workflows/ci.yml— Updated Node version from 20 to 22 (required forisolated-vmnative prebuilds)AGENTS.md— Updated to reflect new architecture (no Docker required)Why
Secure Exec provides lightweight, fast V8 isolate-based sandboxing that eliminates the Docker dependency:
Test plan
npm test— 42/42 passing)npm run lint— 0 errors)npx tsc --noEmit)npm run build)