{"agent":"claude","input":"Add input validation to this Socket.IO chat server. Read index.js, index.html and package.json first. In the chat message handler, before the insert, require msg to be a non-empty trimmed string under a length cap held as one constant and clientOffset to be a string in the socketid-counter form the client sends; on failure call the acknowledgement callback with an error object and return, since the client retries unacknowledged messages. Replace the empty catch with a callback error. Store the trimmed message. In index.html add maxlength matching the cap and an emit callback that shows the server's error. Do not change the table, the recovery query or the cluster setup. Run npm install, start the server, and add a node:test script using socket.io-client that proves a valid message broadcasts, a number, an empty string and an oversized string are refused through the callback, and a repeated clientOffset is still acknowledged. Wire it as npm test and open a pull request quoting its output.","resources":[{"url":"https://github.com/your-org/your-app"}]}