@penguinharness/use-bento-slides 0.2.18 → 0.2.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +37 -0
  2. package/README.zh.md +37 -0
  3. package/THIRD-PARTY-NOTICES.md +30 -0
  4. package/ifaces.json +63 -0
  5. package/package.json +19 -21
  6. package/skills/bento-slides/SKILL.md +89 -29
  7. package/skills/bento-slides/references/bento-agents.md +511 -0
  8. package/workbenches/slides/index.ts +677 -0
  9. package/workbenches/slides/package.json +43 -0
  10. package/workbenches/slides/ui/app.js +1101 -0
  11. package/workbenches/slides/ui/bridge.js +190 -0
  12. package/workbenches/slides/ui/conversation-view.js +206 -0
  13. package/workbenches/slides/ui/conversation.css +95 -0
  14. package/workbenches/slides/ui/conversation.js +115 -0
  15. package/workbenches/slides/ui/deck-files.css +279 -0
  16. package/workbenches/slides/ui/deck-files.js +189 -0
  17. package/workbenches/slides/ui/file-menu.js +72 -0
  18. package/workbenches/slides/ui/icon.svg +9 -0
  19. package/workbenches/slides/ui/index.html +252 -0
  20. package/workbenches/slides/ui/model-choice.js +298 -0
  21. package/workbenches/slides/ui/model-control.tsx +90 -0
  22. package/workbenches/slides/ui/powerpoint.js +196 -0
  23. package/workbenches/slides/ui/sample.bento.json +33 -0
  24. package/workbenches/slides/ui/strings.js +184 -0
  25. package/workbenches/slides/ui/style.css +505 -0
  26. package/workbenches/slides/ui/sync.js +268 -0
  27. package/workbenches/slides/ui/template-picker.js +128 -0
  28. package/workbenches/slides/ui/templates.js +256 -0
  29. package/workbenches/slides/ui/vendor/LICENSE-bento.txt +21 -0
  30. package/workbenches/slides/ui/vendor/LICENSE-jszip.txt +25 -0
  31. package/workbenches/slides/ui/vendor/LICENSE-pptxgen.txt +21 -0
  32. package/workbenches/slides/ui/vendor/bento-slides-1.2.13.runtime.txt +310 -0
  33. package/workbenches/slides/ui/vendor/pptxgen-4.0.1.bundle.js +96 -0
