feat(soak): SessionPool — seed, login, acquire contexts

Owns BrowserContexts, seeds via POST /api/auth/register with the
invite code on cold start, warm-starts via localStorage injection of
the cached JWT, falls back to POST /api/auth/login if the token is
rejected. Exposes acquire(n) for scenarios.

Infrastructure changes needed to import the real GolfBot class from
tests/e2e/bot/ without the Task-10 structural-interface workaround:
 - Add @playwright/test as devDep so value-imports in e2e/bot/*.ts
   resolve at runtime (Page/Locator/expect are pulled even as types)
 - Remove rootDir from tsconfig so TS follows cross-package imports;
   add a paths entry so TS can resolve @playwright/test from the soak
   package's node_modules when compiling files under tests/e2e/bot
 - Drop the local GolfBot structural interface + its placeholder
   GamePhase/StartGameOptions/TurnResult types; re-export the real
   class from types.ts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
adlee-was-taken
2026-04-11 17:19:39 -04:00
parent 066e482f06
commit 3bc0270eb9
5 changed files with 318 additions and 57 deletions

View File

@@ -11,12 +11,12 @@
"declaration": false,
"sourceMap": true,
"outDir": "./dist",
"rootDir": ".",
"baseUrl": ".",
"lib": ["ES2022", "DOM"],
"paths": {
"@soak/*": ["./*"],
"@bot/*": ["../e2e/bot/*"]
"@bot/*": ["../e2e/bot/*"],
"@playwright/test": ["./node_modules/@playwright/test"]
}
},
"include": ["**/*.ts"],