@blackbelt-technology/pi-dashboard-deck3d 0.9.0 → 0.10.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.
Files changed (105) hide show
  1. package/.pi/skills/deck3d/SKILL.agent.md +78 -0
  2. package/.pi/skills/deck3d/SKILL.md +68 -0
  3. package/.pi/skills/deck3d/reference/effects.md +185 -2
  4. package/.pi/skills/deck3d/reference/ir-fields.md +26 -3
  5. package/.pi/skills/deck3d-from-pptx/SKILL.md +134 -0
  6. package/.pi/skills/deck3d-from-pptx/reference/steps.md +72 -0
  7. package/README.md +30 -2
  8. package/assets/preview/stub-chrome.png +0 -0
  9. package/assets/preview/stub-icon.json +59 -0
  10. package/assets/preview/stub-layout.json +195 -0
  11. package/assets/preview/stub-outline.json +48 -0
  12. package/dist/cli.js +11780 -5934
  13. package/dist/runtime.js +5916 -4007
  14. package/fixtures/business-2031/assets/stub-chrome.png +0 -0
  15. package/fixtures/business-2031/assets/stub-icon.json +59 -0
  16. package/fixtures/business-2031/assets/stub-layout.json +195 -0
  17. package/fixtures/business-2031/assets/stub-outline.json +48 -0
  18. package/fixtures/business-2031/build-overrides.mjs +58 -13
  19. package/fixtures/business-2031/deck.agent.md +60 -0
  20. package/fixtures/business-2031/deck.json +133 -8
  21. package/fixtures/business-2031/overrides.json +133 -8
  22. package/package.json +8 -4
  23. package/scripts/gen-stub-assets.ts +31 -0
  24. package/src/art/cutout.ts +97 -0
  25. package/src/art/decode.ts +169 -0
  26. package/src/art/icon.ts +380 -0
  27. package/src/art/png.ts +232 -0
  28. package/src/art/trace.ts +288 -0
  29. package/src/check/rules.ts +13 -8
  30. package/src/cli.ts +313 -51
  31. package/src/compare/index.ts +131 -0
  32. package/src/compare/ssim.ts +91 -0
  33. package/src/fx/art-geometry.ts +137 -0
  34. package/src/fx/art3d.meta.json +30 -0
  35. package/src/fx/art3d.ts +131 -0
  36. package/src/fx/bank.meta.json +26 -0
  37. package/src/fx/bank.ts +8 -0
  38. package/src/fx/compose.ts +5 -4
  39. package/src/fx/crane.meta.json +26 -0
  40. package/src/fx/crane.ts +8 -0
  41. package/src/fx/dolly.ts +5 -1
  42. package/src/fx/fade.ts +5 -1
  43. package/src/fx/flythrough.ts +5 -1
  44. package/src/fx/frame-chrome.meta.json +17 -0
  45. package/src/fx/frame-chrome.ts +134 -0
  46. package/src/fx/haze.meta.json +19 -0
  47. package/src/fx/haze.ts +91 -0
  48. package/src/fx/icon3d.meta.json +21 -0
  49. package/src/fx/icon3d.ts +167 -0
  50. package/src/fx/index.ts +96 -66
  51. package/src/fx/iris.ts +5 -1
  52. package/src/fx/meta.schema.json +10 -2
  53. package/src/fx/path.meta.json +25 -0
  54. package/src/fx/path.ts +8 -0
  55. package/src/fx/persistent.ts +11 -0
  56. package/src/fx/revolve.meta.json +26 -0
  57. package/src/fx/revolve.ts +8 -0
  58. package/src/fx/slide-layer.meta.json +26 -0
  59. package/src/fx/slide-layer.ts +557 -0
  60. package/src/fx/slide-space.ts +142 -0
  61. package/src/fx/stub-assets.ts +117 -0
  62. package/src/fx/swing.meta.json +26 -0
  63. package/src/fx/swing.ts +8 -0
  64. package/src/fx/types.ts +63 -2
  65. package/src/ir/merge.ts +5 -2
  66. package/src/ir/schema.json +140 -3
  67. package/src/ir/types.ts +54 -0
  68. package/src/ir/validate.ts +91 -3
  69. package/src/parse/harvest/index.ts +4 -1
  70. package/src/parse/markdown.ts +38 -7
  71. package/src/pptx/baseline.ts +183 -0
  72. package/src/pptx/extract.ts +161 -0
  73. package/src/pptx/fallback.ts +70 -0
  74. package/src/pptx/import.ts +256 -0
  75. package/src/pptx/master.ts +135 -0
  76. package/src/pptx/media.ts +81 -0
  77. package/src/pptx/package.ts +109 -0
  78. package/src/pptx/ref.ts +100 -0
  79. package/src/pptx/shapes.ts +276 -0
  80. package/src/pptx/stage.ts +82 -0
  81. package/src/pptx/text.ts +202 -0
  82. package/src/pptx/theme.ts +194 -0
  83. package/src/pptx/types.ts +159 -0
  84. package/src/pptx/xfrm.ts +93 -0
  85. package/src/pptx/xml.ts +106 -0
  86. package/src/pptx/zip.ts +239 -0
  87. package/src/render/assets.ts +57 -0
  88. package/src/render/build.ts +75 -0
  89. package/src/render/index.ts +7 -2
  90. package/src/render/template.html +1 -1
  91. package/src/runtime/assets.ts +75 -0
  92. package/src/runtime/fade.ts +110 -0
  93. package/src/runtime/hud.ts +37 -9
  94. package/src/runtime/index.ts +431 -67
  95. package/src/runtime/post.ts +11 -5
  96. package/src/runtime/scene.ts +25 -2
  97. package/src/runtime/transition.ts +222 -0
  98. package/src/runtime/types.ts +13 -2
  99. package/src/serve/index.ts +199 -16
  100. package/src/util/cleanup.ts +13 -0
  101. package/src/util/confine.ts +15 -0
  102. package/src/variants/pick.ts +282 -0
  103. package/src/variants/render.ts +179 -0
  104. package/src/variants/schema.json +48 -0
  105. package/src/variants/style.ts +318 -0
