feat: offline in-browser "Ask MSOS" assistant (no API, zero cost)
A privacy-friendly help widget that answers visitor questions from the site's own content and links to the full page — runs 100% in the browser, no API, no server, no per-token cost. - tools/build_search_index.py: parses every EN/MK/SI page into ~720 heading-level chunks per language -> assistant/index-<lang>.json (lazy-loaded only when the chat is opened; gzips to ~80 KB). - assistant.js: dependency-free BM25 search + multilingual stopword filtering + a curated short-answer layer for common questions, plus an accessible chat widget (role=dialog, keyboard, aria). CSP-safe (self only). - assistant.css: scoped .msa-* styles in the site's teal palette; responsive (full-screen panel on mobile). - Injected on 208 pages (blog WIP excluded; picks it up when that lands). Verified in a headless browser across EN/MK/SI: curated answers, search fallback with correct ranking (rare terms win), correct deep links, Cyrillic + Slovene diacritics, and zero console errors. Curated MK/SI answers are machine-drafted — proofread before launch. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
cca6fd18aa
commit
f7f297bd65
214 files changed
+876
No files matched your search
@@ -356,5 +356,7 @@
|
||||
|
||||
<script src="../../../main.js"></script>
|
||||
<script src="../../../guide-feedback.js"></script>
|
||||
<link rel="stylesheet" href="/assistant.css">
|
||||
<script src="/assistant.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user