Thanks for your interest in improving ContextChat! This project is the embeddable chat front-end companion to ContextMCP.
npm install
cp .dev.vars.example .dev.vars # add your OPENAI_API_KEY (Turnstile test secret is preset)
npm run build:widget
npm run devRun the full local gate — all three must pass:
npm run typecheck # worker + tests + widget
npm test # vitest
npm run build:widget # must produce a bundle with no dynamic import()src/— the Cloudflare Worker (/chatpipeline, guards, retrieval adapters, LLM, SSE).src/retrieval/— pluggable retrieval adapters behind theRetrieverinterface.
widget/— the embeddable Shadow-DOM chat UI (React, compiled to a single IIFE).test/— vitest unit tests for the retrieval adapters.
- Match the existing style: strict TypeScript, no
any, small focused modules. - Keep the widget self-contained: the build must stay a single IIFE with no dynamic
import()(CI enforces this) so it can be injected into a Shadow DOM. - Adding a retrieval adapter: implement the
Retrievertype insrc/retrieval/, register it insrc/retrieval/index.ts, and add a fixture-based unit test for its parser. - No secrets in commits.
.dev.varsis gitignored; never commit real keys. - Keep it brandable: user-facing strings, colors, and fonts must come from config, not hardcoded values.
Open an issue with clear reproduction steps (and the adapter/config involved). For security issues, follow SECURITY.md instead of filing a public issue.