Files
OpenMAIC/package.json
T
7bb9e864ae feat(packages): introduce maic-import and maic-renderer workspace packages (#668)
* feat(import): add pptxtojson-pro workspace package and stage-1 PPTX import

Vendor the TypeScript pptxtojson-pro parser as a workspace package, sync its
bundle to public/vendor at install time (avoids Turbopack dynamic require
issues), and wire a home-page import hook that parses files for inspection.

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(import): extend pptxtojson-pro with PPTX → Slide[] pipeline

`importPptx` now turns a .pptx file directly into canvas `Slide[]`,
optionally uploading every base64 image and blob-backed media via a
caller-supplied OSS callback before resolving.

- Vendor OpenMAIC slide types and shapes config into `src/openmaic/`
  so the bundled dist is self-contained and loadable via `/vendor/`
  URL under Turbopack; add stubs for `resolveFont`, `getSvgPathRange`
  and `parseVideoCodec` until the real PPTist helpers are ported.
- Move `import-pipeline/` under `src/` and re-export `importPptx`,
  `parsedToSlides`, `OssUpload`, `ImportPptxOptions` and `CanvasSlide`
  from the package main entry.
- Add `nanoid`, `katex` and `pptxtojson` as runtime deps of the package.
- Update `useImportPptx` to accept `upload` / `onImported` and return
  the converted `Slide[]`.
- Document the new API surface, error semantics and Turbopack workaround
  in the package README.

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(slide-renderer): package skeleton (rollup + tsc + empty index)

Workspace package scaffolding: package.json with peer deps (react/react-dom/motion/tailwindcss),
rollup ESM+CJS config, tsconfig (strict, jsx react-jsx), and empty entrypoints under src/.

Verified: pnpm --filter slide-renderer build produces dist/{index,elements/index,types/index}.{js,cjs,d.ts}
(empty chunks are expected at this stage).

* docs(slide-renderer): DESIGN.md + README.md

* feat(slide-renderer): copy Slide/Element types + add effects types

* feat(slide-renderer): add utils (geometry simplified to elements API, element ranges, cn)

* feat(slide-renderer): shared element hooks (fill/outline/shadow/flip) + ElementOutline

* feat(slide-renderer): BaseTextElement

* feat(slide-renderer): BaseShapeElement + GradientDefs + PatternDefs

* feat(slide-renderer): pure <img> BaseImageElement, decouple OpenMAIC media business

The base component drops:
- useMediaGenerationStore / isMediaPlaceholder (AI media generation polling)
- useSettingsStore (imageGenerationEnabled toggle)
- useMediaStageId / retryMediaTask (classroom-scoped retry orchestration)
- useI18n (placeholder/error/disabled copy)
- skeleton / error / disabled render branches

Retains: clip / filter / outline / shadow / colorMask, output <img src={elementInfo.src}>.

Adds a `renderImage` slot so consumers can re-inject business behavior (placeholders,
retry buttons, custom src resolvers) without modifying the package.

* feat(slide-renderer): Line / Table / Latex / Code base elements

- Line + LinePointMarker: copied with stroke-draw animation intact
- Table + StaticTable + tableUtils: copied with getTableSubThemeColor moved to package utils
- Latex: katex HTML + legacy SVG fallback, no business deps
- Code: shiki-based syntax highlighting (dynamic import); shiki added as optional peer
  dependency so consumers without code slides pay zero install cost

* feat(slide-renderer): BaseChartElement + Chart + chartOption (echarts as optional peer)

* feat(slide-renderer): pure <video> BaseVideoElement, decouple OpenMAIC media business

Drops:
- useCanvasStore (playingVideoElementId / pauseVideo)
- useMediaGenerationStore / useMediaStageId / retryMediaTask / getVideoMediaRefForElement
- useSettingsStore (videoGenerationEnabled)
- useI18n, motion/react animate scope
- skeleton / error / disabled / placeholder branches

Retains <video src controls preload=metadata>. Adds a `renderVideo` slot so
consumers can re-inject orchestrator-driven playback or placeholders.

* feat(slide-renderer): canvas hooks (useSlideBackgroundStyle, useViewportSize simplified)

- useSlideBackgroundStyle: copied as-is (no business deps)
- useViewportSize: rewritten to take viewportSize/Ratio/canvasPercentage as args,
  drop useCanvasStore, drop editor-only canvasDragged/dragViewport, return fitScale
  instead of writing to a store

* feat(slide-renderer): 4 effect overlays (Highlight/Spotlight/Laser/Zoom), props-driven

All overlays now receive element/geometry/options through props instead of reading
useCanvasStore. SpotlightOverlay uses a configurable element-id prefix
(default 'slide-element-') to locate DOM nodes for measurement, matching the
convention SlideElement will set in T14.

HighlightEffectOptions extended with color/opacity/borderWidth/animated to surface
the original visual knobs through the public API.

* feat(slide-renderer): SlideElement dispatcher with renderImage/renderVideo slots

* feat(slide-renderer): SlideCanvas v1 main entry (props-driven, auto-fit viewport)

Mirrors ScreenCanvas structure but reads from props: slide.elements, slide.theme,
props.background ?? slide.background, props.scale ?? autoFit, props.effects.

Auto-fits viewport into container by default via useViewportSize+ResizeObserver;
pass scale=1 to opt out and render at slide-native dimensions.

* feat(slide-renderer): SlideRendererProvider + useSlideContext (props or context)

SlideCanvas now reads from context as a fallback when props are omitted. Allows
the wrap-then-compose pattern from spec §3.2: provider holds shared data,
sibling overlays read via useSlideContext.

* feat(slide-renderer): aggregate public exports

Main entry exposes SlideCanvas, SlideElement, Provider/hooks, effects, hooks,
utils. `slide-renderer/elements` re-exports all 9 Base*Element + shared
ElementOutline/useElementXxx for granular composition. `slide-renderer/types`
already lived in src/types/index.ts.

* docs(slide-renderer): complete README (install / quickstart / API / effects / Tailwind setup)

* feat(demo): /slide-renderer-demo route exercising the workspace package

Hand-written single Slide with shapes + text demonstrates the v1 API end-to-end:
- props-driven SlideCanvas
- auto-fit viewport via parent container
- gradient background, shape outline + text fill

Wires slide-renderer as a workspace dep and registers its dist as a Tailwind
@source so utility classes inside the package get picked up by the host PostCSS
pipeline.

* feat(pptxtojson-pro): align imported Slide JSON with renderer contract

- Drive `viewportWidth` from the deck's actual pixel width (json.size.width
  × ratio) instead of the legacy 960 default, so 16:9 widescreen decks no
  longer get text element widths clamped to 4:3 dimensions (e.g. titles
  truncated to 842px and forced to wrap). Per-slide `viewportSize` now
  reports the same value, keeping transform-time and render-time aligned.
