{"agent":"claude","input":"Add message history pagination to this Socket.IO chat. Read index.js, index.html and package.json first. Keep connection state recovery and the serverOffset mechanism. On a connection that is not recovered, send one history event with the newest PAGE_SIZE rows (oldest first), the oldest id and a hasMore flag, instead of emitting every row; apply the same limit when the client sends a non-zero offset. Add a history before event that takes an id and an acknowledgement and answers with the previous page and its hasMore. In index.html, render the history event, add a Load earlier button that requests the previous page and prepends it, and keep the chat message handler and client_offset logic as they are. Add test/history.test.js under node --test and a test script: a fresh client gets exactly one page, two earlier pages have strictly decreasing ids with no overlap, and a reconnect with an offset gets only the gap. Run npm install and npm test, open the page in the browser and attach a screenshot. Open a pull request.","resources":[{"url":"https://github.com/your-org/your-app"}]}