{"_id":"@arcai/simple-chat-bot","_rev":"1-1b6954452db623a3acda69de8c633dc7","name":"@arcai/simple-chat-bot","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.0":{"name":"@arcai/simple-chat-bot","version":"0.0.0","keywords":["chatbot","bot","ai","chat","typescript"],"author":{"name":"Your Name"},"license":"MIT","_id":"@arcai/simple-chat-bot@0.0.0","maintainers":[{"name":"arcai","email":"arcai@web5lab.net"}],"homepage":"https://github.com/yourusername/simple-chat-bot#readme","bugs":{"url":"https://github.com/yourusername/simple-chat-bot/issues"},"dist":{"shasum":"1ee167460857f7b150183ef2a726dde4baddec94","tarball":"https://registry.npmjs.org/@arcai/simple-chat-bot/-/simple-chat-bot-0.0.0.tgz","fileCount":20,"integrity":"sha512-tjfUUNUIaB6+WV/tuqfJ3sxFLkDnMmWJEity20bEnOrxBGdeb1WXgnOT1fGEI9Siks90ueCDiMxF0jqn4PUT5g==","signatures":[{"sig":"MEYCIQCTjGG9OrkIOOueQyV9pS1lBl1dRAkjS2mi4YIWWAzqxgIhAI2DLVjb3LDvucJ11xYKLwnLkP/rE6Oka1oP/4lsDP7U","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23073},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","scripts":{"dev":"vite","lint":"eslint .","test":"vitest","build":"tsc","prepublish":"npm run build"},"_npmUser":{"name":"arcai","email":"arcai@web5lab.net"},"repository":{"url":"git+https://github.com/yourusername/simple-chat-bot.git","type":"git"},"_npmVersion":"10.9.0","description":"A lightweight and flexible chatbot library for Node.js and the browser, written in TypeScript.","directories":{},"_nodeVersion":"20.17.0","dependencies":{"viem":"^1.21.4","wagmi":"^1.4.13","eventemitter3":"^5.0.1","@web3modal/wagmi":"^3.5.6","@google/generative-ai":"^0.2.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^5.1.4","react":"^18.2.0","eslint":"^9.9.1","vitest":"^1.3.1","globals":"^15.9.0","postcss":"^8.4.35","react-dom":"^18.2.0","typescript":"^5.5.3","@types/node":"^20.11.24","tailwindcss":"^3.4.1","@types/react":"^18.2.61","autoprefixer":"^10.4.17","lucide-react":"^0.344.0","@types/react-dom":"^18.2.19","typescript-eslint":"^8.3.0","@vitejs/plugin-react":"^4.2.1"},"_npmOperationalInternal":{"tmp":"tmp/simple-chat-bot_0.0.0_1738166574124_0.7619205719274809","host":"s3://npm-registry-packages-npm-production"}},"0.0.1":{"name":"@arcai/simple-chat-bot","version":"0.0.1","type":"module","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"dev":"vite","build":"tsc","test":"vitest","lint":"eslint .","bundle":"esbuild src/index.ts --bundle --minify --outfile=dist/chatbot.min.js --global-name=arcai --format=iife","prepublish":"npm run build"},"dependencies":{"eventemitter3":"^5.0.1","@web3modal/wagmi":"^3.5.6","@google/generative-ai":"^0.2.0","viem":"^1.21.4","wagmi":"^1.4.13"},"devDependencies":{"@types/node":"^20.11.24","@types/react":"^18.2.61","@types/react-dom":"^18.2.19","@vitejs/plugin-react":"^4.2.1","autoprefixer":"^10.4.17","eslint":"^9.9.1","globals":"^15.9.0","lucide-react":"^0.344.0","postcss":"^8.4.35","react":"^18.2.0","react-dom":"^18.2.0","tailwindcss":"^3.4.1","typescript":"^5.5.3","typescript-eslint":"^8.3.0","vite":"^5.1.4","vitest":"^1.3.1"},"keywords":["chatbot","bot","ai","chat","typescript"],"author":{"name":"Your Name"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/yourusername/simple-chat-bot.git"},"_id":"@arcai/simple-chat-bot@0.0.1","description":"A lightweight and flexible chatbot library for Node.js and the browser, written in TypeScript.","bugs":{"url":"https://github.com/yourusername/simple-chat-bot/issues"},"homepage":"https://github.com/yourusername/simple-chat-bot#readme","_nodeVersion":"20.17.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-G2+Fjvv6X38Rmv6bHsM0fzXYAxjiA2VVkOkVIlOH/YATGVLTijvUAgYnW6i12AU4xGlJNdBhvlvrwC+dVZTT1w==","shasum":"9be32fba4467d3b376d31dbe39e756cb1bed3985","tarball":"https://registry.npmjs.org/@arcai/simple-chat-bot/-/simple-chat-bot-0.0.1.tgz","fileCount":23,"unpackedSize":1365939,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCjAzo3bbZr5EzKSIjQ2vErOEheGaEv4p0MjGTtj01VeQIhAI0eVp6Ws1If0GZw+Uw1+9xfMKyH2YxdGf7SEJnNNqZX"}]},"_npmUser":{"name":"arcai","email":"arcai@web5lab.net"},"directories":{},"maintainers":[{"name":"arcai","email":"arcai@web5lab.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/simple-chat-bot_0.0.1_1738169877203_0.5430381381513891"},"_hasShrinkwrap":false}},"time":{"created":"2025-01-29T16:02:53.989Z","modified":"2025-01-29T16:57:57.692Z","0.0.0":"2025-01-29T16:02:54.350Z","0.0.1":"2025-01-29T16:57:57.511Z"},"bugs":{"url":"https://github.com/yourusername/simple-chat-bot/issues"},"author":{"name":"Your Name"},"license":"MIT","homepage":"https://github.com/yourusername/simple-chat-bot#readme","keywords":["chatbot","bot","ai","chat","typescript"],"repository":{"type":"git","url":"git+https://github.com/yourusername/simple-chat-bot.git"},"description":"A lightweight and flexible chatbot library for Node.js and the browser, written in TypeScript.","maintainers":[{"name":"arcai","email":"arcai@web5lab.net"}],"readme":"# Simple Chat Bot\n\nA lightweight and flexible chatbot library for Node.js and the browser, written in TypeScript.\n\n## Features\n\n- 🚀 Simple and intuitive API\n- 📦 TypeScript support out of the box\n- 🎯 Pattern matching using RegExp or strings\n- ⚡ Async response handling\n- 🎨 Customizable response delay and default messages\n- 📡 Event-based architecture\n\n## Installation\n\n```bash\nnpm install simple-chat-bot\n```\n\n## Quick Start\n\n```typescript\nimport { ChatBot } from 'simple-chat-bot';\n\n// Create a new bot instance\nconst bot = new ChatBot({\n  name: 'MyBot',\n  defaultResponse: \"I didn't understand that.\",\n  responseDelay: 500\n});\n\n// Add some response rules\nbot.addRule({\n  pattern: /hello|hi|hey/i,\n  handler: () => 'Hello! How can I help you today?'\n});\n\nbot.addRule({\n  pattern: /bye|goodbye/i,\n  handler: () => 'Goodbye! Have a great day!'\n});\n\n// Add a rule with pattern matching\nbot.addRule({\n  pattern: /my name is (.*)/i,\n  handler: (message, matches) => `Nice to meet you, ${matches?.[1]}!`\n});\n\n// Listen for messages and responses\nbot.on('message', (message) => {\n  console.log('User:', message.content);\n});\n\nbot.on('response', (message) => {\n  console.log('Bot:', message.content);\n});\n\n// Process messages\nasync function chat() {\n  await bot.processMessage('Hello');\n  await bot.processMessage('My name is John');\n  await bot.processMessage('goodbye');\n}\n\nchat();\n```\n\n## API Reference\n\n### ChatBot Class\n\n#### Constructor Options\n\n```typescript\ninterface ChatBotOptions {\n  name?: string;          // Bot's name\n  defaultResponse?: string; // Response when no rules match\n  responseDelay?: number;   // Delay before responding (ms)\n}\n```\n\n#### Methods\n\n- `addRule(rule: MatchRule)`: Add a new response rule\n- `processMessage(content: string)`: Process a user message\n- `setDefaultResponse(response: string)`: Update default response\n- `setResponseDelay(delay: number)`: Update response delay\n\n#### Events\n\n- `message`: Emitted when a user message is received\n- `response`: Emitted when the bot responds\n\n### Types\n\n```typescript\ninterface Message {\n  content: string;\n  type: 'user' | 'bot';\n  timestamp: Date;\n  metadata?: Record<string, unknown>;\n}\n\ninterface MatchRule {\n  pattern: RegExp | string;\n  handler: (message: Message, matches: RegExpMatchArray | null) => Promise<string> | string;\n}\n```\n\n## License\n\nMIT","readmeFilename":"README.md"}