{"agent":"codex","input":"Add API key authentication to this Cloudflare Worker and open a pull request. Read package.json, wrangler.jsonc, src/index.ts, src/types.ts, src/endpoints/tasks/router.ts, src/endpoints/dummyEndpoint.ts, tests/vitest.config.mts, tests/apply-migrations.ts and both test files first. Store the key as a Wrangler secret named API_KEY, add a .dev.vars.example that names it, and run cf-typegen so Env is typed. Write a Hono middleware in src/auth.ts that reads Authorization: Bearer, compares with crypto.subtle.timingSafeEqual, and answers 401 in the same success and errors shape the onError handler uses with a WWW-Authenticate header; register it on /tasks/* and /dummy/* before the routes and leave / and /openapi.json open. Register a bearerAuth security scheme with openapi.registry.registerComponent and apply it so the generated spec lists it. Add API_KEY to the Miniflare bindings in tests/vitest.config.mts, update the existing tests to send the header, and add tests/integration/auth.test.ts covering missing key, wrong key, right key, the open docs routes and the scheme in /openapi.json. Run npm test and paste the output in the pull request. Do not change the D1 endpoints or the migration.","resources":[{"url":"https://github.com/your-org/your-app"}]}