@@ -0,0 +1,72 @@
1
+ # deck3d-from-pptx — step reference
2
+
3
+ How to author each step's variants. Read `pptx/layout.json` for item ids/rects and
4
+ `deck.md` for slide text first. Every fragment lives under `variants[].overrides` in
5
+ `style.json` and **carries forward earlier steps' effects** on the same scope (arrays
6
+ replace). Built-in parameters below; full ranges in [`../../deck3d/reference/effects.md`](../../deck3d/reference/effects.md).
7
+
8
+ ## Built-ins used by the steps
9
+
10
+ | effect | kind | scope | main params |
11
+ |---|---|---|---|
12
+ | `slide-layer` | layer (replaces native content) | slide | `layout` (asset id, `pptx-layout`), `slide` (`sNN`), `mode` `screen`·`panel`·`free`, `depths` `{body,icon,title,image}`, `panel` `{material,tilt}`, `halo` 0–1, `skip[]`, `retext{}`, `widen{}` |
13
+ | `frame-chrome` | layer, **persistent** | **deck only** | `layers[]` `{asset,anchor tl/tr/bl/br,size,fly,delay,speed,ease}`, `suppress[]` slide ids, `opacity`, `scale` |
14
+ | `art3d` | layer | slide | `outline` (asset), `item`, `depth`, `bevel`, `scale`, `x y z`, `sway`, `sweep`, `gradient[]` |
15
+ | `icon3d` | layer | slide | `asset` (icon polylines or outline), `item`, `card`, `color`, `rim`, `depth` |
16
+ | `haze` | background | slide | `layers`, `near`, `far`, `density`, `drift`, `floor`, `color` |
17
+
18
+ `slide-layer` places every item within 2 px of the original at rest (modes `screen`/`free`,
19
+ and `panel` with `tilt: 0`); text is measured by `check`. List an item in
20
+ `slide-layer.skip` when `icon3d`/`art3d` draws it instead.
21
+
22
+ ## 1 · `fidelity`
23
+ Inputs: baseline build, `compare` scores. Variants — **A** exact 2D layer
24
+ (`slide-layer`, `mode: screen`), **B** 3D panel (`mode: panel`, small `tilt`), **C**
25
+ native (no `slide-layer`; the deck3d title/card/diagram). Samples: a text-heavy slide, an
26
+ image slide, a diagram/fallback slide. Native → skip 2, 3, 5.
27
+
28
+ ## 2 · `placement` *(skipped for native)*
29
+ **A** glass panel (`mode: panel`, `panel.material: glass`), **B** free-floating text
30
+ (`mode: free`, `halo` for legibility), **C** frame in space (`free` + larger
31
+ `depths` spread for parallax). Samples: one title, one dense, one image slide.
32
+
33
+ ## 3 · `frame` *(skipped for native)*
34
+ Cut master corner art with `deck3d art cutout <bg> --bg #hex --split`, pin the pieces as
35
+ assets, then one `frame-chrome` at **deck scope** (`overrides.effects`). Variants differ in
36
+ `fly` direction, `delay`/`speed`/`ease` and `suppress` (e.g. hide on title/closing).
37
+ Samples: two consecutive slides + a suppressed one; verify with `compare --transition`.
38
+
39
+ ## 4 · `brand-art`
40
+ `deck3d art trace logo.png --palette #dark,#accent` → outline asset → `art3d`. **A**
41
+ extruded flat, **B** bevel + `sweep` highlight, **C** `sway`. Native: place beside the
42
+ native title (`x/y/z`), not over it. Samples: title slide + one content slide.
43
+
44
+ ## 5 · `icons` *(skipped for native)*
45
+ `deck3d art icon pictogram.svg` → polylines asset → `icon3d` on the item
46
+ (`slide-layer.skip` it). **A** tubes, **B** tubes on a glass `card`, **C** extruded outline.
47
+ Samples: slides with the most icons.
48
+
49
+ ## 6 · `hero`
50
+ Scaffold local effects (`fx scaffold`) that rebuild hero pictures as 3D scenes from the
51
+ slide text/picture. Variants: literal scene · metaphor · minimal motif. Native → slide
52
+ background. Preview each before offering. Samples: the hero slides.
53
+
54
+ ## 7 · `worlds`
55
+ One background world per slide from its text (local effect or corpus card), plus `haze`
56
+ so a bold world recedes behind content. Give **every** slide a non-default background.
57
+ Variants: literal · atmospheric · minimal. Lift floor objects above the floor.
58
+
59
+ ## 8 · `media`
60
+ Replace image items by video: `video-screen` effect (or a local effect) on the slide;
61
+ `slide-layer.skip` the still. Render the final deck with `--embed-video`.
62
+
63
+ ## 9 · `transitions`
64
+ Per-slide `transition` and `cameraPath` variety (`deck3d fx list --kind transition`).
65
+ Variants: calm (dolly) · cinematic (swing/crane) · mixed cycle (`transitionCycle`).
66
+ Verify with `compare --transition`.
67
+
68
+ ## The question shape
69
+
70
+ `ask_user` single choice: title = the step question; options = `<name> — <label>` for each
71
+ variant; free text allowed; message = the `contact.png` path (opened on the canvas) and the
72
+ serve link `http://127.0.0.1:<port>/?variant=<step>:<name>`.
package/README.md CHANGED
@@ -39,6 +39,10 @@ deck3d props search <query> [--role ambient] # candidate models
39
39
  deck3d props fetch <source> <id> # cache + hash-pin, prints override entry
