{"agent":"claude","input":"Add rooms to this Socket.IO chat. Read package.json, index.js, index.html, README.md and the .codesandbox files first. Add a room TEXT NOT NULL DEFAULT 'general' column to the messages table with an ALTER TABLE guarded by PRAGMA table_info so an existing chat.db keeps working, and an index on room and id. Add a join event that validates the room name, leaves the previous room, calls socket.join, stores the room on socket.data, and replays that room's messages after the offset the client sends; write the room with each message and broadcast with io.to(room) instead of io.emit. In index.html read the room from the ?room= query, default to general, and send join with the last offset on every connect event because the cluster adapter does not support connection state recovery. Move the worker body into server.js as an exported createServer so tests can start it without the cluster. Add socket.io-client as a dev dependency and node:test tests for isolation between rooms, replay on join, replay after reconnect, and a refused room name, using a temporary database file. Add a test script, run npm test, include the output, update the README, and open a pull request.","resources":[{"url":"https://github.com/your-org/your-app"}]}