@liustack/pptwise 0.22.0 → 0.24.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 +72 -41
- package/README.zh-CN.md +72 -41
- package/dist/{chunk-M35M4QUC.js → chunk-2CA3JRFR.js} +460 -499
- package/dist/chunk-2CA3JRFR.js.map +1 -0
- package/dist/{chunk-WL5KWYKS.js → chunk-G7WQ7KSP.js} +34800 -30625
- package/dist/chunk-G7WQ7KSP.js.map +1 -0
- package/dist/{chunk-VUOLBHD7.js → chunk-RQUKZYSH.js} +1 -1
- package/dist/{chunk-VUOLBHD7.js.map → chunk-RQUKZYSH.js.map} +1 -1
- package/dist/{chunk-3ZUKISTY.js → chunk-VEZGVYJS.js} +2 -2
- package/dist/cli.js +911 -462
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +5320 -1534
- package/dist/index.js +15 -13
- package/dist/node.d.ts +1 -1
- package/dist/node.js +2 -2
- package/dist/{pixel-audit-H5K6JK3X.js → pixel-audit-M5Q5WCST.js} +4 -4
- package/dist/pixel-audit-M5Q5WCST.js.map +1 -0
- package/dist/{registry-C0GJH7ZT.d.ts → registry-D8bkC8ff.d.ts} +1 -1
- package/dsh/preview-tool.js +20 -17
- package/package.json +2 -1
- package/skills/pptwise/SKILL.md +133 -70
- package/skills/pptwise/SKILL.zh-CN.md +136 -73
- package/skills/pptwise/references/branding.md +34 -8
- package/skills/pptwise/references/branding.zh-CN.md +36 -8
- package/skills/pptwise/references/components.md +63 -33
- package/skills/pptwise/references/components.zh-CN.md +63 -33
- package/skills/pptwise/references/density.md +23 -9
- package/skills/pptwise/references/density.zh-CN.md +23 -9
- package/skills/pptwise/references/images.md +26 -13
- package/skills/pptwise/references/images.zh-CN.md +26 -13
- package/skills/pptwise/references/layouts.md +30 -26
- package/skills/pptwise/references/layouts.zh-CN.md +30 -26
- package/skills/pptwise/references/spec.md +143 -69
- package/skills/pptwise/references/spec.zh-CN.md +143 -69
- package/skills/pptwise/references/validate.md +33 -45
- package/skills/pptwise/references/validate.zh-CN.md +33 -45
- package/skills/pptwise/scripts/run.ps1 +1 -1
- package/skills/pptwise/scripts/run.sh +1 -1
- package/dist/chunk-M35M4QUC.js.map +0 -1
- package/dist/chunk-WL5KWYKS.js.map +0 -1
- package/dist/pixel-audit-H5K6JK3X.js.map +0 -1
- /package/dist/{chunk-3ZUKISTY.js.map → chunk-VEZGVYJS.js.map} +0 -0
|
@@ -1,82 +1,70 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Validation and review loop
|
|
2
2
|
|
|
3
|
-
Read this when
|
|
3
|
+
Read this when filling pages, assembling a deck project, rendering, auditing, previewing, serving, or revising.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Fill small batches
|
|
6
6
|
|
|
7
|
-
For each
|
|
7
|
+
For each confirmed spec page, write `pages/<page-id>.json`. A page file may contain only `components`, `background`, `image_side`, `footnote`, and `notes`. The spec owns `type`, content `kind`, `heading`, and page order. Repeating any locked field in a page file is a hard error.
|
|
8
|
+
|
|
9
|
+
Fill at most four pages, then run:
|
|
8
10
|
|
|
9
11
|
```bash
|
|
10
|
-
pptwise assemble deck-dir/
|
|
11
|
-
pptwise validate deck-dir/
|
|
12
|
+
pptwise assemble deck-dir/
|
|
13
|
+
pptwise validate deck-dir/
|
|
12
14
|
```
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
`assemble` merges the locked semantics and page content into IR v5. It does not write face choices or any other rendering decision into the project. A missing page file remains an accepted placeholder. An orphan page file, a locked-field conflict, an unknown theme, or a kind absent from the bound theme menu is a hard error.
|
|
17
|
+
|
|
18
|
+
`validate` applies schema, component, asset, narrative, physical capacity, and editorial checks. Fix errors until it prints `OK`. Warnings do not block output, but long headings, excessive density, dangling assets, and repetitive choices should normally be tightened before delivery.
|
|
15
19
|
|
|
16
|
-
|
|
20
|
+
Speaker `notes` export as native PowerPoint notes and never paint on the slide.
|
|
21
|
+
|
|
22
|
+
## Render only from the binding
|
|
17
23
|
|
|
18
24
|
```bash
|
|
19
25
|
pptwise render deck-dir/
|
|
20
26
|
```
|
|
21
27
|
|
|
22
|
-
The `.pptx`
|
|
28
|
+
The `.pptx` is written under `.pptwise/<deck>/`, and the command prints its absolute path. There is no render-time theme switch. The project spec is the binding.
|
|
23
29
|
|
|
24
|
-
|
|
30
|
+
An unfinished project requires explicit `--draft`. Content that would be dropped remains blocked unless the user explicitly accepts `--allow-dropped-content`. Prefer fixing or splitting the page.
|
|
25
31
|
|
|
26
|
-
|
|
32
|
+
When changing themes, compare candidates with `pptwise theme try`. A same-menu fork can replace the binding and proceed through assemble, validate, audit, and render. A different menu requires returning to theme selection, then revising the spec and affected page fills before those checks.
|
|
27
33
|
|
|
28
|
-
|
|
34
|
+
## Audit geometry
|
|
29
35
|
|
|
30
|
-
|
|
36
|
+
After every page is filled, run:
|
|
31
37
|
|
|
32
38
|
```bash
|
|
33
39
|
pptwise audit deck-dir/
|
|
34
40
|
```
|
|
35
41
|
|
|
36
|
-
|
|
42
|
+
The deterministic audit checks overflow, out-of-bounds content, low contrast, overlap, truncation, dropped content, and repeated lead components. A finding exits with code 1 and names the page. Restructure the content, rerun assemble and validate when source files changed, then rerun audit until it exits 0.
|
|
43
|
+
|
|
44
|
+
Add `--pixels` when cover or chapter pages use photo backgrounds. Pixel sampling catches text placed on an unsafe part of a real image.
|
|
37
45
|
|
|
38
|
-
|
|
46
|
+
## Review the whole deck
|
|
47
|
+
|
|
48
|
+
When an in-conversation deck preview tool exists, use it. Otherwise generate the self-contained review file:
|
|
39
49
|
|
|
40
50
|
```bash
|
|
41
51
|
pptwise preview deck-dir/ --html
|
|
42
52
|
```
|
|
43
53
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
### Showing the deck to the user
|
|
47
|
-
|
|
48
|
-
How you hand a deck over depends on what the harness can render. Take the first one that applies.
|
|
54
|
+
It writes one SVG per page plus `preview.html` under `.pptwise/<deck>/`. The preview is read-only. Placeholder pages are marked, and a complete deck includes audit findings in the review interface.
|
|
49
55
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
**If the harness has a built-in browser (VS Code, Cursor, and similar), preview to a file.** Run `pptwise preview deck-dir/ --html`. The command prints the absolute path of `preview.html`. Give the user that path so they can open it in the built-in browser. Re-run the same command after each revision: the path does not change, they refresh. No port, no background process.
|
|
53
|
-
|
|
54
|
-
**Otherwise, serve it.** Most harnesses have no way to draw a slide in the transcript, so the review happens in the user's own browser. Never try to substitute by pasting a thumbnail or a screenshot of one page into the conversation. Serve the whole thing and let the user page through it at full size. Start the server as a background task (in DSH, follow the background-job convention and note the job id so you can stop it later):
|
|
56
|
+
When the user needs a live browser round, run the project server as a background task:
|
|
55
57
|
|
|
56
58
|
```bash
|
|
57
59
|
pptwise serve deck-dir/ --no-open
|
|
58
60
|
```
|
|
59
61
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
1. Always pass `--no-open`. There is no browser to auto-open in an agent environment.
|
|
63
|
-
2. Report the exact localhost URL it prints (default `http://127.0.0.1:4400`) to the user, so they can open it themselves. That one line is the whole handoff.
|
|
64
|
-
3. The user pages through the deck and tells you what needs changing, in the conversation. A screenshot of the offending page is the fastest hand-off — you see exactly what they see.
|
|
65
|
-
4. Route each request through phase 6's revision flow. The page live-reloads on every file you save, so each revision lands in the tab the user already has open. No new link, no re-export, nothing for them to click.
|
|
66
|
-
5. Stay in the loop while they keep looking. When the round is over, stop the serve process (kill the background job). Never leave it running after the task ends.
|
|
67
|
-
|
|
68
|
-
### Phase 6 — Revision: edit one page, re-assemble
|
|
69
|
-
|
|
70
|
-
A revision touches the smallest file that captures it:
|
|
71
|
-
|
|
72
|
-
- Content change ("punch up the KPI page") → edit that page's `pages/<id>.json` only, then repeat phase 3's `assemble` + `validate` pair, and phase 5's `audit`, before re-rendering. Never regenerate pages nobody asked you to touch.
|
|
73
|
-
- Structural change (reorder, add/remove a page, change a page's type or heading) → edit `deck.spec.json` instead, re-run `pptwise spec validate` first (phase 2's no-respeccing rule still applies: only do this when the user actually asked for a structural change).
|
|
74
|
-
- A change the reviewer asked for in conversation (usually with a screenshot of the page) → find that page's `pages/<id>.json` by matching what they described against `deck.spec.json`/`pages/`, and treat their words as a requirement to interpret, not a patch to apply verbatim: they are describing a rendered slide, not writing page-file JSON. Translate it into a concrete content edit, then run the same content-change loop above (`assemble` + `validate` + `audit`) for every page you touched. Preview stays read-only end to end: nothing writes into `pages/*.json` except your own deliberate edit.
|
|
62
|
+
Share the exact localhost URL, keep the process for the review round, and stop only that process when the round ends.
|
|
75
63
|
|
|
76
|
-
##
|
|
64
|
+
## Revise at the source
|
|
77
65
|
|
|
78
|
-
|
|
66
|
+
- For a content change, edit only the affected `pages/<id>.json`, then assemble, validate, audit, and render again.
|
|
67
|
+
- For page order, page type, kind, heading, or theme binding, edit `deck.spec.json`, run `pptwise spec validate`, then repeat the project checks.
|
|
68
|
+
- For a different topic or audience, create a new project and restart from intent and narrative.
|
|
79
69
|
|
|
80
|
-
|
|
81
|
-
2. **A new deck** (a different topic, audience, or an explicit request to start over) → phase 1: a new deck project directory, fresh narrative/theme decision, fresh spec.
|
|
82
|
-
3. **Unrelated to deck generation** (a question about the content, anything with no connection to slides) → do not invoke pptwise at all.
|
|
70
|
+
Never regenerate unrelated pages during a focused revision. Interpret screenshot feedback as a content requirement, change the smallest source file that owns it, and keep preview output read-only.
|
|
@@ -3,85 +3,73 @@ summary: 'skills/pptwise/references/validate.md 的中文阅读镜像'
|
|
|
3
3
|
mirror_of: skills/pptwise/references/validate.md
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# 验证与评审循环
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
何时读:填充页面,组装 deck 项目,渲染,审计,预览,启动评审服务,或修订内容时。
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## 小批量填充
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
为 spec 中每张已确认页面编写 `pages/<page-id>.json`。页面文件只能包含 `components`、`background`、`image_side`、`footnote` 与 `notes`。Spec 拥有 `type`、内容页 `kind`、`heading` 和页面顺序。在页面文件中重复任何锁定字段都会硬报错。
|
|
13
|
+
|
|
14
|
+
每次最多填四页,然后运行:
|
|
13
15
|
|
|
14
16
|
```bash
|
|
15
|
-
pptwise assemble deck-dir/
|
|
16
|
-
pptwise validate deck-dir/
|
|
17
|
+
pptwise assemble deck-dir/
|
|
18
|
+
pptwise validate deck-dir/
|
|
17
19
|
```
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
`assemble` 把锁定语义与页面内容合并成 IR v5。它不会把脸的选择或其他渲染决定写回项目。没有页面文件时保留为合法占位页。孤儿页面文件、锁定字段冲突、未知主题,或 kind 不在已绑定主题菜单中,都会硬报错。
|
|
22
|
+
|
|
23
|
+
`validate` 检查 schema、组件、资产、叙事、物理容量与编辑预算。修复错误,直到它打印 `OK`。警告不拦输出,但长标题、密度过高、资产悬空和重复选择通常都应在交付前收紧。
|
|
20
24
|
|
|
21
|
-
|
|
25
|
+
演讲者 `notes` 会导出为原生 PowerPoint 备注,从不画在页面上。
|
|
26
|
+
|
|
27
|
+
## 只按绑定渲染
|
|
22
28
|
|
|
23
29
|
```bash
|
|
24
30
|
pptwise render deck-dir/
|
|
25
31
|
```
|
|
26
32
|
|
|
27
|
-
`.pptx`
|
|
33
|
+
`.pptx` 写到 `.pptwise/<deck>/`,命令会打印绝对路径。渲染阶段没有临时换主题的开关。项目 spec 就是绑定。
|
|
28
34
|
|
|
29
|
-
|
|
35
|
+
未填完的项目需要显式使用 `--draft`。可能丢失的内容仍会被拦截,除非用户明确接受 `--allow-dropped-content`。应优先修复或拆页。
|
|
30
36
|
|
|
31
|
-
|
|
37
|
+
更换主题前,用 `pptwise theme try` 比较候选。菜单相同的分叉可以换绑,再依次运行 assemble、validate、audit 和 render。菜单不同则要回到主题选择,修订 spec 与受影响的页面填充,再重复这些检查。
|
|
32
38
|
|
|
33
|
-
|
|
39
|
+
## 审计几何
|
|
34
40
|
|
|
35
|
-
|
|
41
|
+
全部页面填完后运行:
|
|
36
42
|
|
|
37
43
|
```bash
|
|
38
44
|
pptwise audit deck-dir/
|
|
39
45
|
```
|
|
40
46
|
|
|
41
|
-
|
|
47
|
+
确定性审计会检查溢出、越界、低对比度、重叠、截断、内容丢失和连续使用相同首组件。发现问题时退出码为 1,并指出页面。重组内容,源文件改变后重跑 assemble 与 validate,再重复 audit,直到退出码为 0。
|
|
48
|
+
|
|
49
|
+
封面或章节页使用照片背景时,加上 `--pixels`。像素采样能发现文字落在真实图片不安全区域的问题。
|
|
42
50
|
|
|
43
|
-
|
|
51
|
+
## 评审整份 deck
|
|
52
|
+
|
|
53
|
+
运行环境若有对话内 deck 预览工具,优先使用。否则生成自包含评审文件:
|
|
44
54
|
|
|
45
55
|
```bash
|
|
46
56
|
pptwise preview deck-dir/ --html
|
|
47
57
|
```
|
|
48
58
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
### 把 deck 拿给用户看
|
|
52
|
-
|
|
53
|
-
怎么交付取决于 harness 能画什么。按下面的顺序,用第一条成立的。
|
|
59
|
+
它会在 `.pptwise/<deck>/` 下写出每页一个 SVG 与 `preview.html`。预览只读。占位页会被标记,完整 deck 会在评审界面中带上 audit 发现。
|
|
54
60
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
**如果 harness 有内置浏览器(VS Code、Cursor 一类),就预览成文件。** 跑 `pptwise preview deck-dir/ --html`。命令会打印 `preview.html` 的绝对路径,把那条路径给用户,让他在内置浏览器里打开。每轮修订后重跑同一条命令,路径不变,用户刷新即可。不占端口,不留常驻进程。
|
|
58
|
-
|
|
59
|
-
**否则就起服务。** 大多数 harness 没办法在对话里画出一页幻灯片,审阅就发生在用户自己的浏览器里。绝不要用「贴一张缩略图或某一页的截图」来代替。把整份 deck 服务出去,让用户全尺寸自己翻。启动服务(在 DSH 里遵循后台任务的规矩,记下 job id,方便之后停掉):
|
|
61
|
+
用户需要浏览器实时评审时,把项目服务作为后台任务启动:
|
|
60
62
|
|
|
61
63
|
```bash
|
|
62
64
|
pptwise serve deck-dir/ --no-open
|
|
63
65
|
```
|
|
64
66
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
1. 必须带 `--no-open`。agent 环境里没有可以自动打开的浏览器。
|
|
68
|
-
2. 把它打印的 localhost URL(默认 `http://127.0.0.1:4400`)原样报给用户,让用户自己打开。这一行就是全部交付动作。
|
|
69
|
-
3. 用户翻完整份 deck,在对话里告诉你哪里要改。把出问题的那一页截图发过来是最快的交接方式——你看到的和他看到的完全一致。
|
|
70
|
-
4. 把每一条请求都走阶段六的修订流程。你每保存一次文件页面就实时重渲染,每一次修订都直接落在用户已经打开的那个标签页里。不用发新链接,也不用让他点任何东西。
|
|
71
|
-
5. 用户还在继续看就留在这个循环里。这一轮结束时停掉 serve 进程(kill 掉那个后台任务)。任务结束后绝不留着它继续跑。
|
|
72
|
-
|
|
73
|
-
### Phase 6 — 修订:改一页,重新 assemble
|
|
74
|
-
|
|
75
|
-
一次修订,只改能承载这次改动的最小那份文件:
|
|
76
|
-
|
|
77
|
-
- 内容改动(「把 KPI 那页写得更有冲击力」)→ 只改那一页的 `pages/<id>.json`,然后重复阶段三的 `assemble` + `validate` 组合,以及阶段五的 `audit`,再重新渲染。没人要求你改的页面,绝不重新生成。
|
|
78
|
-
- 结构性改动(调整顺序、增删页面、改某页的 type 或 heading)→ 改 `deck.spec.json`,先重新跑一次 `pptwise spec validate`(阶段二的「不要重新定 spec」规则依然适用:只有在用户确实要求结构性改动时才这么做)。
|
|
79
|
-
- 审查者在对话里提出的改动(通常附一张页面截图)→ 对照他描述的内容在 `deck.spec.json`/`pages/` 里找到那一页的 `pages/<id>.json`。把他的话当成一条需要你去理解的需求,而不是可以照抄的补丁:他描述的是渲染出来的 slide,不是在写页面文件 JSON——你自己要把它翻译成具体的内容改动,然后对每一页你动过的页面跑上面同一套内容改动流程(`assemble` + `validate` + `audit`)。preview 全程只读:除了你自己主动做出的编辑之外,没有任何环节会写入 `pages/*.json`。
|
|
67
|
+
分享命令打印的准确 localhost 地址,在评审轮次中保留进程,结束时只停止这个进程。
|
|
80
68
|
|
|
81
|
-
##
|
|
69
|
+
## 在源头修订
|
|
82
70
|
|
|
83
|
-
|
|
71
|
+
- 内容变化只编辑受影响的 `pages/<id>.json`,再依次运行 assemble、validate、audit 和 render。
|
|
72
|
+
- 页面顺序、页型、kind、标题或主题绑定变化时,编辑 `deck.spec.json`,运行 `pptwise spec validate`,再重复项目检查。
|
|
73
|
+
- 主题或受众完全不同的新任务应创建新项目,从意图与叙事重新开始。
|
|
84
74
|
|
|
85
|
-
|
|
86
|
-
2. **一份新 deck**(不同的主题、不同的受众,或明确要求重新开始)→ 走阶段一:新建一个 deck 项目目录,重新决定 narrative/theme,重新起一份 spec。
|
|
87
|
-
3. **和 deck 生成无关**(关于内容本身的问题,或任何和 slides 没有关联的事)→ 完全不要调用 pptwise。
|
|
75
|
+
聚焦修订时不要重新生成无关页面。把截图反馈解释为内容要求,修改拥有这项要求的最小源文件,并始终保持预览产物只读。
|
|
@@ -23,7 +23,7 @@ $ErrorActionPreference = 'Stop'
|
|
|
23
23
|
# package.json version, and `pnpm release:version` rewrites it on every bump.
|
|
24
24
|
$Package = '@liustack/pptwise'
|
|
25
25
|
$Bin = 'pptwise'
|
|
26
|
-
$Pinned = '0.
|
|
26
|
+
$Pinned = '0.24.0'
|
|
27
27
|
# ------------------------------------------------------------------------------
|
|
28
28
|
|
|
29
29
|
# Environment snapshot, filled by Collect and read by the emitter.
|
|
@@ -21,7 +21,7 @@ set -eu
|
|
|
21
21
|
# package.json version, and `pnpm release:version` rewrites it on every bump.
|
|
22
22
|
PKG="@liustack/pptwise"
|
|
23
23
|
BIN="pptwise"
|
|
24
|
-
PINNED="0.
|
|
24
|
+
PINNED="0.24.0"
|
|
25
25
|
# ------------------------------------------------------------------------------
|
|
26
26
|
|
|
27
27
|
# Split "X.Y.Z" (extra suffix ignored) into the globals _MAJ, _MIN, _PAT.
|