- Replace the pass-through font STUB with real resolution: 22-font
  self-hosted whitelist + alias map (微软雅黑/等线/宋体/楷体/仿宋/Arial/etc.)
  → 5-category primary font mapping, so unknown PPT fonts fall back to a
  rendered open-source equivalent and the pipeline can surface the
  replacement via `replacedFonts.fallback`.
- Translate cell `vAlign` from PPT-native (`up`/`mid`/`down`) to CSS-native
  (`top`/`middle`/`bottom`) at the importer boundary, so the renderer can
  transparently pass it through to `vertical-align` / `justify-content`
  without per-component conversion.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(slide-renderer): drop Tailwind defaults, data-drive styles, ship fonts

Three intertwined changes that together make the package self-contained
and align it with the "slide JSON is the single source of visual truth"
contract.

1. Remove Tailwind utility classes from every element renderer.
   - Replace `className="absolute ..."` / `className="rounded ..."` etc.
     with inline `style={{ position: 'absolute', borderRadius: ... }}`.
   - The few rules that can't be expressed inline (descendant selectors,
     keyframes, browser-default <p> margin reset) move to a new
     `src/styles.ts` injected once by `<SlideCanvas>` via `<style>`.
     Named animation classes (`slide-renderer-pulse` / `-ping`) replace
     `animate-pulse` / `animate-ping` so consumers don't need Tailwind.

