{"_id":"@adzenai/ai","_rev":"11-cee2702a9afff1aa17a565daf42dfc1d","name":"@adzenai/ai","dist-tags":{"latest":"1.3.0"},"versions":{"0.0.1":{"name":"@adzenai/ai","version":"0.0.1","license":"MIT","_id":"@adzenai/ai@0.0.1","maintainers":[{"name":"matesv","email":"mate@adzen.ai"},{"name":"adzen-engineering","email":"engineering@adzen.ai"}],"dist":{"shasum":"bed474abdad0d5e64b4fe213ec8bbcccb9e53e40","tarball":"https://registry.npmjs.org/@adzenai/ai/-/ai-0.0.1.tgz","fileCount":19,"integrity":"sha512-kMRN6MZv8Kpe6iZfY/5XSV5ZwTdhRRqyBvSTywZpyG58Wx7LOvrurKJLHNWGME0rAWVG2psiCiy/2BzxenlwXg==","signatures":[{"sig":"MEUCIQCTzpdmwMr603YDjDnGzeAsGfDM2e+OBxwj3/CFJcddHAIgNcPJH4CyXGAbYrjSCQU3W6u9eF0KE3Vs4pnB81fljFM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":83571},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","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"}},"./copilotkit":{"import":{"types":"./dist/copilotkit/index.d.ts","default":"./dist/copilotkit/index.js"},"require":{"types":"./dist/copilotkit/index.d.cts","default":"./dist/copilotkit/index.cjs"}},"./copilotkit/react":{"import":{"types":"./dist/copilotkit/react/index.d.ts","default":"./dist/copilotkit/react/index.js"},"require":{"types":"./dist/copilotkit/react/index.d.cts","default":"./dist/copilotkit/react/index.cjs"}}},"gitHead":"730d8441d377202a4128e988f99c45baadf3e8da","scripts":{"demo":"vite --config src/copilotkit/demo/vite.config.ts","test":"vitest run","build":"tsup","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"matesv","email":"mate@adzen.ai"},"_npmVersion":"11.6.0","description":"AI-powered ad integration for CopilotKit and AG-UI agents","directories":{},"_nodeVersion":"24.8.0","dependencies":{"@adzenai/core":"workspace:*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","vite":"^6.0.0","jsdom":"^29.1.1","react":"^18.3.0","vitest":"^2.1.0","react-dom":"^18.3.0","typescript":"^5.5.0","@types/react":"^18.3.0","@types/react-dom":"^18.3.0","@vitejs/plugin-react":"^4.3.0"},"peerDependencies":{"rxjs":">=7","react":">=18","@ag-ui/core":"*","@ag-ui/client":"*"},"peerDependenciesMeta":{"rxjs":{"optional":true},"react":{"optional":true},"@ag-ui/core":{"optional":true},"@ag-ui/client":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ai_0.0.1_1783374647096_0.43855203378421326","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@adzenai/ai","version":"1.0.0","license":"MIT","_id":"@adzenai/ai@1.0.0","maintainers":[{"name":"matesv","email":"mate@adzen.ai"},{"name":"adzen-engineering","email":"engineering@adzen.ai"}],"dist":{"shasum":"47aa0cdbfa29aa2703ef4c2b5f1658e21e06e7ac","tarball":"https://registry.npmjs.org/@adzenai/ai/-/ai-1.0.0.tgz","fileCount":20,"integrity":"sha512-QEaFKwu5qgOJmx8cBfuBYyFy7fmHjPghwZAQzdFZmatCETmXvqvPXai7J/Z4cWrGBLSfdd0sGZ0hw4Ue9xzDDg==","signatures":[{"sig":"MEQCIBwCyw9vBTvFhWeENO+rCMwHVNxtmvgZwciXEDuNljuWAiBa4PQP7B/p3XWmogaHI5ui5FTqVd/tVrIwGq2LC/GCDw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":100258},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","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"}},"./copilotkit":{"import":{"types":"./dist/copilotkit/index.d.ts","default":"./dist/copilotkit/index.js"},"require":{"types":"./dist/copilotkit/index.d.cts","default":"./dist/copilotkit/index.cjs"}},"./copilotkit/react":{"import":{"types":"./dist/copilotkit/react/index.d.ts","default":"./dist/copilotkit/react/index.js"},"require":{"types":"./dist/copilotkit/react/index.d.cts","default":"./dist/copilotkit/react/index.cjs"}}},"gitHead":"cb7580422996c319ac9627ccbec6dadfc9d2e30e","scripts":{"demo":"vite --config src/copilotkit/demo/vite.config.ts","test":"vitest run","build":"tsup","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"matesv","email":"mate@adzen.ai"},"_npmVersion":"11.6.0","description":"AI-powered ad integration for CopilotKit and AG-UI agents","directories":{},"_nodeVersion":"24.8.0","dependencies":{"@adzenai/core":"workspace:*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","vite":"^6.0.0","jsdom":"^29.1.1","react":"^18.3.0","vitest":"^2.1.0","react-dom":"^18.3.0","typescript":"^5.5.0","@types/react":"^18.3.0","@types/react-dom":"^18.3.0","@vitejs/plugin-react":"^4.3.0"},"peerDependencies":{"rxjs":">=7","react":">=18","@ag-ui/core":"*","@ag-ui/client":"*"},"peerDependenciesMeta":{"rxjs":{"optional":true},"react":{"optional":true},"@ag-ui/core":{"optional":true},"@ag-ui/client":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ai_1.0.0_1783446356831_0.8198410399845741","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@adzenai/ai","version":"1.1.0","license":"MIT","_id":"@adzenai/ai@1.1.0","maintainers":[{"name":"matesv","email":"mate@adzen.ai"},{"name":"adzen-engineering","email":"engineering@adzen.ai"}],"dist":{"shasum":"7bc527555e459efd70ab3d32365a7f5049b8d3d6","tarball":"https://registry.npmjs.org/@adzenai/ai/-/ai-1.1.0.tgz","fileCount":20,"integrity":"sha512-g+gTCBJi1US/R6R/96fBKv2pe8No4pmbmeJALYcNOgCHHR3xSFofsn2OOybK/J3Na9w9KnAJbaFzExg8G7wSGw==","signatures":[{"sig":"MEQCIHqtnsiOV6TfaBHoP77lPu2rq90n/aYRLk6jD6INeNdrAiB8+/hiL0l1hQ1kw2tutYzASNFjiYKb/hBwfHS+SNnCuQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":100600},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","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"}},"./copilotkit":{"import":{"types":"./dist/copilotkit/index.d.ts","default":"./dist/copilotkit/index.js"},"require":{"types":"./dist/copilotkit/index.d.cts","default":"./dist/copilotkit/index.cjs"}},"./copilotkit/react":{"import":{"types":"./dist/copilotkit/react/index.d.ts","default":"./dist/copilotkit/react/index.js"},"require":{"types":"./dist/copilotkit/react/index.d.cts","default":"./dist/copilotkit/react/index.cjs"}}},"gitHead":"0ca4391285a83cf462cbd899176fe53cbfb9286e","scripts":{"demo":"vite --config src/copilotkit/demo/vite.config.ts","test":"vitest run","build":"tsup","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"matesv","email":"mate@adzen.ai"},"_npmVersion":"11.6.0","description":"AI-powered ad integration for CopilotKit and AG-UI agents","directories":{},"_nodeVersion":"24.8.0","dependencies":{"@adzenai/core":"workspace:*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","vite":"^6.0.0","jsdom":"^29.1.1","react":"^18.3.0","vitest":"^2.1.0","react-dom":"^18.3.0","typescript":"^5.5.0","@types/react":"^18.3.0","@types/react-dom":"^18.3.0","@vitejs/plugin-react":"^4.3.0"},"peerDependencies":{"rxjs":">=7","react":">=18","@ag-ui/core":"*","@ag-ui/client":"*"},"peerDependenciesMeta":{"rxjs":{"optional":true},"react":{"optional":true},"@ag-ui/core":{"optional":true},"@ag-ui/client":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ai_1.1.0_1783638638461_0.8038525261736995","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@adzenai/ai","version":"1.1.1","license":"MIT","_id":"@adzenai/ai@1.1.1","maintainers":[{"name":"matesv","email":"mate@adzen.ai"},{"name":"adzen-engineering","email":"engineering@adzen.ai"},{"name":"tomadzen","email":"tomas@adzen.ai"}],"dist":{"shasum":"dfd8663a7d6efa81ea2c83101cea713105beadb8","tarball":"https://registry.npmjs.org/@adzenai/ai/-/ai-1.1.1.tgz","fileCount":20,"integrity":"sha512-TAzh9fYzEyrykr3lJhNpEMRnE/Z0XzcwqsLuZiswP8w07V6T/OeQ2vkZ2TLt3d8s0j+P33GFD3HzWKjNZDKNSQ==","signatures":[{"sig":"MEUCIDv/FCsmqj2n0AvgoZzw/2hAd18YmVTKgig5hOjDha0rAiEArhpHSM/rsHmYcZIITZ2M3pE0iTcMQc3bT7NCbi0L55o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":93414},"main":"./dist/index.cjs","type":"module","_from":"file:adzenai-ai-1.1.1.tgz","types":"./dist/index.d.ts","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"}},"./copilotkit":{"import":{"types":"./dist/copilotkit/index.d.ts","default":"./dist/copilotkit/index.js"},"require":{"types":"./dist/copilotkit/index.d.cts","default":"./dist/copilotkit/index.cjs"}},"./copilotkit/react":{"import":{"types":"./dist/copilotkit/react/index.d.ts","default":"./dist/copilotkit/react/index.js"},"require":{"types":"./dist/copilotkit/react/index.d.cts","default":"./dist/copilotkit/react/index.cjs"}}},"scripts":{"demo":"vite --config src/copilotkit/demo/vite.config.ts","test":"vitest run","build":"tsup","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"tomadzen","email":"tomas@adzen.ai"},"_resolved":"/private/var/folders/63/smjkfj9n0xvdf_8rbkl5fxjr0000gn/T/8e4dd12c7893f0614537c33936f7e7ec/adzenai-ai-1.1.1.tgz","_integrity":"sha512-TAzh9fYzEyrykr3lJhNpEMRnE/Z0XzcwqsLuZiswP8w07V6T/OeQ2vkZ2TLt3d8s0j+P33GFD3HzWKjNZDKNSQ==","_npmVersion":"10.9.2","description":"AI-powered ad integration for CopilotKit and AG-UI agents","directories":{},"_nodeVersion":"22.16.0","dependencies":{"@adzenai/core":"1.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","vite":"^6.0.0","jsdom":"^29.1.1","react":"^18.3.0","vitest":"^2.1.0","react-dom":"^18.3.0","typescript":"^5.5.0","@types/react":"^18.3.0","@types/react-dom":"^18.3.0","@vitejs/plugin-react":"^4.3.0"},"peerDependencies":{"rxjs":">=7","react":">=18","@ag-ui/core":"*","@ag-ui/client":"*"},"peerDependenciesMeta":{"rxjs":{"optional":true},"react":{"optional":true},"@ag-ui/core":{"optional":true},"@ag-ui/client":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ai_1.1.1_1784043487927_0.6958563028860443","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@adzenai/ai","version":"1.2.0","license":"MIT","_id":"@adzenai/ai@1.2.0","maintainers":[{"name":"matesv","email":"mate@adzen.ai"},{"name":"adzen-engineering","email":"engineering@adzen.ai"},{"name":"tomadzen","email":"tomas@adzen.ai"}],"dist":{"shasum":"75df67a176db0996b44ba32c10d904ebfb5ffeba","tarball":"https://registry.npmjs.org/@adzenai/ai/-/ai-1.2.0.tgz","fileCount":20,"integrity":"sha512-1tX93XWxV4s0r2WL8xah+6Vdp48uqt7sj6/3beu4b7PHYBWrZFfj/bWG/2gWEUYWVk3JMpPZLUSHthOZCQjdnw==","signatures":[{"sig":"MEQCIGIvDb4rBaL+prFA5Xce9njViwCF80QOKVcFC+sa0GGZAiBbXLBE0gz4ojqwnHF4DUA5qPx0wbK+lHqEBl7OZcOKdQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":234503},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","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"}},"./copilotkit":{"import":{"types":"./dist/copilotkit/index.d.ts","default":"./dist/copilotkit/index.js"},"require":{"types":"./dist/copilotkit/index.d.cts","default":"./dist/copilotkit/index.cjs"}},"./copilotkit/react":{"import":{"types":"./dist/copilotkit/react/index.d.ts","default":"./dist/copilotkit/react/index.js"},"require":{"types":"./dist/copilotkit/react/index.d.cts","default":"./dist/copilotkit/react/index.cjs"}}},"gitHead":"55a25496fd270deca7c8f3c9c0069d6a9a24a06a","scripts":{"demo":"vite --config src/copilotkit/demo/vite.config.ts","test":"vitest run","build":"tsup","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"matesv","email":"mate@adzen.ai"},"_npmVersion":"11.6.0","description":"AI-powered ad integration for CopilotKit and AG-UI agents","directories":{},"_nodeVersion":"24.8.0","dependencies":{"@adzenai/core":"workspace:*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","vite":"^6.0.0","jsdom":"^29.1.1","react":"^18.3.0","vitest":"^2.1.0","react-dom":"^18.3.0","typescript":"^5.5.0","@types/node":"^26.1.2","@types/react":"^18.3.0","react-markdown":"^10.1.0","@types/react-dom":"^18.3.0","@vitejs/plugin-react":"^4.3.0"},"peerDependencies":{"rxjs":">=7","react":">=18","@ag-ui/core":"*","@ag-ui/client":"*"},"peerDependenciesMeta":{"rxjs":{"optional":true},"react":{"optional":true},"@ag-ui/core":{"optional":true},"@ag-ui/client":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ai_1.2.0_1786482430652_0.7632390133069635","host":"s3://npm-registry-packages-npm-production"}},"1.2.1":{"name":"@adzenai/ai","version":"1.2.1","license":"MIT","_id":"@adzenai/ai@1.2.1","maintainers":[{"name":"matesv","email":"mate@adzen.ai"},{"name":"adzen-engineering","email":"engineering@adzen.ai"},{"name":"tomadzen","email":"tomas@adzen.ai"}],"dist":{"shasum":"d24a8ecbf457e84ad1bc7a5093a1002c0bc1c746","tarball":"https://registry.npmjs.org/@adzenai/ai/-/ai-1.2.1.tgz","fileCount":20,"integrity":"sha512-QWmCHtiYx0JFllO4CIRYWAsS0g2trMvvHyW2VG3ImDZZJ8HXB/30ztCKxRAj9jo+mSa4F6/a6BnzQg67YuF8XQ==","signatures":[{"sig":"MEQCID/FswOW/y6eVbWe5ZIp0JjEULiFlHCWuw2Wp8aY7F9RAiB1PA17x8WVyTDFN1HiaG/N2Y6yzJ0JeYGc1rntXMhmDw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":238530},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","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"}},"./copilotkit":{"import":{"types":"./dist/copilotkit/index.d.ts","default":"./dist/copilotkit/index.js"},"require":{"types":"./dist/copilotkit/index.d.cts","default":"./dist/copilotkit/index.cjs"}},"./copilotkit/react":{"import":{"types":"./dist/copilotkit/react/index.d.ts","default":"./dist/copilotkit/react/index.js"},"require":{"types":"./dist/copilotkit/react/index.d.cts","default":"./dist/copilotkit/react/index.cjs"}}},"gitHead":"55a25496fd270deca7c8f3c9c0069d6a9a24a06a","scripts":{"demo":"vite --config src/copilotkit/demo/vite.config.ts","test":"vitest run","build":"tsup","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"matesv","email":"mate@adzen.ai"},"_npmVersion":"11.6.0","description":"AI-powered ad integration for CopilotKit and AG-UI agents","directories":{},"_nodeVersion":"24.8.0","dependencies":{"@adzenai/core":"workspace:*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","vite":"^6.0.0","jsdom":"^29.1.1","react":"^18.3.0","vitest":"^2.1.0","react-dom":"^18.3.0","typescript":"^5.5.0","@types/node":"^26.1.2","@types/react":"^18.3.0","react-markdown":"^10.1.0","@types/react-dom":"^18.3.0","@vitejs/plugin-react":"^4.3.0"},"peerDependencies":{"rxjs":">=7","react":">=18","@ag-ui/core":"*","@ag-ui/client":"*"},"peerDependenciesMeta":{"rxjs":{"optional":true},"react":{"optional":true},"@ag-ui/core":{"optional":true},"@ag-ui/client":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ai_1.2.1_1786484544683_0.09409862413353198","host":"s3://npm-registry-packages-npm-production"}},"1.2.2":{"name":"@adzenai/ai","version":"1.2.2","license":"MIT","_id":"@adzenai/ai@1.2.2","maintainers":[{"name":"matesv","email":"mate@adzen.ai"},{"name":"adzen-engineering","email":"engineering@adzen.ai"},{"name":"tomadzen","email":"tomas@adzen.ai"}],"dist":{"shasum":"19f7fb33c08ca27c76fb3b34dea0c06ebff32374","tarball":"https://registry.npmjs.org/@adzenai/ai/-/ai-1.2.2.tgz","fileCount":20,"integrity":"sha512-J1wg5ox9AQuP/anL4FWW5YRwWB32bj0ndj3swMwFY0HfcVr2/xwuuwuNB8k2YNkWTGOHCFIy7YmaIdfckfnK8A==","signatures":[{"sig":"MEQCIDu1e273OoLUtQSM0S+U+XBiPkpx0B7GF3JYIwE4/2WwAiBz7z5L3WmIQFev2jPTys1WKKf9Q5t7C4KH5jAlhOloQA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIFTtDjXqIkrQVxk/7BWXn9Fay0PYRXowt0aVL2F2xWDeAiA/VWX8MDErRz749KuHvdRHQ+YINXpwQj7ofnUOKbfhdA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":243255},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","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"}},"./copilotkit":{"import":{"types":"./dist/copilotkit/index.d.ts","default":"./dist/copilotkit/index.js"},"require":{"types":"./dist/copilotkit/index.d.cts","default":"./dist/copilotkit/index.cjs"}},"./copilotkit/react":{"import":{"types":"./dist/copilotkit/react/index.d.ts","default":"./dist/copilotkit/react/index.js"},"require":{"types":"./dist/copilotkit/react/index.d.cts","default":"./dist/copilotkit/react/index.cjs"}}},"gitHead":"b75a61146b4c00408801858bd1131e3dd97d81aa","scripts":{"demo":"vite --config src/copilotkit/demo/vite.config.ts","test":"vitest run","build":"tsup","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"matesv","email":"mate@adzen.ai"},"_npmVersion":"11.6.0","description":"AI-powered ad integration for CopilotKit and AG-UI agents","directories":{},"_nodeVersion":"24.8.0","dependencies":{"@adzenai/core":"workspace:*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","vite":"^6.0.0","jsdom":"^29.1.1","react":"^18.3.0","vitest":"^2.1.0","react-dom":"^18.3.0","typescript":"^5.5.0","@types/node":"^26.1.2","@types/react":"^18.3.0","react-markdown":"^10.1.0","@types/react-dom":"^18.3.0","@vitejs/plugin-react":"^4.3.0"},"peerDependencies":{"rxjs":">=7","react":">=18","@ag-ui/core":"*","@ag-ui/client":"*"},"peerDependenciesMeta":{"rxjs":{"optional":true},"react":{"optional":true},"@ag-ui/core":{"optional":true},"@ag-ui/client":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ai_1.2.2_1788386304915_0.3422410477892288","host":"s3://npm-registry-packages-npm-production"}},"1.2.3":{"name":"@adzenai/ai","version":"1.2.3","license":"MIT","_id":"@adzenai/ai@1.2.3","maintainers":[{"name":"matesv","email":"mate@adzen.ai"},{"name":"adzen-engineering","email":"engineering@adzen.ai"},{"name":"tomadzen","email":"tomas@adzen.ai"}],"dist":{"shasum":"30f77fceda4e42fbeab3236838822af49118fd48","tarball":"https://registry.npmjs.org/@adzenai/ai/-/ai-1.2.3.tgz","fileCount":20,"integrity":"sha512-euwZRvYQtytkvcP7cGW14f3NfQy859V503/HwrMGqAsiIc1h4JKX5N7B+BICfNrMv9OiF/y4M9H12r5A75/9+g==","signatures":[{"sig":"MEUCIQCKrLi3f+tLKyG4dekwsuCqX08hpwl4g8ZMWrn4Fqj8nQIgNIX+k00vGlMEiH8N4zXU3ufVni164QydRIubZbAg1/s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQCGKkIeTzGdf0PUBgCskJ3wqFBdpa+bpTTtoXKb1vLNJgIgXSCU0nr+/397MqqY5SD4TbhFEoaFSVMBMfkaSuY5U+Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":243248},"main":"./dist/index.cjs","type":"module","_from":"file:adzenai-ai-1.2.3.tgz","types":"./dist/index.d.ts","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"}},"./copilotkit":{"import":{"types":"./dist/copilotkit/index.d.ts","default":"./dist/copilotkit/index.js"},"require":{"types":"./dist/copilotkit/index.d.cts","default":"./dist/copilotkit/index.cjs"}},"./copilotkit/react":{"import":{"types":"./dist/copilotkit/react/index.d.ts","default":"./dist/copilotkit/react/index.js"},"require":{"types":"./dist/copilotkit/react/index.d.cts","default":"./dist/copilotkit/react/index.cjs"}}},"scripts":{"demo":"vite --config src/copilotkit/demo/vite.config.ts","test":"vitest run","build":"tsup","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"matesv","email":"mate@adzen.ai"},"_resolved":"/private/var/folders/9h/mjdx7xl537n7nt5j7q1y4n3w0000gn/T/df898fdae860065d1a8e90e1c211d694/adzenai-ai-1.2.3.tgz","_integrity":"sha512-euwZRvYQtytkvcP7cGW14f3NfQy859V503/HwrMGqAsiIc1h4JKX5N7B+BICfNrMv9OiF/y4M9H12r5A75/9+g==","_npmVersion":"11.6.0","description":"AI-powered ad integration for CopilotKit and AG-UI agents","directories":{},"_nodeVersion":"24.8.0","dependencies":{"@adzenai/core":"1.2.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","vite":"^6.0.0","jsdom":"^29.1.1","react":"^18.3.0","vitest":"^2.1.0","react-dom":"^18.3.0","typescript":"^5.5.0","@types/node":"^26.1.2","@types/react":"^18.3.0","react-markdown":"^10.1.0","@types/react-dom":"^18.3.0","@vitejs/plugin-react":"^4.3.0"},"peerDependencies":{"rxjs":">=7","react":">=18","@ag-ui/core":"*","@ag-ui/client":"*"},"peerDependenciesMeta":{"rxjs":{"optional":true},"react":{"optional":true},"@ag-ui/core":{"optional":true},"@ag-ui/client":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ai_1.2.3_1788386802339_0.3373487840770686","host":"s3://npm-registry-packages-npm-production"}},"1.2.4":{"name":"@adzenai/ai","version":"1.2.4","license":"MIT","_id":"@adzenai/ai@1.2.4","maintainers":[{"name":"matesv","email":"mate@adzen.ai"},{"name":"adzen-engineering","email":"engineering@adzen.ai"},{"name":"tomadzen","email":"tomas@adzen.ai"}],"dist":{"shasum":"429e7fcbfd2d30d93163367766dae7bf4f43dc95","tarball":"https://registry.npmjs.org/@adzenai/ai/-/ai-1.2.4.tgz","fileCount":20,"integrity":"sha512-M7+Lw4S2fSBW6vBPM/4WuqWmkh0NpNPLNshqR6z4wGbf5qk0zAsKkVrCxJoKVJgqUj+9Ar1a8Dxg1gCyrUAKEQ==","signatures":[{"sig":"MEQCIAiHXEeZVtnKUas0LHuESJ0kxbZPaIdmylUvcdFM4AjaAiBx5XHjYXL/eemMIXwS01YwXY/oGzFV+1M02ZoRSyUHxw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQCM72X0oy0tFqc8IcL5Mqi2yFJQlhFjQnqzHonXXVAXxgIhAIg6lL0ffW46cu5R0kslEDAiW/vPVQnj4FnZzXg/4GTF","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":249820},"main":"./dist/index.cjs","type":"module","_from":"file:adzenai-ai-1.2.4.tgz","types":"./dist/index.d.ts","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"}},"./copilotkit":{"import":{"types":"./dist/copilotkit/index.d.ts","default":"./dist/copilotkit/index.js"},"require":{"types":"./dist/copilotkit/index.d.cts","default":"./dist/copilotkit/index.cjs"}},"./copilotkit/react":{"import":{"types":"./dist/copilotkit/react/index.d.ts","default":"./dist/copilotkit/react/index.js"},"require":{"types":"./dist/copilotkit/react/index.d.cts","default":"./dist/copilotkit/react/index.cjs"}}},"scripts":{"demo":"vite --config src/copilotkit/demo/vite.config.ts","test":"vitest run","build":"tsup","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"matesv","email":"mate@adzen.ai"},"_resolved":"/private/var/folders/9h/mjdx7xl537n7nt5j7q1y4n3w0000gn/T/8f95beb4c7909e59da1522ae1d6dfe80/adzenai-ai-1.2.4.tgz","_integrity":"sha512-M7+Lw4S2fSBW6vBPM/4WuqWmkh0NpNPLNshqR6z4wGbf5qk0zAsKkVrCxJoKVJgqUj+9Ar1a8Dxg1gCyrUAKEQ==","_npmVersion":"11.6.0","description":"AI-powered ad integration for CopilotKit and AG-UI agents","directories":{},"_nodeVersion":"24.8.0","dependencies":{"@adzenai/core":"1.2.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","vite":"^6.0.0","jsdom":"^29.1.1","react":"^18.3.0","vitest":"^2.1.0","react-dom":"^18.3.0","typescript":"^5.5.0","@types/node":"^26.1.2","@types/react":"^18.3.0","react-markdown":"^10.1.0","@types/react-dom":"^18.3.0","@vitejs/plugin-react":"^4.3.0"},"peerDependencies":{"rxjs":">=7","react":">=18","@ag-ui/core":"*","@ag-ui/client":"*"},"peerDependenciesMeta":{"rxjs":{"optional":true},"react":{"optional":true},"@ag-ui/core":{"optional":true},"@ag-ui/client":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ai_1.2.4_1788458338004_0.444990105895402","host":"s3://npm-registry-packages-npm-production"}},"1.2.5":{"name":"@adzenai/ai","version":"1.2.5","license":"MIT","_id":"@adzenai/ai@1.2.5","maintainers":[{"name":"matesv","email":"mate@adzen.ai"},{"name":"adzen-engineering","email":"engineering@adzen.ai"},{"name":"tomadzen","email":"tomas@adzen.ai"}],"dist":{"shasum":"186b2bb9b828e74e338e1882d3bde4fd13b0eb95","tarball":"https://registry.npmjs.org/@adzenai/ai/-/ai-1.2.5.tgz","fileCount":20,"integrity":"sha512-OJIdtFmotqNpwIrDmDhmNb5mMuHCliyPkvEBEz0Q3feoFiZcI1qdAnFz0Kjs2VcoXMljZRdzQ+lANw3cDEi0vg==","signatures":[{"sig":"MEUCIQC1/7PDulPtthCzSScNx2YI5K4ELCrixl2o+iIfHVQUkgIgCwD0mBRYXlz7B9EohZtHp70bIH5UWFj9ktZOfq0GunM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIB/OBw8+VV2Evf+sPBjLakMZZEzLSNc2ZgjNvTiFecMJAiEAhd99eII3QAV+cNtMJMj2UhXTOljpiDmOrvqD9B8mmpM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":254567},"main":"./dist/index.cjs","type":"module","_from":"file:adzenai-ai-1.2.5.tgz","types":"./dist/index.d.ts","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"}},"./copilotkit":{"import":{"types":"./dist/copilotkit/index.d.ts","default":"./dist/copilotkit/index.js"},"require":{"types":"./dist/copilotkit/index.d.cts","default":"./dist/copilotkit/index.cjs"}},"./copilotkit/react":{"import":{"types":"./dist/copilotkit/react/index.d.ts","default":"./dist/copilotkit/react/index.js"},"require":{"types":"./dist/copilotkit/react/index.d.cts","default":"./dist/copilotkit/react/index.cjs"}}},"scripts":{"demo":"vite --config src/copilotkit/demo/vite.config.ts","test":"vitest run","build":"tsup","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"matesv","email":"mate@adzen.ai"},"_resolved":"/private/var/folders/9h/mjdx7xl537n7nt5j7q1y4n3w0000gn/T/feb67609aa4b8ab01c1520ac13ae84e0/adzenai-ai-1.2.5.tgz","_integrity":"sha512-OJIdtFmotqNpwIrDmDhmNb5mMuHCliyPkvEBEz0Q3feoFiZcI1qdAnFz0Kjs2VcoXMljZRdzQ+lANw3cDEi0vg==","_npmVersion":"11.6.0","description":"AI-powered ad integration for CopilotKit and AG-UI agents","directories":{},"_nodeVersion":"24.8.0","dependencies":{"@adzenai/core":"1.2.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","vite":"^6.0.0","jsdom":"^29.1.1","react":"^18.3.0","vitest":"^2.1.0","react-dom":"^18.3.0","typescript":"^5.5.0","@types/node":"^26.1.2","@types/react":"^18.3.0","react-markdown":"^10.1.0","@types/react-dom":"^18.3.0","@vitejs/plugin-react":"^4.3.0"},"peerDependencies":{"rxjs":">=7","react":">=18","@ag-ui/core":"*","@ag-ui/client":"*"},"peerDependenciesMeta":{"rxjs":{"optional":true},"react":{"optional":true},"@ag-ui/core":{"optional":true},"@ag-ui/client":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ai_1.2.5_1788466525341_0.8412871664950234","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"_id":"@adzenai/ai@1.3.0","dist":{"shasum":"27349f175fbec2be98d0c8ea80e61d1fa5f4ad08","tarball":"https://registry.npmjs.org/@adzenai/ai/-/ai-1.3.0.tgz","fileCount":26,"integrity":"sha512-wAgbY3JqpYOiRySq0sFn7nKG6DwGcB4E+6XwAXwWleUn0JPEJ0tOyiLyqSJH0BUb0KpOtZ/qTv6m3W3wCZ8KyA==","signatures":[{"sig":"MEQCIFv27upPQUDRzahGE+t3yaW1uNpeROHavHvcD40l26y6AiBmMr8JG+/3PPHWgsttQyTQVcC5wiHPO6SYHaaIPjN1Fw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC9WLWdbj2nm8pn4LyuT3blo7aql2n4L53voKjRYVh8BwIhAJcqlaqpKjHjUe1a1KLgpviAH8mJeVrnUd3H7e13bMw+"}],"unpackedSize":378575},"main":"./dist/index.cjs","name":"@adzenai/ai","type":"module","_from":"file:adzenai-ai-1.3.0.tgz","types":"./dist/index.d.ts","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"}},"./react":{"import":{"types":"./dist/react/index.d.ts","default":"./dist/react/index.js"},"require":{"types":"./dist/react/index.d.cts","default":"./dist/react/index.cjs"}},"./copilotkit":{"import":{"types":"./dist/copilotkit/index.d.ts","default":"./dist/copilotkit/index.js"},"require":{"types":"./dist/copilotkit/index.d.cts","default":"./dist/copilotkit/index.cjs"}},"./copilotkit/react":{"import":{"types":"./dist/copilotkit/react/index.d.ts","default":"./dist/copilotkit/react/index.js"},"require":{"types":"./dist/copilotkit/react/index.d.cts","default":"./dist/copilotkit/react/index.cjs"}}},"license":"MIT","scripts":{"demo":"vite --config src/copilotkit/demo/vite.config.ts","test":"vitest run","build":"tsup","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"version":"1.3.0","_npmUser":{"name":"matesv","email":"mate@adzen.ai"},"_resolved":"/private/var/folders/9h/mjdx7xl537n7nt5j7q1y4n3w0000gn/T/62d2d11284d4fda45a5b98eebd4675c9/adzenai-ai-1.3.0.tgz","_integrity":"sha512-wAgbY3JqpYOiRySq0sFn7nKG6DwGcB4E+6XwAXwWleUn0JPEJ0tOyiLyqSJH0BUb0KpOtZ/qTv6m3W3wCZ8KyA==","_npmVersion":"11.6.0","description":"AI-powered ad integration for CopilotKit and AG-UI agents","directories":{},"maintainers":[{"name":"matesv","email":"mate@adzen.ai"},{"name":"adzen-engineering","email":"engineering@adzen.ai"},{"name":"tomadzen","email":"tomas@adzen.ai"}],"sideEffects":false,"_nodeVersion":"24.8.0","dependencies":{"@adzenai/core":"1.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","vite":"^6.0.0","jsdom":"^29.1.1","react":"^18.3.0","vitest":"^2.1.0","react-dom":"^18.3.0","typescript":"^5.5.0","@types/node":"^26.1.2","@types/react":"^18.3.0","react-markdown":"^10.1.0","@types/react-dom":"^18.3.0","@vitejs/plugin-react":"^4.3.0"},"peerDependencies":{"rxjs":">=7","react":">=18","@ag-ui/core":"*","@ag-ui/client":"*"},"peerDependenciesMeta":{"rxjs":{"optional":true},"react":{"optional":true},"@ag-ui/core":{"optional":true},"@ag-ui/client":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ai_1.3.0_1790022273658_0.6700245553531992"}}},"time":{"created":"2026-07-06T21:50:46.877Z","modified":"2026-09-21T20:24:33.986Z","0.0.1":"2026-07-06T21:50:47.225Z","1.0.0":"2026-07-07T17:45:56.975Z","1.1.0":"2026-07-09T23:10:38.585Z","1.1.1":"2026-07-14T15:38:08.074Z","1.2.0":"2026-08-11T21:07:10.825Z","1.2.1":"2026-08-11T21:42:24.845Z","1.2.2":"2026-09-02T21:58:24.999Z","1.2.3":"2026-09-02T22:06:42.436Z","1.2.4":"2026-09-03T17:58:58.091Z","1.2.5":"2026-09-03T20:15:25.450Z","1.3.0":"2026-09-21T20:24:33.785Z"},"license":"MIT","description":"AI-powered ad integration for CopilotKit and AG-UI agents","maintainers":[{"name":"matesv","email":"mate@adzen.ai"},{"name":"adzen-engineering","email":"engineering@adzen.ai"},{"name":"tomadzen","email":"tomas@adzen.ai"}],"readme":"# @adzenai/ai\n\nAI-powered ad integration for React and Next.js apps. Delivers contextual sponsored placements alongside AI responses without modifying or delaying the content. Works in any React/Next codebase out of the box; ships an optional CopilotKit / AG-UI adapter for streaming agents.\n\n## Install\n\n```bash\nnpm install @adzenai/ai @adzenai/core\n```\n\n## Prerequisites\n\nYou need an Adzen API key. Contact [Adzen](https://adzen.ai) to set up a publisher account and obtain your key. React `>=18` is required for the `@adzenai/ai/react` components.\n\n## Quick Start (React / Next.js)\n\nThe generic flow is two steps: **fetch** a placement on the server (so your API key never reaches the browser), then **render** it on the client.\n\n### 1. Fetch an ad on the server\n\nCall `fetchAdzenAd` from a route handler, server action, or any server code. It returns an `AdzenPlacement` (or `null` when there's no match — never throws):\n\n```typescript\n// app/api/ad/route.ts (Next.js App Router)\nimport { fetchAdzenAd } from \"@adzenai/ai\";\n\nexport async function POST(req: Request) {\n  const { content } = await req.json();\n  const placement = await fetchAdzenAd({\n    apiKey: process.env.ADZEN_API_KEY!, // stays server-side\n    content,                            // the text to match an ad against\n    messageId: crypto.randomUUID(),\n    location: process.env.ADZEN_LOCATION, // optional geo-targeting\n  });\n  return Response.json({ placement });\n}\n```\n\n### 2a. Render with the built-in card\n\n```tsx\nimport { AdzenCard } from \"@adzenai/ai/react\";\n\n// `placement` is the object returned by fetchAdzenAd (fetched via your route)\n<AdzenCard ad={placement} />\n```\n\n`AdzenCard` returns `null` when `ad` is `null`, so it's safe to render unconditionally. It fires render and view impression beacons for you.\n\n### 2b. Render your own markup (headless)\n\nBring your own layout and let the SDK handle impressions. `useAdImpressions` gives you a `ref` to attach to your ad element; it fires the render beacon on mount and the view beacon once the element has been visible long enough:\n\n```tsx\n\"use client\";\nimport { useAdImpressions } from \"@adzenai/ai/react\";\n\nfunction MyAd({ placement }) {\n  const { ref } = useAdImpressions(placement);\n  if (!placement) return null;\n  return (\n    <aside ref={ref} className=\"my-ad\">\n      <span>Sponsored · {placement.advertiser_name}</span>\n      <a href={placement.destination_url}>{placement.headline} — {placement.cta_text}</a>\n    </aside>\n  );\n}\n```\n\n> **Keep the API key server-side.** `fetchAdzenAd` sends the key as `X-API-Key`; call it from server code and pass only the returned `AdzenPlacement` to the client. Calling it from the browser would ship your key in the bundle.\n\n## Quick Start (CopilotKit / AG-UI streaming)\n\nFor AG-UI agents, the middleware buffers assistant text and appends `adzen_placement` events to the stream (`AdzenStreamMiddleware` adds in-message inline ads). Import components from `@adzenai/ai/copilotkit/react`:\n\n```typescript\nimport { AdzenAsyncMiddleware } from \"@adzenai/ai/copilotkit\";\n\nconst adzen = new AdzenAsyncMiddleware({\n  apiKey: process.env.ADZEN_API_KEY!,\n  location: process.env.ADZEN_LOCATION,\n});\n\nfor await (const event of agentEventStream) {\n  const downstream = await adzen.processEvent(event);\n  for (const evt of downstream) emitToClient(evt);\n}\n```\n\n```tsx\nimport { AdzenCard, dispatchPlacementEvents } from \"@adzenai/ai/copilotkit/react\";\n\ndispatchPlacementEvents(events);   // bridge AG-UI events to the browser\n<AdzenCard messageId={msg.id} />   // look the ad up by message id\n```\n\n## Exports\n\n\n| Path                           | Environment                                   | Provides                                                                                                                |\n| ------------------------------ | --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |\n| `@adzenai/ai`                  | Any (server-safe)                             | `fetchAdzenAd`, `mapResponseToPlacement`, `generateIdempotencyKey`, `FetchAdzenAdOptions`, plus core type re-exports (`AdzenPlacement`, `ProcessResponse`, `ProcessResponseAd`, `AdzenBaseConfig`, and the streaming types `InlineAdEvent`, `InlineAdEventPayload`, `InlineAdCreative`, `AdAnchorEvent`, `PlacementRecord`, `PlacementsResponse`, `AdzenStream*Event`) |\n| `@adzenai/ai/react`            | Browser (React 18+)                           | `AdzenCard`, `InlineAd`, `useAdImpressions`, `useAdzenPlacement`, `useAdzenInlineAds`, `buildInlineAdSegments` — the generic React/Next entry (`\"use client\"`), no CopilotKit/AG-UI |\n| `@adzenai/ai/copilotkit`       | Async: server or client. Stream: server only. | `AdzenAsyncMiddleware`, `AdzenAsyncConfig`, `AdzenStreamMiddleware`, `AdzenStreamMiddlewareConfig`, `AdzenStreamConfig`                                |\n| `@adzenai/ai/copilotkit/react` | Browser (React 18+)                           | Everything from `@adzenai/ai/react` **plus** the AG-UI bridge helpers `dispatchPlacementEvent`, `dispatchInlineAdEvent`, `dispatchPlacementEvents` |\n\n\n\n\n## How It Works\n\n1. `AdzenAsyncMiddleware` buffers assistant text from AG-UI events.\n2. On message completion, it calls the Adzen `/process` API to match a contextual ad.\n3. If matched, an `adzen_placement` custom event is appended to the downstream stream.\n4. `dispatchPlacementEvents()` bridges these to browser `CustomEvent`s.\n5. `AdzenCard` picks up the placement and renders it with automatic impression tracking.\n\nImpression beacons are fired as client-side GET requests directly to the delivery API — no server-side proxy needed.\n\nThe middleware is **additive only** — it never modifies, blocks, or delays the original event stream. All failures degrade silently.\n\n## Streaming Enrichment\n\n`AdzenStreamMiddleware` proxies the LLM response stream through Adzen's `/stream` endpoint for in-message ads, instead of waiting for the completed message. Tee the upstream response so one branch feeds AG-UI parsing and the other is piped to Adzen:\n\n```typescript\nconst [parseBranch, proxyBranch] = res.body!.tee();\n\nfor await (const evt of adzen.processStream(parseIntoAgUiEvents(parseBranch), {\n  prompt,\n  upstreamBody: proxyBranch,\n})) {\n  sendToClient(evt);\n}\n```\n\n**Server-side only (Node 18+).** It passes a `ReadableStream` as the fetch request body; browsers other than Chromium do not support this and coerce the stream to the string `\"[object ReadableStream]\"`. The SDK feature-detects and emits an `adzen_error` rather than sending a corrupted body.\n\n### Rendering inline ads\n\nInline ads carry a `content_offset` — the number of message characters streamed before the ad arrived — so they render at that point in the text rather than at the end of the message. `getInlineAdSegments()` does the splitting:\n\n```tsx\nconst { getInlineAdSegments } = useAdzenInlineAds();\n\n<div style={{ whiteSpace: \"pre-wrap\" }}>\n  {getInlineAdSegments(msg.id, msg.content).map((segment, i) =>\n    segment.kind === \"text\" ? (\n      <span key={i}>{segment.text}</span>\n    ) : (\n      <InlineAd key={segment.ad.ad_id} ad={segment.ad} />\n    ),\n  )}\n</div>\n```\n\n`InlineAd` renders as a plain text snippet — an \"Ad\" pill, the advertiser name, and the CTA as the only link (`[AD] Brooks Brothers clothing sale`) — and is block-level, so it appears on its own line directly below the text it follows. The advertiser text uses `creative.advertiser_name`, falling back to `creative.headline`.\n\nAnchors are snapped forward to the next paragraph break, so segments are always whole paragraphs and each one can be passed to a Markdown renderer (`<Markdown>{segment.text}</Markdown>`) without a split breaking `**bold text**`, a list, or a code fence.\n\nAt most one ad is placed per paragraph break. Ads that would land on an already-used break move to the next free one (the end of the message counts as a slot), and any that still have nowhere to go are held back until the message grows, rather than stacking in one spot.\n\nInline ads are deduped by placement instance — the `(ad_id, paragraph_index)` pair — not by `ad_id` alone, so a creative served more than once in a response (spaced repeats) renders each showing rather than just the first. `paragraph_index` is the identity key while `content_offset` stays the position anchor; servers that omit `paragraph_index` fall back to `0` and keep the previous single-render behavior.\n\nIn `sdk` mode the backend stamps an absolute `content_offset` on the `adzen_inline` event (and on `adzen_ad_anchor`): the exact UTF-16 index in the assistant text where the ad belongs. The middleware uses it verbatim, so placement is deterministic regardless of stream timing — the ad lands at the paragraph boundary rather than under the next section's title, even though it arrives after the cursor has moved on. Offsets are resolved in priority order: the ad's own `content_offset`, then the `adzen_ad_anchor` (`AdAnchorEvent`) reservation for its paragraph, then the live cursor — so older servers that omit the field keep working.\n\n## Configuration\n\n```typescript\nnew AdzenAsyncMiddleware({\n  apiKey: string;           // required — Adzen API key\n  endpointUrl?: string;     // default: \"https://api.adzen.ai/v1/ai\"\n  timeoutMs?: number;       // default: 3000\n  adUnitPosition?: string;  // default: \"chin\"\n  location?: string;        // optional — DMA location code for geo-targeting\n  conversationId?: string;  // optional — links impressions to conversation context\n  profileId?: string;       // optional — sent as X-Profile-Id where APIM does not inject it\n});\n```\n\n`endpointUrl` is a base URL; the SDK appends `/process` and `/stream`. The default (`https://api.adzen.ai/v1/ai`) targets the hosted Adzen API, whose AI endpoints live under the `/ai` path prefix. Override it only to point at a different environment — e.g. a local API server without that prefix (`http://localhost:8080/v1`).\n\n`AdzenStreamMiddleware` accepts the same options plus `prefetch` (POST `/process` with the prompt before opening the stream), `placementPollIntervalMs`, `sidecar`, and the `onInlineAd` / `onPlacement` / `onError` / `onStreamStart` / `onStreamEnd` callbacks.\n\n\n\nThe middleware never makes the assistant message wait on the ad pipeline: the prefetch is dispatched without being awaited, and content events are forwarded as they arrive whether or not an ad has been matched yet.\n\n## Publish to NPM\n\nThe following commands needs to run both in /ai and /core package folders. Run `core` first, then `ai` for the updated `core` versions to propagate.\n\n```bash\npnpm build\n```\n\n```bash\nnpm version 1.2.2 --no-git-tag-version\n```\n\n```bash\npnpm publish --access public --no-git-checks\n```\n\n\n\n## License\n\nMIT","readmeFilename":"README.md"}