refactor(app): share session state, screen and transcript reading in packages/core
Ā
PU
8d ago+12568+12568+01234567890123456789012345678901234567890123456789-869-869-012345678901234567890123456789
First of the phone app's PRs. The iPhone app (#209, stacked on this one) reads sessions, screens, transcripts and pairing links the way the desktop app does, so that code moves into packages/core.
What changes
packages/core/src:derive,format,net,screen,transcript, the pure half ofquestions, the agent half ofstate-model(state.ts), the conversation list helpers (conversation.ts, taken out ofconversation-store.ts) andpairing.ts(pairingLink, plus a newparsePairingwith its own base64url/UTF-8, since React Native lacks some globals).- Plain TypeScript: only relative
./x.tsimports andimport typefrom the plugin SDK, no DOM. Vite, Metro andnode --testall load it as it is. app/src/lib/<name>.tsre-exports each file, so no app import changes.check:core(in CI's app job and AGENTS.md) rejects imports from outside the package and runstscwith no DOM lib.- Tests moved with their code;
pnpm testalso globs../packages/core/src/**/*.test.ts. New tests forparsePairing. - Vite's
fs.allowincludespackages/core(checked: the dev server serves it).
No user-visible change.
Checks: typecheck:plugins, check:titles/type/grid/csp/themes/core, pnpm test (632 pass), pnpm build, tsc -p e2e.
š¤ Generated with Claude Code