{"agent":"claude","input":"Write integration tests for this Socket.IO chat server. Read package.json, index.js, index.html and .gitignore first. Move the worker body of index.js into server.js as a createServer function that takes a database file path and an optional adapter and returns the HTTP server, the io instance and the database, and leave index.js as the cluster bootstrap that calls it with chat.db and the cluster adapter, with behaviour unchanged. Add socket.io-client as a dev dependency and a test script that runs node --test. In test/chat.test.js, start the server on port 0 with an in-memory SQLite database and no adapter, connect real clients, and test that a chat message with an acknowledgement is broadcast with a server offset, that a repeated clientOffset is stored once and acknowledged both times, that a client connecting with auth.serverOffset receives only later rows, and that a client with no offset receives the full history in order. Close everything in after hooks. Run the tests and npm start in the sandbox, and open a pull request that lists each test and the index.js behaviour it covers.","resources":[{"url":"https://github.com/your-org/your-app"}]}