Files
cs249r_book/socratiq/package.json
Vijay Janapa Reddi 09976342d2 fix(socratiq): bump uuid to ^14.0.0 (GHSA, buffer bounds in v3/v5/v6)
Transitive via mermaid@11.14.0 — only consumer in this package — uses
uuid v4 (random IDs for diagrams), unaffected by the buffer-bounds bug
in v3/v5/v6, but Dependabot still flags any uuid <14.0.0. Pinned via
overrides so future mermaid bumps stay on the patched line.

Closes Dependabot #88.
2026-05-01 17:23:27 -04:00

62 lines
3.7 KiB
JSON

{
"name": "@mlsysbook/socratiq",
"version": "1.0.0",
"description": "AI learning widget that injects into static HTML pages via a single <script> tag, running entirely inside a Shadow DOM.",
"private": true,
"main": "index.js",
"scripts": {
"dev": "node --max-http-header-size=65536 ./node_modules/.bin/vite --config vite.config.dev.mjs",
"dev:vite": "node --max-http-header-size=65536 ./node_modules/.bin/vite --config vite.config.dev.mjs",
"build:vite": "vite build --config vite.config.prod.mjs",
"build:quarto": "npm run build:vite",
"preview:vite": "vite preview --config vite.config.prod.mjs"
},
"keywords": [],
"author": "Kai Kleinbard",
"license": "ISC",
"devDependencies": {
"chokidar": "^4.0.3",
"vite": "^8.0.10",
"vite-plugin-singlefile": "^2.3.0"
},
"_comments": {
"@leeoniya/ufuzzy": "KEEP ~12KB — fuzzy paragraph search, used in core highlight flow",
"boarding.js": "KEEP ~50KB — onboarding tour, used in sr-onboarding-handler + socratiq-onboarding. Only loads after first visit check.",
"chart.js": "KEEP ~200KB — use tree-shaken named imports only (NOT chart.js/auto). spaced-repetition-stats.js was importing /auto and has been fixed.",
"compromise": "KEEP ~1.5MB — NLP lib. 3 live usages: (1) backupQuiz.js createQuiz() = offline quiz fallback when LLM API fails (called in 4 places in index.js); (2) key_terms_summary.js getTopics() = called on every chat save for topic tagging (hot path); (3) chapterSummaries.js generateSectionSummary() = stop-word filter (replaceable with vanilla JS, but won't save dep while (1)+(2) exist). Cannot remove without killing offline quiz mode.",
"crypto-js": "KEEP ~80KB — used in hashUtils.js for SHA-256 PDF verification. Could replace with native SubtleCrypto (Web Crypto API) to drop this dep entirely.",
"d3": "REVIEW ~570KB — full d3 bundle, only used in KnowledgeGraph.js. Consider importing only needed subpackages (e.g. d3-force, d3-selection, d3-zoom) to cut ~400KB.",
"idb": "KEEP ~8KB — IndexedDB wrapper, used throughout quiz/spaced-rep storage.",
"ink-mde": "KEEP ~150KB — Markdown editor in spaced-rep flashcard modal. Lazy-loaded on modal open.",
"jsonrepair": "KEEP ~30KB — used for repairing malformed LLM JSON responses.",
"jspdf": "KEEP ~250KB — PDF export in generateQuizPDF.js. Only loaded on explicit PDF export action.",
"jspdf-autotable": "KEEP ~80KB — jspdf table plugin, paired with jspdf above.",
"katex": "KEEP ~280KB — math rendering in streamdown_markdown.js. KaTeX is already the lean alternative to MathJax.",
"markdown-it": "KEEP ~60KB — core markdown parser.",
"markdown-it-container": "KEEP ~5KB — custom container blocks (spoiler, info, etc.).",
"mermaid": "KEEP ~800KB — diagram rendering. Already lazy-initialized. Largest single dep — acceptable for diagram support.",
"dompurify": "KEEP ~45KB — XSS sanitization added for security fixes. Small cost, high value."
},
"overrides": {
"uuid": "^14.0.0"
},
"dependencies": {
"@leeoniya/ufuzzy": "^1.0.17",
"boarding.js": "^3.6.0",
"chart.js": "^4.4.5",
"compromise": "^14.13.0",
"crypto-js": "^4.2.0",
"d3": "^7.9.0",
"idb": "^8.0.0",
"ink-mde": "^0.34.0",
"jsonrepair": "^3.11.2",
"jspdf": "^4.2.1",
"jspdf-autotable": "^5.0.7",
"katex": "^0.16.22",
"markdown-it": "^14.1.1",
"markdown-it-container": "^4.0.0",
"mermaid": "^11.14.0",
"dompurify": "^3.4.0"
}
}