Add server-v4 stubs
Merged
MO
8mo ago+16039+16039+01234567890123456789012345678901234567890123456789-8253-8253-0123456789012345678901234567890123456789
why
The intent is we just want the v4 stubs - and the openapi spec (and a few useless tests for now). This isn't all of of the v4 stubs yet (missing /logs etc), but we'll add in the rest of the stubs in parallel.
what changed
- Removes all "copied over" v3 functionality and /sessions routes etc.
- Adds v4 stubs like
/browsersessionwhich return simple JSON objects
test plan
Lint + (pretty useless) tests pass, checked /documentation accessible locally and included screenshot.
Summary by cubic
Adds @browserbasehq/stagehand-server-v4, a schema‑first, stubbed v4 API for BrowserSession and Page, with a regenerated OpenAPI v4 spec. Replaces the legacy v4 sessions runtime with simple stubs and a minimal server boot, leaving packages/server unchanged.
-
New Features
- Full v4 routes:
/v4/browsersession(create/get/end + actions) and/v4/page(navigation, frames, input, CDP, screenshots, etc.), plus/healthzand/readyz. - Zod v4 schemas for BrowserSession/Page expose OpenAPI components; generator builds from route registries (
browserSessionRoutes,pageRoutes);openapi.v4.yamlupdated. - Integration tests for v4 BrowserSession and Page; test utils updated for v4 shapes and a default
x-model-api-key.
- Full v4 routes:
-
Refactors
- Removed legacy v4 runtime and infra (old
sessions/*routes, session store, SSE, auth/env/logging/response, CORS/metrics, SEA fuse) and legacy tests; server registers only v4 routes/components. - Simplified health/readiness handlers and error handling with a lightweight
AppErrorinsrc/types/error.ts. - Fixed query parameter handling in stub GET handlers and OpenAPI so GET endpoints use the correct querystring shapes.
- Removed legacy v4 runtime and infra (old