40
40
  deck3d props generate --prompt <text> --name <n> # text → image → GLB
41
41
  deck3d overrides apply <deck.json> <file> # merge an overrides-grammar file
42
+ deck3d pptx import <file.pptx> [-o dir] [--ref dir] [--force] # pptx → layout.json + media + baseline deck
43
+ deck3d art trace <img> [--palette #a,#b] | icon <svg> | cutout <img> --bg #hex [--split]
44
+ deck3d variants render --step <id> | pick <step> <name> | note <step> --note t | replay
45
+ deck3d compare <deck.html> [--ref dir] [--strict] [--transition] # SSIM vs reference renders
42
46
  ```
43
47
 
44
48
  Exit codes: `0` ok, `1` failure (one-line stderr reason), `2` usage.
@@ -63,6 +67,29 @@ Default check viewports: `1920x1080,1280x720`. Default `check` timeout 120 s/vie
63
67
  - Write endpoints IR-validate payload before write. Invalid payload returns 400 and leaves target file untouched. Write targets confined to deck directory (path traversal refused). 1 MB body cap.
64
68
  - `--check` runs fit check out of band after rebuild; findings stream over SSE as `findings` event; reload never waits for check.
65
69
 
70
+ ## From a pptx
71
+
72
+ `deck3d pptx import talk.pptx -o talk` turns an existing deck into
73
+ `talk/pptx/layout.json` (1920-unit slide space, items `sNN-iMMM`), content-hashed
74
+ media, a baseline `deck.md`/`deck.json`, and optional reference renders (`--ref`
75
+ user exports, else LibreOffice + `pdftoppm`). TypeScript only; unsupported
76
+ constructs (charts, SmartArt, tables, EMF/WMF, WordArt, gradients) become visible
77
+ fallbacks with a warning each. `--force` re-imports and keeps your overrides.
78
+
79
+ - **`overrides.assets[]`** `{ id, path, sha256, mime }` pins files into the one
80
+ offline `deck.html` (25 MB warn / 200 MB error); effects read them via
81
+ `ctx.assets.get(id)`.
82
+ - **Built-ins**: `slide-layer` (the imported layout as depth layers, ≤ 2 px from
83
+ the original at rest), `frame-chrome` (persistent master art that flies out and
84
+ in), `art3d`, `icon3d`, `haze`. `deck3d fx preview <id>` renders each against a
85
+ packaged stub bundle.
86
+ - **Variant loop**: `style.json` records each creative decision; `variants render`
87
+ makes a contact sheet, `serve` previews `?variant=<step>:<name>` (`V` cycles),
88
+ `variants pick` merges one (validated, never drops another writer's effects),
89
+ `variants replay` re-applies the picks after a re-import, `compare` scores each
90
+ slide against its reference render.
91
+ - The guided procedure is the `deck3d-from-pptx` skill.
92
+
66
93
  ## Markdown grammar
67
94
 
68
95
  - `---` front-matter: deck defaults.
@@ -71,7 +98,8 @@ Default check viewports: `1920x1080,1280x720`. Default `check` timeout 120 s/vie
71
98
  - `- bullet` = body bullets.
72
99
  - ```mermaid `flowchart` / `sequenceDiagram` = slide diagram (harvested headless).
73
100
  Other diagram types: warn + `diagram: none`.
74
- - `<!-- deck3d: {...} -->` inline overrides win over `deck.json`.
101
+ - `<!-- deck3d: {...} -->` inline overrides win over `deck.json`. May span
102
+ lines or be a bullet (`- <!-- … -->`); never read as subtitle or bullet.
75
103
  - Pin an id: `# Final {#outro}`.
76
104
 
77
105
  ## IR + overrides
@@ -79,7 +107,7 @@ Default check viewports: `1920x1080,1280x720`. Default `check` timeout 120 s/vie
79
107
  `deck.json` = `{ meta, defaults, slides[], overrides }`.
80
108
 
81
109
  - `slides[]` and below are DERIVED (regenerated every parse).
82
- - Write only `overrides`: `deck`, `slides`, `nodes`, `edges`, `effects`, `props`.
110
+ - Write only `overrides`: `deck`, `slides`, `nodes`, `edges`, `effects`, `props`, `assets`.
83
111
  - Objects deep-merge. Arrays replace. `diagram.data` replaces as a whole object.
84
112
  - Suggest keys spell the overrides grammar: `overrides.slides["arch"].diagram.scale`.
85
113
  - The deck's `⚙` configurator (`C` key) exports an `overrides.json` in this
Binary file
@@ -0,0 +1,59 @@
1
+ {
2
+ "version": 1,
3
+ "viewBox": [
4
+ 0,
5
+ 0,
6
+ 24,
7
+ 24
8
+ ],
9
+ "polylines": [
10
+ {
11
+ "points": [
12
+ [
13
+ 12,
14
+ 3
15
+ ],
16
+ [
17
+ 19,
18
+ 7
19
+ ],
20
+ [
21
+ 19,
22
+ 17
23
+ ],
24
+ [
25
+ 12,
26
+ 21
27
+ ],
28
+ [
29
+ 5,
30
+ 17
31
+ ],
32
+ [
33
+ 5,
34
+ 7
35
+ ]
36
+ ],
37
+ "width": 2,
38
+ "closed": true
39
+ },
40
+ {
41
+ "points": [
42
+ [
43
+ 8.5,
44
+ 12.5
45
+ ],
46
+ [
47
+ 11,
48
+ 15
49
+ ],
50
+ [
51
+ 16,
52
+ 9
53
+ ]
54
+ ],
55
+ "width": 2,
56
+ "closed": false
57
+ }
58
+ ]
59
+ }
@@ -0,0 +1,195 @@
1
+ {
2
+ "version": 1,
3
+ "size": {
4
+ "w": 1920,
5
+ "h": 1080
6
+ },
7
+ "theme": {
8
+ "colors": {
9
+ "dk1": "#161e23",
10
+ "lt1": "#ffffff",
11
+ "accent1": "#f67519",
12
+ "accent2": "#4472c4"
13
+ },
14
+ "fonts": {
15
+ "major": "Poppins",
16
+ "minor": "Poppins"
17
+ }
18
+ },
19
+ "slides": [
20
+ {
21
+ "id": "s01",
22
+ "index": 1,
23
+ "title": "Stub slide",
24
+ "fingerprint": "stub",
25
+ "background": {
26
+ "color": "#ffffff"
27
+ },
28
+ "items": [
29
+ {
30
+ "id": "s01-i001",
31
+ "kind": "text",
32
+ "rect": {
33
+ "x": 120,
34
+ "y": 80,
35
+ "w": 1100,
36
+ "h": 160
37
+ },
38
+ "rotation": 0,
39
+ "flipH": false,
40
+ "flipV": false,
41
+ "placeholder": "title",
42
+ "anchor": "t",
43
+ "insets": {
44
+ "l": 14.4,
45
+ "t": 7.2,
46
+ "r": 14.4,
47
+ "b": 7.2
48
+ },
49
+ "vertical": false,
50
+ "autofit": "none",
51
+ "paragraphs": [
52
+ {
53
+ "align": "l",
54
+ "lineSpacing": 1,
55
+ "spaceBefore": 0,
56
+ "spaceAfter": 12,
57
+ "level": 0,
58
+ "runs": [
59
+ {
60
+ "text": "Stub slide",
61
+ "size": 88,
62
+ "bold": true,
63
+ "italic": false,
64
+ "underline": false,
65
+ "color": "#161e23",
66
+ "font": "Poppins"
67
+ }
68
+ ]
69
+ }
70
+ ]
71
+ },
72
+ {
73
+ "id": "s01-i002",
74
+ "kind": "text",
75
+ "rect": {
76
+ "x": 120,
77
+ "y": 300,
78
+ "w": 900,
79
+ "h": 360
80
+ },
81
+ "rotation": 0,
82
+ "flipH": false,
83
+ "flipV": false,
84
+ "anchor": "t",
85
+ "insets": {
86
+ "l": 14.4,
87
+ "t": 7.2,
88
+ "r": 14.4,
89
+ "b": 7.2
90
+ },
91
+ "vertical": false,
92
+ "autofit": "none",
93
+ "paragraphs": [
94
+ {
95
+ "align": "l",
96
+ "lineSpacing": 1,
97
+ "spaceBefore": 0,
98
+ "spaceAfter": 12,
99
+ "level": 0,
100
+ "bullet": "•",
101
+ "runs": [
102
+ {
103
+ "text": "First point",
104
+ "size": 48,
105
+ "bold": true,
106
+ "italic": false,
107
+ "underline": false,
108
+ "color": "#161e23",
109
+ "font": "Poppins"
110
+ }
111
+ ]
112
+ },
113
+ {
114
+ "align": "l",
115
+ "lineSpacing": 1,
116
+ "spaceBefore": 0,
117
+ "spaceAfter": 12,
118
+ "level": 0,
119
+ "bullet": "•",
120
+ "runs": [
121
+ {
122
+ "text": "Second point",
123
+ "size": 48,
124
+ "bold": true,
125
+ "italic": false,
126
+ "underline": false,
127
+ "color": "#161e23",
128
+ "font": "Poppins"
129
+ }
130
+ ]
131
+ }
132
+ ]
133
+ },
134
+ {
135
+ "id": "s01-i003",
136
+ "kind": "rect",
137
+ "rect": {
138
+ "x": 120,
139
+ "y": 760,
140
+ "w": 600,
141
+ "h": 70
142
+ },
143
+ "rotation": 0,
144
+ "flipH": false,
145
+ "flipV": false,
146
+ "preset": "roundRect",
147
+ "fill": "#f67519",
148
+ "alpha": 1
149
+ },
150
+ {
151
+ "id": "s01-i004",
152
+ "kind": "img",
153
+ "rect": {
154
+ "x": 1300,
155
+ "y": 300,
156
+ "w": 400,
157
+ "h": 400
158
+ },
159
+ "rotation": 0,
160
+ "flipH": false,
161
+ "flipV": false,
162
+ "media": "stub-chrome.png",
163
+ "asset": "stub-chrome",
164
+ "crop": {
165
+ "l": 0,
166
+ "t": 0,
167
+ "r": 0,
168
+ "b": 0
169
+ }
170
+ },
171
+ {
172
+ "id": "s01-i005",
173
+ "kind": "img",
174
+ "rect": {
175
+ "x": 1480,
176
+ "y": 100,
177
+ "w": 140,
178
+ "h": 140
179
+ },
180
+ "rotation": 0,
181
+ "flipH": false,
182
+ "flipV": false,
183
+ "media": "stub-chrome.png",
184
+ "asset": "stub-chrome",
185
+ "crop": {
186
+ "l": 0,
187
+ "t": 0,
188
+ "r": 0,
189
+ "b": 0
190
+ }
191
+ }
192
+ ]
193
+ }
194
+ ]
195
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "version": 1,
3
+ "width": 100,
4
+ "height": 100,
5
+ "polygons": [
6
+ {
7
+ "color": "#f67519",
8
+ "outer": [
9
+ [
10
+ 0,
11
+ 0
12
+ ],
13
+ [
14
+ 100,
15
+ 0
16
+ ],
17
+ [
18
+ 100,
19
+ 100
20
+ ],
21
+ [
22
+ 0,
23
+ 100
24
+ ]
25
+ ],
26
+ "holes": [
27
+ [
28
+ [
29
+ 30,
30
+ 30
31
+ ],
32
+ [
33
+ 30,
34
+ 70
35
+ ],
36
+ [
37
+ 70,
38
+ 70
39
+ ],
40
+ [
41
+ 70,
42
+ 30
43
+ ]
44
+ ]
45
+ ]
46
+ }
47
+ ]
48
+ }