mirror of
https://github.com/THU-MAIC/OpenMAIC.git
synced 2026-10-17 05:29:46 +08:00
* feat(export): download narration script as Markdown or Word-compatible .doc Adds two export-menu entries that download the classroom's TTS narration text (SpeechAction.text per scene) as a local document for lesson prep, closing #413. The .doc is a minimal HTML document with the Word MIME type so no new runtime dependency is introduced; .md is the portable plain-text sibling. Scenes without speech are omitted, HTML is escaped in the .doc path, and file names are sanitized. Co-authored-by: CommandCodeBot <noreply@commandcode.ai> * refactor(export): simplify narration script export hook Reads stage store state at click time instead of subscribing per render, drops unobservable exporting state (the handler is synchronous and the menu-close is the reentrancy guard), removes a redundant empty-scenes pre-check, and drops a type cast the discriminated union makes unnecessary. Co-authored-by: CommandCodeBot <noreply@commandcode.ai> * fix(export): apply code review findings for narration script - Skip whitespace-only speech text when collecting scene scripts, so a blank course cannot download a heading-only document with a success toast - Trim and filter empty paragraphs in the .doc serializer to match the markdown path - Strip only dangerous control ranges in the filename sanitizer so emoji and ZWJ sequences survive (the broad \p{C} class was splitting surrogate pairs) - Add unit tests for whitespace-only speech, HTML paragraph normalization, the <br> branch, emoji-preserving filenames, control-char stripping, and markdown whitespace filtering Co-authored-by: CommandCodeBot <noreply@commandcode.ai> * fix(export): address review feedback on narration script export - Decouple the export menu trigger from full media-readiness gating: script export (.doc/.md) now stays usable while media generation is still pending. PPTX/Resource Pack/ZIP/Video items keep the existing media-dependent gate, now with visible disabled state and a tooltip explaining why. - Document the HTML-as-.doc format as a deliberate zero-dependency tradeoff (not an oversight) directly above buildDocHtml. - Sanitize scene/stage titles before they're interpolated into Markdown headings, so embedded newlines or leading # runs can't inject extra headings or corrupt document structure. - Localize the "Slide N" fallback label via the i18n system instead of hardcoding English, adding export.slideFallback (plus export.textOnly and export.mediaPending for the new UI states) across all 12 locales. Addresses review from @wyuc on PR #1144. * refactor(export): dedupe export-readiness derivation in header controls canExport already implies canExportText once it ANDs the media-readiness check on top, so the trigger's title/aria-label/readiness ternaries had two independent copies of the same 3-way branch drifting apart. Derive canExport from canExportText, and share exportReady/exportLabel between the button's disabled, className, title, and aria-label props. * fix(export): escape leading # in markdown headings instead of deleting it Two issues found in code review: (1) a leading newline could shield a leading # from the strip regex, then trim() would re-expose it unescaped -- a real order-of-operations bug; (2) unconditionally deleting the leading # run silently mangled legitimate titles like "#1 Introduction". Escaping (\#) instead of stripping fixes both: content is preserved and the character can no longer be mistaken for heading syntax, regardless of what precedes it. * fix(review): apply review findings * fix(export): remove legacy doc script export --------- Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
203 lines
7.2 KiB
JSON
203 lines
7.2 KiB
JSON
{
|
|
"name": "openmaic",
|
|
"version": "0.3.2",
|
|
"private": true,
|
|
"license": "MIT",
|
|
"engines": {
|
|
"node": ">=20.9.0"
|
|
},
|
|
"scripts": {
|
|
"postinstall": "cd packages/mathml2omml && npm run build && cd ../pptxgenjs && npm run build && cd ../@openmaic/dsl && pnpm run build && cd ../generation && pnpm run build && cd ../storage && pnpm run build && cd ../importer && pnpm run build && cd ../renderer && pnpm run build && cd ../editor && pnpm run build && cd ../../.. && node scripts/sync-maic-importer.mjs",
|
|
"sync:maic-importer": "node scripts/sync-maic-importer.mjs",
|
|
"gen:video-export-katex": "node scripts/generate-video-export-katex.mjs",
|
|
"gen:video-export-noto-cjk": "node scripts/generate-video-export-noto-cjk.mjs",
|
|
"gen:video-export-noto-script-fonts": "node scripts/generate-video-export-noto-script-fonts.mjs",
|
|
"dev": "next dev",
|
|
"build": "node scripts/assert-vendor-maic-importer.mjs && next build",
|
|
"start": "next start",
|
|
"lint": "eslint",
|
|
"check:i18n-keys": "node scripts/check-i18n-keys.mjs",
|
|
"check:package-versions": "node scripts/check-package-version-bumps.mjs",
|
|
"check": "prettier . --check",
|
|
"format": "prettier . --write",
|
|
"test": "vitest run",
|
|
"test:package-tarballs": "node scripts/smoke-test-package-tarballs.mjs",
|
|
"test:e2e": "playwright test",
|
|
"test:e2e:ui": "playwright test --ui",
|
|
"eval:pbl-v2-planner": "tsx eval/pbl-v2-planner/runner.ts",
|
|
"eval:whiteboard": "tsx eval/whiteboard-layout/runner.ts",
|
|
"eval:outline-language": "tsx eval/outline-language/runner.ts",
|
|
"eval:orchestration": "tsx eval/orchestration/runner.ts",
|
|
"eval:orchestration:answering": "tsx eval/orchestration/answering-runner.ts",
|
|
"eval:orchestration:answer-content": "tsx eval/orchestration/answer-content-runner.ts"
|
|
},
|
|
"dependencies": {
|
|
"@ai-sdk/amazon-bedrock": "^4.0.103",
|
|
"@ai-sdk/anthropic": "^3.0.71",
|
|
"@ai-sdk/azure": "^3.0.88",
|
|
"@ai-sdk/google": "^3.0.64",
|
|
"@ai-sdk/openai": "^3.0.84",
|
|
"@ai-sdk/react": "^3.0.170",
|
|
"@alicloud/credentials": "^2.4.5",
|
|
"@alicloud/docmind-api20220711": "^1.4.15",
|
|
"@alicloud/openapi-client": "^0.4.15",
|
|
"@alicloud/tea-util": "^1.4.11",
|
|
"@assistant-ui/react": "^0.14.18",
|
|
"@assistant-ui/react-markdown": "^0.14.1",
|
|
"@assistant-ui/react-streamdown": "^0.3.3",
|
|
"@aws-sdk/client-s3": "^3.1048.0",
|
|
"@aws-sdk/credential-providers": "^3.1045.0",
|
|
"@aws-sdk/s3-request-presigner": "^3.1048.0",
|
|
"@base-ui/react": "^1.1.0",
|
|
"@copilotkit/backend": "^0.37.0",
|
|
"@copilotkit/runtime": "^1.51.2",
|
|
"@earendil-works/pi-agent-core": "0.78.0",
|
|
"@earendil-works/pi-ai": "0.78.0",
|
|
"@fontsource-variable/inter": "^5.2.8",
|
|
"@fontsource/jetbrains-mono": "^5.2.8",
|
|
"@fontsource/literata": "^5.2.8",
|
|
"@fontsource/lxgw-wenkai": "^5.2.5",
|
|
"@fontsource/merriweather": "^5.2.11",
|
|
"@fontsource/montserrat": "^5.2.8",
|
|
"@fontsource/noto-sans-kr": "^5.2.9",
|
|
"@fontsource/noto-sans-sc": "^5.2.9",
|
|
"@fontsource/noto-serif-sc": "^5.2.8",
|
|
"@fontsource/open-sans": "^5.2.7",
|
|
"@fontsource/roboto": "^5.2.10",
|
|
"@fontsource/source-sans-3": "^5.2.9",
|
|
"@fontsource/source-serif-4": "^5.2.9",
|
|
"@fontsource/zcool-kuaile": "^5.2.8",
|
|
"@langchain/core": "^1.1.16",
|
|
"@langchain/langgraph": "^1.1.1",
|
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
"@napi-rs/canvas": "^0.1.88",
|
|
"@openmaic/dsl": "workspace:*",
|
|
"@openmaic/editor": "workspace:*",
|
|
"@openmaic/generation": "workspace:*",
|
|
"@openmaic/importer": "workspace:*",
|
|
"@openmaic/renderer": "workspace:*",
|
|
"@openmaic/storage": "workspace:*",
|
|
"@radix-ui/react-checkbox": "^1.3.3",
|
|
"@radix-ui/react-popover": "^1.1.15",
|
|
"@radix-ui/react-slider": "^1.3.6",
|
|
"@radix-ui/react-switch": "^1.2.6",
|
|
"@radix-ui/react-use-controllable-state": "^1.2.2",
|
|
"@streamdown/code": "^1.1.1",
|
|
"@types/js-yaml": "^4.0.9",
|
|
"@xyflow/react": "^12.10.0",
|
|
"ai": "^6.0.168",
|
|
"animate.css": "^4.1.1",
|
|
"class-variance-authority": "^0.7.1",
|
|
"clsx": "^2.1.1",
|
|
"cmdk": "^1.1.1",
|
|
"copilotkit": "^0.0.58",
|
|
"dexie": "^4.2.1",
|
|
"docx": "9.4.1",
|
|
"echarts": "^6.0.0",
|
|
"embla-carousel-react": "^8.6.0",
|
|
"es-module-lexer": "^2.0.0",
|
|
"file-saver": "^2.0.5",
|
|
"geist": "^1.7.0",
|
|
"graphemer": "1.4.0",
|
|
"i18next": "^26.0.1",
|
|
"i18next-resources-to-backend": "^1.2.1",
|
|
"immer": "^11.1.3",
|
|
"js-yaml": "^4.1.1",
|
|
"jsonrepair": "^3.13.2",
|
|
"jszip": "^3.10.1",
|
|
"katex": "^0.16.33",
|
|
"lodash": "^4.17.21",
|
|
"lucide-react": "^0.562.0",
|
|
"mathml2omml": "workspace:*",
|
|
"mitt": "^3.0.1",
|
|
"motion": "^12.27.5",
|
|
"nanoid": "^5.1.6",
|
|
"next": "16.1.2",
|
|
"next-themes": "^0.4.6",
|
|
"openai": "^4.104.0",
|
|
"partial-json": "^0.1.7",
|
|
"parse5": "^8.0.1",
|
|
"parse-srcset": "^1.0.2",
|
|
"pg": "^8.16.3",
|
|
"postcss": "^8.5.15",
|
|
"postcss-value-parser": "^4.2.0",
|
|
"pptxgenjs": "workspace:*",
|
|
"pptxtojson": "^1.11.0",
|
|
"prosemirror-commands": "^1.7.1",
|
|
"prosemirror-dropcursor": "^1.8.2",
|
|
"prosemirror-gapcursor": "^1.4.0",
|
|
"prosemirror-history": "^1.5.0",
|
|
"prosemirror-inputrules": "^1.5.1",
|
|
"prosemirror-keymap": "^1.2.3",
|
|
"prosemirror-model": "^1.25.4",
|
|
"prosemirror-schema-basic": "^1.2.4",
|
|
"prosemirror-schema-list": "^1.5.1",
|
|
"prosemirror-state": "^1.4.4",
|
|
"prosemirror-view": "^1.41.5",
|
|
"radix-ui": "^1.4.3",
|
|
"react": "19.2.3",
|
|
"react-colorful": "^5.7.0",
|
|
"react-dom": "19.2.3",
|
|
"react-i18next": "^17.0.1",
|
|
"sanitize-html": "2.17.0",
|
|
"shadcn": "^3.6.3",
|
|
"sharp": "^0.34.5",
|
|
"shiki": "^3.21.0",
|
|
"sonner": "^2.0.7",
|
|
"streamdown": "^2.5.0",
|
|
"svg-arc-to-cubic-bezier": "^3.2.0",
|
|
"svg-pathdata": "^8.0.0",
|
|
"tailwind-merge": "^3.4.0",
|
|
"temml": "^0.13.1",
|
|
"tinycolor2": "^1.6.0",
|
|
"tokenlens": "^1.3.1",
|
|
"tw-animate-css": "^1.4.0",
|
|
"typebox": "^1.1.39",
|
|
"undici": "^7.22.0",
|
|
"unpdf": "^1.4.0",
|
|
"use-stick-to-bottom": "^1.1.1",
|
|
"zod": "^4.3.5",
|
|
"zustand": "^5.0.10"
|
|
},
|
|
"devDependencies": {
|
|
"@fontsource/noto-sans": "5.3.0",
|
|
"@fontsource/noto-sans-arabic": "5.3.0",
|
|
"@playwright/test": "^1.58.2",
|
|
"@rollup/plugin-commonjs": "^28.0.1",
|
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
"@tailwindcss/postcss": "^4",
|
|
"@types/file-saver": "^2.0.7",
|
|
"@types/katex": "^0.16.8",
|
|
"@types/lodash": "^4.17.23",
|
|
"@types/node": "^20",
|
|
"@types/pg": "^8.15.5",
|
|
"@types/react": "^19",
|
|
"@types/react-dom": "^19",
|
|
"@types/sanitize-html": "^2.16.1",
|
|
"@types/tinycolor2": "^1.4.6",
|
|
"eslint": "^9",
|
|
"eslint-config-next": "16.1.2",
|
|
"fake-indexeddb": "^6.2.5",
|
|
"fontkit": "2.0.4",
|
|
"gsap": "^3.15.0",
|
|
"hyperframes": "0.7.60",
|
|
"prettier": "3.8.1",
|
|
"rollup": "^4.35.0",
|
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
"semver": "7.8.5",
|
|
"tailwindcss": "^4",
|
|
"tslib": "^2.8.0",
|
|
"tsx": "^4.21.0",
|
|
"typescript": "^5",
|
|
"vitest": "^4.1.8",
|
|
"vue-to-react": "^1.0.0"
|
|
},
|
|
"pnpm": {
|
|
"ignoredBuiltDependencies": [
|
|
"sharp",
|
|
"unrs-resolver"
|
|
]
|
|
},
|
|
"packageManager": "pnpm@10.28.0+sha512.05df71d1421f21399e053fde567cea34d446fa02c76571441bfc1c7956e98e363088982d940465fd34480d4d90a0668bc12362f8aa88000a64e83d0b0e47be48"
|
|
}
|