{"_id":"@caesura-io/ai-sdk","_rev":"7-ebf3aa46116389cb4588a35a3902a564","name":"@caesura-io/ai-sdk","dist-tags":{"latest":"0.4.0"},"versions":{"0.0.0":{"name":"@caesura-io/ai-sdk","version":"0.0.0","keywords":["caesura","ai","ai-sdk","vercel-ai-sdk","llm","agents","middleware","recommendations"],"author":{"name":"Caesura"},"license":"Apache-2.0","_id":"@caesura-io/ai-sdk@0.0.0","maintainers":[{"name":"oleksandr_caesura","email":"oleksandr@caesura.io"}],"homepage":"https://github.com/caesura-io/caesura-sdk-js/tree/main/packages/ai-sdk#readme","bugs":{"url":"https://github.com/caesura-io/caesura-sdk-js/issues"},"dist":{"shasum":"e1a9eb74a33d942f418ca360ccab9df3684dc3e9","tarball":"https://registry.npmjs.org/@caesura-io/ai-sdk/-/ai-sdk-0.0.0.tgz","fileCount":8,"integrity":"sha512-HkRcLjdiDCOMDJmi1HNs1f7yVAB7tXFYdkgjKiJ3cLhtc9M7p5lIjZZtb08YvPjfawfL+Z2Xe5lrcrFHkofDKw==","signatures":[{"sig":"MEQCICFEjxuOj4C6RIZMorQw9Tizw8wDWiDK8/1H7Y3LYsMeAiAQrc8+qpRsuot/ZDRzN8F2DSsky1KPmYuBUlhOoedwXw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":237104},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"9a8615ed3bbbab223507ed4a4f5242010bdbd2a7","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"oleksandr_caesura","email":"oleksandr@caesura.io"},"repository":{"url":"git+https://github.com/caesura-io/caesura-sdk-js.git","type":"git","directory":"packages/ai-sdk"},"_npmVersion":"11.17.0","description":"Caesura adapter for the Vercel AI SDK — asynchronous, non-blocking recommendation injection via language model middleware.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"ai":"^6.0.0","tsup":"^8.3.0","vitest":"^2.1.2","typescript":"^5.6.2"},"peerDependencies":{"ai":"^5.0.0 || ^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ai-sdk_0.0.0_1782293121824_0.020640032824183585","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@caesura-io/ai-sdk","version":"0.1.0","keywords":["caesura","ai","ai-sdk","vercel-ai-sdk","llm","agents","middleware","recommendations"],"author":{"name":"Caesura"},"license":"Apache-2.0","_id":"@caesura-io/ai-sdk@0.1.0","maintainers":[{"name":"oleksandr_caesura","email":"oleksandr@caesura.io"}],"homepage":"https://github.com/caesura-io/sdk-js/tree/main/packages/ai-sdk#readme","bugs":{"url":"https://github.com/caesura-io/sdk-js/issues"},"dist":{"shasum":"5ade551b3878b45ce6c863d606295e1203b98471","tarball":"https://registry.npmjs.org/@caesura-io/ai-sdk/-/ai-sdk-0.1.0.tgz","fileCount":9,"integrity":"sha512-34dzInpOCU5Q4mVirDareCnRUe2DYbq9o/s6yxLvzmgL+xNbvyrsP35v2LBjg5bvfSfLskzYxoz9YPQ41np5LA==","signatures":[{"sig":"MEUCIQDTmRFB9yPvP+RQ/TnEvn9dhnZZMVH4tUt5jVJqn6OkQQIgAkIxuP0WuhzH4dQyagt/kzP9aqgVSXDv3hQhYR598B0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@caesura-io%2fai-sdk@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":248556},"main":"./dist/index.cjs","type":"module","_from":"file:caesura-io-ai-sdk-0.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1ecef35b-6276-49eb-806e-c1aa501a4bb4"}},"_resolved":"/tmp/159fc6e262efd8ac854d581e281ab5f6/caesura-io-ai-sdk-0.1.0.tgz","_integrity":"sha512-34dzInpOCU5Q4mVirDareCnRUe2DYbq9o/s6yxLvzmgL+xNbvyrsP35v2LBjg5bvfSfLskzYxoz9YPQ41np5LA==","repository":{"url":"git+https://github.com/caesura-io/sdk-js.git","type":"git","directory":"packages/ai-sdk"},"_npmVersion":"11.17.0","description":"Caesura adapter for the Vercel AI SDK — asynchronous, non-blocking recommendation injection via language model middleware.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"ai":"^6.0.0","tsup":"^8.3.0","vitest":"^2.1.2","typescript":"^5.6.2"},"peerDependencies":{"ai":"^5.0.0 || ^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ai-sdk_0.1.0_1782303751973_0.5469428553348092","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@caesura-io/ai-sdk","version":"0.1.1","keywords":["caesura","ai","ai-sdk","vercel-ai-sdk","llm","agents","middleware","recommendations"],"author":{"name":"Caesura"},"license":"Apache-2.0","_id":"@caesura-io/ai-sdk@0.1.1","maintainers":[{"name":"oleksandr_caesura","email":"oleksandr@caesura.io"}],"homepage":"https://github.com/caesura-io/sdk-js/tree/main/packages/ai-sdk#readme","bugs":{"url":"https://github.com/caesura-io/sdk-js/issues"},"dist":{"shasum":"ef4670bec4e743720c5d76b845afa1999f8bc28e","tarball":"https://registry.npmjs.org/@caesura-io/ai-sdk/-/ai-sdk-0.1.1.tgz","fileCount":9,"integrity":"sha512-H0/AM02UqSj0icv95Fv6vvmWKQ2NAWab6ptoz7w7D1MkLi1h8XyXDWNLWBALnLQVkHI413HoQVyydX+ZX3cUog==","signatures":[{"sig":"MEQCIHGwrupFL+cvth4k05f8X2Kse5I797yrsqWJYPN8cARXAiATWeYn/BWzG4z8Zl4RkWsFtv35mh3vtyzyCIaYuCOGWw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@caesura-io%2fai-sdk@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":248610},"main":"./dist/index.cjs","type":"module","_from":"file:caesura-io-ai-sdk-0.1.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1ecef35b-6276-49eb-806e-c1aa501a4bb4"}},"_resolved":"/tmp/90cd38611eaeeeb5c891ee5b73130ec1/caesura-io-ai-sdk-0.1.1.tgz","_integrity":"sha512-H0/AM02UqSj0icv95Fv6vvmWKQ2NAWab6ptoz7w7D1MkLi1h8XyXDWNLWBALnLQVkHI413HoQVyydX+ZX3cUog==","repository":{"url":"git+https://github.com/caesura-io/sdk-js.git","type":"git","directory":"packages/ai-sdk"},"_npmVersion":"11.17.0","description":"Caesura adapter for the Vercel AI SDK — asynchronous, non-blocking recommendation injection via language model middleware.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"ai":"^6.0.0","tsup":"^8.3.0","vitest":"^2.1.2","typescript":"^5.6.2"},"peerDependencies":{"ai":"^5.0.0 || ^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ai-sdk_0.1.1_1782311361063_0.6826329953678993","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@caesura-io/ai-sdk","version":"0.2.0","keywords":["caesura","ai","ai-sdk","vercel-ai-sdk","llm","agents","middleware","recommendations"],"author":{"name":"Caesura"},"license":"Apache-2.0","_id":"@caesura-io/ai-sdk@0.2.0","maintainers":[{"name":"oleksandr_caesura","email":"oleksandr@caesura.io"}],"homepage":"https://github.com/caesura-io/sdk-js/tree/main/packages/ai-sdk#readme","bugs":{"url":"https://github.com/caesura-io/sdk-js/issues"},"dist":{"shasum":"af4d33bfaf8096492dd57f34c1b2d0f38e65c615","tarball":"https://registry.npmjs.org/@caesura-io/ai-sdk/-/ai-sdk-0.2.0.tgz","fileCount":9,"integrity":"sha512-4Ok2/NSFmBf9nHvIP7ztbRv/6ZMpToojFizstJ9np0wBqMyqnGy/i/0ZUf5jHxFCtaQJTYxyexY25JSjhaUV+Q==","signatures":[{"sig":"MEYCIQDxRpaTv64aoWiuW6kyEiQav7XnnHBDtFkTeX825+CMKQIhAP6k2JC7usR0O9BLm8Lvzwz56XHunnJM9OtL3VgpTgs4","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@caesura-io%2fai-sdk@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":72654},"main":"./dist/index.cjs","type":"module","_from":"file:caesura-io-ai-sdk-0.2.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1ecef35b-6276-49eb-806e-c1aa501a4bb4"}},"_resolved":"/tmp/2b8fcdda4fe908009a09886c37e9e74e/caesura-io-ai-sdk-0.2.0.tgz","_integrity":"sha512-4Ok2/NSFmBf9nHvIP7ztbRv/6ZMpToojFizstJ9np0wBqMyqnGy/i/0ZUf5jHxFCtaQJTYxyexY25JSjhaUV+Q==","repository":{"url":"git+https://github.com/caesura-io/sdk-js.git","type":"git","directory":"packages/ai-sdk"},"_npmVersion":"11.18.0","description":"Caesura adapter for the Vercel AI SDK — asynchronous, non-blocking recommendation injection via language model middleware.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.0","dependencies":{"@caesura-io/core":"0.2.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"ai":"^6.0.0","tsup":"^8.3.0","vitest":"^2.1.2","typescript":"^5.6.2"},"peerDependencies":{"ai":"^5.0.0 || ^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ai-sdk_0.2.0_1782813624040_0.9816543555673987","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@caesura-io/ai-sdk","version":"0.2.1","keywords":["caesura","ai","ai-sdk","vercel-ai-sdk","llm","agents","middleware","recommendations"],"author":{"name":"Caesura"},"license":"Apache-2.0","_id":"@caesura-io/ai-sdk@0.2.1","maintainers":[{"name":"oleksandr_caesura","email":"oleksandr@caesura.io"}],"homepage":"https://github.com/caesura-io/sdk-js/tree/main/packages/ai-sdk#readme","bugs":{"url":"https://github.com/caesura-io/sdk-js/issues"},"dist":{"shasum":"1200ef87d8887b43b12b7b990f2f295742e59f44","tarball":"https://registry.npmjs.org/@caesura-io/ai-sdk/-/ai-sdk-0.2.1.tgz","fileCount":9,"integrity":"sha512-bg5LRJFuFkqZZYQuUdyxif8C80t4gKgU9Sx2CaFGrUL9ZPdfMow+U+4lUAyv5aKHycv8e84sZ1in7pSy9UAuhg==","signatures":[{"sig":"MEUCIB9Iw4aHtGHj/NTRpOXKSgFat83K7Gk5hGaXTcXoFFYvAiEAnGB1G7rnY0dbWnFrLzy/CYZkmpB/6V0P3qzzTU9OseM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@caesura-io%2fai-sdk@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":72719},"main":"./dist/index.cjs","type":"module","_from":"file:caesura-io-ai-sdk-0.2.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1ecef35b-6276-49eb-806e-c1aa501a4bb4"}},"_resolved":"/tmp/428f7fa97c1d96d458f2b6c5f8943450/caesura-io-ai-sdk-0.2.1.tgz","_integrity":"sha512-bg5LRJFuFkqZZYQuUdyxif8C80t4gKgU9Sx2CaFGrUL9ZPdfMow+U+4lUAyv5aKHycv8e84sZ1in7pSy9UAuhg==","repository":{"url":"git+https://github.com/caesura-io/sdk-js.git","type":"git","directory":"packages/ai-sdk"},"_npmVersion":"11.18.0","description":"Caesura adapter for the Vercel AI SDK — asynchronous, non-blocking recommendation injection via language model middleware.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.0","dependencies":{"@caesura-io/core":"0.2.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"ai":"^6.0.0","tsup":"^8.3.0","vitest":"^2.1.2","typescript":"^5.6.2"},"peerDependencies":{"ai":"^5.0.0 || ^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ai-sdk_0.2.1_1782815337186_0.2990585099104288","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@caesura-io/ai-sdk","version":"0.3.0","keywords":["caesura","ai","ai-sdk","vercel-ai-sdk","llm","agents","middleware","recommendations"],"author":{"name":"Caesura"},"license":"Apache-2.0","_id":"@caesura-io/ai-sdk@0.3.0","maintainers":[{"name":"oleksandr_caesura","email":"oleksandr@caesura.io"}],"homepage":"https://github.com/caesura-io/sdk-js/tree/main/packages/ai-sdk#readme","bugs":{"url":"https://github.com/caesura-io/sdk-js/issues"},"dist":{"shasum":"1317bcf94cc9f363659a9cf5f15f917edd619cc4","tarball":"https://registry.npmjs.org/@caesura-io/ai-sdk/-/ai-sdk-0.3.0.tgz","fileCount":9,"integrity":"sha512-HQdzu+j6gkojvBv9Aoxex55tRHU/L91s3XpdVAYRP6lGwuWHaeBXq6Bh7iMhlnSE6FeBRCb0zrlS2zNGT7u0VQ==","signatures":[{"sig":"MEUCIBPyITLgv593CDLDiqDStpIxsb8MagFui3PGP+LaQSjQAiEAwWw/nlnpjuyNubehSfSDDU4hRuuwNEAQiC9Vqm5SDk8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@caesura-io%2fai-sdk@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":72937},"main":"./dist/index.cjs","type":"module","_from":"file:caesura-io-ai-sdk-0.3.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1ecef35b-6276-49eb-806e-c1aa501a4bb4"}},"_resolved":"/tmp/093c389d398d822d6521b451ba80c97b/caesura-io-ai-sdk-0.3.0.tgz","_integrity":"sha512-HQdzu+j6gkojvBv9Aoxex55tRHU/L91s3XpdVAYRP6lGwuWHaeBXq6Bh7iMhlnSE6FeBRCb0zrlS2zNGT7u0VQ==","repository":{"url":"git+https://github.com/caesura-io/sdk-js.git","type":"git","directory":"packages/ai-sdk"},"_npmVersion":"11.18.0","description":"Caesura adapter for the Vercel AI SDK — asynchronous, non-blocking recommendation injection via language model middleware.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.0","dependencies":{"@caesura-io/core":"0.2.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"ai":"^7.0.0","tsup":"^8.3.0","vitest":"^2.1.2","typescript":"^5.6.2"},"peerDependencies":{"ai":"^5.0.0 || ^6.0.0 || ^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ai-sdk_0.3.0_1782830200631_0.36742381265007285","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"_id":"@caesura-io/ai-sdk@0.4.0","bugs":{"url":"https://github.com/caesura-io/sdk-js/issues"},"dist":{"shasum":"27de8658b42359b58dc4465d302ea8b078a5db44","tarball":"https://registry.npmjs.org/@caesura-io/ai-sdk/-/ai-sdk-0.4.0.tgz","fileCount":9,"integrity":"sha512-nVMdK4CWxifcFQF3r6ROyTaYb2MM3DJXSeV4AzrXhDuG/mGcB90Awb35XFEyuqclBtDKEvh6oT6h7vs9uqkaVw==","signatures":[{"sig":"MEUCICb1zjZC94q1ucnQ1IE7/eTQ0fDIjl4M97CVXZaDRxaSAiEAzFjSEKmqrO5v2cbS8Lt73Fx2M7mmIPVZyEfIPvfGwEY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDjdrdfnzaHrTC2kCDw2OSkLdu3/W1l5cElKGAEPLc6ZQIgUZfXxX9EGYV5EVeVR0wUYwVtDR1+McozhGBvs2Cyy8Q="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@caesura-io%2fai-sdk@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":88360},"main":"./dist/index.cjs","name":"@caesura-io/ai-sdk","type":"module","_from":"file:caesura-io-ai-sdk-0.4.0.tgz","types":"./dist/index.d.ts","author":{"name":"CaesuraO"},"module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"license":"Apache-2.0","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest"},"version":"0.4.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"1ecef35b-6276-49eb-806e-c1aa501a4bb4"}},"homepage":"https://github.com/caesura-io/sdk-js/tree/main/packages/ai-sdk#readme","keywords":["caesura","ai","ai-sdk","vercel-ai-sdk","llm","agents","middleware","recommendations"],"_resolved":"/tmp/64e1e069e486e954395761a7600ec20d/caesura-io-ai-sdk-0.4.0.tgz","_integrity":"sha512-nVMdK4CWxifcFQF3r6ROyTaYb2MM3DJXSeV4AzrXhDuG/mGcB90Awb35XFEyuqclBtDKEvh6oT6h7vs9uqkaVw==","repository":{"url":"git+https://github.com/caesura-io/sdk-js.git","type":"git","directory":"packages/ai-sdk"},"_npmVersion":"11.21.0","description":"CaesuraO adapter for the Vercel AI SDK — asynchronous, non-blocking recommendation injection via language model middleware.","directories":{},"maintainers":[{"name":"oleksandr_caesura","email":"oleksandr@caesura.io"}],"sideEffects":false,"_nodeVersion":"22.23.3","dependencies":{"@caesura-io/core":"0.3.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"ai":"^7.0.0","tsup":"^8.3.0","vitest":"^2.1.2","typescript":"^5.6.2"},"peerDependencies":{"ai":"^5.0.0 || ^6.0.0 || ^7.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ai-sdk_0.4.0_1790973648179_0.10549622217794208"}}},"time":{"created":"2026-06-24T09:25:21.669Z","modified":"2026-10-02T20:40:48.690Z","0.0.0":"2026-06-24T09:25:22.034Z","0.1.0":"2026-06-24T12:22:32.120Z","0.1.1":"2026-06-24T14:29:21.241Z","0.2.0":"2026-06-30T10:00:24.196Z","0.2.1":"2026-06-30T10:28:57.319Z","0.3.0":"2026-06-30T14:36:40.766Z","0.4.0":"2026-10-02T20:40:48.264Z"},"bugs":{"url":"https://github.com/caesura-io/sdk-js/issues"},"author":{"name":"CaesuraO"},"license":"Apache-2.0","homepage":"https://github.com/caesura-io/sdk-js/tree/main/packages/ai-sdk#readme","keywords":["caesura","ai","ai-sdk","vercel-ai-sdk","llm","agents","middleware","recommendations"],"repository":{"url":"git+https://github.com/caesura-io/sdk-js.git","type":"git","directory":"packages/ai-sdk"},"description":"CaesuraO adapter for the Vercel AI SDK — asynchronous, non-blocking recommendation injection via language model middleware.","maintainers":[{"name":"oleksandr_caesura","email":"oleksandr@caesura.io"}],"readme":"# @caesura-io/ai-sdk\n\nAsynchronous, non-blocking recommendation injection for the [Vercel AI SDK](https://ai-sdk.dev).\n\nCaesuraO listens to your agent's dialogue and pushes short, real-time\nrecommendations (\"analysis\") into the model's context _before the next call_ —\nwithout blocking the conversation. It plugs in as a standard AI SDK language\nmodel middleware.\n\n> **Status:** early development. API is not yet stable.\n\n## Install\n\n```bash\nnpm i @caesura-io/ai-sdk ai\n```\n\n## Quick start\n\nWrap your existing model with `caesuraMiddleware` — the only changes to your code are the highlighted lines:\n\n```diff\n import { wrapLanguageModel, generateText } from 'ai';\n import { anthropic } from '@ai-sdk/anthropic';\n+import { caesuraMiddleware } from '@caesura-io/ai-sdk';\n\n-const model = anthropic('claude-sonnet-4-6');\n+const model = wrapLanguageModel({\n+  model: anthropic('claude-sonnet-4-6'),\n+  middleware: caesuraMiddleware({\n+    autoCreateConversation: true,\n+    // apiKey auto-read from CAESURA_API_KEY if omitted\n+  }),\n+});\n\n const result = await generateText({\n   model,\n   messages: conversation,\n+  providerOptions: { caesura: { conversationId: sessionId } },\n });\n```\n\n## Conversations and persistence\n\n`baseUrl` defaults to `https://api.caesurao.com`. Your account determines the environment;\nmost applications do not need a URL override. `CAESURA_API_KEY` remains unchanged.\n\n`persist` defaults to `true`. Persistence requires a backend conversation ID:\na local label or generated UUID alone does not create a conversation. Choose one of these approaches:\n\n- **Explicit creation (default):** create once, save the returned ID, and reuse it on every turn.\n- **Automatic creation:** set `autoCreateConversation: true` and pass a stable, unique local session label.\n  The SDK creates a backend conversation before its first analysis and reuses it, including after analysis failures.\n  Overlapping observations share the same creation. Empty dialogue and `persist: false` skip creation.\n\nAutomatic creation defaults to `false`. Its local-label mapping is stored in memory by default and\nis lost on eviction, clearing, or restart; use explicit IDs for durable reuse. Use a distinct ID or label\nfor each independent conversation.\n\nIf neither a per-call nor configured ID is supplied, JS uses the shared `\"default\"` session.\nA client serving multiple users must supply distinct IDs or labels.\nCreation failures from `createConversation()` reject its promise;\nautomatic failures go to `onError` and leave the model call running.\n\n```ts\nconst middleware = caesuraMiddleware({});\nconst conversationId = await middleware.createConversation({\n  name: 'Support session',\n});\nconst model = wrapLanguageModel({\n  model: anthropic('claude-sonnet-4-6'),\n  middleware,\n});\n// Save conversationId; reuse it on subsequent calls.\nawait generateText({\n  model,\n  prompt: 'Hello!',\n  providerOptions: { caesura: { conversationId } },\n});\n```\n\n`createConversation({ name?, calendarId?, eventId? })` calls `POST /api/conversation`\nand returns a validated backend ID string. Set `persist: false` to analyze without backend storage.\nOrdinary SDK analysis requests omit `notifyIntegrations` and do not override the backend's default `callType`.\n\n## Analysis and limits\n\nResponses are preserved as returned: JSON objects, arrays, strings, numbers, booleans, or null,\nand plain text. `{analysis}` renders the complete value; `{analysis.field}` reads the exact object key.\nZero and false are valid guidance. Empty values are not buffered. Only boolean `isSame` or `is_same`\nmetadata suppresses duplicates; deduplication depends on the backend returning that signal.\n\nOnly user and assistant text is analyzed. System/developer instructions, tool metadata/results,\nand reasoning items are excluded. Tool results remain adjacent to their assistant tool calls.\nThe skill prompt stays in system/developer instructions, independently of the analysis injection role.\n\n`send.maxMessages` (default `10`) and `send.maxInputChars` cap the actual outgoing analysis request,\nincluding prior analyses. Newest dialogue has priority; history uses the remaining budget.\nZero disables analysis. `inject.keepLast: 0` disables recommendation injection while retaining history.\nNegative limits are rejected. Model input and caller-owned messages are preserved.\n\n## Reusing injected history\n\nPreviously emitted guidance is tracked per stored conversation by provider role\nand exact rendered text, including older merged blocks. Before analysis and\ninjection, recognized anonymous text-only guidance messages are removed from reused\nhistory; only currently eligible guidance is inserted again. This avoids duplicate\ninjections and removes expired guidance or guidance excluded by `keepLast`.\nNamed messages, explicit speaker indices, tool calls, and multimodal content are\npreserved. Messages with a different provider role are not mistaken for guidance.\nKeep application dialogue separate from injected requests when possible; an\nanonymous message with the same role and exact text as prior SDK guidance is\nindistinguishable after serialization.\n\n## Credit Usage Reporting\n\nYou can request credit-usage metadata on every analyze call and receive the reported value via the `onCreditUsage` callback.\n\n```diff\n+import { caesuraMiddleware, createCreditMeter } from '@caesura-io/ai-sdk';\n+\n+const meter = createCreditMeter();\n\n const model = wrapLanguageModel({\n   model,\n   middleware: caesuraMiddleware({\n     autoCreateConversation: true,\n+    onCreditUsage: meter.record,\n   }),\n });\n\n+// Query credit metrics later\n+console.log('total credits consumed:', meter.total());\n+console.log('credits by conversation:', meter.breakdown());\n+console.log('retained credit events:', meter.events());\n```\n\n> [!NOTE]\n> In `async` mode, the `onCreditUsage` callback fires out-of-band as soon as the asynchronous analyze call completes, decoupled from the synchronous `generateText` response.\n\n## Backend message roles and persistence\n\nEvery analysis request sets `currentUser` to `speakerNames.agent` (default `\"Agent\"`).\nThis identifies the guidance recipient even on customer turns; per-message name\noverrides affect only the message, not `currentUser`.\n\n`/api/analyze` uses `speakerRole` for the analysis prompt: both customer and agent\n**dialogue** are sent as `\"user\"`, with identity preserved by `speakerName` and\n`speakerIndex` (`1` for customer, `0` for agent). Explicit indices survive copying\nand trimming. Previous CaesuraO analyses use `\"assistant\"` with index `-1`. JSON-formatted agent dialogue is\nstill dialogue; its content is never used to reclassify it as an analysis.\n\nThe backend persists the last outbound message as the current utterance. The SDK\nkeeps that dialogue message last, even if repeated text matches an earlier\nanalysis anchor. Retained analyses stay before it and use only the remaining\nmessage/character budget. These backend adaptations do not change the original\nroles or messages sent to the model provider.\n\nAnalyses are anchored to the dialogue prefix through the analyzed turn, including\nspeaker names and indices, before SDK send limits are applied. Repeated dialogue\ntherefore keeps its original analysis order, including with\n`placement: \"after-last-analyzed\"`. Pass growing dialogue history to retain those\npositions. If callers edit or remove earlier history, unmatched analyses use the\nlatest-context fallback instead of attaching to another identical utterance.\nBackground analysis snapshots the collected dialogue before awaiting work.\nThe prefix fingerprint uses FNV-1a/64 over UTF-16 code units; it is local occurrence\nmetadata, not a security hash or a backend field.\n\nSimilarity calculation and duplicate suppression are separate: `calculateSimilarities`\ndefaults to `true`, while `similarityThreshold` is omitted unless you configure it.\nCalculating similarities alone does not enable threshold suppression. The SDK forwards\nboth options unchanged and buffers no new guidance when the backend returns boolean\n`isSame: true`; it retains previous guidance and still sends subsequent dialogue turns\nfor analysis and persistence, subject to the configured cadence and in-flight guard.\n\n## Text budgets and migration\n\nText parts concatenate without added separators. Character limits count Unicode\ncode points. Newest dialogue takes priority, with a suffix of the oldest retained\nmessage using any remaining space. Whole analyses then use the remaining budget\nnewest-first, stopping when the next analysis cannot fit. Missing-anchor analyses\ncollapse to one latest leading context entry before budgeting. Objects and arrays\nuse compact Unicode-preserving JSON. Provider input remains unchanged.\n\nSee the [migration notes](https://github.com/caesura-io/sdk-js/blob/main/MIGRATION.md)\nfor persistence defaults, default sessions, arbitrary analysis types, and examples.\n","readmeFilename":"README.md"}