2. Strip renderer-level positive defaults; surface them as data fields.
   - `BaseTextElement`: drop hardcoded `overflowWrap: 'break-word'` and
     the `paragraphSpace ?? 5` fallback. `--paragraphSpace` is only set
     when defined in data; CSS `var()` fallback is 0.
   - `StaticTable`: drop hardcoded `padding: '5px'`, `verticalAlign:
     'middle'`, `wordBreak: 'break-word'`. Extend `TableCell` with
     `padding?: string` and `vAlign?: 'top' | 'middle' | 'bottom'` so
     PPT-extracted padding / vertical alignment flow through unchanged.
   - `PPTTableElement` gets `rowHeights?: number[]` (per-row min-height;
     content can still grow rows).
   - Reshape `<td>` to match the classroom Vue layout: outer `<td>` carries
     only border + textStyle; inner `slide-renderer-cell-text` <div> is
     a flex column with `min-height = rowHeight - 4`, `padding =
     cell.padding`, `line-height: 1`, `justify-content` from `cell.vAlign`.
     Add `.slide-renderer-cell-text p + p { margin-top: 0.4em }` to give
     adjacent paragraphs breathing room without breaking the reset.

3. Self-contained font shipping.
   - Move the 22 woff2 files into `packages/slide-renderer/fonts/`.
   - Ship a sibling `fonts.css` with @font-face declarations using
     relative `./fonts/<name>.woff2` URLs.
   - Expose both via `package.json` exports (`./fonts.css`, `./fonts/*`)
     and the `files` array.
   - Consumer adds one import (`import 'slide-renderer/fonts.css'`); the
     bundler resolves the relative URLs against the package and emits
     each woff2 as a static asset. Removes the dependency on consumer-
     owned `app/globals.css` @font-face blocks and `public/font/` copies.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(demo): wire slide-renderer fonts and swap demo to a table-heavy slide

- Import `slide-renderer/fonts.css` in the root layout so consumer apps
  pull the package's self-hosted @font-face declarations and woff2 assets
  through Next.js' static-asset pipeline.
- Replace the hardcoded `demoSlides` array (24 mixed-element slides) in
  `/slide-renderer-demo` with a single 5×7 table-heavy slide so the demo
  exercises the new `TableCell.padding` / `TableCell.vAlign` /
  `PPTTableElement.rowHeights` fields and the flex-based cell layout.
  Convert the legacy `vAlign: 'up' | 'mid' | 'down'` values to the
  CSS-native `'top' | 'middle' | 'bottom'` form the renderer now expects.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(slide-renderer): add slideToPng standalone snapshot util

Exposes a new `slide-renderer/snapshot` sub-export with `slideToPng(slide,
options)`, the foundation for the AI-driven visual diff loop (snapshot
the rendered slide, compare against PowerPoint's own PNG export, decide
whether a discrepancy belongs to the import algorithm or the renderer).

Implementation notes
- Mounts `<SlideCanvas>` into an off-screen container sized exactly to
  the slide's native pixels, so `useViewportSize` collapses to a 1:1
  render (no scale offset).
- `flushSync` for the initial commit so the snapshot doesn't fire on an
  empty container; `requestAnimationFrame` × 2 to let the ResizeObserver
  settle; then waits for `document.fonts.ready` and every `<img>` in the
  container (with a configurable `timeoutMs`, default 5s).
- Snapshots the SlideCanvas root (`container.firstElementChild`) rather
  than the outer wrapper — html2canvas-pro's bounding-box math otherwise
  leaves white edges or drops absolutely-positioned children.
