{"_id":"ai-stream-utils","_rev":"19-08130a9e400495827f1f4cdd64110e26","name":"ai-stream-utils","dist-tags":{"latest":"3.1.1","ai-v6":"2.3.2"},"versions":{"0.0.0":{"name":"ai-stream-utils","version":"0.0.0","keywords":[],"author":"","license":"ISC","_id":"ai-stream-utils@0.0.0","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"dist":{"shasum":"a99763677317a359536c5cc7787e302472d3b07f","tarball":"https://registry.npmjs.org/ai-stream-utils/-/ai-stream-utils-0.0.0.tgz","fileCount":2,"integrity":"sha512-Jm2WbUtxs7ZBYEt+ND3RI1ypZVkhfh2K06nhq+xE2640Bx8q7VAxEzl6cHSZ8uxOmxw52E2gz0xIGnJEgN8tug==","signatures":[{"sig":"MEQCIHUBGpjCToaqcBnhs7uJPoXiNn7juMpak0H4Zsuu17DXAiBKnDDqYSTK1U1LY3LrO82ld84Hl/jV044zcOnJCIqcfg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":257},"main":"index.js","_from":"file:ai-stream-utils-0.0.0.tgz","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"chriszirkel","email":"chris.zirkel@gmail.com"},"_resolved":"/private/var/folders/_y/_4h8lsmx5053g1g2x562lt0m0000gn/T/a45de2b9df3f44da4ad94024b3697a1e/ai-stream-utils-0.0.0.tgz","_integrity":"sha512-Jm2WbUtxs7ZBYEt+ND3RI1ypZVkhfh2K06nhq+xE2640Bx8q7VAxEzl6cHSZ8uxOmxw52E2gz0xIGnJEgN8tug==","_npmVersion":"11.6.2","description":"WORK IN PROGRESS - DO NOT USE","directories":{},"_nodeVersion":"24.11.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ai-stream-utils_0.0.0_1764397607910_0.24290458046427466","host":"s3://npm-registry-packages-npm-production"}},"0.0.1":{"name":"ai-stream-utils","version":"0.0.1","keywords":["ai","sdk","ai-sdk","ui","message","stream","chunk","ui-message","ui-message-stream","ui-message-chunk"],"author":{"name":"Chris Cook"},"license":"MIT","_id":"ai-stream-utils@0.0.1","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"homepage":"https://github.com/zirkelc/ai-filter-stream#readme","bugs":{"url":"https://github.com/zirkelc/ai-filter-stream/issues"},"dist":{"shasum":"a0f3819dad4ffc234800db1340fcb57a7aa9bcf6","tarball":"https://registry.npmjs.org/ai-stream-utils/-/ai-stream-utils-0.0.1.tgz","fileCount":5,"integrity":"sha512-bNxaku2kZnSBn4PRG43nUou0VUeWesUkXdXaKbWo/KDN4Y8D0yFpaUpwH2uYNDlLjYPr18IygbPcYq5eK4HJhQ==","signatures":[{"sig":"MEUCIEtFh7DI+SFRjJrtM75RQEQY6HI72q6ZUr54Tx9kiK5fAiEAn680CzGIyuEoXYURiTVoqVDF1HesfBNgWvmzKfzmNA4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49787},"main":"./dist/index.mjs","type":"module","_from":"file:ai-stream-utils-0.0.1.tgz","types":"./dist/index.d.mts","module":"./dist/index.mjs","exports":{".":"./dist/index.mjs","./package.json":"./package.json"},"scripts":{"lint":"biome check . --write","test":"vitest","build":"tsdown"},"_npmUser":{"name":"chriszirkel","email":"chris.zirkel@gmail.com"},"_resolved":"/private/var/folders/_y/_4h8lsmx5053g1g2x562lt0m0000gn/T/2958b48e2beda33e128f51ca707dda09/ai-stream-utils-0.0.1.tgz","_integrity":"sha512-bNxaku2kZnSBn4PRG43nUou0VUeWesUkXdXaKbWo/KDN4Y8D0yFpaUpwH2uYNDlLjYPr18IygbPcYq5eK4HJhQ==","repository":{"url":"git+https://github.com/zirkelc/ai-filter-stream.git","type":"git"},"_npmVersion":"11.6.2","description":"AI SDK: Filter and transform UI messages while streaming to the client","directories":{},"_nodeVersion":"24.11.1","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"ai":"^5.0.93","msw":"^2.12.2","tsx":"^4.20.6","zod":"^4.1.12","husky":"^9.1.7","tsdown":"^0.16.5","vitest":"^4.0.10","publint":"^0.3.15","pkg-pr-new":"^0.0.60","typescript":"^5.9.3","@types/node":"^24.10.1","@ai-sdk/openai":"^2.0.76","@biomejs/biome":"^2.3.6","@arethetypeswrong/cli":"^0.18.2","@ai-sdk/provider-utils":"^3.0.17","@total-typescript/tsconfig":"^1.0.4"},"peerDependencies":{"ai":"5.x"},"_npmOperationalInternal":{"tmp":"tmp/ai-stream-utils_0.0.1_1764753253745_0.7366370497750898","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"ai-stream-utils","version":"0.0.2","keywords":["ai","sdk","ai-sdk","ui","message","stream","chunk","ui-message","ui-message-stream","ui-message-chunk"],"author":{"name":"Chris Cook"},"license":"MIT","_id":"ai-stream-utils@0.0.2","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"homepage":"https://github.com/zirkelc/ai-filter-stream#readme","bugs":{"url":"https://github.com/zirkelc/ai-filter-stream/issues"},"dist":{"shasum":"4f37d8de1e195add0a88b3ffdf49e94af1bd5148","tarball":"https://registry.npmjs.org/ai-stream-utils/-/ai-stream-utils-0.0.2.tgz","fileCount":5,"integrity":"sha512-WZwxT7yFfSSJsyR3JS/b0pc6u75c08XWlbyzbrcdWVr13UJJfBPnTtPElhv2sA/7wXOYLEk3asSFqeZX5hcu8A==","signatures":[{"sig":"MEUCIQC/9Zm4CxYBlwOJjUcGN4QJhD+M77OFDmxYkpqqTCDgnwIgT7rvyDNDcdDsrf6NcIcIZB6L8w1+lEMk6NXJROeI4Vg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49629},"main":"./dist/index.mjs","type":"module","_from":"file:ai-stream-utils-0.0.2.tgz","types":"./dist/index.d.mts","module":"./dist/index.mjs","exports":{".":"./dist/index.mjs","./package.json":"./package.json"},"scripts":{"lint":"biome check . --write","test":"vitest","build":"tsdown"},"_npmUser":{"name":"chriszirkel","email":"chris.zirkel@gmail.com"},"_resolved":"/private/var/folders/_y/_4h8lsmx5053g1g2x562lt0m0000gn/T/a1b7867f6b0a6dc770469cc95aae2a7c/ai-stream-utils-0.0.2.tgz","_integrity":"sha512-WZwxT7yFfSSJsyR3JS/b0pc6u75c08XWlbyzbrcdWVr13UJJfBPnTtPElhv2sA/7wXOYLEk3asSFqeZX5hcu8A==","repository":{"url":"git+https://github.com/zirkelc/ai-filter-stream.git","type":"git"},"_npmVersion":"11.6.2","description":"AI SDK: Filter and transform UI messages while streaming to the client","directories":{},"_nodeVersion":"24.11.1","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"ai":"^5.0.93","msw":"^2.12.2","tsx":"^4.20.6","zod":"^4.1.12","husky":"^9.1.7","tsdown":"^0.16.5","vitest":"^4.0.10","publint":"^0.3.15","pkg-pr-new":"^0.0.60","typescript":"^5.9.3","@types/node":"^24.10.1","@ai-sdk/openai":"^2.0.76","@biomejs/biome":"^2.3.6","@arethetypeswrong/cli":"^0.18.2","@ai-sdk/provider-utils":"^3.0.17","@total-typescript/tsconfig":"^1.0.4"},"peerDependencies":{"ai":"5.x"},"_npmOperationalInternal":{"tmp":"tmp/ai-stream-utils_0.0.2_1764758882281_0.9042270655536808","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"ai-stream-utils","version":"0.0.3","keywords":["ai","sdk","ai-sdk","ui","message","stream","chunk","ui-message","ui-message-stream","ui-message-chunk"],"author":{"name":"Chris Cook"},"license":"MIT","_id":"ai-stream-utils@0.0.3","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"homepage":"https://github.com/zirkelc/ai-filter-stream#readme","bugs":{"url":"https://github.com/zirkelc/ai-filter-stream/issues"},"dist":{"shasum":"de3ccbe0125b14ca254ae933ab97a8c8e02ca918","tarball":"https://registry.npmjs.org/ai-stream-utils/-/ai-stream-utils-0.0.3.tgz","fileCount":5,"integrity":"sha512-IqxsyPayCugFG3zmWShAIgAc+CjZtipEDv3ewpQohOx0b5cejmJcBYnhSgRiRhvchsANoebOgcpNuDQh2R8/FQ==","signatures":[{"sig":"MEYCIQDzC0lqlK2ahwOW5NC4Q2OKsrzWKIIap+93rk0mDRL8agIhAK0xznsAKandK4U02RqF7pTkDlEy0wOsNpilJyEZ6TBM","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49606},"main":"./dist/index.mjs","type":"module","_from":"file:ai-stream-utils-0.0.3.tgz","types":"./dist/index.d.mts","module":"./dist/index.mjs","exports":{".":"./dist/index.mjs","./package.json":"./package.json"},"scripts":{"lint":"biome check . --write","test":"vitest","build":"tsdown"},"_npmUser":{"name":"chriszirkel","email":"chris.zirkel@gmail.com"},"_resolved":"/private/var/folders/_y/_4h8lsmx5053g1g2x562lt0m0000gn/T/d5940a6b861eca504da0a09d35b2bd4d/ai-stream-utils-0.0.3.tgz","_integrity":"sha512-IqxsyPayCugFG3zmWShAIgAc+CjZtipEDv3ewpQohOx0b5cejmJcBYnhSgRiRhvchsANoebOgcpNuDQh2R8/FQ==","repository":{"url":"git+https://github.com/zirkelc/ai-filter-stream.git","type":"git"},"_npmVersion":"11.6.2","description":"AI SDK: Filter and transform UI messages while streaming to the client","directories":{},"_nodeVersion":"24.11.1","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"ai":"^5.0.93","msw":"^2.12.2","tsx":"^4.20.6","zod":"^4.1.12","husky":"^9.1.7","tsdown":"^0.16.5","vitest":"^4.0.10","publint":"^0.3.15","pkg-pr-new":"^0.0.60","typescript":"^5.9.3","@types/node":"^24.10.1","@ai-sdk/openai":"^2.0.76","@biomejs/biome":"^2.3.6","@arethetypeswrong/cli":"^0.18.2","@ai-sdk/provider-utils":"^3.0.17","@total-typescript/tsconfig":"^1.0.4"},"peerDependencies":{"ai":"5.x"},"_npmOperationalInternal":{"tmp":"tmp/ai-stream-utils_0.0.3_1764774646497_0.4115838325087362","host":"s3://npm-registry-packages-npm-production"}},"1.4.2":{"name":"ai-stream-utils","version":"1.4.2","keywords":["ai","sdk","ai-sdk","ui","message","stream","chunk","ui-message","ui-message-stream","ui-message-chunk"],"author":{"name":"Chris Cook"},"license":"MIT","_id":"ai-stream-utils@1.4.2","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"homepage":"https://github.com/zirkelc/ai-stream-utils#readme","bugs":{"url":"https://github.com/zirkelc/ai-stream-utils/issues"},"dist":{"shasum":"a23f8a758cedc303645e3b60d8a5235fb39bff6d","tarball":"https://registry.npmjs.org/ai-stream-utils/-/ai-stream-utils-1.4.2.tgz","fileCount":8,"integrity":"sha512-mhEK1IDAwNM4fMPDNuahyUEj6rSdZPSxTn84zkESN+Mj5NC+XvSXfYza6BvhqJqVsFxhGxSDmRxgQbvYU7LTXA==","signatures":[{"sig":"MEYCIQCT2GGu6aLYa+uq1ZafcO/56pvv58arW+Vbq/FqWkIt3wIhAMYypr4IQmmR1WA+qH8f68pfLfMpHzJjV7wbDrDO1ghM","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ai-stream-utils@1.4.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":59208},"type":"module","_from":"file:ai-stream-utils-1.4.2.tgz","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs","./utils":"./dist/utils/index.mjs","./package.json":"./package.json"},"scripts":{"lint":"biome check . --write","test":"vitest","build":"tsdown"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:32b16a36-821a-4992-a130-706a80654b18"}},"_resolved":"/tmp/1b943f67f0f341d1acb3d1196a87853a/ai-stream-utils-1.4.2.tgz","_integrity":"sha512-mhEK1IDAwNM4fMPDNuahyUEj6rSdZPSxTn84zkESN+Mj5NC+XvSXfYza6BvhqJqVsFxhGxSDmRxgQbvYU7LTXA==","repository":{"url":"git+https://github.com/zirkelc/ai-stream-utils.git","type":"git"},"_npmVersion":"11.6.2","description":"AI SDK: Filter and transform UI messages while streaming to the client","directories":{},"_nodeVersion":"24.12.0","_hasShrinkwrap":false,"devDependencies":{"ai":"^6.0.42","msw":"^2.12.7","tsx":"^4.21.0","zod":"^4.3.5","husky":"^9.1.7","tsdown":"0.20.0-beta.4","vitest":"^4.0.17","publint":"^0.3.16","pkg-pr-new":"^0.0.62","typescript":"^5.9.3","@types/node":"^25.0.9","@ai-sdk/openai":"^3.0.12","@biomejs/biome":"^2.3.11","@arethetypeswrong/cli":"^0.18.2","@ai-sdk/provider-utils":"^4.0.8","@total-typescript/tsconfig":"^1.0.4"},"peerDependencies":{"ai":"5.x || 6.x"},"_npmOperationalInternal":{"tmp":"tmp/ai-stream-utils_1.4.2_1769018145872_0.34416385636420266","host":"s3://npm-registry-packages-npm-production"}},"1.5.0":{"name":"ai-stream-utils","version":"1.5.0","keywords":["ai","sdk","ai-sdk","ui","message","stream","chunk","ui-message","ui-message-stream","ui-message-chunk"],"author":{"name":"Chris Cook"},"license":"MIT","_id":"ai-stream-utils@1.5.0","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"homepage":"https://github.com/zirkelc/ai-stream-utils#readme","bugs":{"url":"https://github.com/zirkelc/ai-stream-utils/issues"},"dist":{"shasum":"a6b115232e8c0e541ed8b402d536772848fcf851","tarball":"https://registry.npmjs.org/ai-stream-utils/-/ai-stream-utils-1.5.0.tgz","fileCount":8,"integrity":"sha512-4rW845hM0ZobVNi4wCtl9m4XRUxpnqVRZczq1lq2HhTO/BIkrc8t9W8BIhT0veDnXlm+G1Ki8R+4kAJT6GztpA==","signatures":[{"sig":"MEUCIDXKKIbKZONUgIm28vWgKMU/Z8P7ij+UjJ1tBoSBOSzGAiEAnFjsMeRz+xFCfV28AaM9mIJRfiuW3VhMY+mnHGSHVSw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ai-stream-utils@1.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":61686},"type":"module","_from":"file:ai-stream-utils-1.5.0.tgz","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs","./utils":"./dist/utils/index.mjs","./package.json":"./package.json"},"scripts":{"lint":"biome check . --write","test":"vitest","build":"tsdown"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:32b16a36-821a-4992-a130-706a80654b18"}},"_resolved":"/tmp/d3c529f2557b8b5bb83cedf049ba8c36/ai-stream-utils-1.5.0.tgz","_integrity":"sha512-4rW845hM0ZobVNi4wCtl9m4XRUxpnqVRZczq1lq2HhTO/BIkrc8t9W8BIhT0veDnXlm+G1Ki8R+4kAJT6GztpA==","repository":{"url":"git+https://github.com/zirkelc/ai-stream-utils.git","type":"git"},"_npmVersion":"11.6.2","description":"AI SDK: Filter and transform UI messages while streaming to the client","directories":{},"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"devDependencies":{"ai":"^6.0.42","msw":"^2.12.7","tsx":"^4.21.0","zod":"^4.3.5","husky":"^9.1.7","tsdown":"0.20.0-beta.4","vitest":"^4.0.17","publint":"^0.3.16","pkg-pr-new":"^0.0.62","typescript":"^5.9.3","@types/node":"^25.0.9","@ai-sdk/openai":"^3.0.12","@biomejs/biome":"^2.3.11","@arethetypeswrong/cli":"^0.18.2","@ai-sdk/provider-utils":"^4.0.8","@total-typescript/tsconfig":"^1.0.4"},"peerDependencies":{"ai":"5.x || 6.x"},"_npmOperationalInternal":{"tmp":"tmp/ai-stream-utils_1.5.0_1769675702725_0.6885954481753254","host":"s3://npm-registry-packages-npm-production"}},"1.6.0":{"name":"ai-stream-utils","version":"1.6.0","keywords":["ai","sdk","ai-sdk","ui","message","stream","chunk","ui-message","ui-message-stream","ui-message-chunk"],"author":{"name":"Chris Cook"},"license":"MIT","_id":"ai-stream-utils@1.6.0","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"homepage":"https://github.com/zirkelc/ai-stream-utils#readme","bugs":{"url":"https://github.com/zirkelc/ai-stream-utils/issues"},"dist":{"shasum":"873ce6fa18d7c27ff7c985225bbd771cefdce233","tarball":"https://registry.npmjs.org/ai-stream-utils/-/ai-stream-utils-1.6.0.tgz","fileCount":8,"integrity":"sha512-nhOToR+J3scudZWZUnGO84JXeQHJhwTyUCNQxGQpRzYc7uQQHSiLbJsv2uYiXBEUpAz1HarBoPbBX4E7ntahrg==","signatures":[{"sig":"MEUCIHPLvnuLUzDfYYyy4IS3qV1yQykGLJIfvM01LrE2FfpiAiEAlJ7Kb76ZQd2YH3R6QMbii4hh5TPvkiIZCzomidQ+2Fg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ai-stream-utils@1.6.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":64724},"type":"module","_from":"file:ai-stream-utils-1.6.0.tgz","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs","./utils":"./dist/utils/index.mjs","./package.json":"./package.json"},"scripts":{"lint":"biome check . --write","test":"vitest","build":"tsdown"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:32b16a36-821a-4992-a130-706a80654b18"}},"_resolved":"/tmp/b570f8ddbfb04dda66e4dc737d732d4a/ai-stream-utils-1.6.0.tgz","_integrity":"sha512-nhOToR+J3scudZWZUnGO84JXeQHJhwTyUCNQxGQpRzYc7uQQHSiLbJsv2uYiXBEUpAz1HarBoPbBX4E7ntahrg==","repository":{"url":"git+https://github.com/zirkelc/ai-stream-utils.git","type":"git"},"_npmVersion":"11.6.2","description":"AI SDK: Filter and transform UI messages while streaming to the client","directories":{},"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"devDependencies":{"ai":"^6.0.42","msw":"^2.12.7","tsx":"^4.21.0","zod":"^4.3.5","husky":"^9.1.7","tsdown":"0.20.0-beta.4","vitest":"^4.0.17","publint":"^0.3.16","pkg-pr-new":"^0.0.62","typescript":"^5.9.3","@types/node":"^25.0.9","@ai-sdk/openai":"^3.0.12","@biomejs/biome":"^2.3.11","@arethetypeswrong/cli":"^0.18.2","@ai-sdk/provider-utils":"^4.0.8","@total-typescript/tsconfig":"^1.0.4"},"peerDependencies":{"ai":"5.x || 6.x"},"_npmOperationalInternal":{"tmp":"tmp/ai-stream-utils_1.6.0_1770824655512_0.3261061832797669","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"ai-stream-utils","version":"2.0.0","keywords":["ai","ai-sdk","chunk","filter","map","message","sdk","stream","transform","ui","ui-message","ui-message-chunk","ui-message-stream","utils"],"author":{"name":"Chris Cook"},"license":"MIT","_id":"ai-stream-utils@2.0.0","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"homepage":"https://github.com/zirkelc/ai-stream-utils#readme","bugs":{"url":"https://github.com/zirkelc/ai-stream-utils/issues"},"dist":{"shasum":"773075a46eb39bc2d41fc69bd766d33b4ab9828e","tarball":"https://registry.npmjs.org/ai-stream-utils/-/ai-stream-utils-2.0.0.tgz","fileCount":9,"integrity":"sha512-mmH5/+1ns3NGNH58u0Au9LjsXFmY2+a4p0GrM37EMFjR7hLHOFDZm3jmF6C3fXOQJIgv/kx3x+LpY5AzQyD6EQ==","signatures":[{"sig":"MEUCIQDMrwX9GcJk8bXFssESNWtwhwXfN9MQL8rjxiE48Hv3fQIgH0t507hjClhmdn1JH18/T1ozXGiAZYlBlcvDXXWRdnA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ai-stream-utils@2.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":81215},"type":"module","_from":"file:ai-stream-utils-2.0.0.tgz","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs","./utils":"./dist/utils/index.mjs","./package.json":"./package.json"},"scripts":{"lint":"oxlint --fix","test":"vitest","build":"tsdown","format":"oxfmt --write","lint:ci":"oxlint","benchmark":"pnpm vitest bench --run","format:ci":"oxfmt --check"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:32b16a36-821a-4992-a130-706a80654b18"}},"_resolved":"/tmp/e43ae1d6895da1bf4f83d68e80a653d8/ai-stream-utils-2.0.0.tgz","_integrity":"sha512-mmH5/+1ns3NGNH58u0Au9LjsXFmY2+a4p0GrM37EMFjR7hLHOFDZm3jmF6C3fXOQJIgv/kx3x+LpY5AzQyD6EQ==","repository":{"url":"git+https://github.com/zirkelc/ai-stream-utils.git","type":"git"},"_npmVersion":"11.6.2","description":"AI SDK: Filter and transform UI messages while streaming to the client","directories":{},"lint-staged":{"*":"oxfmt --no-error-on-unmatched-pattern","*.{js,jsx,ts,tsx,mjs,cjs}":"oxlint"},"_nodeVersion":"24.13.0","dependencies":{"defu":"^6.1.4"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^6.0.86","msw":"^2.12.10","tsx":"^4.21.0","zod":"^4.3.6","husky":"^9.1.7","oxfmt":"^0.33.0","oxlint":"^1.48.0","tsdown":"0.20.3","vitest":"^4.0.18","publint":"^0.3.17","pkg-pr-new":"^0.0.63","typescript":"^5.9.3","@types/node":"^25.2.3","lint-staged":"^16.2.7","@ai-sdk/openai":"^3.0.29","@ai-sdk/provider":"^3.0.8","@arethetypeswrong/cli":"^0.18.2","@ai-sdk/provider-utils":"^4.0.15","@total-typescript/tsconfig":"^1.0.4"},"peerDependencies":{"ai":"5.x || 6.x"},"_npmOperationalInternal":{"tmp":"tmp/ai-stream-utils_2.0.0_1771316600709_0.08722670214654382","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"ai-stream-utils","version":"2.0.1","keywords":["ai","ai-sdk","chunk","filter","map","message","sdk","stream","transform","ui","ui-message","ui-message-chunk","ui-message-stream","utils"],"author":{"name":"Chris Cook"},"license":"MIT","_id":"ai-stream-utils@2.0.1","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"homepage":"https://github.com/zirkelc/ai-stream-utils#readme","bugs":{"url":"https://github.com/zirkelc/ai-stream-utils/issues"},"dist":{"shasum":"bad16008ef86ea4958d37ce3ba95c2729d69786b","tarball":"https://registry.npmjs.org/ai-stream-utils/-/ai-stream-utils-2.0.1.tgz","fileCount":9,"integrity":"sha512-xjzMKCix7G1T4deLan8dxauYU4v1yEr0Et353ykyPuA0DqUuqHUp9ZSICCjTJrD1HNhjgLFUFH1+0ZmotsrFBA==","signatures":[{"sig":"MEYCIQDtxubFdJXkAGYDeHy6KSeD8GAumx8fPtprM1CWiqsmLQIhAImZq1LsA2e0abvFfytLsnqnzczEGnW/KTeDS/ztZmG3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ai-stream-utils@2.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":81140},"type":"module","_from":"file:ai-stream-utils-2.0.1.tgz","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs","./utils":"./dist/utils/index.mjs","./package.json":"./package.json"},"scripts":{"lint":"oxlint --fix","test":"vitest","build":"tsdown","format":"oxfmt --write","lint:ci":"oxlint","benchmark":"pnpm vitest bench --run","format:ci":"oxfmt --check"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:32b16a36-821a-4992-a130-706a80654b18"}},"_resolved":"/tmp/d277f858ccf1c6a68cb3507c99bd615b/ai-stream-utils-2.0.1.tgz","_integrity":"sha512-xjzMKCix7G1T4deLan8dxauYU4v1yEr0Et353ykyPuA0DqUuqHUp9ZSICCjTJrD1HNhjgLFUFH1+0ZmotsrFBA==","repository":{"url":"git+https://github.com/zirkelc/ai-stream-utils.git","type":"git"},"_npmVersion":"11.6.2","description":"AI SDK: Filter and transform UI messages while streaming to the client","directories":{},"lint-staged":{"*":"oxfmt --no-error-on-unmatched-pattern","*.{js,jsx,ts,tsx,mjs,cjs}":"oxlint"},"_nodeVersion":"24.13.0","dependencies":{"defu":"^6.1.4"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^6.0.86","msw":"^2.12.10","tsx":"^4.21.0","zod":"^4.3.6","husky":"^9.1.7","oxfmt":"^0.33.0","oxlint":"^1.48.0","tsdown":"0.20.3","vitest":"^4.0.18","publint":"^0.3.17","pkg-pr-new":"^0.0.63","typescript":"^5.9.3","@types/node":"^25.2.3","lint-staged":"^16.2.7","@ai-sdk/openai":"^3.0.29","@ai-sdk/provider":"^3.0.8","@arethetypeswrong/cli":"^0.18.2","@ai-sdk/provider-utils":"^4.0.15","@total-typescript/tsconfig":"^1.0.4"},"peerDependencies":{"ai":"5.x || 6.x"},"_npmOperationalInternal":{"tmp":"tmp/ai-stream-utils_2.0.1_1771331395138_0.7623705384953705","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"ai-stream-utils","version":"2.1.0","keywords":["ai","ai-sdk","chunk","filter","map","message","sdk","stream","transform","ui","ui-message","ui-message-chunk","ui-message-stream","utils"],"author":{"name":"Chris Cook"},"license":"MIT","_id":"ai-stream-utils@2.1.0","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"homepage":"https://github.com/zirkelc/ai-stream-utils#readme","bugs":{"url":"https://github.com/zirkelc/ai-stream-utils/issues"},"dist":{"shasum":"4df639cebba2a70b518ea929ad60ab9ccb5e39f3","tarball":"https://registry.npmjs.org/ai-stream-utils/-/ai-stream-utils-2.1.0.tgz","fileCount":9,"integrity":"sha512-IKBNM7ycySVJVhVDa9u1BS6hF190/j2qjXv48QJHr6nIhAEn0gwR/CMa5G/c4mqPeaB/+LhGtgYaekxdymtZvQ==","signatures":[{"sig":"MEUCID90WR9QejlrcJ50RpYLGx89WXMp3XajupyBbU/O5pluAiEAjr/pUKs0XVXD/uwGGinhqW/ZgyxS8DMHW2To1fYT2G8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ai-stream-utils@2.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":87607},"type":"module","_from":"file:ai-stream-utils-2.1.0.tgz","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs","./utils":"./dist/utils/index.mjs","./package.json":"./package.json"},"scripts":{"lint":"oxlint --fix","test":"vitest","build":"tsdown","format":"oxfmt --write","lint:ci":"oxlint","benchmark":"pnpm vitest bench --run","format:ci":"oxfmt --check"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:32b16a36-821a-4992-a130-706a80654b18"}},"_resolved":"/tmp/b29720fd4d7154b26b66ef4a01487200/ai-stream-utils-2.1.0.tgz","_integrity":"sha512-IKBNM7ycySVJVhVDa9u1BS6hF190/j2qjXv48QJHr6nIhAEn0gwR/CMa5G/c4mqPeaB/+LhGtgYaekxdymtZvQ==","repository":{"url":"git+https://github.com/zirkelc/ai-stream-utils.git","type":"git"},"_npmVersion":"11.8.0","description":"AI SDK: Filter and transform UI messages while streaming to the client","directories":{},"lint-staged":{"*":"oxfmt --no-error-on-unmatched-pattern","*.{js,jsx,ts,tsx,mjs,cjs}":"oxlint"},"_nodeVersion":"24.13.1","dependencies":{"defu":"^6.1.4"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^6.0.86","msw":"^2.12.10","tsx":"^4.21.0","zod":"^4.3.6","husky":"^9.1.7","oxfmt":"^0.33.0","oxlint":"^1.48.0","tsdown":"0.20.3","vitest":"^4.0.18","publint":"^0.3.17","pkg-pr-new":"^0.0.63","typescript":"^5.9.3","@types/node":"^25.2.3","lint-staged":"^16.2.7","@ai-sdk/openai":"^3.0.29","@ai-sdk/provider":"^3.0.8","@arethetypeswrong/cli":"^0.18.2","@ai-sdk/provider-utils":"^4.0.15","@total-typescript/tsconfig":"^1.0.4"},"peerDependencies":{"ai":"5.x || 6.x"},"_npmOperationalInternal":{"tmp":"tmp/ai-stream-utils_2.1.0_1772094008375_0.2122268912452201","host":"s3://npm-registry-packages-npm-production"}},"2.2.0":{"name":"ai-stream-utils","version":"2.2.0","keywords":["ai","ai-sdk","chunk","filter","map","message","sdk","stream","transform","ui","ui-message","ui-message-chunk","ui-message-stream","utils"],"author":{"name":"Chris Cook"},"license":"MIT","_id":"ai-stream-utils@2.2.0","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"homepage":"https://github.com/zirkelc/ai-stream-utils#readme","bugs":{"url":"https://github.com/zirkelc/ai-stream-utils/issues"},"dist":{"shasum":"c0926f8519caf7b72f293d89410af15b9faf798d","tarball":"https://registry.npmjs.org/ai-stream-utils/-/ai-stream-utils-2.2.0.tgz","fileCount":9,"integrity":"sha512-zodQ05B4BxpMG+iWrha35FKAhW3pZ4sJXrcbjSMB8Amsl7ur4dSm0kuZV4wgnqZhtV9LOhKECe3+Y+J5KN13Ug==","signatures":[{"sig":"MEYCIQD7O6ZnYDfqnUL0IAW2H7kAy6494yUqzutMMa9e4U+NsQIhALoPvnhiP6pqoR62SD0EU4shOwqidJ7ojaf3ekl6GLu0","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ai-stream-utils@2.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":92458},"type":"module","_from":"file:ai-stream-utils-2.2.0.tgz","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs","./utils":"./dist/utils/index.mjs","./package.json":"./package.json"},"scripts":{"lint":"oxlint --fix","test":"vitest","build":"tsdown","format":"oxfmt --write","lint:ci":"oxlint","benchmark":"pnpm vitest bench --run","format:ci":"oxfmt --check"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:32b16a36-821a-4992-a130-706a80654b18"}},"_resolved":"/tmp/d252acc4529f448efd7f0805db9e4521/ai-stream-utils-2.2.0.tgz","_integrity":"sha512-zodQ05B4BxpMG+iWrha35FKAhW3pZ4sJXrcbjSMB8Amsl7ur4dSm0kuZV4wgnqZhtV9LOhKECe3+Y+J5KN13Ug==","repository":{"url":"git+https://github.com/zirkelc/ai-stream-utils.git","type":"git"},"_npmVersion":"11.8.0","description":"AI SDK: Filter and transform UI messages while streaming to the client","directories":{},"lint-staged":{"*":"oxfmt --no-error-on-unmatched-pattern","*.{js,jsx,ts,tsx,mjs,cjs}":"oxlint"},"_nodeVersion":"24.13.1","dependencies":{"defu":"^6.1.4"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^6.0.86","msw":"^2.12.10","tsx":"^4.21.0","zod":"^4.3.6","husky":"^9.1.7","oxfmt":"^0.33.0","oxlint":"^1.48.0","tsdown":"0.20.3","vitest":"^4.0.18","publint":"^0.3.17","pkg-pr-new":"^0.0.63","typescript":"^5.9.3","@types/node":"^25.2.3","lint-staged":"^16.2.7","@ai-sdk/react":"^3.0.110","@ai-sdk/openai":"^3.0.29","@ai-sdk/provider":"^3.0.8","@arethetypeswrong/cli":"^0.18.2","@ai-sdk/provider-utils":"^4.0.15","@total-typescript/tsconfig":"^1.0.4"},"peerDependencies":{"ai":"5.x || 6.x"},"_npmOperationalInternal":{"tmp":"tmp/ai-stream-utils_2.2.0_1772613699857_0.4657092072300617","host":"s3://npm-registry-packages-npm-production"}},"2.3.0":{"name":"ai-stream-utils","version":"2.3.0","keywords":["ai","ai-sdk","chunk","filter","map","message","sdk","stream","transform","ui","ui-message","ui-message-chunk","ui-message-stream","utils"],"author":{"name":"Chris Cook"},"license":"MIT","_id":"ai-stream-utils@2.3.0","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"homepage":"https://github.com/zirkelc/ai-stream-utils#readme","bugs":{"url":"https://github.com/zirkelc/ai-stream-utils/issues"},"dist":{"shasum":"59551447804147e0304ff8129c1022d2784246b4","tarball":"https://registry.npmjs.org/ai-stream-utils/-/ai-stream-utils-2.3.0.tgz","fileCount":9,"integrity":"sha512-efSN+pASJNTjEsJV8tGsLXzhiFk1wsNwEgBdAaz5QLl0O+vhHgBJU6HlyMIBphrgErXnGONnXTJEw14P6rxWvA==","signatures":[{"sig":"MEQCIF4mnvQpVlFIMB8UbwsQC/Hd2/UDRmYq0SYgLcfmm6P2AiAdqbi8fEpRS6g6A79YWg2DI0po7PBgp3u7vWIQxdgPpg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ai-stream-utils@2.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":97898},"type":"module","_from":"file:ai-stream-utils-2.3.0.tgz","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs","./utils":"./dist/utils/index.mjs","./package.json":"./package.json"},"scripts":{"lint":"oxlint --fix","test":"vitest","build":"tsdown","format":"oxfmt --write","lint:ci":"oxlint","benchmark":"pnpm vitest bench --run","format:ci":"oxfmt --check"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:32b16a36-821a-4992-a130-706a80654b18"}},"_resolved":"/tmp/6abf921623b3289a97d62745e0d9ff8a/ai-stream-utils-2.3.0.tgz","_integrity":"sha512-efSN+pASJNTjEsJV8tGsLXzhiFk1wsNwEgBdAaz5QLl0O+vhHgBJU6HlyMIBphrgErXnGONnXTJEw14P6rxWvA==","repository":{"url":"git+https://github.com/zirkelc/ai-stream-utils.git","type":"git"},"_npmVersion":"11.13.0","description":"AI SDK: Filter and transform UI messages while streaming to the client","directories":{},"lint-staged":{"*":"oxfmt --no-error-on-unmatched-pattern","*.{js,jsx,ts,tsx,mjs,cjs}":"oxlint"},"_nodeVersion":"24.16.0","dependencies":{"defu":"^6.1.4"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^6.0.86","msw":"^2.12.10","tsx":"^4.21.0","zod":"^4.3.6","husky":"^9.1.7","oxfmt":"^0.33.0","dotenv":"^17.4.2","oxlint":"^1.48.0","tsdown":"0.20.3","vitest":"^4.0.18","publint":"^0.3.17","pkg-pr-new":"^0.0.63","typescript":"^5.9.3","@types/node":"^25.2.3","lint-staged":"^16.2.7","@ai-sdk/react":"^3.0.110","@ai-sdk/openai":"^3.0.29","@ai-sdk/provider":"^3.0.8","@arethetypeswrong/cli":"^0.18.2","@ai-sdk/provider-utils":"^4.0.15","@total-typescript/tsconfig":"^1.0.4"},"peerDependencies":{"ai":"5.x || 6.x"},"_npmOperationalInternal":{"tmp":"tmp/ai-stream-utils_2.3.0_1781020572766_0.9306100845323804","host":"s3://npm-registry-packages-npm-production"}},"2.3.1":{"name":"ai-stream-utils","version":"2.3.1","keywords":["ai","ai-sdk","chunk","filter","map","message","sdk","stream","transform","ui","ui-message","ui-message-chunk","ui-message-stream","utils"],"author":{"name":"Chris Cook"},"license":"MIT","_id":"ai-stream-utils@2.3.1","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"homepage":"https://github.com/zirkelc/ai-stream-utils#readme","bugs":{"url":"https://github.com/zirkelc/ai-stream-utils/issues"},"dist":{"shasum":"491de545b135e38f92076e6a340507fe8c814540","tarball":"https://registry.npmjs.org/ai-stream-utils/-/ai-stream-utils-2.3.1.tgz","fileCount":9,"integrity":"sha512-JffzXKnZUOxkbK7rzAKlCksZfxjdfhfY90A6N0u4fPRiL2OINbMPawhggtVCAsx1r81f1GaLNDichYT3fzPQQw==","signatures":[{"sig":"MEUCIQDOaiZSyDvvgv46MIYK2I+svfbssE8Zd+IaQx2G1+SAKAIgQkbjJD3pyi7ePdmxbxhlWptjUQXenZdIey2YAwJtxzA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ai-stream-utils@2.3.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":97898},"type":"module","_from":"file:ai-stream-utils-2.3.1.tgz","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs","./utils":"./dist/utils/index.mjs","./package.json":"./package.json"},"scripts":{"lint":"oxlint --fix","test":"vitest","build":"tsdown","format":"oxfmt --write","lint:ci":"oxlint","benchmark":"pnpm vitest bench --run","format:ci":"oxfmt --check"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:32b16a36-821a-4992-a130-706a80654b18"}},"_resolved":"/tmp/2fb419f67591c0e9ab08a82d3efc2643/ai-stream-utils-2.3.1.tgz","_integrity":"sha512-JffzXKnZUOxkbK7rzAKlCksZfxjdfhfY90A6N0u4fPRiL2OINbMPawhggtVCAsx1r81f1GaLNDichYT3fzPQQw==","repository":{"url":"git+https://github.com/zirkelc/ai-stream-utils.git","type":"git"},"_npmVersion":"11.16.0","description":"AI SDK: Filter and transform UI messages while streaming to the client","directories":{},"lint-staged":{"*":"oxfmt --no-error-on-unmatched-pattern","*.{js,jsx,ts,tsx,mjs,cjs}":"oxlint"},"_nodeVersion":"24.18.0","dependencies":{"defu":"^6.1.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ai":"^6.0.86","msw":"^2.12.10","tsx":"^4.21.0","zod":"^4.3.6","husky":"^9.1.7","oxfmt":"^0.33.0","dotenv":"^17.4.2","oxlint":"^1.48.0","tsdown":"0.20.3","vitest":"^4.0.18","publint":"^0.3.17","pkg-pr-new":"^0.0.63","typescript":"^5.9.3","@types/node":"^25.2.3","lint-staged":"^16.2.7","@ai-sdk/react":"^3.0.110","@ai-sdk/openai":"^3.0.29","@ai-sdk/provider":"^3.0.8","@arethetypeswrong/cli":"^0.18.2","@ai-sdk/provider-utils":"^4.0.15","@total-typescript/tsconfig":"^1.0.4"},"peerDependencies":{"ai":"5.x || 6.x"},"_npmOperationalInternal":{"tmp":"tmp/ai-stream-utils_2.3.1_1783611914503_0.033888038022661604","host":"s3://npm-registry-packages-npm-production"}},"3.0.0":{"name":"ai-stream-utils","version":"3.0.0","keywords":["ai","ai-sdk","chunk","filter","map","message","sdk","stream","transform","ui","ui-message","ui-message-chunk","ui-message-stream","utils"],"author":{"name":"Chris Cook"},"license":"MIT","_id":"ai-stream-utils@3.0.0","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"homepage":"https://github.com/zirkelc/ai-stream-utils#readme","bugs":{"url":"https://github.com/zirkelc/ai-stream-utils/issues"},"dist":{"shasum":"a575efa0010ab474abf923e9ac2555c13f3fc318","tarball":"https://registry.npmjs.org/ai-stream-utils/-/ai-stream-utils-3.0.0.tgz","fileCount":9,"integrity":"sha512-RxtqVWdTxSnBNcuVngFA3zbH43LdwrjewIFS/AVs5oVLdDJDbKNbrBPEmpb0elyXS2Z+IijrHwy4EyBcLz/cFQ==","signatures":[{"sig":"MEUCIQC8ie80CHFbigpvWVWtU2lMaoBjxZrgcnWsXPkIB0ldoAIgVZq6kXfKEffMDsrMs7P7OK/0GX8Q1jIKFAVUi+Hl4II=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ai-stream-utils@3.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":78882},"type":"module","_from":"file:ai-stream-utils-3.0.0.tgz","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs","./utils":"./dist/utils/index.mjs","./package.json":"./package.json"},"scripts":{"lint":"oxlint --fix","test":"vitest","build":"tsdown","format":"oxfmt --write","lint:ci":"oxlint","benchmark":"pnpm vitest bench --run","format:ci":"oxfmt --check"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:32b16a36-821a-4992-a130-706a80654b18"}},"_resolved":"/tmp/54e6ca1354ca3c658e77900d8acdde2f/ai-stream-utils-3.0.0.tgz","_integrity":"sha512-RxtqVWdTxSnBNcuVngFA3zbH43LdwrjewIFS/AVs5oVLdDJDbKNbrBPEmpb0elyXS2Z+IijrHwy4EyBcLz/cFQ==","repository":{"url":"git+https://github.com/zirkelc/ai-stream-utils.git","type":"git"},"_npmVersion":"11.16.0","description":"AI SDK: Filter and transform UI messages while streaming to the client","directories":{},"lint-staged":{"*":"oxfmt --no-error-on-unmatched-pattern","*.{js,jsx,ts,tsx,mjs,cjs}":"oxlint"},"_nodeVersion":"24.18.0","dependencies":{"defu":"^6.1.4"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^7.0.18","msw":"^2.12.10","tsx":"^4.21.0","zod":"^4.3.6","husky":"^9.1.7","oxfmt":"^0.33.0","dotenv":"^17.4.2","oxlint":"^1.48.0","tsdown":"0.20.3","vitest":"^4.0.18","publint":"^0.3.17","pkg-pr-new":"^0.0.63","typescript":"^5.9.3","@types/node":"^25.2.3","ai-test-kit":"^3.0.1","lint-staged":"^16.2.7","@ai-sdk/react":"^4.0.19","@ai-sdk/openai":"^4.0.9","@ai-sdk/provider":"^4.0.2","@arethetypeswrong/cli":"^0.18.2","@ai-sdk/provider-utils":"^5.0.6","@total-typescript/tsconfig":"^1.0.4"},"peerDependencies":{"ai":"7.x"},"_npmOperationalInternal":{"tmp":"tmp/ai-stream-utils_3.0.0_1783612532243_0.6147018642603264","host":"s3://npm-registry-packages-npm-production"}},"3.1.0":{"name":"ai-stream-utils","version":"3.1.0","keywords":["ai","ai-sdk","chunk","filter","map","message","sdk","stream","transform","ui","ui-message","ui-message-chunk","ui-message-stream","utils"],"author":{"name":"Chris Cook"},"license":"MIT","_id":"ai-stream-utils@3.1.0","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"homepage":"https://github.com/zirkelc/ai-stream-utils#readme","bugs":{"url":"https://github.com/zirkelc/ai-stream-utils/issues"},"dist":{"shasum":"78978ba5cb510e324e04c89ea15e0efbd85fdf16","tarball":"https://registry.npmjs.org/ai-stream-utils/-/ai-stream-utils-3.1.0.tgz","fileCount":9,"integrity":"sha512-0cQdxz/3h0oVbbM6Acos1/Taf+lOFo39D7S5lwR33ytxx3RorakaDQnvM+KBu0dRI9W2GKDBr8pEGDpwlEyV1w==","signatures":[{"sig":"MEYCIQDWWEVgxQykBDgo68YsnOzRUhaz+j+55Kf0C1zLuCMfeAIhAOBKkaCZdAzod8m99pa0M+EU9GisG2l29Z7ctWsKqmna","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ai-stream-utils@3.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":80319},"type":"module","_from":"file:ai-stream-utils-3.1.0.tgz","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs","./utils":"./dist/utils/index.mjs","./package.json":"./package.json"},"scripts":{"lint":"oxlint --fix","test":"vitest","build":"tsdown","format":"oxfmt --write","lint:ci":"oxlint","benchmark":"pnpm vitest bench --run","format:ci":"oxfmt --check"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:32b16a36-821a-4992-a130-706a80654b18"}},"_resolved":"/tmp/81c3e7ca5ea49f40e983e39821758d91/ai-stream-utils-3.1.0.tgz","_integrity":"sha512-0cQdxz/3h0oVbbM6Acos1/Taf+lOFo39D7S5lwR33ytxx3RorakaDQnvM+KBu0dRI9W2GKDBr8pEGDpwlEyV1w==","repository":{"url":"git+https://github.com/zirkelc/ai-stream-utils.git","type":"git"},"_npmVersion":"11.16.0","description":"AI SDK: Filter and transform UI messages while streaming to the client","directories":{},"lint-staged":{"*":"oxfmt --no-error-on-unmatched-pattern","*.{js,jsx,ts,tsx,mjs,cjs}":"oxlint"},"_nodeVersion":"24.18.0","dependencies":{"defu":"^6.1.4"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^7.0.18","msw":"^2.12.10","tsx":"^4.21.0","zod":"^4.3.6","husky":"^9.1.7","oxfmt":"^0.33.0","dotenv":"^17.4.2","oxlint":"^1.48.0","tsdown":"0.20.3","vitest":"^4.0.18","publint":"^0.3.17","pkg-pr-new":"^0.0.63","typescript":"^5.9.3","@types/node":"^25.2.3","ai-test-kit":"^3.0.1","lint-staged":"^16.2.7","@ai-sdk/react":"^4.0.19","@ai-sdk/openai":"^4.0.9","@ai-sdk/provider":"^4.0.2","@arethetypeswrong/cli":"^0.18.2","@ai-sdk/provider-utils":"^5.0.6","@total-typescript/tsconfig":"^1.0.4"},"peerDependencies":{"ai":"7.x"},"_npmOperationalInternal":{"tmp":"tmp/ai-stream-utils_3.1.0_1783670895776_0.8484032646328798","host":"s3://npm-registry-packages-npm-production"}},"2.3.2":{"name":"ai-stream-utils","version":"2.3.2","keywords":["ai","ai-sdk","chunk","filter","map","message","sdk","stream","transform","ui","ui-message","ui-message-chunk","ui-message-stream","utils"],"author":{"name":"Chris Cook"},"license":"MIT","_id":"ai-stream-utils@2.3.2","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"homepage":"https://github.com/zirkelc/ai-stream-utils#readme","bugs":{"url":"https://github.com/zirkelc/ai-stream-utils/issues"},"dist":{"shasum":"17d5a80d34f9aa126442edc3b42c2e10ac8d6d46","tarball":"https://registry.npmjs.org/ai-stream-utils/-/ai-stream-utils-2.3.2.tgz","fileCount":9,"integrity":"sha512-A7iDJ9ZHivMf9GOizSIaDXRzHgzeIO8oDMhe3apqIjlPz5IvGBNt09jc9D90SlHHMU1Davb5c7aZE/D6bFBWuQ==","signatures":[{"sig":"MEYCIQCxZ9SBKrpVLJ3DRzJ/htQkHUdZhkrCzO09mCqdaUgGpQIhAO7J9npRoVHM5r13Utgw4BR9ljzu9ZLXU2eux1wVW+6A","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ai-stream-utils@2.3.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":98261},"type":"module","_from":"file:ai-stream-utils-2.3.2.tgz","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs","./utils":"./dist/utils/index.mjs","./package.json":"./package.json"},"scripts":{"lint":"oxlint --fix","test":"vitest","build":"tsdown","format":"oxfmt --write","lint:ci":"oxlint","benchmark":"pnpm vitest bench --run","format:ci":"oxfmt --check"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:32b16a36-821a-4992-a130-706a80654b18"}},"_resolved":"/tmp/d856d95f4c83945691821049e068982f/ai-stream-utils-2.3.2.tgz","_integrity":"sha512-A7iDJ9ZHivMf9GOizSIaDXRzHgzeIO8oDMhe3apqIjlPz5IvGBNt09jc9D90SlHHMU1Davb5c7aZE/D6bFBWuQ==","repository":{"url":"git+https://github.com/zirkelc/ai-stream-utils.git","type":"git"},"_npmVersion":"11.16.0","description":"AI SDK: Filter and transform UI messages while streaming to the client","directories":{},"lint-staged":{"*":"oxfmt --no-error-on-unmatched-pattern","*.{js,jsx,ts,tsx,mjs,cjs}":"oxlint"},"_nodeVersion":"24.18.0","dependencies":{"defu":"^6.1.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ai":"^6.0.86","msw":"^2.12.10","tsx":"^4.21.0","zod":"^4.3.6","husky":"^9.1.7","oxfmt":"^0.33.0","dotenv":"^17.4.2","oxlint":"^1.48.0","tsdown":"0.20.3","vitest":"^4.0.18","publint":"^0.3.17","pkg-pr-new":"^0.0.63","typescript":"^5.9.3","@types/node":"^25.2.3","lint-staged":"^16.2.7","@ai-sdk/react":"^3.0.110","@ai-sdk/openai":"^3.0.29","@ai-sdk/provider":"^3.0.8","@arethetypeswrong/cli":"^0.18.2","@ai-sdk/provider-utils":"^4.0.15","@total-typescript/tsconfig":"^1.0.4"},"peerDependencies":{"ai":"5.x || 6.x"},"_npmOperationalInternal":{"tmp":"tmp/ai-stream-utils_2.3.2_1783928079206_0.546356563858017","host":"s3://npm-registry-packages-npm-production"}},"3.1.1":{"name":"ai-stream-utils","version":"3.1.1","description":"AI SDK: Filter and transform UI messages while streaming to the client","keywords":["ai","ai-sdk","chunk","filter","map","message","sdk","stream","transform","ui","ui-message","ui-message-chunk","ui-message-stream","utils"],"license":"MIT","author":{"name":"Chris Cook"},"repository":{"type":"git","url":"git+https://github.com/zirkelc/ai-stream-utils.git"},"type":"module","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs","./utils":"./dist/utils/index.mjs","./package.json":"./package.json"},"dependencies":{"defu":"^6.1.4"},"devDependencies":{"@ai-sdk/openai":"^4.0.9","@ai-sdk/provider":"^4.0.2","@ai-sdk/provider-utils":"^5.0.6","@ai-sdk/react":"^4.0.19","@arethetypeswrong/cli":"^0.18.2","@total-typescript/tsconfig":"^1.0.4","@types/node":"^25.2.3","ai":"^7.0.18","ai-test-kit":"^3.0.1","dotenv":"^17.4.2","husky":"^9.1.7","lint-staged":"^16.2.7","msw":"^2.12.10","oxfmt":"^0.33.0","oxlint":"^1.48.0","pkg-pr-new":"^0.0.63","publint":"^0.3.17","tsdown":"0.20.3","tsx":"^4.21.0","typescript":"^5.9.3","vitest":"^4.0.18","zod":"^4.3.6"},"peerDependencies":{"ai":"7.x"},"lint-staged":{"*":"oxfmt --no-error-on-unmatched-pattern","*.{js,jsx,ts,tsx,mjs,cjs}":"oxlint"},"scripts":{"build":"tsdown","test":"vitest","benchmark":"pnpm vitest bench --run","lint":"oxlint --fix","lint:ci":"oxlint","format":"oxfmt --write","format:ci":"oxfmt --check"},"_id":"ai-stream-utils@3.1.1","bugs":{"url":"https://github.com/zirkelc/ai-stream-utils/issues"},"homepage":"https://github.com/zirkelc/ai-stream-utils#readme","_integrity":"sha512-8QkXG/Aqx1xjouFZ8KqgfPjWZbZ8gq/ja9BSydH61J8sEasrcfIT9/mKKIKp3iZLEvgbowQMKVbjF310RoBNPA==","_resolved":"/tmp/b28d84a7d1490d9614d8babf55076209/ai-stream-utils-3.1.1.tgz","_from":"file:ai-stream-utils-3.1.1.tgz","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-8QkXG/Aqx1xjouFZ8KqgfPjWZbZ8gq/ja9BSydH61J8sEasrcfIT9/mKKIKp3iZLEvgbowQMKVbjF310RoBNPA==","shasum":"45acf6e0d20c20905cdbb5a501b824dcdcabac6b","tarball":"https://registry.npmjs.org/ai-stream-utils/-/ai-stream-utils-3.1.1.tgz","fileCount":9,"unpackedSize":80812,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ai-stream-utils@3.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCvlAeZI2vnImGeaFlOnh4B8gVtB5f0vooDV9WDf90/nAIgf/ZfDd40n9VTVjaF8i7LYoN4MYJpmuXD8ZeZhKFM268="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:32b16a36-821a-4992-a130-706a80654b18"}},"directories":{},"maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ai-stream-utils_3.1.1_1783928110423_0.8547006287025818"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-29T06:26:47.908Z","modified":"2026-07-13T07:35:10.778Z","0.0.0":"2025-11-29T06:26:48.110Z","0.0.1":"2025-12-03T09:14:13.926Z","0.0.2":"2025-12-03T10:48:02.473Z","0.0.3":"2025-12-03T15:10:46.682Z","1.4.1":"2026-01-21T07:39:08.981Z","1.4.2":"2026-01-21T17:55:46.018Z","1.5.0":"2026-01-29T08:35:02.883Z","1.6.0":"2026-02-11T15:44:15.707Z","2.0.0":"2026-02-17T08:23:20.845Z","2.0.1":"2026-02-17T12:29:55.298Z","2.1.0":"2026-02-26T08:20:08.529Z","2.2.0":"2026-03-04T08:41:39.998Z","2.3.0":"2026-06-09T15:56:12.916Z","2.3.1":"2026-07-09T15:45:14.663Z","3.0.0":"2026-07-09T15:55:32.377Z","3.1.0":"2026-07-10T08:08:15.909Z","2.3.2":"2026-07-13T07:34:39.373Z","3.1.1":"2026-07-13T07:35:10.543Z"},"bugs":{"url":"https://github.com/zirkelc/ai-stream-utils/issues"},"author":{"name":"Chris Cook"},"license":"MIT","homepage":"https://github.com/zirkelc/ai-stream-utils#readme","keywords":["ai","ai-sdk","chunk","filter","map","message","sdk","stream","transform","ui","ui-message","ui-message-chunk","ui-message-stream","utils"],"repository":{"type":"git","url":"git+https://github.com/zirkelc/ai-stream-utils.git"},"description":"AI SDK: Filter and transform UI messages while streaming to the client","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"readme":"<div align='center'>\n\n<picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"assets/logo-dark.png\" />\n  <img src=\"assets/logo-light.png\" alt=\"ai-stream-utils logo\" width=\"440\" />\n</picture>\n\n<p align=\"center\">AI SDK: Filter and transform UI messages while streaming to the client</p>\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/ai-stream-utils\" alt=\"ai-stream-utils\"><img src=\"https://img.shields.io/npm/dt/ai-stream-utils?label=ai-stream-utils\"></a> <a href=\"https://github.com/zirkelc/ai-stream-utils/actions/workflows/ci.yml\" alt=\"CI\"><img src=\"https://img.shields.io/github/actions/workflow/status/zirkelc/ai-stream-utils/ci.yml?branch=main\"></a>\n</p>\n\n</div>\n\nThis library provides composable filter and transformation utilities for UI message streams created by [`streamText()`](https://ai-sdk.dev/docs/reference/ai-sdk-core/stream-text) in the AI SDK.\n\n### Why?\n\nThe AI SDK UI message stream created by [`toUIMessageStream()`](https://ai-sdk.dev/docs/reference/ai-sdk-core/stream-text#to-ui-message-stream) streams all parts (text, tools, reasoning, etc.) to the client by default. However, you may want to:\n\n- **Filter**: Tool calls like database searches often contain large amounts of data or sensitive information that should not be streamed to the client\n- **Transform**: Modify text or tool outputs while they are streamed to the client\n- **Observe**: Log stream lifecycle events, update states, or run side-effects without modifying the stream\n\nThis library provides type-safe, composable utilities for all these use cases.\n\n### Installation\n\n> [!NOTE]\n> Version compatibility:\n>\n> - Use [`ai-stream-utils@2.x`](https://github.com/zirkelc/ai-stream-utils/tree/v2.x) for AI SDK v6\n> - Use [`ai-stream-utils@3.x`](https://github.com/zirkelc/ai-stream-utils/tree/v3.x) for AI SDK v7\n\n```bash\nnpm install ai-stream-utils@2 # AI SDK v6\nnpm install ai-stream-utils@3 # AI SDK v7\n```\n\n## Usage\n\nThe `pipe` function provides a composable pipeline API for filtering, transforming, and observing UI message streams. Multiple operators can be chained together, and type guards automatically narrow chunk and part types, thus enabling type-safe stream transformations with autocomplete.\n\n### `.filter()`\n\nFilter chunks by returning `true` to keep or `false` to exclude. The predicate may be async.\n\n```typescript\nconst stream = pipe(result.toUIMessageStream())\n  .filter(({ chunk, part }) => {\n    // chunk.type: \"text-delta\" | \"text-start\" | \"tool-input-available\" | ...\n    // part.type: \"text\" | \"reasoning\" | \"tool-weather\" | ...\n\n    if (chunk.type === \"data-weather\") {\n      return false; // exclude chunk\n    }\n\n    return true; // keep chunk\n  })\n  .toStream();\n```\n\n#### Type Guards\n\nGeneric type guards provide a simpler API for common filtering patterns:\n\n- `includeChunks(\"text-delta\")` or `includeChunks([\"text-delta\", \"text-end\"])`: Include **only** specific chunk types\n- `excludeChunks(\"text-delta\")` or `excludeChunks([\"text-delta\", \"text-end\"])`: Exclude **only** specific chunk types\n- `includeParts(\"text\")` or `includeParts([\"text\", \"reasoning\"])`: Include **only** specific part types\n- `excludeParts(\"reasoning\")` or `excludeParts([\"reasoning\", \"tool-database\"])`: Exclude **only** specific part types\n\nFiltering tools is the most common use case and the tool-filter type guards provide a convenient API for filtering tool chunks by tool name:\n\n- `excludeTools()` or `excludeTools(\"weather\")` or `excludeTools([\"weather\", \"database\"])`: Exclude all tools or specific tools by name\n- `includeTools()` or `includeTools(\"weather\")` or `includeTools([\"weather\", \"database\"])`: Include all tools or specific tools by name\n\n> [!NOTE]\n> The tool-filter type guards only affect tool chunks. Non-tool chunks will pass through.\n\n#### Examples\n\nExclude tool calls from the client.\n\n```typescript\n// Exclude by part type (requires \"tool-\" prefix)\nconst stream = pipe(result.toUIMessageStream())\n  .filter(excludeParts([\"tool-weather\", \"tool-database\"]))\n  .toStream();\n\n// Exclude by tool name (without \"tool-\" prefix)\nconst stream = pipe(result.toUIMessageStream())\n  .filter(excludeTools([\"weather\", \"database\"]))\n  .toStream();\n\n// Exclude all tools\nconst stream = pipe(result.toUIMessageStream()).filter(excludeTools()).toStream();\n\n// Include only specific tools (without \"tool-\" prefix)\nconst stream = pipe(result.toUIMessageStream())\n  .filter(includeTools([\"weather\"]))\n  .toStream();\n```\n\n> [!NOTE]\n> `excludeTools()` and `includeTools()` filters tool chunks on the server before streaming to the client. This affects all tool types including:\n>\n> - Server-side tools with `execute` functions\n> - Client-side tools without `execute` functions\n> - Tools that require human approval via `needsApproval`\n>\n> Excluded tools will not appear in the client's message parts, so users won't see tool call UI or be able to approve/reject filtered tools.\n\n### `.map()`\n\nTransform chunks by returning a chunk, an array of chunks, or `null` to exclude. The callback may be async, which lets a chunk be rewritten from an awaited result.\n\n```typescript\nconst stream = pipe(result.toUIMessageStream())\n  .map(({ chunk, part }) => {\n    // chunk.type: \"text-delta\" | \"text-start\" | \"tool-input-available\" | ...\n    // part.type: \"text\" | \"reasoning\" | \"tool-weather\" | ...\n\n    if (chunk.type === \"text-start\") {\n      return chunk; // pass through unchanged\n    }\n\n    if (chunk.type === \"text-delta\") {\n      return { ...chunk, delta: \"modified\" }; // transform chunk\n    }\n\n    if (chunk.type === \"data-weather\") {\n      return [chunk1, chunk2]; // emit multiple chunks\n    }\n\n    return null; // exclude chunk (same as filter)\n  })\n  .toStream();\n```\n\n#### Examples\n\nConvert text to uppercase.\n\n```typescript\nconst stream = pipe(result.toUIMessageStream())\n  .map(({ chunk }) => {\n    if (chunk.type === \"text-delta\") {\n      return { ...chunk, delta: chunk.delta.toUpperCase() };\n    }\n\n    return chunk;\n  })\n  .toStream();\n```\n\n#### Helpers\n\n`transformProviderMetadata()` changes `providerMetadata` on the chunks that carry it (`text-*`, `reasoning-*`, `reasoning-file`, `tool-input-*`, `tool-output-available`, `tool-output-error`, `tool-approval-response`, `source-*`, `file`, `custom`). Every other chunk passes through untouched, so you don't have to narrow by chunk type yourself.\n\nThe callback receives the current `metadata` (may be `undefined`) and returns one of three things:\n\n- an **object** to set/replace the metadata (merge by spreading `metadata`)\n- **`undefined`** to leave the chunk unchanged\n- **`null`** to remove the `providerMetadata` field entirely (the chunk still passes through)\n\n```typescript\nconst stream = pipe(result.toUIMessageStream())\n  .map(\n    transformProviderMetadata(({ chunk, part, metadata }) => {\n      if (chunk.type === \"tool-input-available\")\n        return { ...metadata, app: { toolCallId: chunk.toolCallId } }; // add to tool input chunks\n\n      if (part.type === \"text\") return null; // delete for text parts\n\n      return undefined; // leave everything else unchanged\n    }),\n  )\n  .toStream();\n```\n\n### `.on()`\n\nObserve chunks without modifying the stream. The callback is invoked for matching chunks. Both the predicate and the callback may be async.\n\n```typescript\nconst stream = pipe(result.toUIMessageStream())\n  .on(\n    (predicate) => {\n      const { chunk, part } = predicate;\n      // return true to invoke callback, false to skip\n      return chunk.type === \"text-delta\";\n    },\n    (callback) => {\n      const { chunk, part } = callback;\n      // callback invoked for matching chunks\n      console.log(chunk, part);\n    },\n  )\n  .toStream();\n```\n\n#### Type Guards\n\n**Type guard** provides a type-safe way to observe specific chunk types:\n\n- `chunkType(\"text-delta\")` or `chunkType([\"start\", \"finish\"])`: Observe specific chunk types\n- `partType(\"text\")` or `partType([\"text\", \"reasoning\"])`: Observe chunks belonging to specific part types\n- `toolCall()` or `toolCall({ tool: \"weather\" })` or `toolCall({ state: \"output-available\" })`: Observe tool state transitions\n\n> [!NOTE]\n> The `partType` type guard still operates on chunks. That means `partType(\"text\")` will match any text chunks such as `text-start`, `text-delta`, and `text-end`.\n\nThe `toolCall()` type guard matches tool chunks representing state transitions (not streaming events):\n\n- `input-available`: Tool input fully parsed\n- `approval-requested`: Tool awaiting user approval\n- `output-available`: Tool execution completed\n- `output-error`: Tool execution failed\n- `output-denied`: User denied approval\n\n#### Examples\n\nLog stream lifecycle events:\n\n```typescript\nconst stream = pipe(result.toUIMessageStream())\n  .on(chunkType(\"start\"), ({ chunk }) => {\n    console.log(\"Stream started:\", chunk.messageId);\n  })\n  .on(chunkType(\"finish\"), ({ chunk }) => {\n    console.log(\"Stream finished:\", chunk.finishReason);\n  })\n  .on(chunkType(\"tool-input-available\"), ({ chunk }) => {\n    console.log(\"Tool input:\", chunk.input);\n  })\n  .on(chunkType(\"tool-output-available\"), ({ chunk }) => {\n    console.log(\"Tool output:\", chunk.output);\n  })\n  .toStream();\n```\n\nObserve tool state transitions for a specific tool:\n\n```typescript\nconst stream = pipe(result.toUIMessageStream())\n  .on(toolCall({ tool: \"weather\", state: \"approval-requested\" }), ({ chunk }) => {\n    console.log(\"Weather tool needs approval\");\n  })\n  .on(toolCall({ tool: \"weather\", state: \"output-available\" }), ({ chunk }) => {\n    console.log(\"Weather output:\", chunk.output);\n  })\n  .on(toolCall({ tool: \"weather\", state: \"input-available\" }), ({ chunk }) => {\n    console.log(\"Weather input:\", chunk.input);\n  })\n  .toStream();\n```\n\nObserve all tool calls:\n\n```typescript\nconst stream = pipe(result.toUIMessageStream())\n  .on(toolCall({ state: `input-available` }), ({ chunk, part }) => {\n    console.log(`Tool call ${part.type} (${chunk.toolCallId}) input=`, chunk.input);\n  })\n  .on(toolCall({ state: `output-available` }), ({ chunk, part }) => {\n    console.log(`Tool result ${part.type} (${chunk.toolCallId}) output=`, chunk.output);\n  })\n  .on(toolCall({ state: `output-error` }), ({ chunk, part }) => {\n    console.log(`Tool error ${part.type} (${chunk.toolCallId}) error=`, chunk.errorText);\n  })\n  .toStream();\n```\n\n### `.toStream()`\n\nConvert the pipeline back to a `AsyncIterableStream<InferUIMessageChunk<UI_MESSAGE>>` that can be returned to the client or consumed.\n\n```typescript\nconst stream = pipe(result.toUIMessageStream())\n  .filter(({ chunk }) => {})\n  .map(({ chunk }) => {})\n  .toStream();\n\n// Iterate with for-await-of\nfor await (const chunk of stream) {\n  console.log(chunk);\n}\n\n// Consume as ReadableStream\nfor await (const message of readUIMessageStream({ stream })) {\n  console.log(message);\n}\n\n// Return to client with useChat()\nreturn stream;\n```\n\n### Chaining and Type Narrowing\n\nMultiple operators can be chained together. After filtering with type guards, chunk and part types are narrowed automatically.\n\n```typescript\nconst stream = pipe<MyUIMessage>(result.toUIMessageStream())\n  .filter(includeParts(\"text\"))\n  .map(({ chunk, part }) => {\n    // chunk is narrowed to text chunks: \"text-start\" | \"text-delta\" | \"text-end\"\n    // part is narrowed to \"text\"\n    return chunk;\n  })\n  .toStream();\n```\n\n### Control Chunks\n\n[Control chunks](https://github.com/vercel/ai/blob/main/packages/ai/src/ui-message-stream/ui-message-chunks.ts#L278-L293) always pass through regardless of filter/transform settings:\n\n- `start`: Stream start marker\n- `finish`: Stream finish marker\n- `abort`: Stream abort marker\n- `message-metadata`: Message metadata updates\n- `error`: Error messages\n\n## Stream Utilities\n\nHelper functions for consuming streams and converting between streams, arrays, and async iterables.\n\n### `consumeUIMessageStream`\n\nConsumes a UI message stream by fully reading it and returns the final assembled message. Useful for server-side processing without streaming to the client.\n\n```typescript\nimport { consumeUIMessageStream } from \"ai-stream-utils\";\n\nconst result = streamText({\n  model: openai(\"gpt-4o\"),\n  prompt: \"Tell me a joke\",\n});\n\nconst message = await consumeUIMessageStream(result.toUIMessageStream<MyUIMessage>());\n\nconsole.log(message.parts); // All parts fully assembled\n```\n\n### `createAsyncIterableStream`\n\nAdds async iterator protocol to a `ReadableStream`, enabling `for await...of` loops.\n\n```typescript\nimport { createAsyncIterableStream } from \"ai-stream-utils\";\n\nconst asyncStream = createAsyncIterableStream(readableStream);\nfor await (const chunk of asyncStream) {\n  console.log(chunk);\n}\n```\n\n### `convertArrayToStream`\n\nConverts an array to a `ReadableStream` that emits each element.\n\n```typescript\nimport { convertArrayToStream } from \"ai-stream-utils\";\n\nconst stream = convertArrayToStream([1, 2, 3]);\n```\n\n### `convertAsyncIterableToStream`\n\nConverts an async iterable (e.g., async generator) to a `ReadableStream`.\n\n```typescript\nimport { convertAsyncIterableToStream } from \"ai-stream-utils\";\n\nasync function* generator() {\n  yield 1;\n  yield 2;\n}\nconst stream = convertAsyncIterableToStream(generator());\n```\n\n### `convertAsyncIterableToArray`\n\nCollects all values from an async iterable into an array.\n\n```typescript\nimport { convertAsyncIterableToArray } from \"ai-stream-utils\";\n\nconst array = await convertAsyncIterableToArray(asyncIterable);\n```\n\n### `convertStreamToArray`\n\nConsumes a `ReadableStream` and collects all chunks into an array.\n\n```typescript\nimport { convertStreamToArray } from \"ai-stream-utils\";\n\nconst array = await convertStreamToArray(readableStream);\n```\n\n### `convertUIMessageToSSEStream`\n\nConverts a UI message stream to an SSE (Server-Sent Events) stream. Useful for sending UI message chunks over HTTP as SSE-formatted text.\n\n```typescript\nimport { convertUIMessageToSSEStream } from \"ai-stream-utils\";\n\nconst uiStream = result.toUIMessageStream();\nconst sseStream = convertUIMessageToSSEStream(uiStream);\n\n// Output format: \"data: {...}\\n\\n\" for each chunk\n```\n\n### `convertSSEToUIMessageStream`\n\nConverts an SSE stream back to a UI message stream. Useful for parsing SSE-formatted responses on the client.\n\n```typescript\nimport { convertSSEToUIMessageStream } from \"ai-stream-utils\";\n\nconst response = await fetch(\"/api/chat\");\nconst sseStream = response.body.pipeThrough(new TextDecoderStream());\nconst uiStream = convertSSEToUIMessageStream(sseStream);\n```\n\n## Type Safety\n\nThe [`toUIMessageStream()`](https://ai-sdk.dev/docs/reference/ai-sdk-core/stream-text#to-ui-message-stream) from [`streamText()`](https://ai-sdk.dev/docs/reference/ai-sdk-core/stream-text) returns a generic `ReadableStream<UIMessageChunk>`, which means the part types cannot be inferred automatically.\n\nTo enable autocomplete and type-safety, pass your [`UIMessage`](https://ai-sdk.dev/docs/reference/ai-sdk-core/ui-message#creating-your-own-uimessage-type) type as a generic parameter:\n\n```typescript\nimport type { UIMessage, InferUITools } from \"ai\";\n\ntype MyUIMessageMetadata = {};\ntype MyDataPart = {};\ntype MyTools = InferUITools<typeof tools>;\n\ntype MyUIMessage = UIMessage<MyUIMessageMetadata, MyDataPart, MyTools>;\n\n// Use MyUIMessage type when creating the UI message stream\nconst uiStream = result.toUIMessageStream<MyUIMessage>();\n\n// Type-safe filtering with autocomplete\nconst stream = pipe<MyUIMessage>(uiStream)\n  .filter(includeParts([\"text\", \"tool-weather\"])) // Autocomplete works!\n  .map(({ chunk, part }) => {\n    // part.type is typed based on MyUIMessage\n    return chunk;\n  })\n  .toStream();\n```\n\n## Client-Side Usage\n\nThe transformed stream has the same type as the original UI message stream. You can consume it with [`useChat()`](https://ai-sdk.dev/docs/reference/ai-sdk-ui/use-chat) or [`readUIMessageStream()`](https://ai-sdk.dev/docs/reference/ai-sdk-ui/read-ui-message-stream).\n\nSince message parts may be different on the client vs. the server, you may need to reconcile message parts when the client sends messages back to the server.\n\nIf you save messages to a database and configure `useChat()` to [only send the last message](https://ai-sdk.dev/docs/ai-sdk-ui/chatbot-message-persistence#sending-only-the-last-message), you can read existing messages from the database. This means the model will have access to all message parts, including filtered parts not available on the client.\n\n## API\n\n## `pipe(input)`\n\n- `input`, a `ReadableStream<UIMessageChunk>` or an `AsyncIterable<UIMessageChunk>`\n\nReturns a `ChunkPipeline` with chainable operators. Pass your `UIMessage` type as `pipe<MyUIMessage>(input)` to type the chunk and part unions. The pipeline is itself an `AsyncIterable`, and it can only be consumed once.\n\n```ts\nconst stream = pipe<MyUIMessage>(result.toUIMessageStream<MyUIMessage>())\n  .filter(excludeTools())\n  .toStream();\n```\n\n#### `.filter(guard)` / `.filter(predicate)`\n\nDrop chunks from the stream. Pass a type guard to narrow the chunk and part types for every later operator, or a plain predicate receiving `{ chunk, part }` and returning `true` to keep. A plain predicate may be async and is awaited. Meta chunks always pass through, so the callback only sees content chunks.\n\n```ts\npipe<MyUIMessage>(stream).filter(includeParts([\"text\"]));\n\npipe<MyUIMessage>(stream).filter(({ chunk, part }) => part.type !== \"reasoning\");\n```\n\n#### `.map(fn)`\n\nTransform chunks. The callback receives `{ chunk, part }` and returns a chunk, an array of chunks, or `null` to drop it. The callback may be async, and is awaited before the chunk reaches any later operator, so ordering is preserved.\n\n```ts\npipe<MyUIMessage>(stream).map(({ chunk }) => {\n  if (chunk.type === \"text-delta\") return { ...chunk, delta: chunk.delta.toUpperCase() };\n  return chunk;\n});\n\n// Inline a remote file as a data URL before it reaches the client\npipe<MyUIMessage>(stream).map(async ({ chunk }) => {\n  if (chunk.type !== \"file\") return chunk;\n  const base64 = await downloadAsBase64(chunk.url);\n  return { ...chunk, url: `data:${chunk.mediaType};base64,${base64}` };\n});\n```\n\n#### `.on(guard, callback)` / `.on(predicate, callback)`\n\nObserve chunks without changing the stream. Every chunk passes through regardless of whether the callback runs. Both the predicate and the callback may be async and are awaited; a throw propagates and fails the stream. For meta chunks `part` is `undefined`.\n\n```ts\npipe<MyUIMessage>(stream).on(toolCall({ state: \"output-available\" }), async ({ chunk, part }) => {\n  await log(part.type, chunk.output);\n});\n```\n\n#### `.toStream()`\n\nExecute the pipeline and return an `AsyncIterableStream<UIMessageChunk>`. Throws if the pipeline was already consumed.\n\n```ts\nconst stream = pipe<MyUIMessage>(input).filter(excludeTools()).toStream();\n```\n\n## `includeChunks(types)` / `excludeChunks(types)`\n\nFilter guards matching chunks by chunk type. Accept a single type or an array. Meta chunks pass through either way.\n\n```ts\npipe<MyUIMessage>(stream).filter(includeChunks(\"text-delta\"));\npipe<MyUIMessage>(stream).filter(excludeChunks([\"text-start\", \"text-end\"]));\n```\n\n## `includeParts(types)` / `excludeParts(types)`\n\nFilter guards matching chunks by the part they belong to. Accept a single type or an array. A part type covers every chunk that builds it, so `includeParts('text')` keeps `text-start`, `text-delta` and `text-end`.\n\n```ts\npipe<MyUIMessage>(stream).filter(includeParts([\"text\", \"reasoning\"]));\npipe<MyUIMessage>(stream).filter(excludeParts(\"tool-weather\"));\n```\n\n## `includeTools(names?)` / `excludeTools(names?)`\n\nFilter guards matching tool chunks by tool name, without the `tool-` prefix. Called with no argument they match every tool, including dynamic ones. Non-tool chunks always pass through.\n\n```ts\npipe<MyUIMessage>(stream).filter(excludeTools());\npipe<MyUIMessage>(stream).filter(excludeTools([\"weather\", \"database\"]));\npipe<MyUIMessage>(stream).filter(includeTools(\"weather\"));\n```\n\n## `chunkType(types)` / `partType(types)`\n\nObserve guards for `.on()`, matching by chunk type or by part type. Accept a single type or an array. `chunkType` matches meta chunks, `partType` does not.\n\n```ts\npipe<MyUIMessage>(stream).on(chunkType([\"start\", \"finish\"]), ({ chunk }) => track(chunk.type));\npipe<MyUIMessage>(stream).on(partType(\"text\"), ({ chunk }) => buffer(chunk));\n```\n\n## `toolCall(options?)`\n\nObserve guard for `.on()` matching tool state transitions. Streaming chunks such as `tool-input-start` and `tool-input-delta` are never matched.\n\n- `options.tool` (optional), a tool name without the `tool-` prefix (default: every tool)\n- `options.state` (optional), one of `'input-available'`, `'approval-requested'`, `'output-available'`, `'output-error'`, `'output-denied'` (default: every state)\n\n```ts\npipe<MyUIMessage>(stream).on(toolCall(), ({ chunk, part }) => log(part.type, chunk.type));\npipe<MyUIMessage>(stream).on(toolCall({ tool: \"weather\" }), ({ part }) => log(part.type));\npipe<MyUIMessage>(stream).on(\n  toolCall({ tool: \"weather\", state: \"output-available\" }),\n  ({ chunk }) => log(chunk.output),\n);\n```\n\n## `transformProviderMetadata(fn)`\n\nA `.map()` callback that rewrites `providerMetadata` on the chunks that carry it and passes every other chunk through untouched. The callback receives `{ chunk, part, metadata }`, where `metadata` may be `undefined`, and returns an object to set it, `undefined` to leave the chunk alone, or `null` to remove the field. `null` removes the field, not the chunk.\n\n```ts\npipe<MyUIMessage>(stream).map(\n  transformProviderMetadata(({ chunk, part, metadata }) => {\n    if (part.type === \"text\") return null;\n    return { ...metadata, app: { traceId } };\n  }),\n);\n```\n\n## `consumeUIMessageStream(stream)`\n\n- `stream`, a `ReadableStream<UIMessageChunk>`\n\nReads the stream to completion and resolves with the final assembled `UIMessage`. Throws if the stream ends without producing a message.\n\n```ts\nconst message = await consumeUIMessageStream<MyUIMessage>(\n  pipe<MyUIMessage>(stream)\n    .filter(includeParts([\"text\"]))\n    .toStream(),\n);\n```\n","readmeFilename":"README.md"}