From 5a01ebe0bcd6d0ca1da9fba530a270af8065ea8d Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Nov 2026 06:37:15 +0000 Subject: [PATCH] Declare the console's live preview, as small as it can be (saas-parallel-baselining PB4) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit orun.work's Preview tab shows a coding session's dev server, live from its box: `orun preview` (orun v2.96.0) runs what a repository declares, and the session keeps it running while it works. The box is small and shared with the agent, and the preview is for looking at the UI, so it is the console alone: - apps/web-console-next: spec.preview — install only the console's own packages (--filter "@saas/web-console-next..."), then `next dev` on 127.0.0.1:3001, run directly (not through `pnpm exec`); its API is the product's deployed stage (CONSOLE_DEPLOY_ENV=stage); a 1 GiB heap cap; telemetry off. No `needs`: none of the workers, Postgres or wrangler run. - intent.yaml: preview: {component: web-console-next}. - The console's README: how to run it by hand, and what shows. Run with orun v2.96.0: up in ~17 s; /, /login and /demo answered 200; ~830 MB resident with those three pages compiled. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_019PcpNWBtvn3y8id6vTP3Yz --- apps/web-console-next/README.md | 17 +++++++++++++++++ apps/web-console-next/component.yaml | 27 +++++++++++++++++++++++++++ intent.yaml | 7 +++++++ 3 files changed, 51 insertions(+) diff --git a/apps/web-console-next/README.md b/apps/web-console-next/README.md index 12d6212..1f1bcd8 100644 --- a/apps/web-console-next/README.md +++ b/apps/web-console-next/README.md @@ -31,6 +31,23 @@ incremental cache / tag cache / queue — this app has no R2/KV/D1 bindings and runs fully session-authenticated, so no persistent caching layer is needed. +## Live preview + +`orun preview` runs the console the way a coding session on orun.work does, +for its **Preview** tab (`spec.preview` in `component.yaml`, named by +`preview:` in `intent.yaml`). It is the console alone: `next dev` on +127.0.0.1:3001, talking to the product's deployed **stage** API, with only +its own packages installed and a 1 GiB heap, so it fits beside the agent in +the session's box. No Worker runs locally. Token-free pages (`/`, `/login`, +`/demo`) render in full; pages behind sign-in show the sign-in prompt. + +```sh +orun preview start # waits for :3001 +orun preview status +orun preview logs web-console-next +orun preview stop +``` + ## Parity vs. apps/web-console | Surface | web-console (Vite) | web-console-next (Next 15) | diff --git a/apps/web-console-next/component.yaml b/apps/web-console-next/component.yaml index b4e69f5..f8f9b40 100644 --- a/apps/web-console-next/component.yaml +++ b/apps/web-console-next/component.yaml @@ -56,6 +56,33 @@ spec: - profile: deploy when: triggerRef: github-push-main + # The live preview for orun.work's Preview tab (saas-parallel-baselining + # PB4): `orun preview` runs this, and a coding session keeps it running + # while it works, so the person watches the console change as it is built. + # + # KEPT SMALL ON PURPOSE. It is for looking at the UI, inside the coding + # session's own box (1 vCPU, 3 GiB, shared with the agent): + # - the console alone, `next dev` on the box's loopback. No Worker runs: + # no `needs`, so none of the thirteen workers, Postgres or wrangler start; + # - its API is the product's deployed STAGE (CONSOLE_DEPLOY_ENV=stage); + # - only the console's own packages are installed (`--filter ...`); + # - `next` itself, not `pnpm exec next` (two idle pnpm processes, ~200 MB); + # - its heap is capped at 1 GiB, so it can never starve the agent. + # Measured: up in ~17 s, ~830 MB with three pages compiled. + # The token-free pages (the landing page, /login, /demo's mock gallery) + # show in full. Pages behind sign-in show the sign-in prompt: stage's + # sign-in does not return to a preview host. + preview: + run: + - sh + - -c + - pnpm install --frozen-lockfile --prefer-offline --filter "@saas/web-console-next..." && exec node_modules/.bin/next dev -H 127.0.0.1 -p 3001 + port: 3001 + path: / + env: + CONSOLE_DEPLOY_ENV: stage + NODE_OPTIONS: --max-old-space-size=1024 + NEXT_TELEMETRY_DISABLED: "1" parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/intent.yaml b/intent.yaml index 846064f..d9a85cd 100644 --- a/intent.yaml +++ b/intent.yaml @@ -64,6 +64,13 @@ compositions: cloudflare-domain: stack-tectonic db-migrate: stack-tectonic +# The live preview (saas-parallel-baselining PB4): the one component orun.work's +# Preview tab shows while a coding session works on the product. The console +# alone, against the deployed stage API; its `spec.preview` says how it runs +# (apps/web-console-next/component.yaml), and `orun preview` runs it. +preview: + component: web-console-next + discovery: roots: - apps/