{"_id":"@astermind/evo-virtual-assistant-template","_rev":"5-37ab5ae8c34cb3397c4ce1e67a9a6faf","name":"@astermind/evo-virtual-assistant-template","dist-tags":{"latest":"2.5.14"},"versions":{"2.3.37":{"name":"@astermind/evo-virtual-assistant-template","version":"2.3.37","keywords":["virtual-assistant","widget","react","astermind","rag","ai","embed","assistant-widget","ai-assistant","vanilla-js","embeddable","web-component"],"author":{"name":"AsterMind Team"},"license":"MIT","_id":"@astermind/evo-virtual-assistant-template@2.3.37","maintainers":[{"name":"spockinnator","email":"tim@astermind.ai"},{"name":"clockworksyler","email":"clockworksyler@gmail.com"}],"homepage":"https://astermind.ai","dist":{"shasum":"165001b961b00b15bf82c4de6cd6dc5b4ee617b0","tarball":"https://registry.npmjs.org/@astermind/evo-virtual-assistant-template/-/evo-virtual-assistant-template-2.3.37.tgz","fileCount":59,"integrity":"sha512-aiCwEZMastKNV8qGAF46QwNSlilJFq+HgNOciQv9O3j4YwfcFmUvNGDz+MGXhBi2wW3ZdAq7ZG1GLASqRrtp3Q==","signatures":[{"sig":"MEQCIBtpch+xVFYftw19xRuC+/tHewPxmHPN4Q1deCZaoM+mAiAaR90cTvzsZa6rtKdj1V+3SA+V11SL4nGtKoEQNvqrrg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1302610},"main":"dist/evo-virtual-assistant.umd.js","type":"module","types":"dist/index.d.ts","module":"dist/evo-virtual-assistant.esm.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/evo-virtual-assistant.esm.js","require":"./dist/evo-virtual-assistant.umd.js"},"./styles":"./dist/evo-virtual-assistant.css","./standalone":"./dist/evo-virtual-assistant.min.js"},"gitHead":"51407dc411a630ce2478e8f439c4454c9347cc9e","scripts":{"dev":"rollup -c -w","lint":"eslint src/","test":"vitest run","build":"rollup -c && npm run build:css","clean":"rm -rf dist","verify":"npm run build:prod && npm run typecheck && npm run test && npm audit","lint:fix":"eslint src/ --fix","prebuild":"node scripts/bump-version.js","build:css":"postcss src/styles/index.css -o dist/evo-virtual-assistant.css","typecheck":"tsc --noEmit","build:prod":"npm run clean && npm run build","test:watch":"vitest","test:coverage":"vitest --coverage","version:major":"node scripts/bump-version.js major","version:minor":"node scripts/bump-version.js minor","version:patch":"node scripts/bump-version.js patch","prepublishOnly":"npm run verify"},"_npmUser":{"name":"spockinnator","email":"tim@astermind.ai"},"_npmVersion":"10.8.2","description":"Embeddable AI virtual assistant widget with React support for AsterMind RAG","directories":{},"sideEffects":["*.css"],"_nodeVersion":"20.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jsdom":"^27.4.0","react":"^18.0.0","tslib":"^2.8.1","rollup":"^4.59.0","vitest":"^4.0.17","cssnano":"^6.0.0","postcss":"^8.0.0","react-dom":"^18.0.0","typescript":"^5.0.0","postcss-cli":"^10.0.0","@types/react":"^18.0.0","autoprefixer":"^10.0.0","postcss-import":"^16.1.1","@types/react-dom":"^18.0.0","@rollup/plugin-terser":"^1.0.0","@rollup/plugin-replace":"^5.0.0","@testing-library/react":"^16.3.1","@rollup/plugin-commonjs":"^29.0.0","@rollup/plugin-typescript":"^11.0.0","@testing-library/jest-dom":"^6.9.1","@rollup/plugin-node-resolve":"^15.0.0","@astermind/evo-virtual-assistant-client":"file:../evo-virtual-assistant-client"},"peerDependencies":{"react":"^17.0.0 || ^18.0.0 || ^19.0.0","react-dom":"^17.0.0 || ^18.0.0 || ^19.0.0"},"peerDependenciesMeta":{"react":{"optional":true},"react-dom":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/evo-virtual-assistant-template_2.3.37_1775232229521_0.5623205272246157","host":"s3://npm-registry-packages-npm-production"}},"2.3.40":{"name":"@astermind/evo-virtual-assistant-template","version":"2.3.40","keywords":["virtual-assistant","widget","react","astermind","rag","ai","embed","assistant-widget","ai-assistant","vanilla-js","embeddable","web-component"],"author":{"name":"AsterMind Team"},"license":"MIT","_id":"@astermind/evo-virtual-assistant-template@2.3.40","maintainers":[{"name":"spockinnator","email":"tim@astermind.ai"},{"name":"clockworksyler","email":"clockworksyler@gmail.com"}],"homepage":"https://astermind.ai","dist":{"shasum":"84f1450346c4824b6e4372fb299a950a6bc0fd8f","tarball":"https://registry.npmjs.org/@astermind/evo-virtual-assistant-template/-/evo-virtual-assistant-template-2.3.40.tgz","fileCount":59,"integrity":"sha512-N2rIntViIKekHDAydeG6AGOklegDqJZrC2Tszo8uhRy16axplIfBvjRs0mc80XyxC9r8niJbMsSI5dDcalLbeg==","signatures":[{"sig":"MEQCIDh2Dg+hSgGXafp9/UNoBEG4P7HA7wsbCR653zsETUY5AiBlG610foJNU6NcA5Uem2QzSiScZl2nmU+963XMpYPzZg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1302610},"main":"dist/evo-virtual-assistant.umd.js","type":"module","types":"dist/index.d.ts","module":"dist/evo-virtual-assistant.esm.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/evo-virtual-assistant.esm.js","require":"./dist/evo-virtual-assistant.umd.js"},"./styles":"./dist/evo-virtual-assistant.css","./standalone":"./dist/evo-virtual-assistant.min.js"},"gitHead":"050cc1a7aa6d21832505b503aa44c76173871600","scripts":{"dev":"rollup -c -w","lint":"eslint src/","test":"vitest run","build":"rollup -c && npm run build:css","clean":"rm -rf dist","verify":"npm run build:prod && npm run typecheck && npm run test && npm audit","lint:fix":"eslint src/ --fix","prebuild":"node scripts/bump-version.js","build:css":"postcss src/styles/index.css -o dist/evo-virtual-assistant.css","typecheck":"tsc --noEmit","build:prod":"npm run clean && npm run build","test:watch":"vitest","test:coverage":"vitest --coverage","version:major":"node scripts/bump-version.js major","version:minor":"node scripts/bump-version.js minor","version:patch":"node scripts/bump-version.js patch","prepublishOnly":"npm run verify"},"_npmUser":{"name":"spockinnator","email":"tim@astermind.ai"},"_npmVersion":"10.8.2","description":"Embeddable AI virtual assistant widget with React support for AsterMind RAG","directories":{},"sideEffects":["*.css"],"_nodeVersion":"20.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jsdom":"^27.4.0","react":"^18.0.0","tslib":"^2.8.1","rollup":"^4.59.0","vitest":"^4.0.17","cssnano":"^6.0.0","postcss":"^8.0.0","react-dom":"^18.0.0","typescript":"^5.0.0","postcss-cli":"^10.0.0","@types/react":"^18.0.0","autoprefixer":"^10.0.0","postcss-import":"^16.1.1","@types/react-dom":"^18.0.0","@rollup/plugin-terser":"^1.0.0","@rollup/plugin-replace":"^5.0.0","@testing-library/react":"^16.3.1","@rollup/plugin-commonjs":"^29.0.0","@rollup/plugin-typescript":"^11.0.0","@testing-library/jest-dom":"^6.9.1","@rollup/plugin-node-resolve":"^15.0.0","@astermind/evo-virtual-assistant-client":"file:../evo-virtual-assistant-client"},"peerDependencies":{"react":"^17.0.0 || ^18.0.0 || ^19.0.0","react-dom":"^17.0.0 || ^18.0.0 || ^19.0.0"},"peerDependenciesMeta":{"react":{"optional":true},"react-dom":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/evo-virtual-assistant-template_2.3.40_1775236053149_0.7769895638051729","host":"s3://npm-registry-packages-npm-production"}},"2.3.46":{"name":"@astermind/evo-virtual-assistant-template","version":"2.3.46","keywords":["virtual-assistant","widget","react","astermind","rag","ai","embed","assistant-widget","ai-assistant","vanilla-js","embeddable","web-component"],"author":{"name":"AsterMind Team"},"license":"MIT","_id":"@astermind/evo-virtual-assistant-template@2.3.46","maintainers":[{"name":"spockinnator","email":"tim@astermind.ai"},{"name":"clockworksyler","email":"clockworksyler@gmail.com"}],"homepage":"https://astermind.ai","dist":{"shasum":"3f7d02c4706500a471fa6d739273ff1ae724959c","tarball":"https://registry.npmjs.org/@astermind/evo-virtual-assistant-template/-/evo-virtual-assistant-template-2.3.46.tgz","fileCount":85,"integrity":"sha512-/51LZN7BvJCHLXUhgmSb+hk885IyoySWmhlmNjYMrcM9XCA1YrfLT7oGGt7toQyPP16Pw3UcA5wF2UkMb6xV4A==","signatures":[{"sig":"MEYCIQDaGBrgRrH6U5s7FZDLXsQ/1fyPLKOIM3jbVgmtzfgyMgIhAN/fQlPKbJJbS74DSFRqaFvtl3616D0T8R6HwRXCXIou","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1576013},"main":"dist/evo-virtual-assistant.umd.js","type":"module","types":"dist/index.d.ts","module":"dist/evo-virtual-assistant.esm.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/evo-virtual-assistant.esm.js","require":"./dist/evo-virtual-assistant.umd.js"},"./styles":"./dist/evo-virtual-assistant.css","./standalone":"./dist/evo-virtual-assistant.min.js"},"gitHead":"6ab415542e9db1b7a75c171c970aaefee679c6ad","scripts":{"dev":"rollup -c -w","lint":"eslint src/","test":"vitest run","build":"rollup -c && npm run build:css","clean":"rm -rf dist","verify":"npm run build:prod && npm run typecheck && npm run test && npm audit","lint:fix":"eslint src/ --fix","prebuild":"node scripts/bump-version.js","build:css":"postcss src/styles/index.css -o dist/evo-virtual-assistant.css","typecheck":"tsc --noEmit","build:prod":"npm run clean && npm run build","test:watch":"vitest","test:coverage":"vitest --coverage","version:major":"node scripts/bump-version.js major","version:minor":"node scripts/bump-version.js minor","version:patch":"node scripts/bump-version.js patch","prepublishOnly":"npm run verify"},"_npmUser":{"name":"spockinnator","email":"tim@astermind.ai"},"_npmVersion":"10.8.2","description":"Embeddable AI virtual assistant widget with React support for AsterMind RAG","directories":{},"sideEffects":["*.css"],"_nodeVersion":"20.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jsdom":"^27.4.0","react":"^18.0.0","tslib":"^2.8.1","rollup":"^4.59.0","vitest":"^4.0.17","cssnano":"^6.0.0","postcss":"^8.0.0","react-dom":"^18.0.0","typescript":"^5.0.0","postcss-cli":"^10.0.0","@types/react":"^18.0.0","autoprefixer":"^10.0.0","postcss-import":"^16.1.1","@types/react-dom":"^18.0.0","@rollup/plugin-terser":"^1.0.0","@rollup/plugin-replace":"^5.0.0","@testing-library/react":"^16.3.1","@rollup/plugin-commonjs":"^29.0.0","@rollup/plugin-typescript":"^11.0.0","@testing-library/jest-dom":"^6.9.1","@rollup/plugin-node-resolve":"^15.0.0","@astermind/evo-virtual-assistant-client":"file:../evo-virtual-assistant-client"},"peerDependencies":{"react":"^17.0.0 || ^18.0.0 || ^19.0.0","react-dom":"^17.0.0 || ^18.0.0 || ^19.0.0"},"peerDependenciesMeta":{"react":{"optional":true},"react-dom":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/evo-virtual-assistant-template_2.3.46_1777466397251_0.8249350295287234","host":"s3://npm-registry-packages-npm-production"}},"2.5.2":{"name":"@astermind/evo-virtual-assistant-template","version":"2.5.2","keywords":["virtual-assistant","widget","react","astermind","rag","ai","embed","assistant-widget","ai-assistant","vanilla-js","embeddable","web-component"],"author":{"name":"AsterMind Team"},"license":"MIT","_id":"@astermind/evo-virtual-assistant-template@2.5.2","maintainers":[{"name":"spockinnator","email":"tim@astermind.ai"},{"name":"clockworksyler","email":"clockworksyler@gmail.com"}],"homepage":"https://astermind.ai","dist":{"shasum":"966a37844eb4e4ea9446d55f5a2a34ee2451fba8","tarball":"https://registry.npmjs.org/@astermind/evo-virtual-assistant-template/-/evo-virtual-assistant-template-2.5.2.tgz","fileCount":85,"integrity":"sha512-23Ok8IfsCELYp/Ib2OqpPh3esM4h4FrWc00MMCECS2BdJsH+Y3snsjGqSKl9wgxRF3LbwA56xmFUPv93+eiCFw==","signatures":[{"sig":"MEUCIAcAHojAcLtj+qMCfPIJ8PrXcG/MqhVeh/JviwKTzFTRAiEAjAd1u+85pfQGs/dXujSa3xlpKGVVnNRxUgC+JmvkP64=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1605544},"main":"dist/evo-virtual-assistant.umd.js","type":"module","types":"dist/index.d.ts","module":"dist/evo-virtual-assistant.esm.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/evo-virtual-assistant.esm.js","require":"./dist/evo-virtual-assistant.umd.js"},"./styles":"./dist/evo-virtual-assistant.css","./standalone":"./dist/evo-virtual-assistant.min.js"},"gitHead":"6ab415542e9db1b7a75c171c970aaefee679c6ad","scripts":{"dev":"rollup -c -w","lint":"eslint src/","test":"vitest run","build":"rollup -c && npm run build:css","clean":"rm -rf dist","verify":"npm run build:prod && npm run typecheck && npm run test && npm audit","lint:fix":"eslint src/ --fix","prebuild":"node scripts/bump-version.js","build:css":"postcss src/styles/index.css -o dist/evo-virtual-assistant.css","typecheck":"tsc --noEmit","build:prod":"npm run clean && npm run build","test:watch":"vitest","test:coverage":"vitest --coverage","version:major":"node scripts/bump-version.js major","version:minor":"node scripts/bump-version.js minor","version:patch":"node scripts/bump-version.js patch","prepublishOnly":"npm run verify"},"_npmUser":{"name":"spockinnator","email":"tim@astermind.ai"},"_npmVersion":"10.8.2","description":"Embeddable AI virtual assistant widget with React support for AsterMind RAG","directories":{},"sideEffects":["*.css"],"_nodeVersion":"20.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jsdom":"^27.4.0","react":"^18.0.0","tslib":"^2.8.1","rollup":"^4.59.0","vitest":"^4.0.17","cssnano":"^6.0.0","postcss":"^8.0.0","react-dom":"^18.0.0","typescript":"^5.0.0","postcss-cli":"^10.0.0","@types/react":"^18.0.0","autoprefixer":"^10.0.0","postcss-import":"^16.1.1","@types/react-dom":"^18.0.0","@rollup/plugin-terser":"^1.0.0","@rollup/plugin-replace":"^5.0.0","@testing-library/react":"^16.3.1","@rollup/plugin-commonjs":"^29.0.0","@rollup/plugin-typescript":"^11.0.0","@testing-library/jest-dom":"^6.9.1","@rollup/plugin-node-resolve":"^15.0.0","@astermind/evo-virtual-assistant-client":"file:../evo-virtual-assistant-client"},"peerDependencies":{"react":"^17.0.0 || ^18.0.0 || ^19.0.0","react-dom":"^17.0.0 || ^18.0.0 || ^19.0.0"},"peerDependenciesMeta":{"react":{"optional":true},"react-dom":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/evo-virtual-assistant-template_2.5.2_1777596109814_0.4353240142114332","host":"s3://npm-registry-packages-npm-production"}},"2.5.14":{"name":"@astermind/evo-virtual-assistant-template","version":"2.5.14","description":"Embeddable AI virtual assistant widget with React support for AsterMind RAG","type":"module","main":"dist/evo-virtual-assistant.umd.js","module":"dist/evo-virtual-assistant.esm.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/evo-virtual-assistant.esm.js","require":"./dist/evo-virtual-assistant.umd.js"},"./styles":"./dist/evo-virtual-assistant.css","./standalone":"./dist/evo-virtual-assistant.min.js"},"sideEffects":["*.css"],"engines":{"node":">=18.0.0"},"scripts":{"prebuild":"node scripts/bump-version.js","build":"node scripts/build.js && npm run build:css","build:css":"node scripts/build-css.js src/styles/index.css dist/evo-virtual-assistant.css","build:prod":"npm run clean && npm run build","clean":"rm -rf dist","dev":"rollup -c rollup-iife.config.js -w","test":"vitest run","test:watch":"vitest","test:coverage":"vitest --coverage","typecheck":"tsc --noEmit","verify":"npm run build:prod && npm run typecheck && npm run test && node --test scripts/__tests__/ && npm audit && node scripts/check-deps.js && node scripts/check-bundle-size.js","prepublishOnly":"npm run verify","version:patch":"node scripts/bump-version.js patch","version:minor":"node scripts/bump-version.js minor","version:major":"node scripts/bump-version.js major"},"peerDependencies":{"react":"^17.0.0 || ^18.0.0 || ^19.0.0","react-dom":"^17.0.0 || ^18.0.0 || ^19.0.0"},"peerDependenciesMeta":{"react":{"optional":true},"react-dom":{"optional":true}},"devDependencies":{"@astermind/evo-virtual-assistant-client":"file:../evo-virtual-assistant-client","@rollup/plugin-commonjs":"^29.0.0","@rollup/plugin-node-resolve":"^15.0.0","@rollup/plugin-replace":"^5.0.0","@rollup/plugin-terser":"^1.0.0","@rollup/plugin-typescript":"^11.0.0","@testing-library/jest-dom":"^6.9.1","@testing-library/react":"^16.3.1","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","jsdom":"^27.4.0","react":"^18.0.0","react-dom":"^18.0.0","rollup":"^4.59.0","typescript":"^5.0.0","vitest":"^4.0.17"},"keywords":["virtual-assistant","widget","react","astermind","rag","ai","embed","assistant-widget","ai-assistant","vanilla-js","embeddable","web-component"],"author":{"name":"AsterMind Team"},"license":"MIT","publishConfig":{"access":"public"},"homepage":"https://astermind.ai","_id":"@astermind/evo-virtual-assistant-template@2.5.14","gitHead":"b36b55b2d8f52e78273e3912ab954eb76528c22c","_nodeVersion":"20.19.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-i2n7Nktg4N0C11Ghv2S60i84D9aZGXK7OplIstcpDDGQ9Wem25cgYvablTFsfalajEfBtucK879xx8U50YXxXA==","shasum":"e9858a9159fd000d911c64ee955b37811977fd07","tarball":"https://registry.npmjs.org/@astermind/evo-virtual-assistant-template/-/evo-virtual-assistant-template-2.5.14.tgz","fileCount":115,"unpackedSize":1801800,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBFJYACmNS///mBwBSIrdlj3OL1iB+BqfpKjo8fwecssAiAOFdzVWok7pxuGHK3VWOipOUrtc2HfOmcc3yQ76r+Ggg=="}]},"_npmUser":{"name":"spockinnator","email":"tim@astermind.ai"},"directories":{},"maintainers":[{"name":"spockinnator","email":"tim@astermind.ai"},{"name":"clockworksyler","email":"clockworksyler@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/evo-virtual-assistant-template_2.5.14_1778616594736_0.8501717101452471"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-03T16:03:49.425Z","modified":"2026-05-12T20:09:55.155Z","2.3.37":"2026-04-03T16:03:49.767Z","2.3.40":"2026-04-03T17:07:33.465Z","2.3.46":"2026-04-29T12:39:57.483Z","2.5.2":"2026-05-01T00:41:49.966Z","2.5.14":"2026-05-12T20:09:54.997Z"},"author":{"name":"AsterMind Team"},"license":"MIT","homepage":"https://astermind.ai","keywords":["virtual-assistant","widget","react","astermind","rag","ai","embed","assistant-widget","ai-assistant","vanilla-js","embeddable","web-component"],"description":"Embeddable AI virtual assistant widget with React support for AsterMind RAG","maintainers":[{"name":"spockinnator","email":"tim@astermind.ai"},{"name":"clockworksyler","email":"clockworksyler@gmail.com"}],"readme":"# @astermind/evo-virtual-assistant-template\n\nEmbeddable AI virtual assistant widget for [AsterMind](https://astermind.ai) RAG - a drop-in chat UI that connects to your AsterMind backend with full agentic capabilities.\n\n[![npm version](https://img.shields.io/npm/v/@astermind/evo-virtual-assistant-template.svg)](https://www.npmjs.com/package/@astermind/evo-virtual-assistant-template)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n---\n\n## Table of Contents\n\n- [Architecture](#architecture)\n- [Features](#features)\n- [Installation](#installation)\n- [Quick Start](#quick-start)\n- [Configuration in Your Application](#configuration-in-your-application)\n- [Configuration Reference](#configuration-reference)\n- [Theming](#theming)\n- [Animated Loading Indicator](#animated-loading-indicator)\n- [Markdown & Code Blocks](#markdown--code-blocks)\n- [Source Citations](#source-citations)\n- [React Hooks API](#react-hooks-api)\n- [Components API](#components-api)\n- [TypeScript Support](#typescript-support)\n- [Troubleshooting](#troubleshooting)\n- [Browser Support](#browser-support)\n- [License](#license)\n\n---\n\n## Architecture\n\nThis package is the **UI layer** for the AsterMind Virtual Assistant system. It provides pre-built React components and hooks for embedding a virtual assistant in your application.\n\n### Package Dependencies\n\n```\nYour Application\n    │\n    └── @astermind/evo-virtual-assistant-template (this package - UI components)\n            │\n            └── @astermind/evo-virtual-assistant-client (required - API client)\n```\n\n**Important**: `@astermind/evo-virtual-assistant-client` is automatically installed as a dependency. It provides:\n\n- **API Communication** - Connects to your AsterMind backend\n- **Streaming Responses** - SSE-based token-by-token message display\n- **Offline Fallback** - Local RAG processing with IndexedDB cache\n- **Agentic Capabilities** - DOM interactions (optional, tree-shakeable)\n\n### Where to Configure\n\nAll configuration is done in **your application code**, not in node_modules:\n\n| Configuration Method | Where to Set |\n|---------------------|--------------|\n| React Props | In your component: `<VirtualAssistantWidget apiKey=\"...\" />` |\n| Environment Variables | In your `.env` file |\n| SSR Injection | In your server template |\n| Global Object | In your HTML/JS before loading |\n| Data Attributes | On your script tag |\n\n---\n\n## Features\n\n### Core Widget Features (this package)\n\n- **Embeddable Floating Chat Bubble** - Position anywhere on the page (4 corners)\n- **React Components Library** - 11 fully customizable components\n- **Vanilla JS Standalone Bundle** - IIFE format with React bundled for non-React sites\n- **Full TypeScript Support** - Complete type definitions exported\n- **Theming System** - 20+ CSS custom properties for full visual customization\n\n### RAG & Backend Features (via evo-virtual-assistant-client)\n\n- **AsterMind Backend Integration** - Connects to `/api/external/chat` endpoints\n- **Streaming Responses** - SSE-based token-by-token message display\n- **Source Citations** - Collapsible source references with confidence levels\n- **Session Management** - Automatic sessionId handling across conversations\n- **Offline Fallback** - Local RAG processing when backend is unavailable\n- **Connection Status** - Automatic online/offline/connecting/error states\n\n### Agentic Capabilities (via evo-virtual-assistant-client)\n\nWhen enabled, the virtual assistant can perform actions on your page:\n\n- **Navigation Actions** - Navigate users to specific pages\n- **Form Filling** - Auto-fill form fields with suggested values\n- **Element Clicking** - Programmatically click buttons and links\n- **Modal Triggering** - Open dialogs and modals\n- **Scrolling** - Scroll to specific elements\n- **Element Highlighting** - Draw attention to page elements\n- **Custom Action Handlers** - Define your own action types\n\nAgentic capabilities are tree-shakeable - they're only included in your bundle if you import and use them.\n\n---\n\n## Installation\n\n### NPM (React Projects)\n\n```bash\nnpm install @astermind/evo-virtual-assistant-template\n```\n\nThis automatically installs `@astermind/evo-virtual-assistant-client` as a dependency.\n\n**Required imports** — add both of these to your component file:\n\n```tsx\nimport { VirtualAssistantWidget } from '@astermind/evo-virtual-assistant-template';\nimport '@astermind/evo-virtual-assistant-template/styles';  // Required — loads the virtual assistant CSS\n```\n\n> **Note:** The styles import is required for the widget to render correctly. Without it, the virtual assistant will appear unstyled.\n\n### CDN (Vanilla JS)\n\nInclude **both** the stylesheet and the script in your HTML — the CSS is required for the widget to render correctly:\n\n```html\n<!-- Required: Virtual Assistant styles -->\n<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/@astermind/evo-virtual-assistant-template/dist/evo-virtual-assistant.css\">\n\n<!-- Required: Virtual Assistant widget (standalone bundle with React included) -->\n<script src=\"https://cdn.jsdelivr.net/npm/@astermind/evo-virtual-assistant-template/dist/evo-virtual-assistant.min.js\"></script>\n```\n\n---\n\n## Quick Start\n\n### React Usage\n\n```tsx\nimport { VirtualAssistantWidget } from '@astermind/evo-virtual-assistant-template';\nimport '@astermind/evo-virtual-assistant-template/styles';\n\nfunction App() {\n  return (\n    <VirtualAssistantWidget\n      apiUrl=\"https://your-api-url.com\"\n      apiKey=\"am_your-api-key\"\n      position=\"bottom-right\"\n      greeting=\"Hi! How can I help you today?\"\n    />\n  );\n}\n```\n\n### Vanilla JS Usage\n\n```html\n<!DOCTYPE html>\n<html>\n<head>\n  <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/@astermind/evo-virtual-assistant-template/dist/evo-virtual-assistant.css\">\n</head>\n<body>\n  <script src=\"https://cdn.jsdelivr.net/npm/@astermind/evo-virtual-assistant-template/dist/evo-virtual-assistant.min.js\"></script>\n  <script>\n    AsterMindVirtualAssistant.init({\n      apiUrl: 'https://your-api-url.com',\n      apiKey: 'am_your-api-key',\n      position: 'bottom-right',\n      greeting: 'Hi! How can I help you today?'\n    });\n  </script>\n</body>\n</html>\n```\n\n---\n\n## Configuration in Your Application\n\nAll configuration is done in **your application code**. The evo-virtual-assistant-template reads configuration from several sources in your project.\n\n### React Applications\n\n**Option 1: Pass props directly**\n```tsx\n<VirtualAssistantWidget\n  apiUrl=\"https://api.astermind.ai\"\n  apiKey=\"am_your-api-key\"\n  position=\"bottom-right\"\n/>\n```\n\n**Option 2: Use environment variables**\n\nCreate a `.env` file in your project root:\n\n```env\n# Vite projects\nVITE_ASTERMIND_RAG_API_KEY=am_your_api_key\nVITE_ASTERMIND_RAG_API_SERVER_URL=https://api.astermind.ai\n\n# Create React App projects\nREACT_APP_ASTERMIND_RAG_API_KEY=am_your_api_key\nREACT_APP_ASTERMIND_RAG_API_SERVER_URL=https://api.astermind.ai\n```\n\nThen use the widget without explicit props:\n```tsx\n<VirtualAssistantWidget position=\"bottom-right\" />\n```\n\n### Vanilla JS Applications\n\n**Option 1: Pass config to init()**\n```javascript\nAsterMindVirtualAssistant.init({\n  apiKey: 'am_your_api_key',\n  apiUrl: 'https://api.astermind.ai',\n  position: 'bottom-right'\n});\n```\n\n**Option 2: Global config object**\n```html\n<script>\n  window.astermindConfig = {\n    apiKey: 'am_your_api_key',\n    apiUrl: 'https://api.astermind.ai'\n  };\n</script>\n<script src=\"evo-virtual-assistant.min.js\"></script>\n<script>\n  AsterMindVirtualAssistant.init();\n</script>\n```\n\n**Option 3: Script data attributes**\n```html\n<script\n  src=\"evo-virtual-assistant.min.js\"\n  data-astermind-key=\"am_your_api_key\"\n  data-astermind-url=\"https://api.astermind.ai\"\n></script>\n```\n\n### SSR / Server-Side Rendering\n\nFor Next.js, Nuxt, or other SSR frameworks:\n\n```html\n<script>\n  window.__ASTERMIND_CONFIG__ = {\n    apiKey: '<%= process.env.ASTERMIND_RAG_API_KEY %>',\n    apiUrl: '<%= process.env.ASTERMIND_RAG_API_SERVER_URL %>'\n  };\n</script>\n```\n\n---\n\n## Configuration Reference\n\n### Configuration Priority\n\nThe widget supports multiple configuration methods with this priority (highest to lowest):\n\n1. **Props / init() config** - Direct configuration passed to the component or `init()` function\n2. **Environment variables** - `VITE_ASTERMIND_RAG_API_KEY`, `REACT_APP_ASTERMIND_RAG_API_KEY`\n3. **SSR-injected config** - `window.__ASTERMIND_CONFIG__`\n4. **Global object** - `window.astermindConfig`\n5. **Script data attributes** - `data-astermind-key`, `data-astermind-url`\n\n### API Key and URL\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `apiKey` | `string` | (from env) | Your AsterMind API key (starts with `am_`). Falls back to environment variables. |\n| `apiUrl` | `string` | `'https://api.astermind.ai'` | Backend API URL. Falls back to environment variables. |\n| `throwOnMissingKey` | `boolean` | `true` | Throw error if API key is missing. Set to `false` to log warning instead. |\n\n### Widget Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `position` | `'bottom-right' \\| 'bottom-left' \\| 'top-right' \\| 'top-left'` | `'bottom-right'` | Widget position on screen |\n| `greeting` | `string` | `'Hi! How can I help you today?'` | Initial greeting message |\n| `placeholder` | `string` | `'Type your message...'` | Input placeholder text |\n| `headerTitle` | `string` | `'AsterMind'` | Chat window header title |\n| `headerSubtitle` | `string` | `'AI Assistant'` | Chat window header subtitle |\n| `defaultOpen` | `boolean` | `false` | Start with chat window open |\n| `showPoweredBy` | `boolean` | `true` | Show \"Powered by AsterMind\" badge |\n| `zIndex` | `number` | `9999` | Z-index for the widget |\n\n### Theme Options\n\nCustomize appearance via the `theme` object:\n\n```javascript\n{\n  theme: {\n    primaryColor: '#4F46E5',\n    primaryHover: '#4338CA',\n    backgroundColor: '#ffffff',\n    surfaceColor: '#f3f4f6',\n    textColor: '#1f2937',\n    textMuted: '#6b7280',\n    borderColor: '#e5e7eb',\n    userBubbleBackground: '#4F46E5',\n    userBubbleText: '#ffffff',\n    botBubbleBackground: '#f3f4f6',\n    botBubbleText: '#1f2937',\n    widgetWidth: '380px',\n    widgetHeight: '75vh',      // Default: 75% of viewport height\n    bubbleSize: '60px',\n    borderRadius: '12px',\n    fontFamily: \"'Inter', system-ui, sans-serif\",\n    fontSize: '14px',\n    shadow: '0 4px 20px rgba(0, 0, 0, 0.15)'\n  }\n}\n```\n\n### Agent Configuration\n\nEnable agentic capabilities (powered by evo-virtual-assistant-client):\n\n```javascript\n{\n  agent: {\n    enabled: true,\n    confidenceThreshold: 0.8,\n    siteMap: [\n      { path: '/products', name: 'Products', description: 'View products' },\n      { path: '/contact', name: 'Contact', description: 'Contact us' }\n    ],\n    customActions: {\n      openModal: async (params) => {\n        document.getElementById(params.modalId).showModal();\n      }\n    }\n  }\n}\n```\n\n### Fallback Configuration\n\nConfigure offline behavior:\n\n```javascript\n{\n  fallback: {\n    enabled: true,\n    message: 'Working in offline mode. Some features may be limited.'\n  }\n}\n```\n\n### Event Callbacks\n\n| Callback | Parameters | Description |\n|----------|------------|-------------|\n| `onReady` | `()` | Called when widget is ready |\n| `onMessage` | `(message: ChatMessage)` | Called on each message sent/received |\n| `onAction` | `(action: AgentAction)` | Called when an agentic action occurs |\n| `onError` | `(error: Error)` | Called when an error occurs |\n| `onToggle` | `(isOpen: boolean)` | Called when widget opens/closes |\n\n---\n\n## Theming\n\n### CSS Variables\n\nOverride CSS variables in your stylesheet for quick customization:\n\n```css\n:root {\n  --astermind-primary: #10B981;\n  --astermind-primary-hover: #059669;\n  --astermind-background: #ffffff;\n  --astermind-surface: #f3f4f6;\n  --astermind-text: #1f2937;\n  --astermind-text-muted: #6b7280;\n  --astermind-border: #e5e7eb;\n  --astermind-user-bubble-bg: #10B981;\n  --astermind-user-bubble-text: #ffffff;\n  --astermind-bot-bubble-bg: #f3f4f6;\n  --astermind-bot-bubble-text: #1f2937;\n  --astermind-widget-width: 400px;\n  --astermind-widget-height: 75vh;  /* Default: 75% of viewport height (accepts px, vh, %) */\n  --astermind-bubble-size: 64px;\n  --astermind-border-radius: 16px;\n  --astermind-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);\n  --astermind-font-family: 'Inter', system-ui, sans-serif;\n  --astermind-font-size: 14px;\n}\n```\n\n### CSS Classes\n\nAll elements use the `astermind-` prefix:\n\n| Class | Element |\n|-------|---------|\n| `.evo-virtual-assistant` | Main container |\n| `.astermind-bubble` | Floating trigger button |\n| `.astermind-window` | Chat window |\n| `.astermind-header` | Window header |\n| `.astermind-messages` | Message list container |\n| `.astermind-message` | Individual message |\n| `.astermind-message--user` | User message modifier |\n| `.astermind-message--bot` | Bot message modifier |\n| `.astermind-input` | Input area |\n| `.astermind-status` | Status indicator |\n| `.astermind-action-card` | Action confirmation card |\n| `.astermind-sources` | Source citations container |\n\n---\n\n## Animated Loading Indicator\n\nBy default, the widget displays an animated RSF (Random Starfish Fancy) dancing starfish while the bot is processing a response. Each time the indicator mounts, it randomly selects from **26 unique dance sequences** (skateboarding, surfing, ballet, breakdance, and more). This replaces the previous plain bouncing dots animation.\n\n### Custom Indicator\n\nYou can replace the default animation with your own component using the `loadingIndicator` prop:\n\n```tsx\n<VirtualAssistantWidget\n  apiKey=\"am_...\"\n  loadingIndicator={<MyCustomSpinner />}\n/>\n```\n\nFor vanilla JS, pass a DOM element to `init()`:\n\n```html\n<script>\n  AsterMindVirtualAssistant.init({\n    apiKey: 'am_...',\n    loadingIndicator: document.getElementById('my-spinner')\n  });\n</script>\n```\n\n### Reusing the Animation\n\n`RSFDance` and `RSFStaticStarfish` are exported from the package for use in your own components:\n\n```tsx\nimport { RSFDance, RSFStaticStarfish } from '@astermind/evo-virtual-assistant-template';\n\n// Animated starfish (random dance each mount)\n<RSFDance animate={true} />\n\n// Static starfish icon\n<RSFStaticStarfish />\n```\n\n### Disabling the Animation\n\nTo fall back to simple dots, add these CSS overrides:\n\n```css\n.astermind-typing-dance { display: none; }\n.astermind-typing { display: flex; }\n```\n\n---\n\n## Markdown & Code Blocks\n\nAssistant messages are rendered as markdown. Supported syntax:\n\n- **Bold** (`**text**`) and *italic* (`*text*`).\n- Inline `code` (single backticks, single line).\n- Triple-backtick fenced code blocks with an optional language hint:\n\n  ````\n  ```python\n  def hello(name):\n      print(f\"Hi, {name}!\")\n  ```\n  ````\n\n  Fenced blocks render as:\n\n  ```html\n  <pre class=\"astermind-code-block\">\n    <code class=\"astermind-code language-python\">...</code>\n  </pre>\n  ```\n\n  HTML inside code blocks is escaped — safe to display untrusted output.\n\n- Links (`[label](https://example.com)`).\n- Soft line breaks within paragraphs.\n\n### Syntax highlighting\n\nThe widget ships **no syntax highlighter** by default — bundle size stays small. The `language-<hint>` class on the inner `<code>` element makes it trivial to plug in any client-side highlighter:\n\n```tsx\n// Example with Prism (consumer-installed)\nimport Prism from 'prismjs';\nimport 'prismjs/components/prism-python';\n\nuseEffect(() => {\n  Prism.highlightAll();\n}, [messages]);\n```\n\n### Theming code blocks\n\nTwo CSS variables control the default code-block appearance:\n\n```css\n:root {\n  --astermind-code-bg: #1e1e2e;  /* dark slate */\n  --astermind-code-fg: #f8f8f2;  /* soft white */\n}\n```\n\nOverride them to match your site's syntax theme. If you'd rather restyle the whole element, target `.astermind-code-block`.\n\n---\n\n## Source Citations\n\nWhen the AsterMind backend returns sources alongside an assistant reply, the widget renders a collapsible \"Sources\" toggle under the message.\n\n### Capping the number of sources\n\nTo avoid runaway lists when an upstream response carries an oversized source array, the widget caps the number of citations rendered per message at **7 by default**. Override with `SourceDisplayConfig.maxSources`:\n\n```tsx\n<VirtualAssistantWidget\n  apiKey=\"am_...\"\n  sourceDisplay={{\n    maxSources: 3,   // show at most 3 sources per message\n  }}\n/>\n```\n\n- `0` (or any negative number) hides the sources toggle entirely.\n- The count label reflects the **displayed** (capped) count, not the raw length.\n\n---\n\n## React Hooks API\n\n### useCybernetic\n\nDirect API client access for custom implementations:\n\n```tsx\nimport { useCybernetic } from '@astermind/evo-virtual-assistant-template';\n\nfunction MyComponent() {\n  const {\n    sendMessage,        // Send a message (non-streaming)\n    sendMessageStream,  // Send a message (streaming)\n    connectionStatus,   // 'online' | 'offline' | 'connecting' | 'error'\n    isProcessing,       // Whether a request is in progress\n    lastError,          // Last error that occurred\n    sessionId,          // Current session ID\n    clearSession,       // Clear the current session\n    syncCache,          // Sync cache for offline use\n    client              // Underlying CyberneticClient instance\n  } = useCybernetic({\n    apiUrl: 'https://api.example.com',\n    apiKey: 'am_your-api-key'\n  });\n\n  const handleSend = async () => {\n    const response = await sendMessage('Hello!');\n    console.log(response.reply, response.sources);\n  };\n}\n```\n\n### useChat\n\nChat state management:\n\n```tsx\nimport { useChat } from '@astermind/evo-virtual-assistant-template';\n\nfunction MyComponent() {\n  const {\n    messages,          // Array of chat messages\n    addMessage,        // Add a new message\n    updateMessage,     // Update an existing message\n    clearMessages,     // Clear all messages\n    pendingAction,     // Currently pending agent action\n    setPendingAction   // Set pending action\n  } = useChat();\n}\n```\n\n### useTheme\n\nTheme customization hook:\n\n```tsx\nimport { useTheme } from '@astermind/evo-virtual-assistant-template';\n\nfunction MyComponent() {\n  const { theme, cssVariables } = useTheme({\n    primaryColor: '#10B981',\n    borderRadius: '16px'\n  });\n\n  return <div style={cssVariables}>...</div>;\n}\n```\n\n### useScrollToBottom\n\nAuto-scroll behavior for message lists:\n\n```tsx\nimport { useScrollToBottom } from '@astermind/evo-virtual-assistant-template';\n\nfunction MessageList({ messages }) {\n  const { containerRef, scrollToBottom } = useScrollToBottom();\n\n  return (\n    <div ref={containerRef}>\n      {messages.map(msg => <Message key={msg.id} {...msg} />)}\n    </div>\n  );\n}\n```\n\n---\n\n## Components API\n\nAll components are exported for custom compositions:\n\n```tsx\nimport {\n  VirtualAssistantWidget,    // Main widget (includes bubble + window)\n  ChatBubble,       // Floating trigger button\n  ChatWindow,       // Chat window container\n  ChatHeader,       // Window header with title/subtitle\n  ChatInput,        // Message input with send button\n  MessageList,      // Scrollable message container\n  MessageBubble,    // Individual message bubble\n  ActionCard,       // Agentic action confirmation card\n  SourceCitation,   // Source reference component\n  StatusIndicator,  // Connection status display\n  TypingIndicator   // Typing/loading animation\n} from '@astermind/evo-virtual-assistant-template';\n```\n\n---\n\n## TypeScript Support\n\nFull TypeScript support with exported types:\n\n```typescript\nimport type {\n  // Template-specific types\n  AsterMindVirtualAssistantProps,\n  VirtualAssistantTheme,\n  ChatMessage,\n  AgentAction,\n  ChatState,\n  WidgetPosition,\n  AgentConfig,\n  FallbackConfig,\n  SiteMapEntry,\n  VanillaInitConfig,\n  SendOptions,\n\n  // Re-exported from @astermind/evo-virtual-assistant-client\n  CyberneticConfig,\n  CyberneticResponse,\n  CyberneticError,\n  Source,\n  ConnectionStatus,\n  ConfidenceLevel,\n  StreamCallbacks,\n  AskOptions,\n  CachedDocument,\n  CacheStatus,\n  AgenticConfig\n} from '@astermind/evo-virtual-assistant-template';\n\n// CyberneticClient class is also re-exported for advanced usage\nimport { CyberneticClient } from '@astermind/evo-virtual-assistant-template';\n```\n\n---\n\n## Troubleshooting\n\n### Widget not appearing\n\n1. Ensure styles are imported: `import '@astermind/evo-virtual-assistant-template/styles'`\n2. Check that `apiUrl` and `apiKey` are provided\n3. Verify the widget container has `position: relative` or is in the document flow\n\n### Connection errors\n\n1. Check that your `apiUrl` is correct and accessible\n2. Verify your API key is valid and has the correct permissions\n3. Check browser console for CORS errors - ensure your backend allows the origin\n\n### Streaming not working\n\n1. Verify your backend supports the `/api/external/chat/stream` endpoint\n2. Check that SSE is not being blocked by proxies or firewalls\n3. Ensure `Content-Type: text/event-stream` header is set on responses\n\n### Actions not executing\n\n1. Confirm `agent.enabled` is set to `true`\n2. Check that actions meet the `confidenceThreshold`\n3. Verify custom action handlers are properly defined\n\n### Styles not applying\n\n1. Ensure the CSS file is loaded before the JS\n2. Check for CSS specificity conflicts with your existing styles\n3. Use `!important` or increase specificity if needed\n\n### White text on white background (Dark Mode / CSS Framework conflicts)\n\nIf you're using Tailwind CSS, Bootstrap, or any CSS framework that applies global dark mode styles (e.g. `body { color: white }` or `dark:text-gray-100`), those styles can bleed into the virtual assistant widget through CSS inheritance. This commonly causes the chat input textarea to show white text on a white background.\n\n**Fix: Add these overrides in your app's CSS** (after importing the virtual assistant styles):\n\n```css\n/* Isolate virtual assistant widget from host page dark mode */\n.astermind-window {\n  color: var(--astermind-text, #1f2937);\n  background: var(--astermind-background, #ffffff);\n}\n\n.astermind-input__textarea {\n  color: var(--astermind-text, #1f2937) !important;\n  background-color: var(--astermind-background, #ffffff) !important;\n}\n\n.astermind-input__textarea::placeholder {\n  color: var(--astermind-text-muted, #6b7280) !important;\n}\n```\n\nThe `!important` is needed on the textarea because CSS frameworks often set `color: inherit` on form elements, which inherits from the host page's dark mode text color. The `.astermind-window` rule establishes the widget's own color context.\n\nIf you're using custom theme colors, the CSS variables will be set by the `theme` prop and the overrides above will automatically use your custom values.\n\n---\n\n## Browser Support\n\n| Browser | Version |\n|---------|---------|\n| Chrome | 80+ |\n| Firefox | 75+ |\n| Safari | 13+ |\n| Edge | 80+ |\n\nThe standalone bundle includes necessary polyfills for broader compatibility.\n\n---\n\n## Build Outputs\n\n| File | Format | Description |\n|------|--------|-------------|\n| `evo-virtual-assistant.esm.js` | ESM | ES Module for bundlers (tree-shakeable) |\n| `evo-virtual-assistant.umd.js` | UMD | Universal Module Definition |\n| `evo-virtual-assistant.min.js` | IIFE | Standalone bundle with React included |\n| `evo-virtual-assistant.css` | CSS | Compiled and minified styles |\n\n---\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n\nBuilt with care by the [AsterMind](https://astermind.ai) team.\n","readmeFilename":"README.md"}