@dickpy/dsh-oil-slide 0.0.0-stage → 0.2.7
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/LICENSE +21 -0
- package/README.md +89 -2
- package/bundled-assets/brand/empty-deck-cobalt.webp +0 -0
- package/bundled-assets/brand/oil-slide-mark-512.png +0 -0
- package/bundled-assets/skill/LICENSE +21 -0
- package/bundled-assets/skill/README.md +61 -0
- package/bundled-assets/skill/SKILL.md +185 -0
- package/bundled-assets/skill/references/art-directions.md +99 -0
- package/bundled-assets/skill/references/brand-and-canvas.md +72 -0
- package/bundled-assets/skill/references/design-baseline.txt +1 -0
- package/bundled-assets/skill/references/prompt-compiler.md +99 -0
- package/bundled-assets/skill/references/restore-and-pptx.md +178 -0
- package/bundled-assets/skill/references/staged-pptx.md +71 -0
- package/bundled-assets/skill/scripts/_runtime_utils.py +351 -0
- package/bundled-assets/skill/scripts/asset_sheet.py +528 -0
- package/bundled-assets/skill/scripts/brand_ref.py +776 -0
- package/bundled-assets/skill/scripts/crop_asset.py +1709 -0
- package/bundled-assets/skill/scripts/deck_shell.py +2322 -0
- package/bundled-assets/skill/scripts/export_images.py +280 -0
- package/bundled-assets/skill/scripts/extract_pptx.py +360 -0
- package/bundled-assets/skill/scripts/extract_slide_dom.js +1640 -0
- package/bundled-assets/skill/scripts/html_to_pptx.py +4042 -0
- package/bundled-assets/skill/scripts/measure_slide_layout.py +952 -0
- package/bundled-assets/skill/scripts/oiloil-connect.mjs +1493 -0
- package/bundled-assets/skill/scripts/oiloil-image.mjs +492 -0
- package/bundled-assets/skill/scripts/prepare_plate.py +412 -0
- package/bundled-assets/skill/scripts/render_gradient.py +258 -0
- package/bundled-assets/skill/scripts/slide_brand.py +111 -0
- package/bundled-assets/skill/scripts/slide_incremental.py +122 -0
- package/bundled-assets/skill/scripts/slide_workflow.py +711 -0
- package/bundled-assets/skill/scripts/verify_deck.py +3483 -0
- package/bundled-assets/skill/vendor/README.md +4 -0
- package/bundled-assets/skill/vendor/codex-ppt/LICENSE +21 -0
- package/bundled-assets/skill/vendor/codex-ppt/assemble_ppt.py +435 -0
- package/bundled-assets/skill/vendor/codex-ppt/codex_ppt_runtime.py +284 -0
- package/bundled-assets/skill/vendor/codex-ppt/image_gen.py +972 -0
- package/bundled-assets/skill/vendor/codex-ppt/image_providers/__init__.py +6 -0
- package/bundled-assets/skill/vendor/codex-ppt/image_providers/atlascloud.py +222 -0
- package/bundled-assets/skill/vendor/codex-ppt/image_providers/base.py +32 -0
- package/bundled-assets/skill/vendor/codex-ppt/image_providers/factory.py +21 -0
- package/bundled-assets/skill/vendor/codex-ppt/image_providers/openai_compatible.py +238 -0
- package/bundled-assets/skill/vendor/codex-ppt/requirements.txt +5 -0
- package/bundled-assets/skill/vendor/codex-ppt/styles//345/205/232/346/224/277/347/272/242/351/243/216/346/240/274.md +98 -0
- package/bundled-assets/skill/vendor/codex-ppt/styles//345/210/233/346/204/217/346/235/202/345/277/227/351/243/216.md +72 -0
- package/bundled-assets/skill/vendor/codex-ppt/styles//345/244/215/345/217/244/346/211/201/345/271/263/346/217/222/347/224/273/351/243/216.md +72 -0
- package/bundled-assets/skill/vendor/codex-ppt/styles//346/211/213/347/273/230/346/212/200/346/234/257/350/247/243/351/207/212/351/243/216.md +86 -0
- package/bundled-assets/skill/vendor/codex-ppt/styles//346/211/213/347/273/230/347/231/275/346/235/277/351/243/216.md +72 -0
- package/bundled-assets/skill/vendor/codex-ppt/styles//346/225/231/345/255/246/350/257/276/344/273/266/351/243/216.md +107 -0
- package/bundled-assets/skill/vendor/codex-ppt/styles//346/225/260/346/215/256/344/273/252/350/241/250/347/233/230/351/243/216.md +73 -0
- package/bundled-assets/skill/vendor/codex-ppt/styles//346/270/205/347/210/275/344/270/223/344/270/232/351/243/216.md +87 -0
- package/bundled-assets/skill/vendor/codex-ppt/styles//346/270/251/346/232/226/346/211/213/345/267/245/351/243/216.md +72 -0
- package/bundled-assets/skill/vendor/codex-ppt/styles//347/224/265/345/255/220/345/242/250/346/260/264/346/235/202/345/277/227/351/243/216.md +86 -0
- package/bundled-assets/skill/vendor/codex-ppt/styles//347/247/221/347/240/224/347/255/224/350/276/251/351/243/216.md +138 -0
- package/bundled-assets/skill/vendor/codex-ppt/styles//351/272/246/350/202/257/351/224/241/351/243/216/346/240/274.md +119 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/LICENSE +21 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/SKILL.md +171 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/agents/openai.yaml +4 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/__init__.py +1 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/cli.py +25 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/__init__.py +1 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/_input_normalization.py +355 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/_page_artifacts.py +132 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/build_pptx_from_manifest.py +1029 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/configure_image_backend.py +52 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/deck_run_state.py +214 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/deck_text_hints.py +179 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/finalize_deck_run.py +96 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/formula_renderer.py +254 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/image_gen.py +206 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/main.py +795 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/make_page_contact_sheet.py +28 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/native_tables.py +140 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/paddle_text_hints.py +212 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/page_job_status.py +54 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/page_text_metrics.py +334 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/path_geometry.py +174 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/prepare_deck_run.py +209 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/process_asset_sheet.py +104 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/record_imagegen_result.py +118 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/record_page_dispatch.py +83 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/record_page_result.py +130 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/remove_chroma_key.py +441 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/reset_page_job.py +74 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/runtime_env.py +283 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/split_alpha_components.py +323 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/text_hints.py +309 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/validate_pptx.py +873 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/pyproject.toml +29 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/prompts/page-worker.md +47 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/references/cli-helper.md +282 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/references/manifest-schema.md +423 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/references/page-decision-tree.md +301 -0
- package/bundled-assets/skill/vendor/image-to-editable-ppt/scripts/build-page-worker-prompt.py +134 -0
- package/cordis.patch.yml +3 -0
- package/lib/client.js +11282 -0
- package/lib/index.js +2638 -0
- package/package.json +140 -4
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "image-to-editable-ppt-cli"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Self-contained editppt CLI for the image-to-editable-ppt skill."
|
|
5
|
+
requires-python = ">=3.10"
|
|
6
|
+
dependencies = [
|
|
7
|
+
"PyMuPDF>=1.24.0",
|
|
8
|
+
"Pillow>=10.0.0",
|
|
9
|
+
"openai>=2.0.0",
|
|
10
|
+
"PyYAML>=6.0.0",
|
|
11
|
+
"numpy>=1.26.0",
|
|
12
|
+
"requests>=2.31.0",
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
[project.scripts]
|
|
16
|
+
editppt = "editppt.cli:main"
|
|
17
|
+
|
|
18
|
+
[build-system]
|
|
19
|
+
requires = ["hatchling"]
|
|
20
|
+
build-backend = "hatchling.build"
|
|
21
|
+
|
|
22
|
+
[tool.hatch.build.targets.wheel]
|
|
23
|
+
packages = ["editppt"]
|
|
24
|
+
|
|
25
|
+
[tool.hatch.build]
|
|
26
|
+
exclude = [
|
|
27
|
+
"**/.DS_Store",
|
|
28
|
+
"**/__pycache__",
|
|
29
|
+
]
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Page Reconstructor Prompt Template
|
|
2
|
+
|
|
3
|
+
Placeholders of the form `{{NAME}}` are filled by `scripts/build-page-worker-prompt.py`.
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
Rebuild one page for image-to-editable-ppt.
|
|
7
|
+
|
|
8
|
+
Run dir: {{RUN_DIR}}
|
|
9
|
+
Page id: {{PAGE_ID}}
|
|
10
|
+
Page dir: {{PAGE_DIR}}
|
|
11
|
+
Source image: {{SOURCE_IMAGE}}
|
|
12
|
+
|
|
13
|
+
You own only this Page dir. Do not edit deck_manifest.json, page_jobs.json, notes_manifest.json, final outputs, the original input, or any other page directory.
|
|
14
|
+
|
|
15
|
+
Read references by task, before acting on their rules. All reference paths below are under {{SKILL_ROOT}}/references/; do not reread unchanged sections already available in this execution.
|
|
16
|
+
- Start with page_request.json and page-decision-tree.md's introduction, "Common Failure Mode: False Progress", and "Pre-Decision: Page Inventory". Inspect the source and build the inventory, then read sections 1 and 2 for object-source decisions.
|
|
17
|
+
- Before native reconstruction, read section 3.1 for text; read sections 3.2-3.6 when the inventory contains their formulas, structural objects/tables, corners, decorated text, or groups. Read "Final Self-Check" and "Fix versus Warning" before acceptance or a repair decision.
|
|
18
|
+
- Read manifest-schema.md's page_request.json and pages/page_NNN/manifest.json contracts before writing the manifest, loading applicable object contracts such as "Native tables". Before image jobs read the image_backend and imagegen-jobs.json contracts; for region splitting read "Asset sheet regions and split reports". Before returning read the validation.json and page_result.json contracts. Deck-state and notes contracts are outside your ownership.
|
|
19
|
+
- Use cli-helper.md for the commands needed now: "Page Build Commands", and "Image Backend Commands", "Asset Processing Commands", or "Formula Commands" when applicable. Do not load unrelated install or orchestration instructions.
|
|
20
|
+
|
|
21
|
+
Hard rules (reminders; authoritative details remain in the references):
|
|
22
|
+
1. Separate foreground visuals through image editing; use the configured image API for these edits — page-decision-tree.md section 2.
|
|
23
|
+
2. Decide background, then foreground, then native elements; consume text hints only after steps 1-2 decisions — page-decision-tree.md introduction and section 3.1.
|
|
24
|
+
3. Build from manifest.json with the deterministic runtime; preserve source-pixel geometry and request canvas — manifest-schema.md's page_request.json and manifest.json contracts.
|
|
25
|
+
4. Execute the recorded image backend contract, using editppt image generate/edit for the Oil Slide custom channel; record openai-compatible-api and stop on provider failure — manifest-schema.md's image_backend contract.
|
|
26
|
+
5. Structural validation never waives object-source rules — page-decision-tree.md "Common Failure Mode: False Progress".
|
|
27
|
+
|
|
28
|
+
Recovery: read any previous validation failure before editing. Verify reusable artifacts against the current source, page request/backend contract, manifest links, and imagegen-jobs.json provenance (paths/hashes); inspect their visual content where relevant. Reuse compliant artifacts and repair only failed or dependent parts. Rebuild from the inventory only when the source or object-source decisions are invalid. Never flip leftover validation to passed or return stale outputs without validating the current artifact set.
|
|
29
|
+
|
|
30
|
+
Execution:
|
|
31
|
+
1. Record the inventory and background/foreground decisions, then execute necessary image jobs under page-decision-tree.md sections 1-2. Page-local image jobs remain serial. Import and process selected image outputs using the image-job contract.
|
|
32
|
+
2. Reconstruct native elements under the applicable section 3 rules and write manifest.json using its field contract.
|
|
33
|
+
3. Run `editppt page build {{PAGE_DIR}}`, then `editppt page contact-sheet {{PAGE_DIR}}`.
|
|
34
|
+
4. Perform the Final Self-Check against the source and run `editppt page validate {{PAGE_DIR}}`. Fix page-local issues yourself; after a change rebuild the affected outputs and verify the changed result. Once the current outputs pass, return without another unchanged build/QA cycle.
|
|
35
|
+
|
|
36
|
+
Required outputs: manifest.json, imagegen-jobs.json, page.pptx, preview.png, split_assets_contact.png, validation.json, page_result.json. Validation and page-result shapes are owned by manifest-schema.md; success requires top-level validation `passed: true` and the required outputs.
|
|
37
|
+
|
|
38
|
+
Use the configured model order for all repairs. Respect runtime-required approvals; the parent owns the OCR confirmation exception. Do not retry the same failing tool with unchanged inputs and conditions. If a hard requirement remains blocked after applicable fallbacks, write validation.json with `passed: false` and the concrete cause/error, plus page_result.json referencing only artifacts that exist. Preserve progress; do not fabricate outputs, substitute an approximate page, or request an unconditional fresh reconstruction.
|
|
39
|
+
|
|
40
|
+
Return only available artifact paths (omit missing artifacts on failure):
|
|
41
|
+
page_manifest=`<absolute path>`
|
|
42
|
+
page_pptx=`<absolute path>`
|
|
43
|
+
preview=`<absolute path>`
|
|
44
|
+
contact_sheet=`<absolute path>`
|
|
45
|
+
validation=`<absolute path>`
|
|
46
|
+
page_result=`<absolute path>`
|
|
47
|
+
```
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
# CLI Helper
|
|
2
|
+
|
|
3
|
+
This is the `editppt` command manual: install check, command tree, and syntax examples. Workflow policy lives in `SKILL.md`; object decisions and text-hints usage live in `references/page-decision-tree.md`; file and field contracts live in `references/manifest-schema.md`.
|
|
4
|
+
|
|
5
|
+
Usage principles:
|
|
6
|
+
|
|
7
|
+
- If a deterministic action can be completed with `editppt`, call the CLI directly instead of rewriting it as a temporary Python script.
|
|
8
|
+
- When full CLI parameters are needed, read `editppt <command> --help` or `editppt image <command> --help` first.
|
|
9
|
+
- In network-restricted agents, `editppt prepare`/`editppt run hints` with a PaddleOCR token and CLI fallback `editppt image generate/edit` calls need network approval. The approval and user-interaction policy lives in `SKILL.md` Entry Contract and Phase 1.
|
|
10
|
+
|
|
11
|
+
## Command Tree
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
editppt - top-level CLI for setup, run orchestration, image assets, and formulas
|
|
15
|
+
|-- setup - create or verify the user-level runtime home and config files
|
|
16
|
+
|-- doctor - check local runtime health, dependencies, and backend availability
|
|
17
|
+
|-- config - write user-level OpenAI-compatible image API fallback settings
|
|
18
|
+
|-- prepare - normalize image/PDF/PPTX inputs into a run directory and page jobs
|
|
19
|
+
|-- run - advance run state and coordinate page workers
|
|
20
|
+
| |-- next - read current run state and return the next required action
|
|
21
|
+
| |-- status - inspect run/page state for debugging or manual checks
|
|
22
|
+
| |-- backend - override or inspect the run-level image backend contract
|
|
23
|
+
| |-- dispatch - record that a page worker was spawned or a local rebuild was claimed
|
|
24
|
+
| |-- record - validate required page outputs and record page result hashes
|
|
25
|
+
| |-- reset - return a failed or stuck page to pending for re-dispatch
|
|
26
|
+
| |-- hints - regenerate per-page text hints for a prepared run
|
|
27
|
+
| `-- finalize - rebuild the final PPTX from recorded page manifests and validate it
|
|
28
|
+
|-- page - page-local helpers
|
|
29
|
+
| |-- hints - detect and measure text lines for one page directory
|
|
30
|
+
| |-- build - build page.pptx and preview.png from manifest.json
|
|
31
|
+
| |-- contact-sheet - create the origin-versus-preview comparison image
|
|
32
|
+
| `-- validate - validate page.pptx against manifest.json as run record will
|
|
33
|
+
|-- image - generate, edit, import, and process bitmap assets
|
|
34
|
+
| |-- generate - create a new image from a text prompt
|
|
35
|
+
| |-- edit - edit a source image for clean bases or source-faithful asset sheets
|
|
36
|
+
| |-- import - copy a selected image into the page dir and record provenance
|
|
37
|
+
| `-- process-sheet - split a transparent or chroma-key asset sheet into assets
|
|
38
|
+
`-- formula - render formula assets from agent-transcribed LaTeX
|
|
39
|
+
`-- render-latex - render LaTeX into SVG/PNG/PDF plus a manifest fragment
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Common Help Entrypoints
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
editppt --help
|
|
46
|
+
editppt run --help
|
|
47
|
+
editppt page hints --help
|
|
48
|
+
editppt image --help
|
|
49
|
+
editppt image edit --help
|
|
50
|
+
editppt formula render-latex --help
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Use Oil Slide → 生图设置 to select the image API root, model alias and optional key. The configured default and ordered backups apply to every generation and edit. To test configuration without generating an image, use `editppt doctor --check-api`.
|
|
54
|
+
|
|
55
|
+
Pass `--prompt` or `--prompt-file` and an explicit `--out`. For edits, pass every input via `--image` and an optional `--mask`. Size and quality must be supported by the provider.
|
|
56
|
+
|
|
57
|
+
## Skill Script Commands
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
python3 <skill-root>/scripts/build-page-worker-prompt.py <run> --page page_001 --out <absolute-run-dir>/pages/page_001/worker-prompt.md
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Purpose: generate a page-worker prompt from the skill-local `prompts/page-worker.md` template. This is a skill script, not an `editppt` CLI command, because it reads skill documentation and references.
|
|
64
|
+
|
|
65
|
+
The script writes the prompt file and prints JSON with `prompt_file`, `page_id`, and `dispatch_command_template`. It does not create a page worker or claim local execution and must run before `editppt run dispatch`.
|
|
66
|
+
|
|
67
|
+
## Pre-Run Check
|
|
68
|
+
|
|
69
|
+
The `editppt` CLI is a required runtime surface for this skill. First confirm that the CLI is available:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
editppt --help
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
If the shell returns command not found, or if the skill was just updated, install the skill-local CLI in editable mode:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
pipx install --force --editable <skill-root>/cli
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
If `pipx` itself is unavailable, fall back to one of:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
uv tool install --force --editable <skill-root>/cli
|
|
85
|
+
python3 -m pip install --user -e <skill-root>/cli
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`<skill-root>` is the `image-to-editable-ppt` directory that contains `SKILL.md`. On Windows, use the same directory's `cli` subdirectory path.
|
|
89
|
+
|
|
90
|
+
After the CLI is available, run local runtime checks:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
editppt setup
|
|
94
|
+
editppt doctor
|
|
95
|
+
editppt config --api-key "<key>" --base-url "<openai-compatible-base-url>" --model "<image-model>"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Write `editppt config` only when API fallback is needed or when the user explicitly provides a third-party image API. Do not write API keys into the project directory, run directory, prompts, or manifests.
|
|
99
|
+
|
|
100
|
+
Optional but recommended on first use: configure a PaddleOCR-VL token. The offline detector only measures text geometry (where and how large); with a token the hints also carry recognized text content and cleaner block boundaries. Store it next to the other credentials:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
editppt config --paddle-ocr-token "<token>"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
`editppt doctor` reports the current text-hints backend; without a token everything still works through the built-in offline detector. When and how to ask the user about the token — including the application URL and the regenerate step — is defined in `SKILL.md` Phase 1.
|
|
107
|
+
|
|
108
|
+
## Run Commands
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
editppt prepare input.png
|
|
112
|
+
editppt prepare input.pdf
|
|
113
|
+
editppt prepare input.png --image-backend openai-compatible-api
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Purpose: normalize a single image, multiple images, a PDF, or an image-based PPTX into a run directory and generate `deck_manifest.json`, `page_jobs.json`, `notes_manifest.json`, plus per-page `pages/page_NNN/source.png`, `page_request.json`, and text hints. `--image-backend` records the requested run/page contract; selection policy lives in `SKILL.md` subsection "Image Backend Selection".
|
|
117
|
+
|
|
118
|
+
When a PaddleOCR token is configured, `prepare` may submit the input pages to PaddleOCR for content-aware text hints. In a sandboxed or approval-gated environment, request network approval up front for this command instead of accepting a DNS/sandbox failure followed by lower-quality `builtin-ink` fallback; see `SKILL.md` Phase 1 for the approval-rejection policy.
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
editppt run next <run> --json
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Purpose: read current run state and return the next stage. `stage=rebuild_page_locally` appears for single-page and `prepare --serial-local` runs; the parent agent must build the page prompt, claim local execution with `run dispatch --local`, and rebuild the page itself using that prompt. `stage=dispatch_pages` lists `suggested_pages` that must each be dispatched to a page worker. `stage=wait` means wait for dispatched pages to complete; slow dispatched workers remain active and must not be reset or replaced because they occupy a slot. `stage=finalize` means proceed to final assembly. `stage=configure_backend` appears only when `deck_manifest.json.image_backend` is missing; follow the returned `next_command`.
|
|
125
|
+
|
|
126
|
+
Generate the page-worker prompt with the skill script before spawning a worker:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
python3 <skill-root>/scripts/build-page-worker-prompt.py <run> --page page_001 --out <absolute-run-dir>/pages/page_001/worker-prompt.md
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
editppt run dispatch <run> --page page_001 --agent-id <worker-id> --prompt-file <absolute-run-dir>/pages/page_001/worker-prompt.md
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
For a local rebuild, use:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
editppt run dispatch <run> --page page_001 --agent-id main --prompt-file <absolute-run-dir>/pages/page_001/worker-prompt.md --local
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Purpose: record that a page has been dispatched to a worker or claimed for local reconstruction. For worker dispatch, first create the worker with the current environment's available subagent/multi-agent tool, then run this command. For local reconstruction, `--local` is allowed for single-page and serial-local runs. `--prompt-file` uses the same absolute path as the prompt-builder `--out`. `--agent-id` is any stable identifier for the execution; the same id must be reused at `run record`.
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
editppt run record <run> --page page_001 --agent-id <worker-id>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Purpose: validate the required page outputs and record their hashes; failure recovery is defined in `SKILL.md` Phase 3.
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
editppt run reset <run> --page page_001 --agent-id <worker-id> --confirm-lost
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Purpose: return a page to `pending` and clear dispatch/result records. Dispatched pages require matching `--agent-id` and `--confirm-lost`; eligibility is defined in `SKILL.md` Phase 3.
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
editppt run finalize <run>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Purpose: after all pages are recorded, rebuild, validate, and output the final PPTX. Final assembly reads each recorded `pages/page_NNN/manifest.json` in page order; `page.pptx` is a page-local deliverability artifact, not the final assembly input.
|
|
161
|
+
|
|
162
|
+
## Page Build Commands
|
|
163
|
+
|
|
164
|
+
These are the worker-side commands for turning a finished `manifest.json` into the required page artifacts. Use them instead of writing any page-local PowerPoint or imaging code.
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
editppt page build pages/page_001
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Purpose: build `page.pptx` and render `preview.png` from `manifest.json` with the deterministic runtime. Optional `--manifest/--out/--preview` override the default file names inside the page directory.
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
editppt page contact-sheet pages/page_001
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Purpose: create `split_assets_contact.png`, the origin-versus-preview comparison image, from `source.png` and `preview.png` in the page directory.
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
editppt page validate pages/page_001 --report pages/page_001/validation.json
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Purpose: validate `page.pptx` against `manifest.json` with the same manifest-contract checks `editppt run record` will run (record additionally verifies the full artifact set, hashes, and top-level `passed: true`). Run it before returning so manifest-contract failures are fixed inside the page instead of bouncing back from the parent's record step. Optional `--report <file>` writes a JSON report.
|
|
183
|
+
|
|
184
|
+
## Text Measurement Commands
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
editppt run hints <run>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Purpose: regenerate `text_hints.json`/`text_hints.png` for every page of a prepared run — for example right after configuring a PaddleOCR token, so the current run gets content-aware hints without re-running prepare.
|
|
191
|
+
|
|
192
|
+
When used with a configured PaddleOCR token, this command calls the external OCR service. If the runtime requires approval for network access, request it with the task-local conversion-data justification from `SKILL.md`; see `SKILL.md` Phase 1 for the approval-rejection policy.
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
editppt page hints pages/page_001
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Purpose: detect the text lines on one page's `source.png` and write `text_hints.json` (each line's source-pixel `box_px`, measured glyph height, and derived font sizes) plus `text_hints.png`, the source image with every detected line framed and labeled. `editppt prepare` already runs this for every page (PDF inputs are OCR'd in one batch job when a PaddleOCR token is available via the `PADDLE_OCR_TOKEN` environment variable or `~/.editppt/config.yaml`; otherwise the built-in offline detector runs). Use this command only to regenerate hints for a page. How to consume the hints is defined in `page-decision-tree.md` section 3.1.
|
|
199
|
+
|
|
200
|
+
## Image Backend Commands
|
|
201
|
+
|
|
202
|
+
Use the configured image API for the following commands.
|
|
203
|
+
|
|
204
|
+
Generate a new image:
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
editppt image generate \
|
|
208
|
+
--prompt-file prompt.txt \
|
|
209
|
+
--out pages/page_001/assets/support.png
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Create a clean base or foreground asset sheet from the source image:
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
editppt image edit \
|
|
216
|
+
--image pages/page_001/source.png \
|
|
217
|
+
--prompt-file clean-base.prompt.txt \
|
|
218
|
+
--out pages/page_001/assets/clean-base.png
|
|
219
|
+
|
|
220
|
+
editppt image edit \
|
|
221
|
+
--image pages/page_001/source.png \
|
|
222
|
+
--prompt-file asset-sheet.prompt.txt \
|
|
223
|
+
--out pages/page_001/assets/asset-sheet.png
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
When multiple fallback image outputs are required, run `editppt image generate` or `editppt image edit` calls serially. For foreground icons and small visual objects, prefer one sparse asset sheet with generous spacing; create a second sheet only when one sheet cannot fit the required objects cleanly.
|
|
227
|
+
|
|
228
|
+
These commands call the configured Images API directly. In a network-restricted runtime, request approval before the call and state that only task-local prompts plus required page images/masks/references are uploaded for the current conversion.
|
|
229
|
+
|
|
230
|
+
## Asset Processing Commands
|
|
231
|
+
|
|
232
|
+
Record a selected image output:
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
editppt image import pages/page_001 \
|
|
236
|
+
--job-id icon-sheet \
|
|
237
|
+
--source-image /tmp/generated.png \
|
|
238
|
+
--dest assets/icon-sheet.png \
|
|
239
|
+
--role asset_sheet \
|
|
240
|
+
--backend openai-compatible-api
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
`--source-image` must be an existing, readable local image. `--backend` records the actual producer and is required; `--fallback-reason` is accepted only when it is consistent with the page's backend contract. Field values and provenance rules live in `manifest-schema.md`.
|
|
244
|
+
|
|
245
|
+
Process a chroma-key asset sheet (already-transparent supplied inputs bypass chroma removal):
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
editppt image process-sheet pages/page_001 \
|
|
249
|
+
--job-id icon-sheet \
|
|
250
|
+
--asset-sheet-source assets/icon-sheet.png \
|
|
251
|
+
--regions assets/asset-regions.json \
|
|
252
|
+
--assets-dir assets/icons
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
Re-split an existing Alpha sheet after changing only object regions:
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
editppt image process-sheet pages/page_001 \
|
|
259
|
+
--job-id icon-sheet \
|
|
260
|
+
--skip-chroma \
|
|
261
|
+
--regions assets/asset-regions.json \
|
|
262
|
+
--assets-dir assets/icons
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
When `--job-id` is present, the default chroma image, alpha image, and split report are written under `assets/` with that job id in the filename. This keeps multiple asset-sheet jobs on one page isolated. Explicit `--chroma`, `--alpha`, and `--split-manifest` values still override those defaults; calls without `--job-id` retain the legacy page-level filenames.
|
|
266
|
+
|
|
267
|
+
`--regions` selects whole-object region splitting; omit it for legacy connected-component splitting. `--skip-chroma` requires genuine transparency; `--force-chroma` permits replacing the Alpha output but never re-keys a transparent source. Region and report fields are defined in `manifest-schema.md`, "Asset sheet regions and split reports".
|
|
268
|
+
|
|
269
|
+
For opaque sheets, the asset sheet key color is determined by the generation prompt; `process-sheet` samples the key color from the image edge. Key-color selection and when to regenerate a sheet with a different key color are defined in `page-decision-tree.md` section 2.2.
|
|
270
|
+
|
|
271
|
+
## Formula Commands
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
editppt formula render-latex pages/page_001 \
|
|
275
|
+
--tex "\\sum_{i \\in N} p_{ij}x_{ij} \\ge a_j u_j" \
|
|
276
|
+
--out assets/formula_001.svg \
|
|
277
|
+
--box 100,120,360,80 \
|
|
278
|
+
--id formula_001 \
|
|
279
|
+
--fragment assets/formula_001.fragment.json
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
The agent transcribes the formula from the source into LaTeX. The CLI only renders it into an image asset and manifest fragment.
|