feat(biochem): Фаза 2.1/2.2/2.4 — серверный chem.js + /analyze + подсказки валентности

- biochem-core.js dual-export (browser window.BIO + Node module.exports), без дублей
- BIO.valency: подробные подсказки валентности (2.4), общие для редактора и сервера
- services/chem.js: серверный анализ поверх того же ядра (analyze/validate)
- POST /api/biochem/analyze (2.2); /validate переведён на ядро (+фикс формата связей)
- api.js: LS.biochemAnalyze

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Maxim Dolgolyov
2026-05-30 22:37:59 +03:00
parent 8b5d9238b5
commit b67fac6407
7 changed files with 125 additions and 26 deletions
+2 -1
View File
@@ -937,6 +937,7 @@ async function biochemGetElements() { return req('GET', '/biochem/elements'
async function biochemGetMolecules(p={}) { return req('GET', `/biochem/molecules?${new URLSearchParams(p)}`); }
async function biochemGetMolecule(id) { return req('GET', `/biochem/molecules/${id}`); }
async function biochemValidate(atoms,bonds){ return req('POST','/biochem/validate',{atoms,bonds}); }
async function biochemAnalyze(atoms,bonds){ return req('POST','/biochem/analyze',{atoms,bonds}); }
async function biochemGetReactions() { return req('GET', '/biochem/reactions'); }
async function biochemGetChallenges() { return req('GET', '/biochem/challenges'); }
async function biochemSolveChallenge(id,payload) { return req('POST',`/biochem/challenges/${id}/solve`,payload); }
@@ -1065,7 +1066,7 @@ window.LS = {
clearFeaturesCache,
hideDisabledFeatures,
showBoardIfAllowed,
biochemGetElements, biochemGetMolecules, biochemGetMolecule, biochemValidate,
biochemGetElements, biochemGetMolecules, biochemGetMolecule, biochemValidate, biochemAnalyze,
biochemGetReactions, biochemGetChallenges, biochemSolveChallenge,
biochemGetSaved, biochemSave, biochemDeleteSaved,
biochemGetPathways, biochemGetPathwayProgress, biochemSavePathwayProgress,