Skip to content

armgit / bento

Public Imported from GitHub
0

Bento, the office suite that fits in a file

slides: the compact document — an agent writes a deck without the defaults (#422) (#484)

nyblnet747c58803212
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 169ea200..76a5c05a 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1353,6 +1353,13 @@ jobs:
# routes the argument. Bare {{date}} stays viewer-locale (#381).
run: node scripts/test-slides-fields.ts
+ - name: Compact document rig
+ # The agent authoring form (#422): compactDoc/expandDoc are inverses
+ # on the starter deck, expansion equals the editor's insert helpers
+ # field for field, nested arrays flatten, ids mint deterministically,
+ # the loader gates the expanded doc, the file on disk stays full.
+ run: node scripts/test-slides-compact.ts
+
- name: Layers panel rig
# editor/layerrows.ts, DOM-free: rows top-first, labels per type,
# group indent, moveInPaintOrder == the Order buttons (front/back/±1,
diff --git a/AGENTS.md b/AGENTS.md
index ab2083a6..07d3489e 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -89,6 +89,36 @@ are in `docs/DECISIONS.md` — don't reopen them.
11. **Verify before claiming done**: typecheck, build, and exercise the change
in a browser when it's user-visible. Report failures honestly.
+## Authoring a deck as an agent: the compact form
+
+The JSON in `#bento-doc` is the full document: every element carries every
+field, including a dozen defaults no author chose. Write the **compact** form
+instead — `"compact": true` at the top level, and leave out every field that
+equals what the editor would insert (rotation 0, opacity 1, the font stack,
+weight 400, centre/middle, line height 1.25, a shape's transparent stroke, a
+slide's theme background, `transition: "fade"` …). `x y w h` and the type's
+content (`html`, `shape`, `src`, `option`, `content`, `columns`/`rows`) are
+always written. Two conveniences: `elements` may nest arrays (a helper that
+returns a card as `[bg, title, body]` needs no spread), and `id` may be
+omitted — it is minted deterministically as `<slideId>-<type>-<index>`, so a
+re-run yields the same ids.
+
+```json
+{ "compact": true, "title": "Q3 review",
+ "slides": [ { "id": "s1", "elements": [
+ { "type": "text", "x": 96, "y": 80, "w": 1088, "h": 100, "html": "Q3 review", "fontSize": 48 },
+ [ { "type": "shape", "shape": "rect", "x": 96, "y": 220, "w": 500, "h": 300, "fill": "#F3F0EA" },
+ { "type": "text", "x": 120, "y": 240, "w": 452, "h": 60, "html": "Revenue" } ] ] } ] }
+```
+
+Load it with `window.bento.loadDoc(json)` or *Save ▾ Replace from JSON…*;
+`window.bento.compact()` (or *Save ▾ Copy compact JSON*) gives a deck back in
+this shape. A compact document passes the untrusted shape gate on the way in
+(unknown keys are dropped). The FILE is always saved full — the on-disk
+format is unchanged and every shipped shell reads it as before.
+`slides/src/compact.ts` is the whole mechanism; `scripts/test-slides-compact.ts`
+proves the round-trip on the starter deck and the gallery decks.
+
## Commands
```sh
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bb423702..3a4af889 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,20 @@ pre-1.0.
## [Unreleased]
+- **A deck can be written the short way.** An AI agent writing a deck used
+ to spend most of its output on fields nobody chose — rotation 0, opacity 1,
+ the font stack, weight 400, centre, middle, line height 1.25, on every
+ element. A document marked `"compact": true` may leave all of that out and
+ gets it back on load, filled from the same defaults the editor uses when
+ you insert an element; `elements` may nest arrays, and an element without
+ an id gets one minted from its slide and position, the same every time.
+ *Save ▾ Copy compact JSON (for agents)* and `window.bento.compact()` hand
+ a deck back in that shape; *Replace from JSON…* and `loadDoc` take it. The
+ saved file is unchanged — always full, so nothing older is affected.
+ Measured: 12–14% off a designed deck's JSON, about 3× off a deck written
+ the compact way. Asked for, with a working proof of concept, by
+ benedictjohannes (#411, #422); the nested arrays and the flattening come
+ from that proof.
- **A Layers list.** The Slide panel now opens with *Layers*: every element
on the slide, top of the stack first, with a glyph and a short label (the
text's first words, or the kind). Click a row to select, shift-click to add,
diff --git a/scripts/compact-measure.mjs b/scripts/compact-measure.mjs
new file mode 100644
index 00000000..02379b1f
--- /dev/null
+++ b/scripts/compact-measure.mjs
@@ -0,0 +1,94 @@
+#!/usr/bin/env node
+// SPDX-License-Identifier: MIT
+// Copyright (c) 2026 The Bento authors
+// How much of a deck's JSON is boilerplate an author never chose (#422).
+//
+// node scripts/compact-measure.mjs [deck.bento.html …]
+//
+// With no arguments: the starter deck (slides/src/starterdeck.ts) and the two
+// biggest gallery decks built by build-example-decks.mjs into working/ (or
+// pass paths). For each: full bytes, compact bytes (slides/src/compact.ts
+// compactDoc, the same function "Copy compact JSON" uses), tokens at chars/4,
+// and which fields the stripping removed most bytes from. Assets and fonts
+// are counted separately: they are payload, not boilerplate, and dominate a
+// deck with photos — the interesting number is the DOCUMENT without them.
+//
+// Exported for the rig: measureDoc(doc) → { full, compact, ... }.
+
+import { readFileSync, existsSync, readdirSync } from 'node:fs'
+import { join, dirname, basename } from 'node:path'
+import { fileURLToPath } from 'node:url'
+
+const root = dirname(dirname(fileURLToPath(import.meta.url)))
+const { compactDoc } = await import(join(root, 'slides/src/compact.ts'))
+const { starterDoc } = await import(join(root, 'slides/src/starterdeck.ts'))
+
+/** The document minus binary payload: assets and fonts, which no compaction touches. */
+export function withoutPayload(doc) {
+ const { assets, fonts, ...rest } = doc
+ // an inline data: URI on an element (a video pasted straight in) is payload too
+ return JSON.parse(JSON.stringify(rest, (k, v) => (typeof v === 'string' && v.startsWith('data:') && v.length > 256 ? `data:…(${v.length} B)` : v)))
+}
+
+export function measureDoc(doc) {
+ const full = withoutPayload(doc)
+ const compact = withoutPayload(compactDoc(doc))
+ const fullJson = JSON.stringify(full)
+ const compactJson = JSON.stringify(compact)
+ // per-field bytes removed: walk elements of both and diff key sets
+ const removed = {}
+ const els = (d) => d.slides.flatMap((s) => s.elements ?? [])
+ const fe = els(full), ce = els(compact)
+ fe.forEach((el, i) => {
+ const c = ce[i] ?? {}
+ for (const k of Object.keys(el)) if (!(k in c)) removed[k] = (removed[k] ?? 0) + JSON.stringify({ [k]: el[k] }).length
+ })
+ full.slides.forEach((s, i) => {
+ const c = compact.slides[i] ?? {}
+ for (const k of Object.keys(s)) if (k !== 'elements' && !(k in c)) removed[`slide.${k}`] = (removed[`slide.${k}`] ?? 0) + JSON.stringify({ [k]: s[k] }).length
+ })
+ const top = Object.entries(removed).sort((a, b) => b[1] - a[1])
+ return {
+ elements: fe.length, slides: full.slides.length,
+ fullBytes: fullJson.length, compactBytes: compactJson.length,
+ fullTokens: Math.round(fullJson.length / 4), compactTokens: Math.round(compactJson.length / 4),
+ payloadBytes: JSON.stringify(doc).length - fullJson.length,
+ top,
+ }
+}
+
+const readDeck = (file) => {
+ const html = readFileSync(file, 'utf8')
+ const m = /<script type="application\/bento\+json" id="bento-doc">\s*([\s\S]*?)\s*<\/script>/.exec(html)
+ if (!m) throw new Error(`no #bento-doc in ${file}`)
+ return JSON.parse(m[1])
+}
+
+export function defaultDecks() {
+ const decks = [['starter deck', starterDoc()]]
+ const dir = process.env.DECKS_DIR ?? join(root, 'working') // build-example-decks.mjs's default output
+ if (existsSync(dir)) {
+ const files = readdirSync(dir).filter((f) => f.endsWith('.bento.html')).map((f) => [f, readDeck(join(dir, f))])
+ files.sort((a, b) => b[1].slides.flatMap((s) => s.elements).length - a[1].slides.flatMap((s) => s.elements).length)
+ for (const [f, d] of files.slice(0, 2)) decks.push([f.replace('.bento.html', ''), d])
+ }
+ return decks
+}
+
+if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
+ const decks = process.argv.length > 2 ? process.argv.slice(2).map((f) => [basename(f), readDeck(f)]) : defaultDecks()
+ let tf = 0, tc = 0
+ console.log('| deck | slides | elements | full bytes | compact bytes | saved | full tokens | compact tokens | payload (assets+fonts) |')
+ console.log('| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |')
+ const tops = {}
+ for (const [name, doc] of decks) {
+ const m = measureDoc(doc)
+ tf += m.fullBytes; tc += m.compactBytes
+ console.log(`| ${name} | ${m.slides} | ${m.elements} | ${m.fullBytes.toLocaleString()} | ${m.compactBytes.toLocaleString()} | ${(100 - m.compactBytes / m.fullBytes * 100).toFixed(1)}% | ${m.fullTokens.toLocaleString()} | ${m.compactTokens.toLocaleString()} | ${m.payloadBytes.toLocaleString()} |`)
+ for (const [k, v] of m.top) tops[k] = (tops[k] ?? 0) + v
+ }
+ console.log(`| **total** | | | ${tf.toLocaleString()} | ${tc.toLocaleString()} | ${(100 - tc / tf * 100).toFixed(1)}% | ${Math.round(tf / 4).toLocaleString()} | ${Math.round(tc / 4).toLocaleString()} | |`)
+ console.log('\nbytes removed, by field (all decks):\n')
+ console.log('| field | bytes |'); console.log('| --- | ---: |')
+ for (const [k, v] of Object.entries(tops).sort((a, b) => b[1] - a[1]).slice(0, 14)) console.log(`| \`${k}\` | ${v.toLocaleString()} |`)
+}
diff --git a/scripts/fixtures/compact-decks/orbital-dark-immersive.json b/scripts/fixtures/compact-decks/orbital-dark-immersive.json
new file mode 100644
index 00000000..316781ef
--- /dev/null
+++ b/scripts/fixtures/compact-decks/orbital-dark-immersive.json
@@ -0,0 +1 @@
+{"format":"bento/slides","version":1,"title":"Orbital — dark immersive template","size":{"width":1280,"height":720},"theme":{"background":"#05060E","color":"#EAF4FF","accent":"#38E1FF","fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif"},"template":true,"assets":{"font-instrument":"data:,","ph-stars":"data:,","ph-cubesats":"data:,","ph-jwst":"data:,","font-spacemono":"data:,","font-spacemono-bold":"data:,"},"fonts":[{"family":"Instrument Sans","asset":"font-instrument","weight":"100 900"},{"family":"Space Mono","asset":"font-spacemono","weight":"400"},{"family":"Space Mono","asset":"font-spacemono-bold","weight":"700"}],"present":{"progress":true},"slides":[{"id":"orb-cover","background":"#05060E","transition":"none","notes":"TEMPLATE — “Orbital”, immersive dark-tech deck. Style family: void black, one luminous gradient — over REAL sky: the backdrop is a sunlit Earth from the ISS (NASA, public domain; ISS007-E-10807), the sun flaring at the top behind the orbit dot, dimmed under a scrim (image opacity 0.6) so the type stays lit. Three satellites track wide low-orbit arcs across the sky behind the ring. The ring and wordmark morph through the whole deck.","elements":[{"id":"im-1","type":"image","x":0,"y":0,"w":1280,"h":720,"rotation":0,"opacity":0.6,"src":"asset:ph-stars","fit":"cover","radius":0,"fx":{"ambient":"kenburns","ken":{"dir":"drift","scale":1.09,"duration":28}}},{"id":"s-2","type":"shape","shape":"rect","x":0,"y":0,"w":1280,"h":720,"rotation":0,"opacity":1,"fill":"rgba(5,6,14,0.45)","stroke":"none","strokeWidth":0,"radius":0,"fillGradient":{"angle":180,"stops":[{"at":0,"color":"rgba(5,6,14,0.6)"},{"at":0.55,"color":"rgba(5,6,14,0.25)"},{"at":1,"color":"rgba(5,6,14,0.7)"}]}},{"id":"s-3","type":"shape","shape":"ellipse","x":560,"y":168,"w":3,"h":3,"rotation":0,"opacity":1,"fill":"rgba(233,246,255,1)","stroke":"none","strokeWidth":0,"radius":0,"fx":{"loop":{"type":"motion-path","path":"M0,0 L-139.76228435536117,-2.576007532546436 L-269.9999999999999,-10.128479473896435 L-381.8376618407357,-22.142727342297007 L-467.6537180435968,-37.79999999999998 L-521.599946196097,-56.03328019024945 L-540,-75.6 L-521.599946196097,-95.16671980975057 L-467.653718043597,-113.39999999999999 L-381.8376618407358,-129.057272657703 L-269.99999999999983,-141.0715205261036 L-139.76228435536117,-148.62399246745358 L-1.3226185430791414e-13,-151.20000000000002 L139.76228435536092,-148.62399246745358 L270,-141.07152052610357 L381.8376618407355,-129.057272657703 L467.65371804359665,-113.40000000000005 L521.5999461960969,-95.16671980975057 L539.9999999999999,-75.60000000000002 L521.5999461960969,-56.03328019024947 L467.65371804359677,-37.800000000000004 L381.8376618407357,-22.14272734229702 L270.0000000000002,-10.128479473896459 L139.76228435536117,-2.576007532546436 L1.3226185430791414e-13,0 Z","duration":44}},"shadow":{"blur":6,"color":"rgba(120,215,255,0.9)"}},{"id":"s-4","type":"shape","shape":"ellipse","x":1340,"y":240,"w":3,"h":3,"rotation":0,"opacity":1,"fill":"rgba(233,246,255,1)","stroke":"none","strokeWidth":0,"radius":0,"fx":{"loop":{"type":"motion-path","path":"M0,0 L-23.851921597652183,27.175999735764677 L-93.7822173508929,52.49999999999999 L-205.0252531694167,74.24621202458748 L-349.99999999999994,90.93266739736605 L-518.8266684282355,101.42221176035217 L-699.9999999999999,105 L-881.1733315717645,101.42221176035217 L-1049.9999999999998,90.93266739736606 L-1194.9747468305832,74.24621202458749 L-1306.2177826491072,52.49999999999999 L-1376.1480784023477,27.17599973576471 L-1400,1.285879139104721e-14 L-1376.148078402348,-27.175999735764634 L-1306.217782649107,-52.50000000000001 L-1194.9747468305834,-74.24621202458748 L-1050.0000000000002,-90.93266739736605 L-881.1733315717645,-101.42221176035217 L-700.0000000000001,-105 L-518.8266684282358,-101.42221176035218 L-349.99999999999994,-90.93266739736605 L-205.02525316941686,-74.2462120245875 L-93.78221735089313,-52.50000000000004 L-23.851921597652183,-27.175999735764673 L0,-2.571758278209442e-14 Z","duration":54}},"shadow":{"blur":6,"color":"rgba(120,215,255,0.9)"}},{"id":"s-5","type":"shape","shape":"ellipse","x":-60,"y":300,"w":3,"h":3,"rotation":0,"opacity":1,"fill":"rgba(233,246,255,1)","stroke":"none","strokeWidth":0,"radius":0,"fx":{"loop":{"type":"motion-path","path":"M0,0 L29.303789391401253,-22.2584378788168 L115.21815274538261,-42.999999999999986 L251.888168179569,-60.811183182043095 L429.9999999999996,-74.47818472546173 L637.4156212118322,-83.06962106085989 L859.9999999999998,-86.00000000000003 L1082.5843787881674,-83.0696210608599 L1289.9999999999993,-74.47818472546177 L1468.1118318204308,-60.811183182043116 L1604.7818472546173,-42.999999999999986 L1690.6962106085987,-22.258437878816792 L1720,-3.159588741800171e-14 L1690.696210608599,22.258437878816732 L1604.781847254617,42.99999999999999 L1468.111831820431,60.81118318204307 L1290.0000000000005,74.47818472546169 L1082.584378788168,83.06962106085987 L860.0000000000002,86 L637.4156212118327,83.06962106085989 L429.9999999999993,74.47818472546167 L251.88816817956985,60.81118318204315 L115.21815274538261,42.99999999999997 L29.303789391401253,22.25843787881678 L0,2.106392494533447e-14 Z","duration":62}},"shadow":{"blur":6,"color":"rgba(120,215,255,0.9)"}},{"id":"orb-ring","type":"shape","shape":"ellipse","x":440,"y":120,"w":400,"h":400,"rotation":0,"opacity":1,"fill":"rgba(0,0,0,0)","stroke":"#38E1FF","strokeWidth":2,"radius":0,"shadow":{"blur":60,"color":"rgba(56,225,255,0.45)"}},{"id":"s-6","type":"shape","shape":"ellipse","x":610,"y":90,"w":60,"h":60,"rotation":0,"opacity":1,"fill":"#38E1FF","stroke":"none","strokeWidth":0,"radius":0,"fillGradient":{"angle":30,"stops":[{"at":0,"color":"#38E1FF"},{"at":1,"color":"#7A5CFF"}]},"fx":{"loop":{"type":"motion-path","path":"M0,0 L51.763809020504134,6.814834742186338 L99.99999999999997,26.794919243112258 L141.42135623730948,58.578643762690504 L173.2050807568877,100 L193.18516525781365,148.23619097949586 L199.99999999999997,200 L193.18516525781362,251.7638090205042 L173.20508075688772,299.99999999999994 L141.42135623730948,341.4213562373095 L99.99999999999997,373.20508075688775 L51.76380902050418,393.18516525781365 L0,400 L-51.76380902050409,393.1851652578137 L-100.00000000000007,373.2050807568877 L-141.4213562373095,341.4213562373095 L-173.20508075688772,300.0000000000001 L-193.18516525781368,251.7638090205041 L-200,200.00000000000006 L-193.1851652578137,148.23619097949594 L-173.20508075688775,99.99999999999997 L-141.42135623730957,58.578643762690504 L-100.00000000000011,26.794919243112304 L-51.763809020504134,6.814834742186338 L-4.898587196589413e-14,0 Z","duration":14}},"shadow":{"blur":30,"color":"rgba(56,225,255,0.8)"}},{"id":"orb-word","type":"text","x":140,"y":260,"w":1000,"h":130,"rotation":0,"opacity":1,"html":"ORBITAL","fontSize":110,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":800,"color":"#EAF4FF","align":"center","valign":"top","lineHeight":1.3,"letterSpacing":30,"shadow":{"blur":40,"color":"rgba(56,225,255,0.35)"}},{"id":"t-7","type":"text","x":140,"y":400,"w":1000,"h":24,"rotation":0,"opacity":1,"html":"LOW-ORBIT DATA · A FICTIONAL COMPANY FOR A REAL TEMPLATE","fontSize":12,"fontFamily":"'Space Mono', ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace","fontWeight":500,"color":"rgba(178,196,224,0.62)","align":"center","valign":"top","lineHeight":1.3,"letterSpacing":3},{"id":"t-8","type":"text","x":140,"y":616,"w":1000,"h":24,"rotation":0,"opacity":1,"html":"— PRESS → TO ENTER THE SYSTEM —","fontSize":11,"fontFamily":"'Space Mono', ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace","fontWeight":500,"color":"rgba(178,196,224,0.4)","align":"center","valign":"top","lineHeight":1.3,"letterSpacing":3}]},{"id":"orb-thesis","background":"#05060E","transition":"morph","notes":"Ring morphs off-center and shrinks; the wordmark docks top-left. Big statements sit on the darkness — no boxes needed.","elements":[{"id":"orb-word","type":"text","x":96,"y":70,"w":300,"h":40,"rotation":0,"opacity":1,"html":"ORBITAL","fontSize":22,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":800,"color":"rgba(178,196,224,0.62)","align":"left","valign":"top","lineHeight":1.3,"letterSpacing":10},{"id":"s-9","type":"shape","shape":"ellipse","x":930,"y":230,"w":520,"h":520,"rotation":0,"opacity":1,"fill":"rgba(122,92,255,0.06)","stroke":"none","strokeWidth":0,"radius":0,"shadow":{"blur":90,"color":"rgba(122,92,255,0.28)"}},{"id":"orb-ring","type":"shape","shape":"ellipse","x":880,"y":180,"w":620,"h":620,"rotation":0,"opacity":1,"fill":"rgba(0,0,0,0)","stroke":"#7A5CFF","strokeWidth":2,"radius":0,"shadow":{"blur":70,"color":"rgba(122,92,255,0.4)"}},{"id":"t-a","type":"text","x":96,"y":170,"w":700,"h":22,"rotation":0,"opacity":1,"html":"01 · THE THESIS","fontSize":12,"fontFamily":"'Space Mono', ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace","fontWeight":500,"color":"#38E1FF","align":"left","valign":"top","lineHeight":1.3,"letterSpacing":3},{"id":"t-b","type":"text","x":96,"y":210,"w":900,"h":300,"rotation":0,"opacity":1,"html":"Every satellite is<br>a sensor. Nobody<br>reads the sky.","fontSize":76,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":800,"color":"#EAF4FF","align":"left","valign":"top","lineHeight":1.1,"fx":{"enter":"fade-up"}},{"id":"t-c","type":"text","x":96,"y":540,"w":620,"h":80,"rotation":0,"opacity":1,"html":"Twelve thousand spacecraft stream telemetry into archives nobody opens. We turn that exhaust into signal.","fontSize":17,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":400,"color":"rgba(178,196,224,0.62)","align":"left","valign":"top","lineHeight":1.6,"fx":{"enter":"fade-up","order":2}},{"id":"s-d","type":"shape","shape":"ellipse","x":1062,"y":703.5,"w":6,"h":6,"rotation":0,"opacity":1,"fill":"#E9F6FF","stroke":"none","strokeWidth":0,"radius":0,"fx":{"loop":{"type":"motion-path","path":"M0,0 L-51.77669529663692,-21.85131060721003 L-91.50635094610968,-50.32849302036028 L-116.4814565722671,-83.49087431876369 L-125.00000000000006,-119.07849302036031 L-116.48145657226716,-154.6661117219569 L-91.50635094610976,-187.8284930203603 L-51.77669529663697,-216.30567543351066 L-1.6653345369377348e-13,-238.15698604072062 L60.29523872436979,-251.89329413510725 L124.9999999999999,-256.5784930203604 L189.70476127563,-251.89329413510725 L249.99999999999977,-238.15698604072068 L301.77669529663666,-216.30567543351074 L341.50635094610965,-187.8284930203603 L366.48145657226706,-154.66611172195692 L374.99999999999994,-119.07849302036037 L366.48145657226706,-83.49087431876382 L341.5063509461097,-50.328493020360426 L301.77669529663706,-21.851310607210152 L249.9999999999999,1.5265566588595902e-14 L189.70476127563012,13.73630809438657 L125.00000000000003,18.42150697963968 L60.295238724369895,13.736308094386587 L1.3877787807814457e-13,6.106226635438361e-14 Z","duration":19}},"shadow":{"blur":14,"color":"rgba(56,225,255,0.85)"}},{"id":"s-e","type":"shape","shape":"ellipse","x":946,"y":552.2,"w":5,"h":5,"rotation":0,"opacity":1,"fill":"#38E1FF","stroke":"none","strokeWidth":0,"radius":0,"fx":{"loop":{"type":"motion-path","path":"M0,0 L-8.51854342773295,-35.58761870159663 L-5.551115123125783e-14,-71.1752374031932 L24.975105626157344,-104.33761870159661 L64.70476127563013,-132.8148011147469 L116.48145657226694,-154.66611172195695 L176.7766952966369,-168.40241981634355 L241.481456572267,-173.08761870159665 L306.1862178478971,-168.40241981634355 L366.4814565722669,-154.666111721957 L418.2581518689039,-132.81480111474696 L457.98780751837666,-104.3376187015967 L482.9629131445341,-71.17523740319325 L491.48145657226706,-35.58761870159667 L482.9629131445342,-1.0685896612017133e-13 L457.9878075183768,33.16238129840327 L418.2581518689041,61.639563711553535 L366.481456572267,83.49087431876372 L306.18621784789724,97.22718241315025 L241.48145657226712,101.91238129840337 L176.776695296637,97.22718241315027 L116.48145657226725,83.49087431876374 L64.70476127563037,61.63956371155377 L24.975105626157344,33.16238129840333 L-2.7755575615628914e-14,-3.0531133177191805e-14 Z","duration":19}},"shadow":{"blur":14,"color":"rgba(56,225,255,0.85)"}},{"id":"s-f","type":"shape","shape":"ellipse","x":970.5,"y":362,"w":6,"h":6,"rotation":0,"opacity":1,"fill":"#E9F6FF","stroke":"none","strokeWidth":0,"radius":0,"fx":{"loop":{"type":"motion-path","path":"M0,0 L39.72965564947281,-28.477182413150295 L91.50635094610975,-50.32849302036033 L151.8015896704795,-64.06480111474688 L216.5063509461096,-68.74999999999999 L281.21111222173994,-64.06480111474687 L341.5063509461097,-50.3284930203603 L393.2830462427467,-28.4771824131502 L433.01270189221935,6.106226635438361e-14 L457.98780751837677,33.162381298403425 L466.50635094610965,68.74999999999999 L457.98780751837677,104.33761870159654 L433.0127018922193,137.5 L393.2830462427466,165.9771824131503 L341.5063509461096,187.82849302036036 L281.2111122217398,201.56480111474693 L216.50635094610973,206.25000000000003 L151.80158967047961,201.56480111474696 L91.50635094610945,187.8284930203603 L39.72965564947298,165.97718241315042 L-5.551115123125783e-14,137.5 L-24.97510562615743,104.33761870159664 L-33.49364905389035,68.75000000000007 L-24.975105626157344,33.16238129840327 L-1.3877787807814457e-13,1.2975731600306517e-13 Z","duration":19}},"shadow":{"blur":14,"color":"rgba(56,225,255,0.85)"}},{"id":"s-g","type":"shape","shape":"ellipse","x":1122.3,"y":245.5,"w":6,"h":6,"rotation":0,"opacity":1,"fill":"#38E1FF","stroke":"none","strokeWidth":0,"radius":0,"fx":{"loop":{"type":"motion-path","path":"M0,0 L64.70476127563012,-4.685198885253108 L129.40952255126044,1.5265566588595902e-14 L189.70476127563018,13.736308094386587 L241.481456572267,35.58761870159659 L281.2111122217399,64.06480111474694 L306.18621784789724,97.22718241315032 L314.7047612756302,132.81480111474687 L306.18621784789724,168.40241981634344 L281.21111222173977,201.5648011147469 L241.48145657226695,230.04198352789726 L189.70476127563006,251.89329413510725 L129.40952255126035,265.6296022294938 L64.70476127563025,270.3148011147469 L1.1102230246251565e-13,265.6296022294938 L-60.29523872437004,251.89329413510717 L-112.07193402100651,230.0419835278973 L-151.80158967047956,201.5648011147469 L-176.77669529663692,168.40241981634352 L-185.29523872436985,132.81480111474696 L-176.77669529663683,97.22718241315015 L-151.80158967047964,64.06480111474701 L-112.07193402100663,35.58761870159656 L-60.2952387243698,13.73630809438657 L-6.938893903907228e-14,1.5265566588595902e-14 Z","duration":19}},"shadow":{"blur":14,"color":"rgba(56,225,255,0.85)"}},{"id":"s-h","type":"shape","shape":"ellipse","x":1312.5,"y":271,"w":5,"h":5,"rotation":0,"opacity":1,"fill":"#E9F6FF","stroke":"none","strokeWidth":0,"radius":0,"fx":{"loop":{"type":"motion-path","path":"M0,0 L51.77669529663681,21.85131060721 L91.50635094610968,50.328493020360355 L116.48145657226705,83.49087431876372 L124.99999999999997,119.07849302036028 L116.48145657226702,154.66611172195695 L91.50635094610962,187.82849302036033 L51.77669529663675,216.30567543351071 L-9.71445146547012e-14,238.15698604072065 L-60.295238724369845,251.89329413510725 L-124.99999999999994,256.5784930203603 L-189.70476127563006,251.89329413510725 L-250.00000000000023,238.15698604072057 L-301.7766952966367,216.30567543351074 L-341.5063509461097,187.8284930203603 L-366.4814565722671,154.66611172195692 L-375,119.07849302036037 L-366.48145657226706,83.49087431876356 L-341.5063509461098,50.328493020360426 L-301.77669529663683,21.851310607209975 L-250,-1.5265566588595902e-14 L-189.70476127563023,-13.73630809438657 L-125.00000000000014,-18.421506979639695 L-60.29523872437001,-13.736308094386603 L1.3877787807814457e-13,4.5796699765787714e-14 Z","duration":19}},"shadow":{"blur":14,"color":"rgba(56,225,255,0.85)"}},{"id":"s-i","type":"shape","shape":"ellipse","x":1428.5,"y":422.3,"w":6,"h":6,"rotation":0,"opacity":1,"fill":"#38E1FF","stroke":"none","strokeWidth":0,"radius":0,"fx":{"loop":{"type":"motion-path","path":"M0,0 L8.518543427732922,35.58761870159657 L-2.7755575615628914e-14,71.17523740319325 L-24.97510562615743,104.33761870159661 L-64.70476127563016,132.81480111474687 L-116.48145657226715,154.66611172195695 L-176.7766952966369,168.4024198163435 L-241.481456572267,173.0876187015966 L-306.1862178478971,168.40241981634352 L-366.4814565722673,154.66611172195687 L-418.258151868904,132.81480111474684 L-457.98780751837677,104.33761870159657 L-482.9629131445342,71.17523740319322 L-491.48145657226706,35.58761870159665 L-482.9629131445341,-1.60288449180257e-13 L-457.9878075183769,-33.16238129840329 L-418.25815186890384,-61.63956371155375 L-366.48145657226706,-83.49087431876374 L-306.1862178478973,-97.22718241315027 L-241.48145657226718,-101.91238129840342 L-176.77669529663706,-97.22718241315032 L-116.48145657226691,-83.49087431876369 L-64.70476127563043,-61.63956371155382 L-24.9751056261574,-33.162381298403396 L-2.7755575615628914e-14,-3.8163916471489756e-14 Z","duration":19}},"shadow":{"blur":14,"color":"rgba(56,225,255,0.85)"}},{"id":"s-j","type":"shape","shape":"ellipse","x":995.6,"y":730.8,"w":7,"h":7,"rotation":0,"opacity":1,"fill":"#38E1FF","stroke":"none","strokeWidth":0,"radius":0,"fx":{"loop":{"type":"motion-path","path":"M0,0 L-56.721950763706744,-53.10302232567298 L-96.57193756475,-117.90286648641896 L-116.83424965785575,-189.98353018948904 L-116.12804395893271,-264.43283532244783 L-94.50144721930245,-336.177184773778 L-53.42827626712975,-400.32731969151484 L4.292400173819107,-452.511514394125 L74.72701339202126,-489.17350225108487 L153.07556089535845,-507.8148293767422 L233.99871864857437,-507.165120133733 L311.98170718262884,-487.2686511332732 L381.710114701908,-449.4813338572744 L438.4320654656147,-396.3783115316015 L478.2820522666583,-331.5784673708551 L498.5443643597639,-259.4978036677851 L497.8381586608409,-185.04849853482648 L476.2115619212106,-113.30414908349634 L435.13839096903797,-49.154014165759534 L377.4177145280893,3.0301805368506383 L306.98310130988665,39.692168393810725 L228.63455380654975,58.333495519467945 L147.71139605333383,57.683786276458754 L69.72840751927932,37.78731727599891 L1.7208456881689926e-13,9.49906819869284e-14 Z","duration":25}},"shadow":{"blur":14,"color":"rgba(56,225,255,0.85)"}},{"id":"s-k","type":"shape","shape":"ellipse","x":890.5,"y":577.6,"w":6,"h":6,"rotation":0,"opacity":1,"fill":"#E9F6FF","stroke":"none","strokeWidth":0,"radius":0,"fx":{"loop":{"type":"motion-path","path":"M0,0 L-13.356682027378701,-73.43107372737128 L-5.600245734881976,-147.5404508857948 L22.740720562273584,-217.27769989346058 L69.73482684659801,-277.890342476749 L132.17950243624742,-325.2477272107373 L205.8192458844925,-356.1225265875823 L285.63563037076574,-368.41067405277073 L366.18930119513914,-361.2747526636737 L441.990658812167,-335.20106367029064 L507.87396596791535,-291.9664858887122 L559.3493841570329,-234.51738434623488 L592.9089486970819,-166.76882037384925 L606.2656307244606,-93.3377466464781 L598.5091944319639,-19.228369488054355 L570.1682281348084,50.50887951961133 L523.174121850484,111.1215221028998 L460.7294462608346,158.4789068368881 L387.08970281258956,189.3537062137331 L307.27331832631654,201.6418536789215 L226.71964750194292,194.50593228982447 L150.918289884915,168.43224329644147 L85.03498272916663,125.19766551486296 L33.55956454004911,67.74856397238571 L-3.441691376337985e-14,-1.899813639738568e-13 Z","duration":25}},"shadow":{"blur":14,"color":"rgba(56,225,255,0.85)"}},{"id":"s-l","type":"shape","shape":"ellipse","x":891.7,"y":390.7,"w":7,"h":7,"rotation":0,"opacity":1,"fill":"#38E1FF","stroke":"none","strokeWidth":0,"radius":0,"fx":{"loop":{"type":"motion-path","path":"M0,0 L34.839643988416206,-67.19940599055073 L87.39703208025158,-123.81325743041779 L154.09046513223828,-165.98341390278756 L230.37489589799233,-190.83604893354632 L311.0516664868102,-196.67749651626934 L390.6227883077312,-183.10967165164274 L463.6656209061561,-151.0571991822998 L525.2024159494898,-102.70440213781126 L571.0395425498917,-41.346443729983484 L598.0532762789774,28.83523257451023 L604.4026758254155,103.0578615162227 L589.6550401029953,176.26329359147005 L554.8153961145791,243.46269958202075 L502.2580080227434,300.0765510218881 L435.5645749707569,342.24670749425775 L359.2801442050029,367.0993425250164 L278.603373616185,372.9407901077396 L199.032251795264,359.3729652431129 L125.98941919683936,327.3204927737702 L64.45262415350521,278.9676957292813 L18.615497553103477,217.60973732145368 L-8.398236175982168,147.42806101696002 L-14.747635722420293,73.20543207524754 L-3.441691376337985e-14,1.899813639738568e-13 Z","duration":25}},"shadow":{"blur":14,"color":"rgba(56,225,255,0.85)"}},{"id":"s-m","type":"shape","shape":"ellipse","x":1000.4,"y":239.4,"w":6,"h":6,"rotation":0,"opacity":1,"fill":"#E9F6FF","stroke":"none","strokeWidth":0,"radius":0,"fx":{"loop":{"type":"motion-path","path":"M0,0 L70.43461321820216,-36.66198785695983 L148.78316072153933,-55.303314982617145 L229.70631847475525,-54.653605739607954 L307.68930700880975,-34.757136739148116 L377.41771452808905,3.03018053685086 L434.1396652917957,56.13320286252375 L473.98965209283915,120.93304702326996 L494.2519641859448,193.01371072633995 L493.54575848702177,267.4630158592986 L471.9191617473915,339.2073653106287 L430.84599079521894,403.35750022836555 L373.1253143542699,455.54169493097584 L302.6907011360678,492.2036827879357 L224.34215363273063,510.84500991359295 L143.4189958795147,510.19530067058383 L65.43600734546021,490.29883167012395 L-4.292400173818935,452.5115143941251 L-61.014350937525954,399.40849206845195 L-100.86433773856896,334.60864790770637 L-121.12664983167488,262.52798420463597 L-120.42044413275185,188.0786790716773 L-98.79384739312158,116.33432962034716 L-57.72067644094866,52.18419470260995 L-2.753353101070388e-13,1.899813639738568e-13 Z","duration":25}},"shadow":{"blur":14,"color":"rgba(56,225,255,0.85)"}},{"id":"s-n","type":"shape","shape":"ellipse","x":1175.7,"y":176.7,"w":7,"h":7,"rotation":0,"opacity":1,"fill":"#38E1FF","stroke":"none","strokeWidth":0,"radius":0,"fx":{"loop":{"type":"motion-path","path":"M0,0 L80.55367082437336,7.135921389096925 L156.35502844140154,33.20961038248007 L222.23833559714993,76.4441881640585 L273.7137537862674,133.8932897065358 L307.2733183263165,201.64185367892145 L320.63000035369515,275.0729274062926 L312.87356406119846,349.18230456471633 L284.532597764043,418.91955357238203 L237.53849147971854,479.53219615567053 L175.09381589006935,526.8895808896586 L101.45407244182431,557.7643802665036 L21.637687955551062,570.0525277316922 L-58.91598286882204,562.9166063425953 L-134.71734048585049,536.8429173492121 L-200.60064764159884,493.6083395676336 L-252.07606583071635,436.1592380251564 L-285.6356303707655,368.4106740527705 L-298.9923123981441,294.9796003253999 L-291.2358761056474,220.87022316697588 L-262.8949098084919,151.13297415931018 L-215.90080352416751,90.5203315760217 L-153.45612793451835,43.16294684203359 L-79.81638448627332,12.28814746518847 L2.000483112496454e-13,-3.1663560662309463e-14 Z","duration":25}},"shadow":{"blur":14,"color":"rgba(56,225,255,0.85)"}},{"id":"s-o","type":"shape","shape":"ellipse","x":1355.8,"y":227,"w":6,"h":6,"rotation":0,"opacity":1,"fill":"#E9F6FF","stroke":"none","strokeWidth":0,"radius":0,"fx":{"loop":{"type":"motion-path","path":"M0,0 L61.53679504333378,48.352797044488476 L107.37392164373576,109.7107554523162 L134.38765537282148,179.8924317568099 L140.73705491925966,254.1150606985223 L125.98941919683936,327.32049277376996 L91.1497752084233,394.51989876432066 L38.592387116588,451.1337502041877 L-28.10104593539842,493.30390667655735 L-104.38547670115267,518.1565417073164 L-185.06224728997086,523.9979892900395 L-264.63336911089186,510.43016442541284 L-337.67620170931644,478.37769195607 L-399.2129967526502,430.0248949115816 L-445.05012335305236,368.6669365037536 L-472.06385708213793,298.4852601992604 L-478.41325662857616,224.26263125754744 L-463.6656209061559,151.0571991823001 L-428.8259769177398,83.85779319174945 L-376.26858882590454,27.243941751882353 L-309.57515577391814,-14.926214720487332 L-233.2907250081636,-39.77884975124638 L-152.61395441934627,-45.62029733396949 L-73.04283259842468,-32.05247246934285 L-6.88338275267597e-14,-6.332712132461893e-14 Z","duration":25}},"shadow":{"blur":14,"color":"rgba(56,225,255,0.85)"}},{"id":"s-p","type":"shape","shape":"ellipse","x":1473.9,"y":370.4,"w":7,"h":7,"rotation":0,"opacity":1,"fill":"#38E1FF","stroke":"none","strokeWidth":0,"radius":0,"fx":{"loop":{"type":"motion-path","path":"M0,0 L20.26231209310575,72.08066370306997 L19.556106394182745,146.52996883602884 L-2.0704903454475163,218.274318287359 L-43.14366129762014,282.42445320509586 L-100.86433773856908,334.60864790770614 L-171.29895095677122,371.27063576466594 L-249.6474984601084,389.9119628903233 L-330.5706562133243,389.2622536473141 L-408.55364474737877,369.36578464685425 L-478.282052266658,331.57846737085544 L-535.0040030303646,278.47544504518265 L-574.853989831408,213.67560088443668 L-595.116301924514,141.59493718136625 L-594.4100962255908,67.14563204840759 L-572.7834994859606,-4.598717402922551 L-531.710328533788,-68.74885232065935 L-473.98965209283926,-120.93304702326952 L-403.5550388746367,-157.59503488022963 L-325.2064913713003,-176.2363620058868 L-244.28333361808387,-175.58665276287763 L-166.30034508402935,-155.6901837624178 L-96.5719375647502,-117.90286648641904 L-39.84998680104315,-64.79984416074585 L-1.376676550535194e-13,-3.008038262919399e-13 Z","duration":25}},"shadow":{"blur":14,"color":"rgba(56,225,255,0.85)"}},{"id":"s-q","type":"shape","shape":"ellipse","x":858.5,"y":661.6,"w":6,"h":6,"rotation":0,"opacity":1,"fill":"#E9F6FF","stroke":"none","strokeWidth":0,"radius":0,"fx":{"loop":{"type":"motion-path","path":"M0,0 L-34.00915955658671,-29.107721324938762 L-43.31688310758287,-60.04033092149814 L-27.288864674728465,-90.68982256422701 L12.98261277333026,-118.96748404835319 L74.75311460027116,-142.94623947477848 L153.8130831871694,-160.99197628795915 L244.77471232760286,-171.87490734606686 L341.4391173168509,-174.8533788823856 L437.2187787003785,-169.72441298387224 L525.5864708382729,-156.83754020049344 L600.520081545852,-137.07097961587235 L656.9130090870416,-111.77178966806493 L690.9221686436282,-82.6640683431262 L700.2298921946243,-51.731458746566844 L684.2018737617701,-21.081967103838 L643.9303963137114,7.195694380288118 L582.1598944867701,31.174449806713607 L503.0999258998722,49.220186619894186 L412.1382967594387,60.10311767800192 L315.4738917701907,63.08158921432069 L219.69423038666304,57.95262331580731 L131.32653824876894,45.065750532428545 L56.3929275411893,25.29918994780733 L-4.1300296516055823e-14,-1.9824142327706795e-14 Z","duration":31}},"shadow":{"blur":14,"color":"rgba(56,225,255,0.85)"}},{"id":"s-r","type":"shape","shape":"ellipse","x":830.8,"y":381.8,"w":5,"h":5,"rotation":0,"opacity":1,"fill":"#7A5CFF","stroke":"none","strokeWidth":0,"radius":0,"fx":{"loop":{"type":"motion-path","path":"M0,0 L39.498800231245525,-28.38904251023161 L100.61303921289124,-52.53937849174777 L179.17788255439342,-70.80520245772541 L269.83926601657083,-81.9417286905845 L366.41876614149663,-85.19002133153543 L462.33464960082694,-80.3287146051548 L551.0504074453006,-67.68909853115626 L626.5202073875386,-48.13254205702964 L683.600907281219,-22.991792187748906 L718.4025517589035,6.019850520147965 L728.5534662618752,36.925290560124125 L713.3618827419357,67.61837326710983 L673.8630825106902,96.0074157773414 L612.7488435290444,120.15775175885763 L534.1840001875423,138.42357572483525 L443.5226167253649,149.56010195769431 L346.9431166004391,152.80839459864524 L251.02723314110884,147.94708787226463 L162.3114752966351,135.3074717982661 L86.84167535439714,115.7509153241395 L29.76097546071665,90.61016545485867 L-5.040669016967699,61.59852274696209 L-15.191583519939444,30.693082706985724 L0,3.304023721284466e-14 Z","duration":31}},"shadow":{"blur":14,"color":"rgba(122,92,255,0.9)"}},{"id":"s-s","type":"shape","shape":"ellipse","x":1006.7,"y":161.6,"w":6,"h":6,"rotation":0,"opacity":1,"fill":"#38E1FF","stroke":"none","strokeWidth":0,"radius":0,"fx":{"loop":{"type":"motion-path","path":"M0,0 L90.35423356856089,-11.389273318020937 L186.84147392630695,-14.907139693543133 L282.8862750955611,-10.313862346623788 L371.9433425981775,2.07753446229423 L447.94358445761566,21.422597518434692 L505.7077097874926,46.402992743749735 L541.2991889063081,75.31634748568932 L552.2925213298148,106.19226440016797 L537.938529620692,136.92660077432927 L499.2154145928231,165.4248623751665 L438.76209254238444,189.74493977018668 L360.69835746327465,208.22945987574738 L270.3441238947138,219.61873319376832 L173.8568835369677,223.1365995692905 L77.81208236771357,218.5433222223712 L-11.244985134902802,206.15192541345314 L-87.24522699434122,186.80686235731264 L-145.0093523242178,161.82646713199773 L-180.60083144303343,132.91311239005805 L-191.59416386654027,102.03719547557941 L-177.24017215741733,71.3028591014181 L-138.51705712954853,42.80459750058086 L-78.06373507910985,18.484520105560698 L2.0650148258027912e-13,-3.964828465541359e-14 Z","duration":31}},"shadow":{"blur":14,"color":"rgba(56,225,255,0.85)"}},{"id":"s-t","type":"shape","shape":"ellipse","x":1286.9,"y":129,"w":5,"h":5,"rotation":0,"opacity":1,"fill":"#E9F6FF","stroke":"none","strokeWidth":0,"radius":0,"fx":{"loop":{"type":"motion-path","path":"M0,0 L89.3915951202703,12.142233890995243 L165.91649118424408,31.274330327700252 L224.35964298853114,56.09246855523775 L260.73824631954454,84.90533346731372 L272.5731594787602,115.74937593568093 L259.0578526924963,146.52262543831014 L221.11337178313602,175.12793587679676 L161.32557041843302,199.61590261726826 L83.76888845737834,218.31771119464014 L-6.271314392859104,229.95886426056444 L-102.6589471065063,233.74603647151346 L-198.82535180222325,229.42113829990896 L-288.216946922493,217.2789044089138 L-364.741842986467,198.14680797220873 L-423.18499479075416,173.32866974467126 L-459.56359812176754,144.51580483259525 L-471.39851128098326,113.67176236422796 L-457.8832044947194,82.89851286159892 L-419.93872358535907,54.293202423112234 L-360.150922220656,29.805235682640713 L-282.5942402596014,11.103427105268857 L-192.55403740936396,-0.5377259606554433 L-96.16640469571675,-4.324898171604464 L2.2715163083830703e-13,2.6432189770275728e-14 Z","duration":31}},"shadow":{"blur":14,"color":"rgba(56,225,255,0.85)"}},{"id":"s-u","type":"shape","shape":"ellipse","x":1509.2,"y":301,"w":6,"h":6,"rotation":0,"opacity":1,"fill":"#7A5CFF","stroke":"none","strokeWidth":0,"radius":0,"fx":{"loop":{"type":"motion-path","path":"M0,0 L37.162957171722255,28.710180870995888 L49.83854979218893,59.52000000000003 L37.162957171722375,90.32981912900406 L2.4780177909633494e-13,119.03999999999998 L-59.117727606415336,143.69399123244668 L-136.16145020781087,162.6116640664996 L-225.88076542967337,174.50381036145075 L-322.16145020781096,178.56000000000003 L-418.4421349859486,174.50381036145075 L-508.16145020781073,162.6116640664997 L-585.2051728092064,143.69399123244676 L-644.3229004156224,119.04000000000002 L-681.4858575873443,90.32981912900433 L-694.1614502078111,59.520000000000095 L-681.4858575873445,28.710180870996055 L-644.3229004156225,1.5198509117908543e-13 L-585.2051728092066,-24.65399123244661 L-508.1614502078116,-43.57166406649942 L-418.4421349859489,-55.463810361450626 L-322.16145020781124,-59.519999999999946 L-225.8807654296736,-55.463810361450655 L-136.1614502078114,-43.57166406649958 L-59.11772760641575,-24.653991232446675 L1.2390088954816747e-13,6.608047442568932e-14 Z","duration":31}},"shadow":{"blur":14,"color":"rgba(122,92,255,0.9)"}}]},{"id":"orb-earth","background":"#05060E","transition":"fade","notes":"The live-view beat: a real Earth-from-the-ISS clip (Expedition 65, NASA — public domain) plays full-bleed, muted and looping, and AUTOPLAYS the moment you present. Demonstrates the VIDEO media element embedded self-contained in the file (~290 KB, trimmed + downscaled from the 4K original with ffmpeg). One scrim, one line, a HUD “live” tag. On the editor canvas the clip shows its poster frame (inert); it only plays in present.","elements":[{"id":"m-v","type":"media","kind":"video","x":0,"y":0,"w":1280,"h":720,"rotation":0,"opacity":1,"src":"data:,","poster":"data:,","fit":"cover","controls":false,"autoplay":true,"loop":true,"muted":true},{"id":"s-w","type":"shape","shape":"rect","x":0,"y":0,"w":1280,"h":720,"rotation":0,"opacity":1,"fill":"rgba(5,6,14,0.30)","stroke":"none","strokeWidth":0,"radius":0,"fillGradient":{"angle":180,"stops":[{"at":0,"color":"rgba(5,6,14,0.32)"},{"at":0.5,"color":"rgba(5,6,14,0.05)"},{"at":1,"color":"rgba(5,6,14,0.82)"}]}},{"id":"t-x","type":"text","x":96,"y":84,"w":700,"h":22,"rotation":0,"opacity":1,"html":"01b · THE VIEW FROM 400 KM","fontSize":12,"fontFamily":"'Space Mono', ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace","fontWeight":500,"color":"#38E1FF","align":"left","valign":"top","lineHeight":1.3,"letterSpacing":3},{"id":"s-y","type":"shape","shape":"ellipse","x":1004,"y":90,"w":10,"h":10,"rotation":0,"opacity":1,"fill":"#FF4FA3","stroke":"none","strokeWidth":0,"radius":0,"shadow":{"blur":10,"color":"rgba(255,79,163,0.9)"}},{"id":"t-z","type":"text","x":1024,"y":84,"w":700,"h":22,"rotation":0,"opacity":1,"html":"LIVE FEED","fontSize":12,"fontFamily":"'Space Mono', ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace","fontWeight":500,"color":"#FF4FA3","align":"left","valign":"top","lineHeight":1.3,"letterSpacing":3},{"id":"t-10","type":"text","x":96,"y":452,"w":1000,"h":180,"rotation":0,"opacity":1,"html":"Live from<br>low orbit.","fontSize":66,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":800,"color":"#EAF4FF","align":"left","valign":"top","lineHeight":1.06,"fx":{"enter":"fade-up"},"shadow":{"y":2,"blur":30,"color":"rgba(0,0,0,0.6)"}},{"id":"t-11","type":"text","x":96,"y":648,"w":700,"h":22,"rotation":0,"opacity":1,"html":"EARTH FROM THE ISS · EXPEDITION 65 (4K) · NASA — PUBLIC DOMAIN","fontSize":10,"fontFamily":"'Space Mono', ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace","fontWeight":500,"color":"rgba(178,196,224,0.5)","align":"left","valign":"top","lineHeight":1.3,"letterSpacing":3}]},{"id":"orb-system","background":"#0B0E1E","transition":"fade","notes":"The “system map” — a clickable data pipeline: INGEST → CORE → MODEL, with dashes marching along the links (telemetry flowing) and a satellite orbiting the core. Nodes stagger in on entry. Click a node → a hidden STATE slide zooms that subsystem (link + stateOf). Extend it by duplicating a state slide.","elements":[{"id":"t-12","type":"text","x":96,"y":84,"w":700,"h":22,"rotation":0,"opacity":1,"html":"02 · THE CONSTELLATION — CLICK A NODE","fontSize":12,"fontFamily":"'Space Mono', ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace","fontWeight":500,"color":"rgba(178,196,224,0.62)","align":"left","valign":"top","lineHeight":1.3,"letterSpacing":3},{"id":"s-13","type":"shape","shape":"ellipse","x":500,"y":220,"w":280,"h":280,"rotation":0,"opacity":1,"fill":"rgba(0,0,0,0)","stroke":"rgba(56,225,255,0.30)","strokeWidth":1.5,"radius":0,"strokeStyle":"dashed","fx":{"loop":{"type":"dash-march","distance":40,"duration":7}}},{"id":"s-14","type":"shape","shape":"ellipse","x":636,"y":216,"w":8,"h":8,"rotation":0,"opacity":1,"fill":"#38E1FF","stroke":"none","strokeWidth":0,"radius":0,"fillGradient":{"angle":30,"stops":[{"at":0,"color":"#38E1FF"},{"at":1,"color":"#7A5CFF"}]},"fx":{"loop":{"type":"motion-path","path":"M0,0 L36.23466631435289,4.770384319530436 L69.99999999999997,18.75644347017858 L98.99494936611664,41.00505063388336 L121.24355652982139,70 L135.22961568046955,103.7653336856471 L139.99999999999997,140 L135.22961568046952,176.23466631435292 L121.2435565298214,209.99999999999997 L98.99494936611664,238.99494936611666 L69.99999999999997,261.24355652982143 L36.23466631435293,275.2296156804695 L0,280 L-36.234666314352864,275.2296156804696 L-70.00000000000004,261.2435565298214 L-98.99494936611666,238.99494936611666 L-121.2435565298214,210.00000000000006 L-135.22961568046958,176.23466631435286 L-140,140.00000000000003 L-135.2296156804696,103.76533368564716 L-121.24355652982142,69.99999999999999 L-98.99494936611669,41.00505063388336 L-70.00000000000007,18.756443470178613 L-36.23466631435289,4.770384319530436 L-3.429011037612589e-14,0 Z","duration":12}},"shadow":{"blur":16,"color":"rgba(56,225,255,0.85)"}},{"id":"s-15","type":"shape","shape":"line","x":342,"y":359,"w":238,"h":2,"rotation":0,"opacity":1,"fill":"rgba(132,186,236,0.9)","stroke":"none","strokeWidth":2,"radius":0,"strokeStyle":"dashed","lineEnd":"arrow","fx":{"loop":{"type":"dash-march","distance":24,"duration":1.6}}},{"id":"s-16","type":"shape","shape":"line","x":700,"y":359,"w":238,"h":2,"rotation":0,"opacity":1,"fill":"rgba(132,186,236,0.9)","stroke":"none","strokeWidth":2,"radius":0,"strokeStyle":"dashed","lineEnd":"arrow","fx":{"loop":{"type":"dash-march","distance":24,"duration":1.6}}},{"id":"s-17","type":"shape","shape":"ellipse","x":580,"y":300,"w":120,"h":120,"rotation":0,"opacity":1,"fill":"#05060E","stroke":"#38E1FF","strokeWidth":2,"radius":0,"fillGradient":{"angle":30,"stops":[{"at":0,"color":"#38E1FF"},{"at":1,"color":"#7A5CFF"}]},"fx":{"enter":"fade-up","order":0},"shadow":{"blur":55,"color":"rgba(56,225,255,0.7)"}},{"id":"t-18","type":"text","x":580,"y":351,"w":120,"h":30,"rotation":0,"opacity":1,"html":"<b>CORE</b>","fontSize":15,"fontFamily":"'Space Mono', ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace","fontWeight":400,"color":"#04141c","align":"center","valign":"top","lineHeight":1.3,"letterSpacing":2,"fx":{"enter":"fade-up","order":0}},{"id":"orb-n1","type":"shape","shape":"ellipse","x":258,"y":318,"w":84,"h":84,"rotation":0,"opacity":1,"fill":"#0B0E1E","stroke":"#7A5CFF","strokeWidth":2,"radius":0,"fx":{"enter":"fade-up","order":1},"link":"orb-state-ingest","shadow":{"blur":34,"color":"rgba(122,92,255,0.55)"}},{"id":"s-19","type":"shape","shape":"ellipse","x":286,"y":346,"w":28,"h":28,"rotation":0,"opacity":1,"fill":"#7A5CFF","stroke":"none","strokeWidth":0,"radius":0,"fillGradient":{"angle":30,"stops":[{"at":0,"color":"#7A5CFF"},{"at":1,"color":"#FF4FA3"}]},"fx":{"enter":"fade-up","order":1},"link":"orb-state-ingest","shadow":{"blur":14,"color":"rgba(122,92,255,0.85)"}},{"id":"t-1a","type":"text","x":233,"y":416,"w":134,"h":24,"rotation":0,"opacity":1,"html":"INGEST","fontSize":12,"fontFamily":"'Space Mono', ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace","fontWeight":400,"color":"rgba(178,196,224,0.62)","align":"center","valign":"top","lineHeight":1.3,"letterSpacing":3,"fx":{"enter":"fade-up","order":1},"link":"orb-state-ingest"},{"id":"orb-n2","type":"shape","shape":"ellipse","x":938,"y":318,"w":84,"h":84,"rotation":0,"opacity":1,"fill":"#0B0E1E","stroke":"#FF4FA3","strokeWidth":2,"radius":0,"fx":{"enter":"fade-up","order":2},"link":"orb-state-model","shadow":{"blur":34,"color":"rgba(255,79,163,0.5)"}},{"id":"s-1b","type":"shape","shape":"ellipse","x":966,"y":346,"w":28,"h":28,"rotation":0,"opacity":1,"fill":"#FF4FA3","stroke":"none","strokeWidth":0,"radius":0,"fx":{"enter":"fade-up","order":2},"link":"orb-state-model","shadow":{"blur":14,"color":"rgba(255,79,163,0.85)"}},{"id":"t-1c","type":"text","x":913,"y":416,"w":134,"h":24,"rotation":0,"opacity":1,"html":"MODEL","fontSize":12,"fontFamily":"'Space Mono', ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace","fontWeight":400,"color":"rgba(178,196,224,0.62)","align":"center","valign":"top","lineHeight":1.3,"letterSpacing":3,"fx":{"enter":"fade-up","order":2},"link":"orb-state-model"},{"id":"t-1d","type":"text","x":96,"y":566,"w":900,"h":60,"rotation":0,"opacity":1,"html":"Hidden state slides answer the click — arrow keys skip them,<br>so the linear story stays clean.","fontSize":15,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":400,"color":"rgba(178,196,224,0.45)","align":"left","valign":"top","lineHeight":1.5,"fx":{"enter":"fade","order":3}}]},{"id":"orb-state-ingest","background":"#0B0E1E","transition":"morph","notes":"A hidden state — reached only by clicking its node on the system map. Each state gets its own NASA backdrop (public domain) under a deep scrim — the photo switch is what makes the zoom-in feel like a place, not a popup.","elements":[{"id":"im-1e","type":"image","x":0,"y":0,"w":1280,"h":720,"rotation":0,"opacity":0.55,"src":"asset:ph-cubesats","fit":"cover","radius":0,"fx":{"ambient":"kenburns","ken":{"dir":"drift","scale":1.08,"duration":20}}},{"id":"s-1f","type":"shape","shape":"rect","x":0,"y":0,"w":1280,"h":720,"rotation":0,"opacity":1,"fill":"rgba(11,14,30,0.62)","stroke":"none","strokeWidth":0,"radius":0},{"id":"t-1g","type":"text","x":96,"y":84,"w":700,"h":22,"rotation":0,"opacity":1,"html":"02a · INGEST — CLICK ANYWHERE DIM TO GO BACK","fontSize":12,"fontFamily":"'Space Mono', ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace","fontWeight":500,"color":"rgba(178,196,224,0.62)","align":"left","valign":"top","lineHeight":1.3,"letterSpacing":3},{"id":"orb-state-ingest-halo","type":"shape","shape":"ellipse","x":460,"y":130,"w":360,"h":360,"rotation":0,"opacity":1,"fill":"rgba(0,0,0,0)","stroke":"#7A5CFF","strokeWidth":2,"radius":0,"shadow":{"blur":70,"color":"rgba(122,92,255,0.5)"}},{"id":"t-1h","type":"text","x":340,"y":240,"w":600,"h":80,"rotation":0,"opacity":1,"html":"INGEST","fontSize":56,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":800,"color":"#EAF4FF","align":"center","valign":"top","lineHeight":1.3,"letterSpacing":8},{"id":"t-1i","type":"text","x":340,"y":330,"w":600,"h":80,"rotation":0,"opacity":1,"html":"4.2 TB of telemetry per orbit,<br>deduplicated at the edge.","fontSize":16,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":400,"color":"rgba(178,196,224,0.62)","align":"center","valign":"top","lineHeight":1.6},{"id":"t-1j","type":"text","x":96,"y":648,"w":700,"h":22,"rotation":0,"opacity":1,"html":"CUBESATS DEPLOYED FROM THE ISS, EXPEDITION 72 · NASA — PUBLIC DOMAIN","fontSize":9,"fontFamily":"'Space Mono', ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace","fontWeight":500,"color":"rgba(178,196,224,0.4)","align":"left","valign":"top","lineHeight":1.3,"letterSpacing":3},{"id":"s-1k","type":"shape","shape":"rect","x":0,"y":0,"w":1280,"h":720,"rotation":0,"opacity":1,"fill":"rgba(0,0,0,0)","stroke":"none","strokeWidth":0,"radius":0,"link":"orb-system"}],"name":"INGEST","stateOf":"orb-system"},{"id":"orb-state-model","background":"#0B0E1E","transition":"morph","notes":"A hidden state — reached only by clicking its node on the system map. Each state gets its own NASA backdrop (public domain) under a deep scrim — the photo switch is what makes the zoom-in feel like a place, not a popup.","elements":[{"id":"im-1l","type":"image","x":0,"y":0,"w":1280,"h":720,"rotation":0,"opacity":0.55,"src":"asset:ph-jwst","fit":"cover","radius":0,"fx":{"ambient":"kenburns","ken":{"dir":"drift","scale":1.08,"duration":20}}},{"id":"s-1m","type":"shape","shape":"rect","x":0,"y":0,"w":1280,"h":720,"rotation":0,"opacity":1,"fill":"rgba(11,14,30,0.62)","stroke":"none","strokeWidth":0,"radius":0},{"id":"t-1n","type":"text","x":96,"y":84,"w":700,"h":22,"rotation":0,"opacity":1,"html":"02a · MODEL — CLICK ANYWHERE DIM TO GO BACK","fontSize":12,"fontFamily":"'Space Mono', ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace","fontWeight":500,"color":"rgba(178,196,224,0.62)","align":"left","valign":"top","lineHeight":1.3,"letterSpacing":3},{"id":"orb-state-model-halo","type":"shape","shape":"ellipse","x":460,"y":130,"w":360,"h":360,"rotation":0,"opacity":1,"fill":"rgba(0,0,0,0)","stroke":"#FF4FA3","strokeWidth":2,"radius":0,"shadow":{"blur":70,"color":"rgba(255,79,163,0.5)"}},{"id":"t-1o","type":"text","x":340,"y":240,"w":600,"h":80,"rotation":0,"opacity":1,"html":"MODEL","fontSize":56,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":800,"color":"#EAF4FF","align":"center","valign":"top","lineHeight":1.3,"letterSpacing":8},{"id":"t-1p","type":"text","x":340,"y":330,"w":600,"h":80,"rotation":0,"opacity":1,"html":"Anomaly scores in 90 seconds —<br>before the next ground pass.","fontSize":16,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":400,"color":"rgba(178,196,224,0.62)","align":"center","valign":"top","lineHeight":1.6},{"id":"t-1q","type":"text","x":96,"y":648,"w":700,"h":22,"rotation":0,"opacity":1,"html":"JAMES WEBB PRIMARY MIRROR · NASA/MSFC — PUBLIC DOMAIN","fontSize":9,"fontFamily":"'Space Mono', ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace","fontWeight":500,"color":"rgba(178,196,224,0.4)","align":"left","valign":"top","lineHeight":1.3,"letterSpacing":3},{"id":"s-1r","type":"shape","shape":"rect","x":0,"y":0,"w":1280,"h":720,"rotation":0,"opacity":1,"fill":"rgba(0,0,0,0)","stroke":"none","strokeWidth":0,"radius":0,"link":"orb-system"}],"name":"MODEL","stateOf":"orb-system"},{"id":"orb-growth","background":"#05060E","transition":"fade","notes":"Neon-styled area chart. Note the restraint: one gradient line on darkness reads as “expensive”; three would read as a dashboard.","elements":[{"id":"t-1s","type":"text","x":96,"y":84,"w":700,"h":22,"rotation":0,"opacity":1,"html":"03 · SIGNAL EXTRACTED, PETABYTES","fontSize":12,"fontFamily":"'Space Mono', ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace","fontWeight":500,"color":"rgba(178,196,224,0.62)","align":"left","valign":"top","lineHeight":1.3,"letterSpacing":3},{"id":"t-1t","type":"text","x":96,"y":120,"w":900,"h":90,"rotation":0,"opacity":1,"html":"Up and to the right,<br>literally.","fontSize":54,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":800,"color":"#EAF4FF","align":"left","valign":"top","lineHeight":1.1},{"id":"c-1u","type":"chart","x":96,"y":280,"w":1088,"h":370,"rotation":0,"opacity":1,"preset":"line","option":{"grid":{"left":46,"right":16,"top":20,"bottom":30},"xAxis":{"type":"category","data":["Q1","Q2","Q3","Q4","Q5","Q6"]},"yAxis":{"type":"value"},"color":["#38E1FF"],"tooltip":{"trigger":"axis"},"series":[{"type":"line","smooth":true,"data":[2,5,11,24,52,96],"lineStyle":{"width":3.5,"color":"#38E1FF"},"areaStyle":{"color":{"type":"linear","x":0,"y":0,"x2":0,"y2":1,"colorStops":[{"offset":0,"color":"rgba(56,225,255,0.35)"},{"offset":1,"color":"rgba(56,225,255,0)"}]}},"symbol":"circle","symbolSize":8,"itemStyle":{"color":"#38E1FF"}}]},"fx":{"enter":"fade-up"}}]},{"id":"orb-end","background":"#05060E","transition":"morph","notes":"The ring comes home to center; the wordmark grows back on pure void black. Loops keep breathing after the morph settles.","elements":[{"id":"orb-ring","type":"shape","shape":"ellipse","x":340,"y":60,"w":600,"h":600,"rotation":0,"opacity":1,"fill":"rgba(0,0,0,0)","stroke":"#FF4FA3","strokeWidth":2,"radius":0,"shadow":{"blur":80,"color":"rgba(255,79,163,0.4)"}},{"id":"s-1v","type":"shape","shape":"ellipse","x":620,"y":40,"w":44,"h":44,"rotation":0,"opacity":1,"fill":"#FF4FA3","stroke":"none","strokeWidth":0,"radius":0,"fillGradient":{"angle":30,"stops":[{"at":0,"color":"#7A5CFF"},{"at":1,"color":"#FF4FA3"}]},"fx":{"loop":{"type":"motion-path","path":"M0,0 L77.64571353075621,10.222252113279506 L149.99999999999994,40.192378864668385 L212.13203435596424,87.86796564403576 L259.80762113533154,150 L289.7777478867205,222.3542864692438 L299.99999999999994,300 L289.7777478867204,377.64571353075627 L259.8076211353316,449.99999999999994 L212.13203435596424,512.1320343559643 L149.99999999999994,559.8076211353316 L77.64571353075627,589.7777478867205 L0,600 L-77.64571353075614,589.7777478867205 L-150.0000000000001,559.8076211353316 L-212.13203435596427,512.1320343559643 L-259.8076211353316,450.0000000000001 L-289.77774788672053,377.64571353075615 L-300,300.00000000000006 L-289.77774788672053,222.3542864692439 L-259.8076211353316,149.99999999999997 L-212.13203435596435,87.86796564403576 L-150.00000000000017,40.192378864668456 L-77.64571353075621,10.222252113279506 L-7.347880794884119e-14,0 Z","duration":18}},"shadow":{"blur":26,"color":"rgba(255,79,163,0.8)"}},{"id":"orb-word","type":"text","x":140,"y":300,"w":1000,"h":110,"rotation":0,"opacity":1,"html":"JOIN THE SWEEP","fontSize":66,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":800,"color":"#EAF4FF","align":"center","valign":"top","lineHeight":1.3,"letterSpacing":16,"shadow":{"blur":40,"color":"rgba(255,79,163,0.3)"}},{"id":"t-1w","type":"text","x":390,"y":430,"w":700,"h":22,"rotation":0,"opacity":1,"html":"ORBITAL.EXAMPLE · GROUND STATION OPEN HOUSE FRIDAYS","fontSize":12,"fontFamily":"'Space Mono', ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace","fontWeight":500,"color":"rgba(178,196,224,0.5)","align":"left","valign":"top","lineHeight":1.3,"letterSpacing":3}]}],"modified":"2026-09-15T02:03:49.172Z"}
diff --git a/scripts/fixtures/compact-decks/signal-editorial-type.json b/scripts/fixtures/compact-decks/signal-editorial-type.json
new file mode 100644
index 00000000..e5839494
--- /dev/null
+++ b/scripts/fixtures/compact-decks/signal-editorial-type.json
@@ -0,0 +1 @@
+{"format":"bento/slides","version":1,"title":"Signal — editorial type template","size":{"width":1280,"height":720},"theme":{"background":"#EFEDE4","color":"#141310","accent":"#E8442E","fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif"},"template":true,"assets":{"font-fraunces":"data:,","font-instrument":"data:,","ph-press":"data:,","ph-press2":"data:,"},"fonts":[{"family":"Fraunces","asset":"font-fraunces","weight":"900"},{"family":"Instrument Sans","asset":"font-instrument","weight":"100 900"}],"slides":[{"id":"sig-cover","background":"#141310","transition":"none","notes":"TEMPLATE — “Signal”, an editorial-typographic deck. The cover is the poster: a full-bleed public-domain photograph under a deep ink scrim (one rect, no filters) with the masthead type reversed to bone. Slide 2 cuts back to paper. The red bar and the title share ids with slide 2 — they MORPH.","elements":[{"id":"im-1","type":"image","x":0,"y":0,"w":1280,"h":720,"rotation":0,"opacity":1,"src":"asset:ph-press","fit":"cover","radius":0,"fx":{"ambient":"kenburns","ken":{"dir":"drift","scale":1.07,"duration":24}}},{"id":"s-2","type":"shape","shape":"rect","x":0,"y":0,"w":1280,"h":720,"rotation":0,"opacity":1,"fill":"rgba(20,19,16,0.62)","stroke":"none","strokeWidth":0,"radius":0},{"id":"t-3","type":"text","x":96,"y":84,"w":500,"h":24,"rotation":0,"opacity":1,"html":"SIGNAL — A FESTIVAL OF GRAPHIC IDEAS","fontSize":13,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":700,"color":"#EFEDE4","align":"left","valign":"top","lineHeight":1.3,"letterSpacing":4},{"id":"s-4","type":"shape","shape":"rect","x":96,"y":118,"w":1088,"h":2,"rotation":0,"opacity":1,"fill":"rgba(239,237,228,0.7)","stroke":"none","strokeWidth":0,"radius":0},{"id":"sig-title","type":"text","x":86,"y":128,"w":1120,"h":330,"rotation":0,"opacity":1,"html":"Loud<br>letters.","fontSize":168,"fontFamily":"Fraunces, Georgia, serif","fontWeight":900,"color":"#EFEDE4","align":"left","valign":"top","lineHeight":0.92,"shadow":{"y":3,"blur":26,"color":"rgba(20,19,16,0.4)"}},{"id":"sig-bar","type":"shape","shape":"rect","x":96,"y":520,"w":320,"h":74,"rotation":0,"opacity":1,"fill":"#E8442E","stroke":"none","strokeWidth":0,"radius":0},{"id":"t-5","type":"text","x":442,"y":524,"w":560,"h":80,"rotation":0,"opacity":1,"html":"Three days on typography, grids,<br>and the confidence to be simple.","fontSize":19,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":400,"color":"rgba(239,237,228,0.85)","align":"left","valign":"top","lineHeight":1.5,"fx":{"enter":"fade-up","order":1}},{"id":"t-6","type":"text","x":96,"y":536,"w":320,"h":40,"rotation":0,"opacity":1,"html":"OCT 12—14","fontSize":26,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":800,"color":"#EFEDE4","align":"center","valign":"top","lineHeight":1.3,"letterSpacing":3},{"id":"t-7","type":"text","x":96,"y":640,"w":800,"h":24,"rotation":0,"opacity":1,"html":"HALL 6 · MAKETOWN · TICKETS AT THE DOOR · PHOTO: LIBRARY OF CONGRESS, 1942","fontSize":12,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":600,"color":"rgba(239,237,228,0.6)","align":"left","valign":"top","lineHeight":1.3,"letterSpacing":3},{"id":"t-8","type":"text","x":1150,"y":654,"w":80,"h":24,"rotation":0,"opacity":1,"html":"01","fontSize":13,"fontFamily":"ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace","fontWeight":600,"color":"rgba(239,237,228,0.6)","align":"right","valign":"top","lineHeight":1.3}]},{"id":"sig-manifesto","background":"#EFEDE4","transition":"morph","notes":"The morph beat: the red bar became a column, the title shrank into a corner. Duplicate-and-rearrange is the entire animation technique.","elements":[{"id":"sig-title","type":"text","x":96,"y":84,"w":500,"h":80,"rotation":0,"opacity":1,"html":"Loud letters.","fontSize":40,"fontFamily":"Fraunces, Georgia, serif","fontWeight":900,"color":"rgba(20,19,16,0.55)","align":"left","valign":"top","lineHeight":1},{"id":"sig-bar","type":"shape","shape":"rect","x":96,"y":170,"w":10,"h":450,"rotation":0,"opacity":1,"fill":"#E8442E","stroke":"none","strokeWidth":0,"radius":0},{"id":"t-9","type":"text","x":150,"y":168,"w":980,"h":380,"rotation":0,"opacity":1,"html":"We believe a poster can<br>argue, a grid can dance,<br>and <i>restraint</i> is the<br>loudest move of all.","fontSize":62,"fontFamily":"Fraunces, Georgia, serif","fontWeight":900,"color":"#141310","align":"left","valign":"top","lineHeight":1.14,"fx":{"enter":"fade-up"}},{"id":"t-a","type":"text","x":150,"y":580,"w":700,"h":30,"rotation":0,"opacity":1,"html":"— The programme committee, writing manifestos again","fontSize":15,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":400,"color":"rgba(20,19,16,0.55)","align":"left","valign":"top","lineHeight":1.3,"fx":{"enter":"fade-up","order":2}},{"id":"t-b","type":"text","x":1150,"y":654,"w":80,"h":24,"rotation":0,"opacity":1,"html":"02","fontSize":13,"fontFamily":"ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace","fontWeight":600,"color":"rgba(20,19,16,0.55)","align":"right","valign":"top","lineHeight":1.3}]},{"id":"sig-speakers","background":"#141310","transition":"fade","notes":"Inverted spread. The huge index letters are the “image”. Stagger order walks the three rows in.","elements":[{"id":"t-c","type":"text","x":96,"y":84,"w":500,"h":24,"rotation":0,"opacity":1,"html":"THE SPEAKERS","fontSize":13,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":700,"color":"#E8442E","align":"left","valign":"top","lineHeight":1.3,"letterSpacing":4},{"id":"s-d","type":"shape","shape":"rect","x":96,"y":118,"w":1088,"h":2,"rotation":0,"opacity":1,"fill":"rgba(239,237,228,0.25)","stroke":"none","strokeWidth":0,"radius":0},{"id":"t-e","type":"text","x":80,"y":130,"w":220,"h":180,"rotation":0,"opacity":1,"html":"A","fontSize":150,"fontFamily":"Fraunces, Georgia, serif","fontWeight":900,"color":"rgba(239,237,228,0.13)","align":"left","valign":"top","lineHeight":1.3,"fx":{"enter":"fade-up","order":0}},{"id":"t-f","type":"text","x":270,"y":176,"w":500,"h":60,"rotation":0,"opacity":1,"html":"Ada Kessler","fontSize":40,"fontFamily":"Fraunces, Georgia, serif","fontWeight":900,"color":"#EFEDE4","align":"left","valign":"top","lineHeight":1.3,"fx":{"enter":"fade-up","order":0}},{"id":"t-g","type":"text","x":800,"y":190,"w":384,"h":40,"rotation":0,"opacity":1,"html":"GRIDS THAT MISBEHAVE","fontSize":14,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":600,"color":"#E8442E","align":"right","valign":"top","lineHeight":1.3,"letterSpacing":3,"fx":{"enter":"fade-up","order":0}},{"id":"s-h","type":"shape","shape":"rect","x":270,"y":268,"w":914,"h":1,"rotation":0,"opacity":1,"fill":"rgba(239,237,228,0.18)","stroke":"none","strokeWidth":0,"radius":0},{"id":"t-i","type":"text","x":80,"y":295,"w":220,"h":180,"rotation":0,"opacity":1,"html":"B","fontSize":150,"fontFamily":"Fraunces, Georgia, serif","fontWeight":900,"color":"rgba(239,237,228,0.13)","align":"left","valign":"top","lineHeight":1.3,"fx":{"enter":"fade-up","order":1}},{"id":"t-j","type":"text","x":270,"y":341,"w":500,"h":60,"rotation":0,"opacity":1,"html":"Bruno Mächler","fontSize":40,"fontFamily":"Fraunces, Georgia, serif","fontWeight":900,"color":"#EFEDE4","align":"left","valign":"top","lineHeight":1.3,"fx":{"enter":"fade-up","order":1}},{"id":"t-k","type":"text","x":800,"y":355,"w":384,"h":40,"rotation":0,"opacity":1,"html":"THE END OF THE HERO IMAGE","fontSize":14,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":600,"color":"#E8442E","align":"right","valign":"top","lineHeight":1.3,"letterSpacing":3,"fx":{"enter":"fade-up","order":1}},{"id":"s-l","type":"shape","shape":"rect","x":270,"y":433,"w":914,"h":1,"rotation":0,"opacity":1,"fill":"rgba(239,237,228,0.18)","stroke":"none","strokeWidth":0,"radius":0},{"id":"t-m","type":"text","x":80,"y":460,"w":220,"h":180,"rotation":0,"opacity":1,"html":"C","fontSize":150,"fontFamily":"Fraunces, Georgia, serif","fontWeight":900,"color":"rgba(239,237,228,0.13)","align":"left","valign":"top","lineHeight":1.3,"fx":{"enter":"fade-up","order":2}},{"id":"t-n","type":"text","x":270,"y":506,"w":500,"h":60,"rotation":0,"opacity":1,"html":"Chiyo Tanaka","fontSize":40,"fontFamily":"Fraunces, Georgia, serif","fontWeight":900,"color":"#EFEDE4","align":"left","valign":"top","lineHeight":1.3,"fx":{"enter":"fade-up","order":2}},{"id":"t-o","type":"text","x":800,"y":520,"w":384,"h":40,"rotation":0,"opacity":1,"html":"SERIFS, SHARPENED","fontSize":14,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":600,"color":"#E8442E","align":"right","valign":"top","lineHeight":1.3,"letterSpacing":3,"fx":{"enter":"fade-up","order":2}},{"id":"s-p","type":"shape","shape":"rect","x":270,"y":598,"w":914,"h":1,"rotation":0,"opacity":1,"fill":"rgba(239,237,228,0.18)","stroke":"none","strokeWidth":0,"radius":0},{"id":"t-q","type":"text","x":1150,"y":654,"w":80,"h":24,"rotation":0,"opacity":1,"html":"03","fontSize":13,"fontFamily":"ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace","fontWeight":600,"color":"rgba(20,19,16,0.55)","align":"right","valign":"top","lineHeight":1.3}]},{"id":"sig-floor","background":"#141310","transition":"fade","notes":"The photo essay beat. A full-bleed public-domain photograph (Marjory Collins, New York Times pressroom, 1942 — Library of Congress) with a slow ken-burns drift, an ink scrim, and one serif line. A DIFFERENT frame from the cover shot on purpose — the cover sets the type, this beat prints it. Swap the photo, keep the recipe: image → scrim → words.","elements":[{"id":"im-r","type":"image","x":0,"y":0,"w":1280,"h":720,"rotation":0,"opacity":1,"src":"asset:ph-press2","fit":"cover","radius":0,"fx":{"ambient":"kenburns","ken":{"dir":"drift","scale":1.09,"duration":22}}},{"id":"s-s","type":"shape","shape":"rect","x":0,"y":0,"w":1280,"h":720,"rotation":0,"opacity":1,"fill":"rgba(15,14,11,0.58)","stroke":"none","strokeWidth":0,"radius":0},{"id":"s-t","type":"shape","shape":"rect","x":0,"y":430,"w":1280,"h":290,"rotation":0,"opacity":1,"fill":"rgba(15,14,11,0.4)","stroke":"none","strokeWidth":0,"radius":0,"fillGradient":{"angle":180,"stops":[{"at":0,"color":"rgba(15,14,11,0)"},{"at":1,"color":"rgba(15,14,11,0.85)"}]}},{"id":"t-u","type":"text","x":96,"y":96,"w":500,"h":24,"rotation":0,"opacity":1,"html":"THE FLOOR","fontSize":13,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":700,"color":"#E8442E","align":"left","valign":"top","lineHeight":1.3,"letterSpacing":4},{"id":"s-v","type":"shape","shape":"rect","x":96,"y":130,"w":220,"h":2,"rotation":0,"opacity":1,"fill":"#E8442E","stroke":"none","strokeWidth":0,"radius":0},{"id":"t-w","type":"text","x":90,"y":420,"w":1000,"h":220,"rotation":0,"opacity":1,"html":"Set by hand,<br>read by thousands.","fontSize":76,"fontFamily":"Fraunces, Georgia, serif","fontWeight":900,"color":"#EFEDE4","align":"left","valign":"top","lineHeight":1.02,"fx":{"enter":"fade-up"}},{"id":"t-x","type":"text","x":96,"y":640,"w":900,"h":24,"rotation":0,"opacity":1,"html":"NEW YORK TIMES PRESSROOM, 1942 · LIBRARY OF CONGRESS — PUBLIC DOMAIN","fontSize":10,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":600,"color":"rgba(239,237,228,0.55)","align":"left","valign":"top","lineHeight":1.3,"letterSpacing":3,"fx":{"enter":"fade-up","order":2}},{"id":"t-y","type":"text","x":1150,"y":654,"w":80,"h":24,"rotation":0,"opacity":1,"html":"04","fontSize":13,"fontFamily":"ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace","fontWeight":600,"color":"rgba(239,237,228,0.6)","align":"right","valign":"top","lineHeight":1.3}]},{"id":"sig-schedule","background":"#EFEDE4","transition":"fade","notes":"A dead-simple bar chart, art-directed: ink bars, one red. Charts are template JSON — swap the numbers.","elements":[{"id":"t-z","type":"text","x":96,"y":84,"w":500,"h":24,"rotation":0,"opacity":1,"html":"ATTENDANCE, FIVE EDITIONS","fontSize":13,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":700,"color":"#E8442E","align":"left","valign":"top","lineHeight":1.3,"letterSpacing":4},{"id":"s-10","type":"shape","shape":"rect","x":96,"y":118,"w":1088,"h":2,"rotation":0,"opacity":1,"fill":"#141310","stroke":"none","strokeWidth":0,"radius":0},{"id":"t-11","type":"text","x":96,"y":148,"w":900,"h":80,"rotation":0,"opacity":1,"html":"Word travels.","fontSize":64,"fontFamily":"Fraunces, Georgia, serif","fontWeight":900,"color":"#141310","align":"left","valign":"top","lineHeight":1.3},{"id":"c-12","type":"chart","x":96,"y":260,"w":1088,"h":380,"rotation":0,"opacity":1,"preset":"bar","option":{"grid":{"left":40,"right":10,"top":20,"bottom":30},"xAxis":{"type":"category","data":["2022","2023","2024","2025","2026"]},"yAxis":{"type":"value"},"series":[{"type":"bar","data":[420,780,1300,2450,4100],"itemStyle":{"color":"#141310"},"barWidth":90}],"color":["#141310"],"tooltip":{"trigger":"item","formatter":"{b}: {c} people"}},"fx":{"enter":"fade-up","order":1}},{"id":"s-13","type":"shape","shape":"rect","x":996,"y":300,"w":90,"h":24,"rotation":0,"opacity":1,"fill":"#E8442E","stroke":"none","strokeWidth":0,"radius":0,"fx":{"enter":"fade","order":3}},{"id":"t-14","type":"text","x":940,"y":268,"w":200,"h":30,"rotation":0,"opacity":1,"html":"<b>SOLD OUT</b>","fontSize":13,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":400,"color":"#E8442E","align":"center","valign":"top","lineHeight":1.3,"letterSpacing":3,"fx":{"enter":"fade","order":3}},{"id":"t-15","type":"text","x":1150,"y":654,"w":80,"h":24,"rotation":0,"opacity":1,"html":"05","fontSize":13,"fontFamily":"ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace","fontWeight":600,"color":"rgba(20,19,16,0.55)","align":"right","valign":"top","lineHeight":1.3}]},{"id":"sig-marquee","background":"#E8442E","transition":"zoom","notes":"The shout slide. Dash-march on the two rules makes the page feel like it is sliding. One background change resets the room.","elements":[{"id":"s-16","type":"shape","shape":"line","x":0,"y":140,"w":1280,"h":4,"rotation":0,"opacity":1,"fill":"#EFEDE4","stroke":"none","strokeWidth":3,"radius":0,"strokeStyle":"dashed","fx":{"loop":{"type":"dash-march","distance":60,"duration":2.4}}},{"id":"t-17","type":"text","x":40,"y":210,"w":1200,"h":300,"rotation":0,"opacity":1,"html":"SAY IT<br>BIGGER.","fontSize":150,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":900,"color":"#EFEDE4","align":"center","valign":"top","lineHeight":0.95,"letterSpacing":2},{"id":"s-18","type":"shape","shape":"line","x":0,"y":566,"w":1280,"h":4,"rotation":0,"opacity":1,"fill":"#EFEDE4","stroke":"none","strokeWidth":3,"radius":0,"strokeStyle":"dashed","fx":{"loop":{"type":"dash-march","distance":60,"duration":2.4}}},{"id":"t-19","type":"text","x":40,"y":600,"w":1200,"h":30,"rotation":0,"opacity":1,"html":"WORKSHOP TRACK · 40 SEATS · BRING SCISSORS","fontSize":13,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":700,"color":"rgba(239,237,228,0.8)","align":"center","valign":"top","lineHeight":1.3,"letterSpacing":5}]},{"id":"sig-end","background":"#EFEDE4","transition":"morph","notes":"Close where you opened — the bar and title morph home. End on the practical line.","elements":[{"id":"t-1a","type":"text","x":96,"y":84,"w":500,"h":24,"rotation":0,"opacity":1,"html":"SIGNAL — OCT 12—14","fontSize":13,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":700,"color":"#E8442E","align":"left","valign":"top","lineHeight":1.3,"letterSpacing":4},{"id":"s-1b","type":"shape","shape":"rect","x":96,"y":118,"w":1088,"h":2,"rotation":0,"opacity":1,"fill":"#141310","stroke":"none","strokeWidth":0,"radius":0},{"id":"sig-title","type":"text","x":86,"y":150,"w":1120,"h":300,"rotation":0,"opacity":1,"html":"See you<br>in Hall 6.","fontSize":132,"fontFamily":"Fraunces, Georgia, serif","fontWeight":900,"color":"#141310","align":"left","valign":"top","lineHeight":0.95},{"id":"sig-bar","type":"shape","shape":"rect","x":96,"y":520,"w":1088,"h":74,"rotation":0,"opacity":1,"fill":"#E8442E","stroke":"none","strokeWidth":0,"radius":0},{"id":"t-1c","type":"text","x":96,"y":540,"w":1088,"h":40,"rotation":0,"opacity":1,"html":"signal-festival.example — a fictional event for a very real template","fontSize":16,"fontFamily":"'Instrument Sans', 'Helvetica Neue', sans-serif","fontWeight":600,"color":"#EFEDE4","align":"center","valign":"top","lineHeight":1.3,"letterSpacing":1},{"id":"t-1d","type":"text","x":1150,"y":654,"w":80,"h":24,"rotation":0,"opacity":1,"html":"07","fontSize":13,"fontFamily":"ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace","fontWeight":600,"color":"rgba(20,19,16,0.55)","align":"right","valign":"top","lineHeight":1.3}]}],"modified":"2026-09-15T02:03:49.153Z"}
diff --git a/scripts/test-slides-compact.ts b/scripts/test-slides-compact.ts
new file mode 100644
index 00000000..de6211f4
--- /dev/null
+++ b/scripts/test-slides-compact.ts
@@ -0,0 +1,195 @@
+#!/usr/bin/env node
+// SPDX-License-Identifier: MIT
+// Copyright (c) 2026 The Bento authors
+// The compact document (#422 / #411): defaults omitted, expanded on load.
+//
+// node scripts/test-slides-compact.ts
+//
+// WHAT THIS PROVES. compactDoc and expandDoc are inverses on real decks: the
+// starter deck and every gallery deck round-trip to a deep-equal document
+// (canonical JSON byte-identical — key ORDER is the one thing a round-trip
+// may change, and nothing reads key order). A minimal compact deck expands
+// to what the editor's own insert helpers produce, field for field — the
+// defaults come from those helpers, not a second table. Nested arrays
+// flatten; missing ids are minted deterministically; theme-derived defaults
+// follow the theme; compactDoc never strips a value that differs from its
+// default; the flag is explicit; and the gated loader runs sanitizeSlide on
+// the expanded document. Also the measured numbers: the starter deck's
+// compact form is under 90% of the full one (11–14% saved on designed decks
+// that override most defaults), and an agent deck written the compact way
+// expands to more than 2.5× its bytes — the case the feature is for.
+
+import { readFileSync, readdirSync } from 'node:fs'
+import { fileURLToPath } from 'node:url'
+import { dirname, join } from 'node:path'
+import { compactDoc, expandDoc, isCompact, compactJson, COMPACT_FLAG } from '../slides/src/compact.ts'
+import { starterDoc } from '../slides/src/starterdeck.ts'
+import { defaultText, defaultShape, defaultTable, defaultCode, readableInk, FONT_STACK, newDoc, isLightBg, type BentoDoc, type TextElement, type ShapeElement, type TableElement } from '../slides/src/model.ts'
+
+let failures = 0
+let checks = 0
+function ok(cond: boolean, msg: string) {
+ checks++
+ if (!cond) { failures++; console.log(` FAIL ${msg}`) }
+ else console.log(` ok ${msg}`)
+}
+const root = join(dirname(fileURLToPath(import.meta.url)), '..')
+const read = (f: string) => readFileSync(join(root, f), 'utf8')
+type Obj = Record<string, unknown>
+const canon = (v: unknown): string => JSON.stringify(v, (_k, x) => (x && typeof x === 'object' && !Array.isArray(x)) ? Object.fromEntries(Object.keys(x).sort().map((k) => [k, (x as Obj)[k]])) : x)
+
+console.log('round-trip on real decks\n')
+const decks: Array<[string, BentoDoc]> = [['starter deck', starterDoc()]]
+// Two gallery decks as checked-in fixtures (their doc JSON with photo/font
+// payloads replaced by `data:,` — the rig measures structure, not bytes).
+// Regenerated by hand from build-example-decks.mjs output (doc JSON, payloads
+// blanked); a rig carries what it measures, never a path from one machine's
+// environment.
+const fixturesDir = join(root, 'scripts/fixtures/compact-decks')
+for (const f of readdirSync(fixturesDir).filter((f) => f.endsWith('.json')).sort()) {
+ decks.push([f, JSON.parse(readFileSync(join(fixturesDir, f), 'utf8'))])
+}
+// "Never loses or changes a value": every field of d is in the round-trip with
+// the same value. A deck the EDITOR wrote is byte-identical (every default is
+// present, so nothing is added back that was not there). A deck a SCRIPT wrote
+// may omit optional fields (a media element with no `autoplay`); expansion
+// fills those with the editor's insert defaults, so the round-trip can be a
+// superset — the additions are listed and must all be editor defaults, which
+// is the compact form's one promise: absent means "what the editor inserts".
+const subsetDiff = (from: unknown, to: unknown, path = ''): { changed: string[]; added: string[] } => {
+ const out = { changed: [] as string[], added: [] as string[] }
+ if (Array.isArray(from)) {
+ if (!Array.isArray(to) || to.length !== from.length) { out.changed.push(path); return out }
+ from.forEach((v, i) => { const d = subsetDiff(v, to[i], `${path}[${i}]`); out.changed.push(...d.changed); out.added.push(...d.added) })
+ return out
+ }
+ if (from && typeof from === 'object') {
+ if (!to || typeof to !== 'object') { out.changed.push(path); return out }
+ for (const k of Object.keys(from as Obj)) { const d = subsetDiff((from as Obj)[k], (to as Obj)[k], `${path}.${k}`); out.changed.push(...d.changed); out.added.push(...d.added) }
+ for (const k of Object.keys(to as Obj)) if (!(k in (from as Obj))) out.added.push(`${path}.${k}`)
+ return out
+ }
+ if (from !== to) out.changed.push(path)
+ return out
+}
+for (const [name, doc] of decks) {
+ const c = compactDoc(doc)
+ const back = expandDoc(c)
+ const d = subsetDiff(doc, back)
+ ok(d.changed.length === 0, `${name}: no value is lost or changed by the round-trip${d.changed.length ? ` (${d.changed.slice(0, 3).join(', ')})` : ''}`)
+ const addedKeys = [...new Set(d.added.map((p) => p.replace(/^.*\./, '')))]
+ if (name === 'starter deck') ok(canon(back) === canon(doc), 'the starter deck (editor-shaped: every default present) round-trips canonical-JSON byte-identical')
+ else ok(addedKeys.every((k) => ['radius', 'fit', 'autoplay', 'loop', 'muted', 'controls', 'preset', 'rotation', 'opacity', 'fontFamily', 'fontWeight', 'lineHeight', 'align', 'valign', 'stroke', 'strokeWidth', 'header', 'notes', 'transition', 'background', 'style', 'color', 'fontSize'].includes(k)), `${name}: the only additions are editor insert defaults the script left out (${addedKeys.join(', ') || 'none'})`)
+ ok(!(COMPACT_FLAG in (back as unknown as Obj)), `${name}: the flag does not survive expansion`)
+ ok(JSON.stringify(c).length < JSON.stringify(doc).length, `${name}: the compact form is smaller`)
+}
+ok(decks.length === 3, `the starter deck and the two gallery fixtures were measured (${decks.length})`)
+
+console.log('\nexpansion matches the editor\'s inserts\n')
+const compact = {
+ compact: true, title: 'Agent deck',
+ slides: [
+ { id: 'a', elements: [
+ { id: 't1', type: 'text', x: 96, y: 80, w: 1000, h: 80, html: 'Hello', fontSize: 48 },
+ { id: 's1', type: 'shape', shape: 'ellipse', x: 100, y: 200, w: 200, h: 200 },
+ { id: 'tb', type: 'table', x: 100, y: 400, w: 800, h: 200, columns: [{ w: 1 }], rows: [{ cells: [{ html: 'x' }] }] },
+ ] },
+ { id: 'b', background: '#101820', elements: [
+ { id: 't2', type: 'text', x: 96, y: 80, w: 1000, h: 80, html: 'Dark' },
+ { id: 'c2', type: 'code', x: 96, y: 200, w: 800, h: 300, content: 'x' },
+ { id: 'tb2', type: 'table', x: 100, y: 400, w: 800, h: 200, columns: [{ w: 1 }], rows: [{ cells: [{ html: 'x' }] }] },
+ ] },
+ ],
+}
+const ex = expandDoc(JSON.parse(JSON.stringify(compact)))
+const el = (si: number, id: string) => ex.slides[si].elements.find((e) => e.id === id) as unknown as Obj
+const t1 = el(0, 't1') as unknown as TextElement
+const want = defaultText({ id: 't1', x: 96, y: 80, w: 1000, h: 80, html: 'Hello', fontSize: 48, color: readableInk(ex.slides[0].background) })
+ok(canon(t1) === canon(want), 'a light-slide text box equals defaultText(...) with readableInk of the slide background — the editor\'s own insert')
+ok(t1.fontFamily === FONT_STACK && t1.fontWeight === 400 && t1.align === 'center' && t1.valign === 'middle' && t1.lineHeight === 1.25 && t1.rotation === 0 && t1.opacity === 1, 'rotation, opacity, font stack, weight, align, valign, line height filled')
+const s1 = el(0, 's1') as unknown as ShapeElement
+ok(canon(s1) === canon(defaultShape('ellipse', { id: 's1', x: 100, y: 200, w: 200, h: 200 })), 'an ellipse equals defaultShape(\'ellipse\', …) — radius 0, not the rect\'s 12')
+const t2 = el(1, 't2') as unknown as TextElement
+ok(t2.color === readableInk('#101820') && t2.color === '#F5F7FA', 'text on a dark slide gets light ink, as the editor gives it')
+const c2 = el(1, 'c2')
+ok(canon(c2) === canon(defaultCode({ id: 'c2', x: 96, y: 200, w: 800, h: 300, content: 'x', color: readableInk('#101820') })), 'a code block equals defaultCode(...) with the slide\'s ink')
+const tb = el(0, 'tb') as unknown as TableElement
+ok(canon(tb.style) === canon(defaultTable({}, ex.theme).style), 'a table on a light slide carries tableStyleFor(theme)')
+const tb2 = el(1, 'tb2') as unknown as TableElement
+ok(tb2.style.color === '#F5F7FA' && tb2.style.zebra === 'rgba(255,255,255,0.06)' && tb2.style.borderColor === 'rgba(255,255,255,0.16)', 'a table on a dark slide gets editor.newTable()\'s dark adaptation')
+ok(ex.slides[0].background === newDoc().theme.background && ex.slides[0].transition === 'fade' && ex.slides[0].notes === '', 'slide background follows the theme; transition fade; notes empty')
+ok(ex.format === 'bento/slides' && ex.version === 1 && ex.size.width === 1280 && canon(ex.theme) === canon(newDoc().theme), 'format, version, size and theme filled from newDoc()')
+ok(ex.title === 'Agent deck', 'an authored field is kept as written')
+
+console.log('\nnested arrays, ids, the flag\n')
+const nested = expandDoc({ compact: true, slides: [{ id: 'x', elements: [
+ { type: 'text', x: 0, y: 0, w: 1, h: 1, html: 'a' },
+ [ { type: 'shape', shape: 'rect', x: 0, y: 0, w: 1, h: 1 }, { type: 'text', x: 0, y: 0, w: 1, h: 1, html: 'b' } ],
+ { id: 'mine', type: 'text', x: 0, y: 0, w: 1, h: 1, html: 'c' },
+] }] })
+ok(nested.slides[0].elements.length === 4, 'a nested array of elements is flattened into the slide (the POC\'s BentoElement | BentoElement[])')
+ok(nested.slides[0].elements.map((e) => e.id).join(' ') === 'x-text-0 x-shape-1 x-text-2 mine', 'missing ids mint as ${slideId}-${type}-${index}; an authored id is kept')
+const again = expandDoc({ compact: true, slides: [{ id: 'x', elements: [ { type: 'text', x: 0, y: 0, w: 1, h: 1, html: 'a' }, [ { type: 'shape', shape: 'rect', x: 0, y: 0, w: 1, h: 1 }, { type: 'text', x: 0, y: 0, w: 1, h: 1, html: 'b' } ], { id: 'mine', type: 'text', x: 0, y: 0, w: 1, h: 1, html: 'c' } ] }] })
+ok(canon(again) === canon(nested), 'the same input expands to the same ids — deterministic, so a re-run keeps morph pairing')
+ok(new Set(nested.slides[0].elements.map((e) => e.id)).size === 4, 'minted ids are unique on the slide')
+const noSlideId = expandDoc({ compact: true, slides: [{ elements: [{ type: 'text', x: 0, y: 0, w: 1, h: 1, html: 'a' }] }, {}] })
+ok(noSlideId.slides[0].id === 's1' && noSlideId.slides[1].id === 's2' && noSlideId.slides[0].elements[0].id === 's1-text-0', 'a slide without an id gets s1, s2 …; its elements mint from that')
+const backCompact = compactDoc(nested)
+ok(!('id' in ((backCompact.slides as Obj[])[0].elements as Obj[])[0]) && ((backCompact.slides as Obj[])[0].elements as Obj[])[3].id === 'mine', 'compactDoc drops an id that equals the mint scheme and keeps an authored one')
+const full = starterDoc()
+ok(canon(expandDoc(full)) === canon(full) && !isCompact(full), 'a document WITHOUT the flag is returned as is — a full file missing an optional field keeps its meaning (no fontFamily = theme font, not the stack)')
+ok(isCompact({ compact: true }) && !isCompact({ compact: 'yes' }) && !isCompact(null), 'the flag is exactly `compact: true`')
+
+console.log('\nnothing non-default is stripped\n')
+const mutated = starterDoc()
+const firstText = mutated.slides[0].elements.find((e) => e.type === 'text') as TextElement
+firstText.rotation = 5; firstText.opacity = 0.5; firstText.lineHeight = 1.7
+const mc = compactDoc(mutated)
+const mEl = ((mc.slides as Obj[])[0].elements as Obj[]).find((e) => e.id === firstText.id)!
+ok(mEl.rotation === 5 && mEl.opacity === 0.5 && mEl.lineHeight === 1.7, 'rotation 5, opacity 0.5, lineHeight 1.7 survive compaction')
+const geom = ((mc.slides as Obj[])[0].elements as Obj[]).every((e) => 'x' in e && 'y' in e && 'w' in e && 'h' in e && 'type' in e)
+ok(geom, 'x, y, w, h and type are always kept — geometry is never a default')
+ok(((mc.slides as Obj[])[0].elements as Obj[]).every((e) => e.type !== 'text' || 'html' in e), 'html is always kept on text')
+
+console.log('\nthe gated loader and the surfaces\n')
+const loader = read('slides/src/compactload.ts')
+ok(/import \{ sanitizeSlide \} from '\.\/untrusted'/.test(loader) && /map\(sanitizeSlide\)/.test(loader) && /return parseDoc\(JSON\.stringify\(expanded\)\)/.test(loader), 'compactload.ts expands, runs sanitizeSlide on every slide, then parseDoc — the gate is the single point of validation')
+ok(/if \(!isCompact\(raw\)\) return parseDoc\(json\)/.test(loader), 'a full document takes the plain parseDoc path, as today')
+const main = read('slides/src/main.ts')
+ok(/const next = parseDocInput\(json\)/.test(main) && /compact: \(\) => compactJson\(store\.doc\)/.test(main), 'window.bento.loadDoc accepts compact input and window.bento.compact() emits it')
+ok(/return serializeFile\(store\.doc\)/.test(main), 'window.bento.serialize() is unchanged — the file is full')
+const editor = read('slides/src/editor/editor.ts')
+ok(/const next = parseDocInput\(ta\.value\)/.test(editor), 'Replace from JSON… accepts compact input')
+ok(/t\('Copy compact JSON \(for agents\)'\)/.test(editor) && /this\.copyDocJson\(true\)/.test(editor) && /compact \? compactJson\(clone\)/.test(editor), 'the Save menu has Copy compact JSON, wired to compactJson')
+ok(!/compact/i.test(read('slides/src/save.ts')) && !/compactDoc|compactJson/.test(read('slides/src/model.ts')), 'save.ts and model.ts know nothing of compaction — the on-disk file cannot be compact')
+ok(!/compact/.test(read('slides/src/modelkeys.generated.ts')), 'no model key named compact — the flag is input, never stored')
+ok(/compact/.test(read('AGENTS.md')), 'AGENTS.md tells agents about the compact form')
+
+console.log('\nwhat the editor dereferences on first render\n')
+{
+ // parseDoc checks only format and a non-empty slides array; render.ts reads
+ // doc.size.width/height for every thumbnail and doc.theme.fontFamily for
+ // every text box, the About dialog reads doc.title. A compact deck that
+ // leaves them out (or writes null) must still arrive whole (found by the
+ // bento-check build: a doc without size threw in rebuildSidebar).
+ const dEq = (a: unknown, b: unknown) => JSON.stringify(a) === JSON.stringify(b)
+ const bare = expandDoc({ compact: true, slides: [{ elements: [{ type: 'text', x: 0, y: 0, w: 100, h: 20, html: 'x' }] }] }) as unknown as Obj
+ ok(dEq(bare.size, { width: 1280, height: 720 }), 'a compact deck without size gets the model default 1280×720')
+ ok(bare.format === 'bento/slides' && typeof bare.version === 'number' && typeof bare.title === 'string' && typeof (bare.theme as Obj).fontFamily === 'string', 'format, version, title and theme.fontFamily are present from newDoc()')
+ const nulls = expandDoc({ compact: true, size: null, theme: null, title: 7, format: 'nope', version: 'x', slides: [] }) as unknown as Obj
+ ok(dEq(nulls.size, { width: 1280, height: 720 }) && typeof (nulls.theme as Obj).fontFamily === 'string' && typeof nulls.title === 'string' && nulls.format === 'bento/slides' && nulls.version === 1, 'null or wrong-shaped size/theme/title/format/version are replaced by the defaults, not passed through')
+ const halfSize = expandDoc({ compact: true, size: { width: 1600 }, slides: [] }) as unknown as Obj
+ ok(dEq(halfSize.size, { width: 1280, height: 720 }), 'a size missing its height is replaced whole')
+ ok(dEq((expandDoc({ compact: true, size: { width: 1600, height: 900 }, slides: [] }) as unknown as Obj).size, { width: 1600, height: 900 }), 'a well-formed size is kept')
+ const nullFont = expandDoc({ compact: true, theme: { fontFamily: null, accent: '#123456' }, slides: [] }) as unknown as Obj
+ ok(typeof (nullFont.theme as Obj).fontFamily === 'string' && (nullFont.theme as Obj).accent === '#123456', 'a null theme slot falls back; a set one is kept')
+}
+
+console.log('\nthe numbers\n')
+const sj = JSON.stringify(starterDoc()), sc = compactJson(starterDoc())
+ok(sc.length / sj.length < 0.9, `the starter deck compacts to ${(sc.length / sj.length * 100).toFixed(1)}% of full (a designed deck overrides most defaults; measured 86.1%)`)
+const agentCompact = JSON.stringify(compact), agentFull = JSON.stringify(ex)
+ok(agentFull.length / agentCompact.length > 2.5, `an agent deck written compact is ${(agentFull.length / agentCompact.length).toFixed(1)}× smaller than its expansion`)
+
+console.log(`\n${checks - failures}/${checks} checks passed`)
+process.exit(failures ? 1 : 0)
diff --git a/slides/src/compact.ts b/slides/src/compact.ts
new file mode 100644
index 00000000..d9a0ffa8
--- /dev/null
+++ b/slides/src/compact.ts
@@ -0,0 +1,222 @@
+// SPDX-License-Identifier: MIT
+// Copyright (c) 2026 The Bento authors
+/**
+ * The compact document — an authoring shape for agents (issue #422,
+ * discussion #411 by benedictjohannes, whose bentoUtils.ts POC is the idea
+ * this follows).
+ *
+ * A full bento/slides element carries a dozen fields no author chose:
+ * rotation 0, opacity 1, the font stack, weight 400, centre/middle, line
+ * height 1.25 … An agent writing a hundred-element deck spends most of its
+ * output on that boilerplate. The compact form is the same document with
+ * every field that equals what the editor would have inserted LEFT OUT, and
+ * three conveniences on top:
+ *
+ * - `"compact": true` at the top level says "expand me". Without it a
+ * document is taken as full, exactly as today — so a full file that
+ * happens to lack an optional field keeps its meaning (a text box with
+ * no `fontFamily` renders in the THEME font; the expanded default is the
+ * editor's font stack, and those are not the same thing).
+ * - `elements` may nest arrays: `[title, [cardBg, cardTitle, cardBody]]`.
+ * A factory helper that returns a group is the natural way to write a
+ * card, and flattening it here means the helper needs no spread at the
+ * call site (the POC's `BentoElement | BentoElement[]`).
+ * - `id` may be omitted. A missing id is minted DETERMINISTICALLY as
+ * `${slideId}-${type}-${n}` (n = the element's index on that slide), so
+ * re-running the same generator yields the same ids, morph pairing across
+ * slides still works when the author repeats an id on purpose, and a
+ * round-trip through the editor never changes an id it did not mint.
+ *
+ * Defaults come from the SAME functions model.ts's editor paths use
+ * (defaultText, defaultShape, …), never a second table — a second table is
+ * what drifts. Where the editor derives a value from the deck (text colour
+ * from the slide background via readableInk, a table's style from the theme,
+ * a slide's background from the theme), expansion consults the same thing.
+ *
+ * Contract: `expandDoc(compactDoc(d))` deep-equals `d` for every valid full
+ * document (scripts/test-slides-compact.ts holds the starter deck and the
+ * gallery decks to it), and `compactDoc` never removes a field whose value
+ * differs from the default. The FILE on disk is always full: nothing here
+ * touches save, so no shipped shell ever meets a compact document.
+ */
+
+import {
+ FORMAT, FORMAT_VERSION, FONT_STACK,
+ defaultText, defaultShape, defaultImage, defaultChart, defaultCode, defaultTable, defaultMedia,
+ readableInk, isLightBg, newDoc,
+ type BentoDoc, type Slide, type SlideElement, type ShapeKind,
+} from './model.ts'
+
+/** Marker on a compact document. Consumed by expandDoc; never stored. */
+export const COMPACT_FLAG = 'compact'
+
+type Obj = Record<string, unknown>
+const isObj = (v: unknown): v is Obj => !!v && typeof v === 'object' && !Array.isArray(v)
+
+const deepEqual = (a: unknown, b: unknown): boolean => {
+ if (a === b) return true
+ if (typeof a !== typeof b || a === null || b === null || typeof a !== 'object') return false
+ if (Array.isArray(a) !== Array.isArray(b)) return false
+ if (Array.isArray(a)) return a.length === (b as unknown[]).length && a.every((v, i) => deepEqual(v, (b as unknown[])[i]))
+ const ka = Object.keys(a as Obj), kb = Object.keys(b as Obj)
+ return ka.length === kb.length && ka.every((k) => deepEqual((a as Obj)[k], (b as Obj)[k]))
+}
+
+/**
+ * What the editor would insert for this element type on this slide, with the
+ * author's fields laid over it. `x y w h` and the type's required content are
+ * never defaulted here in a way an author would keep — the defaults' geometry
+ * is a fixed spot on the canvas, so compactDoc keeps geometry always.
+ */
+function elementDefaults(el: Obj, slide: Obj, doc: Obj): Obj | null {
+ const theme = (doc.theme ?? {}) as BentoDoc['theme']
+ const bg = typeof slide.background === 'string' ? slide.background : (theme?.background ?? '#FFFFFF')
+ const ink = readableInk(bg)
+ switch (el.type) {
+ case 'text': return defaultText({ id: '', html: '', color: ink }) as unknown as Obj
+ case 'shape': return defaultShape((el.shape as ShapeKind) ?? 'rect', { id: '' }) as unknown as Obj
+ case 'image': return defaultImage('', { id: '' }) as unknown as Obj
+ case 'chart': return defaultChart({}, { id: '' }) as unknown as Obj
+ case 'code': return defaultCode({ id: '', content: '', color: ink }) as unknown as Obj
+ case 'table': {
+ // editor.newTable(): themed style, adapted for a dark slide
+ const tbl = defaultTable({ id: '' }, theme) as unknown as Obj
+ if (!isLightBg(bg)) {
+ const style = { ...(tbl.style as Obj) }
+ style.color = ink
+ style.zebra = 'rgba(255,255,255,0.06)'
+ style.borderColor = 'rgba(255,255,255,0.16)'
+ tbl.style = style
+ }
+ return tbl
+ }
+ case 'media': return defaultMedia((el.kind as 'video' | 'audio') ?? 'video', '', { id: '' }) as unknown as Obj
+ default: return null // svg, embed: no insert helper, nothing to default
+ }
+}
+
+/** Keys compactDoc never strips even when equal to the default: identity,
+ * geometry and the type's own content. Absent = the element is unplaced. */
+const KEEP = new Set(['id', 'type', 'x', 'y', 'w', 'h', 'html', 'shape', 'kind', 'src', 'option', 'content', 'columns', 'rows'])
+
+function slideDefaults(doc: Obj): Obj {
+ const theme = (doc.theme ?? {}) as { background?: string }
+ return { background: theme.background ?? '#FFFFFF', transition: 'fade', notes: '', elements: [] }
+}
+
+function docDefaults(): Obj {
+ const d = newDoc() as unknown as Obj
+ // docId and modified are minted per document; never a default to strip or fill
+ return { format: FORMAT, version: FORMAT_VERSION, title: d.title, size: d.size, theme: d.theme }
+}
+
+// ---------------------------------------------------------------------------
+
+/** Strip every field equal to what expandDoc would put back. Pure; the input
+ * is not mutated. The result carries `compact: true`. */
+export function compactDoc(full: BentoDoc): Obj {
+ const doc = full as unknown as Obj
+ const out: Obj = { [COMPACT_FLAG]: true }
+ const dd = docDefaults()
+ for (const [k, v] of Object.entries(doc)) {
+ if (k === 'slides' || k === COMPACT_FLAG) continue
+ if (k in dd && deepEqual(v, dd[k])) continue
+ out[k] = v
+ }
+ // theme: strip the slots that equal newDoc's theme, keep the rest
+ if (isObj(doc.theme)) {
+ const base = dd.theme as Obj
+ const th: Obj = {}
+ for (const [k, v] of Object.entries(doc.theme)) if (!(k in base && deepEqual(v, base[k]))) th[k] = v
+ if (Object.keys(th).length) out.theme = th; else delete out.theme
+ }
+ out.slides = ((doc.slides ?? []) as Obj[]).map((slide) => {
+ const sd = slideDefaults(doc)
+ const s: Obj = {}
+ for (const [k, v] of Object.entries(slide)) {
+ if (k === 'elements') continue
+ if (k in sd && deepEqual(v, sd[k])) continue
+ s[k] = v
+ }
+ const els = ((slide.elements ?? []) as Obj[]).map((el, i) => {
+ const defaults = elementDefaults(el, slide, doc)
+ const e: Obj = {}
+ const minted = el.id === mintId(slide, el, i)
+ for (const [k, v] of Object.entries(el)) {
+ if (k === 'id' && minted) continue
+ if (KEEP.has(k) || !defaults || !(k in defaults)) { e[k] = v; continue }
+ if (deepEqual(v, defaults[k])) continue
+ e[k] = v
+ }
+ return e
+ })
+ if (els.length) s.elements = els
+ return s
+ })
+ return out
+}
+
+const mintId = (slide: Obj, el: Obj, i: number) => `${slide.id}-${el.type}-${i}`
+
+/** Is the author's doc-level value the shape the editor will dereference?
+ * format/version must be ours; size a {width,height} of numbers; theme an
+ * object; title a string. */
+const usableDocField = (k: string, v: unknown, dd: Obj): boolean =>
+ k === 'size' ? isObj(v) && typeof v.width === 'number' && typeof v.height === 'number' && v.width > 0 && v.height > 0
+ : k === 'theme' ? isObj(v)
+ : k === 'title' ? typeof v === 'string'
+ : k === 'format' || k === 'version' ? v === dd[k]
+ : true
+
+/** Is this JSON a compact document? The flag decides; nothing is inferred. */
+export const isCompact = (doc: unknown): boolean => isObj(doc) && doc[COMPACT_FLAG] === true
+
+/**
+ * Fill every omitted field, flatten nested element arrays, mint missing ids.
+ * Pure; returns a new object. A document without the flag is returned as is
+ * (so callers can pass everything through). Slides without an id get
+ * `s${n}` (1-based); elements without one get `${slideId}-${type}-${index}`.
+ */
+export function expandDoc(input: unknown): BentoDoc {
+ if (!isCompact(input)) return input as BentoDoc
+ const src = input as Obj
+ const dd = docDefaults()
+ const doc: Obj = { ...dd, ...src }
+ delete doc[COMPACT_FLAG]
+ // The editor dereferences these unconditionally on first render — render.ts
+ // reads doc.size.width/height for every thumbnail (rebuildSidebar) and
+ // doc.theme.fontFamily for every text box; the About dialog reads
+ // doc.title — and parseDoc only checks format and a non-empty slides array,
+ // so a document without `size` passes it and throws in the sidebar. A
+ // missing one is the default; so is one of the wrong shape (`size: null`,
+ // `title: 3`): an author who wrote that meant "I don't care", not "break".
+ for (const k of Object.keys(dd)) {
+ if (!(k in src) || !usableDocField(k, src[k], dd)) doc[k] = dd[k]
+ }
+ doc.theme = { ...(dd.theme as Obj), ...(isObj(src.theme) ? src.theme : {}) }
+ for (const k of Object.keys(dd.theme as Obj)) if (typeof (doc.theme as Obj)[k] !== 'string') (doc.theme as Obj)[k] = (dd.theme as Obj)[k]
+ const slidesIn = Array.isArray(src.slides) ? (src.slides as unknown[]) : []
+ doc.slides = slidesIn.map((raw, si) => {
+ const s0 = isObj(raw) ? raw : {}
+ const slide: Obj = { ...slideDefaults(doc), ...s0 }
+ if (typeof slide.id !== 'string' || !slide.id) slide.id = `s${si + 1}`
+ const flat: Obj[] = []
+ const walk = (v: unknown) => { if (Array.isArray(v)) v.forEach(walk); else if (isObj(v)) flat.push(v) }
+ walk(s0.elements)
+ slide.elements = flat.map((el, i) => {
+ const defaults = elementDefaults(el, slide, doc) ?? {}
+ const out: Obj = { ...defaults, ...el }
+ if (typeof out.id !== 'string' || !out.id) out.id = mintId(slide, el, i)
+ return out as unknown as SlideElement
+ })
+ return slide as unknown as Slide
+ })
+ return doc as unknown as BentoDoc
+}
+
+/** The font stack expansion assumes for text — exported so the rig can state
+ * why a full document without `fontFamily` is NOT auto-expanded. */
+export const EXPANDED_TEXT_FONT = FONT_STACK
+
+/** The compact JSON of a document, for "Copy compact JSON" and window.bento.compact(). */
+export const compactJson = (doc: BentoDoc): string => JSON.stringify(compactDoc(doc))
diff --git a/slides/src/compactload.ts b/slides/src/compactload.ts
new file mode 100644
index 00000000..2c7f658d
--- /dev/null
+++ b/slides/src/compactload.ts
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: MIT
+// Copyright (c) 2026 The Bento authors
+// The agent entry point for a document that may be compact (src/compact.ts).
+// Kept apart from compact.ts so that module stays node-importable for the rig
+// and the measure script: this one needs the untrusted gate, which is bundled.
+//
+// parseDoc (model.ts) stays what it is — the file on disk is always full. A
+// COMPACT document is authored by a tool, so it gets the untrusted shape gate
+// on the way in (sanitizeSlide, the same rule pasted clips and remote ops
+// meet): an unknown key or a malformed value is dropped rather than reaching
+// the renderer. A full document is not gated here — that is today's
+// behaviour and today's promise (your own file is yours).
+
+import { parseDoc, type BentoDoc, type Slide } from './model'
+import { sanitizeSlide } from './untrusted'
+import { expandDoc, isCompact } from './compact'
+
+/**
+ * Parse document JSON that may be compact. Returns null on anything parseDoc
+ * refuses. Expansion happens BEFORE parseDoc so the format/slides checks and
+ * docId minting see a full document.
+ */
+export function parseDocInput(json: string): BentoDoc | null {
+ let raw: unknown
+ try { raw = JSON.parse(json) } catch { return null }
+ if (!isCompact(raw)) return parseDoc(json)
+ const expanded = expandDoc(raw) as unknown as Record<string, unknown>
+ expanded.slides = ((expanded.slides ?? []) as unknown[]).map(sanitizeSlide).filter((s): s is Slide => s !== null)
+ return parseDoc(JSON.stringify(expanded))
+}
diff --git a/slides/src/editor/editor.ts b/slides/src/editor/editor.ts
index 6ba5a23a..366372cb 100644
--- a/slides/src/editor/editor.ts
+++ b/slides/src/editor/editor.ts
@@ -40,6 +40,8 @@ import { appConfig } from '../../../kernel/src/app.ts'
import { disconnectOnline, joinFromDoc, mintCollab, mintInvite, mintRoomKey, onlineTransport, rotateKeys, sharingOn, startSharing, stopSharing } from '../sync/online'
import { projectDoc, projectOp, type AudienceTicket } from '../audience'
import { stripEmbeddedEnvelopes } from '../envelope'
+import { compactJson } from '../compact'
+import { parseDocInput } from '../compactload'
import { lsGet, lsJson, lsSet } from '../../../kernel/src/storage.ts'
import { shrinkImageFile, shrinkEnabled, setShrinkEnabled, shrinkNote, type ShrinkResult } from './shrink'
@@ -899,6 +901,9 @@ export class Editor {
item(ICONS.code, t('Copy document JSON'),
t('Copies this deck as plain JSON — content only, no live-session keys. Edit it in another tool, then bring it back with Replace from JSON.'),
() => void this.copyDocJson())
+ item(ICONS.code, t('Copy compact JSON (for agents)'),
+ t('The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.'),
+ () => void this.copyDocJson(true))
item(ICONS.code, t('Replace from JSON…'),
t('Paste edited document JSON to replace this deck’s content — ⌘Z undoes.'),
() => this.openReplaceJson())
@@ -1096,12 +1101,12 @@ export class Editor {
* member revocation on top. Nothing about the round-trip needs a room, and
* openReplaceJson keeps THIS document's, so dropping the block costs nothing.
*/
- private async copyDocJson() {
+ private async copyDocJson(compact = false) {
const clone = JSON.parse(JSON.stringify(this.store.doc)) as import('../model').BentoDoc
stripCollabSecrets(clone)
try {
- await navigator.clipboard.writeText(JSON.stringify(clone))
- this.toast(t('Document JSON copied'))
+ await navigator.clipboard.writeText(compact ? compactJson(clone) : JSON.stringify(clone))
+ this.toast(compact ? t('Compact JSON copied') : t('Document JSON copied'))
} catch {
this.toast(t('Couldn’t access the clipboard'))
}
@@ -1134,7 +1139,7 @@ export class Editor {
// either wipe the user's room credentials (paste of our own JSON) or
// silently move the deck into a room that came from somewhere else.
// Content is imported; identity and capability are not.
- const next = parseDoc(ta.value)
+ const next = parseDocInput(ta.value) // full or compact (src/compact.ts)
if (next) {
const keep = this.store.doc.collab
if (keep) next.collab = keep
diff --git a/slides/src/i18n/de.ts b/slides/src/i18n/de.ts
index 0e8e36af..153e589b 100644
--- a/slides/src/i18n/de.ts
+++ b/slides/src/i18n/de.ts
@@ -919,4 +919,7 @@ export const de: Catalog = {
"Curved connector": "Gebogener Verbinder",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "Eine gebogene Linie zwischen zwei Elementen — die Enden rasten ein und folgen mit, die Spitze folgt der Kurve",
"Double-headed": "Zwei Spitzen",
+ "Copy compact JSON (for agents)": "Kompaktes JSON kopieren (für Agenten)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "Dasselbe Deck ohne alle Standardwerte — die Form, die ein KI-Agent schreiben sollte. „Aus JSON ersetzen“ nimmt es zurück; die gespeicherte Datei ist immer vollständig.",
+ "Compact JSON copied": "Kompaktes JSON kopiert",
}
diff --git a/slides/src/i18n/es.ts b/slides/src/i18n/es.ts
index 182be23c..adfc84b5 100644
--- a/slides/src/i18n/es.ts
+++ b/slides/src/i18n/es.ts
@@ -919,4 +919,7 @@ export const es: Catalog = {
"Curved connector": "Conector curvo",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "Una línea curva entre dos elementos: los extremos se enganchan y se reajustan, y la punta sigue la curva",
"Double-headed": "Dos puntas",
+ "Copy compact JSON (for agents)": "Copiar JSON compacto (para agentes)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "La misma presentación sin ningún valor predeterminado: la forma que debería escribir un agente de IA. «Reemplazar desde JSON» lo acepta; el archivo guardado siempre es completo.",
+ "Compact JSON copied": "JSON compacto copiado",
}
diff --git a/slides/src/i18n/fr.ts b/slides/src/i18n/fr.ts
index 4de18144..3db35bce 100644
--- a/slides/src/i18n/fr.ts
+++ b/slides/src/i18n/fr.ts
@@ -919,4 +919,7 @@ export const fr: Catalog = {
"Curved connector": "Connecteur courbe",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "Une ligne courbe entre deux éléments — les extrémités s’accrochent et se replacent, la pointe suit la courbe",
"Double-headed": "Deux pointes",
+ "Copy compact JSON (for agents)": "Copier le JSON compact (pour les agents)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "La même présentation sans aucune valeur par défaut : la forme qu’un agent IA devrait écrire. « Remplacer depuis JSON » la reprend ; le fichier enregistré est toujours complet.",
+ "Compact JSON copied": "JSON compact copié",
}
diff --git a/slides/src/i18n/it.ts b/slides/src/i18n/it.ts
index 78bc0db9..69a357dc 100644
--- a/slides/src/i18n/it.ts
+++ b/slides/src/i18n/it.ts
@@ -919,4 +919,7 @@ export const it: Catalog = {
"Curved connector": "Connettore curvo",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "Una linea curva tra due elementi — le estremità si agganciano e si riposizionano, la punta segue la curva",
"Double-headed": "Due punte",
+ "Copy compact JSON (for agents)": "Copia JSON compatto (per gli agenti)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "La stessa presentazione senza alcun valore predefinito: la forma che un agente IA dovrebbe scrivere. «Sostituisci da JSON» la riprende; il file salvato è sempre completo.",
+ "Compact JSON copied": "JSON compatto copiato",
}
diff --git a/slides/src/i18n/ja.ts b/slides/src/i18n/ja.ts
index 73bcdf75..74495752 100644
--- a/slides/src/i18n/ja.ts
+++ b/slides/src/i18n/ja.ts
@@ -919,4 +919,7 @@ export const ja: Catalog = {
"Curved connector": "曲線コネクタ",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "2つの要素をつなぐ曲線 — 両端は要素に吸着して追従し、先端は曲線に沿います",
"Double-headed": "両端に矢じり",
+ "Copy compact JSON (for agents)": "コンパクトな JSON をコピー(エージェント向け)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "既定値をすべて省いた同じデッキ。AI エージェントが書くべき形です。「JSON から置き換え」で戻せます。保存されるファイルは常に完全な形です。",
+ "Compact JSON copied": "コンパクトな JSON をコピーしました",
}
diff --git a/slides/src/i18n/packed.ts b/slides/src/i18n/packed.ts
index a7e3b457..eb07bde7 100644
--- a/slides/src/i18n/packed.ts
+++ b/slides/src/i18n/packed.ts
@@ -925,4 +925,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Curved connector": ["曲線コネクタ","曲线连接线","曲線連接線","Conector curvo","Connecteur courbe","Gebogener Verbinder","Connettore curvo","Conector curvo"],
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": ["2つの要素をつなぐ曲線 — 両端は要素に吸着して追従し、先端は曲線に沿います","两个元素之间的曲线 — 两端吸附并跟随移动,箭头沿曲线方向","兩個元素之間的曲線 — 兩端吸附並跟隨移動,箭頭沿曲線方向","Una línea curva entre dos elementos: los extremos se enganchan y se reajustan, y la punta sigue la curva","Une ligne courbe entre deux éléments — les extrémités s’accrochent et se replacent, la pointe suit la courbe","Eine gebogene Linie zwischen zwei Elementen — die Enden rasten ein und folgen mit, die Spitze folgt der Kurve","Una linea curva tra due elementi — le estremità si agganciano e si riposizionano, la punta segue la curva","Uma linha curva entre dois elementos — as extremidades encaixam e reposicionam-se, a ponta segue a curva"],
"Double-headed": ["両端に矢じり","双头","雙頭","Dos puntas","Deux pointes","Zwei Spitzen","Due punte","Duas pontas"],
+ "Copy compact JSON (for agents)": ["コンパクトな JSON をコピー(エージェント向け)","复制精简 JSON(供智能体使用)","複製精簡 JSON(供代理程式使用)","Copiar JSON compacto (para agentes)","Copier le JSON compact (pour les agents)","Kompaktes JSON kopieren (für Agenten)","Copia JSON compatto (per gli agenti)","Copiar JSON compacto (para agentes)"],
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": ["既定値をすべて省いた同じデッキ。AI エージェントが書くべき形です。「JSON から置き換え」で戻せます。保存されるファイルは常に完全な形です。","同一份文稿,省去所有默认值——AI 智能体应当书写的形式。“从 JSON 替换”可读回它;保存的文件始终是完整的。","同一份文稿,省去所有預設值——AI 代理程式應當書寫的形式。「從 JSON 取代」可讀回它;儲存的檔案始終是完整的。","La misma presentación sin ningún valor predeterminado: la forma que debería escribir un agente de IA. «Reemplazar desde JSON» lo acepta; el archivo guardado siempre es completo.","La même présentation sans aucune valeur par défaut : la forme qu’un agent IA devrait écrire. « Remplacer depuis JSON » la reprend ; le fichier enregistré est toujours complet.","Dasselbe Deck ohne alle Standardwerte — die Form, die ein KI-Agent schreiben sollte. „Aus JSON ersetzen“ nimmt es zurück; die gespeicherte Datei ist immer vollständig.","La stessa presentazione senza alcun valore predefinito: la forma che un agente IA dovrebbe scrivere. «Sostituisci da JSON» la riprende; il file salvato è sempre completo.","A mesma apresentação sem nenhum valor predefinido: a forma que um agente de IA deve escrever. «Substituir a partir de JSON» aceita-a; o ficheiro guardado é sempre completo."],
+ "Compact JSON copied": ["コンパクトな JSON をコピーしました","已复制精简 JSON","已複製精簡 JSON","JSON compacto copiado","JSON compact copié","Kompaktes JSON kopiert","JSON compatto copiato","JSON compacto copiado"],
}
diff --git a/slides/src/i18n/packs/ar.ts b/slides/src/i18n/packs/ar.ts
index d316a3ab..53d3204f 100644
--- a/slides/src/i18n/packs/ar.ts
+++ b/slides/src/i18n/packs/ar.ts
@@ -939,4 +939,7 @@ export const strings: Catalog = {
"Curved connector": "موصّل منحنٍ",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "خط منحنٍ بين عنصرين — يلتصق الطرفان ويعاد توجيههما، ويتبع الرأس المنحنى",
"Double-headed": "برأسين",
+ "Copy compact JSON (for agents)": "نسخ JSON مضغوط (للوكلاء)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "العرض نفسه بدون أي قيمة افتراضية: الشكل الذي ينبغي لوكيل الذكاء الاصطناعي كتابته. «استبدال من JSON» يقبله؛ الملف المحفوظ كامل دائمًا.",
+ "Compact JSON copied": "تم نسخ JSON المضغوط",
}
diff --git a/slides/src/i18n/packs/bn.ts b/slides/src/i18n/packs/bn.ts
index b8793530..254dfaa2 100644
--- a/slides/src/i18n/packs/bn.ts
+++ b/slides/src/i18n/packs/bn.ts
@@ -942,4 +942,7 @@ export const strings: Catalog = {
"Curved connector": "বাঁকা সংযোজক",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "দুটি উপাদানের মধ্যে একটি বাঁকা রেখা — প্রান্তগুলো আটকে যায় ও পুনর্বিন্যস্ত হয়, মাথাটি বাঁক অনুসরণ করে",
"Double-headed": "দুই মাথা",
+ "Copy compact JSON (for agents)": "সংক্ষিপ্ত JSON কপি করুন (এজেন্টের জন্য)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "সব ডিফল্ট বাদ দেওয়া একই ডেক — একটি AI এজেন্টের যেভাবে লেখা উচিত। “JSON থেকে প্রতিস্থাপন” এটি ফিরিয়ে নেয়; সংরক্ষিত ফাইল সবসময় পূর্ণ।",
+ "Compact JSON copied": "সংক্ষিপ্ত JSON কপি হয়েছে",
}
diff --git a/slides/src/i18n/packs/da.ts b/slides/src/i18n/packs/da.ts
index aa822d5a..e3c6f812 100644
--- a/slides/src/i18n/packs/da.ts
+++ b/slides/src/i18n/packs/da.ts
@@ -931,4 +931,7 @@ export const strings: Catalog = {
"Curved connector": "Buet forbinder",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "En buet linje mellem to elementer — enderne snapper på og flytter med, spidsen følger kurven",
"Double-headed": "To spidser",
+ "Copy compact JSON (for agents)": "Kopiér kompakt JSON (til agenter)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "Samme dæk uden alle standardværdier — den form en AI-agent bør skrive. »Erstat fra JSON« tager den tilbage; den gemte fil er altid fuldstændig.",
+ "Compact JSON copied": "Kompakt JSON kopieret",
}
diff --git a/slides/src/i18n/packs/fa.ts b/slides/src/i18n/packs/fa.ts
index 5c384f99..f4bad922 100644
--- a/slides/src/i18n/packs/fa.ts
+++ b/slides/src/i18n/packs/fa.ts
@@ -935,4 +935,7 @@ export const strings: Catalog = {
"Curved connector": "اتصال‌دهندهٔ منحنی",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "خطی منحنی بین دو عنصر — دو سر می‌چسبند و دوباره مسیر می‌گیرند، نوک در امتداد منحنی است",
"Double-headed": "دو سر",
+ "Copy compact JSON (for agents)": "کپی JSON فشرده (برای عامل‌ها)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "همان دک بدون هیچ مقدار پیش‌فرض؛ شکلی که یک عامل هوش مصنوعی باید بنویسد. «جایگزینی از JSON» آن را می‌پذیرد؛ پروندهٔ ذخیره‌شده همیشه کامل است.",
+ "Compact JSON copied": "JSON فشرده کپی شد",
}
diff --git a/slides/src/i18n/packs/fi.ts b/slides/src/i18n/packs/fi.ts
index b0ee9a79..a4a985c5 100644
--- a/slides/src/i18n/packs/fi.ts
+++ b/slides/src/i18n/packs/fi.ts
@@ -936,4 +936,7 @@ export const strings: Catalog = {
"Curved connector": "Kaareva yhdysviiva",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "Kaareva viiva kahden elementin välillä — päät tarttuvat ja reitittyvät uudelleen, kärki seuraa kaarta",
"Double-headed": "Kaksipäinen",
+ "Copy compact JSON (for agents)": "Kopioi tiivis JSON (agenteille)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "Sama pakka ilman oletusarvoja — muoto, jonka tekoälyagentin tulisi kirjoittaa. ”Korvaa JSON:sta” ottaa sen vastaan; tallennettu tiedosto on aina täydellinen.",
+ "Compact JSON copied": "Tiivis JSON kopioitu",
}
diff --git a/slides/src/i18n/packs/fil.ts b/slides/src/i18n/packs/fil.ts
index a4c58619..5485b6d0 100644
--- a/slides/src/i18n/packs/fil.ts
+++ b/slides/src/i18n/packs/fil.ts
@@ -948,4 +948,7 @@ export const strings: Catalog = {
"Curved connector": "Kurbadong connector",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "Kurbadong linya sa pagitan ng dalawang elemento — kumakapit at umaayos ang mga dulo, sumusunod sa kurba ang dulo",
"Double-headed": "Dalawang ulo",
+ "Copy compact JSON (for agents)": "Kopyahin ang compact na JSON (para sa mga agent)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "Ang parehong deck na wala ang lahat ng default — ang anyong dapat isulat ng isang AI agent. Tinatanggap ito ng “Palitan mula sa JSON”; ang na-save na file ay laging buo.",
+ "Compact JSON copied": "Nakopya ang compact na JSON",
}
diff --git a/slides/src/i18n/packs/he.ts b/slides/src/i18n/packs/he.ts
index 6401e648..bda9f593 100644
--- a/slides/src/i18n/packs/he.ts
+++ b/slides/src/i18n/packs/he.ts
@@ -932,4 +932,7 @@ export const strings: Catalog = {
"Curved connector": "מחבר מעוגל",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "קו מעוגל בין שני רכיבים — הקצוות נצמדים ומתעדכנים, והראש עוקב אחרי העקומה",
"Double-headed": "שני ראשים",
+ "Copy compact JSON (for agents)": "העתקת JSON קומפקטי (לסוכנים)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "אותה מצגת בלי ברירות המחדל — הצורה שסוכן AI צריך לכתוב. «החלפה מ-JSON» מקבלת אותה; הקובץ השמור תמיד מלא.",
+ "Compact JSON copied": "JSON קומפקטי הועתק",
}
diff --git a/slides/src/i18n/packs/hi.ts b/slides/src/i18n/packs/hi.ts
index fa13d6a5..1ff28667 100644
--- a/slides/src/i18n/packs/hi.ts
+++ b/slides/src/i18n/packs/hi.ts
@@ -939,4 +939,7 @@ export const strings: Catalog = {
"Curved connector": "घुमावदार कनेक्टर",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "दो तत्वों के बीच घुमावदार रेखा — सिरे चिपकते और फिर से जुड़ते हैं, नोक वक्र के साथ चलती है",
"Double-headed": "दो नोक",
+ "Copy compact JSON (for agents)": "संक्षिप्त JSON कॉपी करें (एजेंट के लिए)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "वही डेक, हर डिफ़ॉल्ट हटाकर — वह रूप जो एक AI एजेंट को लिखना चाहिए। “JSON से बदलें” इसे वापस लेता है; सहेजी गई फ़ाइल हमेशा पूरी होती है।",
+ "Compact JSON copied": "संक्षिप्त JSON कॉपी हो गया",
}
diff --git a/slides/src/i18n/packs/id.ts b/slides/src/i18n/packs/id.ts
index edff9396..7f3f7b26 100644
--- a/slides/src/i18n/packs/id.ts
+++ b/slides/src/i18n/packs/id.ts
@@ -929,4 +929,7 @@ export const strings: Catalog = {
"Curved connector": "Penghubung melengkung",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "Garis lengkung di antara dua elemen — ujungnya menempel dan menyesuaikan, kepalanya mengikuti lengkungan",
"Double-headed": "Dua kepala",
+ "Copy compact JSON (for agents)": "Salin JSON ringkas (untuk agen)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "Dek yang sama tanpa semua nilai bawaan — bentuk yang seharusnya ditulis agen AI. “Ganti dari JSON” menerimanya kembali; berkas yang disimpan selalu lengkap.",
+ "Compact JSON copied": "JSON ringkas disalin",
}
diff --git a/slides/src/i18n/packs/ko.ts b/slides/src/i18n/packs/ko.ts
index d41547a1..ec0546df 100644
--- a/slides/src/i18n/packs/ko.ts
+++ b/slides/src/i18n/packs/ko.ts
@@ -923,4 +923,7 @@ export const strings: Catalog = {
"Curved connector": "곡선 연결선",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "두 요소 사이의 곡선 — 양 끝이 붙어 따라 움직이고 화살촉은 곡선을 따릅니다",
"Double-headed": "양쪽 머리",
+ "Copy compact JSON (for agents)": "간결한 JSON 복사 (에이전트용)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "모든 기본값을 뺀 같은 덱 — AI 에이전트가 작성해야 할 형태입니다. “JSON에서 바꾸기”로 되돌릴 수 있으며, 저장되는 파일은 항상 완전한 형태입니다.",
+ "Compact JSON copied": "간결한 JSON을 복사했습니다",
}
diff --git a/slides/src/i18n/packs/ms.ts b/slides/src/i18n/packs/ms.ts
index 8757e883..061f364a 100644
--- a/slides/src/i18n/packs/ms.ts
+++ b/slides/src/i18n/packs/ms.ts
@@ -932,4 +932,7 @@ export const strings: Catalog = {
"Curved connector": "Penyambung melengkung",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "Garis melengkung antara dua elemen — hujungnya melekat dan dilaraskan semula, hujung anak panah mengikut lengkung",
"Double-headed": "Dua kepala",
+ "Copy compact JSON (for agents)": "Salin JSON padat (untuk ejen)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "Dek yang sama tanpa semua nilai lalai — bentuk yang patut ditulis oleh ejen AI. “Ganti daripada JSON” menerimanya semula; fail yang disimpan sentiasa lengkap.",
+ "Compact JSON copied": "JSON padat disalin",
}
diff --git a/slides/src/i18n/packs/nb.ts b/slides/src/i18n/packs/nb.ts
index afc5e340..456385e9 100644
--- a/slides/src/i18n/packs/nb.ts
+++ b/slides/src/i18n/packs/nb.ts
@@ -933,4 +933,7 @@ export const strings: Catalog = {
"Curved connector": "Buet kobling",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "En buet linje mellom to elementer — endene fester seg og flytter med, spissen følger kurven",
"Double-headed": "To spisser",
+ "Copy compact JSON (for agents)": "Kopier kompakt JSON (for agenter)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "Samme kortstokk uten alle standardverdier — formen en KI-agent bør skrive. «Erstatt fra JSON» tar den tilbake; den lagrede filen er alltid fullstendig.",
+ "Compact JSON copied": "Kompakt JSON kopiert",
}
diff --git a/slides/src/i18n/packs/nl.ts b/slides/src/i18n/packs/nl.ts
index 066ca329..bc07a7e4 100644
--- a/slides/src/i18n/packs/nl.ts
+++ b/slides/src/i18n/packs/nl.ts
@@ -927,4 +927,7 @@ export const strings: Catalog = {
"Curved connector": "Gebogen verbinder",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "Een gebogen lijn tussen twee elementen — de uiteinden klikken vast en schuiven mee, de punt volgt de kromme",
"Double-headed": "Twee punten",
+ "Copy compact JSON (for agents)": "Compacte JSON kopiëren (voor agents)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "Hetzelfde deck zonder alle standaardwaarden — de vorm die een AI-agent zou moeten schrijven. ‘Vervangen uit JSON’ neemt het terug; het opgeslagen bestand is altijd volledig.",
+ "Compact JSON copied": "Compacte JSON gekopieerd",
}
diff --git a/slides/src/i18n/packs/pl.ts b/slides/src/i18n/packs/pl.ts
index 6398e766..371a4399 100644
--- a/slides/src/i18n/packs/pl.ts
+++ b/slides/src/i18n/packs/pl.ts
@@ -930,4 +930,7 @@ export const strings: Catalog = {
"Curved connector": "Łącznik krzywy",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "Zakrzywiona linia między dwoma elementami — końce przyczepiają się i dopasowują, grot podąża za krzywą",
"Double-headed": "Dwa groty",
+ "Copy compact JSON (for agents)": "Kopiuj zwięzły JSON (dla agentów)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "Ta sama prezentacja bez wartości domyślnych — postać, którą powinien pisać agent AI. „Zastąp z JSON” przyjmuje ją z powrotem; zapisany plik jest zawsze pełny.",
+ "Compact JSON copied": "Skopiowano zwięzły JSON",
}
diff --git a/slides/src/i18n/packs/ru.ts b/slides/src/i18n/packs/ru.ts
index 8e9eaa9d..8dc8ec66 100644
--- a/slides/src/i18n/packs/ru.ts
+++ b/slides/src/i18n/packs/ru.ts
@@ -931,4 +931,7 @@ export const strings: Catalog = {
"Curved connector": "Изогнутый соединитель",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "Изогнутая линия между двумя элементами — концы прилипают и перестраиваются, наконечник идёт вдоль кривой",
"Double-headed": "Два наконечника",
+ "Copy compact JSON (for agents)": "Копировать компактный JSON (для агентов)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "Та же презентация без значений по умолчанию — форма, которую должен писать ИИ-агент. «Заменить из JSON» принимает её обратно; сохранённый файл всегда полный.",
+ "Compact JSON copied": "Компактный JSON скопирован",
}
diff --git a/slides/src/i18n/packs/sv.ts b/slides/src/i18n/packs/sv.ts
index 18cbbf69..5bd438d5 100644
--- a/slides/src/i18n/packs/sv.ts
+++ b/slides/src/i18n/packs/sv.ts
@@ -928,4 +928,7 @@ export const strings: Catalog = {
"Curved connector": "Böjd koppling",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "En böjd linje mellan två element — ändarna fäster och flyttar med, spetsen följer kurvan",
"Double-headed": "Två spetsar",
+ "Copy compact JSON (for agents)": "Kopiera kompakt JSON (för agenter)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "Samma presentation utan alla standardvärden — formen en AI-agent bör skriva. ”Ersätt från JSON” tar tillbaka den; den sparade filen är alltid fullständig.",
+ "Compact JSON copied": "Kompakt JSON kopierad",
}
diff --git a/slides/src/i18n/packs/th.ts b/slides/src/i18n/packs/th.ts
index b36c691e..32b69e63 100644
--- a/slides/src/i18n/packs/th.ts
+++ b/slides/src/i18n/packs/th.ts
@@ -933,4 +933,7 @@ export const strings: Catalog = {
"Curved connector": "เส้นเชื่อมโค้ง",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "เส้นโค้งระหว่างสององค์ประกอบ — ปลายเกาะติดและปรับตามเมื่อย้าย หัวลูกศรวิ่งตามเส้นโค้ง",
"Double-headed": "สองหัว",
+ "Copy compact JSON (for agents)": "คัดลอก JSON แบบกระชับ (สำหรับเอเจนต์)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "เด็คเดียวกันโดยตัดค่าเริ่มต้นทั้งหมดออก คือรูปแบบที่เอเจนต์ AI ควรเขียน “แทนที่จาก JSON” รับกลับได้ ไฟล์ที่บันทึกจะสมบูรณ์เสมอ",
+ "Compact JSON copied": "คัดลอก JSON แบบกระชับแล้ว",
}
diff --git a/slides/src/i18n/packs/tk.ts b/slides/src/i18n/packs/tk.ts
index 20ef96ed..384908ff 100644
--- a/slides/src/i18n/packs/tk.ts
+++ b/slides/src/i18n/packs/tk.ts
@@ -956,4 +956,7 @@ export const strings: Catalog = {
"Curved connector": "Egri birleşdiriji",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "Iki elementiň arasyndaky egri çyzyk — uçlary ýapyşýar we täzeden ugrukdyrylýar, ujy egriniň yzyndan gidýär",
"Double-headed": "Iki uçly",
+ "Copy compact JSON (for agents)": "Ykjam JSON-y göçür (agentler üçin)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "Ähli deslapky bahalary aýrylan şol bir toplum — AI agentiň ýazmaly görnüşi. «JSON-dan çalyş» ony yzyna alýar; ýatda saklanan faýl elmydama doly.",
+ "Compact JSON copied": "Ykjam JSON göçürildi",
}
diff --git a/slides/src/i18n/packs/tr.ts b/slides/src/i18n/packs/tr.ts
index 5964b91b..e9e0a7ed 100644
--- a/slides/src/i18n/packs/tr.ts
+++ b/slides/src/i18n/packs/tr.ts
@@ -930,4 +930,7 @@ export const strings: Catalog = {
"Curved connector": "Eğri bağlayıcı",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "İki öğe arasında eğri bir çizgi — uçlar yapışır ve yeniden yönlenir, uç eğriyi izler",
"Double-headed": "Çift başlı",
+ "Copy compact JSON (for agents)": "Kompakt JSON'u kopyala (ajanlar için)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "Tüm varsayılanlar çıkarılmış aynı deste — bir yapay zekâ ajanının yazması gereken biçim. “JSON'dan değiştir” geri alır; kaydedilen dosya her zaman tamdır.",
+ "Compact JSON copied": "Kompakt JSON kopyalandı",
}
diff --git a/slides/src/i18n/packs/uk.ts b/slides/src/i18n/packs/uk.ts
index 6bb0f411..611e3326 100644
--- a/slides/src/i18n/packs/uk.ts
+++ b/slides/src/i18n/packs/uk.ts
@@ -939,4 +939,7 @@ export const strings: Catalog = {
"Curved connector": "Вигнутий з’єднувач",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "Вигнута лінія між двома елементами — кінці прилипають і перебудовуються, вістря йде вздовж кривої",
"Double-headed": "Два вістря",
+ "Copy compact JSON (for agents)": "Копіювати компактний JSON (для агентів)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "Та сама презентація без значень за замовчуванням — форма, яку має писати ШІ-агент. «Замінити з JSON» приймає її назад; збережений файл завжди повний.",
+ "Compact JSON copied": "Компактний JSON скопійовано",
}
diff --git a/slides/src/i18n/packs/ur.ts b/slides/src/i18n/packs/ur.ts
index 99818191..4a81725a 100644
--- a/slides/src/i18n/packs/ur.ts
+++ b/slides/src/i18n/packs/ur.ts
@@ -949,4 +949,7 @@ export const strings: Catalog = {
"Curved connector": "خمدار کنیکٹر",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "دو عناصر کے درمیان خمدار لکیر — سرے چپکتے اور دوبارہ جڑتے ہیں، نوک خم کے ساتھ چلتی ہے",
"Double-headed": "دو نوک",
+ "Copy compact JSON (for agents)": "کمپیکٹ JSON کاپی کریں (ایجنٹس کے لیے)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "وہی ڈیک، ہر ڈیفالٹ ہٹا کر — وہ شکل جو ایک AI ایجنٹ کو لکھنی چاہیے۔ “JSON سے بدلیں” اسے واپس لیتا ہے؛ محفوظ شدہ فائل ہمیشہ مکمل ہوتی ہے۔",
+ "Compact JSON copied": "کمپیکٹ JSON کاپی ہو گیا",
}
diff --git a/slides/src/i18n/packs/vi.ts b/slides/src/i18n/packs/vi.ts
index 7db407aa..3381af6b 100644
--- a/slides/src/i18n/packs/vi.ts
+++ b/slides/src/i18n/packs/vi.ts
@@ -929,4 +929,7 @@ export const strings: Catalog = {
"Curved connector": "Đường nối cong",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "Đường cong giữa hai phần tử — hai đầu bám vào và tự chỉnh lại, đầu mũi tên đi theo đường cong",
"Double-headed": "Hai đầu",
+ "Copy compact JSON (for agents)": "Sao chép JSON gọn (cho tác tử)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "Cùng bộ trang chiếu nhưng bỏ mọi giá trị mặc định: dạng mà một tác tử AI nên viết. “Thay thế từ JSON” nhận lại nó; tệp đã lưu luôn đầy đủ.",
+ "Compact JSON copied": "Đã sao chép JSON gọn",
}
diff --git a/slides/src/i18n/pt.ts b/slides/src/i18n/pt.ts
index 7f811951..37ee06e6 100644
--- a/slides/src/i18n/pt.ts
+++ b/slides/src/i18n/pt.ts
@@ -917,4 +917,7 @@ export const pt: Catalog = {
"Curved connector": "Conector curvo",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "Uma linha curva entre dois elementos — as extremidades encaixam e reposicionam-se, a ponta segue a curva",
"Double-headed": "Duas pontas",
+ "Copy compact JSON (for agents)": "Copiar JSON compacto (para agentes)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "A mesma apresentação sem nenhum valor predefinido: a forma que um agente de IA deve escrever. «Substituir a partir de JSON» aceita-a; o ficheiro guardado é sempre completo.",
+ "Compact JSON copied": "JSON compacto copiado",
}
diff --git a/slides/src/i18n/zh-Hans.ts b/slides/src/i18n/zh-Hans.ts
index f962c6c7..c0c837a3 100644
--- a/slides/src/i18n/zh-Hans.ts
+++ b/slides/src/i18n/zh-Hans.ts
@@ -919,4 +919,7 @@ export const zhHans: Catalog = {
"Curved connector": "曲线连接线",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "两个元素之间的曲线 — 两端吸附并跟随移动,箭头沿曲线方向",
"Double-headed": "双头",
+ "Copy compact JSON (for agents)": "复制精简 JSON(供智能体使用)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "同一份文稿,省去所有默认值——AI 智能体应当书写的形式。“从 JSON 替换”可读回它;保存的文件始终是完整的。",
+ "Compact JSON copied": "已复制精简 JSON",
}
diff --git a/slides/src/i18n/zh-Hant.ts b/slides/src/i18n/zh-Hant.ts
index 9ac3f876..ee6d79fb 100644
--- a/slides/src/i18n/zh-Hant.ts
+++ b/slides/src/i18n/zh-Hant.ts
@@ -919,4 +919,7 @@ export const zhHant: Catalog = {
"Curved connector": "曲線連接線",
"A curved line between two elements — the ends snap on and re-route, the tip follows the curve": "兩個元素之間的曲線 — 兩端吸附並跟隨移動,箭頭沿曲線方向",
"Double-headed": "雙頭",
+ "Copy compact JSON (for agents)": "複製精簡 JSON(供代理程式使用)",
+ "The same deck with every default left out — the shape an AI agent should write. Replace from JSON takes it back; the saved file is always full.": "同一份文稿,省去所有預設值——AI 代理程式應當書寫的形式。「從 JSON 取代」可讀回它;儲存的檔案始終是完整的。",
+ "Compact JSON copied": "已複製精簡 JSON",
}
diff --git a/slides/src/main.ts b/slides/src/main.ts
index 9cddb949..4f576916 100644
--- a/slides/src/main.ts
+++ b/slides/src/main.ts
@@ -18,6 +18,8 @@ import { buildSlidePreview } from './preview'
import { APP_VERSION, checkForUpdates, buildUpdatedFile, applyUpdate } from './update'
import { i18nApi, t, applyDirection } from './i18n'
import { parseDoc, type BentoDoc, type TextElement } from './model'
+import { compactJson } from './compact'
+import { parseDocInput } from './compactload'
import { validateDoc, type ValidateOpts } from './validate'
import { resolveThemeRefs } from './palette'
import { measureText, measureElement, type TextMeasureSpec } from './measure'
@@ -315,15 +317,23 @@ if (location.hash === '#present') {
},
/**
* AI/tooling round-trip: replace the whole document from a JSON string
- * (the contents of #bento-doc). Validates via parseDoc; returns false and
- * changes nothing on invalid input. Undoable in the editor.
+ * (the contents of #bento-doc, or a COMPACT document — `"compact": true`
+ * with defaults omitted, nested element arrays and missing ids allowed; see
+ * src/compact.ts). Validates via parseDoc; returns false and changes
+ * nothing on invalid input. Undoable in the editor.
*/
loadDoc(json: string): boolean {
- const next = parseDoc(json)
+ const next = parseDocInput(json)
if (!next) return false
store.replaceDoc(next)
return true
},
+ /**
+ * The document as compact JSON: every field equal to what the editor would
+ * have inserted left out. The shape an agent should write; loadDoc and
+ * "Replace from JSON…" take it back. The FILE is always saved full.
+ */
+ compact: () => compactJson(store.doc),
/**
* Report what the runtime would otherwise swallow: unknown keys, text that
* overflows its box, elements off the canvas, effects that can never run,