Fix Windows SEA build
why
what changed
test plan
Summary by cubic
Fixes the Windows SEA build and cross‑platform path resolution (including when run via tsx). CI builds, launches, and smoke‑tests Linux, macOS, and Windows binaries (x64/arm64); CJS/ESM outputs are stable.
- Bug Fixes
- Reusable SEA build workflow with a full OS/arch matrix (incl. Ubuntu 24.04 ARM and Windows 11 ARM), same‑arch launch check against /healthz, selective artifact upload, and an include_sourcemaps toggle (dev/test only; releases exclude sourcemaps).
- Centralized runtimePaths helpers across core/server/evals/docs to replace import.meta/fileURLToPath, fix tsx path resolution, normalize absolute paths, and correct supervisorClient CLI resolution and Windows spawning.
- Tooling: split DOM script builds into four Turbo tasks for Windows; switch to in‑process esbuild and Node‑invoked turbo/postject; stabilize CJS/ESM via tsc emits plus small CJS wrappers; refine tsconfig includes; add default NODE_ENV/BB_ENV in server env.
[!NOTE]
Medium Risk
Touches build/CI and packaging code (SEA generation, path resolution) across multiple packages, so failures could break releases or CI on specific platforms despite being largely tooling-focused.
Overview
Fixes cross-platform SEA building by moving build-server-sea to a reusable workflow with a multi-OS/arch matrix (including ARM runners), optional artifact/caching inputs, selective artifact upload, and a same-arch smoke test that boots each binary and hits /healthz.
Standardizes path/root resolution via new runtimePaths helpers (core/server/evals/docs) and replaces ad-hoc fileURLToPath(import.meta.url)/__dirname usage across scripts, tests, and supervisorClient (also tightening CLI resolution and SEA detection).
Simplifies build/tooling: core CJS/ESM builds now rely on tsc emits plus small CJS wrapper entrypoints (dropping esbuild bundling of core/tests), DOM script generation is split into separate Turbo tasks, server SEA build switches to in-process esbuild and Node-invoked turbo/postject, and server env config now provides default NODE_ENV/BB_ENV values.
Written by Cursor Bugbot for commit 2e4a07a6d0b54eddb7fea10d079c8062ecba1d6b. This will update automatically on new commits. Configure here.