Second revision: MCP servers, shared-link AI, flashcard modes, document previews
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 30s

Generation
- Every quiz is NCLEX style; "Practice exam" writes 50 questions.
- Calculation questions only when the material involves calculations (max 5 per exam).
- Broad topics: the class's topics are listed in the prompt, a quick grouping call maps
  narrow labels onto broad ones, and leftover variants are merged.
- Exact select-all count per batch; option order shuffled.
- Python check: at most 3 runs, fixed problems count as passed, cosmetic remarks ignored.

Assistant
- Text, tool steps and cards appear in the order they happen, with paragraph breaks
  between steps.
- Optional thinking box: fixed height, follows the newest text, can be scrolled back.
- "+" opens a material picker listing recent items; items can be dragged in from class
  pages; shorter placeholder.

MCP servers
- Streamable HTTP client; encrypted headers.
- Per-server instructions and switches for chat, Explain, generation and the quiz check.
- Settings UI.

Share links
- Optional "Explain this" and "Ask about this material" per link, off by default.
- Items are loaded on the server and checked against the share; no tools; rate-limited.
- Migration 4 stores the switches.

Study and documents
- Standard flashcard mode (optionally repeat missed cards until known) next to spaced
  repetition.
- Streak visuals restyled in the app palette.
- Side by side / Original document views, with sandboxed previews of Word and PowerPoint
  files.

Other
- Built-in embedding model baked into the image; sharp stubbed if it cannot load; real
  load error shown in Settings.
- Python runner blocks network and process modules in JavaScript too.
- "View questions and answers" removed from the quiz start screen.
- Docs updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Elijah 2026-11-15 15:48:54 -07:00
parent 5ea61c882c
commit 031f7bec31
45 changed files with 2918 additions and 397 deletions

View file

@ -343,6 +343,50 @@ export function readCoreTitle(zip: ZipReader): string | undefined {
return title || undefined;
}
/** Image types a browser can show, by file extension. */
export const WEB_IMAGE_MIME: Record<string, string> = { png: 'image/png', jpg: 'image/jpeg', jpeg: 'image/jpeg', gif: 'image/gif', webp: 'image/webp', bmp: 'image/bmp', svg: 'image/svg+xml' };
export interface SlidePreview {
title: string;
blocks: string[];
notes: string;
images: { mime: string; data: string }[];
/** Pictures left out: formats a browser can't show, or over the size budget. */
skippedImages: number;
}
/** Slides with their text and pictures, for showing the original deck in the browser. */
export function pptxSlidesForPreview(bytes: Uint8Array, limits: ZipLimits, imageBudget = 40 * 1024 * 1024): SlidePreview[] {
const zip = new ZipReader(bytes, limits);
let budget = imageBudget;
return slideOrder(zip).map((path) => {
const xml = zip.readText(path);
const slide = xml ? readSlide(xml) : { title: '', blocks: [] };
const dir = path.slice(0, path.lastIndexOf('/'));
const rels = readRelationships(zip.readText(relsPathFor(path)));
const notesRel = rels.find((rel) => !rel.external && /\/notesSlide$/.test(rel.type));
const notesXml = notesRel ? zip.readText(resolveTarget(dir, notesRel.target)) : null;
const images: SlidePreview['images'] = [];
let skippedImages = 0;
const seen = new Set<string>();
for (const rel of rels) {
if (rel.external || !/\/image$/.test(rel.type)) continue;
const target = resolveTarget(dir, rel.target);
if (seen.has(target)) continue;
seen.add(target);
const mime = WEB_IMAGE_MIME[target.slice(target.lastIndexOf('.') + 1).toLowerCase()];
const data = mime ? zip.read(target) : null;
if (!mime || !data || data.byteLength > budget) {
skippedImages++;
continue;
}
budget -= data.byteLength;
images.push({ mime, data: Buffer.from(data).toString('base64') });
}
return { title: slide.title, blocks: slide.blocks, notes: notesXml ? readNotes(notesXml) : '', images, skippedImages };
});
}
export async function extractPptx(bytes: Uint8Array, ctx: OfficeContext): Promise<ExtractResult> {
const zip = new ZipReader(bytes, ctx.limits);
const slides = slideOrder(zip);