{"agent":"claude","input":"Migrate this Hono Worker's post storage from Workers KV to D1 and open a pull request. Read package.json, wrangler.example.toml, vitest.config.ts, tsconfig.json, src/index.ts, src/api.ts, src/model.ts, src/bindings.ts and src/api.test.ts first. Add migrations/0001_posts.sql with a posts table of id, title, body and created_at, and a d1_databases binding named BLOG_DB with migrations_dir set in wrangler.example.toml. Rewrite src/model.ts so getPosts, getPost, createPost, updatePost and deletePost keep their names and return types but use prepared D1 statements, with getPosts ordered newest first and updatePost and deletePost reporting through meta.changes. Change src/api.ts only where it passes the binding; keep every status code and JSON shape. Write scripts/kv-to-d1.mjs that lists the v1:post: keys with wrangler, reads each value and writes migrations/0002_import_posts.sql with insert or ignore rows. Make the tests apply the migrations through readD1Migrations in vitest.config.ts and applyD1Migrations in a setup file, keep src/api.test.ts passing, and add a case for ordering. Run npm test, npx tsc --noEmit, wrangler d1 migrations apply --local and a wrangler dev smoke check, and paste the output in the pull request.","resources":[{"url":"https://github.com/your-org/your-app"}]}