Repository navigation
Standalone single-file HTML export (offline, interactive, no server) #1470
Replies: 1 comment
|
Thanks @nirvanaslash, and sorry for the slow reply. This is a well-argued proposal, and the gap is real: none of the current exports gives a teacher one portable artifact that stays playable, offline and interactive. It also fits where we want OpenMAIC to go: a player that runs from the course manifest with no server is essentially the runtime as a standalone artifact. We'd like to see it done in phases, because the full version is large:
A shape we'd welcome:
Please also state explicitly what won't work offline: anything that needs a model (AI chat, discussion/Q&A, regeneration), so the export UI can say so instead of shipping dead controls. If you're up for it, could you sketch the Phase 1 design here first, in particular which parts of |
Uh oh!
There was an error while loading. Please reload this page.
Problem or Motivation
A course built in OpenMAIC can currently leave the app in four ways, and none of them gives a teacher one portable file that keeps a course playable, offline and interactive:
Export | What you get | What is lost -- | -- | -- Export PPTX | slides only | all actions, narration, interactivity Export Resource Pack | *.pptx + one standalone HTML per interactive scene (interactive/NN_<title>.html) | slides are not HTML; scenes are not joined; no narration, no timeline Export Classroom ZIP (.maic.zip) | complete manifest (stage / agents / scenes with actions + whiteboards / mediaIndex) | it must be imported back into an OpenMAIC instance to play; not a distributable artifact Export Video | Hyperframes project → MP4 | interactivity is frozen by design (see Alternatives)The concrete frustration: I want to hand a lesson to students (or archive it for a school intranet) as a single
.htmlfile that opens in any browser and still behaves like the classroom — pages, animations, whiteboard strokes, narration, and the clickable/drag-able interactive simulations — with no OpenMAIC server, nopnpm, no Docker.Today I have to choose between "an MP4 where the simulations are dead screenshots" and "a PPTX plus a folder of disconnected HTML files".
Proposed Solution
Add an offline standalone player export: compile the whole classroom into one self-contained artifact that plays every scene type in a plain browser.
Suggested name: Export → Offline Player (single-file HTML).
Implementation sketch (reusing what already exists):
.maic.zipmanifest —ClassroomManifestinlib/export/classroom-zip-types.tsalready carries everything a player needs:scenes[].content,scenes[].actions(withaudioRef),scenes[].whiteboards,scenes[].multiAgent,agents[]andmediaIndex.lib/playback/+lib/action/, with every/api/*dependency removed) plus the slide renderer.@openmaic/dsland@openmaic/rendererare already published and render slides from the DSL rather than rasterising them.inlineHtmlAssetsmachinery the resource pack already uses) — mounted in an<iframe>so it stays interactive instead of being frozen..html— everything inlined, easiest to hand out;index.html+assets/+media/) — small file, incremental updates.Acceptance Criteria
export.inlinePartialwarning pattern (count + host names).Alternatives Considered
pointer-events:none(lib/video-export/emit-hyperframes/index.ts), bounds readiness withINTERACTIVE_READY_TIMEOUT_MS = 8_000(lib/video-export/interactive-static.ts) and replaces a scene with a fallback card on timeout; quiz/PBL compile to deterministic covers / read-only question lists (lib/video-export/passes/visuals.ts). Correct for video, wrong for "hand out the interactive lesson".Additional Context
中文摘要
当前四种导出方式都无法满足"把一堂课交付成一个可在任意浏览器离线打开、且保持可交互的单文件":
*.pptx+ 每个交互场景各一个独立 HTML(幻灯片不是 HTML、场景彼此孤立、无旁白、无时间轴).maic.zip):数据完整(scenes[].actions/whiteboards/mediaIndex),但必须导入回 OpenMAIC 实例才能播放pointer-events:none、就绪上限 8 秒、超时降级为回退卡;测验 / PBL 编译成确定性封面与只读题目列表)建议新增「离线播放器导出(单文件 HTML)」:以现有 manifest 为数据源,打包一套无服务端的播放器运行时(
lib/playback+lib/action的行为,去掉全部/api/*依赖),用已发布的@openmaic/dsl+@openmaic/renderer渲染幻灯片,把 JS/CSS/字体/图片/旁白音频/交互页全部内联,交互页以 iframe 形式嵌入以保持可交互;同时提供"单文件"与"解压文件夹"两种形态。需要显式决定的两个边界:① 需要实时调用大模型的功能(PBL 运行时、多智能体讨论 / 问答、AI 判分、媒体生成)在离线静态产物中必须降级为明确提示,不能卡住;② 旁白建议转 Opus/MP3 再内联(本机实测 9 分 42 秒旁白 = 24.5 MB WAV,base64 再涨约 33%)。
All reactions