{"_id":"@basementstudio/sanity-ai-image-plugin","_rev":"7-36360de55e096bbba42878cfe17c8539","name":"@basementstudio/sanity-ai-image-plugin","dist-tags":{"latest":"0.1.4"},"versions":{"0.0.0":{"name":"@basementstudio/sanity-ai-image-plugin","version":"0.0.0","keywords":["sanity","sanity-plugin","gemini","image-generation","ai-image-plugin"],"_id":"@basementstudio/sanity-ai-image-plugin@0.0.0","maintainers":[{"name":"fedealvarezcampos","email":"fedealvarezcampos@gmail.com"},{"name":"ignmandagaran","email":"ignaciofmandagaran@gmail.com"},{"name":"bertodev","email":"bautista@basement.studio"},{"name":"gitchad","email":"tobias@basement.studio"},{"name":"mesteban","email":"mariana@basement.studio"},{"name":"valentinabearzotti","email":"valebearzotti1@gmail.com"},{"name":"mike.aguilar.bsmnt","email":"miqueas@basement.studio"},{"name":"tomasfdev","email":"hellotomasdev@gmail.com"},{"name":"joserago","email":"jose@basement.studio"}],"dist":{"shasum":"62af308733d4e26b6d9c1984764082b365fc7804","tarball":"https://registry.npmjs.org/@basementstudio/sanity-ai-image-plugin/-/sanity-ai-image-plugin-0.0.0.tgz","fileCount":23,"integrity":"sha512-H/5pqF3WEFz9RhCSUdSay/WvHll2jzzLDs0LveaQyPp1wQLcBXYOakQYSwAejwqeWY9y/tLmcJEL1NJmC906fA==","signatures":[{"sig":"MEYCIQDh4Oew6+7W3Jp2tPbe+9bi+zHuB+pUIZqMQYZYTqj7hwIhAI3qRClWMxAsRhOVeWo4gZXKKfdVVCmHkvRn8fWzv+P8","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":96567},"type":"module","exports":{".":{"types":"./src/index.ts","import":"./src/index.ts","default":"./src/index.ts"},"./server":{"types":"./src/server.ts","import":"./src/server.ts","default":"./src/server.ts"},"./package.json":"./package.json"},"gitHead":"26c374cddf0ebf8f218fb83765114965ff9c99a2","private":false,"scripts":{"test":"bun test tests","build":"tsc -p tsconfig.build.json","check":"tsc -p tsconfig.json --noEmit","release":"changeset publish","changeset":"changeset","release-canary":"changeset publish --tag canary --no-git-tag","version-canary":"changeset version --snapshot canary","version-packages":"changeset version"},"_npmUser":{"name":"mike.aguilar.bsmnt","email":"miqueas@basement.studio"},"_npmVersion":"10.2.5","description":"Portable Sanity Studio plugin and server helper for AI image generation.","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","dependencies":{"ai":"^6","@ai-sdk/google":"^3","@ai-sdk/openai":"^3"},"_hasShrinkwrap":false,"packageManager":"bun@1.3.7","devDependencies":{"react":"^19.2.4","sanity":"^5.6.0","react-dom":"^19.2.4","@sanity/ui":"^3.1.14","@types/bun":"^1.3.6","typescript":"^5.9.3","@types/node":"^20.19.30","@types/react":"^19.2.9","@changesets/cli":"^2.29.8","@types/react-dom":"^19.2.3","@changesets/changelog-github":"^0.5.2"},"peerDependencies":{"react":"^18.0.0 || ^19.0.0","sanity":"^3.0.0 || ^4.0.0 || ^5.0.0","react-dom":"^18.0.0 || ^19.0.0","@sanity/ui":"^2.0.0 || ^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sanity-ai-image-plugin_0.0.0_1774642914439_0.27026010815811663","host":"s3://npm-registry-packages-npm-production"}},"0.0.1":{"name":"@basementstudio/sanity-ai-image-plugin","version":"0.0.1","keywords":["sanity","sanity-plugin","gemini","image-generation","ai-image-plugin"],"_id":"@basementstudio/sanity-ai-image-plugin@0.0.1","maintainers":[{"name":"fedealvarezcampos","email":"fedealvarezcampos@gmail.com"},{"name":"ignmandagaran","email":"ignaciofmandagaran@gmail.com"},{"name":"bertodev","email":"bautista@basement.studio"},{"name":"gitchad","email":"tobias@basement.studio"},{"name":"mesteban","email":"mariana@basement.studio"},{"name":"valentinabearzotti","email":"valebearzotti1@gmail.com"},{"name":"mike.aguilar.bsmnt","email":"miqueas@basement.studio"},{"name":"tomasfdev","email":"hellotomasdev@gmail.com"},{"name":"joserago","email":"jose@basement.studio"}],"dist":{"shasum":"a5b843c919306553671a3cbddfc86fef08634c68","tarball":"https://registry.npmjs.org/@basementstudio/sanity-ai-image-plugin/-/sanity-ai-image-plugin-0.0.1.tgz","fileCount":23,"integrity":"sha512-UbCTjLEh6KHBRzrMzdo4tXHXFp/zPiiZvHN2WoUs9BDpKpIUka1yofB9KlOmeyCs4p6Uk5oSogeJpCYPy2jLxg==","signatures":[{"sig":"MEQCIApGOvp20xDLv8WUqLdIhBRE4qOutqRaGyXPlIv04r+BAiA6eQ0jjY9PVr7srallSz9YTuxmhK4j9HmqwyWWvNMZHA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":96588},"type":"module","exports":{".":{"types":"./src/index.ts","import":"./src/index.ts","default":"./src/index.ts"},"./server":{"types":"./src/server.ts","import":"./src/server.ts","default":"./src/server.ts"},"./package.json":"./package.json"},"gitHead":"3fa052c576988f1cebda6db706d55f3170e1c7b0","private":false,"scripts":{"test":"bun test tests","build":"tsc -p tsconfig.build.json","check":"tsc -p tsconfig.json --noEmit","release":"changeset publish","changeset":"changeset","release-canary":"changeset publish --tag canary --no-git-tag","version-canary":"changeset version --snapshot canary","version-packages":"changeset version"},"_npmUser":{"name":"mike.aguilar.bsmnt","email":"miqueas@basement.studio"},"_npmVersion":"10.2.5","description":"Portable Sanity Studio plugin and server helper for AI image generation.","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","dependencies":{"ai":"^6","@ai-sdk/google":"^3","@ai-sdk/openai":"^3"},"_hasShrinkwrap":false,"packageManager":"bun@1.3.7","devDependencies":{"react":"^19.2.4","sanity":"^5.6.0","react-dom":"^19.2.4","@sanity/ui":"^3.1.14","@types/bun":"^1.3.6","typescript":"^5.9.3","@types/node":"^20.19.30","@types/react":"^19.2.9","@changesets/cli":"^2.29.8","@types/react-dom":"^19.2.3","@changesets/changelog-github":"^0.5.2"},"peerDependencies":{"react":"^18.0.0 || ^19.0.0","sanity":"^3.0.0 || ^4.0.0 || ^5.0.0","react-dom":"^18.0.0 || ^19.0.0","@sanity/ui":"^2.0.0 || ^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sanity-ai-image-plugin_0.0.1_1774643004972_0.4483087084559432","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@basementstudio/sanity-ai-image-plugin","version":"0.1.0","keywords":["sanity","sanity-plugin","gemini","image-generation","ai-image-plugin"],"_id":"@basementstudio/sanity-ai-image-plugin@0.1.0","maintainers":[{"name":"fedealvarezcampos","email":"fedealvarezcampos@gmail.com"},{"name":"ignmandagaran","email":"ignaciofmandagaran@gmail.com"},{"name":"bertodev","email":"bautista@basement.studio"},{"name":"gitchad","email":"tobias@basement.studio"},{"name":"mesteban","email":"mariana@basement.studio"},{"name":"valentinabearzotti","email":"valebearzotti1@gmail.com"},{"name":"mike.aguilar.bsmnt","email":"miqueas@basement.studio"},{"name":"tomasfdev","email":"hellotomasdev@gmail.com"},{"name":"joserago","email":"jose@basement.studio"}],"dist":{"shasum":"d4627a6cf80110884c3567de054b02d83687c987","tarball":"https://registry.npmjs.org/@basementstudio/sanity-ai-image-plugin/-/sanity-ai-image-plugin-0.1.0.tgz","fileCount":90,"integrity":"sha512-PAilSta9UDdJ0/TzLht7bN7NQdp9ILdO3l+W69xa48vsGVrrTAPwSSiNoyfCEueqnsYuXutJz/Xkb6LGXstcVg==","signatures":[{"sig":"MEQCIAq+G5K5repwn9Fh7y1tlxPKQnAA36Z3drQhq7pqMt7zAiB/no+wZQPyqV7+pnaptGI8NVOoPCR+BmeORKGGtzr6rQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":196778},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20.19 <22 || >=22.12"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./server":{"types":"./dist/server.d.ts","import":"./dist/server.js","default":"./dist/server.js"},"./package.json":"./package.json"},"gitHead":"4c4869d008bffb06632e4014b7cfcf366e66957d","private":false,"scripts":{"test":"bun test tests","build":"tsc -p tsconfig.build.json","check":"tsc -p tsconfig.json --noEmit","release":"changeset publish","changeset":"changeset","release-canary":"changeset publish --tag canary --no-git-tag","version-canary":"changeset version --snapshot canary","version-packages":"changeset version"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:fba657a6-b7d5-43d2-a260-b9da32319952"}},"_npmVersion":"11.6.2","description":"Portable Sanity Studio plugin and server helper for AI image generation.","directories":{},"sideEffects":false,"_nodeVersion":"24.14.0","dependencies":{"ai":"^6","@ai-sdk/google":"^3","@ai-sdk/openai":"^3","@sanity/studio-secrets":"^4.0.2"},"_hasShrinkwrap":false,"packageManager":"bun@1.3.7","devDependencies":{"react":"^19.2.4","sanity":"^5.6.0","react-dom":"^19.2.4","@sanity/ui":"^3.1.14","@types/bun":"^1.3.6","typescript":"^5.9.3","@types/node":"^20.19.30","@types/react":"^19.2.9","@changesets/cli":"^2.29.8","@types/react-dom":"^19.2.3","@changesets/changelog-github":"^0.5.2"},"peerDependencies":{"react":"^19.2.0","sanity":"^5.0.0","react-dom":"^19.2.0","@sanity/ui":"^3.1.13"},"_npmOperationalInternal":{"tmp":"tmp/sanity-ai-image-plugin_0.1.0_1775071567372_0.07759574247394041","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@basementstudio/sanity-ai-image-plugin","version":"0.1.1","keywords":["sanity","sanity-plugin","gemini","image-generation","ai-image-plugin"],"_id":"@basementstudio/sanity-ai-image-plugin@0.1.1","maintainers":[{"name":"fedealvarezcampos","email":"fedealvarezcampos@gmail.com"},{"name":"ignmandagaran","email":"ignaciofmandagaran@gmail.com"},{"name":"bertodev","email":"bautista@basement.studio"},{"name":"gitchad","email":"tobias@basement.studio"},{"name":"mesteban","email":"mariana@basement.studio"},{"name":"valentinabearzotti","email":"valebearzotti1@gmail.com"},{"name":"mike.aguilar.bsmnt","email":"miqueas@basement.studio"},{"name":"tomasfdev","email":"hellotomasdev@gmail.com"},{"name":"joserago","email":"jose@basement.studio"}],"dist":{"shasum":"6a48edf65794fce68dec5db2d79c803e4fb32fdb","tarball":"https://registry.npmjs.org/@basementstudio/sanity-ai-image-plugin/-/sanity-ai-image-plugin-0.1.1.tgz","fileCount":98,"integrity":"sha512-r8yHvGPaKGl2zWvI2p0qgKDPqHbtY2J5o9l3YteofP0frrulix3nPQpBDPmzoqolPGsqR9xy8gXvCqO5DFR86w==","signatures":[{"sig":"MEUCIDQPRRlDkUmZJb22Zog3UJ4HNkWxNJHICNW3nQHfTGbvAiEAzUD/r5v7/OSQ+P/nr+wRW4lC6mt4fobYVgYV7pF8QLM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":232469},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20.19 <22 || >=22.12"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./server":{"types":"./dist/server.d.ts","import":"./dist/server.js","default":"./dist/server.js"},"./package.json":"./package.json"},"gitHead":"269a40de0cd741e0631932e81ad69f82141b0b15","private":false,"scripts":{"test":"bun test tests","build":"tsc -p tsconfig.build.json","check":"tsc -p tsconfig.json --noEmit","release":"changeset publish","changeset":"changeset","release-canary":"changeset publish --tag canary --no-git-tag","version-canary":"changeset version --snapshot canary","version-packages":"changeset version"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:fba657a6-b7d5-43d2-a260-b9da32319952"}},"_npmVersion":"11.6.2","description":"Portable Sanity Studio plugin and server helper for AI image generation.","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","dependencies":{"ai":"^6","@ai-sdk/google":"^3","@ai-sdk/openai":"^3","@sanity/studio-secrets":"^4.0.2"},"_hasShrinkwrap":false,"packageManager":"bun@1.3.7","devDependencies":{"react":"^19.2.4","sanity":"^5.6.0","react-dom":"^19.2.4","@sanity/ui":"^3.1.14","@types/bun":"^1.3.6","typescript":"^5.9.3","@types/node":"^20.19.30","@types/react":"^19.2.9","@changesets/cli":"^2.29.8","@types/react-dom":"^19.2.3","@changesets/changelog-github":"^0.5.2"},"peerDependencies":{"react":"^19.2.0","sanity":"^5.0.0","react-dom":"^19.2.0","@sanity/ui":"^3.1.13"},"_npmOperationalInternal":{"tmp":"tmp/sanity-ai-image-plugin_0.1.1_1775245780211_0.5832845681721981","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@basementstudio/sanity-ai-image-plugin","version":"0.1.2","keywords":["sanity","sanity-plugin","gemini","image-generation","ai-image-plugin"],"_id":"@basementstudio/sanity-ai-image-plugin@0.1.2","maintainers":[{"name":"fedealvarezcampos","email":"fedealvarezcampos@gmail.com"},{"name":"ignmandagaran","email":"ignaciofmandagaran@gmail.com"},{"name":"bertodev","email":"bautista@basement.studio"},{"name":"gitchad","email":"tobias@basement.studio"},{"name":"mesteban","email":"mariana@basement.studio"},{"name":"valentinabearzotti","email":"valebearzotti1@gmail.com"},{"name":"mike.aguilar.bsmnt","email":"miqueas@basement.studio"},{"name":"tomasfdev","email":"hellotomasdev@gmail.com"},{"name":"joserago","email":"jose@basement.studio"}],"dist":{"shasum":"aa8c055fb0d688156a9fc15726949ed322785673","tarball":"https://registry.npmjs.org/@basementstudio/sanity-ai-image-plugin/-/sanity-ai-image-plugin-0.1.2.tgz","fileCount":2,"integrity":"sha512-X8K7cz8ajwYUwMzaOMXoNq4uZHvruG3F2NrwSEZ4jE0t4wmiqx93opWDLUYwW8JRvt7u1xTJNbN8XMVYuBsqAA==","signatures":[{"sig":"MEYCIQC7SVhPdyxSW1qCizobjHI2cCqmrfZinELS+mqGNX13pwIhAKmhx7timZM0/DsVhyHSgW+PQ/Qzml8BQJ8E9zMWMElJ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10103},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20.19 <22 || >=22.12"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./server":{"types":"./dist/server.d.ts","import":"./dist/server.js","default":"./dist/server.js"},"./package.json":"./package.json"},"gitHead":"1ed7c800bea1784dfc5e7021bc3fdedad2125dd9","private":false,"scripts":{"test":"bun test tests","build":"tsc -p tsconfig.build.json","check":"tsc -p tsconfig.json --noEmit","release":"changeset publish","changeset":"changeset","release-canary":"changeset publish --tag canary --no-git-tag","version-canary":"changeset version --snapshot canary","version-packages":"changeset version"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:fba657a6-b7d5-43d2-a260-b9da32319952"}},"_npmVersion":"11.6.2","description":"Portable Sanity Studio plugin and server helper for AI image generation.","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","dependencies":{"ai":"^6","@ai-sdk/google":"^3","@ai-sdk/openai":"^3","@sanity/studio-secrets":"^4.0.2"},"_hasShrinkwrap":false,"packageManager":"bun@1.3.7","devDependencies":{"react":"^19.2.4","sanity":"^5.6.0","react-dom":"^19.2.4","@sanity/ui":"^3.1.14","@types/bun":"^1.3.6","typescript":"^5.9.3","@types/node":"^20.19.30","@types/react":"^19.2.9","@changesets/cli":"^2.29.8","@types/react-dom":"^19.2.3","@changesets/changelog-github":"^0.5.2"},"peerDependencies":{"react":"^19.2.0","sanity":"^5.0.0","react-dom":"^19.2.0","@sanity/ui":"^3.1.13"},"_npmOperationalInternal":{"tmp":"tmp/sanity-ai-image-plugin_0.1.2_1775247223366_0.5340258581996182","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@basementstudio/sanity-ai-image-plugin","version":"0.1.3","keywords":["sanity","sanity-plugin","gemini","image-generation","ai-image-plugin"],"_id":"@basementstudio/sanity-ai-image-plugin@0.1.3","maintainers":[{"name":"fedealvarezcampos","email":"fedealvarezcampos@gmail.com"},{"name":"ignmandagaran","email":"ignaciofmandagaran@gmail.com"},{"name":"bertodev","email":"bautista@basement.studio"},{"name":"gitchad","email":"tobias@basement.studio"},{"name":"mesteban","email":"mariana@basement.studio"},{"name":"valentinabearzotti","email":"valebearzotti1@gmail.com"},{"name":"mike.aguilar.bsmnt","email":"miqueas@basement.studio"},{"name":"tomasfdev","email":"hellotomasdev@gmail.com"},{"name":"joserago","email":"jose@basement.studio"}],"dist":{"shasum":"caafa38f6fe9242a8c25d9c6cca3ff39c8142bd9","tarball":"https://registry.npmjs.org/@basementstudio/sanity-ai-image-plugin/-/sanity-ai-image-plugin-0.1.3.tgz","fileCount":2,"integrity":"sha512-JlNa67c5TQX2tRieGU5xyU5posMALi6ef+3/5Vpn07DGMu/k2cr4wKpttg5NL8NHyp9Ut25EYPKha95bR4Xc9A==","signatures":[{"sig":"MEQCIBokp/B2gWCv1LYvnuJuObh0tIbsm521KP95hj8gKS2VAiB2XrqVrf26V0NJjsMTZ/w7KK6tAwPKAOgj42sR6YCAuw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":21619},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20.19 <22 || >=22.12"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./server":{"types":"./dist/server.d.ts","import":"./dist/server.js","default":"./dist/server.js"},"./package.json":"./package.json"},"gitHead":"8b01e60141b29eb5e22391548e55fdb61d359785","private":false,"scripts":{"test":"bun test tests","build":"tsc -p tsconfig.build.json","check":"tsc -p tsconfig.json --noEmit","release":"changeset publish","changeset":"changeset","release-canary":"changeset publish --tag canary --no-git-tag","version-canary":"changeset version --snapshot canary","version-packages":"changeset version"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:fba657a6-b7d5-43d2-a260-b9da32319952"}},"_npmVersion":"11.6.2","description":"Portable Sanity Studio plugin and server helper for AI image generation.","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","dependencies":{"ai":"^6","@ai-sdk/google":"^3","@ai-sdk/openai":"^3","@sanity/studio-secrets":"^4.0.2"},"_hasShrinkwrap":false,"packageManager":"bun@1.3.7","devDependencies":{"react":"^19.2.4","sanity":"^5.6.0","react-dom":"^19.2.4","@sanity/ui":"^3.1.14","@types/bun":"^1.3.6","typescript":"^5.9.3","@types/node":"^20.19.30","@types/react":"^19.2.9","@changesets/cli":"^2.29.8","@types/react-dom":"^19.2.3","@changesets/changelog-github":"^0.5.2"},"peerDependencies":{"react":"^19.2.0","sanity":"^5.0.0","react-dom":"^19.2.0","@sanity/ui":"^3.1.13"},"_npmOperationalInternal":{"tmp":"tmp/sanity-ai-image-plugin_0.1.3_1775565678421_0.3909183040017179","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@basementstudio/sanity-ai-image-plugin","private":false,"version":"0.1.4","packageManager":"bun@1.3.7","description":"Portable Sanity Studio plugin and server helper for AI image generation.","type":"module","sideEffects":false,"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./server":{"types":"./dist/server.d.ts","import":"./dist/server.js","default":"./dist/server.js"},"./package.json":"./package.json"},"scripts":{"build":"tsc -p tsconfig.build.json","check":"tsc -p tsconfig.json --noEmit","test":"bun test tests","changeset":"changeset","version-packages":"changeset version","release":"changeset publish","version-canary":"changeset version --snapshot canary","release-canary":"changeset publish --tag canary --no-git-tag"},"keywords":["sanity","sanity-plugin","gemini","image-generation","ai-image-plugin"],"peerDependencies":{"@sanity/ui":"^3.1.13","react":"^19.2.0","react-dom":"^19.2.0","sanity":"^5.0.0"},"engines":{"node":">=20.19 <22 || >=22.12"},"dependencies":{"@ai-sdk/google":"^3","@ai-sdk/openai":"^3","@sanity/studio-secrets":"^4.0.2","ai":"^6"},"devDependencies":{"@sanity/ui":"^3.1.14","@changesets/changelog-github":"^0.5.2","@changesets/cli":"^2.29.8","@types/bun":"^1.3.6","@types/node":"^20.19.30","@types/react":"^19.2.9","@types/react-dom":"^19.2.3","react":"^19.2.4","react-dom":"^19.2.4","sanity":"^5.6.0","typescript":"^5.9.3"},"gitHead":"81e640f956a0c6e10cc11f3dba3b0284e0d3d4f4","_id":"@basementstudio/sanity-ai-image-plugin@0.1.4","_nodeVersion":"24.14.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-v9CesWt1ZC2y/t/47kxa7v1txVMWxTvU3Gezp/CQ+Xo35pB6C86lcKSRo9qFTvj3ciYF+CoVrlvExbxmyXYE4Q==","shasum":"9e24c3cfcc2f569954c2efe9e6a5bdec6b08a52f","tarball":"https://registry.npmjs.org/@basementstudio/sanity-ai-image-plugin/-/sanity-ai-image-plugin-0.1.4.tgz","fileCount":2,"unpackedSize":21619,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHxfEuN2Eqa7u4w8Fp6ZGlGyX4OF2CV/II92OoRrb/vsAiEA9Cwy31+cTRCmk5wBjNKswFTC/QCbxdr7MaaY72UVrHs="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:fba657a6-b7d5-43d2-a260-b9da32319952"}},"directories":{},"maintainers":[{"name":"fedealvarezcampos","email":"fedealvarezcampos@gmail.com"},{"name":"ignmandagaran","email":"ignaciofmandagaran@gmail.com"},{"name":"bertodev","email":"bautista@basement.studio"},{"name":"gitchad","email":"tobias@basement.studio"},{"name":"mesteban","email":"mariana@basement.studio"},{"name":"valentinabearzotti","email":"valebearzotti1@gmail.com"},{"name":"mike.aguilar.bsmnt","email":"miqueas@basement.studio"},{"name":"tomasfdev","email":"hellotomasdev@gmail.com"},{"name":"joserago","email":"jose@basement.studio"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sanity-ai-image-plugin_0.1.4_1775710521018_0.8070077610548867"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-27T20:21:54.322Z","modified":"2026-04-09T04:55:21.379Z","0.0.0":"2026-03-27T20:21:54.586Z","0.0.1":"2026-03-27T20:23:25.115Z","0.1.0":"2026-04-01T19:26:07.507Z","0.1.1":"2026-04-03T19:49:40.376Z","0.1.2":"2026-04-03T20:13:43.511Z","0.1.3":"2026-04-07T12:41:18.606Z","0.1.4":"2026-04-09T04:55:21.159Z"},"keywords":["sanity","sanity-plugin","gemini","image-generation","ai-image-plugin"],"description":"Portable Sanity Studio plugin and server helper for AI image generation.","maintainers":[{"name":"fedealvarezcampos","email":"fedealvarezcampos@gmail.com"},{"name":"ignmandagaran","email":"ignaciofmandagaran@gmail.com"},{"name":"bertodev","email":"bautista@basement.studio"},{"name":"gitchad","email":"tobias@basement.studio"},{"name":"mesteban","email":"mariana@basement.studio"},{"name":"valentinabearzotti","email":"valebearzotti1@gmail.com"},{"name":"mike.aguilar.bsmnt","email":"miqueas@basement.studio"},{"name":"tomasfdev","email":"hellotomasdev@gmail.com"},{"name":"joserago","email":"jose@basement.studio"}],"readme":"# `sanity-ai-image-plugin`\n\nPortable Sanity Studio plugin and server helper for generating images with\nGemini, OpenAI, and other package-supported image models and dropping the\nresult straight into Sanity image fields.\n\n## Setup\n\n### 1. Add the Studio plugin\n\n1. Import `aiImagePlugin` in your `sanity.config.ts`.\n2. Add it to the `plugins` array.\n3. Set `apiVersion`.\n4. Add a `generateButton` target for each image field that should show a\n  `Generate` button.\n\n```ts\nimport { aiImagePlugin } from \"@basementstudio/sanity-ai-image-plugin\"\nimport { defineConfig } from \"sanity\"\n\nexport default defineConfig({\n  // ...your existing config\n  plugins: [\n    aiImagePlugin({\n      apiVersion: \"2025-02-19\",\n      targets: [\n        {\n          id: \"article-featured-image\",\n          type: \"generateButton\",\n          documentType: \"article\",\n          fieldPath: \"featuredImage\",\n        },\n      ],\n    }),\n  ],\n})\n```\n\nWith that config:\n\n- the AI Image Plugin settings tool is registered in Studio\n- the default asset source is enabled\n- `article.featuredImage` gets a `Generate` button\n\n#### `aiImagePlugin(...)` options\n\n\n| Option              | Required | Default                                                                                     | Notes                                                                                                                                          |\n| ------------------- | -------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |\n| `apiVersion`        | Yes      | none                                                                                        | Sanity API version used by the plugin's client calls.                                                                                          |\n| `targets`           | No       | `[]`                                                                                        | Generate-button targets. Each matching target adds a `Generate` button above a Sanity image input.                                             |\n| `allowedModels`     | No       | `[\"gemini-2.5-flash-image\"]`                                                                | Non-empty subset of `SUPPORTED_AI_IMAGE_MODELS`. The first entry becomes the default model in Studio unless settings or the route override it. |\n| `apiEndpoint`       | No       | `\"/api/ai-image-plugin\"`                                                                    | Path the Studio calls when generating images. Change this if your route lives somewhere else.                                                  |\n| `assetSource`       | No       | enabled with built-in defaults                                                              | Adds the plugin to the Sanity image asset picker. Set `false` to disable it, or pass an object to customize labels and copy.                   |\n| `frontendRateLimit` | No       | `{ maxRequests: 3, windowSecs: 60 }`                                                        | Browser-side rolling window limiter shared across tabs via `localStorage`. Set `false` to disable it.                                          |\n| `settingsTool`      | No       | `{ name: \"ai-image-plugin-settings\", title: \"AI Image Plugin\", registerSchemaType: false }` | Lets you rename the settings tool or opt into registering the schema type automatically.                                                       |\n\n\n#### `targets[]` generate-button fields\n\n\n| Field                        | Required | Default                                                                    | Notes                                                                                                                                     |\n| ---------------------------- | -------- | -------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |\n| `id`                         | Yes      | none                                                                       | Stable target ID. This is also how per-target settings are stored.                                                                        |\n| `type`                       | Yes      | none                                                                       | Must be `\"generateButton\"`.                                                                                                               |\n| `documentType`               | Yes      | none                                                                       | Sanity document type the target should match, like `\"article\"` or `\"homePage\"`.                                                           |\n| `fieldPath`                  | Yes      | none                                                                       | Dot path to the image field, like `\"featuredImage\"` or `\"seo.ogImage\"`.                                                                   |\n| `title`                      | No       | none                                                                       | Friendly name shown in the settings tool and used as a fallback label in parts of the UI.                                                 |\n| `description`                | No       | `\"Generate an image with AI Image Plugin for this field.\"` in the field UI | Short helper copy shown above the button and in the settings tool.                                                                        |\n| `dialogTitle`                | No       | `\"Generate Image\"`                                                         | Title shown at the top of the generate dialog.                                                                                            |\n| `promptLabel`                | No       | `\"Custom prompt\"`                                                          | Label for the freeform editor prompt field in the dialog.                                                                                 |\n| `promptPlaceholder`          | No       | `\"Optional custom instructions for this image.\"`                           | Placeholder text for the editor prompt field.                                                                                             |\n| `suggestedContextFieldPaths` | No       | `[]`                                                                       | Top-level document fields that should be preselected as context tags when the dialog opens. Editors can still toggle them per generation. |\n\n\n#### `assetSource` fields\n\n\n| Field               | Required | Default                                                                                         | Notes                                                                                 |\n| ------------------- | -------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |\n| `enabled`           | No       | `true`                                                                                          | Set `false` to disable the asset source while keeping the rest of the plugin enabled. |\n| `id`                | No       | `\"ai-image-plugin-asset-source\"`                                                                | Stable target ID used for asset-source-specific settings.                             |\n| `title`             | No       | `\"Image Asset Source\"`                                                                          | Label shown in the asset picker.                                                      |\n| `description`       | No       | `\"Adds AI Image Plugin to the image asset picker.\"`                                             | Helper text shown in the settings UI.                                                 |\n| `promptLabel`       | No       | `\"Prompt\"`                                                                                      | Label for the asset source prompt field.                                              |\n| `promptPlaceholder` | No       | `\"Turn these references into a clean homepage hero image with warm daylight and subtle depth.\"` | Placeholder text for the asset source prompt field.                                   |\n\n\n#### `frontendRateLimit` fields\n\n\n| Field         | Required | Default | Notes                                                             |\n| ------------- | -------- | ------- | ----------------------------------------------------------------- |\n| `maxRequests` | No       | `3`     | Maximum generation attempts allowed during the configured window. |\n| `windowSecs`  | No       | `60`    | Rolling window length in seconds.                                 |\n\n\n#### `settingsTool` fields\n\n\n| Field                | Required | Default                      | Notes                                                                                    |\n| -------------------- | -------- | ---------------------------- | ---------------------------------------------------------------------------------------- |\n| `name`               | No       | `\"ai-image-plugin-settings\"` | Internal tool name.                                                                      |\n| `title`              | No       | `\"AI Image Plugin\"`          | Title shown in the Studio tool menu.                                                     |\n| `registerSchemaType` | No       | `false`                      | Set `true` if you want the plugin to register its settings document schema type for you. |\n\n\n### 2. Add the API route\n\n1. Create a POST route at `/api/ai-image-plugin`.\n2. Import `handleAiImageRequest` from the server entrypoint.\n3. Pass the shared secret and the provider API key(s) for the models you allow.\n4. If you customize `allowedModels` in Studio, mirror that same list here.\n\n```ts\nimport { handleAiImageRequest } from \"@basementstudio/sanity-ai-image-plugin/server\"\n\nexport async function POST(request: Request) {\n  return handleAiImageRequest(request, {\n    apiKey: process.env.GEMINI_API_KEY!,\n    sharedSecret: process.env.AI_IMAGE_PLUGIN_SHARED_SECRET!,\n  })\n}\n```\n\nIf your route lives somewhere else, set `apiEndpoint` in `aiImagePlugin(...)`\nto match it.\n\n#### `handleAiImageRequest(request, options)` fields\n\n\n| Field                    | Required      | Default                                                              | Notes                                                                                                                     |\n| ------------------------ | ------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |\n| `sharedSecret`           | Yes           | none                                                                 | Must exactly match the secret saved in Studio.                                                                            |\n| `apiKey`                 | Conditionally | none                                                                 | Google API key. Use this for Google models, or use `googleApiKey` instead.                                                |\n| `googleApiKey`           | Conditionally | none                                                                 | Provider-specific alias for Google models. If both `googleApiKey` and `apiKey` are present, `googleApiKey` wins.          |\n| `openAiApiKey`           | Conditionally | none                                                                 | Required when you allow OpenAI models such as `gpt-image-1`.                                                              |\n| `allowedModels`          | No            | If `model` is set, `[model]`; otherwise `[\"gemini-2.5-flash-image\"]` | Non-empty subset of the package-supported models. Keep this in sync with the Studio config if you expose multiple models. |\n| `model`                  | No            | First entry in resolved `allowedModels`                              | Route-level default model. It must also be present in `allowedModels`.                                                    |\n| `enforceSameOrigin`      | No            | `true`                                                               | Rejects browser requests whose `Origin` does not match the API route origin.                                              |\n| `geminiApiUrl`           | No            | Google Generative Language API default base URL                      | Optional override for Google requests.                                                                                    |\n| `maxReferenceFileBytes`  | No            | `8 * 1024 * 1024`                                                    | Maximum size for a single reference image upload.                                                                         |\n| `maxReferences`          | No            | `5`                                                                  | Maximum number of reference images accepted per request.                                                                  |\n| `maxTotalReferenceBytes` | No            | `maxReferences * maxReferenceFileBytes`                              | Maximum combined size of all reference images in one request.                                                             |\n\n\n### 3. Set the env vars your route uses\n\nAdd the variables your server route reads. For the minimal example above, you\nonly need the shared secret and a Google API key.\n\n\n| Variable                        | Required      | Default | Notes                                                                                                                                                                    |\n| ------------------------------- | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `AI_IMAGE_PLUGIN_SHARED_SECRET` | Yes           | none    | Shared secret used by your app route. Use a long random string.                                                                                                          |\n| `GEMINI_API_KEY`                | Conditionally | none    | Required when the active model is a Google model such as `gemini-2.5-flash-image`.                                                                                       |\n| `OPENAI_API_KEY`                | Conditionally | none    | Required when the active model is an OpenAI model such as `gpt-image-1`.                                                                                                 |\n| `AI_IMAGE_MODEL`                | No            | none    | Optional project-level env var you can read in your own route if you want to choose the default model from the environment. The plugin does not read this automatically. |\n\n\n### 4. Configure the shared secret in Studio\n\n1. Start your Sanity Studio.\n2. Open the `AI Image Plugin` tool in the Studio navigation.\n3. Click `Configure shared secret`.\n4. Paste the same value you set in `AI_IMAGE_PLUGIN_SHARED_SECRET`.\n5. Save it.\n\nThe Studio stores this secret separately from the normal plugin settings\ndocument and sends it as the `x-ai-image-plugin-secret` header when\ngenerating images. If you ever rotate the secret, update it in both places.\n\n## Supported Models\n\nThe package has an internal supported-model registry. In this first pass it\ncontains exactly:\n\n- `gemini-2.5-flash-image`\n- `gemini-3.1-flash-image-preview`\n- `gpt-image-1`\n\nEach installation can opt into any non-empty subset of those models with the\nordered `allowedModels` config. The first allowed model becomes the fallback\ndefault for both the Studio UI and the server helper unless the settings\ndocument or route overrides it.\n\n## Behavior\n\n### Server helper\n\nThe server helper requires a valid shared secret and same-origin browser\nrequests by default.\n\nThat means requests are accepted only when:\n\n1. the request includes the correct `x-ai-image-plugin-secret` header\n2. the browser `Origin` matches the API route origin exactly\n\nSame-origin matches look like this:\n\n- `http://localhost:3000/studio` -> `http://localhost:3000/api/ai-image-plugin`\n- `https://myapp.vercel.app/studio` -> `https://myapp.vercel.app/api/ai-image-plugin`\n\nThe helper does not inspect the `/studio` path directly because browser\n`Origin` headers only include the scheme, host, and port. The shared secret is\nmanaged from the plugin settings tool and stored separately from the plugin's\nnormal prompt/reference-image settings document.\n\nBy default it also enforces:\n\n- `8 MiB` maximum per reference image\n- a combined reference-image cap of `maxReferences * 8 MiB`\n- the requested `model` must be both package-supported and present in the\nroute's configured `allowedModels`\n\nIf your framework supports route-level body limits, keep those enabled too.\n\n### Frontend rate limit\n\nThe Studio UI applies a browser-side rolling-window limiter by default across\nboth generation entrypoints in the same browser profile.\n\nDefault behavior:\n\n- `3` generation attempts per `60` seconds\n- shared through `localStorage`, so refreshes and other tabs see the same block\n- configurable with `frontendRateLimit` in `sanity.config`\n- disabled entirely with `frontendRateLimit: false`\n\nOnly requests that are actually sent to the plugin API route consume quota.\nLocal validation failures inside Studio do not.\n\n### Asset source\n\nThe generic asset source composes:\n\n1. global prompt\n2. asset-source target prompt\n3. editor prompt\n\nReference images are combined from:\n\n1. global reference images\n2. asset-source target reference images\n3. local editor-uploaded reference images\n\nThe asset-source model picker starts on:\n\n1. `settings.globalModel` when it is present and allowed\n2. otherwise the first configured `allowedModels` entry\n\nEditors can override that selection for the current request before generating.\n\n### Generate button targets\n\nGenerate-button targets match against:\n\n- `documentType`\n- `fieldPath`\n\nWhen matched, the plugin renders a `Generate` button above the normal Sanity\nimage input.\n\nTargets can also declare:\n\n- `suggestedContextFieldPaths`\n\nWhen the dialog opens, the plugin inspects the current document schema and shows\neligible top-level document fields as toggle tags. In this first pass, eligible\nfield types are:\n\n- `string`\n- `text`\n- `number`\n- `boolean`\n- `date`\n- `datetime`\n- `slug`\n\nSuggested context field paths are only default-on tags. They are filtered to\nfields that exist on the current document type, and editors can toggle them on\nor off for each generation.\n\nThe generate dialog also includes a model picker. It starts from the same\nglobal default resolution as the asset source, but editors can switch to a\ndifferent allowed model for that one generation request.\n\nPrompt composition order is:\n\n1. global prompt\n2. target prompt\n3. optional selected document context\n4. optional editor prompt\n\nSelected document context is built as generic lines such as:\n\n- `The field called \"title\" has content \"...\".`\n\n## PNG Normalization\n\nAll reference images are converted to PNG before they are sent to the server\nhelper. That includes:\n\n- locally uploaded reference files\n- stored settings images downloaded from Sanity\n- new images uploaded through the settings tool\n\n","readmeFilename":"README.md"}