{"agent":"claude","input":"Add graceful shutdown to this Socket.IO server. Read package.json, index.js and index.html first. In each worker, handle SIGTERM and SIGINT once: stop accepting connections, close the Socket.IO server so clients reconnect, close the SQLite database, and exit 0, with a forced exit after a timeout read from SHUTDOWN_TIMEOUT_MS. Make sure an insert in progress finishes before the database closes. In the cluster primary, forward SIGTERM to every worker, wait for them to exit, then exit. Add a node:test test that spawns the server, connects a socket.io-client, sends SIGTERM and asserts the client is disconnected, the process exits 0 and the database reopens cleanly, plus a test script. Run the test, exercise the shutdown by hand with two browser tabs and show them reconnecting with history, and open a pull request with the output.","resources":[{"url":"https://github.com/your-org/your-app"}]}