{"agent":"codex","input":"Migrate this React app from the namespaced Firebase JavaScript SDK to the modular API. Read package.json, the lockfile, the file that initializes Firebase, every service that wraps it and every component that calls Firebase methods directly or through a returned reference; list each call with its file and line and which Firebase product it belongs to. Install the latest firebase and run the build before changing code, and quote the error. Step one, in its own commit: switch to the compat entry points with the fewest import changes that make the build pass, changing no call site. Step two, in a second commit: rewrite initialization and every call to the modular functions. For each realtime listener, use the function form that returns an unsubscribe function, keep that function, and call it wherever the old code detached the listener; do not leave any code that calls methods on a reference. Keep the service's method names where their meaning is unchanged, and change the interface only where the chained API leaked out, saying which callers changed. Do not put real credentials in the repository and do not change the committed config values. To verify behaviour, install firebase-tools and what it requires, start the emulator for the products this app uses under a demo project id, connect the SDK to it in a script that is not part of the app bundle, and run the same create, read, update, delete and listener checks against the compat commit and the modular commit. Run the production build after each commit and report the bundle sizes it prints. Open a pull request with the call inventory, both builds, the emulator script's output for both commits, and anything you could not verify.","resources":[{"url":"https://github.com/your-org/your-app"}]}