- Uses `html2canvas-pro` instead of `html-to-image`: the latter's SVG
  `<foreignObject>` path loads embedded woff2 asynchronously, so the
  drawImage fires before fonts decode and text re-wraps in the fallback
  font. html2canvas-pro walks the DOM and inherits the parent document's
  font registry, keeping wrap positions identical to the on-screen render.
- `onclone` hook injects a small CSS reset (`font-kerning: none`,
  `font-feature-settings: normal`, `font-variant-east-asian: normal`,
  `text-rendering: geometricPrecision`) scoped to the slide tree, to
  prevent html2canvas-pro's CJK text measurement from clipping
  full-width punctuation (e.g. `(` / `)`) past cell boundaries.
- Default `pixelRatio` follows `window.devicePixelRatio` for retina-sharp
  output; consumers can override.
- Optional `debugVisibleMs` briefly shows the off-screen container after
  snapshot so callers can compare what was captured vs the live render.

Wiring
- Sub-export added to `package.json` (`./snapshot`) and Rollup `entries`
  for tree-shaking — apps that don't use snapshot don't pay the
  `html2canvas-pro` bundle cost.
- Demo route adds an "导出 PNG" button that calls `slideToPng` on the
  active slide and triggers a browser download.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore: build slide-renderer in root postinstall

Without this, fresh installs leave packages/slide-renderer/dist
missing and Next.js fails to resolve the `slide-renderer` import.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(parser+renderer): iteration-0601-002 fidelity fixes

Parser (pptxtojson-pro):
- shapeSerializer: stop painting parent fill on grpFill children; honor
  explicit <a:ln><a:noFill/></a:ln> over theme lnRef (master logo dots
  were rendering as visible green rings).
- imageSerializer: detect custGeom ellipses and 8-vertex chamfered-rect
  photo frames; resolve to 'ellipse'/'octagon' instead of falling back
  to 'rect'.
- textSerializer: emit text-shadow from rPr effectLst > outerShdw, and
  compensate the half-leading PowerPoint puts above the first line for
  unitless lnSpc > 1 (cover-title gap regression).
- border/tableSerializer: pass rgba()/hsla() colors through ensureHex
  untouched so '#rgba(...)' never reaches the DOM.
- transformParsedToSlides: drop the 1.1 SAFE_PADDING wrap-fudge and
  thread bodyPr@anchor through as vAlign.
- font config: add 思源黑体/思源宋体 + Source Han aliases and a trailing
  region/weight suffix stripper so 'SourceHanSerif CN Light' resolves.

Renderer (slide-renderer):
- SlideCanvas: new chrome prop (default true) to opt out of the
  preview-only card shadow + rounded corners; snapshot pipeline passes
  false so html2canvas output matches PPT edges.
- BaseTextElement: flex-column + justifyContent driven by the new
  vAlign field; width/height stay 100% so the box anchors correctly.
- BaseImageElement: maxWidth/maxHeight 'none' to prevent host CSS from
  shrinking absolutely-positioned <img>.
- snapshot: render with chrome=false.

Docs: SKILL.md expanded with the iteration workflow + OOXML traps.

* fix(parser+renderer): iteration-0605-001 fidelity fixes

slide-renderer:
- PPTImageElement: add `softEdge` field (feather radius that fades image
  alpha to transparent at every edge, per a:softEdge@rad).
- TableCell: add per-side `borders` so cells with partial dividers render
  each side independently instead of falling back to the table-level
  uniform outline.
- BaseTextElement: hoist `fill`/`opacity` to the outer wrapper so the
  background covers the full shape rectangle, matching PowerPoint behavior
  for short text inside tall shapes.
- Misc tweaks across image/latex/shape/video base elements, StaticTable
  and the standalone snapshot util.

pptxtojson-pro:
- Parser/serializer fidelity improvements for text, math, image, shape
  and table (notably ~500 lines in textSerializer and ~127 in
  mathSerializer).
