refactor: move e2e's core into @e2e-dev/core, and engines peer on it
Stack 2/3: session-half split → this PR → @e2e-dev/core API.
2026-11-15: rebased onto main 235986078 and the package renamed from e2e-core to @e2e-dev/core. Command output quoted below predates the rename.
Moves the engine contract, locators, agent, replay cache, secrets, and the session half of a worker from packages/e2e to packages/core, published as the new @e2e-dev/core package. e2e is built on it. Nothing changes in behavior.
flowchart BT
core["@e2e-dev/core<br/>engine contract, locators, agent, cache,<br/>secrets, engine sessions, standalone worker"]
e2e["e2e<br/>CLI, collector, scheduler, reporters, expect, MCP"]
web["@e2e-dev/web, @e2e-dev/mobile"]
e2e -- "dependency, exact version (fixed group)" --> core
web -- "peer" --> core
web -- "peer" --> e2e
@e2e-dev/core: 145 modules moved withgit mvto the same paths underpackages/core/src. Its one public entry is@e2e-dev/core/engine.e2ereaches the rest as@e2e-dev/core/lib/<path>(./lib/*in its exports), which is not public API. The next PR adds the@e2e-dev/coreand@e2e-dev/core/agententries.e2e: depends on@e2e-dev/coreat its exact version (workspace:*), and the changesetsfixedgroup keeps the two versions equal.e2e/engineande2e/agentre-export it unchanged, so engines, integrations, and executors work as before.- Engines:
@e2e-dev/weband@e2e-dev/mobileimport@e2e-dev/core/engineand peer on@e2e-dev/corebesidee2e(>=0.23.1 <1). - Yarn: Yarn installs no peer the project does not list, and under Plug'n'Play the engine then fails to load.
e2e initadds@e2e-dev/corebeside an engine, ande2e upgradeadds a required@e2e-dev/*peer the project lacks, at the versione2edepends on. Checked on Yarn 4.18.1 PnP with packed builds: without core listed the config fails to load, with it the scaffolded test passes. - CI:
- The root
buildandtestscripts run@e2e-dev/corefirst, and so does the Bun job inspec.yml. .github/filters.ymladdspackages/core/**to the runner filter.- The nightly examples workflow packs
@e2e-dev/coreand overrides it in each example's npm install. scripts/install-smoke.tspacks it too and fails on a second installed copy.
- The root
Most of the diff is mechanical: of 639 files, 145 are pure renames and most of the rest only rewrite import specifiers to @e2e-dev/core/lib/<path>. The parts to read:
| What | Where |
|---|---|
| package manifests | packages/core/package.json, packages/e2e/package.json, packages/{web,mobile}/package.json, root package.json, .changeset/config.json |
| the moved entries and their stubs | packages/core/src/engine/index.ts and agent/public.ts (verbatim), packages/e2e/src/engine/index.ts and agent/public.ts (re-exports) |
| build and test config | packages/core/tsconfig*.json, packages/core/vitest.config.ts, packages/e2e/vitest.config.ts (the integration project externalizes core's dist, so tests and the built runner share one module state) |
| guards | packages/e2e/tests/unit/package-imports.test.ts (follows imports into @e2e-dev/core; ai stays lazy there), scripts/install-smoke.ts, scripts/check-error-codes.ts |
| CI | .github/workflows/spec.yml, examples.yml, .github/actions/example-packages/action.yml, .github/filters.yml, CODEOWNERS |
| prose | AGENTS.md, CONTRIBUTING.md (stability, engine contract), docs/writing-an-engine.mdx, docs/reference/engine.mdx, READMEs |
To confirm the rest is only import lines: git diff -M --unified=0 <base> <head> -- 'packages/*/src' 'packages/*/tests' | grep '^[-+][^-+]' | grep -v "from '\|import('".
Before merging: @e2e-dev/core does not exist on npm yet, and npm Trusted Publishing can only be added to a package that exists. Publish a placeholder @e2e-dev/core@0.0.0 by hand and connect release.yml as its trusted publisher (CONTRIBUTING.md, "npm Trusted Publishing") before this merges. Otherwise the next release publishes e2e with an exact dependency on an @e2e-dev/core version that failed to publish.
Verified
Ran it locally: yes. No behavior changes, so the evidence is the existing suites against the built packages, plus a fresh install:
pnpm test: e2e 4626 passed (unit and integration), web 810, mobile 531, every other package green, and@e2e-dev/core's entries check.- Testbed through the built CLI: 588 passed, 1 skipped.
scripts/install-smoke.tswith pnpm 11 and pnpm 12: installs the packed@e2e-dev/core,e2e,@e2e-dev/web, and@e2e-dev/mobilewith no build scripts, finds one@e2e-dev/corecopy, typechecks a mobile tool, and runs a TypeScript test.pnpm checkpasses.- Not run locally: the nightly examples workflow's npm override of
@e2e-dev/core. It only runs on the nightly or on a manual dispatch, which posts to Slack.
🤖 Generated with Claude Code