@liustack/pptfast 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/README.zh-CN.md +2 -1
- package/dist/browser.js +111 -111
- package/dist/{chunk-6JJGXB5S.js → chunk-ONO7V2SF.js} +11927 -10980
- package/dist/chunk-ONO7V2SF.js.map +1 -0
- package/dist/{chunk-RE53OS3K.js → chunk-WCBFCHOZ.js} +24 -21
- package/dist/chunk-WCBFCHOZ.js.map +1 -0
- package/dist/cli.js +409 -33
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +90 -22
- package/dist/index.js +2 -2
- package/dist/{pixel-audit-ZB4RSPHG.js → pixel-audit-GA6B64W7.js} +2 -2
- package/dist/{pixel-audit-ZB4RSPHG.js.map → pixel-audit-GA6B64W7.js.map} +1 -1
- package/dist/validate.d.ts +152 -45
- package/dist/validate.js +58 -35
- package/package.json +2 -1
- package/dist/chunk-6JJGXB5S.js.map +0 -1
- package/dist/chunk-RE53OS3K.js.map +0 -1
package/README.md
CHANGED
|
@@ -94,6 +94,7 @@ No `installPlatform()` call is needed in a browser — DOM parsing and (for `--p
|
|
|
94
94
|
| `themes [--json]` | List the 13 built-in themes |
|
|
95
95
|
| `narratives [--json]` | List named narrative presets (strategy/pacing/audience axes + theme recommendations) |
|
|
96
96
|
| `preview <target> -o <dir> [--html]` | Render each slide to a standalone SVG (`--html` also writes a self-contained `preview.html`) — same `target` forms as `render`, never gated on placeholder pages |
|
|
97
|
+
| `serve <target> [--port 4400] [--no-open]` | Live-preview server: the same review page as `preview --html`, auto-reloading on source changes, with annotations submitting straight back to the deck directory as `revision-request.json` |
|
|
97
98
|
| `migrate <input> -o <output>` | Convert a v3 IR file to v4, or a `deck.plan.json` project directory to `deck.spec.json` — deterministic, no model call (see The IR and Deck projects) |
|
|
98
99
|
| `init` | Scaffold `pptfast.config.json` |
|
|
99
100
|
| `check-update` / `self-update` | Check npm for a newer release / update the global install |
|
|
@@ -202,7 +203,7 @@ pptfast audit examples/basic.json
|
|
|
202
203
|
|
|
203
204
|
## For AI agents
|
|
204
205
|
|
|
205
|
-
The recommended loop for an agent generating a deck: read `pptfast schema` to learn the vocabulary, write an IR JSON, run `pptfast validate` and fix whatever it reports (errors carry a page number and a fixable-in-place message — the point is to close this loop without a human), then `pptfast audit` for the same kind of fixable-in-place feedback on what a *valid* deck can still get wrong at render time (overflow, low-contrast, overlap — exit code alone says whether it's clean), then `pptfast render`. `pptfast preview` gives the agent SVG files it can look at to self-check layout before committing to a render. Add `--html` to also write a self-contained `preview.html` for a human to review (keyboard nav, placeholder badges — a remote-URL image asset stays remote, the one self-containment gap) — zero network calls and zero further dependencies once it's open in a tab, the project's most mature zero-dependency browser artifact today (see Browser above). When every page is filled, that `preview.html` also overlays the same `audit` findings (per-page badges plus a findings panel, click to jump to the page) so a human reviewer sees them without a terminal — a deck with any placeholder page shows a one-line "audit skipped" notice instead. The reviewer can leave free-text per-page annotations right in `preview.html` and export them as a `revision-request.json` (a Blob download, no network or file write — preview stays read-only) for the agent to route back through `pages/*.json`. The Claude Code plugin above wraps this loop as a skill ([`skills/pptfast/SKILL.md`](./skills/pptfast/SKILL.md)). This exact loop is exercised by an internal, model-agnostic benchmark (`tests/bench/`, not published to npm) that mechanically scores how well a model follows the skill on a fixed question bank — see `tests/bench/README.md`.
|
|
206
|
+
The recommended loop for an agent generating a deck: read `pptfast schema` to learn the vocabulary, write an IR JSON, run `pptfast validate` and fix whatever it reports (errors carry a page number and a fixable-in-place message — the point is to close this loop without a human), then `pptfast audit` for the same kind of fixable-in-place feedback on what a *valid* deck can still get wrong at render time (overflow, low-contrast, overlap — exit code alone says whether it's clean), then `pptfast render`. `pptfast preview` gives the agent SVG files it can look at to self-check layout before committing to a render. Add `--html` to also write a self-contained `preview.html` for a human to review (keyboard nav, placeholder badges — a remote-URL image asset stays remote, the one self-containment gap) — zero network calls and zero further dependencies once it's open in a tab, the project's most mature zero-dependency browser artifact today (see Browser above). When every page is filled, that `preview.html` also overlays the same `audit` findings (per-page badges plus a findings panel, click to jump to the page) so a human reviewer sees them without a terminal — a deck with any placeholder page shows a one-line "audit skipped" notice instead. The reviewer can leave free-text per-page annotations right in `preview.html` and export them as a `revision-request.json` (a Blob download, no network or file write — preview stays read-only) for the agent to route back through `pages/*.json`. `pptfast serve <target>` offers the same loop live instead of as a download — a browser tab that auto-reloads on source changes, with that same annotation panel now submitting straight to `<deck-dir>/revision-request.json` on disk, no manual export/hand-back step. The Claude Code plugin above wraps this loop as a skill ([`skills/pptfast/SKILL.md`](./skills/pptfast/SKILL.md)). This exact loop is exercised by an internal, model-agnostic benchmark (`tests/bench/`, not published to npm) that mechanically scores how well a model follows the skill on a fixed question bank — see `tests/bench/README.md`.
|
|
206
207
|
|
|
207
208
|
## Roadmap
|
|
208
209
|
|
package/README.zh-CN.md
CHANGED
|
@@ -92,6 +92,7 @@ const bytes = await generatePptx(ir) // Uint8Array,可直接写成 .pptx 文
|
|
|
92
92
|
| `themes [--json]` | 列出 13 个内置主题 |
|
|
93
93
|
| `narratives [--json]` | 列出具名叙事预设(strategy/pacing/audience 轴 + theme 推荐) |
|
|
94
94
|
| `preview <target> -o <dir> [--html]` | 逐页渲染为独立 SVG(`--html` 额外写出一个自包含的 `preview.html`)——`target` 形式同 `render`,永远不受占位页拦截 |
|
|
95
|
+
| `serve <target> [--port 4400] [--no-open]` | 实时预览服务:与 `preview --html` 同款审阅页,源文件变化自动刷新,批注直接提交回 deck 目录生成 `revision-request.json` |
|
|
95
96
|
| `migrate <input> -o <output>` | 把 v3 IR 文件转成 v4,或把 `deck.plan.json` 项目目录转成 `deck.spec.json`——确定性转换,不调模型(见「IR」与「Deck 项目」) |
|
|
96
97
|
| `init` | 生成 `pptfast.config.json` 模板 |
|
|
97
98
|
| `check-update` / `self-update` | 检查 npm 上的新版本 / 更新全局安装 |
|
|
@@ -194,7 +195,7 @@ pptfast audit examples/basic.json
|
|
|
194
195
|
|
|
195
196
|
## 面向 AI agent
|
|
196
197
|
|
|
197
|
-
推荐给 agent 的生成回路:先读 `pptfast schema` 学词汇表,写出 IR JSON,跑 `pptfast validate` 并根据报错自纠(错误信息带页码和可直接照抄的修正方式,目的就是让这个回路不必依赖人工介入),再跑 `pptfast audit`——同样是可直接照抄的修正反馈,只是针对一份*合法* deck 在渲染层仍可能出现的问题(溢出、低对比度、重叠——exit code 本身就说明干不干净),最后执行 `pptfast render`。`pptfast preview` 能让 agent 在正式渲染前先看一遍 SVG,自查版式是否合理。加上 `--html` 还会额外写出一个自包含的 `preview.html`,供人工审查(键盘翻页、占位页角标——远程 URL 的图片资产仍是远程链接,这是自包含性上唯一的缺口)——打开后零网络请求、零进一步依赖,是这个项目目前最成熟的零依赖浏览器产物(见上文「浏览器」)。当所有页面都已填写时,这份 `preview.html` 还会叠加同一份 `audit` 检查结果(每页一个数量角标,加一个可点击跳转的 findings 面板),让人工审查者不必打开终端就能看到问题——如果 deck 里还有占位页,则显示一行「audit 已跳过」的提示代替。审查者可以直接在 `preview.html` 里给每页写自由文本批注,并导出为 `revision-request.json`(浏览器 Blob 下载,不联网也不写文件——preview 始终只读),交给 agent 通过 `pages/*.json`
|
|
198
|
+
推荐给 agent 的生成回路:先读 `pptfast schema` 学词汇表,写出 IR JSON,跑 `pptfast validate` 并根据报错自纠(错误信息带页码和可直接照抄的修正方式,目的就是让这个回路不必依赖人工介入),再跑 `pptfast audit`——同样是可直接照抄的修正反馈,只是针对一份*合法* deck 在渲染层仍可能出现的问题(溢出、低对比度、重叠——exit code 本身就说明干不干净),最后执行 `pptfast render`。`pptfast preview` 能让 agent 在正式渲染前先看一遍 SVG,自查版式是否合理。加上 `--html` 还会额外写出一个自包含的 `preview.html`,供人工审查(键盘翻页、占位页角标——远程 URL 的图片资产仍是远程链接,这是自包含性上唯一的缺口)——打开后零网络请求、零进一步依赖,是这个项目目前最成熟的零依赖浏览器产物(见上文「浏览器」)。当所有页面都已填写时,这份 `preview.html` 还会叠加同一份 `audit` 检查结果(每页一个数量角标,加一个可点击跳转的 findings 面板),让人工审查者不必打开终端就能看到问题——如果 deck 里还有占位页,则显示一行「audit 已跳过」的提示代替。审查者可以直接在 `preview.html` 里给每页写自由文本批注,并导出为 `revision-request.json`(浏览器 Blob 下载,不联网也不写文件——preview 始终只读),交给 agent 通过 `pages/*.json` 回填。`pptfast serve <target>` 把同一套回路做成实时版本而不是下载版本——打开的浏览器标签页会随源文件变化自动刷新,同一个批注面板改为直接提交到磁盘上的 `<deck-dir>/revision-request.json`,不用再手动导出、手动交回。上文的 Claude Code 插件已把这套回路封装成 skill([`skills/pptfast/SKILL.md`](./skills/pptfast/SKILL.md))。这套回路本身由一个模型无关的内部基准测试(`tests/bench/`,不发布到 npm)机械化验证——固定题库,评估模型跟随该 skill 的表现,细节见 `tests/bench/README.md`。
|
|
198
199
|
|
|
199
200
|
## 路线图
|
|
200
201
|
|