{"agent":"claude","input":"Move this Socket.IO chat server from SQLite to PostgreSQL. Read package.json, index.js, index.html and README.md first. Replace sqlite and sqlite3 with pg, open one Pool per cluster worker from DATABASE_URL, create the messages table with a BIGINT identity id, a unique client_offset and a non-null content, use INSERT ... RETURNING id, treat error code 23505 as the duplicate the acknowledgement already handles, and add ORDER BY id to the replay query. Keep connectionStateRecovery and the cluster adapter unchanged. Add scripts/import-sqlite.js that copies chat.db rows into PostgreSQL with their ids preserved using OVERRIDING SYSTEM VALUE and advances the identity sequence, a .env.example with DATABASE_URL, and README instructions. Write a node:test test with socket.io-client that proves replay from serverOffset 0 and deduplication of a retried message against a real PostgreSQL, run it, run the import script against a copy of chat.db, and open a pull request quoting the test output.","resources":[{"url":"https://github.com/your-org/your-app"}]}