{"_id":"@desplega.ai/business-use","_rev":"10-4ff5f340f2424ac244355e0fbc4689f2","name":"@desplega.ai/business-use","dist-tags":{"latest":"0.4.3"},"versions":{"0.1.2":{"name":"@desplega.ai/business-use","version":"0.1.2","keywords":["workflow","automation","testing","event-driven","observability","typescript","business-logic"],"author":{"name":"Desplega AI","email":"contact@desplega.ai"},"license":"MIT","_id":"@desplega.ai/business-use@0.1.2","maintainers":[{"name":"tarasyarema","email":"tarasyarema@pm.me"},{"name":"3z3","email":"ezequiel.cura@gmail.com"}],"homepage":"https://github.com/desplega-ai/business-use#readme","bugs":{"url":"https://github.com/desplega-ai/business-use/issues"},"dist":{"shasum":"30c6214cd4e8abf7f3c9a673d00ccadea05dda44","tarball":"https://registry.npmjs.org/@desplega.ai/business-use/-/business-use-0.1.2.tgz","fileCount":6,"integrity":"sha512-PFrgaizrSx9ACMscqL5C07EwJCkHZ1uP4wXzACmPou/cRfxorDsMBu7uW4sLwerPdXmEkSDJLgRUU9UFP7DbGw==","signatures":[{"sig":"MEQCID8tf7S5PdYyf+Y6x85Jl/LRqmWM2TKO1n7HWZMlX3JnAiBRoZ08sgjoTAQmVSZT3o9YnqCcEA5LxdegFlLeNUw7UA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":62304},"main":"./dist/index.cjs","type":"module","_from":"file:desplega.ai-business-use-0.1.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","lint":"eslint src/**/*.ts","test":"vitest","build":"tsup src/index.ts --format cjs,esm --dts --clean","format":"prettier --write \"src/**/*.{ts,tsx,json,md}\"","example":"tsx example.ts","test:ui":"vitest --ui","lint:fix":"eslint src/**/*.ts --fix","test:run":"vitest run","typecheck":"tsc --noEmit","format:check":"prettier --check \"src/**/*.{ts,tsx,json,md}\""},"_npmUser":{"name":"tarasyarema","email":"tarasyarema@pm.me"},"_resolved":"/tmp/0a71a4d9d13fae1bd6927f1d527fd17c/desplega.ai-business-use-0.1.2.tgz","_integrity":"sha512-PFrgaizrSx9ACMscqL5C07EwJCkHZ1uP4wXzACmPou/cRfxorDsMBu7uW4sLwerPdXmEkSDJLgRUU9UFP7DbGw==","repository":{"url":"git+https://github.com/desplega-ai/business-use.git","type":"git"},"_npmVersion":"10.8.2","description":"Lightweight JavaScript/TypeScript SDK for Business-Use event tracking and assertions","directories":{},"_nodeVersion":"20.19.5","dependencies":{"zod":"^3.24.1"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.3.5","eslint":"^9.0.0","vitest":"^2.1.8","prettier":"^3.0.0","@eslint/js":"^9.38.0","@vitest/ui":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.2","eslint-config-prettier":"^10.1.8","@typescript-eslint/parser":"^8.0.0","@typescript-eslint/eslint-plugin":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/business-use_0.1.2_1761075625419_0.11299028315145754","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@desplega.ai/business-use","version":"0.1.3","keywords":["workflow","automation","testing","event-driven","observability","typescript","business-logic"],"author":{"name":"Desplega AI","email":"contact@desplega.ai"},"license":"MIT","_id":"@desplega.ai/business-use@0.1.3","maintainers":[{"name":"tarasyarema","email":"tarasyarema@pm.me"},{"name":"3z3","email":"ezequiel.cura@gmail.com"}],"homepage":"https://github.com/desplega-ai/business-use#readme","bugs":{"url":"https://github.com/desplega-ai/business-use/issues"},"dist":{"shasum":"4beccd0c51e64cc7b5e06c1fd9f83092da53023f","tarball":"https://registry.npmjs.org/@desplega.ai/business-use/-/business-use-0.1.3.tgz","fileCount":6,"integrity":"sha512-FT6KYKDuftg2yLpK/BgBqZUbYOt6hcUV4ujOOESWtjXxPIZ+3lYjO118/2uOslbMLLl6pXdSxo08Vxhgad1YUg==","signatures":[{"sig":"MEYCIQDst/xOYixoEyMrSXxnvAA69SHkig523r2nFNM7eF+QUgIhAIHT9mwUMUT/OtremB/VMErHqUOAvvGeyyYaP9kwIjvp","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":62304},"main":"./dist/index.cjs","type":"module","_from":"file:desplega.ai-business-use-0.1.3.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","lint":"eslint src/**/*.ts","test":"vitest","build":"tsup src/index.ts --format cjs,esm --dts --clean","format":"prettier --write \"src/**/*.{ts,tsx,json,md}\"","example":"tsx example.ts","test:ui":"vitest --ui","lint:fix":"eslint src/**/*.ts --fix","test:run":"vitest run","typecheck":"tsc --noEmit","format:check":"prettier --check \"src/**/*.{ts,tsx,json,md}\""},"_npmUser":{"name":"tarasyarema","email":"tarasyarema@pm.me"},"_resolved":"/tmp/61472d88e9619c83c4c0b6d7826ca5b8/desplega.ai-business-use-0.1.3.tgz","_integrity":"sha512-FT6KYKDuftg2yLpK/BgBqZUbYOt6hcUV4ujOOESWtjXxPIZ+3lYjO118/2uOslbMLLl6pXdSxo08Vxhgad1YUg==","repository":{"url":"git+https://github.com/desplega-ai/business-use.git","type":"git"},"_npmVersion":"10.8.2","description":"Lightweight JavaScript/TypeScript SDK for Business-Use event tracking and assertions","directories":{},"_nodeVersion":"20.19.5","dependencies":{"zod":"^3.24.1"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.3.5","eslint":"^9.0.0","vitest":"^2.1.8","prettier":"^3.0.0","@eslint/js":"^9.38.0","@vitest/ui":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.2","eslint-config-prettier":"^10.1.8","@typescript-eslint/parser":"^8.0.0","@typescript-eslint/eslint-plugin":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/business-use_0.1.3_1761075863383_0.3362403154173199","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@desplega.ai/business-use","version":"0.2.0","keywords":["workflow","automation","testing","event-driven","observability","typescript","business-logic"],"author":{"name":"Desplega AI","email":"contact@desplega.ai"},"license":"MIT","_id":"@desplega.ai/business-use@0.2.0","maintainers":[{"name":"tarasyarema","email":"tarasyarema@pm.me"},{"name":"3z3","email":"ezequiel.cura@gmail.com"}],"homepage":"https://github.com/desplega-ai/business-use#readme","bugs":{"url":"https://github.com/desplega-ai/business-use/issues"},"dist":{"shasum":"41437609453664b1ce8eba781aa466d635328543","tarball":"https://registry.npmjs.org/@desplega.ai/business-use/-/business-use-0.2.0.tgz","fileCount":6,"integrity":"sha512-f04N7pUXOtySz8r1aZrxsYm/e8ztYbFm59KBl2rNAOWFuc59UAzIpXYRrUohGw/8NEzcOUSGdwexVK4daXqS2w==","signatures":[{"sig":"MEYCIQCUBQ/vnw/vxDxidQkaCO4fj7BM6ToWAY8JkckiKqt09gIhAIVil5YMexiYocVdGzqwAhenQb9xbya9Ssoni79uwnq6","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":70111},"main":"./dist/index.cjs","type":"module","_from":"file:desplega.ai-business-use-0.2.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","lint":"eslint src/**/*.ts","test":"vitest","build":"tsup src/index.ts --format cjs,esm --dts --clean","format":"prettier --write \"src/**/*.{ts,tsx,json,md}\"","example":"tsx example.ts","test:ui":"vitest --ui","lint:fix":"eslint src/**/*.ts --fix","test:run":"vitest run","typecheck":"tsc --noEmit","format:check":"prettier --check \"src/**/*.{ts,tsx,json,md}\""},"_npmUser":{"name":"tarasyarema","email":"tarasyarema@pm.me"},"_resolved":"/tmp/9d6828731a1d166c278020984a4b837d/desplega.ai-business-use-0.2.0.tgz","_integrity":"sha512-f04N7pUXOtySz8r1aZrxsYm/e8ztYbFm59KBl2rNAOWFuc59UAzIpXYRrUohGw/8NEzcOUSGdwexVK4daXqS2w==","repository":{"url":"git+https://github.com/desplega-ai/business-use.git","type":"git"},"_npmVersion":"10.8.2","description":"Lightweight JavaScript/TypeScript SDK for Business-Use event tracking and assertions","directories":{},"_nodeVersion":"20.19.5","dependencies":{"zod":"^3.24.1"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.3.5","eslint":"^9.0.0","vitest":"^2.1.8","prettier":"^3.0.0","@eslint/js":"^9.38.0","@vitest/ui":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.2","eslint-config-prettier":"^10.1.8","@typescript-eslint/parser":"^8.0.0","@typescript-eslint/eslint-plugin":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/business-use_0.2.0_1761144343221_0.41049339943090657","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@desplega.ai/business-use","version":"0.3.1","keywords":["workflow","automation","testing","event-driven","observability","typescript","business-logic"],"author":{"name":"Desplega AI","email":"contact@desplega.ai"},"license":"MIT","_id":"@desplega.ai/business-use@0.3.1","maintainers":[{"name":"tarasyarema","email":"tarasyarema@pm.me"},{"name":"3z3","email":"ezequiel.cura@gmail.com"}],"homepage":"https://github.com/desplega-ai/business-use#readme","bugs":{"url":"https://github.com/desplega-ai/business-use/issues"},"dist":{"shasum":"24b6d061d5edc77706128f1e9653d4f8b4516bc1","tarball":"https://registry.npmjs.org/@desplega.ai/business-use/-/business-use-0.3.1.tgz","fileCount":6,"integrity":"sha512-8FzI5QM13hfTNgI7o/quzxQbdUDizlgqZdAA9B5HBn7QhWdiPKD0D1ACdnxg7tbMyDd3OcXgamUhyR4OELopkQ==","signatures":[{"sig":"MEUCIQD3K6Kuhin3/7BUfiAlEvS7l74O+BkHw2WLqZtjv9/4YgIgV+umcBHZe37gf54Ra/KywWVcKpea+8alHsaJ1Ty0zRQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":70111},"main":"./dist/index.cjs","type":"module","_from":"file:desplega.ai-business-use-0.3.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","lint":"eslint src/**/*.ts","test":"vitest","build":"tsup src/index.ts --format cjs,esm --dts --clean","format":"prettier --write \"src/**/*.{ts,tsx,json,md}\"","example":"tsx example.ts","test:ui":"vitest --ui","lint:fix":"eslint src/**/*.ts --fix","test:run":"vitest run","typecheck":"tsc --noEmit","format:check":"prettier --check \"src/**/*.{ts,tsx,json,md}\""},"_npmUser":{"name":"tarasyarema","email":"tarasyarema@pm.me"},"_resolved":"/tmp/5b78e142c541fc1859749688c61b83cf/desplega.ai-business-use-0.3.1.tgz","_integrity":"sha512-8FzI5QM13hfTNgI7o/quzxQbdUDizlgqZdAA9B5HBn7QhWdiPKD0D1ACdnxg7tbMyDd3OcXgamUhyR4OELopkQ==","repository":{"url":"git+https://github.com/desplega-ai/business-use.git","type":"git"},"_npmVersion":"10.8.2","description":"Lightweight JavaScript/TypeScript SDK for Business-Use event tracking and assertions","directories":{},"_nodeVersion":"20.19.5","dependencies":{"zod":"^3.24.1"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.3.5","eslint":"^9.0.0","vitest":"^2.1.8","prettier":"^3.0.0","@eslint/js":"^9.38.0","@vitest/ui":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.2","eslint-config-prettier":"^10.1.8","@typescript-eslint/parser":"^8.0.0","@typescript-eslint/eslint-plugin":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/business-use_0.3.1_1761176068264_0.8799766452837696","host":"s3://npm-registry-packages-npm-production"}},"0.3.2":{"name":"@desplega.ai/business-use","version":"0.3.2","keywords":["workflow","automation","testing","event-driven","observability","typescript","business-logic"],"author":{"name":"Desplega AI","email":"contact@desplega.ai"},"license":"MIT","_id":"@desplega.ai/business-use@0.3.2","maintainers":[{"name":"tarasyarema","email":"tarasyarema@pm.me"},{"name":"3z3","email":"ezequiel.cura@gmail.com"}],"homepage":"https://github.com/desplega-ai/business-use#readme","bugs":{"url":"https://github.com/desplega-ai/business-use/issues"},"dist":{"shasum":"cb16dcbdb40d6c613568b2355dba2d63702cbbf6","tarball":"https://registry.npmjs.org/@desplega.ai/business-use/-/business-use-0.3.2.tgz","fileCount":6,"integrity":"sha512-0QRLY9evlC1HsoO88l3hLCSaWa4xMCIRe1CQd04B1MDFM0KOHFPvdsgVHrluKgu/HrNqzaV8zSiVOngGR7YHFA==","signatures":[{"sig":"MEUCIDhMd1Zjz3V7lTyR24rv8HT2YvxEB9nF/GUZgWCCHgT4AiEA42oEhw9haD/9mJzWr2Q3M2mJId6ymxGUsTIJXRCfiHc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":70111},"main":"./dist/index.cjs","type":"module","_from":"file:desplega.ai-business-use-0.3.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","lint":"eslint src/**/*.ts","test":"vitest","build":"tsup src/index.ts --format cjs,esm --dts --clean","format":"prettier --write \"src/**/*.{ts,tsx,json,md}\"","example":"tsx example.ts","test:ui":"vitest --ui","lint:fix":"eslint src/**/*.ts --fix","test:run":"vitest run","typecheck":"tsc --noEmit","format:check":"prettier --check \"src/**/*.{ts,tsx,json,md}\""},"_npmUser":{"name":"tarasyarema","email":"tarasyarema@pm.me"},"_resolved":"/tmp/be19c0d5333fb0832f982be04b96b37b/desplega.ai-business-use-0.3.2.tgz","_integrity":"sha512-0QRLY9evlC1HsoO88l3hLCSaWa4xMCIRe1CQd04B1MDFM0KOHFPvdsgVHrluKgu/HrNqzaV8zSiVOngGR7YHFA==","repository":{"url":"git+https://github.com/desplega-ai/business-use.git","type":"git"},"_npmVersion":"10.8.2","description":"Lightweight JavaScript/TypeScript SDK for Business-Use event tracking and assertions","directories":{},"_nodeVersion":"20.19.5","dependencies":{"zod":"^3.24.1"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.3.5","eslint":"^9.0.0","vitest":"^2.1.8","prettier":"^3.0.0","@eslint/js":"^9.38.0","@vitest/ui":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.2","eslint-config-prettier":"^10.1.8","@typescript-eslint/parser":"^8.0.0","@typescript-eslint/eslint-plugin":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/business-use_0.3.2_1761177396615_0.9450239638940274","host":"s3://npm-registry-packages-npm-production"}},"0.3.3":{"name":"@desplega.ai/business-use","version":"0.3.3","keywords":["workflow","automation","testing","event-driven","observability","typescript","business-logic"],"author":{"name":"Desplega AI","email":"contact@desplega.ai"},"license":"MIT","_id":"@desplega.ai/business-use@0.3.3","maintainers":[{"name":"tarasyarema","email":"tarasyarema@pm.me"},{"name":"3z3","email":"ezequiel.cura@gmail.com"}],"homepage":"https://github.com/desplega-ai/business-use#readme","bugs":{"url":"https://github.com/desplega-ai/business-use/issues"},"dist":{"shasum":"c32c0318127dbb4b3307d4be776bb2b48cb1c06d","tarball":"https://registry.npmjs.org/@desplega.ai/business-use/-/business-use-0.3.3.tgz","fileCount":6,"integrity":"sha512-/2tYvvlQ4zMuI2hTJY7c1WHe8l56I+ob6lVBxTkJoZ4F0sHyT2EhEIkx6e2LlKn+NKNbNuVG4e7GPhxCzTKX1w==","signatures":[{"sig":"MEUCIQDzGsLAgVJF7eQFXQeqvmuI1UUjiS8dk4CJw1jPNBnhYgIgXuPWj9AGhoUjbTIiCY5hg2gh0hKv0KR9EsNaCqJaq5w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":70111},"main":"./dist/index.cjs","type":"module","_from":"file:desplega.ai-business-use-0.3.3.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","lint":"eslint src/**/*.ts","test":"vitest","build":"tsup src/index.ts --format cjs,esm --dts --clean","format":"prettier --write \"src/**/*.{ts,tsx,json,md}\"","example":"tsx example.ts","test:ui":"vitest --ui","lint:fix":"eslint src/**/*.ts --fix","test:run":"vitest run","typecheck":"tsc --noEmit","format:check":"prettier --check \"src/**/*.{ts,tsx,json,md}\""},"_npmUser":{"name":"tarasyarema","email":"tarasyarema@pm.me"},"_resolved":"/tmp/79af69eda2ccfa3d9317a9dd93d6adc1/desplega.ai-business-use-0.3.3.tgz","_integrity":"sha512-/2tYvvlQ4zMuI2hTJY7c1WHe8l56I+ob6lVBxTkJoZ4F0sHyT2EhEIkx6e2LlKn+NKNbNuVG4e7GPhxCzTKX1w==","repository":{"url":"git+https://github.com/desplega-ai/business-use.git","type":"git"},"_npmVersion":"10.8.2","description":"Lightweight JavaScript/TypeScript SDK for Business-Use event tracking and assertions","directories":{},"_nodeVersion":"20.19.5","dependencies":{"zod":"^3.24.1"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.3.5","eslint":"^9.0.0","vitest":"^2.1.8","prettier":"^3.0.0","@eslint/js":"^9.38.0","@vitest/ui":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.2","eslint-config-prettier":"^10.1.8","@typescript-eslint/parser":"^8.0.0","@typescript-eslint/eslint-plugin":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/business-use_0.3.3_1761178124682_0.38875162443966604","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@desplega.ai/business-use","version":"0.4.0","keywords":["workflow","automation","testing","event-driven","observability","typescript","business-logic"],"author":{"name":"Desplega AI","email":"contact@desplega.ai"},"license":"MIT","_id":"@desplega.ai/business-use@0.4.0","maintainers":[{"name":"tarasyarema","email":"tarasyarema@pm.me"},{"name":"3z3","email":"ezequiel.cura@gmail.com"}],"homepage":"https://github.com/desplega-ai/business-use#readme","bugs":{"url":"https://github.com/desplega-ai/business-use/issues"},"dist":{"shasum":"74bc95d43b2fcbfc0c629f15a9b227181e3bb346","tarball":"https://registry.npmjs.org/@desplega.ai/business-use/-/business-use-0.4.0.tgz","fileCount":6,"integrity":"sha512-qgS6VB7f4/0JHw5Obf1apzJRL2gJUeZUuptWP2uJPcpYXwi3bHt8YuD4YJQN6qrSueNgz2xUTd3RneDnPXeRBQ==","signatures":[{"sig":"MEUCIGO2emL9K5BTuw2mgPjRxh5NGZSaJp4mb4j8FASn/4uHAiEAh4aSLrkhJ2aRsLEx8Q8Dv/lz46H6zbXlPx4GxmVDs18=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":72851},"main":"./dist/index.cjs","type":"module","_from":"file:desplega.ai-business-use-0.4.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","lint":"eslint src/**/*.ts","test":"vitest","build":"tsup src/index.ts --format cjs,esm --dts --clean","format":"prettier --write \"src/**/*.{ts,tsx,json,md}\"","example":"tsx example.ts","test:ui":"vitest --ui","lint:fix":"eslint src/**/*.ts --fix","test:run":"vitest run","typecheck":"tsc --noEmit","format:check":"prettier --check \"src/**/*.{ts,tsx,json,md}\""},"_npmUser":{"name":"tarasyarema","email":"tarasyarema@pm.me"},"_resolved":"/tmp/65e399ea546592e966392d3b55339b1e/desplega.ai-business-use-0.4.0.tgz","_integrity":"sha512-qgS6VB7f4/0JHw5Obf1apzJRL2gJUeZUuptWP2uJPcpYXwi3bHt8YuD4YJQN6qrSueNgz2xUTd3RneDnPXeRBQ==","repository":{"url":"git+https://github.com/desplega-ai/business-use.git","type":"git"},"_npmVersion":"10.8.2","description":"Lightweight JavaScript/TypeScript SDK for Business-Use event tracking and assertions","directories":{},"_nodeVersion":"20.19.5","dependencies":{"zod":"^3.24.1"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.3.5","eslint":"^9.0.0","vitest":"^2.1.8","prettier":"^3.0.0","@eslint/js":"^9.38.0","@vitest/ui":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.2","eslint-config-prettier":"^10.1.8","@typescript-eslint/parser":"^8.0.0","@typescript-eslint/eslint-plugin":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/business-use_0.4.0_1761226449611_0.9494545786889088","host":"s3://npm-registry-packages-npm-production"}},"0.4.1":{"name":"@desplega.ai/business-use","version":"0.4.1","keywords":["workflow","automation","testing","event-driven","observability","typescript","business-logic"],"author":{"name":"Desplega AI","email":"contact@desplega.ai"},"license":"MIT","_id":"@desplega.ai/business-use@0.4.1","maintainers":[{"name":"tarasyarema","email":"tarasyarema@pm.me"},{"name":"3z3","email":"ezequiel.cura@gmail.com"}],"homepage":"https://github.com/desplega-ai/business-use#readme","bugs":{"url":"https://github.com/desplega-ai/business-use/issues"},"dist":{"shasum":"0d3ece66a607060638c2348299601d7ba35c8582","tarball":"https://registry.npmjs.org/@desplega.ai/business-use/-/business-use-0.4.1.tgz","fileCount":6,"integrity":"sha512-c4rihVI45vDpDyi8ITNpkr4bWpmj5PE3ft2Ci7HleJNiD6QygkoAxlKU1TO5A2CcoG1Ly46a1+NU87TamH4leA==","signatures":[{"sig":"MEYCIQD8PEkNg/qIH+gdBEOrlmq61P1W1azqdikQEWVS3wgDaAIhAIHy5bYBAkVKklVeTKkWwEdR2hyxEFz6+RC4XhNZRh1C","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":72359},"main":"./dist/index.cjs","type":"module","_from":"file:desplega.ai-business-use-0.4.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","lint":"eslint src/**/*.ts","test":"vitest","build":"tsup src/index.ts --format cjs,esm --dts --clean","format":"prettier --write \"src/**/*.{ts,tsx,json,md}\"","example":"tsx example.ts","test:ui":"vitest --ui","lint:fix":"eslint src/**/*.ts --fix","test:run":"vitest run","typecheck":"tsc --noEmit","format:check":"prettier --check \"src/**/*.{ts,tsx,json,md}\""},"_npmUser":{"name":"tarasyarema","email":"tarasyarema@pm.me"},"_resolved":"/tmp/e0187cbe52080754987d61b55db573ef/desplega.ai-business-use-0.4.1.tgz","_integrity":"sha512-c4rihVI45vDpDyi8ITNpkr4bWpmj5PE3ft2Ci7HleJNiD6QygkoAxlKU1TO5A2CcoG1Ly46a1+NU87TamH4leA==","repository":{"url":"git+https://github.com/desplega-ai/business-use.git","type":"git"},"_npmVersion":"10.8.2","description":"Lightweight JavaScript/TypeScript SDK for Business-Use event tracking and assertions","directories":{},"_nodeVersion":"20.19.5","dependencies":{"zod":"^3.24.1"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.3.5","eslint":"^9.0.0","vitest":"^2.1.8","prettier":"^3.0.0","@eslint/js":"^9.38.0","@vitest/ui":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.2","eslint-config-prettier":"^10.1.8","@typescript-eslint/parser":"^8.0.0","@typescript-eslint/eslint-plugin":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/business-use_0.4.1_1761250349725_0.05192654135388075","host":"s3://npm-registry-packages-npm-production"}},"0.4.2":{"name":"@desplega.ai/business-use","version":"0.4.2","keywords":["workflow","automation","testing","event-driven","observability","typescript","business-logic"],"author":{"name":"Desplega AI","email":"contact@desplega.ai"},"license":"MIT","_id":"@desplega.ai/business-use@0.4.2","maintainers":[{"name":"tarasyarema","email":"tarasyarema@pm.me"},{"name":"3z3","email":"ezequiel.cura@gmail.com"}],"homepage":"https://github.com/desplega-ai/business-use#readme","bugs":{"url":"https://github.com/desplega-ai/business-use/issues"},"dist":{"shasum":"fc9c6ead44a7382e4756bfb0a5e784e4b83f0a3d","tarball":"https://registry.npmjs.org/@desplega.ai/business-use/-/business-use-0.4.2.tgz","fileCount":6,"integrity":"sha512-Rd/H/EzfKjylxaKwJulhoclfK9q0QFg8HjHrLrAVNY3YGlEaDzSFDR2uDjynDy+MLl7jxr/e+xzUNTR87tr0EA==","signatures":[{"sig":"MEUCIDhE+1krNXsnaLJ5SzAErHqauBf2IbLvRtEPiI4mj5DgAiEApBIyDjdQtmW5jE35O6Tc+Tjz/+0E0RKGHR0Q6aDOqCs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":72137},"main":"./dist/index.cjs","type":"module","_from":"file:desplega.ai-business-use-0.4.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","lint":"eslint src/**/*.ts","test":"vitest","build":"tsup src/index.ts --format cjs,esm --dts --clean","format":"prettier --write \"src/**/*.{ts,tsx,json,md}\"","example":"tsx example.ts","test:ui":"vitest --ui","lint:fix":"eslint src/**/*.ts --fix","test:run":"vitest run","typecheck":"tsc --noEmit","format:check":"prettier --check \"src/**/*.{ts,tsx,json,md}\""},"_npmUser":{"name":"tarasyarema","email":"tarasyarema@pm.me"},"_resolved":"/tmp/79cef10d4fbbec9a2a1679dd4a499429/desplega.ai-business-use-0.4.2.tgz","_integrity":"sha512-Rd/H/EzfKjylxaKwJulhoclfK9q0QFg8HjHrLrAVNY3YGlEaDzSFDR2uDjynDy+MLl7jxr/e+xzUNTR87tr0EA==","repository":{"url":"git+https://github.com/desplega-ai/business-use.git","type":"git"},"_npmVersion":"10.8.2","description":"Lightweight JavaScript/TypeScript SDK for Business-Use event tracking and assertions","directories":{},"_nodeVersion":"20.19.5","dependencies":{"zod":"^3.24.1"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.3.5","eslint":"^9.0.0","vitest":"^2.1.8","prettier":"^3.0.0","@eslint/js":"^9.38.0","@vitest/ui":"^2.1.8","typescript":"^5.7.2","@types/node":"^22.10.2","eslint-config-prettier":"^10.1.8","@typescript-eslint/parser":"^8.0.0","@typescript-eslint/eslint-plugin":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/business-use_0.4.2_1761319036119_0.7494247630174236","host":"s3://npm-registry-packages-npm-production"}},"0.4.3":{"name":"@desplega.ai/business-use","version":"0.4.3","description":"Lightweight JavaScript/TypeScript SDK for Business-Use event tracking and assertions","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"keywords":["workflow","automation","testing","event-driven","observability","typescript","business-logic"],"author":{"name":"Desplega AI","email":"contact@desplega.ai"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/desplega-ai/business-use.git"},"homepage":"https://github.com/desplega-ai/business-use#readme","bugs":{"url":"https://github.com/desplega-ai/business-use/issues"},"dependencies":{"zod":"^3.24.1"},"devDependencies":{"@eslint/js":"^9.38.0","@types/node":"^22.10.2","@typescript-eslint/eslint-plugin":"^8.0.0","@typescript-eslint/parser":"^8.0.0","@vitest/ui":"^2.1.8","eslint":"^9.0.0","eslint-config-prettier":"^10.1.8","prettier":"^3.0.0","tsup":"^8.3.5","tsx":"^4.19.2","typescript":"^5.7.2","vitest":"^2.1.8"},"engines":{"node":">=18.0.0"},"scripts":{"build":"tsup src/index.ts --format cjs,esm --dts --clean","dev":"tsup src/index.ts --format cjs,esm --dts --watch","test":"vitest","test:ui":"vitest --ui","test:run":"vitest run","example":"tsx example.ts","typecheck":"tsc --noEmit","lint":"eslint src/**/*.ts","lint:fix":"eslint src/**/*.ts --fix","format":"prettier --write \"src/**/*.{ts,tsx,json,md}\"","format:check":"prettier --check \"src/**/*.{ts,tsx,json,md}\""},"_id":"@desplega.ai/business-use@0.4.3","_integrity":"sha512-qAqV3vDI1VX5khn2Mi7bul+mqJf0RE5Gdus+41VI8SUOCeRIidnqXaNO/dCUAoPwZLN7Mx9zLTn/I3s/IDcToA==","_resolved":"/tmp/b5b2f39d6cbf59cd1ed46f1321ca8f0b/desplega.ai-business-use-0.4.3.tgz","_from":"file:desplega.ai-business-use-0.4.3.tgz","_nodeVersion":"20.20.1","_npmVersion":"10.8.2","dist":{"integrity":"sha512-qAqV3vDI1VX5khn2Mi7bul+mqJf0RE5Gdus+41VI8SUOCeRIidnqXaNO/dCUAoPwZLN7Mx9zLTn/I3s/IDcToA==","shasum":"8e226c094302a85b744cd723c1308b43529c277f","tarball":"https://registry.npmjs.org/@desplega.ai/business-use/-/business-use-0.4.3.tgz","fileCount":6,"unpackedSize":73253,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEiGO7sUP1DVrXuWyJ1wQkNdPuG2eaCGp2ovTmxtSTrUAiEA+fF6oOBG2c+pKxfD1ThdUUwOMQEwAz8SXBTZUgcvhec="}]},"_npmUser":{"name":"tarasyarema","email":"tarasyarema@pm.me"},"directories":{},"maintainers":[{"name":"tarasyarema","email":"tarasyarema@pm.me"},{"name":"3z3","email":"ezequiel.cura@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/business-use_0.4.3_1774557355414_0.814693494872557"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-21T19:40:25.285Z","modified":"2026-03-26T20:35:55.694Z","0.1.2":"2025-10-21T19:40:25.642Z","0.1.3":"2025-10-21T19:44:23.572Z","0.2.0":"2025-10-22T14:45:43.400Z","0.3.1":"2025-10-22T23:34:28.465Z","0.3.2":"2025-10-22T23:56:36.832Z","0.3.3":"2025-10-23T00:08:44.880Z","0.4.0":"2025-10-23T13:34:09.809Z","0.4.1":"2025-10-23T20:12:29.916Z","0.4.2":"2025-10-24T15:17:16.327Z","0.4.3":"2026-03-26T20:35:55.557Z"},"bugs":{"url":"https://github.com/desplega-ai/business-use/issues"},"author":{"name":"Desplega AI","email":"contact@desplega.ai"},"license":"MIT","homepage":"https://github.com/desplega-ai/business-use#readme","keywords":["workflow","automation","testing","event-driven","observability","typescript","business-logic"],"repository":{"type":"git","url":"git+https://github.com/desplega-ai/business-use.git"},"description":"Lightweight JavaScript/TypeScript SDK for Business-Use event tracking and assertions","maintainers":[{"name":"tarasyarema","email":"tarasyarema@pm.me"},{"name":"3z3","email":"ezequiel.cura@gmail.com"}],"readme":"# Business-Use JavaScript SDK\n\n[![Format & Lint Checks](https://github.com/desplega-ai/business-use/actions/workflows/check.yaml/badge.svg)](https://github.com/desplega-ai/business-use/actions/workflows/check.yaml)\n\nA lightweight JavaScript/TypeScript SDK for tracking business events and assertions in production applications.\n\n## Features\n\n- **Zero user-facing failures**: SDK errors never crash or block your code\n- **Minimal overhead**: Asynchronous batching prevents blocking I/O\n- **Simple API**: Main function `ensure()` with convenience helpers `act()` and `assert()`\n- **Type-safe**: Full TypeScript support with comprehensive type definitions\n- **Context-aware**: Filters and validators can access upstream dependency data\n- **Minimal dependencies**: Only Zod for schema validation\n\n## Installation\n\n```bash\n# Using pnpm\npnpm add @desplega.ai/business-use\n\n# Using npm\nnpm install @desplega.ai/business-use\n\n# Using yarn\nyarn add @desplega.ai/business-use\n```\n\n## Quick Start\n\n```typescript\nimport { initialize, ensure } from '@desplega.ai/business-use';\n\n// Initialize the SDK (call once at app startup)\ninitialize({ apiKey: 'your-api-key' });\n\n// Track a business action (no validator)\nensure({\n  id: 'payment_processed',\n  flow: 'checkout',\n  runId: 'run_12345',\n  data: { amount: 100, currency: 'USD' },\n  description: 'Payment processed successfully'\n});\n\n// Track a business assertion (with validator)\nfunction validateOrderTotal(data: Record<string, any>, ctx: { deps: Array<{ flow: string; id: string; data: Record<string, any> }> }): boolean {\n  // ctx.deps contains upstream dependency events\n  const hasCart = ctx.deps.some((dep) => dep.id === 'cart_created');\n  return data.total > 0 && hasCart;\n}\n\nensure({\n  id: 'order_total_valid',\n  flow: 'checkout',\n  runId: 'run_12345',\n  data: { total: 150 },\n  depIds: ['cart_created'],\n  validator: validateOrderTotal, // Creates \"assert\" node\n  description: 'Order total validation'\n});\n\n// Convenience wrappers (optional)\nimport { act, assert } from '@desplega.ai/business-use';\n\n// act() is ensure() without validator\nact({ id: 'user_signup', flow: 'onboarding', runId: 'u123', data: {...} });\n\n// assert() is ensure() with validator\nassert({ id: 'validation', flow: 'checkout', runId: 'o123', data: {...}, validator: fn });\n```\n\n## API Reference\n\n### `initialize(options?)`\n\nInitialize the Business-Use SDK. Must be called before using `ensure()`.\n\n**Options:**\n- `apiKey?: string` - API key for authentication (default: from `BUSINESS_USE_API_KEY` env var)\n- `url?: string` - Backend API URL (default: from `BUSINESS_USE_URL` env var or `http://localhost:13370`)\n- `batchSize?: number` - Number of events per batch (default: 100)\n- `batchInterval?: number` - Flush interval in milliseconds (default: 5000)\n- `maxQueueSize?: number` - Maximum queue size (default: `batchSize * 10`)\n\n**Example:**\n```typescript\ninitialize({\n  apiKey: 'your-api-key',\n  url: 'https://api.example.com',\n  batchSize: 50,\n  batchInterval: 3000,\n});\n```\n\n### `ensure(options)`\n\n**Main function** to track business events. Type is auto-determined by the presence of a `validator`.\n\n**Options:**\n- `id: string` - Unique event identifier (e.g., `\"payment_processed\"`)\n- `flow: string` - Flow identifier (e.g., `\"checkout\"`)\n- `runId: string | (() => string)` - Run identifier (string or function)\n- `data: Record<string, any>` - Event data payload\n- `filter?: (data, ctx) => boolean` - Optional filter function evaluated on backend\n- `depIds?: string[] | (() => string[])` - Optional dependency node IDs\n- `validator?: (data, ctx) => boolean` - Optional validation function executed on backend\n- `description?: string` - Optional human-readable description\n\n**Type determination:**\n- If `validator` is provided → creates an **\"assert\"** node\n- If `validator` is `undefined` → creates an **\"act\"** node\n\n**Example:**\n```typescript\n// Action node (no validator)\nensure({\n  id: 'payment_processed',\n  flow: 'checkout',\n  runId: 'run_12345',\n  data: { amount: 100, currency: 'USD' },\n  depIds: ['cart_created'],\n  description: 'Payment processed successfully',\n});\n\n// Assertion node (with validator)\nfunction validateTotal(data: Record<string, any>, ctx: { deps: DepData[] }): boolean {\n  const itemsTotal = ctx.deps.reduce((sum, dep) => sum + dep.data.price, 0);\n  return data.total === itemsTotal;\n}\n\nensure({\n  id: 'order_total_valid',\n  flow: 'checkout',\n  runId: 'run_12345',\n  data: { total: 150 },\n  depIds: ['item_added'],\n  validator: validateTotal,\n  description: 'Order total validation',\n});\n```\n\n### `act(options)`\n\n**Convenience wrapper** around `ensure()` without a validator. Creates an \"act\" node.\n\n**Options:**\n- `id: string` - Unique event identifier (e.g., `\"payment_processed\"`)\n- `flow: string` - Flow identifier (e.g., `\"checkout\"`)\n- `runId: string | (() => string)` - Run identifier (string or function)\n- `data: Record<string, any>` - Event data payload\n- `filter?: (data, ctx) => boolean` - Optional filter function evaluated on backend\n- `depIds?: string[] | (() => string[])` - Optional dependency node IDs\n- `description?: string` - Optional human-readable description\n\n**Filter Function Signature:**\n\n```typescript\nfunction myFilter(\n  data: Record<string, any>,\n  ctx: { deps: Array<{ flow: string; id: string; data: Record<string, any> }> }\n): boolean {\n  // Return true to include event, false to filter it out\n  // ctx.deps contains all upstream dependency events\n  return true;\n}\n```\n\n**Example:**\n```typescript\nact({\n  id: 'user_signup',\n  flow: 'onboarding',\n  runId: 'run_001',\n  data: { email: 'user@example.com', plan: 'premium' },\n  depIds: ['landing_page_visit'],\n  description: 'User signed up for premium plan'\n});\n\n// Using functions for dynamic values\nact({\n  id: 'order_completed',\n  flow: 'checkout',\n  runId: () => getCurrentRunId(),\n  data: { orderId: order.id },\n  depIds: () => getDependencies(),\n});\n\n// With filter based on upstream dependencies\nfunction checkPrerequisites(\n  data: Record<string, any>,\n  ctx: { deps: Array<{ flow: string; id: string; data: Record<string, any> }> }\n): boolean {\n  // Only process if all upstream tasks are approved\n  return ctx.deps.every((dep) => dep.data.status === 'approved');\n}\n\nact({\n  id: 'order_finalized',\n  flow: 'checkout',\n  runId: 'run_12345',\n  data: { orderId: 'ord_123' },\n  depIds: ['payment_processed', 'inventory_reserved'],\n  filter: checkPrerequisites, // Evaluated on backend with ctx\n  description: 'Order finalized after all prerequisites',\n});\n```\n\n### `assert(options)`\n\n**Convenience wrapper** around `ensure()` with a validator. Creates an \"assert\" node.\n\n**Options:**\n- `id: string` - Unique assertion identifier (e.g., `\"order_total_valid\"`)\n- `flow: string` - Flow identifier (e.g., `\"checkout\"`)\n- `runId: string | (() => string)` - Run identifier (string or function)\n- `data: Record<string, any>` - Event data payload\n- `filter?: (data, ctx) => boolean` - Optional filter function evaluated on backend\n- `depIds?: string[] | (() => string[])` - Optional dependency node IDs\n- `validator?: (data, ctx) => boolean` - Optional validation function executed on backend\n- `description?: string` - Optional human-readable description\n\n**Validator Function Signature:**\n\n```typescript\nfunction myValidator(\n  data: Record<string, any>,\n  ctx: { deps: Array<{ flow: string; id: string; data: Record<string, any> }> }\n): boolean {\n  // Return true if validation passes, false if it fails\n  // ctx.deps contains all upstream dependency events\n  return true;\n}\n```\n\n**Example:**\n```typescript\n// Validator accessing upstream dependencies\nfunction validateOrderTotal(\n  data: Record<string, any>,\n  ctx: { deps: Array<{ flow: string; id: string; data: Record<string, any> }> }\n): boolean {\n  // Calculate total from upstream item_added events\n  const itemsTotal = ctx.deps\n    .filter((dep) => dep.id === 'item_added')\n    .reduce((sum, dep) => sum + dep.data.price, 0);\n\n  // Verify order total matches\n  return data.total === itemsTotal;\n}\n\nassert({\n  id: 'order_total_matches',\n  flow: 'checkout',\n  runId: 'run_12345',\n  data: { total: 150 },\n  depIds: ['item_added'], // Multiple item_added events\n  validator: validateOrderTotal,\n  description: 'Order total matches sum of item prices',\n});\n\n// Validator with complex logic\nfunction validatePaymentAndInventory(\n  data: Record<string, any>,\n  ctx: { deps: Array<{ flow: string; id: string; data: Record<string, any> }> }\n): boolean {\n  const paymentApproved = ctx.deps.some(\n    (dep) => dep.id === 'payment_processed' && dep.data.status === 'approved'\n  );\n  const inventoryReserved = ctx.deps.some(\n    (dep) => dep.id === 'inventory_reserved' && dep.data.reserved === true\n  );\n  return paymentApproved && inventoryReserved && data.readyToShip;\n}\n\nassert({\n  id: 'order_ready',\n  flow: 'checkout',\n  runId: 'run_12345',\n  data: { readyToShip: true },\n  depIds: ['payment_processed', 'inventory_reserved'],\n  validator: validatePaymentAndInventory,\n});\n```\n\n### `shutdown(timeout?)`\n\nGracefully shutdown the SDK. Attempts to flush all remaining events.\n\n**Parameters:**\n- `timeout?: number` - Maximum time to wait in milliseconds (default: 5000)\n\n**Returns:** `Promise<void>`\n\n**Example:**\n```typescript\n// At application shutdown\nawait shutdown(5000);\n```\n\n## Environment Variables\n\nThe SDK supports configuration via environment variables:\n\n- `BUSINESS_USE_API_KEY` - API key for authentication\n- `BUSINESS_USE_URL` - Backend API URL\n\n**Example:**\n```bash\nexport BUSINESS_USE_API_KEY=\"your-api-key\"\nexport BUSINESS_USE_URL=\"https://api.example.com\"\n```\n\n```typescript\n// Will use environment variables\ninitialize();\n```\n\n## Configuration\n\n### Batch Processing\n\nEvents are batched and sent to the backend when either condition is met:\n\n1. **Size trigger**: Queue contains ≥ `batchSize` events (default: 100)\n2. **Time trigger**: `batchInterval` milliseconds elapsed since last flush (default: 5000ms)\n\n### Queue Management\n\n- **Max queue size**: `batchSize * 10` (default: 1000 events)\n- **Overflow strategy**: Drops oldest events (FIFO eviction)\n- **Thread safety**: Built on JavaScript event loop (inherently single-threaded)\n\n## Error Handling\n\nThe SDK is designed to **never fail your application**:\n\n- All network errors are caught and logged internally\n- Invalid configurations result in no-op behavior with warnings\n- Queue overflow silently drops oldest events\n- No exceptions are thrown to user code\n\n## TypeScript Support\n\nThe SDK is written in TypeScript and provides full type definitions with **type-safe filter and validator functions**:\n\n```typescript\nimport { initialize, act, assert, type Ctx, type DepData } from '@desplega.ai/business-use';\n\n// Type inference - both data and ctx are automatically typed!\nact({\n  id: 'payment_processed',\n  flow: 'checkout',\n  runId: 'run_123',\n  data: { amount: 100, currency: 'USD' },\n  depIds: ['cart_created'],\n  filter: (data, ctx) => {\n    // data.amount is known to exist!\n    // ctx.deps gives you access to upstream dependencies\n    return data.amount > 0 && ctx.deps.length > 0;\n  },\n});\n\n// Explicit types for even better type safety\ninterface OrderData {\n  orderId: string;\n  total: number;\n}\n\ninterface ItemData {\n  id: string;\n  price: number;\n}\n\nassert<OrderData>({\n  id: 'order_validation',\n  flow: 'checkout',\n  runId: 'run_456',\n  data: { orderId: '12345', total: 200 },\n  depIds: ['item_added'],\n  validator: (data, ctx) => {\n    // Full autocomplete and type checking for data!\n    // ctx.deps contains all upstream item_added events\n    const calculatedTotal = ctx.deps\n      .filter((dep) => dep.id === 'item_added')\n      .reduce((sum, dep) => sum + (dep.data as ItemData).price, 0);\n    return data.total === calculatedTotal;\n  },\n});\n```\n\n### Type Safety Features\n\n- **Automatic type inference**: Both `data` and `ctx` parameters in `filter` and `validator` functions are automatically typed\n- **Explicit type parameters**: Use generic type parameters (`act<T>`, `assert<T>`) for even stricter type checking\n- **Context typing**: `ctx` has type `Ctx` with `deps: DepData[]` for accessing upstream dependencies\n- **Nested object support**: Full type safety for complex nested data structures\n- **IDE autocomplete**: Get full IntelliSense/autocomplete in VS Code and other TypeScript-aware editors\n\n### Context Structure\n\nBoth `filter` and `validator` functions receive a `ctx` parameter with upstream dependency data:\n\n```typescript\ninterface DepData {\n  flow: string;    // Flow identifier\n  id: string;      // Node/event identifier\n  data: Record<string, any>; // Event data payload\n}\n\ninterface Ctx {\n  deps: DepData[]; // All upstream dependency events\n}\n```\n\n## Architecture\n\nThe SDK follows industry best practices inspired by OpenTelemetry, Sentry, and DataDog:\n\n- **Array-based queue** with configurable size limits\n- **Recursive setTimeout** (not setInterval) for reliable timer management\n- **Promise-based shutdown** with timeout protection\n- **Backend filter evaluation** with access to upstream dependencies via `ctx`\n- **Function serialization** for backend execution of both filters and validators\n- **Context-aware execution** - both filters and validators receive upstream dependency data\n\n## Development\n\n```bash\n# Install dependencies\npnpm install\n\n# Build the SDK\npnpm build\n\n# Run tests\npnpm test\n\n# Run tests with UI\npnpm test:ui\n\n# Run example\npnpm example\n\n# Type check\npnpm typecheck\n```\n\n## License\n\nMIT\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request.\n\n## Support\n\nFor issues and questions:\n- GitHub Issues: https://github.com/desplega-ai/business-use/issues\n- Documentation: https://github.com/desplega-ai/business-use#readme\n","readmeFilename":"README.md"}