package/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # Bento Slides
2
+
3
+ Make slide decks with [Bento Slides](https://bento.page), a slide editor whose document is JSON. The plugin carries two things:
4
+
5
+ - **The Slides workbench (AI PPT):** a slide editor in a tab beside the Agent's chat. You edit a deck there while the Agent edits the same deck, and each of you sees the other's changes as they are saved.
6
+ - **The `bento-slides` Skill:** how the Agent writes and changes decks, both those in the workbench and standalone `.bento.html` files in a Workspace.
7
+
8
+ `default_agent` gets the plugin when a Project is created. Any other Agent installs it from the plugin library.
9
+
10
+ ## The Slides workbench
11
+
12
+ - **Start from a template.** Preview the four slides of a project brief or a team retrospective, name the presentation and create an editable copy. Text, shapes and speaker notes are included in the PowerPoint export.
13
+ - **Find a presentation.** The workbench opens your saved presentations, ordered by the last edit. Open, rename or delete one there. Use **File → Save presentation**, **Ctrl+S** or **Cmd+S** to write the open presentation, including the text you are typing.
14
+ - **A full slide editor in a tab.** Bento's own editor: slide list, canvas, text, shapes, pictures, tables, charts, morph transitions, presenter mode.
15
+ - **Ask in plain words.** The rail beside the editor sends your request to the Agent together with the slide you are on and the elements you selected, so "make this a bar chart of the numbers" means this slide.
16
+ - **Both of you edit one deck.** A deck is one file. The editor saves your changes to it and the Agent edits it with its own tools; whichever side saved last is loaded into the other within a second. Asking from the ordinary chat works the same way: the Agent writes the same file.
17
+ - **Both sides' edits are kept.** When the Agent saves while you have unsaved changes, your changes are replayed on top of its version, element by element. If you both changed the same property, yours is kept, the workbench says so, and the Agent's version goes to the deck’s **File → Version history**, from which any version can be restored.
18
+ - **Decks you can take away.** **Export as PowerPoint file (.pptx)** downloads an editable .pptx with native text, shapes, tables and supported charts. For the original animations, media and editor, **Download Bento HTML file (.html)** gives a self-contained `.bento.html` that opens in any browser with the editor inside it. **Import Bento HTML or JSON…** opens it again, or a deck's `.json`.
19
+
20
+ To start, open the **Slides** tab beside the Agent's chat, or the **AI PPT** tile in the App Center. Describe a deck and choose **Create with AI**, choose a blank presentation or start from a template, or open the sample deck. Use **Present** to play the current deck. Then click a slide, type a change in the rail on the right, and keep editing while the Agent works.
21
+
22
+ ## Your data
23
+
24
+ - Decks live with the Agent, on the server, in the workbench's data folder: `app/data/slides/decks/<name>.bento.json` in the Agent's folder, one JSON file per deck, and under `history/` the last twenty versions that one side replaced. Exporting the Agent with its data carries them.
25
+ - The editor runs in a sandboxed frame with no origin of its own and a policy that allows no network connection. It cannot reach the internet, the app's API or your sign-in. Bento's update check, live sharing and remote media are therefore off inside the workbench; pictures are embedded in the deck.
26
+ - The workbench sends nothing to any other host. The Agent's own work goes to the model you configured, as in any chat.
27
+ - Decks stay when the workbench is updated. Removing the workbench, or the plugin, removes them with it. Deleting a presentation from the file list removes it and its history.
28
+
29
+ ## Known limits
30
+
31
+ - The workbench and editor use the app’s language. The embedded Bento presentation keeps its own slide colours.
32
+ - Printing, PDF and real full screen do not work inside the app's frame. Export the deck and present or print it from a browser tab; Bento's own "fill the tab" presenting works in the workbench.
33
+ - The Agent's Session for a deck runs its tool calls without asking, because it edits the deck file with them. A deck you import may have been written by someone else: each request tells the Agent the deck's text is content, not instructions, and the Agent's sandbox is what limits its commands.
34
+
35
+ ## Licence and credits
36
+
37
+ Apache-2.0, like the rest of PenguinHarness. The editor is [Bento Slides](https://bento.page) 1.2.13, MIT, © 2026 The Bento authors, shipped unmodified, and the Skill's format reference is the Bento project's own agent guide; see [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md). This plugin is not affiliated with or endorsed by the Bento project.
package/README.zh.md ADDED
@@ -0,0 +1,37 @@
1
+ # Bento 幻灯片
2
+
3
+ 用 [Bento Slides](https://bento.page) 制作幻灯片。Bento 是一款以 JSON 为文稿格式的幻灯片编辑器。本插件包含两部分:
4
+
5
+ - **幻灯片工作台(AI PPT)**:Agent 对话旁的一个标签页,里面是完整的幻灯片编辑器。你在这里修改文稿的同时,Agent 修改同一份文稿,任何一方保存后,另一方立即看到。
6
+ - **`bento-slides` Skill**:Agent 编写和修改文稿的方法,既适用于工作台里的文稿,也适用于工作区里自成一体的 `.bento.html` 文件。
7
+
8
+ 新建 Project 时,`default_agent` 会预装本插件;其他 Agent 可从插件库安装。
9
+
10
+ ## 幻灯片工作台
11
+
12
+ - **从模板新建。** 在首页逐页预览项目简报或团队复盘,命名后创建可编辑的演示文稿。导出的 PowerPoint 保留文字、形状和演讲备注。
13
+ - **打开已有文稿**。首页按最近编辑时间排列保存的演示文稿,可打开、重命名或删除。点「文件 → 保存演示文稿」或按 Ctrl+S、Cmd+S,会把正在输入的文字一起写入当前文稿。
14
+ - **标签页里的完整编辑器**:Bento 自己的编辑器,含幻灯片列表、画布、文本、形状、图片、表格、图表、morph 过渡与演讲者模式。
15
+ - **用一句话提出修改**:编辑器旁的侧栏把你的请求连同当前所在的幻灯片和选中的元素一起发给 Agent,「把这一页的数字做成柱状图」指的就是这一页。
16
+ - **双方编辑同一份文稿**:一份文稿就是一个文件。编辑器把你的修改保存进去,Agent 用自己的工具修改它;哪一方最后保存,另一方在一秒内载入。在普通对话里提出请求也一样:Agent 写的是同一个文件。
17
+ - **双方的修改都会保留**:你还有未保存的修改时 Agent 保存了文稿,你的修改会按元素重放到它的版本之上。双方改了同一个属性时保留你的值,工作台会提示,Agent 的版本存入文稿的**文件 → 历史版本**,任何一个版本都可以恢复。
18
+ - **文稿可以带走**:**导出为 PowerPoint 文件(.pptx)** 可下载 .pptx,在 PowerPoint 里继续编辑文字、形状、表格和支持的图表。想保留原有动画、媒体和编辑器,可用**下载 Bento HTML 文件(.html)** 得到一个自成一体的 `.bento.html`,任何浏览器都能打开,编辑器就在文件里;**导入 Bento HTML 或 JSON…**可以把它或文稿的 `.json` 再导回来。
19
+
20
+ 开始使用:打开 Agent 对话旁的**幻灯片**标签页,或应用中心里的 **AI PPT**。描述一份文稿后选择**让 AI 生成**,或打开示例文稿。然后点开一页,在右侧侧栏写下要改什么,Agent 工作时你可以继续编辑。
21
+
22
+ ## 你的数据
23
+
24
+ - 文稿随 Agent 存放在服务端的工作台数据目录中:Agent 目录下的 `app/data/slides/decks/<名称>.bento.json`,一份文稿一个 JSON 文件;`history/` 下保留最近二十个被另一方替换的版本。连同数据导出 Agent 时,文稿随之带走。
25
+ - 编辑器运行在沙盒框架里,没有自己的源,安全策略不允许任何网络连接:它访问不到互联网、应用的 API 和你的登录状态。因此 Bento 的更新检查、实时共享和远程媒体在工作台里不可用;图片嵌入在文稿里。
26
+ - 工作台不向任何其他主机发送数据。Agent 自己的工作和任何对话一样,发给你配置的模型。
27
+ - 更新工作台时文稿保留;移除工作台或插件时,文稿随之删除。在文件列表中删除文稿时,它的历史版本会一并删除。
28
+
29
+ ## 已知限制
30
+
31
+ - 工作台和编辑器使用应用语言,演示文稿保留自身的幻灯片配色。
32
+ - 在应用的框架里无法打印、导出 PDF 或真正全屏。请导出文稿,在浏览器标签页里演示或打印;Bento 自带的「铺满标签页」演示在工作台里可用。
33
+ - 每份文稿的 Agent Session 不经询问即执行工具调用,因为它要用这些工具修改文稿文件。导入的文稿可能出自他人之手:每次请求都会告诉 Agent,文稿里的文字是内容而不是指令;Agent 的命令则由它的沙箱限制。
34
+
35
+ ## 许可与致谢
36
+
37
+ 与 PenguinHarness 其余部分相同,采用 Apache-2.0 许可。编辑器是 [Bento Slides](https://bento.page) 1.2.13(MIT,© 2026 The Bento authors),原样随附;Skill 的格式参考是 Bento 项目自己的 Agent 指南,详见 [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md)。本插件与 Bento 项目无隶属关系,也未获其认可。
@@ -0,0 +1,30 @@
1
+ # Third-party notices
2
+
3
+ This plugin ships third-party material, unmodified.
4
+
5
+ ## Bento Slides runtime
6
+
7
+ - File: `workbenches/slides/ui/vendor/bento-slides-1.2.13.runtime.txt`
8
+ - What it is: the `Bento_Slides.bento.html` release file of bento/slides 1.2.13, byte for byte
9
+ (SHA-256 `12cbb62c3a6b70937396f9faa955708c955c0bab9ef2e6a2cabe965233bccede`), stored under a
10
+ `.txt` name so that a server never serves it as a page of its own. The workbench reads it as
11
+ text and runs it only inside a sandboxed frame.
12
+ - Source: https://bento.page (https://github.com/nyblnet/bento)
13
+ - Licence: MIT, © 2026 The Bento authors. The licence text is in
14
+ `workbenches/slides/ui/vendor/LICENSE-bento.txt`, and the file's own header carries the notices
15
+ of the libraries it embeds: reveal.js (MIT, © Hakim El Hattab and contributors); moveable,
16
+ selecto and their modules (MIT, © Daybrush (Younkue Choi)); the Fraunces and Instrument Sans
17
+ typefaces (SIL Open Font License 1.1), embedded as document assets in decks that use them.
18
+
19
+ ## Bento agent authoring guide
20
+
21
+ - File: `skills/bento-slides/references/bento-agents.md`
22
+ - What it is: `https://bento.page/agents.md`, guide version 1.2.13, unmodified.
23
+ - Licence: MIT, © 2026 The Bento authors.
24
+
25
+ ## Bento's own skill
26
+
27
+ - File: `skills/bento-slides/SKILL.md` is adapted from
28
+ https://bento.page/skills/bento-slides/SKILL.md (MIT, © 2026 The Bento authors).
29
+
30
+ "Bento" is the name of that project. This plugin is not affiliated with or endorsed by it.
package/ifaces.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "hash": "b2c151b4aef2abeedae7d1f4ea423e08b6ab99243ad1ca2be10a005eca3644b4",
3
+ "ifaces": {
4
+ "@penguinharness/use-bento-slides#UseBentoSlidesPlugin": {
5
+ "name": "UseBentoSlidesPlugin",
6
+ "methods": {},
7
+ "slots": {}
8
+ }
9
+ },
10
+ "types": {},
11
+ "modules": {
12
+ "UseBentoSlidesPlugin": {
13
+ "name": "UseBentoSlidesPlugin",
14
+ "kind": "component",
15
+ "requires": {},
16
+ "provides": {
17
+ "UseBentoSlidesPlugin": "@penguinharness/use-bento-slides#UseBentoSlidesPlugin"
18
+ },
19
+ "contributes": {
20
+ "PluginLibraryModule.cards": [
21
+ {
22
+ "id": "use-bento-slides.card",
23
+ "title": "Bento Slides",
24
+ "titleZh": "Bento 幻灯片",
25
+ "descriptionZh": "Bento 幻灯片:AI PPT 工作台里,你在编辑器中修改文稿的同时,Agent 修改同一份文稿,双方的修改都会保留;Skill 也能在工作区里编写自成一体的 .bento.html 文稿。",
26
+ "shortDescription": "Edit slide decks with the Agent, live.",
27
+ "shortDescriptionZh": "和 Agent 一起实时编辑幻灯片。",
28
+ "category": "utilities",
29
+ "icon": "icon.svg",
30
+ "quickStart": {
31
+ "prompt": "Make a five-slide deck in the Slides workbench introducing PenguinHarness: a cover, what it does, how it improves itself (with a chart), how to get started, and a closing slide. Tell me when to open the Slides tab.",
32
+ "promptZh": "在幻灯片工作台里做一份五页的文稿介绍 PenguinHarness:封面、它能做什么、它如何自我改进(配一张图表)、如何上手、结尾页。做好后告诉我打开「幻灯片」标签页。",
33
+ "skills": [
34
+ "bento-slides"
35
+ ]
36
+ }
37
+ }
38
+ ],
39
+ "PluginLibraryModule.skills": [
40
+ {
41
+ "id": "use-bento-slides.skill.bento-slides",
42
+ "name": "bento-slides",
43
+ "path": "skills/bento-slides"
44
+ }
45
+ ],
46
+ "PluginLibraryModule.workbenches": [
47
+ {
48
+ "id": "use-bento-slides.workbench.slides",
49
+ "name": "slides",
50
+ "path": "workbenches/slides"
51
+ }
52
+ ]
53
+ },
54
+ "children": []
55
+ }
56
+ },
57
+ "plugin": {
58
+ "modules": [
59
+ "UseBentoSlidesPlugin"
60
+ ],
61
+ "replaces": []
62
+ }
63
+ }
package/package.json CHANGED
@@ -1,13 +1,20 @@
1
1
  {
2
2
  "name": "@penguinharness/use-bento-slides",
3
- "version": "0.2.18",
4
- "description": "Create and edit Bento presentations — self-contained .bento.html decks whose document is JSON. Use whenever the user wants a slide deck or presentation: from scratch, from source material, or by improving an existing file.",
3
+ "version": "0.2.19",
4
+ "description": "Bento slide decks: the Slides workbench, where you edit a deck while the Agent edits the same deck and both sides' edits are kept, and a Skill that authors decks there or as self-contained .bento.html files.",
5
5
  "keywords": [
6
6
  "penguin-plugin",
7
7
  "penguinharness",
8
- "skills"
8
+ "skills",
9
+ "workbench",
10
+ "slides",
11
+ "presentation"
9
12
  ],
10
13
  "license": "Apache-2.0",
14
+ "author": {
15
+ "name": "Prism-Shadow",
16
+ "url": "https://github.com/Prism-Shadow"
17
+ },
11
18
  "repository": {
12
19
  "type": "git",
13
20
  "url": "git+https://github.com/Prism-Shadow/penguin-harness.git",
@@ -16,32 +23,23 @@
16
23
  "files": [
17
24
  "icon.svg",
18
25
  "skills",
26
+ "workbenches",
19
27
  "hooks",
20
- "LICENSE"
28
+ "ifaces.json",
29
+ "LICENSE",
30
+ "THIRD-PARTY-NOTICES.md",
31
+ "README.zh.md"
21
32
  ],
22
33
  "publishConfig": {
23
34
  "access": "public"
24
35
  },
25
- "penguin": {
26
- "short_description": "Author Bento slide decks.",
27
- "short_description_zh": "制作 Bento 幻灯片。",
28
- "category": "office-productivity",
29
- "icon": "icon.svg",
30
- "quick_start": {
31
- "prompt": "Make a three-slide Bento deck in this Workspace introducing PenguinHarness: a title slide, what it does, and how to get started.",
32
- "prompt_zh": "在当前工作区做一份三页的 Bento 幻灯片介绍 PenguinHarness:标题页、它能做什么、如何上手。",
33
- "skills": [
34
- "bento-slides"
35
- ]
36
- },
37
- "title": "Bento Slides",
38
- "title_zh": "Bento 幻灯片"
39
- },
40
36
  "devDependencies": {
41
37
  "vitest": "^4.1.12",
42
- "@prismshadow/skills": "0.2.18"
38
+ "@prismshadow/skills": "0.2.19",
39
+ "@prismshadow/penguin-core": "0.2.19"
43
40
  },
44
41
  "scripts": {
45
- "test": "vitest run"
42
+ "test": "vitest run",
43
+ "build": "node ../../scripts/gen-ifaces.mjs --project tsconfig.json --out ifaces.json"
46
44
  }
47
45
  }
@@ -1,26 +1,90 @@
1
1
  ---
2
2
  name: bento-slides
3
- description: "Create and edit Bento presentations — self-contained .bento.html decks whose document is JSON. Use whenever the user wants a slide deck or presentation: from scratch, from source material, or by improving an existing file."
4
- version: 2026.10.11.1
3
+ description: "Create and edit Bento slide decks, whose document is JSON: in the Slides workbench, where the user edits the same deck while you work, or as a self-contained .bento.html file. Use whenever the user wants a slide deck or presentation, or a request names the Slides workbench or a deck file under app/data/slides/decks/."
4
+ version: 2026.11.19.1
5
5
  ---
6
6
 
7
- # Authoring Bento decks
7
+ # Bento slide decks
8
8
 
9
- A Bento deck is one self-contained `.bento.html` file. The document is plain JSON in a single block:
9
+ A Bento deck is a JSON document (`"format": "bento/slides"`). It lives in one of two places, and the place decides how you edit it:
10
10
 
11
- ```html
12
- <script type="application/bento+json" id="bento-doc"> { "format":"bento/slides", ... } </script>
13
- ```
11
+ - **A deck in the Slides workbench:** one file, `<deck-id>.bento.json`, that holds only the JSON. The user has it open in an editor and may change it while you work. See _Decks in the Slides workbench_.
12
+ - **A standalone `.bento.html` file** in a Workspace: the self-contained Bento app, with the JSON in one block inside it. See _Standalone .bento.html files_.
14
13
 
15
- Edit **that block only**, in place. Escape every `<` in the JSON as `\u003c` so it can never contain a literal `</script>`. Leave the rest of the file — the compressed runtime — untouched. In a chat context the user copies the JSON out instead (*Save ▾ → Copy document JSON*) and pastes the replacement back (*Save ▾ → Replace from JSON…*); `window.bento.loadDoc(json)` does the same from the console.
14
+ A request sent from the workbench names its deck file. A request that names a `.bento.html` file, or asks for a file in the Workspace, is about that file. Otherwise, when the Slides workbench is installed (its folder, below, exists), make the deck there and tell the user to open the **Slides** tab, or the **AI PPT** tile in the App Center; its **Export** button gives a `.bento.html` whenever they want one. Without the workbench, write a `.bento.html` file.
16
15
 
17
- Adapted from the Bento project's own skill, https://bento.page/skills/bento-slides/SKILL.md (MIT, © 2026 The Bento/Suite authors). The authoritative schema and recipe reference is https://bento.page/agents.md.
16
+ The document format, every element type and the copy-paste recipes are in `references/bento-agents.md`: the Bento project's own guide (https://bento.page/agents.md, guide version 1.2.13, MIT, © 2026 The Bento authors), shipped with this skill unmodified, so reading it needs no download. Its notes on installing Bento's own skill do not apply here.
18
17
 
19
18
  ## Before you start
20
19
 
21
- If the user's message only invokes this skill (e.g. "use bento-slides skill") without a concrete request, ask what deck they want before doing anything: the topic, the source material to build it from, and whether to start from scratch or edit an existing `.bento.html`. Do not download anything or write a document until the goal is clear.
20
+ If the user's message only invokes this skill (e.g. "use bento-slides skill") without a concrete request, ask what deck they want before doing anything: the topic, the source material to build it from, and whether to start from scratch or change an existing deck. Do not download anything or write a document until the goal is clear.
21
+
22
+ ## Decks in the Slides workbench
23
+
24
+ The workbench shows the deck in Bento's editor and loads whatever you save within a second, so the user watches your work land: save small, finished steps.
25
+
26
+ ### Where the decks are
27
+
28
+ ```
29
+ <App Data Dir>/agents/<Agent ID>/app/data/slides/decks/<deck-id>.bento.json
30
+ ```
31
+
32
+ Build the path from the Environment section of your system prompt. A request sent from the workbench names the exact file; use that path as given. `<deck-id>` is lower-case letters, digits and hyphens.
33
+
34
+ - **One deck, one file,** holding the deck's document and nothing else: no HTML, no runtime, no `<` escaping.
35
+ - **To create a deck,** write a new `<deck-id>.bento.json` there (make the `decks/` directory if it is missing). It appears in the workbench's deck list at once.
36
+ - **Never write** `collab` into a deck (it would hold the keys to a live sharing room), and never change a deck's `docId`.
37
+ - Leave `history/`, beside `decks/`, alone: the workbench keeps there the versions one side replaced.
38
+
39
+ ### One read-modify-write per step
40
+
41
+ The user may save the same file at any moment, and the workbench rewrites it in its own layout when they do. Text you read a few seconds ago may no longer match. So:
42
+
43
+ 1. **Change the deck with a short script that loads the JSON, changes it and writes it back, in one run.** Do not carry text from an earlier read into a later edit, and do not edit by exact string replacement across turns.
44
+
45
+ ```bash
46
+ python3 - "$DECK" <<'PY'
47
+ import json, sys
48
+ path = sys.argv[1]
49
+ doc = json.load(open(path, encoding="utf-8"))
50
+ slide = next(s for s in doc["slides"] if s["id"] == "numbers")
51
+ title = next(e for e in slide["elements"] if e["id"] == "headline")
52
+ title["html"] = "Revenue by quarter"
53
+ json.dump(doc, open(path, "w", encoding="utf-8"), ensure_ascii=False)
54
+ PY
55
+ ```
56
+
57
+ `node -e` with `JSON.parse` / `JSON.stringify` works the same way. Any valid JSON layout is accepted.
58
+
59
+ 2. **Write the whole file in one step.** A half-written file is shown to the user as "cannot be read right now" until the next write.
60
+ 3. **One coherent step per write:** a slide added, a chart replaced, a colour scheme applied. The user sees each one land.
61
+ 4. **Read only what you need.** Print the slide ids and titles first; open one slide's elements when you work on it. Skip `assets` (picture data, often megabytes): `doc.pop("assets", None)` when printing, and never rewrite a picture you did not change.
22
62
 
23
- ## Starting from nothing
63
+ When the request names a slide ("slide 3 (id "numbers")") or selected elements, those are what "this slide", "this title" and "here" mean.
64
+
65
+ ### Merging with the user's edits
66
+
67
+ The workbench replays the user's own edits on top of your version, element by element, by `id`.
68
+
69
+ - **Keep ids.** Changing an element keeps its `id`; a new element gets a new, descriptive `id` unique on its slide (`revenue-chart`, not `el7`). Renaming an id reads as "deleted one, added another" and drops what the user did to it.
70
+ - **Change only what the request asks for.** Do not reformat, renumber or re-space the rest of the deck: every property you touch is one the user's edit can collide with. On a collision the user's value is kept and yours goes to the deck's history.
71
+ - **Do not remove what the user added** unless asked.
72
+
73
+ Pictures and media in a workbench deck must be embedded (below): the editor there allows no network, so a remote URL does not load.
74
+
75
+ When you are done, answer in one or two sentences: what changed, on which slides. The user already sees the result.
76
+
77
+ ## Standalone .bento.html files
78
+
79
+ A `.bento.html` file is the Bento app with the document inside it, as plain JSON in a single block:
80
+
81
+ ```html
82
+ <script type="application/bento+json" id="bento-doc"> { "format":"bento/slides", ... } </script>
83
+ ```
84
+
85
+ Edit **that block only**, in place. Escape every `<` in the JSON as `<` so it can never contain a literal `</script>`. Leave the rest of the file — the compressed runtime — untouched, and never regenerate the whole file. In a chat context the user copies the JSON out instead (_Save ▾ → Copy document JSON_) and pastes the replacement back (_Save ▾ → Replace from JSON…_); `window.bento.loadDoc(json)` does the same from the console.
86
+
87
+ ### Starting from nothing
24
88
 
25
89
  The user does not need Bento installed — the app ships inside every deck. When there is no `.bento.html` to edit, fetch the latest signed release and author into it:
26
90
 
@@ -31,19 +95,14 @@ curl -fsSL https://bento.page/releases/slides/Bento_Slides.bento.html -o "<Topic
31
95
 
32
96
  On Windows without curl: `iwr https://bento.page/releases/slides/Bento_Slides.bento.html -OutFile <Topic>.bento.html`.
33
97
 
34
- Verify the download contains `id="bento-doc"`, then **replace** that block's JSON — it ships with a showcase deck, which is discarded. For a fresh document:
35
-
36
- - **Fetch https://bento.page/agents.md before authoring** and start from its "Minimal valid document" skeleton. `size` and `theme` (including `theme.fontFamily`) are **required**; the app will not boot without them.
37
- - **Fully specify element fields** as the skeleton shows — shapes need `stroke` / `strokeWidth`, text needs `fontFamily` / `align` / `valign`. Missing fields render wrong or not at all.
38
- - **Omit `docId` and `collab` entirely.** The app mints a fresh identity and dormant collaboration credentials on first open.
98
+ Verify the download contains `id="bento-doc"`, then write the document into that block, replacing whatever it holds. When done, offer to open it (`open` / `xdg-open` / `start`): the file boots straight into the editor with the finished deck. Aim for one pass from request to opened deck.
39
99
 
40
- When done, offer to open it (`open` / `xdg-open` / `start`): the file boots straight into the editor with the finished deck. Aim for one pass from request to opened deck.
100
+ ## Making a good deck
41
101
 
42
- ## Workflow
43
-
44
- 1. **Find the document.** Locate the `#bento-doc` block and parse its JSON. Note `doc.size` (canonical 1280×720), `doc.theme`, existing element `id`s, and whether `doc.template` / `doc.readonly` are set.
45
- 2. **Read the source material** the user gave you and classify each piece — a stat, a table, a process, a definition to expand, a photo.
46
- 3. **Map material to a feature; do not default to bullet text.** This is the step that makes it a Bento deck rather than a slideshow of paragraphs:
102
+ 1. **Read the deck first.** Note `doc.size` (canonical 1280×720), `doc.theme`, the existing element `id`s, and whether `doc.template` / `doc.readonly` are set.
103
+ 2. **For a new deck,** start from the "Minimal valid document" skeleton in `references/bento-agents.md`. A deck needs `format: "bento/slides"`, `version: 1`, `size` and `theme` (including `theme.fontFamily`); the app will not boot without them. **Fully specify element fields** as the skeleton shows (`x, y, w, h, rotation, opacity`, and per type what the guide lists — shapes need `stroke` / `strokeWidth`, text needs `fontFamily` / `align` / `valign`): a missing field renders wrong or not at all. Omit `docId` and `collab`: the app mints a fresh identity on first open.
104
+ 3. **Read the source material** the user gave you and classify each piece — a stat, a table, a process, a definition to expand, a photo.
105
+ 4. **Map material to a feature; do not default to bullet text.** This is the step that makes it a Bento deck rather than a slideshow of paragraphs:
47
106
  - numbers to compare visually (trend, magnitude, share) — a **chart** element
48
107
  - a comparison, spec, pricing or feature grid — a **table** element (`columns` weights, `rows` of `cells`, a `style` object)
49
108
  - consecutive slides about the **same thing changing** — **morph**: give shared elements the same `id` on both slides and `transition:"morph"` on the later one (Bento's signature move; reach for it liberally)
@@ -53,24 +112,25 @@ When done, offer to open it (`open` / `xdg-open` / `start`): the file boots stra
53
112
  - a **headline number** — big text with `fx:{countUp:true}`
54
113
  - **every cover and divider** — at least one ambient motion
55
114
  - **repeated chrome or a logo** — keep its `id` stable across slides so it morphs in place
56
- - a **demo clip, recording or soundbite** — a **media** element (`kind: video|audio`); embed short clips as a data URI, link big ones by URL to keep the file small
57
- 4. **Author** using the schema, keeping https://bento.page/agents.md open for the element shapes, the morph / chart / state / ken-burns snippets and the gotchas. Respect one accent colour, at most two typefaces, 96px side margins (right-most x ≤ 1184), and write **speaker notes** on every slide.
58
- 5. **Self-audit before finishing:**
115
+ - a **demo clip, recording or soundbite** — a **media** element (`kind: video|audio`); embed short clips as a data URI
116
+ 5. **Author** with `references/bento-agents.md` open for the element shapes, the morph / chart / state / ken-burns recipes and the gotchas. Respect one accent colour, at most two typefaces, 96px side margins (right-most x ≤ 1184), and write **speaker notes** on every slide.
117
+ 6. **Self-audit before finishing:**
59
118
  - [ ] any numbers rendered as text that should be a **chart**?
60
119
  - [ ] do consecutive slides on one subject share **ids and `transition:"morph"`**?
61
120
  - [ ] at least one **motion moment** (ken-burns, loop, count-up), especially on the cover?
62
121
  - [ ] a drill-down that would work better as a **state slide**?
63
122
  - [ ] one accent colour, at most two typefaces, 96px margins?
64
123
  - [ ] speaker notes on every slide?
65
- 6. **Write back** the edited `#bento-doc` block (escaping `<` as `\u003c`), or return the replacement JSON. Never regenerate the whole HTML file.
124
+
125
+ You cannot run the Bento app's own `validate()` or `measure()` from here. After a structural change, re-read the document you wrote and check that it parses, that every slide and element has an `id`, and that text boxes are large enough for their text at their font size (a line of N characters at font size F needs about `0.55 * F * N` px of width).
66
126
 
67
127
  ## Critical gotchas
68
128
 
69
129
  - **Charts:** bar and line series `data` must be **plain numbers** — `{value,…}` item objects coerce to 0, and only pie takes `{name,value}`. Colour by series, not per bar. `option` is pure JSON: template formatters only (`{b}` / `{c}` / `{d}`), never functions.
70
130
  - **Morph needs deterministic, stable ids** shared across the slides that should animate together. Different ids mean no morph — the elements just cut.
71
- - **Images and fonts must be embedded** as data URIs in `doc.assets` and referenced by `"asset:<key>"`, so the file stays self-contained.
72
- - **Media:** a `media` element (`kind: video|audio`) embeds short clips as a data URI in `src`, or references a URL for big files. `autoplay` runs only in present mode and needs `muted:true` for video. Do not embed large videos — they bloat the file.
131
+ - **Images and fonts must be embedded** as data URIs in `doc.assets` and referenced by `"asset:<key>"`, so the deck stays self-contained.
132
+ - **Media:** a `media` element (`kind: video|audio`) embeds short clips as a data URI in `src`; a standalone file may reference a URL for big files, a workbench deck may not. `autoplay` runs only in present mode and needs `muted:true` for video. Do not embed large videos — they bloat the deck.
73
133
  - **Never regenerate `docId`** when editing an existing deck; it is the document's identity. Fresh decks omit it and the app mints one.
74
134
  - `template:true` means every open mints a fresh deck; `readonly:true` means the file boots straight into the show with no editor.
75
135
 
76
- Working examples of every technique: open any template at https://bento.page and read its `#bento-doc` block.
136
+ Adapted from the Bento project's own skill, https://bento.page/skills/bento-slides/SKILL.md (MIT, © 2026 The Bento authors). "Bento" is that project's name; this plugin is not affiliated with or endorsed by it.