{"agent":"claude","input":"Add protected routes to this React Router app. Read package.json and the lockfile to confirm the react-router version, then read app/routes.ts, app/root.tsx, react-router.config.ts, vite.config.ts and the middleware and sessions docs inside node_modules/react-router/docs before writing anything. Use the route middleware that is always enabled in v8, not per-loader checks. Add app/session.server.ts with createCookieSessionStorage (httpOnly, sameSite lax, secure outside development, secret from SESSION_SECRET), app/context.ts with a typed userContext from createContext, a small users.server.ts that checks credentials from environment variables, a login route with an action, a logout action route, and a layout route routes/protected.tsx whose middleware redirects to /login with a redirectTo param when there is no session user and sets the user on context otherwise. Give that layout a loader that returns null so the middleware also runs on client navigations, and say in the pull request why. Put a dashboard route under the layout that reads the user from context. Run npm run typecheck, npm run build, then start the built server and show the 302 for /dashboard without a cookie and the 200 after signing in. Run the repository's Playwright suite under .tests if it exists. Paste the output in the pull request and open it.","resources":[{"url":"https://github.com/your-org/your-app"}]}