{"_id":"@agent-widget/react","_rev":"7-f1978dc6cc8ee7b727ec2c173624c78d","name":"@agent-widget/react","dist-tags":{"latest":"0.0.7"},"versions":{"0.0.1":{"name":"@agent-widget/react","version":"0.0.1","keywords":["react","chat","widget","chatbot","ai","agent","typescript","component-library","ui-components"],"author":{"name":"Your Name","email":"your.email@example.com"},"license":"MIT","_id":"@agent-widget/react@0.0.1","maintainers":[{"name":"lo789ye","email":"surpasspluto@gmail.com"}],"homepage":"https://github.com/your-org/agent-widget#readme","bugs":{"url":"https://github.com/your-org/agent-widget/issues"},"dist":{"shasum":"4a7e20111d5c744942e27969a3bb008354d8a261","tarball":"https://registry.npmjs.org/@agent-widget/react/-/react-0.0.1.tgz","fileCount":10,"integrity":"sha512-6T6f4wX28YaakOEGCBPso2m6Y9Zw9K6WZ3xE6LOEkJankWB4Wi4KUY6HJKjWNfHNPn1eJLBraBCnvc90JjEynA==","signatures":[{"sig":"MEUCIBcwfYQ94o8iuXPX9ovQSbCOJuBMOsazPADKBEAHca2zAiEAj5IFC3yzjvf16EFJ4lhCZzYP8TVLTlbuMWSmIT5Ek8s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":634331},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./styles":"./dist/style.css"},"scripts":{"dev":"vite","lint":"eslint .","build":"tsc --noEmit && vite build","preview":"vite preview","build:lib":"vite build --mode lib","prepublishOnly":"npm run build:lib"},"_npmUser":{"name":"lo789ye","email":"surpasspluto@gmail.com"},"repository":{"url":"git+https://github.com/your-org/agent-widget.git","type":"git"},"_npmVersion":"10.9.3","description":"A modern React chat widget component library with AI agent support","directories":{},"_nodeVersion":"22.20.0","dependencies":{"clsx":"^2.1.1","remark-gfm":"^4.0.1","lucide-react":"^0.560.0","eventemitter3":"^5.0.1","react-markdown":"^10.1.0","tailwind-merge":"^3.4.0","class-variance-authority":"^0.7.1"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.2.4","react":"^19.2.0","eslint":"^9.39.1","globals":"^16.5.0","postcss":"^8.5.6","react-dom":"^19.2.0","@eslint/js":"^9.39.1","typescript":"~5.9.3","@types/node":"^24.10.1","tailwindcss":"^4.1.18","@types/react":"^19.2.5","autoprefixer":"^10.4.23","vite-plugin-dts":"^4.5.4","@types/react-dom":"^19.2.3","typescript-eslint":"^8.46.4","@tailwindcss/postcss":"^4.1.18","@vitejs/plugin-react":"^5.1.1","eslint-plugin-react-hooks":"^7.0.1","eslint-plugin-react-refresh":"^0.4.24"},"peerDependencies":{"react":">=18.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/react_0.0.1_1766475666914_0.5603987635022996","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@agent-widget/react","version":"0.0.2","keywords":["react","chat","widget","chatbot","ai","agent","typescript","component-library","ui-components"],"author":{"name":"Your Name","email":"your.email@example.com"},"license":"MIT","_id":"@agent-widget/react@0.0.2","maintainers":[{"name":"lo789ye","email":"surpasspluto@gmail.com"}],"homepage":"https://github.com/your-org/agent-widget#readme","bugs":{"url":"https://github.com/your-org/agent-widget/issues"},"dist":{"shasum":"d4f936046fc8181bfb090fe5fc73c6b4bfdfb58b","tarball":"https://registry.npmjs.org/@agent-widget/react/-/react-0.0.2.tgz","fileCount":10,"integrity":"sha512-p+CI8BYO3QRtHN6qcxD3OyuoVHVKtx5pzgrzQC72BxtSkCAjmGRv48lZ0rBZrh+Fr0FyDqD515UvWRE2QEM2Lg==","signatures":[{"sig":"MEUCIQDTAm5b3HsY5cMw6CFgLOmeFwmrbCJrFSzus9utDuCoOgIgIy49d8umRvubGUimkh2tTf55K/phTjqxnKqRnmjTyl0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1181280},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./styles":"./dist/react.css"},"scripts":{"dev":"vite","lint":"eslint .","build":"tsc --noEmit && vite build","preview":"vite preview","build:lib":"vite build --mode lib","prepublishOnly":"npm run build:lib"},"_npmUser":{"name":"lo789ye","email":"surpasspluto@gmail.com"},"repository":{"url":"git+https://github.com/your-org/agent-widget.git","type":"git"},"_npmVersion":"10.9.3","description":"A modern React chat widget component library with AI agent support","directories":{},"_nodeVersion":"22.20.0","dependencies":{"clsx":"^2.1.1","remark-gfm":"^4.0.1","lucide-react":"^0.560.0","eventemitter3":"^5.0.1","react-markdown":"^10.1.0","tailwind-merge":"^3.4.0","class-variance-authority":"^0.7.1"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.2.4","react":"^19.2.0","eslint":"^9.39.1","globals":"^16.5.0","postcss":"^8.4.32","react-dom":"^19.2.0","@eslint/js":"^9.39.1","typescript":"~5.9.3","@types/node":"^24.10.1","tailwindcss":"^3.4.17","@types/react":"^19.2.5","autoprefixer":"^10.4.16","vite-plugin-dts":"^4.5.4","@types/react-dom":"^19.2.3","typescript-eslint":"^8.46.4","@vitejs/plugin-react":"^5.1.1","eslint-plugin-react-hooks":"^7.0.1","eslint-plugin-react-refresh":"^0.4.24"},"peerDependencies":{"react":">=18.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/react_0.0.2_1766843933017_0.2496485494877847","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@agent-widget/react","version":"0.0.3","keywords":["react","chat","widget","chatbot","ai","agent","typescript","component-library","ui-components"],"author":{"name":"Your Name","email":"your.email@example.com"},"license":"MIT","_id":"@agent-widget/react@0.0.3","maintainers":[{"name":"lo789ye","email":"surpasspluto@gmail.com"}],"homepage":"https://github.com/your-org/agent-widget#readme","bugs":{"url":"https://github.com/your-org/agent-widget/issues"},"dist":{"shasum":"f6aba294602065c3e8d4bd82070e5285243ce150","tarball":"https://registry.npmjs.org/@agent-widget/react/-/react-0.0.3.tgz","fileCount":10,"integrity":"sha512-6J16P3nYecx/BxHT4c6Wbgr3bKb5k3bVZRS+AGnbYAmDEgDx2RFjQvhk8KEb4sbIW1WXUIRuV9bm4jMquTHG/w==","signatures":[{"sig":"MEUCIEi4jjSWmW4plpkO0P5bklWqn79g0ZcC0ZCz9NC0/RSmAiEApU9pMwztJL8yiVptYAtvj9GpmYR8gdlsqpvjb6da8Hw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1196314},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./styles":"./dist/react.css"},"scripts":{"dev":"vite","lint":"eslint .","build":"tsc --noEmit && vite build","preview":"vite preview","build:lib":"vite build --mode lib","prepublishOnly":"npm run build:lib"},"_npmUser":{"name":"lo789ye","email":"surpasspluto@gmail.com"},"repository":{"url":"git+https://github.com/your-org/agent-widget.git","type":"git"},"_npmVersion":"10.9.3","description":"A modern React chat widget component library with AI agent support","directories":{},"_nodeVersion":"22.20.0","dependencies":{"clsx":"^2.1.1","remark-gfm":"^4.0.1","lucide-react":"^0.560.0","eventemitter3":"^5.0.1","react-markdown":"^10.1.0","tailwind-merge":"^3.4.0","class-variance-authority":"^0.7.1"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.2.4","react":"^19.2.0","eslint":"^9.39.1","globals":"^16.5.0","postcss":"^8.4.32","react-dom":"^19.2.0","@eslint/js":"^9.39.1","typescript":"~5.9.3","@types/node":"^24.10.1","tailwindcss":"^3.4.17","@types/react":"^19.2.5","autoprefixer":"^10.4.16","vite-plugin-dts":"^4.5.4","@types/react-dom":"^19.2.3","typescript-eslint":"^8.46.4","@vitejs/plugin-react":"^5.1.1","eslint-plugin-react-hooks":"^7.0.1","eslint-plugin-react-refresh":"^0.4.24"},"peerDependencies":{"react":">=18.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/react_0.0.3_1767102959441_0.28900024563368754","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@agent-widget/react","version":"0.0.4","keywords":["react","chat","widget","chatbot","ai","agent","typescript","component-library","ui-components"],"author":{"name":"Your Name","email":"your.email@example.com"},"license":"MIT","_id":"@agent-widget/react@0.0.4","maintainers":[{"name":"lo789ye","email":"surpasspluto@gmail.com"}],"homepage":"https://github.com/your-org/agent-widget#readme","bugs":{"url":"https://github.com/your-org/agent-widget/issues"},"dist":{"shasum":"308988c0d72bc6c7958f2cc1569f437fbdeb8159","tarball":"https://registry.npmjs.org/@agent-widget/react/-/react-0.0.4.tgz","fileCount":10,"integrity":"sha512-+nBkmFbNDZu2JvLcFwcltvhUR3GyvnjBTj+UkBjkoB37uDMo/tZvUPBQYuUuUr2qwTifMrhc2rmDa357614o4g==","signatures":[{"sig":"MEUCIC4eG676s0jxWwx63waY3C+qV3B0CypWnFb/M0R7qbKtAiEAoy8/tRGqQ2Dl26femxQEXm/zjI8Ii7VFEpE1Z2pCv1c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1528978},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./styles":"./dist/react.css"},"scripts":{"dev":"vite","lint":"eslint .","build":"tsc --noEmit && vite build","preview":"vite preview","build:lib":"vite build --mode lib","prepublishOnly":"npm run build:lib"},"_npmUser":{"name":"lo789ye","email":"surpasspluto@gmail.com"},"repository":{"url":"git+https://github.com/your-org/agent-widget.git","type":"git"},"_npmVersion":"10.9.3","description":"A modern React chat widget component library with AI agent support","directories":{},"_nodeVersion":"22.20.0","dependencies":{"clsx":"^2.1.1","remark-gfm":"^4.0.1","lucide-react":"^0.560.0","eventemitter3":"^5.0.1","react-markdown":"^10.1.0","tailwind-merge":"^3.4.0","class-variance-authority":"^0.7.1"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.2.4","react":"^19.2.0","eslint":"^9.39.1","globals":"^16.5.0","postcss":"^8.4.32","react-dom":"^19.2.0","@eslint/js":"^9.39.1","typescript":"~5.9.3","@types/node":"^24.10.1","tailwindcss":"^3.4.17","@types/react":"^19.2.5","autoprefixer":"^10.4.16","@dnd-kit/core":"^6.3.1","vite-plugin-dts":"^4.5.4","@types/react-dom":"^19.2.3","typescript-eslint":"^8.46.4","@dnd-kit/utilities":"^3.2.2","@vitejs/plugin-react":"^5.1.1","eslint-plugin-react-hooks":"^7.0.1","eslint-plugin-react-refresh":"^0.4.24"},"peerDependencies":{"react":">=18.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/react_0.0.4_1767724478273_0.8212879934597173","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@agent-widget/react","version":"0.0.5","keywords":["react","chat","widget","chatbot","ai","agent","typescript","component-library","ui-components"],"author":{"name":"Your Name","email":"your.email@example.com"},"license":"MIT","_id":"@agent-widget/react@0.0.5","maintainers":[{"name":"lo789ye","email":"surpasspluto@gmail.com"}],"homepage":"https://github.com/your-org/agent-widget#readme","bugs":{"url":"https://github.com/your-org/agent-widget/issues"},"dist":{"shasum":"afdb147f5fa9ce1df637a05055e41605f7533eca","tarball":"https://registry.npmjs.org/@agent-widget/react/-/react-0.0.5.tgz","fileCount":10,"integrity":"sha512-xTmaRdsSxA/uU1mpjYXxkla6gFs+R+wMWSX8AOv9w8GMKp45zUSPdUG12MFWmcCXWm66KztmrgHTINlY4jL/3A==","signatures":[{"sig":"MEYCIQCiPpSoC/I1OHqC3EIK077zFxohSQv5bWlNCRPDawGOTwIhAN34x2tq6ko8S4dpbY2kPbXrRM0H6WvKzeI3Vgl+eX3a","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1628241},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./styles":"./dist/react.css"},"gitHead":"b3a95331a6ff54a84dbefb27168b55286979e545","scripts":{"dev":"vite","lint":"eslint .","build":"tsc --noEmit && vite build","preview":"vite preview","build:lib":"vite build --mode lib","prepublishOnly":"npm run build:lib"},"_npmUser":{"name":"lo789ye","email":"surpasspluto@gmail.com"},"repository":{"url":"git+https://github.com/your-org/agent-widget.git","type":"git"},"_npmVersion":"10.9.3","description":"A modern React chat widget component library with AI agent support","directories":{},"_nodeVersion":"22.20.0","dependencies":{"clsx":"^2.1.1","remark-gfm":"^4.0.1","lucide-react":"^0.560.0","eventemitter3":"^5.0.1","react-markdown":"^10.1.0","tailwind-merge":"^3.4.0","class-variance-authority":"^0.7.1"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.2.4","react":"^19.2.0","eslint":"^9.39.1","globals":"^16.5.0","postcss":"^8.4.32","react-dom":"^19.2.0","@eslint/js":"^9.39.1","typescript":"~5.9.3","@types/node":"^24.10.1","tailwindcss":"^3.4.17","@types/react":"^19.2.5","autoprefixer":"^10.4.16","@dnd-kit/core":"^6.3.1","vite-plugin-dts":"^4.5.4","@types/react-dom":"^19.2.3","typescript-eslint":"^8.46.4","@dnd-kit/utilities":"^3.2.2","@vitejs/plugin-react":"^5.1.1","eslint-plugin-react-hooks":"^7.0.1","eslint-plugin-react-refresh":"^0.4.24"},"peerDependencies":{"react":">=18.0.0","zustand":">=5.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/react_0.0.5_1770428419274_0.0047815775982629205","host":"s3://npm-registry-packages-npm-production"}},"0.0.6":{"name":"@agent-widget/react","version":"0.0.6","keywords":["react","chat","widget","chatbot","ai","agent","typescript","component-library","ui-components"],"author":{"name":"Your Name","email":"your.email@example.com"},"license":"MIT","_id":"@agent-widget/react@0.0.6","maintainers":[{"name":"lo789ye","email":"surpasspluto@gmail.com"}],"homepage":"https://github.com/your-org/agent-widget#readme","bugs":{"url":"https://github.com/your-org/agent-widget/issues"},"dist":{"shasum":"2d7496bd6aebc87693f5e3d60e7352c991f6e957","tarball":"https://registry.npmjs.org/@agent-widget/react/-/react-0.0.6.tgz","fileCount":10,"integrity":"sha512-xFhLXm56BuHwUjG7N//x3WeFHmvLaw99ReMZMt4bGCVZbnbnYNXu9zq3TByG38pR2ijqQBibYdvZ+J0bKJW93w==","signatures":[{"sig":"MEUCIQCh+4pm1Q6t8gyR2toP7NcPLl0yuqZw98g5LZfoYRr7NgIgBIpQYZbcL5jmpxzAFiiWb3rE1A2oZv2zFi83aOGLG4I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1628220},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./styles":"./dist/react.css"},"gitHead":"b3a95331a6ff54a84dbefb27168b55286979e545","scripts":{"dev":"vite","lint":"eslint .","build":"tsc --noEmit && vite build","preview":"vite preview","build:lib":"vite build --mode lib","prepublishOnly":"npm run build:lib"},"_npmUser":{"name":"lo789ye","email":"surpasspluto@gmail.com"},"repository":{"url":"git+https://github.com/your-org/agent-widget.git","type":"git"},"_npmVersion":"10.9.3","description":"A modern React chat widget component library with AI agent support","directories":{},"_nodeVersion":"22.20.0","dependencies":{"clsx":"^2.1.1","remark-gfm":"^4.0.1","lucide-react":"^0.560.0","eventemitter3":"^5.0.1","react-markdown":"^10.1.0","tailwind-merge":"^3.4.0","class-variance-authority":"^0.7.1"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.2.4","react":"^19.2.0","eslint":"^9.39.1","globals":"^16.5.0","postcss":"^8.4.32","react-dom":"^19.2.0","@eslint/js":"^9.39.1","typescript":"~5.9.3","@types/node":"^24.10.1","tailwindcss":"^3.4.17","@types/react":"^19.2.5","autoprefixer":"^10.4.16","@dnd-kit/core":"^6.3.1","vite-plugin-dts":"^4.5.4","@types/react-dom":"^19.2.3","typescript-eslint":"^8.46.4","@dnd-kit/utilities":"^3.2.2","@vitejs/plugin-react":"^5.1.1","eslint-plugin-react-hooks":"^7.0.1","eslint-plugin-react-refresh":"^0.4.24"},"peerDependencies":{"react":">=18.0.0","zustand":">=5.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/react_0.0.6_1770428684691_0.2605477825256768","host":"s3://npm-registry-packages-npm-production"}},"0.0.7":{"name":"@agent-widget/react","version":"0.0.7","description":"A modern React chat widget component library with AI agent support","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"},"./styles":"./dist/react.css"},"scripts":{"dev":"vite","build":"tsc --noEmit && vite build","build:lib":"vite build --mode lib","lint":"eslint .","preview":"vite preview","prepublishOnly":"npm run build:lib"},"keywords":["react","chat","widget","chatbot","ai","agent","typescript","component-library","ui-components"],"author":{"name":"Your Name","email":"your.email@example.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/your-org/agent-widget.git"},"bugs":{"url":"https://github.com/your-org/agent-widget/issues"},"homepage":"https://github.com/your-org/agent-widget#readme","peerDependencies":{"react":">=18.0.0","react-dom":">=18.0.0","zustand":">=5.0.0"},"dependencies":{"class-variance-authority":"^0.7.1","clsx":"^2.1.1","eventemitter3":"^5.0.1","lucide-react":"^0.560.0","react-markdown":"^10.1.0","remark-gfm":"^4.0.1","tailwind-merge":"^3.4.0"},"devDependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/utilities":"^3.2.2","@eslint/js":"^9.39.1","@types/node":"^24.10.1","@types/react":"^18.2.0","@types/react-dom":"^18.2.0","@vitejs/plugin-react":"^5.1.1","autoprefixer":"^10.4.16","eslint":"^9.39.1","eslint-plugin-react-hooks":"^7.0.1","eslint-plugin-react-refresh":"^0.4.24","globals":"^16.5.0","postcss":"^8.4.32","react":"^18.2.0","react-dom":"^18.2.0","tailwindcss":"^3.4.17","typescript":"~5.9.3","typescript-eslint":"^8.46.4","vite":"^7.2.4","vite-plugin-dts":"^4.5.4"},"_id":"@agent-widget/react@0.0.7","gitHead":"b3a95331a6ff54a84dbefb27168b55286979e545","_nodeVersion":"22.20.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-enaNqc6t1jQPqEfXZQY1/6Pkj0eT0mmLEDqsBLLVte0mvIu7/IUqaxivX3vOKtOIjks+10QkoAnnbyoI2+DkAg==","shasum":"4c5323ebc782a40e4e4d6713e40f01605502035a","tarball":"https://registry.npmjs.org/@agent-widget/react/-/react-0.0.7.tgz","fileCount":10,"unpackedSize":1628235,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDOz6CQs1aNOQ1lrgo4e97zAFSnGUSNz4gx+kb4NhvMdQIhAJ91XHaLfb4B72lu1yV9Z4oPlQ4FeQBtME4udMng2mZp"}]},"_npmUser":{"name":"lo789ye","email":"surpasspluto@gmail.com"},"directories":{},"maintainers":[{"name":"lo789ye","email":"surpasspluto@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react_0.0.7_1772186037588_0.8046307283167009"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-23T07:41:06.831Z","modified":"2026-02-27T09:53:57.892Z","0.0.1":"2025-12-23T07:41:07.121Z","0.0.2":"2025-12-27T13:58:53.216Z","0.0.3":"2025-12-30T13:55:59.632Z","0.0.4":"2026-01-06T18:34:38.486Z","0.0.5":"2026-02-07T01:40:19.423Z","0.0.6":"2026-02-07T01:44:44.876Z","0.0.7":"2026-02-27T09:53:57.750Z"},"bugs":{"url":"https://github.com/your-org/agent-widget/issues"},"author":{"name":"Your Name","email":"your.email@example.com"},"license":"MIT","homepage":"https://github.com/your-org/agent-widget#readme","keywords":["react","chat","widget","chatbot","ai","agent","typescript","component-library","ui-components"],"repository":{"type":"git","url":"git+https://github.com/your-org/agent-widget.git"},"description":"A modern React chat widget component library with AI agent support","maintainers":[{"name":"lo789ye","email":"surpasspluto@gmail.com"}],"readme":"\n## 📦 安装\n\n```bash\nnpm install @agent-widget/react zustand\n# 或\nyarn add @agent-widget/react zustand\n# 或\npnpm add @agent-widget/react zustand\n```\n\n> **注意**：本组件库使用 [Zustand](https://github.com/pmndrs/zustand) 进行状态管理，需要同时安装 `zustand` 依赖（版本 >= 5.0.0）。\n\n\n## 🚀 基本使用方法\n\n### 1. 最简单的使用\n\n```tsx\nimport { AgentProvider, ChatWidget } from '@agent-widget/react';\nimport '@agent-widget/react/styles'; // 导入编译好的样式（必须）\n\nfunction App() {\n  return (\n    <AgentProvider appRuntimeUrl=\"http://your-api-endpoint.com/api/v1/chat/stream\">\n      <ChatWidget />\n    </AgentProvider>\n  );\n}\n```\n\n### 2. 完整配置使用\n\n```tsx\nimport { AgentProvider, ChatWidget } from '@agent-widget/react';\nimport '@agent-widget/react/styles';\n\nfunction App() {\n  return (\n    <AgentProvider appRuntimeUrl=\"http://your-api-endpoint.com/api/v1/chat/stream\">\n      <ChatWidget\n        locale=\"cn\"        // 语言：'cn' | 'en'\n        theme=\"dark\"       // 主题：'dark' | 'light'\n        floating={true}    // 是否悬浮模式\n        width=\"800px\"      // 宽度（悬浮模式）\n        height=\"90vh\"      // 高度（悬浮模式）\n        welcomeMessage=\"您好！我是您的AI助手\" // 欢迎消息\n        suggestedPrompts={[  // 建议提示词\n          { tag: \"查询代币\", text: \"查询SOL价格\" },\n          { tag: \"查看余额\", text: \"显示我的钱包余额\" }\n        ]}\n        context={{         // 上下文数据\n          walletAddress: \"0x...\"\n        }}\n      />\n    </AgentProvider>\n  );\n}\n```\n\n### 3. 非悬浮模式（嵌入到容器中）\n\n```tsx\nfunction App() {\n  return (\n    <div style={{ width: '100%', height: '600px' }}>\n      <AgentProvider appRuntimeUrl=\"http://your-api-endpoint.com/api/stream\">\n        <ChatWidget floating={false} />\n      </AgentProvider>\n    </div>\n  );\n}\n```\n\n### 4. 隐藏聊天但保持对话历史\n\n**重要提示**：如果需要隐藏聊天组件但保持对话历史和状态，应该卸载 `ChatWidget` 组件但保留 `AgentProvider`。\n\n```tsx\nfunction App() {\n  const [showChat, setShowChat] = useState(true);\n\n  return (\n    <AgentProvider appRuntimeUrl=\"http://your-api-endpoint.com/api/stream\">\n      <button onClick={() => setShowChat(!showChat)}>\n        {showChat ? '隐藏聊天' : '显示聊天'}\n      </button>\n\n      {/* 条件渲染 ChatWidget，但保留 AgentProvider */}\n      {showChat && <ChatWidget />}\n    </AgentProvider>\n  );\n}\n```\n\n**为什么这样做？**\n- `AgentProvider` 管理全局状态和事件系统，卸载它会丢失所有对话历史\n- `ChatWidget` 只是 UI 展示层，卸载后重新挂载会自动恢复对话状态\n- 这种方式既能节省性能，又能保持用户体验的连续性\n\n## 🎯 事件系统\n\n组件库提供了完整的双向事件系统，允许你监听组件内部事件，也可以向组件发送事件来控制其行为。\n\n### 可监听的组件事件\n\n这些是组件内部触发的事件，你可以监听它们来响应用户操作：\n\n#### 1. `crypto:trade` - 加密货币交易事件\n\ncrypto:trade 事件在用户提交交易表单时触发，支持买入和卖出操作。\n\n```tsx\nimport { useEffect } from 'react';\nimport { useAgent } from '@agent-widget/react';\n\nfunction TradeHandler() {\n  const { eventEmitter } = useAgent();\n\n  useEffect(() => {\n    const handleCryptoTrade = (data) => {\n      console.log('交易请求:', {\n        trade_action: data.trade_action,    // 'buy' 或 'sell'\n        target_token: data.target_token,    // 目标代币地址\n        chain: data.chain,                  // 链名称\n        amount: data.amount,                // 交易数量\n        slippage: data.slippage,            // 滑点\n        priority_fee: data.priority_fee,    // 优先级费用\n        tip_fee: data.tip_fee,              // 小费\n        auto_fee: data.auto_fee,            // 是否自动费用\n        max_auto_fee: data.max_auto_fee,    // 最大自动费用\n        is_anti_mev: data.is_anti_mev,      // 是否防MEV\n        custom_rpc: data.custom_rpc         // 自定义RPC\n      });\n      // 执行交易逻辑...\n    };\n\n    eventEmitter.on('crypto:trade', handleCryptoTrade);\n    return () => eventEmitter.off('crypto:trade', handleCryptoTrade);\n  }, [eventEmitter]);\n\n  return null;\n}\n```\n\n**数据类型**：\n```tsx\ninterface CryptoTradeEventData {\n  trade_action: 'buy' | 'sell';     // 交易动作\n  target_token: string;             // 目标代币地址\n  chain: string;                    // 链名称\n  amount: string;                   // 交易数量\n  slippage: string;                 // 滑点容忍度\n  priority_fee: number;             // 优先级费用\n  tip_fee: number;                  // 小费\n  auto_fee: 0 | 1;                  // 是否自动费用\n  max_auto_fee: string;             // 最大自动费用\n  is_anti_mev: 0 | 1 | 2;           // 是否防MEV\n  custom_rpc?: string;              // 自定义RPC URL\n}\n```\n\n#### 2. `token:info` - 代币详情事件\n\ntoken:info 事件在用户点击代币卡片或查询代币详情时触发。\n\n```tsx\nconst handleTokenInfo = (data) => {\n  console.log('代币详情查询:', {\n    chain: data.chain,\n    token_address: data.token_address\n  });\n  // 查询并显示代币详细信息...\n};\n\neventEmitter.on('token:info', handleTokenInfo);\n```\n\n**数据类型**：\n```tsx\ninterface TokenInfoEventData {\n  chain: string;        // 链名称\n  token_address: string; // 代币合约地址\n}\n```\n\n#### 3. `crypto:send` - 代币发送事件\n\ncrypto:send 事件在用户提交代币转账表单时触发。\n\n```tsx\nconst handleCryptoSend = (data) => {\n  console.log('代币转账:', {\n    chain: data.chain,\n    token_address: data.token_address,\n    to_wallet_address: data.to_wallet_address,\n    amount: data.amount\n  });\n  // 执行转账逻辑...\n};\n\neventEmitter.on('crypto:send', handleCryptoSend);\n```\n\n**数据类型**：\n```tsx\ninterface CryptoSendEventData {\n  chain: string;           // 链名称\n  token_address: string;   // 代币合约地址\n  to_wallet_address: string; // 目标钱包地址\n  amount: string;          // 转账数量\n}\n```\n\n#### 4. `crypto:convert` - 代币转换事件\n\ncrypto:convert 事件在用户提交代币兑换表单时触发。\n\n```tsx\nconst handleCryptoConvert = (data) => {\n  console.log('代币兑换:', {\n    chain: data.chain,\n    from_token_address: data.from_token_address,\n    to_token_address: data.to_token_address,\n    amount: data.amount\n  });\n  // 执行代币兑换逻辑...\n};\n\neventEmitter.on('crypto:convert', handleCryptoConvert);\n```\n\n**数据类型**：\n```tsx\ninterface CryptoConvertEventData {\n  chain: string;              // 链名称\n  from_token_address: string; // 源代币地址\n  to_token_address: string;   // 目标代币地址\n  amount: string;             // 兑换数量\n}\n```\n\n#### 5. `my:wallet` - 钱包事件\n\nmy:wallet 事件在用户点击钱包详情按钮时触发。\n\n```tsx\nconst handleMyWallet = (data) => {\n  console.log('钱包详情:', {\n    chain: data.chain,\n    wallet_address: data.wallet_address\n  });\n  // 显示钱包详细信息...\n};\n\neventEmitter.on('my:wallet', handleMyWallet);\n```\n\n**数据类型**：\n```tsx\ninterface MyWalletEventData {\n  chain: string;        // 链名称\n  wallet_address: string; // 钱包地址\n}\n```\n\n## 💼 WalletBalancesCard 功能\n\n钱包余额卡片提供了丰富的交互功能：\n\n### 点击代币行查看详情\n\n用户可以点击任意代币行来触发 `token:info` 事件，获取该代币的详细信息。\n\n### 复制代币地址\n\n每个代币行左侧都有一个复制按钮，点击可复制代币合约地址到剪贴板。\n\n### 钱包详情按钮\n\n卡片底部的钱包图标按钮用于触发 `my:wallet` 事件，获取完整的钱包信息。\n\n```tsx\n// 监听钱包余额卡片的交互\nfunction WalletMonitor() {\n  const { eventEmitter } = useAgent();\n\n  useEffect(() => {\n    // 监听代币信息查询\n    const handleTokenInfo = (data: TokenInfoEventData) => {\n      console.log('查看代币详情:', data);\n      // 跳转到代币详情页面或显示详细信息\n    };\n\n    // 监听钱包详情查询\n    const handleMyWallet = (data: MyWalletEventData) => {\n      console.log('查看钱包详情:', data);\n      // 显示钱包的完整信息和交易历史\n    };\n\n    eventEmitter.on('token:info', handleTokenInfo);\n    eventEmitter.on('my:wallet', handleMyWallet);\n\n    return () => {\n      eventEmitter.off('token:info', handleTokenInfo);\n      eventEmitter.off('my:wallet', handleMyWallet);\n    };\n  }, [eventEmitter]);\n\n  return null;\n}\n```\n\n### 可发送给组件的事件\n\n这些是你可以向组件发送的事件，用于控制组件行为或更新状态：\n\n#### 1. `trade_status` - 更新交易状态\n\n用于通知组件交易的执行结果（成功或失败）。\n\n```tsx\nimport { useAgent } from '@agent-widget/react';\n\nfunction TradeController() {\n  const { eventEmitter } = useAgent();\n\n  const sendTradeSuccess = () => {\n    eventEmitter.emit('trade_status', {\n      id: 'trade-123',              // 交易ID\n      status: 1,                     // 1=成功, 0=失败\n      tradeHash: '0xabc123...',      // 交易哈希\n      fromAddress: 'So11111...',     // 源代币地址\n      fromName: 'SOL',               // 源代币名称\n      fromImageUrl: 'https://...',   // 源代币图标\n      toAddress: 'EPjFWd...',        // 目标代币地址\n      toName: 'USDC',                // 目标代币名称\n      toImageUrl: 'https://...',     // 目标代币图标\n      amount: '100',                 // 交易数量\n      reason: '交易成功'              // 成功/失败原因\n    });\n  };\n\n  const sendTradeFailure = () => {\n    eventEmitter.emit('trade_status', {\n      id: 'trade-456',\n      status: 0,                     // 0=失败\n      tradeHash: '0xdef456...',\n      amount: '50',\n      reason: '余额不足'              // 失败原因\n    });\n  };\n\n  return (\n    <div>\n      <button onClick={sendTradeSuccess}>模拟成功</button>\n      <button onClick={sendTradeFailure}>模拟失败</button>\n    </div>\n  );\n}\n```\n\n**数据类型**：\n```tsx\ninterface TradeStatusData {\n  id: string;              // 交易唯一ID（必填）\n  status: 0 | 1;           // 状态：0=失败, 1=成功（必填）\n  tradeHash: string;       // 交易哈希（必填）\n  fromAddress?: string;    // 源代币地址\n  fromName?: string;       // 源代币名称\n  fromImageUrl?: string;   // 源代币图标URL\n  toAddress?: string;      // 目标代币地址\n  toName?: string;         // 目标代币名称\n  toImageUrl?: string;     // 目标代币图标URL\n  amount?: string;         // 交易数量\n  reason?: string;         // 成功/失败原因说明\n}\n```\n\n#### 2. `clear_chat` - 清空聊天记录\n\n清空所有聊天消息。\n\n```tsx\nimport { useAgent } from '@agent-widget/react';\n\nfunction ClearButton() {\n  const { eventEmitter } = useAgent();\n\n  const handleClear = () => {\n    eventEmitter.emit('clear_chat');\n  };\n\n  return <button onClick={handleClear}>清空聊天</button>;\n}\n```\n\n### 完整示例：监听所有事件\n\n```tsx\nimport { useEffect } from 'react';\nimport { useAgent } from '@agent-widget/react';\nimport type {\n  CryptoTradeEventData,\n  TokenInfoEventData,\n  CryptoSendEventData,\n  CryptoConvertEventData,\n  MyWalletEventData\n} from '@agent-widget/react';\n\nfunction EventMonitor() {\n  const { eventEmitter } = useAgent();\n\n  useEffect(() => {\n    // 1. 监听交易相关事件\n    const handleCryptoTrade = (data: CryptoTradeEventData) => {\n      console.log('💰 Crypto Trade:', data);\n      // 执行交易逻辑\n    };\n\n    // 2. 监听代币详情事件\n    const handleTokenInfo = (data: TokenInfoEventData) => {\n      console.log('ℹ️ Token Info:', data);\n      // 查询代币信息\n    };\n\n    // 3. 监听代币发送事件\n    const handleCryptoSend = (data: CryptoSendEventData) => {\n      console.log('📤 Crypto Send:', data);\n      // 执行转账逻辑\n    };\n\n    // 4. 监听代币转换事件\n    const handleCryptoConvert = (data: CryptoConvertEventData) => {\n      console.log('🔄 Crypto Convert:', data);\n      // 执行兑换逻辑\n    };\n\n    // 5. 监听钱包事件\n    const handleMyWallet = (data: MyWalletEventData) => {\n      console.log('👛 My Wallet:', data);\n      // 查询钱包详情\n    };\n\n    // 注册事件监听\n    eventEmitter.on('crypto:trade', handleCryptoTrade);\n    eventEmitter.on('token:info', handleTokenInfo);\n    eventEmitter.on('crypto:send', handleCryptoSend);\n    eventEmitter.on('crypto:convert', handleCryptoConvert);\n    eventEmitter.on('my:wallet', handleMyWallet);\n\n    // 清理函数\n    return () => {\n      eventEmitter.off('crypto:trade', handleCryptoTrade);\n      eventEmitter.off('token:info', handleTokenInfo);\n      eventEmitter.off('crypto:send', handleCryptoSend);\n      eventEmitter.off('crypto:convert', handleCryptoConvert);\n      eventEmitter.off('my:wallet', handleMyWallet);\n    };\n  }, [eventEmitter]);\n\n  return null;\n}\n```\n","readmeFilename":"README.md"}