{"agent":"claude","input":"Add CORS to this tRPC API for browser clients on other origins. Read src/pages/api/trpc/[trpc].ts, src/utils/trpc.ts, src/server/env.ts, next.config.ts, playwright.config.ts, playwright/smoke.test.ts, package.json and .github/workflows/main.yml first. Add CORS_ALLOWED_ORIGINS to the zod env schema as an optional comma-separated string. Write src/server/cors.ts that, for a request whose Origin is in the list, sets Access-Control-Allow-Origin to that origin and Vary: Origin, sets Allow-Credentials only when the list is explicit, and for an OPTIONS preflight echoes Access-Control-Request-Headers, allows GET, POST and OPTIONS, sets Max-Age and ends with 204. Wrap the handler in [trpc].ts so the preflight never reaches tRPC and an unset variable changes nothing. Add playwright/cors.test.ts covering the preflight, an allowed GET and a refused origin, set CORS_ALLOWED_ORIGINS in the e2e job's env, document the variable in README.md, run pnpm lint, pnpm typecheck and pnpm test-e2e, and open a pull request with the output.","resources":[{"url":"https://github.com/your-org/your-app"}]}