- Refinements in GroupNode, MathNode and ShapeNode models; richer Theme,
  StyleResolver and RenderContext plumbing.
- Expanded shape presets and customGeometry utilities, plus adapter and
  import-pipeline updates to surface the new fields.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore: stop tracking local slide-renderer-demo sandbox

`app/slide-renderer-demo/page.tsx` is a personal scratchpad used for
ad-hoc rendering tests; it shouldn't ship with the package. Remove it
from the index (file stays on disk locally) and ignore the directory so
future tweaks don't show up in `git status`.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore: rename packages pptxtojson-pro→maic-import and slide-renderer→maic-renderer

Align workspace package names with the MAIC product family:
  packages/pptxtojson-pro  → packages/maic-import
  packages/slide-renderer  → packages/maic-renderer

Functional references updated end to end:
- Root package.json: workspace deps + postinstall/sync scripts
- next.config.ts: transpilePackages
- app/globals.css: Tailwind `@source` for renderer dist
- app/layout.tsx: `maic-renderer/fonts.css` import
- lib/import/use-import-pptx.ts: imports + runtime URL
  (`/vendor/maic-import/index.js`) + script comment
- scripts/sync-maic-import.mjs: renamed and pointed at the new dist
- .gitignore: vendor path and sync-script comment
- Package package.json `name` fields and cross-link in READMEs

Also re-include the gitignored `app/slide-renderer-demo/` in Tailwind's
source detection via an explicit `@source` so its classes (e.g.
`bg-violet-600`) keep getting generated — Tailwind v4 skips gitignored
paths by default, which was making the demo's import button render
white-on-white after the demo was excluded from version control.

