feat(assistant): headless-RAG — индексация JS-рендеримых учебников

scripts/index-textbooks-headless.js: puppeteer-core + системный Chrome/Edge
рендерит каждый учебник через локальный сервер (служебный JWT в localStorage,
т.к. /textbook требует логина), кликает по параграфам и забирает рендерный
текст движков (математика/физика и т.п.) в textbook_chunks. Дополняет
статический индексатор. npm: index:textbooks / index:textbooks:full (headless).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Maxim Dolgolyov
2026-06-04 18:27:40 +03:00
parent 2252bbd666
commit 0119ea0f15
3 changed files with 369 additions and 3 deletions
+3
View File
@@ -14,6 +14,8 @@
"lint:routes": "node scripts/check-route-auth.js",
"import:content": "node scripts/import-content.js",
"import:exam-tasks": "node scripts/import-exam-tasks.js",
"index:textbooks": "node scripts/index-textbooks.js",
"index:textbooks:full": "node scripts/index-textbooks-headless.js",
"test": "node --test tests/*.test.js",
"hooks:install": "sh ../scripts/install-hooks.sh"
},
@@ -26,6 +28,7 @@
"js-yaml": "^4.1.1",
"jsonwebtoken": "^9.0.2",
"multer": "^2.1.1",
"puppeteer-core": "^25.1.0",
"sharp": "^0.34.5",
"ws": "^8.20.0"
},