DESIGN.md@packages/@openmaic/importerA
DESIGN.md@packages/@openmaic/importer from thu-maic/openmaic is a DESIGN.md file: the design rules coding agents follow in that repo.
mdr add thu-maic/openmaic/packages/@openmaic/importer/DESIGN.md@git:20260624.7cb1291Pins git:20260624.7cb1291 in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 14 of 14 checks passed
- Kind
- DESIGN.md file
- Repository
- thu-maic/openmaic
- Path
packages/@openmaic/importer/DESIGN.md- Versions recorded
- 1
- Latest version
- git:20260624.7cb1291, committed Jun 24, 2026
- Size
- 6,732 bytes
- Repository stars
- 42,430
- License
- MIT
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# DESIGN
`maic-importer`:将 `.pptx` 文件解析为结构化 JSON,供 PPTist 等下游渲染器消费。
## 解析管线
```
.pptx (ArrayBuffer)
↓ parser/ZipParser ── 解压 zip,按用途分类
PptxFiles
↓ model/* ── XML → 结构化模型(位置、大小、层级)
PresentationData
↓ serializer/* ── 模型 + 主题/模板上下文 → JSON 元素
Element[]
↓ adapter/toPptxtojson ── 组装最终输出
Output { slides, themeColors, size }
```
入口:`src/index.ts` → `parse(buffer, options?)`
## 分层职责
| 层 | 目录 | 做什么 | 不做什么 |
|---|---|---|---|
| **parser** | `src/parser/` | zip 解压、XML 解析(SafeXmlNode)、rels 映射、单位换算 | 不解析 OOXML 业务语义 |
| **model** | `src/model/` | 解析几何与结构:位置、大小、旋转、占位符、节点类型 | 不解析视觉样式(颜色、字体、填充) |
| **serializer** | `src/serializer/` | 结合 theme/master/layout 上下文,把模型转成 JSON 元素 | 不直接读 zip |
| **adapter** | `src/adapter/` | 定义对外 JSON 类型,组装最终 Output | 不写业务逻辑 |
| **shapes** | `src/shapes/` | 生成 SVG path 字符串(200+ preset + 自定义几何) | 不决定填充/边框 |
| **utils** | `src/utils/` | 通用工具(颜色变换、媒体格式、EMF 解析、EQ 公式等) | 不引用业务类型 |
依赖方向:`adapter → serializer → model → parser`,单向。`shapes` 和 `utils` 是底层工具。
## 目录结构
```
src/
├── index.ts # 入口:parse() + 类型导出
├── adapter/
│ ├── types.ts # ★ 对外 JSON 类型定义(改它 = 改协议)
│ └── toPptxtojson.ts # 组装 Output
├── parser/
…Read the whole file at its exact version.
How to install
mdr add thu-maic/openmaic/packages/@openmaic/importer/DESIGN.md@sha256:e8b98723c68740b4The line at the top of this page pins the label git:20260624.7cb1291, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_fkv4jy4se4d4jtgw)
4 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 1 version of this file, committed on Jun 24, 2026.
Audit of the latest version
- pass: Size between 200 bytes and 200 KB (6732 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
thu-maic/openmaic · 42,430 stars · license MIT · pushed 2026-11-02 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_fkv4jy4se4d4jtgw GET https://markdownregistry.com/api/v1/resolve?ref=thu-maic/openmaic/packages/@openmaic/importer/DESIGN.md GET https://markdownregistry.com/api/v1/blob/e8b98723c68740b4753fe7e806fcf7761f97351932f6d76f54d6fede2a660443
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: what DESIGN.md is and how agents use it · which agent file does what.