CSS class names (`slide-renderer-prose` / `slide-renderer-cell-text` /
`slide-renderer-pulse` / `slide-renderer-ping` / `slide-renderer-code-
cursor-blink`) and internal source comments that still reference the old
package names are intentionally left untouched to keep the rename
diff minimal; they can be updated separately as the codebase evolves.

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(dsl): extract @maic/dsl contract package and adopt @maic/* scope

Establish the SDK family's contract keystone and align package naming with
the planned @maic/* scope, per PR #668 review.

1. New @maic/dsl package (packages/maic-dsl)
   - Pure, zero-runtime-dependency spec: the canonical slide object model,
     pure type-guards, and DSL version/migration scaffolding.
   - Seeded from lib/types/slides.ts but reconciled into a *superset* of the
     three previously-drifted copies (app / renderer / importer); merged
     fields are annotated @since-merge. README documents the divergence and
     the acyclic dependency arrows (renderer/importer -> dsl -> nothing).
   - Enums are regular (not const) so consumers compiling with
     isolatedModules can import them across the package boundary (TS2748).

2. Wire @maic/importer to @maic/dsl
   - Import all slide types from @maic/dsl; delete the vendored
     openmaic/types/slides.ts copy.
   - Eliminate the Slide drift at the root: transformParsedToSlides now fills
     viewportSize/viewportRatio/theme at construction and emits a complete
     DSL Slide, removing the partial "draft slide" + post-fill step in
     parsedToSlides (no DraftSlide type needed).
   - Add @maic/dsl to the root postinstall build chain before the importer.

3. Adopt @maic/* scope (agent-noun names)
   - maic-import  -> @maic/importer
   - maic-renderer -> @maic/renderer
   - Update all package-name references (deps, app imports, transpilePackages,
     fonts.css subpath import, Tailwind @source node_modules path, READMEs).
   - Directory names and /vendor paths are intentionally left unchanged.

Note: @maic/renderer still vendors its own slide types; wiring it to
@maic/dsl is the next step.

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor(renderer): consume slide types from @maic/dsl, drop vendored copy

Wire @maic/renderer to the @maic/dsl contract keystone, completing the
de-duplication of the slide object model across the SDK family.

- Delete packages/maic-renderer/src/types/slides.ts (the vendored copy) and
  repoint all ~30 internal imports at @maic/dsl. SlideElement's runtime
  `ElementTypes` value import now resolves to the DSL enum.
- Re-export the DSL types from src/types/index.ts so the public
  `@maic/renderer/types` entry keeps exporting the full slide contract
  (alongside the renderer-only effect types).
- Add @maic/dsl as a regular dependency and mark it external in the rollup
  build so consumers share a single copy (enum not inlined); the emitted
  .d.ts references @maic/dsl directly.

@maic/dsl is a superset of the renderer's former types, so this is
non-breaking; the renderer additionally gains `script` and the
importer-origin fields it didn't previously declare.

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor(renderer): serve fonts from OSS, drop the 43.6MB bundled woff2

Move the 22 CJK fonts off the repo and onto object storage to fix the
PR #668 blocking repo-weight concern.

- fonts.css now points every @font-face src at
  https://file.maic.chat/fonts/<name>.woff2 instead of bundled local files.
- Extract the CDN origin + font whitelist into fonts.config.mjs (single
  source of truth) and generate fonts.css from it via
  scripts/generate-fonts-css.mjs. `genfonts` runs first in the build, so the
  CSS always reflects the config; changing the domain is now a one-liner.
- Delete packages/maic-renderer/fonts/*.woff2 (22 files, ~43.6MB) and drop
  the now-unused "./fonts/*" export and "fonts" files entry from package.json
  (fonts.css is kept).

Font names are unchanged, so consumers and the importer font whitelist are
unaffected. Note: this removes the files going forward only; purging them
from git history (LFS / filter-repo) is a separate follow-up.

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(home): gate the unwired PPTX import button behind a feature flag

The PPTX import flow is still scaffolding — `useImportPptx` has no
`onImported` consumer, so clicking it only logs the parsed slides. Hide both
PPTX import entry points (and the hidden file input) behind
NEXT_PUBLIC_ENABLE_PPTX_IMPORT (default off) so the UI doesn't expose a
no-op. The classroom import button is unaffected.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(import): harden the runtime URL-loaded PPTX parser

The PPTX parser is loaded at runtime from /vendor/maic-import/index.js — a
gitignored artifact synced into public/vendor during postinstall. If a deploy
skips that step the URL 404s and import() fails with an opaque SyntaxError
(404 HTML parsed as JS). Add guards on both ends plus docs.

- Build-time assertion: scripts/assert-vendor-maic-import.mjs verifies the
  bundle exists and is non-empty; wired into `build` so a misconfigured deploy
  fails early with an actionable message instead of shipping a broken runtime.
- Runtime guard: use-import-pptx.ts HEAD-probes the URL before import() and,
  on a non-ok response, throws a clear error surfaced to the user via the new
  import.error.parserUnavailable string (added to all 6 locales).
- Docs: document the postinstall deploy dependency and the pull-without-install
  type/runtime drift in @maic/importer's README.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore: unify the @maic/* license policy to AGPL-3.0

Pick one license for the SDK family and apply it uniformly, matching the
OpenMAIC root, per PR #668 review.

- @maic/dsl and @maic/importer: relicense MIT -> AGPL-3.0 (package.json +
  full AGPL-3.0 LICENSE text).
- @maic/renderer: already AGPL-3.0; add the LICENSE file its package.json
  `files` already referenced.

@maic/importer is derived from pptxtojson (MIT); MIT permits relicensing a
derivative under AGPL, and the upstream MIT attribution is retained in the
package README/index.html, so this is compliant.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore: rename packages/maic-import dir to maic-importer

Align the importer's directory with its @maic/importer package name and the
maic-* sibling dirs (maic-dsl, maic-renderer). Package name is unchanged, so
imports/transpilePackages/node_modules resolution are unaffected.

- git mv packages/maic-import -> packages/maic-importer (history preserved).
- Rename the vendor sync/assert scripts and the runtime vendor path to match:
  scripts/{sync,assert-vendor}-maic-importer.mjs, public/vendor/maic-importer,
  URL /vendor/maic-importer/index.js.
- Update all path references: root postinstall/build/sync scripts, .gitignore,
  use-import-pptx.ts, and doc links in the dsl/renderer/importer READMEs.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore: nest the @maic packages under packages/@maic/

Mirror the @maic/* npm scope in the directory layout: move the three family
packages into packages/@maic/{dsl,importer,renderer}. Package names are
unchanged, so imports / transpilePackages / node_modules resolution are
unaffected.

- git mv packages/maic-{dsl,importer,renderer} -> packages/@maic/* (history
  preserved).
- pnpm-workspace.yaml: add packages/@maic/* glob.
- Recompute the root postinstall cd chain for the nested layout.
- Update dir-path references: sync script srcDir, .gitignore comment, the dsl
  source comment, and the renderer/importer README/SKILL cross-links.

Unchanged: the @maic/* package names, the runtime vendor path
(public/vendor/maic-importer) and its sync/assert scripts.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore(renderer): clear font licenses, drop non-redistributable faces, remove importer font remapping

Address the PR #668 blocking font-license-clearance review.

Font licensing (renderer):
- Reduce the self-hosted whitelist to 6 clearly-redistributable faces:
  SourceHanSans/SourceHanSerif/LXGWWenKai/ZhuQueFangSong (SIL OFL 1.1),
  ZcoolHappy (ZCOOL free-use), WenDingPLKaiTi = AR PL KaitiM GB (Arphic PL 1999).
- Drop AlibabaPuHuiTi: free to *use* commercially but its license grants no
  explicit redistribution/re-host right, unlike OFL — dropped to keep public
  CDN serving unambiguous.
- Add FONTS.md (per-face attribution/clearance record, separate from the
  package's AGPL LICENSE) and bundle the verbatim license texts under
  font-licenses/ (OFL.txt, ZcoolHappy-LICENSE.txt, ARPHIC-PL.txt); ship both via
  package.json `files`. Regenerate fonts.css from the trimmed config.

Importer font remapping removed:
- The importer no longer rewrites font-family names (alias -> category ->
  primary). It passes each slide's original font-family through unchanged, so
  it can never target a face the renderer doesn't ship. Delete configs/font.ts,
  the resolveFont/replaceFontFamilyInHtml helpers, and the now-unused
  FontReplacementBucket / ImportContext.replacedFonts plumbing.

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs(renderer): document the CDN font runtime dependency

Add a "Fonts" section to the renderer README per PR #668: the optional
`@maic/renderer/fonts.css` loads woff2 from an external host
(https://file.maic.chat), which must be reachable + CORS-enabled or the
browser silently falls back to system fonts. Note that the import is optional
and that the origin is configurable via fonts.config.mjs + `pnpm run genfonts`.

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs(renderer): verify WenDingPLKaiTi == AR PL KaitiM GB from the font name table

Record the embedded-name-table evidence (Family/Copyright/Trademark/Designer =
Arphic, nameID 13 = the full Arphic Public License) so the
WenDingPLKaiTi ⇄ AR PL KaitiM GB correspondence is provable, and correct the
copyright year to 1994–1999 to match the font metadata.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore: fix `pnpm check` (prettier) after merging main

main added a `prettier . --check` CI step that flagged 180 files. Resolve it
consistently with the existing convention (vendored/workspace packages are
excluded from root Prettier):

- .prettierignore: exclude `packages/@maic/` (own rollup/tsc/eslint toolchains;
  dist is generated, importer/src1 is a vendored oracle), matching how
  pptxgenjs / mathml2omml / docs are already handled.
- Format the three root-level files we added/edited that root Prettier does
  cover: lib/import/use-import-pptx.ts and the two scripts/*-maic-importer.mjs.

`pnpm check` now passes.

Co-authored-by: Cursor <cursoragent@cursor.com>

* style: align @maic/{dsl,renderer,importer} source to root Prettier

Per review preference, the @maic packages are our own code and should follow
the repo style rather than be ignored wholesale. Narrow .prettierignore to only
the generated build output (packages/@maic/*/dist/) and the vendored legacy
reference (packages/@maic/importer/src1/), then `prettier --write` the package
sources. Formatting-only; all three packages still build.

