Add activity rendering and direct PDF raster extraction#20
Merged
nicpottier merged 5 commits intomainfrom Feb 12, 2026
Merged
Conversation
…jects Activity rendering: - Add Liquid prompt templates for 7 activity types with answer variants - Extend config with activity render strategies and per-section model resolution - Add HTML validation support for activity-generated IDs - Update web-rendering types for activity sections PDF raster extraction: - Replace SVG-based raster image extraction with direct PDF object extraction - Recurse into Form XObjects to find nested images - Handle CMYK JPEG color conversion via mupdf - Deduplicate images by PDF object number - Support JPEG format throughout storage and API layers
OpenAI structured outputs don't support z.record() (additionalProperties).
Change activityAnswersLLMSchema from record to array of {id, value} objects,
and convert back to record in render-llm.ts for storage. Update all answer
prompt templates to show the new array format.
…e prompt - Handle .jpeg extension (not just .jpg) in image serving route - Add superRefine validation: answer_prompt only allowed for activity render type - Fix true/false prompt: radio values use "true"/"false", shared data-activity-item per question
Resolve conflicts in config.ts (BookFormat/LayoutType from main + activity RenderType from branch) and books.ts (new routes from main + updated image serving from branch). Fix books.test.ts to use new buffer/format image fields.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
z.record()to array of{id, value}for OpenAI structured output compatibility; add config validation foranswer_promptonly on activity render typesTest plan
pnpm test)pnpm typecheck)