{"_id":"@peristyle/emdash-plugin-video-to-recipe","_rev":"9-a941c7c475f58f25837891ed4fb1f9d7","name":"@peristyle/emdash-plugin-video-to-recipe","dist-tags":{"latest":"1.0.2"},"versions":{"0.5.0":{"name":"@peristyle/emdash-plugin-video-to-recipe","version":"0.5.0","keywords":["emdash","emdash-plugin","tiktok","instagram","recipe","import"],"_id":"@peristyle/emdash-plugin-video-to-recipe@0.5.0","maintainers":[{"name":"thehedges","email":"kthedges23@gmail.com"}],"homepage":"https://github.com/peristyle-io/video-to-recipe#readme","bugs":{"url":"https://github.com/peristyle-io/video-to-recipe/issues"},"dist":{"shasum":"b23fde17a5d0bdcd3f354a68ee35b4c62d01fd3e","tarball":"https://registry.npmjs.org/@peristyle/emdash-plugin-video-to-recipe/-/emdash-plugin-video-to-recipe-0.5.0.tgz","fileCount":29,"integrity":"sha512-pb3imqZ/4hqk7awLfSBGuDDoGVV1B6T9hI6JGnlLFqCs7LwGa9rtc8rO8kFfPGBajV0Cb7k6xHZVGf3N+FUY7w==","signatures":[{"sig":"MEYCIQCfvhZ6viIEmMdNqTeVQuT3ZLRgaBIaqTHevVF42HRqLgIhAKkznZOFSwZvgRm/q71yQFy9a9HzoVX8bh67u3FJNFyS","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":309902},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./sandbox":{"types":"./dist/sandbox-entry.d.ts","import":"./dist/sandbox-entry.js"}},"gitHead":"00cd73aa08db49b44f6182f6cd7b0f4b51764ba0","scripts":{"dev":"tsup --watch","test":"node scripts/test-caption-parser.mjs","build":"tsup","version":"pnpm build","typecheck":"tsc --noEmit","preversion":"pnpm typecheck && pnpm test","postversion":"git push --follow-tags","test:routes":"node scripts/test-routes.mjs","prepublishOnly":"pnpm build","diagnose:tiktok":"node scripts/diagnose-tiktok.mjs"},"_npmUser":{"name":"thehedges","email":"kthedges23@gmail.com"},"repository":{"url":"git+https://github.com/peristyle-io/video-to-recipe.git","type":"git"},"_npmVersion":"11.6.2","description":"Import TikTok and Instagram posts as recipe drafts in the EmDash admin","directories":{},"_nodeVersion":"25.2.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","emdash":"^0.14.0","esbuild":"^0.28.2","typescript":"^5.0.0"},"peerDependencies":{"astro":">=6.0.0-beta.0","emdash":"^0.14.0"},"_npmOperationalInternal":{"tmp":"tmp/emdash-plugin-video-to-recipe_0.5.0_1788356522527_0.20066982458213234","host":"s3://npm-registry-packages-npm-production"}},"0.8.0":{"name":"@peristyle/emdash-plugin-video-to-recipe","version":"0.8.0","keywords":["emdash","emdash-plugin","tiktok","instagram","recipe","import","gemini","video"],"_id":"@peristyle/emdash-plugin-video-to-recipe@0.8.0","maintainers":[{"name":"thehedges","email":"kthedges23@gmail.com"}],"homepage":"https://github.com/peristyle-io/video-to-recipe#readme","bugs":{"url":"https://github.com/peristyle-io/video-to-recipe/issues"},"dist":{"shasum":"fb1859dd601ae19c8b4f97b145274be983d39e34","tarball":"https://registry.npmjs.org/@peristyle/emdash-plugin-video-to-recipe/-/emdash-plugin-video-to-recipe-0.8.0.tgz","fileCount":32,"integrity":"sha512-43g1LcVUpZtJqvSDkFibJB/IfbfSnr6kWdWkaHnIXlRWKIIwScOAMhmBGN1r9pSJAdjzgUG1PLzd8MnPrCM+xw==","signatures":[{"sig":"MEUCIQCVno8kpWvXmO3hnoaz2hJTmh25UvgoIuEPOj6FTCw4ggIgckSfvNR8KUT6o9fWlnc0XIHmTWXPZMoytpl6RFAFdXc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":410302},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./sandbox":{"types":"./dist/sandbox-entry.d.ts","import":"./dist/sandbox-entry.js"}},"gitHead":"bb51488782db5e7bb4dd0a47170534fddf33feb8","scripts":{"dev":"tsup --watch","test":"node scripts/test-caption-parser.mjs && node scripts/test-article.mjs","build":"tsup","version":"pnpm build","typecheck":"tsc --noEmit","preversion":"pnpm typecheck && pnpm test","postversion":"git push --follow-tags","test:routes":"node scripts/test-routes.mjs","prepublishOnly":"pnpm build","diagnose:tiktok":"node scripts/diagnose-tiktok.mjs"},"_npmUser":{"name":"thehedges","email":"kthedges23@gmail.com"},"repository":{"url":"git+https://github.com/peristyle-io/video-to-recipe.git","type":"git"},"_npmVersion":"11.6.2","description":"Import TikTok and Instagram posts as recipe drafts in the EmDash admin, and build the whole article from the video with Gemini","directories":{},"_nodeVersion":"25.2.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","emdash":"^0.14.0","esbuild":"^0.28.2","typescript":"^5.0.0"},"peerDependencies":{"astro":">=6.0.0-beta.0","emdash":">=0.14.0"},"_npmOperationalInternal":{"tmp":"tmp/emdash-plugin-video-to-recipe_0.8.0_1788369939411_0.8790758073952076","host":"s3://npm-registry-packages-npm-production"}},"0.8.1":{"name":"@peristyle/emdash-plugin-video-to-recipe","version":"0.8.1","keywords":["emdash","emdash-plugin","tiktok","instagram","recipe","import","gemini","video"],"_id":"@peristyle/emdash-plugin-video-to-recipe@0.8.1","maintainers":[{"name":"thehedges","email":"kthedges23@gmail.com"}],"homepage":"https://github.com/peristyle-io/video-to-recipe#readme","bugs":{"url":"https://github.com/peristyle-io/video-to-recipe/issues"},"dist":{"shasum":"a56285bbb5479b897e6531d73c7cc3cf4b95f51c","tarball":"https://registry.npmjs.org/@peristyle/emdash-plugin-video-to-recipe/-/emdash-plugin-video-to-recipe-0.8.1.tgz","fileCount":32,"integrity":"sha512-UReaDIorvw1nHySjiM7Eh1GLO0VNyLXqKmr1XBLEIs1rYpfT6DELZURWsD2RnZIsjWUK26RhPRSohBwcHylPCg==","signatures":[{"sig":"MEYCIQCJiddIPyp8BSBojhGgDMNv8Wng+/9SXMve3hEA82Ds6wIhAMXHOdML/r6EZwTG4zNUjGVU9VIm04QNhB41N3fpR/eA","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":411656},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./sandbox":{"types":"./dist/sandbox-entry.d.ts","import":"./dist/sandbox-entry.js"}},"gitHead":"3c1013941fc807fdf0cb94aa258f3982c26d81a3","scripts":{"dev":"tsup --watch","test":"node scripts/test-caption-parser.mjs && node scripts/test-article.mjs","build":"tsup","version":"pnpm build","typecheck":"tsc --noEmit","preversion":"pnpm typecheck && pnpm test","postversion":"git push --follow-tags","test:routes":"node scripts/test-routes.mjs","prepublishOnly":"pnpm build","diagnose:tiktok":"node scripts/diagnose-tiktok.mjs"},"_npmUser":{"name":"thehedges","email":"kthedges23@gmail.com"},"repository":{"url":"git+https://github.com/peristyle-io/video-to-recipe.git","type":"git"},"_npmVersion":"11.6.2","description":"Import TikTok and Instagram posts as recipe drafts in the EmDash admin, and build the whole article from the video with Gemini","directories":{},"_nodeVersion":"25.2.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","emdash":"^0.14.0","esbuild":"^0.28.2","typescript":"^5.0.0"},"peerDependencies":{"astro":">=6.0.0-beta.0","emdash":">=0.14.0"},"_npmOperationalInternal":{"tmp":"tmp/emdash-plugin-video-to-recipe_0.8.1_1788371375907_0.5014514252979532","host":"s3://npm-registry-packages-npm-production"}},"0.8.5":{"name":"@peristyle/emdash-plugin-video-to-recipe","version":"0.8.5","keywords":["emdash","emdash-plugin","tiktok","instagram","recipe","import","gemini","video"],"_id":"@peristyle/emdash-plugin-video-to-recipe@0.8.5","maintainers":[{"name":"thehedges","email":"kthedges23@gmail.com"}],"homepage":"https://github.com/peristyle-io/video-to-recipe#readme","bugs":{"url":"https://github.com/peristyle-io/video-to-recipe/issues"},"dist":{"shasum":"7fbc2af6919f29f71911a6c1fc50e4c2d8247175","tarball":"https://registry.npmjs.org/@peristyle/emdash-plugin-video-to-recipe/-/emdash-plugin-video-to-recipe-0.8.5.tgz","fileCount":32,"integrity":"sha512-PNJylrD2PSik/GozJjbVOI/NBdduNEae+MBuHR7qm+6ke22HdWRY9GCyBj5m84JrcOBHnn82CIcEZBHGMj9RCg==","signatures":[{"sig":"MEUCIQDO3tV3i4MhsepJ8mOqymw/m8/D0873XfRUKAW7PJw5iQIgF3pARjdOwQdreWbcAddn7smvtUaS5HuUEi46hWPzCC0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":416359},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./sandbox":{"types":"./dist/sandbox-entry.d.ts","import":"./dist/sandbox-entry.js"}},"gitHead":"91ef74bfc4a149ea07da3df171d6e1ed1ff803db","scripts":{"dev":"tsup --watch","test":"node scripts/test-caption-parser.mjs && node scripts/test-article.mjs && node scripts/test-instagram-login-wall.mjs","build":"tsup","version":"pnpm build","typecheck":"tsc --noEmit","preversion":"pnpm typecheck && pnpm test","postversion":"git push --follow-tags","test:routes":"node scripts/test-routes.mjs","prepublishOnly":"pnpm build","diagnose:tiktok":"node scripts/diagnose-tiktok.mjs"},"_npmUser":{"name":"thehedges","email":"kthedges23@gmail.com"},"repository":{"url":"git+https://github.com/peristyle-io/video-to-recipe.git","type":"git"},"_npmVersion":"11.6.2","description":"Import TikTok and Instagram posts as recipe drafts in the EmDash admin, and build the whole article from the video with Gemini","directories":{},"_nodeVersion":"25.2.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","emdash":"^0.14.0","esbuild":"^0.28.2","typescript":"^5.0.0"},"peerDependencies":{"astro":">=6.0.0-beta.0","emdash":">=0.14.0"},"_npmOperationalInternal":{"tmp":"tmp/emdash-plugin-video-to-recipe_0.8.5_1788372044506_0.022513413922942815","host":"s3://npm-registry-packages-npm-production"}},"0.10.0":{"name":"@peristyle/emdash-plugin-video-to-recipe","version":"0.10.0","keywords":["emdash","emdash-plugin","tiktok","instagram","recipe","import","gemini","video"],"_id":"@peristyle/emdash-plugin-video-to-recipe@0.10.0","maintainers":[{"name":"thehedges","email":"kthedges23@gmail.com"}],"homepage":"https://github.com/peristyle-io/video-to-recipe#readme","bugs":{"url":"https://github.com/peristyle-io/video-to-recipe/issues"},"dist":{"shasum":"b6be543f33055425c0389af0a41a218ebfc08350","tarball":"https://registry.npmjs.org/@peristyle/emdash-plugin-video-to-recipe/-/emdash-plugin-video-to-recipe-0.10.0.tgz","fileCount":28,"integrity":"sha512-EccWVCxM0il7y/6nC7rKZ7imqoo9M/3Ao7hefFcD2E5tN1XRuonINeP+n+cuzLh6/a3rlV5SQqMC4lWj1KzVpA==","signatures":[{"sig":"MEQCIGVEdlwRCHgG7oWMZ+sR8afbVniQmTo8f9V8eLsqgN03AiAmPHaT7mg+jfwiNmPwjDfuK1BxNm9tqqCg5cCHfEF6VQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":435567},"type":"module","_from":"file:peristyle-emdash-plugin-video-to-recipe-0.10.0.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./sandbox":{"types":"./dist/sandbox-entry.d.ts","import":"./dist/sandbox-entry.js"}},"scripts":{"dev":"tsup --watch","test":"node scripts/test-caption-parser.mjs && node scripts/test-article.mjs && node scripts/test-instagram-page-media.mjs","build":"tsup","version":"pnpm build","typecheck":"tsc --noEmit","preversion":"pnpm typecheck && pnpm test","postversion":"git push --follow-tags","test:routes":"node scripts/test-routes.mjs","diagnose:tiktok":"node scripts/diagnose-tiktok.mjs","diagnose:instagram":"node scripts/diagnose-instagram.mjs"},"_npmUser":{"name":"thehedges","email":"kthedges23@gmail.com"},"_resolved":"/tmp/b901b320dc869d610ce8064da5edd449/peristyle-emdash-plugin-video-to-recipe-0.10.0.tgz","_integrity":"sha512-EccWVCxM0il7y/6nC7rKZ7imqoo9M/3Ao7hefFcD2E5tN1XRuonINeP+n+cuzLh6/a3rlV5SQqMC4lWj1KzVpA==","repository":{"url":"git+https://github.com/peristyle-io/video-to-recipe.git","type":"git"},"_npmVersion":"11.6.2","description":"Import TikTok and Instagram posts as recipe drafts in the EmDash admin — no login for either — and build the whole article from the video with Gemini","directories":{},"_nodeVersion":"25.2.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","emdash":"^0.14.0","esbuild":"^0.28.2","typescript":"^5.0.0"},"peerDependencies":{"astro":">=6.0.0-beta.0","emdash":">=0.14.0"},"_npmOperationalInternal":{"tmp":"tmp/emdash-plugin-video-to-recipe_0.10.0_1788397960166_0.4476088257060351","host":"s3://npm-registry-packages-npm-production"}},"0.11.0":{"name":"@peristyle/emdash-plugin-video-to-recipe","version":"0.11.0","keywords":["emdash","emdash-plugin","tiktok","instagram","recipe","import","gemini","video"],"_id":"@peristyle/emdash-plugin-video-to-recipe@0.11.0","maintainers":[{"name":"thehedges","email":"kthedges23@gmail.com"}],"homepage":"https://github.com/peristyle-io/video-to-recipe#readme","bugs":{"url":"https://github.com/peristyle-io/video-to-recipe/issues"},"dist":{"shasum":"1b4cf74f21f52ff478c251c234f1dc4c0c1269cc","tarball":"https://registry.npmjs.org/@peristyle/emdash-plugin-video-to-recipe/-/emdash-plugin-video-to-recipe-0.11.0.tgz","fileCount":28,"integrity":"sha512-wmqHe7sRrQP/L5/OgwH9aufrNz2RGnSqtlS/kueiuDk/rgVYkeUtW1bfQK1H4LtEF3lOt2654O0f6jEX+QERog==","signatures":[{"sig":"MEUCIADcHSws48perG9AxKu4luUdkHZg6bmfX7NcLiVINgQ0AiEA9FitnxiVLI/H3gt6BZxQGgkaJ1kRwy8kQYxo21MYvdA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":443148},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./sandbox":{"types":"./dist/sandbox-entry.d.ts","import":"./dist/sandbox-entry.js"}},"gitHead":"e99466ffe9daacf75204cd73eaf328462bd243b1","scripts":{"dev":"tsup --watch","test":"node scripts/test-caption-parser.mjs && node scripts/test-article.mjs && node scripts/test-instagram-page-media.mjs && node scripts/test-routes.mjs && node scripts/test-tiktok-adapter.mjs","build":"tsup","version":"pnpm build","typecheck":"tsc --noEmit","preversion":"pnpm typecheck && pnpm test","postversion":"git push --follow-tags","test:routes":"node scripts/test-routes.mjs","prepublishOnly":"pnpm build","diagnose:tiktok":"node scripts/diagnose-tiktok.mjs","test:routes:live":"node scripts/test-routes-live.mjs","diagnose:instagram":"node scripts/diagnose-instagram.mjs"},"_npmUser":{"name":"thehedges","email":"kthedges23@gmail.com"},"repository":{"url":"git+https://github.com/peristyle-io/video-to-recipe.git","type":"git"},"_npmVersion":"11.6.2","description":"Import TikTok and Instagram posts as recipe drafts in the EmDash admin — no login for either — and build the whole article from the video with Gemini","directories":{},"_nodeVersion":"25.2.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","emdash":"^0.14.0","esbuild":"^0.28.2","typescript":"^5.0.0"},"peerDependencies":{"astro":">=6.0.0-beta.0","emdash":">=0.14.0"},"_npmOperationalInternal":{"tmp":"tmp/emdash-plugin-video-to-recipe_0.11.0_1788467995164_0.3010449052157307","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@peristyle/emdash-plugin-video-to-recipe","version":"1.0.0","keywords":["emdash","emdash-plugin","tiktok","instagram","recipe","import","gemini","video"],"_id":"@peristyle/emdash-plugin-video-to-recipe@1.0.0","maintainers":[{"name":"thehedges","email":"kthedges23@gmail.com"}],"homepage":"https://github.com/peristyle-io/video-to-recipe#readme","bugs":{"url":"https://github.com/peristyle-io/video-to-recipe/issues"},"dist":{"shasum":"87ab59c8da3b0813e885aa18ce5456b36b9fc69a","tarball":"https://registry.npmjs.org/@peristyle/emdash-plugin-video-to-recipe/-/emdash-plugin-video-to-recipe-1.0.0.tgz","fileCount":34,"integrity":"sha512-dJ0yGged/l563nqtZqfKnnEapYPIZUZ/B6F8DEQf/qP6LvzzH6Y8Lg7W7xCZE1VVCN8cY1CmUjUNStdu4BWzyQ==","signatures":[{"sig":"MEQCIE2MKzHneRGPjp7TWqgBNG6bjyhemdG/5ZSHQUwMJ2xEAiBD52tlzqjUjgGt4V6AzkHmySrQY/eLyzaCQgarxkVdrw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQCRP5HmiObe5Up9DGu7k1j6AqUJY2y9840XU/aq/i69awIgeIwAYfhxUxyvHIk8yt8QUXvMG9J6F674b/4zAASH92g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":518243},"type":"module","_from":"file:peristyle-emdash-plugin-video-to-recipe-1.0.0.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./gemini":{"types":"./dist/gemini/index.d.ts","import":"./dist/gemini/index.js"},"./sandbox":{"types":"./dist/sandbox-entry.d.ts","import":"./dist/sandbox-entry.js"}},"scripts":{"dev":"tsup --watch","test":"node scripts/test-caption-parser.mjs && node scripts/test-article.mjs && node scripts/test-instagram-page-media.mjs && node scripts/test-jobs.mjs && node scripts/test-routes.mjs && node scripts/test-tiktok-adapter.mjs","build":"tsup","version":"pnpm build","typecheck":"tsc --noEmit","preversion":"pnpm typecheck && pnpm test","postversion":"git push --follow-tags","test:routes":"node scripts/test-routes.mjs","diagnose:tiktok":"node scripts/diagnose-tiktok.mjs","test:routes:live":"node scripts/test-routes-live.mjs","diagnose:instagram":"node scripts/diagnose-instagram.mjs"},"_npmUser":{"name":"thehedges","email":"kthedges23@gmail.com"},"_resolved":"/tmp/3fa54d7e924e08d7ab6d405cd41b4fc1/peristyle-emdash-plugin-video-to-recipe-1.0.0.tgz","_integrity":"sha512-dJ0yGged/l563nqtZqfKnnEapYPIZUZ/B6F8DEQf/qP6LvzzH6Y8Lg7W7xCZE1VVCN8cY1CmUjUNStdu4BWzyQ==","repository":{"url":"git+https://github.com/peristyle-io/video-to-recipe.git","type":"git"},"_npmVersion":"11.6.2","description":"Import TikTok and Instagram posts as recipe drafts in the EmDash admin — no login for either — and build the whole article from the video with Gemini","directories":{},"_nodeVersion":"25.2.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","emdash":"^0.14.0","esbuild":"^0.28.2","typescript":"^5.0.0"},"peerDependencies":{"astro":">=6.0.0-beta.0","emdash":">=0.14.0"},"_npmOperationalInternal":{"tmp":"tmp/emdash-plugin-video-to-recipe_1.0.0_1789587776032_0.5079309083355201","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@peristyle/emdash-plugin-video-to-recipe","version":"1.0.1","keywords":["emdash","emdash-plugin","tiktok","instagram","recipe","import","gemini","video"],"_id":"@peristyle/emdash-plugin-video-to-recipe@1.0.1","maintainers":[{"name":"thehedges","email":"kthedges23@gmail.com"}],"homepage":"https://github.com/peristyle-io/video-to-recipe#readme","bugs":{"url":"https://github.com/peristyle-io/video-to-recipe/issues"},"dist":{"shasum":"605cdb1520ee3dbff0799420d70232dfbf211f9d","tarball":"https://registry.npmjs.org/@peristyle/emdash-plugin-video-to-recipe/-/emdash-plugin-video-to-recipe-1.0.1.tgz","fileCount":35,"integrity":"sha512-0QfymsjgBmFNbN6eTjqORJWXWTSXioBuA9HUEqXnD3KT0s9RtRO79qi1zOIvZ6YHr/DoVfMuhS2FBa2Dam6Stw==","signatures":[{"sig":"MEYCIQDhtvsas5GITGkls+8uvmfbFOa+NSgsJWPvryznYMlG8AIhAMeoQtfr1FApslY/jRCYoxDKeLgitvpEERcIB+c2wjrk","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIDUGi2Ear0yi01XYMQaMUy/ekTR30Ow99k1i2W0fppo/AiBl6PVHRTSu3BdwbFggdZQ7uqjU4vWL6v0BqDU2aJNugg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1024888},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./gemini":{"types":"./dist/gemini/index.d.ts","import":"./dist/gemini/index.js"},"./sandbox":{"types":"./dist/sandbox-entry.d.ts","import":"./dist/sandbox-entry.js"}},"gitHead":"917fae2a396d6a7396374130bac97cac1747363a","scripts":{"dev":"tsup --watch","test":"node scripts/test-caption-parser.mjs && node scripts/test-article.mjs && node scripts/test-instagram-page-media.mjs && node scripts/test-jobs.mjs && node scripts/test-routes.mjs && node scripts/test-tiktok-adapter.mjs","build":"tsup","version":"pnpm build","typecheck":"tsc --noEmit","preversion":"pnpm typecheck && pnpm test","postversion":"git push --follow-tags","test:routes":"node scripts/test-routes.mjs","prepublishOnly":"pnpm build","diagnose:tiktok":"node scripts/diagnose-tiktok.mjs","test:routes:live":"node scripts/test-routes-live.mjs","diagnose:instagram":"node scripts/diagnose-instagram.mjs"},"_npmUser":{"name":"thehedges","email":"kthedges23@gmail.com"},"repository":{"url":"git+https://github.com/peristyle-io/video-to-recipe.git","type":"git"},"_npmVersion":"11.20.0","description":"Import TikTok and Instagram posts as recipe drafts in the EmDash admin — no login for either — and build the whole article from the video with Gemini","directories":{},"_nodeVersion":"26.11.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.4.3","tsup":"^8.0.0","emdash":"^0.14.0","esbuild":"^0.28.2","typescript":"^5.0.0"},"peerDependencies":{"astro":">=6.0.0-beta.0","emdash":">=0.14.0"},"_npmOperationalInternal":{"tmp":"tmp/emdash-plugin-video-to-recipe_1.0.1_1794697718662_0.14852273051267428","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"_id":"@peristyle/emdash-plugin-video-to-recipe@1.0.2","bugs":{"url":"https://github.com/peristyle-io/video-to-recipe/issues"},"dist":{"shasum":"45c73ece5adaac2e58e60b1c41f82a649dc09977","tarball":"https://registry.npmjs.org/@peristyle/emdash-plugin-video-to-recipe/-/emdash-plugin-video-to-recipe-1.0.2.tgz","fileCount":34,"integrity":"sha512-w/e/JRMQASF1RwdprlqapIZfXzm+tuk0GI2j/qIXPwyuwKtWFbkAA3Jk+zJVkjQAVo3oSnJCdWDa0iT4WSp33A==","signatures":[{"sig":"MEYCIQCp3cFxJ6fIPny/INQCDvPaoKrg4J4d9hw6xI/FUKtoCAIhAKNkXLjpA2lNXtd2UTCGkj5JOUBkKow2zVVoU7VjQdOf","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCvXEyk3ROY961Vk7vWtLNQkHQNzDZZbdc5IWQHV43qPwIhAP9Ud1bb05IZ3KVgMUt+pYldoD3QUOI4maX+mtzyOfL9"}],"unpackedSize":519089},"name":"@peristyle/emdash-plugin-video-to-recipe","type":"module","_from":"file:peristyle-emdash-plugin-video-to-recipe-1.0.2.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./gemini":{"types":"./dist/gemini/index.d.ts","import":"./dist/gemini/index.js"},"./sandbox":{"types":"./dist/sandbox-entry.d.ts","import":"./dist/sandbox-entry.js"}},"scripts":{"dev":"tsup --watch","test":"node scripts/test-caption-parser.mjs && node scripts/test-article.mjs && node scripts/test-instagram-page-media.mjs && node scripts/test-jobs.mjs && node scripts/test-routes.mjs && node scripts/test-tiktok-adapter.mjs","build":"tsup","version":"pnpm build","typecheck":"tsc --noEmit","preversion":"pnpm typecheck && pnpm test","postversion":"git push --follow-tags","test:routes":"node scripts/test-routes.mjs","diagnose:tiktok":"node scripts/diagnose-tiktok.mjs","test:routes:live":"node scripts/test-routes-live.mjs","diagnose:instagram":"node scripts/diagnose-instagram.mjs"},"version":"1.0.2","_npmUser":{"name":"thehedges","email":"kthedges23@gmail.com"},"homepage":"https://github.com/peristyle-io/video-to-recipe#readme","keywords":["emdash","emdash-plugin","tiktok","instagram","recipe","import","gemini","video"],"_resolved":"/tmp/b3bda404eb166b86fff4be0bcef9c4b5/peristyle-emdash-plugin-video-to-recipe-1.0.2.tgz","_integrity":"sha512-w/e/JRMQASF1RwdprlqapIZfXzm+tuk0GI2j/qIXPwyuwKtWFbkAA3Jk+zJVkjQAVo3oSnJCdWDa0iT4WSp33A==","repository":{"url":"git+https://github.com/peristyle-io/video-to-recipe.git","type":"git"},"_npmVersion":"11.20.0","description":"Import TikTok and Instagram posts as recipe drafts in the EmDash admin — no login for either — and build the whole article from the video with Gemini","directories":{},"maintainers":[{"name":"thehedges","email":"kthedges23@gmail.com"}],"_nodeVersion":"26.11.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","emdash":"^0.14.0","esbuild":"^0.28.2","typescript":"^5.0.0"},"peerDependencies":{"astro":">=6.0.0-beta.0","emdash":">=0.14.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/emdash-plugin-video-to-recipe_1.0.2_1794698685011_0.08847243752363732"}}},"time":{"created":"2026-09-02T13:42:02.277Z","modified":"2026-11-14T23:24:45.332Z","0.5.0":"2026-09-02T13:42:02.665Z","0.8.0":"2026-09-02T17:25:39.567Z","0.8.1":"2026-09-02T17:49:36.066Z","0.8.5":"2026-09-02T18:00:44.656Z","0.10.0":"2026-09-03T01:12:40.324Z","0.11.0":"2026-09-03T20:39:55.367Z","1.0.0":"2026-09-16T19:42:56.126Z","1.0.1":"2026-11-14T23:08:38.778Z","1.0.2":"2026-11-14T23:24:45.141Z"},"bugs":{"url":"https://github.com/peristyle-io/video-to-recipe/issues"},"homepage":"https://github.com/peristyle-io/video-to-recipe#readme","keywords":["emdash","emdash-plugin","tiktok","instagram","recipe","import","gemini","video"],"repository":{"url":"git+https://github.com/peristyle-io/video-to-recipe.git","type":"git"},"description":"Import TikTok and Instagram posts as recipe drafts in the EmDash admin — no login for either — and build the whole article from the video with Gemini","maintainers":[{"name":"thehedges","email":"kthedges23@gmail.com"}],"readme":"# @peristyle/emdash-plugin-video-to-recipe\n\nImport public **TikTok** and **Instagram** posts into your [EmDash](https://www.npmjs.com/package/emdash) site as draft recipe posts — one at a time by URL, or in bulk by scanning a TikTok profile. No account, API key or session cookie is needed for either platform. With a Gemini API key, it can also **watch the video and write the whole article from it**, which is the only way to get a recipe out of a post that never wrote one down.\n\n> Renamed from `@peristyle/emdash-plugin-instagram-to-recipe` in 0.5.0, when TikTok support landed. See [Upgrading from 0.4.x](#upgrading-from-04x).\n\nFor a post such as [a recipe from @recipeincaption](https://www.tiktok.com/@recipeincaption/video/7663935915911367954), the plugin will:\n\n1. Fetch the post and read the caption\n2. Parse ingredients and numbered steps — **including captions the platform delivered as a single unbroken line**\n3. Download the cover image and store its dimensions for responsive images\n4. Download the source video, so a transcription step can recover spoken instructions later\n5. Create a **draft** post in your configured collection\n\nOr, with Gemini configured, skip the caption entirely and\n[build the article from the video](#build-the-article-from-the-video-gemini) —\nbody, ingredients, steps, times and servings, taken from what the video\nactually shows.\n\n## Which platform should you import from?\n\n**TikTok, when you have the choice.** It is the default platform, and the\nreason is plumbing rather than taste: TikTok serves captions, cover images,\ndates and the video file itself to an anonymous request, while Instagram\nguards the equivalent behind an API that refuses most servers.\n\n|                              | TikTok                                      | Instagram                                        |\n| ---------------------------- | ------------------------------------------- | ------------------------------------------------ |\n| Single post by URL           | Embed pages, no auth                        | Post page, no auth                                |\n| Profile scan (bulk)          | Embed page, no auth                         | **Not supported** — see below                     |\n| Posts per profile scan       | ~10–12                                       | —                                                 |\n| Caption cap                  | 4,000 chars                                  | 2,200 chars                                       |\n| Caption shape                | One flat line, structure rebuilt from markers | Real line breaks, usually one ingredient per line |\n| Post date                    | Exact (`createTime`)                         | Exact (`taken_at`)                                |\n| Popularity signal            | Plays                                        | —                                                 |\n| Source video                 | Direct MP4, no auth                          | Direct MP4 from the post page                     |\n| Typical failure              | Creator wrote no caption at all              | Page omits `video_versions`                       |\n\n**Single-post import works on both, with no credential at all.** Instagram's\npost page carries the caption, cover image, date and source MP4, so a pasted\nURL imports fully in one request.\n\n**Bulk profile scanning is TikTok-only.** Listing an Instagram profile's posts\nis possible only through `web_profile_info`, which requires a logged-in session\n*and* is refused at Meta's edge proxy for many server IPs regardless of what\nyou send it. Shipping a scan that reliably returns nothing — plus a session\ncookie setting to feed it — was worse than not offering it, so the Instagram\nadapter no longer implements a profile scan and the admin does not offer it.\nInstagram's food-creator culture does put recipes in captions more\nconsistently, so importing individual Instagram URLs alongside a TikTok profile\nscan is a reasonable way to work.\n\n## Install\n\n```bash\npnpm add @peristyle/emdash-plugin-video-to-recipe\n# or: npm install / yarn add\n```\n\nRegister in `astro.config.mjs`:\n\n```javascript\nimport { videoToRecipePlugin } from \"@peristyle/emdash-plugin-video-to-recipe\";\n\nexport default defineConfig({\n  integrations: [\n    emdash({\n      plugins: [videoToRecipePlugin()],\n    }),\n  ],\n});\n```\n\nRebuild or restart the dev server after adding the plugin.\n\n### Prepare the target collection\n\nEmDash stores each collection field as a real database column, so **the\ncollection you import into must declare every field the plugin writes** — an\nundeclared field fails the whole import with `no column named ...`.\n\nIn the admin, open **Content Types → <your recipe collection>** and make sure\nthese fields exist (slugs must match exactly):\n\n| slug                  | type         | notes                                |\n| --------------------- | ------------ | ------------------------------------ |\n| `title`               | string       | usually already present              |\n| `excerpt`             | text         |                                      |\n| `ingredients`         | portableText |                                      |\n| `recipe_instructions` | portableText |                                      |\n| `difficulty`          | string       |                                      |\n| `featured_image`      | image        |                                      |\n| `source_url`          | url          | provenance — permalink               |\n| `source_caption`      | text         | provenance — raw caption             |\n| `import_notes`        | text         | provenance — parse gaps              |\n| `source_video`        | file         | source video, for transcription      |\n\nBuilding articles from video writes a few more, and every import also fills\nthe platform's own link field. These are **optional**: a field the collection\ndoesn't declare is skipped with a warning in the log rather than failing the\nimport, so add only the ones you want.\n\n| slug                 | type         | notes                                                                    |\n| -------------------- | ------------ | ------------------------------------------------------------------------- |\n| `content`            | portableText | the article body                                                         |\n| `prep_time`          | integer      | minutes                                                                  |\n| `cook_time`          | integer      | minutes                                                                  |\n| `rest_time`          | integer      | minutes — resting, chilling                                              |\n| `servings`           | integer      |                                                                           |\n| `nutrition_calories` | integer      | only when the video states it                                            |\n| `tiktok_url`         | url          | set to the post URL for TikTok imports                                   |\n| `instagram_url`      | url          | set to the post URL for Instagram imports (on a `source_*` collection)   |\n\nThen set **Content collection** in the plugin's settings to that collection's\nslug. The default is `posts`; if your site's recipe collection is called\nsomething else, imports will fail until you change it.\n\n> **Already have `instagram_url` / `instagram_caption` / `instagram_video`?**\n> Keep them. The plugin detects which naming your collection uses and writes to\n> it — see [Upgrading from 0.4.x](#upgrading-from-04x). You never need to\n> migrate the schema.\n\n## Admin usage\n\nOpen **Plugins → Import video recipes** in the EmDash admin. The page has three sections:\n\n### Single post\n\n1. Paste a TikTok or Instagram post URL and click **Convert to recipe** — the platform is detected from the URL, and TikTok short links (`vm.tiktok.com`, `vt.tiktok.com`) are followed automatically\n2. Review the parsed preview (title, ingredients, steps, cover image)\n3. Click **Create draft post**\n4. Edit the draft under **Posts** (slug, categories, times, publish)\n\nSaving the same post twice **rewrites the draft it already has** rather than\nadding a second copy of it, and only the fields the plugin owns — your\ncategories, slug and hand-set times survive.\n\n### Bulk import from a profile\n\n1. Enter a public **TikTok** handle, optionally set **Posted on or after** / **Posted on or before**, and click **Scan profile**\n2. The profile is fetched in a single request and every caption that parses as a recipe is listed with its post date, sorted by plays\n3. Check the recipes you want (already-imported posts are unchecked and labeled) and click **Create selected drafts** — the page switches to a progress view at once, and **Check progress** shows how many drafts are done, which failed and why\n4. Posts that **didn't** parse as recipes are listed under **Other posts** — check any of them and click **Create stub drafts** to import the cover image and raw caption with empty recipe fields, flagged in `import_notes` for manual or AI completion\n\nBulk import is idempotent — posts already imported are skipped. Deleting an imported draft clears the bookkeeping, so the post can be imported again later. If a draft was deleted in a way the plugin could not see, the next import of that post creates a fresh draft rather than failing.\n\nA scan that returns nothing says **why** — rate limiting and a handle with no\npublic posts are different problems with different answers, and the banner\nnames which one it was rather than reporting \"no recipes found\".\n\n#### Date range\n\nThe date fields are **inclusive** and filter the posts the scan already\nfetched. They cannot make the scan reach further back: one profile request\nreturns roughly the 12 most recent posts, so a range starting before that\nwindow would otherwise silently miss older posts. The UI is built so that\nnever goes unsaid:\n\n- After a scan, the form itself names the window it reached (“This scan reaches\n  back to 2026-01-15; a range starting earlier will miss posts”)\n- Every result reports posts scanned, posts matched, and the oldest date reached\n- A range starting before the oldest scanned post raises a warning naming the\n  cut-off, so “0 results” is never mistaken for “nothing exists”\n- A range that matches nothing gets its own banner plus a **Clear dates** button\n  that restores the full scan — served from the 24-hour cache, so it costs no\n  extra request\n- Posts returned without a date are kept rather than dropped, and their count\n  is reported\n\nResults are ordered by engagement; when a date range is active they switch to\nnewest first, matching how the list is being read.\n\n### While an import is running\n\nThe admin host renders **no** pending state for a plugin interaction: the page\nkeeps its blocks, buttons live, until the handler returns. The honest reading\nof a page that has not changed is \"my click did nothing\" — so it gets clicked\nagain. The plugin closes that gap two ways, by how long the work takes.\n\n**Quick work runs inline.** Converting a URL and scanning a profile take a few\nseconds, so they still run within the press. An operation already in flight\n**claims itself in the plugin's KV store**, so a second press is answered with\n\"still working on that — no need to press again\", naming how long the first\nrun has been going, rather than starting a second fetch. The marker is\nreleased as soon as the run finishes, including when it fails, and expires by\nitself if the run never returns.\n\n**Slow work runs as a background job.** Building an article from a video and\ncreating a batch of drafts take a minute or more, so the press records a job\nand returns at once with a progress view: what the job is doing (“Downloading\nthe video from TikTok”, “Gemini is watching the video and writing the\narticle”, “Creating draft 3 of 7: Lemon Orzo”), a meter, when it last\nreported, and a **Check progress** button. Blocks cannot refresh themselves,\nso the button is how the view is redrawn; when the job is done the same press\nshows the result screen the synchronous flow used to return. Bulk jobs list\nevery selected post with its outcome, and a post that fails does not stop the\nrest.\n\nA job is driven by whichever of three things reaches it first:\n\n- EmDash's `after()` keeps the handler's work going past the response —\n  `waitUntil` on Workers, fire-and-forget on Node.\n- A **one-shot cron task**, scheduled when the job starts and again every\n  minute while it is unfinished, and cancelled as soon as the job ends.\n- The **Check progress** press itself. A job nothing is running — queued\n  because the host could not defer it, or abandoned because its runner was cut\n  off — is run by the press that asks about it, and resumes from the last\n  finished post rather than starting over.\n\nWhich of them you actually get depends on the host, so it is worth being\nconcrete about EmDash 0.14:\n\n- **Node, Bun, a VPS, local dev.** `after()` is fire-and-forget and finishes\n  the job on its own; EmDash's Node cron scheduler runs on real timers and\n  backs it up. Jobs finish unattended and **Check progress** is only how you\n  watch them.\n- **Cloudflare Workers.** `after()` is `waitUntil`, which usually carries a\n  job to the end but can be cut off mid-video. Plugin cron tasks are **not** a\n  fallback there: EmDash 0.14 picks a request-driven cron scheduler for\n  Workers and never wires its tick up, so a scheduled task does not fire —\n  and a Cloudflare Cron Trigger in `wrangler.jsonc` will not reach it either,\n  because EmDash exports no `scheduled` handler. So on Workers the backstop is\n  the **Check progress** press, which is enough: it takes the job over and\n  resumes from the last finished post, and a finished article is never paid\n  for twice. The cron driver stays in the plugin because it works today on\n  Node and will work on Workers the moment EmDash calls its own `tickCron()`.\n\nEvery runner writes a heartbeat every ten seconds, so a job that has gone\nquiet for 45 seconds is known to be dead rather than merely slow, and is taken\nover instead of waited on. A job that dies three times is marked failed with\nthat reason. Finished jobs are kept for a day so the result screen can be\nrevisited, then pruned.\n\nA second press of the same button while its job runs shows that job's progress\n— nothing is downloaded, billed or written twice. A running job also holds the\n**same KV marker** the equivalent API route takes, so an agent calling\n`generate-article` while a reviewer's job is building that video is refused\nwith `busy: true` rather than billed for a second copy. The marker is held\nwith the job's own 45-second staleness, not the route's minutes, so the press\nthat takes a dead runner's job over is never locked out by it.\n\n> The host's missing pending state is EmDash's to fix, and a patch that adds a\n> busy indicator to plugin pages is proposed upstream. Once it lands, the\n> quick operations get a spinner too; the job flow stays, because a spinner\n> cannot say which of seven drafts is being written.\n\n## Build the article from the video (Gemini)\n\nThe caption parser can only recover what the creator typed. On short-form\nvideo that is often a dish name and a hashtag wall — the recipe is spoken, or\nshown as on-screen text, or just demonstrated. Google's\n[agentic video understanding](https://blog.google/innovation-and-ai/models-and-research/gemini-models/introducing-agentic-video-in-gemini/)\ncloses that gap: the model searches, scans and re-samples the video rather than\nreading it at a fixed frame rate, so the quantity the creator says once at 0:04\nis findable.\n\nAdd a key from [Google AI Studio](https://aistudio.google.com/apikey) under\n**Settings → Build articles from video**, and every video post gets a **Build\nthe full article from the video** button. One press starts the job and the\npage shows its progress; when the model is done, **Check progress** shows the\ndraft with:\n\n- a **title** and **excerpt**\n- an **article body** — why the dish works, technique notes, substitutions,\n  serving and storage — as portable text in `content`\n- **ingredients** with quantities, and **numbered steps** including the ones\n  only said out loud\n- **times, servings and difficulty**, where the video actually supports them\n- **`import_notes`** naming the model, whether agentic processing was used, and\n  the model's own caveats about anything the video left unclear\n\n### What it will not do\n\nThe prompt forbids invention, and the plumbing enforces the rest:\n\n- **No made-up numbers.** A quantity, temperature or time the video never gives\n  is left out and flagged in `notes` instead of guessed. `nutrition_calories`\n  is written only when the video or caption states it.\n- **The video outranks the caption.** The caption travels as context, labelled\n  as such; where the two disagree the video wins.\n- **A draft is never duplicated.** Running the builder over an already-imported\n  post updates that draft in place, writing only the fields it owns — your\n  categories, slug and anything else on the row are untouched. It *does*\n  overwrite the title, excerpt, body, ingredients and steps, so a rewrite\n  discards hand-edits to those.\n- **The article is cached.** Pressing the button twice costs one API call; pass\n  `force` (or use **Rewrite the article from the video**) to actually re-run it.\n- **It degrades rather than fails.** If the API declines the agentic flag, the\n  request is retried once with standard processing and the draft records which\n  it got. Only a very short clip (under 4MB) is sent inline; anything larger\n  goes through the Files API, which streams the file instead of base64-encoding\n  it — the plugin runs in a sandboxed Worker isolate with a ~128MB memory\n  ceiling, and the inline path holds three copies of the video at once.\n\nEverything it writes is still a **draft**. Read it before publishing — that is\nwhat the `import_notes` line is for.\n\n### Cost and time\n\nStandard Gemini API token pricing, no feature fee; agentic processing is the\ncheaper path on anything but a very short clip. Expect up to a minute per\nvideo: the plugin downloads the video from the platform CDN, then waits on the\nmodel. The batch route is sequential on purpose — parallel runs get you rate\nlimited by the CDN and the API at once.\n\n### Settings\n\n- **Content collection** — where drafts are created (default: `posts`)\n- **TikTok handle** (optional) — pre-fills the bulk scan\n- **Gemini API key** — enables building articles from video. Write-only: it is\n  never rendered back into the form. Tick **Forget the saved API key** and save\n  to remove it; leaving the field blank keeps the saved one.\n- **Model** — `gemini-3.8-flash` (default), `gemini-3.7-flash`,\n  `gemini-3.6-flash`, or `gemini-3.5-flash-lite`\n- **Agentic video processing** — on by default, and worth leaving on\n\n> Standard-format EmDash plugins are configured here (settings are stored in the plugin's KV store), not via constructor options.\n\n### Using the article builder outside EmDash\n\nEverything under `src/gemini/` is written against plain `fetch` and a config\nobject rather than against `PluginContext` — the sandbox supplies\n`ctx.http.fetch` and KV-stored settings, but the builder itself knows nothing\nabout either. That makes it usable anywhere, and since 1.0.0 it is exported as\na supported subpath:\n\n```javascript\nimport {\n  generateArticleFromVideo,\n  isGeminiConfigured,\n  DEFAULT_GEMINI_MODEL,\n} from \"@peristyle/emdash-plugin-video-to-recipe/gemini\";\n\nconst article = await generateArticleFromVideo({\n  config: { apiKey: process.env.GEMINI_API_KEY, model: DEFAULT_GEMINI_MODEL, agentic: true },\n  fetchFn: fetch,\n  video: { bytes, mimeType: \"video/mp4\", filename: \"post.mp4\" },\n  context: { platformLabel: \"TikTok\", postUrl, handle, caption },\n  progress: (step, phase) => console.log(`[${phase}] ${step}`),\n});\n// → { is_recipe, title, excerpt, body[], ingredients[], instructions[],\n//     prep_time_minutes, cook_time_minutes, servings, difficulty, notes, … }\n```\n\nYou bring the bytes and the key; the module does the upload, the schema and the\nparse. Videos over 4MB go through the Files API automatically. Nothing from\n`emdash` or `astro` is pulled in, so a plain Node or Worker project can depend\non this without either peer.\n\nThis is how Peristyle's own onboarding shows a creator their recipe before\ntheir site exists — the recipe on that page is written by this function, not by\na reimplementation of it.\n\n## How captions are parsed\n\nNeither platform returns a caption with its line structure intact. Instagram's\nHTML fallback flattens single line breaks; TikTok's embed payload strips them\nentirely, so a 2,700-character recipe arrives as one unbroken string.\n\n`src/caption.ts` rebuilds the structure from the markers the writer left behind,\nand only from markers that are unambiguous in running prose:\n\n- ` -4 large eggs` — a space, a bullet, then content. Never `medium-high`, never `5 - 7 minutes`\n- ` 2. Heat the pan` — a step number followed by a capital. Never `1.5 cups`, never the `50.` inside `350.`\n- ` For the Tzatziki:` — a capitalised `For …` header, or one of a closed vocabulary (`Instructions:`, `Marinade:`, `Assembly:` …)\n\nThat vocabulary is deliberately closed rather than \"any capitalised word before\na colon\": captions are full of phrases like `-Flour Mixture: 3/4 cup flour`,\nwhere a colon introduces one ingredient's contents, not a new section.\n\nIngredients are read in three shapes, in order:\n\n1. An explicit `Ingredients:` / `What you'll need:` header\n2. The contiguous run of bulleted lines — how most TikTok captions are written\n3. **Paragraphs of one ingredient per line, with neither bullets nor a header**\n   — how most Instagram captions are written:\n\n   ```\n   greek meatballs:\n   1 lb chicken\n   1/2 cup feta cheese\n\n   greek salad\n   romaine lettuce\n   cherry tomatoes\n   ```\n\n   A paragraph qualifies once enough of its lines open with a quantity; the\n   paragraphs after it are then read as continuations, so a produce list with\n   no quantities at all still comes through. The caption's first line is its\n   title and is never an ingredient, and everything from the first numbered\n   step onwards is the method.\n\nRe-splitting a line on its quantities is **only** done to a caption that\narrived flattened. A line the creator wrote out — `dressing - 1/2 cup olive\noil, juice of 1 lemon, 1 tbsp honey` — is one ingredient, and shredding it into\nsix fragments with dangling commas is a worse answer than leaving it alone.\n\nRun the fixtures with `pnpm test`.\n\n## Capabilities\n\n| Capability        | Purpose                                   |\n| ----------------- | ----------------------------------------- |\n| `network:request` | Fetch post pages and CDN media            |\n| `content:read`    | Check for prior imports                   |\n| `content:write`   | Create draft posts                        |\n| `media:write`     | Upload cover images and source videos     |\n\nAllowed hosts: `www.tiktok.com`, `vm.tiktok.com`, `vt.tiktok.com`,\n`*.tiktokcdn.com`, `*.tiktokcdn-us.com`, `*.tiktokv.com`,\n`www.instagram.com`, `*.cdninstagram.com`, `*.fbcdn.net`,\n`generativelanguage.googleapis.com`.\n\nThe Gemini host is in the manifest whether or not you configure a key — the\nallowlist is static, and nothing reaches it until a key is saved.\n\n## API routes\n\nFor scripting or a custom admin UI:\n\n| Route          | Method | Body                                                                       |\n| -------------- | ------ | -------------------------------------------------------------------------- |\n| `parse`        | POST   | `{ \"url\": \"https://www.tiktok.com/@recipeincaption/video/7663935915911367954\" }` |\n| `create-draft` | POST   | `{ \"key\": \"tt:7663935915911367954\" }`                                       |\n| `bulk-scan`    | POST   | `{ \"source\": \"tiktok\", \"handle\": \"recipeincaption\", \"from\": \"2026-01-01\", \"to\": \"2026-06-30\" }` (`source`/`from`/`to` optional) |\n| `bulk-create`  | POST   | `{ \"keys\": [\"tt:7663935915911367954\"] }`                                    |\n| `create-stub`  | POST   | `{ \"key\": \"tt:7663935915911367954\" }` or `{ \"url\": \"https://...\" }`         |\n| `generate-article`  | POST | `{ \"key\": \"tt:7663935915911367954\" }` or `{ \"url\": \"https://...\" }`, plus optional `apply` / `force` |\n| `generate-articles` | POST | `{ \"keys\": [\"tt:7663935915911367954\"], \"force\": false }`               |\n\nPosts are addressed by a **key** — `tt:<videoId>` for TikTok, `ig:<shortcode>`\nfor Instagram — which is unique across platforms. The pre-0.5.0 `shortcode` /\n`shortcodes` parameters are still accepted; an unprefixed value is read as a\nTikTok video id when it is all digits, and as an Instagram shortcode otherwise.\n\n`create-draft` is idempotent: a post that is already imported is updated in\nplace and the response carries `updated: true`, so retrying a call whose\nresponse you never saw cannot duplicate a recipe.\n\nEvery route that costs a network round-trip or a model call refuses to run\ntwice at once for the same target. A concurrent second call rejects with an\nerror carrying `busy: true` and a message naming how long the first has been\nrunning, rather than starting a duplicate. The admin page's background jobs\ntake the same markers, so this holds across the two surfaces: a\n`generate-article` call for a video the admin is already building is refused,\nand vice versa. `generate-article` resolves a `url` to its post key before\ntaking the marker, so calling it by URL and by key for the same post collides\nas it should.\n\n`bulk-scan` returns both `candidates` (parsed recipes) and `unparsed` (posts\nthe recipe parser rejected, with their full captions), plus the coverage the\ncaller needs to judge completeness: `scanned` (posts fetched), `matched` (posts\nleft after the date range), `window` (`oldest`/`newest` dates reached),\n`rangeBeyondScan` (the range asks for posts older than the scan reached), and\n`undated`.\n\n`create-stub` imports a post **without** parsing: the draft gets the cover\nimage, raw caption, and a title guess, with empty recipe fields and an\n`import_notes` marker — intended for prose captions, or recipes that are only\nspoken or on screen, that a human or AI agent will structure after import. It\nis idempotent: an already-imported post returns the existing draft.\n\n`generate-article` is the one call an agent needs: give it a post URL and it\nconverts the post, sends the video to Gemini, and writes the finished article\nto the collection — creating the draft when the post is new, updating it in\nplace when it was already imported. It returns the `article`, the merged\n`recipe`, the `contentId`, `fromCache`, `applied` and `created`. Pass\n`apply: false` to get the article back without touching the collection (useful\nfor a review step), or `force: true` to re-run the model instead of reusing the\ncached article. A `key` works in place of a `url` once the post has been\nscanned or converted.\n\n`generate-articles` does the same across a batch of scanned keys, sequentially,\nreturning `created`, `updated` and `failed`. It is route-only — a run of ten\nposts takes minutes, longer than an admin page load should hold open.\n\nBoth need a Gemini API key in settings; without one they fail with a message\nsaying where to add it.\n\nBase path: `/_emdash/api/plugins/peristyle-video-to-recipe/<route>`\n\n## Upgrading to 1.0.0\n\nThe slow admin buttons no longer hold the page open.\n\n**Building an article and creating a batch of drafts are background jobs.**\nThe press returns at once with a progress view — the step, a meter, when the\nrunner last reported — and a **Check progress** button that redraws it and, if\nnothing else has picked the job up, runs it. The result screen when the job\nfinishes is the one the synchronous flow used to return, so nothing you read\nbefore is gone; a bulk run now also lists every selected post with its\noutcome, and one post failing no longer loses the rest. See [While an import\nis running](#while-an-import-is-running) for what drives a job on your host —\nit differs between Node and Cloudflare Workers, and on Workers the\n**Check progress** press is the backstop.\n\nNothing to configure and no data migration: jobs live in the plugin's own KV\nstore and finished ones are pruned after a day.\n\n**The API routes are unchanged**, and still synchronous — an agent that wants\nto wait for an article should keep calling `generate-article`. They now share\ntheir in-flight markers with the admin jobs, so the two surfaces cannot both\npay Gemini for one video.\n\n`generate-article` called with a `url` now converts the post *before* taking\nits marker rather than after, so the marker is always the post's. A duplicate\ncall by URL is answered a page fetch later than it used to be, and a call by\nURL racing a call by key for the same post is now correctly refused.\n\n**The article builder is importable on its own**, at\n`@peristyle/emdash-plugin-video-to-recipe/gemini` — see [Using the article\nbuilder outside EmDash](#using-the-article-builder-outside-emdash). Nothing\ninside the plugin changed to allow it; the module never depended on\n`PluginContext` in the first place, and the subpath simply stops that being an\naccident. Additive, so no existing import moves.\n\n## Upgrading to 0.11.0\n\n**`gemini-3.8-flash` is available, and is the new default model.** Google\nadded it to the models that support agentic video understanding; it sits at the\nhead of the picker under **Settings → Build articles from video**. Sites that\nnever chose a model explicitly move to it on upgrade — a saved choice is left\nalone, and `gemini-3.7-flash`, `gemini-3.6-flash` and `gemini-3.5-flash-lite`\nare all still selectable.\n\n**Drafts fill the platform's own link field.** A TikTok import now writes\n`tiktok_url`, and an Instagram import on a `source_*` collection writes\n`instagram_url`, each set to the same URL as `source_url`. Both are optional:\na collection without the field imports as before, with a note in the log.\n\n**A deleted draft no longer blocks re-import.** If the draft a post was\nimported as is gone — deleted while the plugin was disabled, or from a\ncollection the plugin no longer targets — the next import creates a fresh\ndraft and repairs the bookkeeping instead of failing on the missing row.\n\n**TikTok errors say what happened.** When the profile embed or a post page\ncannot be fetched at all — a network failure, or the plugin sandbox refusing\na CDN host — the scan banner and the single-post error now carry that reason\nrather than suggesting the handle was misspelled.\n\n## Upgrading to 0.10.0\n\nTwo things were removed because they did not work, and one behaviour changed.\n(0.9.0 was never published; 0.10.0 is the first release carrying these changes.)\n\n**The Instagram session cookie setting is gone.** Nothing needs it any more.\nSingle-post import reads the post page, which carries the caption, cover image,\ndate and source video with no credential — so the cookie's only remaining job\nwas the profile listing, which Meta refuses at its edge proxy for many server\nIPs no matter what cookie it is sent. A cookie you had saved is **deleted from\nthe plugin's KV store** on the first admin page load after upgrading: it is a\nreal credential, and leaving one behind because the code that read it was\ndeleted is not housekeeping. Nothing else about Instagram imports changes, and\nthey got faster (one request instead of three).\n\n**Instagram profile scanning is gone.** `bulk-scan` with `\"source\":\n\"instagram\"` now fails with an explanation instead of returning an empty list.\nImport Instagram posts one URL at a time — that path is unaffected — or scan\nthe creator on TikTok. The bulk form no longer shows a platform picker while\nTikTok is the only scannable platform; it comes back automatically if another\nadapter implements a profile scan.\n\n**Saving a post twice updates it instead of duplicating it.** `create-draft`\n(and the **Create draft post** button) rewrites the draft an already-imported\npost has, and the route response carries `updated: true`. Your categories,\nslug and hand-set fields on that row are left alone.\n\n## Upgrading from 0.4.x\n\nThe package, the export, and the plugin id all changed:\n\n```diff\n-import { instagramToRecipePlugin } from \"@peristyle/emdash-plugin-instagram-to-recipe\";\n+import { videoToRecipePlugin } from \"@peristyle/emdash-plugin-video-to-recipe\";\n\n emdash({\n-  plugins: [instagramToRecipePlugin()],\n+  plugins: [videoToRecipePlugin()],\n })\n```\n\n`instagramToRecipePlugin` is still exported as a deprecated alias, so an\nun-edited config keeps working — but update the package name and the\n`noExternal` entry if your site lists one.\n\nTwo things follow from the id changing from `peristyle-instagram-to-recipe` to\n`peristyle-video-to-recipe`:\n\n**Your collection's field names are left alone.** Collections built against\n0.4.x declare `instagram_url` / `instagram_caption` / `instagram_video`. The\nplugin reads an existing draft to see which naming your collection uses, and\nwrites to it — and if that guess is ever wrong, the first failed insert is\nretried the other way and the answer remembered. New sites get `source_*`; you\nare never forced to migrate.\n\n**Import bookkeeping is rebuilt automatically.** Plugin KV is namespaced by\nplugin id, so the record of what you'd already imported does not carry across\nthe rename. Before the first scan, the plugin reads the provenance URL off\nevery existing draft in the collection (up to 2,000) and restores the map, so\nbulk import stays idempotent instead of offering your whole library again.\nDrafts beyond that cap may be re-offered; the plugin logs a warning when it\nhits the limit.\n\n## Development\n\n```bash\npnpm build              # bundle to dist/\npnpm typecheck\npnpm test               # caption parser, article builder, Instagram page, routes, TikTok adapter — all offline\npnpm test:routes:live   # the route suite against real TikTok (needs network)\npnpm test:routes        # route tests against a fake plugin context (hits the network)\npnpm diagnose:tiktok [handle] [videoUrl]   # live check of both TikTok endpoints\npnpm diagnose:instagram <postUrl>          # live check of the Instagram path\n```\n\nBoth platforms' endpoints are undocumented-but-public and can change without\nnotice. The diagnostic scripts are the fastest way to see which half broke:\n`diagnose:instagram` runs the real single-post fetch against a live post and\nprints the fields that decide what the draft gets — caption, owner, `isVideo`,\n`videoUrl`, `takenAt` and the cover image.\n\n### The Gemini client\n\n`src/gemini/` is a hand-rolled REST client rather than `@google/genai`: the\nplugin sandbox only gets `ctx.http.fetch` against a static host allowlist, and\nthe SDK reaches for its own transport. It covers exactly two calls —\n`POST /v1beta/interactions` for the article, and the Files API resumable upload\nfor a video too large to inline. The upload's `start` request goes to\n`/upload/v1beta/files`, not `/v1beta/files`: only the `/upload/` frontend\nspeaks the resumable protocol and answers with an `x-goog-upload-url` header.\nThe metadata path returns 200 and no header, which reads as a success with\nnowhere to send the bytes.\n\n`scripts/test-article.mjs` stubs both, plus the platform CDN download, so the\nwhole article path is tested offline: the request shape (inline vs. file URI,\nthe agentic flag, the response schema), the fields written to the draft, the\narticle cache, the in-place update, the agentic-flag retry, and the optional\nfield drop.\n\n### Adding a platform\n\nImplement `SourceAdapter` (`src/sources/types.ts`), register it in\n`src/sources/registry.ts`, and add its hosts to `allowedHosts`. Nothing above\nthat layer — the caption parser, the recipe builder, the draft writer, the\nadmin UI — is platform-specific.\n","readmeFilename":"README.md"}