`pnpm check` passes.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(lint): scope ESLint to @maic source and clear all errors

- eslint.config.mjs: replace blanket packages/** ignore with precise
  rules so @maic/{dsl,importer,renderer} source is linted, while skipping
  third-party packages, dist output, importer/src1 and public/vendor
  (the generated bundle was producing thousands of false errors in CI).
- importer: replace `any` with concrete narrowings/types, fix prefer-const.
- renderer: drop manual useMemo that React Compiler could not preserve.
- remove leftover debug console.log + stale eslint-disable in use-import-pptx.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(i18n): add missing PPTX import keys to pt-BR

pt-BR.json was missing import.{pptx,parsingPptx,pptxSuccess} and
import.error.{invalidPptx,parserUnavailable}, failing the i18n key
alignment check against en-US.json.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-09 03:25:05 -04:00

157 lines
5.2 KiB
JSON

{
"name": "openmaic",
"version": "0.2.2",
"private": true,
"license": "AGPL-3.0",
"engines": {
"node": ">=20.9.0"
},
"scripts": {
"postinstall": "cd packages/mathml2omml && npm run build && cd ../pptxgenjs && npm run build && cd ../@maic/dsl && pnpm run build && cd ../importer && pnpm run build && cd ../renderer && pnpm run build && cd ../../.. && node scripts/sync-maic-importer.mjs",
"sync:maic-importer": "node scripts/sync-maic-importer.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": "prettier . --check",
"format": "prettier . --write",
"test": "vitest run",
"test:e2e": "playwright test",
"test:e2e:ui": "playwright test --ui",
"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"
},
"dependencies": {
"@ai-sdk/anthropic": "^3.0.71",
"@ai-sdk/google": "^3.0.64",
"@ai-sdk/openai": "^3.0.53",
"@ai-sdk/react": "^3.0.170",
"@base-ui/react": "^1.1.0",
"@copilotkit/backend": "^0.37.0",
"@copilotkit/runtime": "^1.51.2",
"@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-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",
"@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",
"@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",
"echarts": "^6.0.0",
"embla-carousel-react": "^8.6.0",
"file-saver": "^2.0.5",
"geist": "^1.7.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",
"pptxgenjs": "workspace:*",
"pptxtojson": "^1.11.0",
"@maic/importer": "workspace:*",
"@maic/renderer": "workspace:*",
"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",
"shadcn": "^3.6.3",
"sharp": "^0.34.5",
"shiki": "^3.21.0",
"sonner": "^2.0.7",
"streamdown": "^2.1.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",
"undici": "^7.22.0",
"unpdf": "^1.4.0",
"use-stick-to-bottom": "^1.1.1",
"zod": "^4.3.5",
"zustand": "^5.0.10"
},
"devDependencies": {
"@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/react": "^19",
"@types/react-dom": "^19",
"@types/tinycolor2": "^1.4.6",
"eslint": "^9",
"eslint-config-next": "16.1.2",
"prettier": "3.8.1",
"rollup": "^4.35.0",
"rollup-plugin-typescript2": "^0.36.0",
"tailwindcss": "^4",
"tslib": "^2.8.0",
"tsx": "^4.21.0",
"typescript": "^5",
"vitest": "^4.1.0",
"vue-to-react": "^1.0.0"
},
"pnpm": {
"ignoredBuiltDependencies": [
"sharp",
"unrs-resolver"
]
},
"packageManager": "pnpm@10.28.0+sha512.05df71d1421f21399e053fde567cea34d446fa02c76571441bfc1c7956e98e363088982d940465fd34480d4d90a0668bc12362f8aa88000a64e83d0b0e47be48"
}