How andersonba/yve-bot works
Project type and purpose
• yve-bot is an open-source JavaScript/TypeScript SDK for building rule-based chatbot conversations that run both in Node and in the browser.
• The README and docs show it provides a “core engine” (state machine, actions, listeners, validators), an extensibility layer for custom types/validators, and a UI bundle to render chats in the browser.
• It ships via npm, builds with Rollup, and includes examples (CLI, web, React, Socket.io) plus a documentation website.
File structure
• Top-level source folders under src/
• src/core: the engine implementing state, actions, controllers, store, validators, sanitizers, exceptions
• src/ext: extension points for custom types (e.g. StringSearch)
• src/ui: the UI adapter that listens to core events and renders messages
• src/types.d.ts: shared interfaces
• Build output under lib/: core.js, ui.js, web.js, ext/types
• Configuration: rollup.config.ts, tsconfig.json, tslint.json
• Examples under examples/: CLI, Facebook bot, React, plain web, Socket.io
• Documentation site in website/: built with Docusaurus, serves docs and playground.
README for additional insights
• The engine is loaded with a YAML or JS ruleset, then routed through core API: controller.handle(), store updates, listeners emit “send message” events.
• The UI layer subscribes to core’s event emitter and updates DOM or console.
• Extensions plug into core.types or core.validators to add custom behavior.
• The build produces separate bundles for “core”, “ui”, and “web” targets.