@taloswork/ose-shared 0.1.9 → 0.1.10
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/mcp/gen/mcp.json +2 -2
- package/package.json +3 -3
- package/skills/cozy-static-svg/SKILL.md +1 -1
- package/skills/diagram-design/SKILL.md +1 -1
- package/skills/document/SKILL.md +63 -75
- package/skills/document/bin/deck-build.cjs +51 -1
- package/skills/document/bin/deck-qa.cjs +18745 -279
- package/skills/document/bin/doc-convert.cjs +9280 -76489
- package/skills/document/bin/doc-fill.cjs +0 -0
- package/skills/document/bin/doc-gen.cjs +3043 -46825
- package/skills/document/bin/doc-run.cjs +65095 -1967
- package/skills/document/bin/doc-scan.cjs +0 -0
- package/skills/document/bin/doc-text.cjs +0 -0
- package/skills/document/bin/doc-validate.cjs +18067 -226
- package/skills/document/bin/doc-xml.cjs +1 -1
- package/skills/document/bin/docx-annotate.cjs +0 -0
- package/skills/document/bin/html2pptx.cjs +32498 -145280
- package/skills/document/bin/ocr-worker.cjs +0 -0
- package/skills/document/bin/ocr.cjs +0 -0
- package/skills/document/bin/pdf-form.cjs +0 -0
- package/skills/document/bin/pdf-images.cjs +0 -0
- package/skills/document/bin/pdf-ops.cjs +0 -0
- package/skills/document/bin/pdf-render.cjs +11 -9
- package/skills/document/bin/pdf-tables.cjs +0 -0
- package/skills/document/bin/pptx-clone.cjs +21 -25
- package/skills/document/bin/pptx-embed-fonts.cjs +8 -6
- package/skills/document/bin/pptx-set-image.cjs +0 -0
- package/skills/document/bin/pptx-slide.cjs +22 -32
- package/skills/document/bin/pptx-theme.cjs +1 -20
- package/skills/document/bin/pptx-tokenize.cjs +1 -1
- package/skills/document/bin/xlsx-query.cjs +0 -0
- package/skills/document/bin/xlsx-recalc.cjs +0 -0
- package/skills/document/bin-reference.md +35 -0
- package/skills/document/content-pipeline.md +19 -18
- package/skills/document/deck-design.md +110 -211
- package/skills/document/layouts/README.md +4 -33
- package/skills/document/motion/README.md +4 -2
- package/skills/document/office.md +5 -1
- package/skills/document/rewrite.md +43 -99
- package/skills/document/styles/README.md +0 -7
- package/skills/document/theme-system.md +1 -0
- package/skills/document/themes/README.md +5 -5
- package/skills/document/themes/anthropic-clay.json +1 -7
- package/skills/document/themes/apple-keynote.json +1 -7
- package/skills/document/themes/black-gold.json +1 -2
- package/skills/document/themes/cinereel.json +1 -2
- package/skills/document/themes/cool-tech.json +1 -2
- package/skills/document/themes/hand-drawn.json +1 -2
- package/skills/document/themes/ivory-gold.json +1 -2
- package/skills/document/themes/magazine-ink.json +1 -2
- package/skills/document/themes/mckinsey-consulting.json +1 -7
- package/skills/document/themes/mono.json +1 -2
- package/skills/document/themes/swiss-grid.json +1 -2
- package/skills/document/themes/warm-editorial.json +1 -2
- package/skills/image-layout/SKILL.md +1 -1
- package/skills/image-layout/bin/html2img.cjs +0 -0
package/mcp/gen/mcp.json
CHANGED
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"TALOS_API_KEY": "${TALOS_GATEWAY_API_KEY}",
|
|
13
13
|
"TALOS_GATEWAY_BASE_URL": "${TALOS_GATEWAY_BASE_URL}"
|
|
14
14
|
},
|
|
15
|
-
"timeoutMs":
|
|
15
|
+
"timeoutMs": 720000,
|
|
16
16
|
"connectTimeoutMs": 30000,
|
|
17
|
-
"supportsParallelToolCalls":
|
|
17
|
+
"supportsParallelToolCalls": true,
|
|
18
18
|
"metadata": {
|
|
19
19
|
"provides": "talos/gen",
|
|
20
20
|
"title": "文生图/视频 · Talos 计费",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taloswork/ose-shared",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "Talos cross-OSE shared library — skills + MCP servers auto-loaded into every OSE (P93 2026-07-27).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
13
|
-
"_talosPublishHash": "sha256-
|
|
14
|
-
"_talosPublishedAt": "2026-09-
|
|
13
|
+
"_talosPublishHash": "sha256-MMo1cmSGoBS29NLIlZUCTv7YE8lJGyiNy0TeT_VC7Og",
|
|
14
|
+
"_talosPublishedAt": "2026-09-27T03:05:35.934Z"
|
|
15
15
|
}
|
|
@@ -33,7 +33,7 @@ description: "手工编写纯静态 SVG 插画:柔和渐变、圆润主体、
|
|
|
33
33
|
参数给目录或通配符即为批量(如 `python3 scripts/artkit.py .`),通配符由脚本自己展开,
|
|
34
34
|
两个平台写法一致;细节见 `references/cross-platform.md`。
|
|
35
35
|
报告含结构、圆角裁切、引用、字体、调色清单、文案清单;**无 ✗ 才算过**。不通过就用 edit 精准修复(只动需要动的坐标 / 路径 / 层级),再跑一次;成功报告留着核对文案与调色。
|
|
36
|
-
5. **交付**:`present_file` 直出原生 SVG
|
|
36
|
+
5. **交付**:`present_file` 直出原生 SVG;预览、脚本不交付。质检报告核对过后,回复里用温柔、贴合画面意境的一两句话介绍这幅画,**严禁输出“质检通过、直出原生 SVG”这类生硬的技术汇报**。
|
|
37
37
|
|
|
38
38
|
- **成批出图**:先按顺序写完所有 SVG,再用一条命令批量质检(传目录或通配符即可),逐个按报告核对。
|
|
39
39
|
- **不拆子 agent**:画 SVG 全程自己完成,不派子 agent、不并行外发。逐张手写、逐张落盘、最后统一质检;成批也是串行画完再批量质检,不用子 agent 分担画面。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: diagram-design
|
|
3
|
-
description: Create branded architecture,
|
|
3
|
+
description: Create branded architecture, data flow, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar, flywheel, tree, org chart, layer stack, Venn, pyramid/funnel, and bar/line/Gantt/scatter diagrams as standalone HTML/SVG/PNG. Also redraws .drawio or Mermaid sources, onboards brand tokens from a website, and adds callouts, motion or hand-drawn styling.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
6
|
version: "2.3"
|
package/skills/document/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: document
|
|
3
|
-
description: "Use
|
|
3
|
+
description: "Use for document FILES. Reading: a PDF, .docx, .pptx or .xlsx attachment to read, summarize, translate or search when its pages must be rendered (formulas, scans, figures) or a sheet computed — others arrive as extracted text. Writing: any request to create or edit a Word, PowerPoint, Excel or PDF file, or convert one (转成/导出 PDF, .docx/.pptx → PDF). ALWAYS use its scripts — doc-gen (docs), html2pptx (decks, and a deck made here to PDF), doc-convert (an existing file to PDF); never hand-write a python/ReportLab/LibreOffice/browser pipeline. Do NOT trigger for images or plain .txt/.md/.csv."
|
|
4
4
|
license: Proprietary. LICENSE.txt has complete terms
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -26,6 +26,14 @@ script only when:
|
|
|
26
26
|
exact (don't do the arithmetic yourself).
|
|
27
27
|
- **Formula / figure / scanned / exact layout matters** AND you can see images
|
|
28
28
|
→ read **vision.md**; `bin/pdf-render` a page, then look.
|
|
29
|
+
- **A deck you built here, as PDF**(PPT 要 PDF / 导出 PDF / deck as PDF)→ print
|
|
30
|
+
its `deck.html` with the same STYLE flags you rendered the .pptx with (leave out
|
|
31
|
+
`--editable` / `--rasterize` / `--notes-doc`, which are .pptx-only):
|
|
32
|
+
`bin/html2pptx.cjs deck.html out.pdf --style <id> [--theme-v2 …] [--backdrop …]`.
|
|
33
|
+
One 16:9 page per slide, vector text (selectable, searchable), links clickable.
|
|
34
|
+
Do not route it through `doc-convert` (that re-lays out the .pptx) and never
|
|
35
|
+
assemble slide PNGs into a PDF (image pages: no text, no links). If the result
|
|
36
|
+
reports `pages` ≠ `slides`, a slide overflows its canvas — fix it and print again.
|
|
29
37
|
- **Convert** a .docx/.pptx/.xlsx to PDF(转成/转换/导出 PDF / convert to PDF)→
|
|
30
38
|
`bin/doc-convert.cjs <in.docx|pptx|xlsx> <out.pdf>`. This is FAITHFUL conversion —
|
|
31
39
|
the source's content, structure and images with neutral print styling; do not
|
|
@@ -39,6 +47,10 @@ script only when:
|
|
|
39
47
|
template) → read **rewrite.md**, use `doc-gen` / `doc-fill`. **Always** produce
|
|
40
48
|
document files via these scripts — never hand-write a python / ReportLab /
|
|
41
49
|
LibreOffice script for document output.
|
|
50
|
+
**A length limit** (正文 1000 字以内 / under 800 words) is kept in the spec,
|
|
51
|
+
before generating: after a PDF, `doc-gen` prints `textChars` (spaces and URLs
|
|
52
|
+
not counted) — over the limit, shorten the spec and generate once more. Do not
|
|
53
|
+
extract text from the output to count it.
|
|
42
54
|
**Any deck/presentation(路演/汇报/评审/宣讲/pitch/roadshow/介绍 PPT)**:
|
|
43
55
|
**CLARIFY FIRST — HARD GATE (applies to EVERY deck).** Before authoring, collect
|
|
44
56
|
three brief fields: **(1) content source** (提供材料 / 联网调研 / 自由创作);
|
|
@@ -117,53 +129,28 @@ script only when:
|
|
|
117
129
|
Then render a cover+content sample of the result and confirm (same image-card step as
|
|
118
130
|
a normal pick) before authoring; save the resulting preference to memory.
|
|
119
131
|
|
|
120
|
-
**
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
only for a deliberate exception. `decorRhythm:"steady"` disables auto balancing.
|
|
143
|
-
For `classic-v1`, choose only pre-V2 layouts and omit scene/decor controls.
|
|
144
|
-
3. **Render:** modern entry → `bin/html2pptx.cjs deck.html out.pptx --style <id>
|
|
145
|
-
--theme-v2 [--media-style <id>] [--backdrop <variant>]`; frozen classic entry →
|
|
146
|
-
`bin/html2pptx.cjs deck.html out.pptx --style <id> [--backdrop <variant>]`.
|
|
147
|
-
DEFAULT hybrid (no `--editable`/`--rasterize`): pixel-perfect
|
|
148
|
-
visuals baked into a backdrop + native EDITABLE text and native `data-chart`
|
|
149
|
-
on top. Theme V2 injects the compatible V1 family paint plus semantic component,
|
|
150
|
-
media and art-direction layers; it never chooses a layout. Chromium gives the full CSS toolbox (Tailwind
|
|
151
|
-
+ a `size="1".."7"` scale, gradients, shadows, per-element SVG, `<img>`
|
|
152
|
-
auto-inline, speaker notes) → NATIVE editable pptx.
|
|
153
|
-
**For a substantive deck, first read content-pipeline.md** (premium-deck method:
|
|
154
|
-
clarify + persist brief → research → narrative structure → one outline gate → author from
|
|
155
|
-
`layouts/` → fast HTML preview → final PPTX QA; premium density = rich VISUAL + sparse TEXT, details to
|
|
156
|
-
speaker notes). **Do NOT build a deck with `doc-gen pptx` archetypes or `doc-run`
|
|
157
|
-
PptxGenJS — those deck paths are OFF.** (html2pptx needs a browser: the app's
|
|
158
|
-
Chromium service or bundled Playwright; if neither, say so and stop — never
|
|
159
|
-
silently fall back to a lesser deck.) End with the mandatory hostile-review loop
|
|
160
|
-
(deck-design.md). *(The legacy `themes/*.json` + `--theme` recolor path is for
|
|
161
|
-
doc-gen DOCUMENTS; for decks use `--style` + `layouts/`.)*
|
|
162
|
-
- **After ANY generated/edited file** (doc-gen / doc-fill / docx-annotate /
|
|
163
|
-
pptx-clone / doc-xml pack / hand-written scripts): run
|
|
164
|
-
`bin/doc-validate.cjs <file>` — exit 1 means fix it before delivering. Then
|
|
165
|
-
**render-and-look** at the output before delivery (see "Verify generated
|
|
166
|
-
output" below) — `doc-validate` proves well-formed, not good-looking.
|
|
132
|
+
**Then build it — the method lives in deck-design.md.** For a substantive deck read
|
|
133
|
+
**content-pipeline.md** first (brief → research → narrative → one outline gate), then
|
|
134
|
+
**deck-design.md** (workflow and delivery sign-off) and **`layouts/README.md`** (the
|
|
135
|
+
layout index and fill rules). In short: pick layouts from `layouts/profiles.json` by
|
|
136
|
+
slide intent; fill them with `deck-build` (required for any layout with a `{{#rows}}`
|
|
137
|
+
block — it computes the geometry; put the confirmed scenario in its spec as
|
|
138
|
+
`"scenario"` — read decks such as 内审/报告/培训 then get no animation); render with `bin/html2pptx.cjs deck.html out.pptx
|
|
139
|
+
--style <id>` (+ `--theme-v2` for modern entries, never for `classic-v1`) — DEFAULT
|
|
140
|
+
hybrid: baked visuals, native editable text. `doc-gen` makes no decks and the doc-run
|
|
141
|
+
PptxGenJS deck path is OFF. html2pptx needs a browser (the app's Chromium or bundled
|
|
142
|
+
Playwright); without one, say so and stop — never fall back to a lesser deck.
|
|
143
|
+
- **Generators check their own output.** `doc-gen` and `html2pptx` report
|
|
144
|
+
validity in the step that wrote the file — `valid: false` exits 1, fix before
|
|
145
|
+
delivering; never re-run `doc-validate` on their output. `doc-gen pdf` prints
|
|
146
|
+
`{valid, pages, textChars, cjkChars, previews}` (a ≈72dpi PNG per page — read
|
|
147
|
+
those, do not re-render or count characters yourself); `doc-gen docx` prints
|
|
148
|
+
`{valid, textChars, cjkChars}`, `xlsx` `{valid}`; `html2pptx` adds `valid` and
|
|
149
|
+
`qa` (deck-qa's findings) to its result. **After any other edit** (doc-fill /
|
|
150
|
+
docx-annotate / pptx-clone / pptx-slide / doc-xml pack / hand-written scripts)
|
|
151
|
+
run `bin/doc-validate.cjs <file>` yourself — exit 1 means fix it. Valid is not
|
|
152
|
+
good-looking: **render-and-look** before delivery (see "Verify generated
|
|
153
|
+
output" below; decks sign off with `deck-qa --final`).
|
|
167
154
|
- **Raw XML edit** (when no targeted tool fits): `doc-xml unpack` → edit →
|
|
168
155
|
`doc-xml pack` → `doc-validate` (see rewrite.md "Raw XML editing").
|
|
169
156
|
- **PDF** whose inlined text is garbled/missing where the answer should be →
|
|
@@ -204,39 +191,40 @@ Fidelity-decision self-correct, but pointed at your OWN output:
|
|
|
204
191
|
blank CJK** (a missing-font symptom, not a content bug); colliding
|
|
205
192
|
headers/footers; leftover `{{tokens}}` / "lorem" / "undefined".
|
|
206
193
|
3. **Fix → re-render the affected pages.** One fix often creates another; repeat
|
|
207
|
-
until a clean pass.
|
|
194
|
+
until a clean pass. Fix what is broken — clipped, overlapping, unreadable, tofu —
|
|
195
|
+
not how full a page looks: unless the user asked for a page count, never
|
|
196
|
+
resize fonts, line height or margins to fill a short last page or squeeze onto
|
|
197
|
+
fewer pages. Page breaks already keep a heading with its text and never strand
|
|
198
|
+
a single line, so a heading near a page edge is not something to fix. Layout and styling taste gets at most
|
|
199
|
+
TWO fix rounds: after the second, deliver and name what is still imperfect instead
|
|
200
|
+
of regenerating again. Scale rigor to the artifact: a one-page memo = one look; a
|
|
208
201
|
multi-page report/deck = every page, ideally a sub-agent for fresh eyes.
|
|
209
202
|
4. **Vision unavailable**: say so and rely on `doc-validate` + a text re-extract
|
|
210
203
|
(`doc-text`) as a weaker proxy — never claim the layout is verified.
|
|
211
204
|
|
|
212
205
|
## Scripts (run via bash; output returns to context, the script itself does not)
|
|
213
206
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
- `bin/
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
- `bin/doc-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
- `bin/
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
- `bin/
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
- `bin/
|
|
234
|
-
- `bin/pdf-form.cjs list
|
|
235
|
-
- `bin/pdf-ops.cjs merge <out> <in…>` / `split <in> <from-to> <out>` / `rotate <in> <deg> <out> [pages]` / `watermark <in> <text> <out>` / `encrypt <in> <out> <user-pw> [owner-pw]` / `decrypt <in> <pw> <out>` — PDF page ops + AES-256 password protection.
|
|
236
|
-
- `bin/xlsx-recalc.cjs <in.xlsx> <out.xlsx>` — re-evaluate all formulas (HyperFormula) and cache the results, keeping the formulas. Use when a spreadsheet's formula cells show stale/blank values.
|
|
237
|
-
- `bin/doc-run.cjs <script.js> [args…]` — run a custom Node script with the engine's libraries bundled in (`require("pptxgenjs"|"docx"|"xlsx"|"pdf-lib"|"jszip"|"pizzip"|"hyperformula")` guaranteed on any machine; `--list` prints the registry). The long-tail escape hatch when no verb fits — see rewrite.md "Custom scripts"; ALWAYS doc-validate the output.
|
|
238
|
-
- `bin/html2pptx.cjs <deck.html|snapshot.layout.json> [out.pptx] [--style <id>] [--theme-v2] [--media-style <id>] [--backdrop <variant>] [--editable] [--rasterize] [--preview-dir <dir>] [--preview-pages <all|N,N-M>]` — **THE deck path**: write slide HTML (`<section class="slide" data-layout="…">` on a 1280×720 canvas), Chromium lays it out → NATIVE editable pptx. `--preview-dir` is a preview-only fast path that writes slide PNGs directly from the styled HTML and skips PPTX/LibreOffice; use all pages once, then `--preview-pages` for changed pages. `--theme-v2` composes the selected family's existing paint with its semantic component profile, default media style and bound art direction; `--media-style` overrides only the media treatment. Entries in a `classic-v1` catalog collection reject both flags; omit them for the frozen V1 path. `--backdrop <variant>` picks a signature backdrop. **DEFAULT = hybrid**: each slide's visuals bake into a full-fidelity raster backdrop with native EDITABLE text on top; auto-falls back to plain native if backdrop capture is unavailable. `--editable` = plain native only (effects flatten). `--rasterize` = full image slides (ZERO editability — tell the user). Advisory warnings on hardcoded brand colors + repeated layouts (P3). Runs in the app's Chromium OR bundled headless Chromium (Playwright) — works off-app (CI/cloud); layout JSON works anywhere. **Tailwind + `size="1".."7"` scale available** (vendored offline). See theme-system.md + deck-design.md + layouts/README.md. `[--theme <theme.json>]` is a separate legacy document recolor path.
|
|
239
|
-
- `bin/deck-build.cjs <spec.json> <deck.html>` — **THE FAST deck path** for catalog slides: emit a COMPACT spec with `style`, independent `layoutPack`, and per-slide `intent` + `layout` + content. Modern entries add `themeVersion:2` plus optional `mediaStyle`/`decorRhythm`; frozen `classic-v1` entries must omit those fields and use only pre-V2 layouts. Use `layouts/profiles.json` to match content intent before selecting geometry; under V2 the same intent derives the art scene and deck-level decoration rhythm. The CLI warns on an intent/layout mismatch and errors on an unknown intent. `layoutPack:"none"` forces shared layouts; omitting `layoutPack` preserves the old behavior where a `kind:"pack"` style implicitly uses its same-name layouts. `slots`, `rows`, and `chart` are still validated against `layouts/slots.json`; any unknown layout/slot/field or missing figure input exits 1 and writes nothing. See theme-system.md for the full schema and compatibility contract.
|
|
207
|
+
One line each — **read a bin's entry in `bin-reference.md` before its first use**
|
|
208
|
+
(flags, output shape, exit codes, gotchas). Do not read, grep or open `bin/*.cjs`
|
|
209
|
+
themselves — they are bundled builds; the answer is in `bin-reference.md`.
|
|
210
|
+
|
|
211
|
+
- Read: `bin/doc-scan.cjs <file.pdf>` page signals · `bin/doc-text.cjs <file.pdf>` text layer ·
|
|
212
|
+
`bin/pdf-render.cjs <file.pdf> <N|N-M|3,7-8|all> [scale]` pages → PNG (scale `1` ≈72dpi for layout) ·
|
|
213
|
+
`bin/pdf-images.cjs` embedded images · `bin/pdf-tables.cjs` text-layer tables ·
|
|
214
|
+
`bin/ocr.cjs <image> [lang]` · `bin/xlsx-query.cjs <file> --summary|--agg|--sample` exact spreadsheet compute.
|
|
215
|
+
- Generate: `bin/doc-gen.cjs <docx|xlsx|pdf> <out> <spec.json>` (self-checks) ·
|
|
216
|
+
`bin/doc-run.cjs <script.js>` custom script with the bundled libraries ·
|
|
217
|
+
`bin/doc-convert.cjs <in.docx|pptx|xlsx> <out.pdf>` faithful → PDF.
|
|
218
|
+
- Decks: `bin/deck-build.cjs <spec.json> <deck.html>` catalog slides from a compact spec ·
|
|
219
|
+
`bin/html2pptx.cjs <deck.html> <out.pptx> --style <id> …` THE deck path (self-checks; `--preview-dir` for fast previews) ·
|
|
220
|
+
`bin/deck-qa.cjs <deck.pptx> [--json | --final]` lint, and the one-call delivery sign-off.
|
|
221
|
+
- Edit: `bin/doc-fill.cjs` fill `{{tokens}}` · `bin/doc-xml.cjs unpack|pack|replace|merge-runs` raw XML ·
|
|
222
|
+
`bin/pptx-slide.cjs add|dup|remove|reorder` · `bin/pptx-clone.cjs` clone a template slide per item ·
|
|
223
|
+
`bin/pptx-tokenize.cjs` uploaded deck → template · `bin/pptx-set-image.cjs` · `bin/pptx-theme.cjs` palette from a deck ·
|
|
224
|
+
`bin/pptx-embed-fonts.cjs` · `bin/docx-annotate.cjs comment|suggest|accept|redline-check` ·
|
|
225
|
+
`bin/xlsx-recalc.cjs` recompute formulas.
|
|
226
|
+
- Validate: `bin/doc-validate.cjs <file.docx|pptx|xlsx|pdf> [--strict]` — for anything a generator did not already check.
|
|
227
|
+
- PDF: `bin/pdf-form.cjs list|fill|overlay` · `bin/pdf-ops.cjs merge|split|rotate|watermark|stamp|encrypt|decrypt`.
|
|
240
228
|
|
|
241
229
|
All scripts are Node and print a machine-readable result plus a human note. On a
|
|
242
230
|
missing dependency or unreadable file they exit non-zero with a clear message —
|
|
@@ -686,6 +686,52 @@ function applyMotion(html, layoutId, preset) {
|
|
|
686
686
|
}
|
|
687
687
|
return out;
|
|
688
688
|
}
|
|
689
|
+
var STAGE_SCENARIOS = [
|
|
690
|
+
"pitch",
|
|
691
|
+
"\u8DEF\u6F14",
|
|
692
|
+
"\u53D1\u5E03\u4F1A",
|
|
693
|
+
"launch",
|
|
694
|
+
"keynote",
|
|
695
|
+
"\u4E3B\u9898\u6F14\u8BB2",
|
|
696
|
+
"\u5927\u4F1A",
|
|
697
|
+
"conference",
|
|
698
|
+
"\u8BB2\u5EA7",
|
|
699
|
+
"lecture",
|
|
700
|
+
"talk",
|
|
701
|
+
"\u9500\u552E",
|
|
702
|
+
"sales"
|
|
703
|
+
];
|
|
704
|
+
var READ_SCENARIOS = [
|
|
705
|
+
"\u5185\u5BA1",
|
|
706
|
+
"\u8BC4\u5BA1",
|
|
707
|
+
"review",
|
|
708
|
+
"\u62A5\u544A",
|
|
709
|
+
"\u6C47\u62A5",
|
|
710
|
+
"report",
|
|
711
|
+
"\u8BB2\u4E49",
|
|
712
|
+
"handout",
|
|
713
|
+
"\u57F9\u8BAD",
|
|
714
|
+
"training",
|
|
715
|
+
"\u8FF0\u804C",
|
|
716
|
+
"\u5468\u62A5",
|
|
717
|
+
"\u6708\u62A5"
|
|
718
|
+
];
|
|
719
|
+
function motionForDeck(spec) {
|
|
720
|
+
if (typeof spec.motion === "boolean") {
|
|
721
|
+
return { on: spec.motion, reason: `motion: ${spec.motion} in the spec` };
|
|
722
|
+
}
|
|
723
|
+
const scenario = typeof spec.scenario === "string" ? spec.scenario.trim() : "";
|
|
724
|
+
if (!scenario)
|
|
725
|
+
return { on: true, reason: "no scenario in the spec \u2014 the family preset applies" };
|
|
726
|
+
const s = scenario.toLowerCase();
|
|
727
|
+
const read = READ_SCENARIOS.find((k) => s.includes(k));
|
|
728
|
+
if (read)
|
|
729
|
+
return { on: false, reason: `scenario "${scenario}" is read, not watched \u2014 the family preset is off` };
|
|
730
|
+
const stage = STAGE_SCENARIOS.find((k) => s.includes(k));
|
|
731
|
+
if (stage)
|
|
732
|
+
return { on: true, reason: `scenario "${scenario}" is presented \u2014 the family preset applies` };
|
|
733
|
+
return { on: true, reason: `scenario "${scenario}" is not one motion knows \u2014 the family preset applies; set motion:false to drop it` };
|
|
734
|
+
}
|
|
689
735
|
|
|
690
736
|
// apps/admin/data/skills.lib/document/bin-src/deck-build.mjs
|
|
691
737
|
function die(msg, code = 1) {
|
|
@@ -711,6 +757,8 @@ async function main() {
|
|
|
711
757
|
die("mediaStyle must be a string and requires themeVersion: 2", 64);
|
|
712
758
|
}
|
|
713
759
|
if (spec?.layoutPack !== void 0 && typeof spec.layoutPack !== "string") die('layoutPack must be a pack id or "none"', 64);
|
|
760
|
+
if (spec?.scenario !== void 0 && typeof spec.scenario !== "string") die('scenario must be a string (the confirmed scenario, e.g. "\u5185\u5BA1" or "\u53D1\u5E03\u4F1A")', 64);
|
|
761
|
+
if (spec?.motion !== void 0 && typeof spec.motion !== "boolean") die("motion must be true or false", 64);
|
|
714
762
|
if (spec?.decorRhythm !== void 0 && (spec.themeVersion !== 2 || !["auto", "steady"].includes(spec.decorRhythm))) {
|
|
715
763
|
die("decorRhythm must be auto|steady and requires themeVersion: 2", 64);
|
|
716
764
|
}
|
|
@@ -816,8 +864,9 @@ async function main() {
|
|
|
816
864
|
);
|
|
817
865
|
}
|
|
818
866
|
}
|
|
867
|
+
const motion = motionForDeck(spec);
|
|
819
868
|
let motionPreset = null;
|
|
820
|
-
if (catalogEntry?.motion) {
|
|
869
|
+
if (catalogEntry?.motion && motion.on) {
|
|
821
870
|
const mp = (0, import_node_path.join)(skillDir, catalogEntry.motion);
|
|
822
871
|
if (!(0, import_node_fs.existsSync)(mp)) die(`motion preset not found: ${catalogEntry.motion}`, 66);
|
|
823
872
|
let raw;
|
|
@@ -848,6 +897,7 @@ async function main() {
|
|
|
848
897
|
out: outPath,
|
|
849
898
|
slides: Array.isArray(spec?.slides) ? spec.slides.length : 0,
|
|
850
899
|
warnings,
|
|
900
|
+
motion: catalogEntry?.motion ? motion : { on: false, reason: "the family has no motion preset" },
|
|
851
901
|
next: `html2pptx ${outPath} out.pptx${styleId ? ` --style ${styleId}` : " --style <skin>"}${spec?.themeVersion === 2 ? " --theme-v2" : ""}${spec?.mediaStyle ? ` --media-style ${spec.mediaStyle}` : ""}`
|
|
852
902
|
}, null, 1) + "\n");
|
|
853
903
|
}
|