@pinepaper.studio/mcp-server 1.5.5 → 1.6.1

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 (80) hide show
  1. package/README.de.md +71 -0
  2. package/README.es.md +71 -0
  3. package/README.fr.md +71 -0
  4. package/README.hi.md +71 -0
  5. package/README.ja.md +71 -0
  6. package/README.ko.md +71 -0
  7. package/README.md +513 -272
  8. package/README.pt-BR.md +71 -0
  9. package/README.zh-CN.md +71 -0
  10. package/assets/easing-splashes.svg +152 -0
  11. package/assets/equation-path.svg +77 -0
  12. package/assets/hero.svg +126 -0
  13. package/assets/live-badge.svg +62 -0
  14. package/assets/poster-sunburst.svg +106 -0
  15. package/dist/__tests__/fixtures/mock-relations.d.ts +48 -0
  16. package/dist/__tests__/fixtures/mock-relations.d.ts.map +1 -1
  17. package/dist/__tests__/fixtures/mock-relations.js +31 -0
  18. package/dist/__tests__/fixtures/mock-relations.js.map +1 -1
  19. package/dist/agent/types.d.ts +6 -6
  20. package/dist/browser/bridge.d.ts +48 -4
  21. package/dist/browser/bridge.d.ts.map +1 -1
  22. package/dist/browser/bridge.js +79 -18
  23. package/dist/browser/bridge.js.map +1 -1
  24. package/dist/browser/puppeteer-controller.d.ts +34 -0
  25. package/dist/browser/puppeteer-controller.d.ts.map +1 -1
  26. package/dist/browser/puppeteer-controller.js +116 -5
  27. package/dist/browser/puppeteer-controller.js.map +1 -1
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +32 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/ontology/index.d.ts +2 -0
  32. package/dist/ontology/index.d.ts.map +1 -1
  33. package/dist/ontology/index.js +2 -0
  34. package/dist/ontology/index.js.map +1 -1
  35. package/dist/ontology/ontology-compiler.d.ts +78 -0
  36. package/dist/ontology/ontology-compiler.d.ts.map +1 -0
  37. package/dist/ontology/ontology-compiler.js +235 -0
  38. package/dist/ontology/ontology-compiler.js.map +1 -0
  39. package/dist/ontology/ontology-validator.d.ts +103 -0
  40. package/dist/ontology/ontology-validator.d.ts.map +1 -0
  41. package/dist/ontology/ontology-validator.js +573 -0
  42. package/dist/ontology/ontology-validator.js.map +1 -0
  43. package/dist/ontology/types.d.ts +1 -0
  44. package/dist/ontology/types.d.ts.map +1 -1
  45. package/dist/ontology/validator.d.ts +6 -0
  46. package/dist/ontology/validator.d.ts.map +1 -1
  47. package/dist/ontology/validator.js +34 -5
  48. package/dist/ontology/validator.js.map +1 -1
  49. package/dist/ontology/vocabulary.d.ts.map +1 -1
  50. package/dist/ontology/vocabulary.js +91 -3
  51. package/dist/ontology/vocabulary.js.map +1 -1
  52. package/dist/tools/definitions.d.ts +1 -1
  53. package/dist/tools/definitions.d.ts.map +1 -1
  54. package/dist/tools/definitions.js +978 -27
  55. package/dist/tools/definitions.js.map +1 -1
  56. package/dist/tools/handlers/maps.d.ts.map +1 -1
  57. package/dist/tools/handlers/maps.js +54 -1
  58. package/dist/tools/handlers/maps.js.map +1 -1
  59. package/dist/tools/handlers/ontology.d.ts.map +1 -1
  60. package/dist/tools/handlers/ontology.js +15 -3
  61. package/dist/tools/handlers/ontology.js.map +1 -1
  62. package/dist/tools/handlers.d.ts.map +1 -1
  63. package/dist/tools/handlers.js +137 -6
  64. package/dist/tools/handlers.js.map +1 -1
  65. package/dist/tools/minimal-descriptions.d.ts.map +1 -1
  66. package/dist/tools/minimal-descriptions.js +20 -1
  67. package/dist/tools/minimal-descriptions.js.map +1 -1
  68. package/dist/tools/toolkits.d.ts.map +1 -1
  69. package/dist/tools/toolkits.js +25 -2
  70. package/dist/tools/toolkits.js.map +1 -1
  71. package/dist/types/code-generator.d.ts +190 -2
  72. package/dist/types/code-generator.d.ts.map +1 -1
  73. package/dist/types/code-generator.js +1068 -30
  74. package/dist/types/code-generator.js.map +1 -1
  75. package/dist/types/schemas.d.ts +2726 -116
  76. package/dist/types/schemas.d.ts.map +1 -1
  77. package/dist/types/schemas.js +594 -4
  78. package/dist/types/schemas.js.map +1 -1
  79. package/manifest.json +299 -71
  80. package/package.json +14 -3
package/README.md CHANGED
@@ -1,70 +1,209 @@
1
1
  # PinePaper MCP Server
2
2
 
3
- > Create animated graphics with AI using the Model Context Protocol
3
+ > Create animated vector graphics with AI using the Model Context Protocol
4
4
 
5
5
  [![npm version](https://badge.fury.io/js/%40pinepaper.studio%2Fmcp-server.svg)](https://www.npmjs.com/package/@pinepaper.studio/mcp-server)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
7
 
8
- ## Overview
8
+ **English** · [简体中文](README.zh-CN.md) · [日本語](README.ja.md) · [한국어](README.ko.md) · [Español](README.es.md) · [Português (BR)](README.pt-BR.md) · [Français](README.fr.md) · [Deutsch](README.de.md) · [हिन्दी](README.hi.md)
9
9
 
10
- PinePaper MCP Server enables AI assistants to create and animate graphics in [PinePaper Studio](https://pinepaper.studio) via the Model Context Protocol (MCP). Works with any AI that supports MCP tool calling (Claude, GPT, Gemini, local models, etc.). Using natural language, you can:
10
+ <p align="center">
11
+ <img src="assets/hero.svg" alt="PinePaper MCP — a tool call on the left becomes motion on the canvas at the right" width="840">
12
+ </p>
11
13
 
12
- - Create text, shapes, and complex graphics
13
- - Animate items with behavior-driven relations
14
- - Generate procedural backgrounds
15
- - Export animated SVG and training data
14
+ *Everything above and below moves — these are animated SVGs exported straight from PinePaper tool calls, no video files, no GIFs. Open this README on GitHub and watch.*
16
15
 
17
- ## Quick Start
16
+ ## Overview
18
17
 
19
- ### 1. Install
18
+ PinePaper MCP Server enables AI assistants to create and animate graphics in [PinePaper Studio](https://pinepaper.studio) via the Model Context Protocol (MCP). Works with any AI that supports MCP tool calling (Claude, GPT, Gemini, local models, etc.).
19
+
20
+ The server exposes **121 tools** across drawing, animation, diagrams, maps, typography, physics, image editing, data visualization, and export. Using natural language, you can:
21
+
22
+ - Create text, shapes, geometry, and complex graphics
23
+ - Animate items with behavior-driven **relations** rather than keyframes
24
+ - Build long scenes as **event-driven chains** that stay scrub- and replay-stable
25
+ - Generate procedural backgrounds and parametric/equation-driven paths
26
+ - Author diagrams, maps, charts, and letter collages
27
+ - Edit images: crop, chroma-key background removal, GPU filters, lasso cutouts, object detection
28
+ - Export animated SVG, video frames, embeddable widgets, and LLM training data
29
+
30
+ ## Made with tool calls
31
+
32
+ Every graphic below is an animated SVG produced through this server's tool surface — the arguments shown beside each result are what an AI agent passes to the named tool. They aren't shell commands; **[Run these yourself](#run-these-yourself)** below shows the three ways to execute them.
33
+
34
+ <table>
35
+ <tr>
36
+ <td width="55%">
37
+
38
+ ```js
39
+ // The scene IS a graph: two items, two declared edges —
40
+ // the canvas view and the graph view are the same data.
41
+ { "sourceId": "$dot",
42
+ "relationType": "moves_along_path",
43
+ "relationOptions": { "path": "$p1", // an ellipse path
44
+ "duration": 6, "easing": "easeInOut", "loop": true } }
45
+ { "itemId": "$square", "animationType": "rotate",
46
+ "options": { "speed": 0.18 } }
47
+ ```
48
+
49
+ </td>
50
+ <td align="center"><img src="assets/poster-sunburst.svg" width="260" alt="The graph is the animation — canvas view above, typed-edge graph below"></td>
51
+ </tr>
52
+ <tr>
53
+ <td>
54
+
55
+ ```js
56
+ // Five rails, five named easings, one loop — each dot is
57
+ // a moves_along_path down its rail with a different easing
58
+ for (const easing of ['linear', 'easeIn', 'easeOut',
59
+ 'easeInOut', 'pingpong']) {
60
+ add_relation($dot, 'moves_along_path', {
61
+ equation: { kind: 'parametric', xExpr: '0', yExpr: 't',
62
+ min: -1, max: 1, scale: 58 },
63
+ duration: 2.6, easing, loop: true });
64
+ }
65
+ ```
20
66
 
21
- ```bash
22
- # Using npm
23
- npm install -g @pinepaper.studio/mcp-server
67
+ </td>
68
+ <td align="center"><img src="assets/easing-splashes.svg" width="300" alt="Five easing curves compared on vertical rails"></td>
69
+ </tr>
70
+ <tr>
71
+ <td>
24
72
 
25
- # Using bun
26
- bun add -g @pinepaper.studio/mcp-server
73
+ ```js
74
+ // The engine solves the curve; the exporter bakes the
75
+ // motion to native SVG keyframes. pinepaper_add_relation:
76
+ { "sourceId": "$dot", "relationType": "moves_along_path",
77
+ "relationOptions": { "equation": {
78
+ "kind": "parametric",
79
+ "xExpr": "cos(2*t)*cos(t)",
80
+ "yExpr": "cos(2*t)*sin(t)",
81
+ "scale": 108, "cx": 280, "cy": 118 },
82
+ "duration": 8, "loop": true } }
27
83
  ```
28
84
 
29
- ### 2. Configure Your AI Client
85
+ </td>
86
+ <td align="center"><img src="assets/equation-path.svg" width="300" alt="A dot tracing the rose curve r = cos(2θ)"></td>
87
+ </tr>
88
+ <tr>
89
+ <td>
90
+
91
+ ```js
92
+ // Status chip: pale panel, slate bar, green dot blinking
93
+ { "itemType": "rectangle", "properties": { "width": 264,
94
+ "height": 72, "fillColor": "#e8eff5" } }
95
+ { "itemType": "circle", "properties": { "radius": 9,
96
+ "fillColor": "#2e9b4e" } }
97
+ { "itemId": "$1", "animationType": "fade",
98
+ "options": { "speed": 1.0 } } // only the dot blinks
99
+ ```
100
+
101
+ </td>
102
+ <td align="center"><img src="assets/live-badge.svg" width="220" alt="LIVE status chip with blinking green dot"></td>
103
+ </tr>
104
+ </table>
105
+
106
+ All five showcase files (including the banner) live in [`assets/`](assets/) — tiny (4–11 KB), dependency-free, loop forever, and render anywhere SVG renders: GitHub READMEs, docs sites, dashboards, emails that allow SVG. They follow one editorial design system (serif mastheads, hairline rules, slate ink on paper white, framed canvas stages, typed-edge graph diagrams) supplied to the agent as context — share a design guideline with your agent and the tool calls come out on-system.
107
+
108
+ ### Try it interactive
109
+
110
+ GitHub can't run scripts inside a README, so the interactive demos live in the editor — one click, no install. Each is a shipped template where the **relation graph** does all the state handling (tabs, accordions, menus — no event-handler code):
30
111
 
31
- Add to your MCP client configuration. Examples:
112
+ - [Tabs from relations](https://pinepaper.studio/editor.html?template=tabs-from-relations) — `on_click_fire` + `exclusive_group` + `on_enter_set_visibility`
113
+ - [Accordion from relations](https://pinepaper.studio/editor.html?template=accordion-from-relations) — disclosure pairs via `on_event_toggle`
114
+ - [Solar system, 4-in-1 tabs](https://pinepaper.studio/editor.html?template=solar-system-tabs) — the state machine driving four scenes
115
+ - [Menubar from relations](https://pinepaper.studio/editor.html?template=menubar-from-relations) — WAI-ARIA menubar semantics from the same graph
32
116
 
33
- **Claude Desktop** (`claude_desktop_config.json`):
34
- - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
35
- - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
117
+ The same graph drives visuals, keyboard access, and screen-reader roles (WCAG 2.1 AA) — see `pinepaper://docs/relations` from your MCP client.
118
+
119
+ ## Run these yourself
120
+
121
+ The snippets above are MCP tool-call arguments — they execute when an AI agent invokes the tool. Three ways to make that happen:
122
+
123
+ **1 · Ask your agent (any MCP client).** With this server [configured](#2-configure-your-ai-client), paste a prompt like:
124
+
125
+ > Create a blue circle and make it ride a diamond-shaped path with easeInOut, looping. Add an orange rotating square beside it. Then export the scene as animated SVG.
126
+
127
+ Your agent picks the tools (`pinepaper_create_item`, `pinepaper_add_relation`, `pinepaper_export_svg`) and runs them.
128
+
129
+ **2 · Hand your agent a complete batch.** This is a full, valid `pinepaper_agent_batch_execute` argument — an agent (or an MCP inspector) can execute it verbatim; `$0`/`$1` reference the created items in order:
36
130
 
37
131
  ```json
38
132
  {
39
- "mcpServers": {
40
- "pinepaper": {
41
- "command": "npx",
42
- "args": ["-y", "@pinepaper.studio/mcp-server"]
43
- }
44
- }
133
+ "operations": [
134
+ { "type": "create", "itemType": "circle",
135
+ "properties": { "x": 300, "y": 260, "radius": 10, "fillColor": "#2e5e8f" } },
136
+ { "type": "relation", "relationType": "moves_along_path", "sourceId": "$0",
137
+ "relationOptions": { "path": [ { "x": 180, "y": 260 }, { "x": 300, "y": 180 },
138
+ { "x": 420, "y": 260 }, { "x": 300, "y": 340 } ],
139
+ "duration": 6, "easing": "easeInOut", "loop": true } },
140
+ { "type": "create", "itemType": "rectangle",
141
+ "properties": { "x": 520, "y": 260, "width": 60, "height": 60, "fillColor": "#f0a030" } },
142
+ { "type": "animate", "itemId": "$1", "animationType": "rotate" }
143
+ ]
45
144
  }
46
145
  ```
47
146
 
48
- **Other MCP Clients**: Refer to your AI client's MCP configuration documentation.
147
+ **3 · No MCP, no agent — just a browser.** Open [pinepaper.studio/editor](https://pinepaper.studio/editor.html), open the browser console, and paste (verified working as-is):
49
148
 
50
- ### 3. Start Using
149
+ ```js
150
+ const app = window.PinePaper;
151
+ const dot = app.create('circle', { x: 300, y: 260, radius: 10, fillColor: '#2e5e8f' });
152
+ app.addRelation(dot.data.id, null, 'moves_along_path', {
153
+ path: [ {x:180,y:260}, {x:300,y:180}, {x:420,y:260}, {x:300,y:340} ],
154
+ duration: 6, easing: 'easeInOut', loop: true,
155
+ });
156
+ const sq = app.create('rectangle', { x: 520, y: 260, width: 60, height: 60, fillColor: '#f0a030' });
157
+ app.animate(sq, { animationType: 'rotate' });
158
+ ```
51
159
 
52
- Open your AI client and try:
160
+ The same code an agent generates is the code you can paste — the canvas is yours either way, undo included.
53
161
 
54
- > "Create a red pulsing text that says HELLO"
162
+ ## What's new in 1.6.0
55
163
 
56
- > "Create a sun and earth, make earth orbit the sun"
164
+ - **Image editing tools**: `pinepaper_crop_image` (one-shot crop, keeps the item's id and relations) and `pinepaper_chroma_key` (green-screen background removal with auto-estimated thresholds)
165
+ - **`pinepaper_media` gains `set_clip`** — re-trim an already-uploaded video/audio clip
166
+ - **Shader auras** in `pinepaper_apply_effect`: `heatmap`, `liquid_metal`, `gem_smoke` (WebGL2, silhouette-clipped)
167
+ - **`pinepaper_image_filter` fixed and expanded** — now routed to the real GPU filter engine with the full 15-filter set (halftone family, posterize, vignette, HSL, tint, dither, blur…)
168
+ - **README as an MCP resource** — clients can read `pinepaper://docs/readme` (and per-language variants) without leaving the protocol
169
+ - This README, in 9 languages, with live animated examples
57
170
 
58
- > "Add a sunburst background with blue and purple colors"
59
171
 
60
- ## Features
172
+ ## Toolkits & Token Budget
173
+
174
+ 121 tools is a lot of context. The server ships a **toolkit** system that serves only the tools a given client needs, plus a **verbosity** system that controls how long each tool description is.
175
+
176
+ **Toolkit profiles** (`PINEPAPER_TOOLKIT`):
177
+
178
+ | Profile | Contents |
179
+ |---------|----------|
180
+ | `full` | Every tool, no filtering (default) |
181
+ | `agent` | Broad authoring surface, minus niche/low-level groups |
182
+ | `diagram` | Canvas + diagram + query/export |
183
+ | `map` | Canvas + map + query/export |
184
+ | `font` | Canvas + font + letter collage + export |
185
+ | `minimal` | Agent, browser, canvas, and guide only |
186
+
187
+ **Verbosity tiers** (`PINEPAPER_VERBOSITY`): `verbose`, `compact` (default), `minimal`.
61
188
 
62
- ### 🤖 Agent Flow Mode (ENFORCED in v1.5.0)
189
+ **Client auto-detection.** When neither env var is set explicitly, the server picks a profile from the MCP `initialize` handshake:
63
190
 
64
- Agent mode is now **enforced by default** for optimal performance:
191
+ | Client | Toolkit | Verbosity |
192
+ |--------|---------|-----------|
193
+ | `claude-ai` | `minimal` | `compact` |
194
+ | `claude-desktop` | `full` | `compact` |
195
+ | `claude-code` | `agent` | `compact` |
196
+ | `cursor` | `full` | `compact` |
197
+ | `windsurf` | `full` | `compact` |
198
+
199
+ Explicit env vars always win. You can also hand-pick tools with `PINEPAPER_TOOLS` (comma-separated names), or switch profiles at runtime with the `pinepaper_set_toolkit` tool. Start with `pinepaper_tool_guide` to have the server explain its own surface.
200
+
201
+ ## Features
202
+
203
+ ### 🤖 Agent Flow Mode (enforced by default)
65
204
 
66
205
  - **Auto-Connection**: Browser connects automatically on first tool call (headless mode)
67
- - **Auto-Session**: Agent sessions start automatically - just start creating!
206
+ - **Auto-Session**: Agent sessions start automatically — just start creating
68
207
  - **Batch Operations**: Execute multiple operations in one call (~10x faster)
69
208
  - **Smart Exports**: Auto-detect optimal format for Instagram, TikTok, YouTube, etc.
70
209
 
@@ -74,200 +213,160 @@ Agent mode is now **enforced by default** for optimal performance:
74
213
  "Analyze the scene and recommend export format"
75
214
  ```
76
215
 
77
- **No manual setup required** - just start making tool calls.
216
+ **No manual setup required** — just start making tool calls.
78
217
 
79
- **Tools:**
80
- - `pinepaper_agent_start_job` - Start a named job session (optional)
81
- - `pinepaper_agent_end_job` - End job with summary and export recommendations
82
- - `pinepaper_agent_reset` - Quick canvas reset
83
- - `pinepaper_agent_batch_execute` - Execute multiple operations in batch
84
- - `pinepaper_agent_export` - Smart export with platform auto-detection
85
- - `pinepaper_agent_analyze` - Analyze content for export recommendations
218
+ ### 🔄 Relations (Behavior-Driven Animation)
86
219
 
87
- ### 🎯 Interactive Triggers (NEW in v1.5.0)
220
+ The **key feature** — describe HOW items should behave, and the engine solves the motion every frame. 39 relation types are available via `pinepaper_add_relation`. Relations are compositional: one item can carry several at once.
88
221
 
89
- Add click, hover, and drag interactions to items:
222
+ **Spatial & motion**
90
223
 
91
- ```
92
- "Make the button show a panel when clicked"
93
- "Add a hover effect that plays an animation"
94
- "Create a drag-and-drop quiz"
95
- ```
224
+ | Relation | Description |
225
+ |----------|-------------|
226
+ | `orbits` | Circular motion around a target |
227
+ | `follows` | Move toward target (with offset) |
228
+ | `attached_to` | Fixed offset from target |
229
+ | `maintains_distance` | Hold a set distance |
230
+ | `points_at` | Rotate to face target |
231
+ | `mirrors` | Mirror target's position |
232
+ | `parallax` | Depth-scaled movement |
233
+ | `bounds_to` | Stay within an area |
234
+ | `wave_through` | Wave propagation across items |
235
+ | `moves_along_path` | Travel along a path or equation |
96
236
 
97
- **Event Types:**
98
- - `click`, `hover_enter`, `hover_exit`
99
- - `drag_start`, `drag_move`, `drag_end`
100
- - `timeline`, `animation_end`
237
+ **Structural layout**
101
238
 
102
- **Tools:**
103
- - `pinepaper_add_trigger` - Add event triggers with actions
104
- - `pinepaper_remove_trigger` - Remove triggers from items
105
- - `pinepaper_query_triggers` - List all triggers
239
+ Static composition expressed as edges instead of hardcoded coordinates. Placement is derived from the target's bounds and re-derived each frame, so moving or resizing the target brings the dependent along — and the layout stays editable as graph data.
106
240
 
107
- ### 📝 Quiz/LMS Integration (NEW in v1.5.0)
241
+ | Relation | Description |
242
+ |----------|-------------|
243
+ | `on_top_of` | Source's bottom edge rests on the target's top edge — stacking (`gap`, `align`, `overhang`) |
244
+ | `below` | Mirror of `on_top_of` — source's top edge on the target's bottom edge |
245
+ | `beside` | Flank the target left or right (`side`, `gap`, `align`) |
246
+ | `inside` | Place within the target's bounds at a 9-way `anchor`, inset by `padding` |
247
+ | `centered_on` | Source center = target center + (`offsetX`, `offsetY`); concentric at zero |
248
+ | `aligned_with` | Match the target on one `axis` only, leaving the other free (`axis` is required) |
108
249
 
109
- Create interactive quizzes with SCORM/xAPI support:
250
+ **Structure & construction**
110
251
 
111
- ```
112
- "Create a multiple choice quiz about planets"
113
- "Add a drag-and-drop matching exercise"
114
- "Track quiz score and progress"
115
- ```
252
+ | Relation | Description |
253
+ |----------|-------------|
254
+ | `is_midpoint_of` | Sit at the midpoint of two items |
255
+ | `lies_on_line` | Constrain onto a line |
256
+ | `is_centroid_of` | Sit at the centroid of a set |
257
+ | `is_circumcenter_of` | Sit at the circumcenter |
258
+ | `concentric_with` | Share a center |
259
+ | `circumscribes` | Enclose a target |
260
+ | `indicates` | Point out / annotate |
261
+ | `construction_reveal` | Staged geometric reveal |
116
262
 
117
- **Question Types:**
118
- - Multiple choice, Multiple select
119
- - Drag-and-drop, Matching, Sequencing
120
- - Hotspot, True/False, Fill-in-blank
263
+ **Animation & camera**
121
264
 
122
- **Tools:**
123
- - `pinepaper_create_quiz` - Create interactive quizzes
124
- - `pinepaper_get_quiz_state` - Get score, progress, answers
125
- - `pinepaper_reset_quiz` - Reset quiz state
265
+ | Relation | Description |
266
+ |----------|-------------|
267
+ | `animates` | Drive a property over time |
268
+ | `grows_from` | Scale in from an origin |
269
+ | `staggered_with` | Offset timing across a set |
270
+ | `morphs_to` / `group_morphs_to` | Shape morphing |
271
+ | `camera_follows` / `camera_animates` | Camera behavior |
126
272
 
127
- ### 📐 Diagram Tools (NEW in v1.4.3)
273
+ **Deterministic binding (Expression IR)**
128
274
 
129
- Create flowcharts, UML diagrams, network diagrams, and more:
275
+ | Relation | Description |
276
+ |----------|-------------|
277
+ | `driven_by` | Bind one property to another: `source.p = target.p * multiplier + offset`, optionally clamped. For `fillColor`/`strokeColor` the driven value interpolates `colorFrom`→`colorTo`, so a relation can drive color. |
278
+ | `time_expression` | Self-relation: drive a property by a math expression of `t` (scene time) and `v` (base value), e.g. `sin(t*2)*50 + v`. |
130
279
 
131
- ```
132
- "Create a flowchart for user login process"
133
- "Make a UML class diagram for the User class"
134
- "Design a network topology with 3 servers connected to a cloud"
135
- ```
280
+ With `signal: true` these compile to a pure `f(t)` Expression IR, making them scrub-, loop-, and replay-stable. Expressions using `random()` or unknown symbols fall back to per-frame evaluation.
136
281
 
137
- **Shape Types:**
138
- - **Flowchart**: process, decision, terminal, data, document, database, preparation
139
- - **UML**: uml-class, uml-usecase, uml-actor
140
- - **Network**: cloud, server
141
- - **Basic**: rectangle, circle, triangle, star
142
-
143
- **Connector Features:**
144
- - Smart routing (orthogonal, direct, curved)
145
- - Arrow styles (classic, stealth, diamond, circle, none)
146
- - Animated bolt effect for data flow
147
- - Labels on connectors
148
-
149
- **Auto-Layout Algorithms:**
150
- - Hierarchical (flowcharts, org charts)
151
- - Force-directed (network diagrams)
152
- - Tree (hierarchies)
153
- - Radial (mind maps)
154
- - Grid (component libraries)
155
-
156
- **Tools:**
157
- - `pinepaper_create_diagram_shape` - Create diagram shapes with ports
158
- - `pinepaper_connect` - Connect items with smart connectors
159
- - `pinepaper_connect_ports` - Connect specific ports
160
- - `pinepaper_add_ports` - Add connection ports to items
161
- - `pinepaper_auto_layout` - Automatically arrange items
162
- - `pinepaper_get_diagram_shapes` - List available shapes
163
- - `pinepaper_update_connector` - Update connector properties
164
- - `pinepaper_remove_connector` - Remove a connector
165
- - `pinepaper_diagram_mode` - Control diagram editing mode
166
-
167
- ### 🔍 Asset Search & Import (NEW in v1.3.0)
282
+ **Event-driven scene chains**
168
283
 
169
- Search and import free SVG assets from multiple repositories:
284
+ | Relation | Description |
285
+ |----------|-------------|
286
+ | `on_event_fire_after` | When source event fires, pulse the target event after a delay (chaining primitive) |
287
+ | `on_event_add_relation` | On fire, add a relation to an item — the scene evolves itself |
288
+ | `on_event_remove_relation` | On fire, tear a relation down |
289
+ | `on_event_set_color` | On fire, set fill/stroke color |
290
+ | `on_event_set_property` | On fire, set any item property |
291
+ | `on_event_set_visibility` | On fire, show/hide |
292
+
293
+ Create channels with `pinepaper_event` (`create` → `eventId`, `pulse` → fire it). Chain beats with `on_event_fire_after` on the `canvas` timeline to author a long scene as a graph of timed beats instead of a keyframe track.
294
+
295
+ **Extras**: relations can target the live pointer via the reserved `targetId` `'cursor'`, and any relation can carry `params.window = { start, end?, repeat? }` to gate when it is active (`repeat`: `once` | `loop` | `pingpong`).
296
+
297
+ ### 🎨 Item Creation & Geometry
170
298
 
171
299
  ```
172
- "Search for a rocket icon"
173
- "Import a cat illustration"
174
- "Add a user avatar icon"
300
+ "Create a blue circle at position 200, 300 with radius 50"
301
+ "Create text saying 'Welcome' with font size 72"
302
+ "Draw the perpendicular bisector of AB"
175
303
  ```
176
304
 
177
- **Supported Repositories:**
178
- - **SVGRepo**: 500,000+ icons with various licenses
179
- - **OpenClipart**: 150,000+ public domain clipart (CC0)
180
- - **Iconify**: 200,000+ icons from multiple icon sets
181
- - **Font Awesome**: 2,000+ free icons (CC BY 4.0)
305
+ Beyond basic shapes, `pinepaper_geometry` provides construction primitives, `pinepaper_group` handles group/ungroup/break-apart, and `pinepaper_arrange` controls z-order (bring forward/back/front/back).
182
306
 
183
- **Tools:**
184
- - `pinepaper_search_assets` - Search across all repositories
185
- - `pinepaper_import_asset` - Import and place on canvas
307
+ ### 🎬 Simple Animations
186
308
 
187
- ### 📊 Performance Metrics (NEW in v1.3.0)
309
+ For quick looping effects: `pulse`, `rotate`, `bounce`, `fade`, `wobble`, `slide`, `typewriter`. For timed work use `pinepaper_keyframe_animate`; query the valid targets with `pinepaper_get_animatable_properties` and `pinepaper_get_available_easings`.
188
310
 
189
- Built-in performance tracking helps AI assistants optimize workflows:
311
+ ### 🖼️ Background Generators
190
312
 
191
- - Automatic timing for all tool operations
192
- - Phase breakdown (validation, code generation, execution, screenshots)
193
- - Export formats: summary, detailed JSON, CSV
194
- - Self-optimization through `pinepaper_get_performance_metrics`
313
+ 31 procedural generators via `pinepaper_execute_generator` (list them with `pinepaper_list_generators`):
314
+
315
+ `drawBlobs`, `drawBokeh`, `drawCircuit`, `drawFluidFlow`, `drawFormulaArt`, `drawFunctionPlot`, `drawGeometricAbstract`, `drawGlobeWireframe`, `drawGradientMesh`, `drawGrid`, `drawHalftone`, `drawLowPoly`, `drawNoiseTexture`, `drawOrganicFlow`, `drawParametricCollection`, `drawParametricCurve`, `drawPattern`, `drawPeaks`, `drawRibbons`, `drawScatter`, `drawShaderArt`, `drawSimulation`, `drawSpectrumAnalyzer`, `drawStackedCircles`, `drawStackedWaves`, `drawSunburst`, `drawSunsetScene`, `drawTruchet`, `drawWaves`, `drawWindField`, `drawYeganehMountains`
316
+
317
+ ### 📐 Diagram Tools
318
+
319
+ Create flowcharts, UML diagrams, network diagrams, and more:
195
320
 
196
- **Example workflow:**
197
321
  ```
198
- 1. Run your scene creation workflow
199
- 2. Call pinepaper_get_performance_metrics
200
- 3. Identify bottlenecks (e.g., individual creates vs batch)
201
- 4. Adjust approach and re-run
322
+ "Create a flowchart for user login process"
323
+ "Make a UML class diagram for the User class"
324
+ "Design a network topology with 3 servers connected to a cloud"
202
325
  ```
203
326
 
204
- ### 🐛 Enhanced Error Messages (NEW in v1.3.0)
327
+ - **Shape types** — Flowchart: process, decision, terminal, data, document, database, preparation · UML: uml-class, uml-usecase, uml-actor · Network: cloud, server · Basic: rectangle, circle, triangle, star
328
+ - **Connectors** — smart routing (orthogonal, direct, curved), arrow styles (classic, stealth, diamond, circle, none), animated bolt effect, labels
329
+ - **Auto-layout** — hierarchical, force-directed, tree, radial, grid
330
+ - **Mermaid** — import existing diagrams with `pinepaper_import_mermaid`
205
331
 
206
- Errors now include canvas context for easier debugging:
332
+ ### 🗺️ Maps
207
333
 
208
- - Total item count and types
209
- - Active relations
210
- - Recent items created
211
- - Canvas state at time of error
334
+ Choropleths, region styling, and data-driven map animation via `pinepaper_map`, `pinepaper_map_regions`, `pinepaper_map_animation`, and `pinepaper_map_data`.
212
335
 
213
- Makes troubleshooting much faster and more precise.
336
+ ### 🔤 Typography
214
337
 
215
- ### 🎨 Item Creation
338
+ `pinepaper_font` covers font loading and text-to-path work; `pinepaper_create_letter_collage` and `pinepaper_animate_letter_collage` build and animate letterform collages.
216
339
 
217
- Create text, shapes, and custom graphics:
340
+ ### 🔍 Asset Search & Import
218
341
 
219
- ```
220
- "Create a blue circle at position 200, 300 with radius 50"
221
- "Add a gold star in the center"
222
- "Create text saying 'Welcome' with font size 72"
223
- ```
224
-
225
- ### 🔄 Relations (Behavior-Driven Animation)
342
+ Search and import free SVG assets from multiple repositories:
226
343
 
227
- The **key feature** - describe HOW items should behave:
344
+ - **SVGRepo**: 500,000+ icons with various licenses
345
+ - **OpenClipart**: 150,000+ public domain clipart (CC0)
346
+ - **Iconify**: 200,000+ icons from multiple icon sets
347
+ - **Font Awesome**: 2,000+ free icons (CC BY 4.0)
228
348
 
229
- | Relation | Description | Example |
230
- |----------|-------------|---------|
231
- | `orbits` | Circular motion | "Moon orbits Earth" |
232
- | `follows` | Move toward target | "Label follows player" |
233
- | `attached_to` | Fixed offset | "Hat attached to character" |
234
- | `maintains_distance` | Stay at distance | "Satellite 200px from station" |
235
- | `points_at` | Face target | "Arrow points at target" |
236
- | `mirrors` | Mirror position | "Reflection mirrors original" |
237
- | `parallax` | Depth movement | "Background parallax scroll" |
238
- | `bounds_to` | Stay within area | "Player stays in arena" |
349
+ ### 🖼️ Image Processing & Object Detection
239
350
 
240
- ### 🎬 Simple Animations
351
+ Import images, then use `pinepaper_image_filter`, `pinepaper_lasso`, and `pinepaper_cutout_style` to process them. `pinepaper_detect_objects` runs object detection (with text queries) and can composite results as nodes; `pinepaper_extract_object` pulls a single object out.
241
352
 
242
- For quick looping effects:
353
+ ### 🧠 Ontology & Validation
243
354
 
244
- - `pulse` - Scale up/down
245
- - `rotate` - Continuous spin
246
- - `bounce` - Vertical bounce
247
- - `fade` - Opacity cycle
248
- - `wobble` - Side-to-side
249
- - `slide` - Horizontal slide
250
- - `typewriter` - Character reveal
355
+ The server keeps a design graph of the canvas, so an AI can inspect and critique its own work: `pinepaper_get_canvas_ontology`, `pinepaper_query_ontology`, `pinepaper_analyze_design`, `pinepaper_validate_design`, `pinepaper_validate`, and `pinepaper_validate_scene`.
251
356
 
252
- ### 🖼️ Background Generators
357
+ ### 📊 Performance Metrics
253
358
 
254
- Procedural patterns:
359
+ Built-in performance tracking helps AI assistants optimize workflows:
255
360
 
256
- - `drawSunburst` - Radial rays
257
- - `drawSunsetScene` - Animated sunset
258
- - `drawGrid` - Lines, dots, squares
259
- - `drawWaves` - Layered waves
260
- - `drawCircuit` - Tech circuit board
361
+ - Automatic timing for all tool operations
362
+ - Phase breakdown (validation, code generation, execution, screenshots)
363
+ - Export formats: summary, detailed JSON, CSV
364
+ - Self-optimization through `pinepaper_get_performance_metrics`
261
365
 
262
366
  ### 📊 Training Data Export
263
367
 
264
368
  Generate instruction/code pairs for LLM fine-tuning:
265
369
 
266
- ```
267
- "Export training data from this scene"
268
- ```
269
-
270
- Outputs pairs like:
271
370
  ```json
272
371
  {
273
372
  "instruction": "moon orbits earth at radius 100",
@@ -277,57 +376,130 @@ Outputs pairs like:
277
376
 
278
377
  ## Tools Reference
279
378
 
280
- ### Item Tools
379
+ All 121 tools, grouped by the tag used for toolkit filtering.
380
+
381
+ ### Canvas (`canvas`)
382
+ | Tool | Description |
383
+ |------|-------------|
384
+ | `pinepaper_set_background_color` | Set background color |
385
+ | `pinepaper_set_canvas_size` | Set canvas dimensions |
386
+ | `pinepaper_get_canvas_size` | Read canvas dimensions |
387
+ | `pinepaper_clear_canvas` | Clear the canvas |
388
+ | `pinepaper_refresh_page` | Reload the studio page |
389
+ | `pinepaper_background` | Manage background layers |
390
+
391
+ ### Item Creation (`core`)
281
392
  | Tool | Description |
282
393
  |------|-------------|
283
394
  | `pinepaper_create_item` | Create text, shapes, graphics |
284
395
  | `pinepaper_modify_item` | Change item properties |
285
396
  | `pinepaper_delete_item` | Remove an item |
286
- | `pinepaper_batch_create` | Create multiple items at once |
287
- | `pinepaper_batch_modify` | Modify multiple items at once |
288
397
  | `pinepaper_create_grid` | Create items in a grid layout |
289
398
  | `pinepaper_create_glossy_sphere` | Create 3D glossy sphere effect |
290
399
  | `pinepaper_create_diagonal_stripes` | Create diagonal stripe pattern |
400
+ | `pinepaper_geometry` | Geometric construction primitives |
401
+ | `pinepaper_group` | Group / ungroup / break apart |
402
+ | `pinepaper_arrange` | Z-order: bring forward/back/front/back |
403
+
404
+ ### Batch (`batch`)
405
+ | Tool | Description |
406
+ |------|-------------|
407
+ | `pinepaper_batch_create` | Create multiple items at once |
408
+ | `pinepaper_batch_modify` | Modify multiple items at once |
291
409
 
292
- ### Relation Tools
410
+ ### Import (`import`)
293
411
  | Tool | Description |
294
412
  |------|-------------|
295
- | `pinepaper_add_relation` | Create behavioral relationship |
296
- | `pinepaper_remove_relation` | Remove relationship |
413
+ | `pinepaper_import_svg` | Import SVG markup |
414
+ | `pinepaper_import_image` | Import a raster image |
415
+ | `pinepaper_detect_objects` | Detect objects in an image (text queries, composite as nodes) |
416
+ | `pinepaper_extract_object` | Extract a detected object |
417
+
418
+ ### Assets (`assets`)
419
+ | Tool | Description |
420
+ |------|-------------|
421
+ | `pinepaper_search_assets` | Search SVG assets across repositories |
422
+ | `pinepaper_import_asset` | Import asset from search results |
423
+
424
+ ### Relations (`relations`)
425
+ | Tool | Description |
426
+ |------|-------------|
427
+ | `pinepaper_add_relation` | Create a behavioral relationship |
428
+ | `pinepaper_remove_relation` | Remove a relationship |
297
429
  | `pinepaper_query_relations` | Find existing relations |
430
+ | `pinepaper_register_custom_relation` | Register a custom relation type |
298
431
 
299
- ### Animation Tools
432
+ ### Animation (`animation`)
300
433
  | Tool | Description |
301
434
  |------|-------------|
302
- | `pinepaper_animate` | Apply simple loop animation |
435
+ | `pinepaper_animate` | Apply a simple loop animation |
303
436
  | `pinepaper_keyframe_animate` | Timed keyframe animation |
304
437
  | `pinepaper_play_timeline` | Control playback |
438
+ | `pinepaper_get_animatable_properties` | List animatable properties |
439
+ | `pinepaper_get_available_easings` | List easing functions |
440
+ | `pinepaper_construction_sequence` | Staged construction animation |
441
+
442
+ ### Masks (`masks`)
443
+ | Tool | Description |
444
+ |------|-------------|
445
+ | `pinepaper_apply_animated_mask` | Apply an animated mask |
446
+ | `pinepaper_apply_custom_mask` | Apply a custom mask |
447
+ | `pinepaper_remove_mask` | Remove a mask |
448
+ | `pinepaper_get_mask_types` | List mask types |
449
+ | `pinepaper_get_mask_animations` | List mask animations |
450
+
451
+ ### Camera (`camera`)
452
+ | Tool | Description |
453
+ |------|-------------|
454
+ | `pinepaper_camera` | Camera state control |
455
+ | `pinepaper_camera_animate` | Animate the camera |
456
+ | `pinepaper_camera_director` | Shot-level camera direction |
305
457
 
306
- ### Generator Tools
458
+ ### Scene & Events (`scene`)
307
459
  | Tool | Description |
308
460
  |------|-------------|
309
- | `pinepaper_execute_generator` | Run background generator |
461
+ | `pinepaper_create_scene` | Create a scene |
462
+ | `pinepaper_manage_scenes` | Manage scenes |
463
+ | `pinepaper_scene_playback` | Scene playback control |
464
+ | `pinepaper_event` | Create / pulse event channels for scene chains |
465
+
466
+ ### Generators, Effects & Filters
467
+ | Tool | Description |
468
+ |------|-------------|
469
+ | `pinepaper_execute_generator` | Run a background generator |
310
470
  | `pinepaper_list_generators` | List available generators |
471
+ | `pinepaper_apply_effect` | Apply sparkle, blast, and other effects |
472
+ | `pinepaper_add_filter` | Add an image filter |
311
473
 
312
- ### Effect Tools
474
+ ### Editing (`selection`, `transform`, `history`)
313
475
  | Tool | Description |
314
476
  |------|-------------|
315
- | `pinepaper_apply_effect` | Apply sparkle, blast effects |
477
+ | `pinepaper_selection` | Selection management |
478
+ | `pinepaper_transform` | Transform items |
479
+ | `pinepaper_history` | Undo / redo |
316
480
 
317
- ### Asset Tools (NEW)
481
+ ### Image Processing (`image_processing`)
318
482
  | Tool | Description |
319
483
  |------|-------------|
320
- | `pinepaper_search_assets` | Search for SVG assets across repositories |
321
- | `pinepaper_import_asset` | Import asset from search results |
484
+ | `pinepaper_image_filter` | Apply image filters |
485
+ | `pinepaper_lasso` | Lasso selection on images |
486
+ | `pinepaper_cutout_style` | Cutout styling |
322
487
 
323
- ### Query Tools
488
+ ### Composition (`precomp`, `deform`, `sprite`, `interaction`)
324
489
  | Tool | Description |
325
490
  |------|-------------|
326
- | `pinepaper_get_items` | Get canvas items |
327
- | `pinepaper_get_relation_stats` | Relation statistics |
328
- | `pinepaper_get_performance_metrics` | Get execution timing metrics |
491
+ | `pinepaper_precomp` | Pre-composition management |
492
+ | `pinepaper_deform` | Deformation tools |
493
+ | `pinepaper_sprite_sheet` | Sprite sheet handling |
494
+ | `pinepaper_interaction` | Click, hover, and drag interactions |
329
495
 
330
- ### Diagram Tools (NEW in v1.4.3)
496
+ ### Data Visualization (`dataviz`)
497
+ | Tool | Description |
498
+ |------|-------------|
499
+ | `pinepaper_create_chart` | Create a chart |
500
+ | `pinepaper_equation_path` | Function / parametric / Fourier equation paths |
501
+
502
+ ### Diagram (`diagram`)
331
503
  | Tool | Description |
332
504
  |------|-------------|
333
505
  | `pinepaper_create_diagram_shape` | Create flowchart/UML/network shapes with ports |
@@ -339,42 +511,103 @@ Outputs pairs like:
339
511
  | `pinepaper_update_connector` | Update connector style/label |
340
512
  | `pinepaper_remove_connector` | Remove a connector |
341
513
  | `pinepaper_diagram_mode` | Control diagram editing mode |
514
+ | `pinepaper_import_mermaid` | Import a Mermaid diagram |
342
515
 
343
- ### Agent Flow Mode Tools (NEW in v1.5.0)
516
+ ### Map (`map`)
344
517
  | Tool | Description |
345
518
  |------|-------------|
346
- | `pinepaper_agent_start_job` | Start content creation job session |
347
- | `pinepaper_agent_end_job` | End job with summary and recommendations |
348
- | `pinepaper_agent_reset` | Quick canvas reset without page refresh |
349
- | `pinepaper_agent_batch_execute` | Execute multiple operations in batch |
350
- | `pinepaper_agent_export` | Smart export with platform auto-detection |
351
- | `pinepaper_agent_analyze` | Analyze content for export recommendations |
519
+ | `pinepaper_map` | Create / configure a map |
520
+ | `pinepaper_map_regions` | Region styling and selection |
521
+ | `pinepaper_map_animation` | Animate a map |
522
+ | `pinepaper_map_data` | Bind data to a map |
523
+ | `pinepaper_globe` | Globe mode + world tour |
352
524
 
353
- ### Interactive Trigger Tools (NEW in v1.5.0)
525
+ ### Media (`media`)
354
526
  | Tool | Description |
355
527
  |------|-------------|
356
- | `pinepaper_add_trigger` | Add event triggers (click, hover, drag) |
357
- | `pinepaper_remove_trigger` | Remove triggers from items |
358
- | `pinepaper_query_triggers` | List all triggers on canvas |
528
+ | `pinepaper_media` | Video/audio from a URL (upload, list, remove, playback rate) |
359
529
 
360
- ### Quiz/LMS Tools (NEW in v1.5.0)
530
+ ### Rigging (`rigging`)
361
531
  | Tool | Description |
362
532
  |------|-------------|
363
- | `pinepaper_create_quiz` | Create interactive quizzes |
364
- | `pinepaper_get_quiz_state` | Get quiz score, progress, answers |
365
- | `pinepaper_reset_quiz` | Reset quiz to initial state |
533
+ | `pinepaper_rigging` | Skeletons, bones, IK chains, breakdown-pose keyframes |
366
534
 
367
- ### Canvas Tools
535
+ ### Typography (`font`, `letter_collage`)
368
536
  | Tool | Description |
369
537
  |------|-------------|
370
- | `pinepaper_set_background_color` | Set background |
371
- | `pinepaper_set_canvas_size` | Set dimensions |
538
+ | `pinepaper_font` | Font loading and text-to-path |
539
+ | `pinepaper_create_letter_collage` | Create a letterform collage |
540
+ | `pinepaper_animate_letter_collage` | Animate a letterform collage |
372
541
 
373
- ### Export Tools
542
+ ### Simulation & Utilities (`magic`, `physics`, `measurement`, `template`)
543
+ | Tool | Description |
544
+ |------|-------------|
545
+ | `pinepaper_magic` | High-level "make it look good" helpers |
546
+ | `pinepaper_physics` | Physics simulation |
547
+ | `pinepaper_measurement` | Measurement and annotation |
548
+ | `pinepaper_apply_template` | Apply a scene template |
549
+
550
+ ### Query (`query`)
551
+ | Tool | Description |
552
+ |------|-------------|
553
+ | `pinepaper_get_items` | Get canvas items |
554
+ | `pinepaper_get_relation_stats` | Relation statistics |
555
+ | `pinepaper_query` | General canvas query |
556
+
557
+ ### Ontology (`ontology`)
558
+ | Tool | Description |
559
+ |------|-------------|
560
+ | `pinepaper_get_canvas_ontology` | Get the canvas design graph |
561
+ | `pinepaper_query_ontology` | Query the design graph |
562
+ | `pinepaper_analyze_design` | Analyze design quality |
563
+ | `pinepaper_validate_design` | Validate against design rules |
564
+ | `pinepaper_validate` | General validation |
565
+ | `pinepaper_validate_scene` | Validate scene integrity |
566
+ | `pinepaper_instantiate_ontology` | Compile a pp: design graph into a scene |
567
+ | `pinepaper_lint_scene` | Relational-density audit + structural-relation suggestions |
568
+
569
+ ### Export (`export`)
374
570
  | Tool | Description |
375
571
  |------|-------------|
376
572
  | `pinepaper_export_svg` | Export animated SVG |
573
+ | `pinepaper_export_scene` | Export the scene |
377
574
  | `pinepaper_export_training_data` | Export LLM training pairs |
575
+ | `pinepaper_export_widget` | Export an embeddable widget |
576
+ | `pinepaper_export_widget_html` | Export widget HTML |
577
+ | `pinepaper_capture_frames` | Capture deterministic frames |
578
+
579
+ ### Agent Flow (`agent`)
580
+ | Tool | Description |
581
+ |------|-------------|
582
+ | `pinepaper_agent_start_job` | Start a content creation job session |
583
+ | `pinepaper_agent_end_job` | End job with summary and recommendations |
584
+ | `pinepaper_agent_reset` | Quick canvas reset without page refresh |
585
+ | `pinepaper_agent_batch_execute` | Execute multiple operations in batch |
586
+ | `pinepaper_agent_export` | Smart export with platform auto-detection |
587
+ | `pinepaper_agent_analyze` | Analyze content for export recommendations |
588
+
589
+ ### Browser (`browser`)
590
+ | Tool | Description |
591
+ |------|-------------|
592
+ | `pinepaper_browser_connect` | Connect to the studio |
593
+ | `pinepaper_browser_disconnect` | Disconnect |
594
+ | `pinepaper_browser_screenshot` | Take a screenshot |
595
+ | `pinepaper_browser_status` | Connection status |
596
+
597
+ ### Guide & Diagnostics
598
+ | Tool | Description |
599
+ |------|-------------|
600
+ | `pinepaper_tool_guide` | Server-side guide to the tool surface |
601
+ | `pinepaper_set_toolkit` | Switch toolkit profile at runtime |
602
+ | `pinepaper_get_performance_metrics` | Get execution timing metrics |
603
+ | `pinepaper_diagnostic_report` | Diagnostic report |
604
+
605
+ ### Escape Hatches (`custom_code`, `p5`, `register`)
606
+ | Tool | Description |
607
+ |------|-------------|
608
+ | `pinepaper_execute_custom_code` | Run custom code against the app |
609
+ | `pinepaper_p5_draw` | p5.js-style drawing |
610
+ | `pinepaper_register_item` | Register an externally created item |
378
611
 
379
612
  ## Examples
380
613
 
@@ -405,7 +638,18 @@ Outputs pairs like:
405
638
  3. Add relation: label follows player with offset [0, -50]
406
639
  ```
407
640
 
408
- ### Flowchart Diagram (NEW)
641
+ ### Event-Driven Scene Chain
642
+
643
+ ```
644
+ 1. Create events e0, e1, e2 (one per beat)
645
+ 2. Chain them: on_event_fire_after e0 → e1 (delay 2000, timeline: canvas)
646
+ 3. Chain: on_event_fire_after e1 → e2 (delay 2000, timeline: canvas)
647
+ 4. Give beat 1 a reaction: on_event_add_relation e1 → planet (type: orbits)
648
+ 5. Give beat 2 a reaction: on_event_set_color e2 → planet (color: #ff3300)
649
+ 6. Pulse e0 to start — the whole chain is scrub- and replay-stable
650
+ ```
651
+
652
+ ### Flowchart Diagram
409
653
 
410
654
  ```
411
655
  1. Create a terminal shape with label "Start"
@@ -419,7 +663,7 @@ Outputs pairs like:
419
663
  9. Apply hierarchical auto-layout
420
664
  ```
421
665
 
422
- ### Network Diagram (NEW)
666
+ ### Network Diagram
423
667
 
424
668
  ```
425
669
  1. Create a cloud shape with label "Internet"
@@ -432,27 +676,29 @@ Outputs pairs like:
432
676
 
433
677
  ## Architecture
434
678
 
679
+ The server does not draw anything itself. It validates a tool call, generates JavaScript that calls PinePaper Studio's `app.*` API, and executes it in the browser — so the studio app stays the single source of truth for behavior.
680
+
435
681
  ```
436
682
  ┌─────────────────────────────────────────────────────────────┐
437
683
  │ AI Client (Claude, etc.) │
438
684
  │ │ │
439
685
  │ MCP Protocol │
440
686
  │ │ │
441
- │ ┌───────────▼───────────┐ │
442
- │ │ PinePaper MCP Server │ │
443
- │ │ ┌─────────────────┐ │ │
444
- │ │ │ Tool Handlers │ │ │
445
- │ │ └────────┬────────┘ │ │
446
- │ │ │ │ │
447
- │ │ ┌────────▼────────┐ │ │
448
- │ │ │ Code Generator │ │ │
449
- │ │ └────────┬────────┘ │ │
450
- │ └───────────┼───────────┘ │
687
+ │ ┌───────────▼───────────┐ │
688
+ │ │ PinePaper MCP Server │ │
689
+ │ │ ┌─────────────────┐ │ │
690
+ │ │ │ Tool Handlers │ │ validate + route │
691
+ │ │ └────────┬────────┘ │ │
692
+ │ │ │ │ │
693
+ │ │ ┌────────▼────────┐ │ │
694
+ │ │ │ Code Generator │ │ emit app.* calls │
695
+ │ │ └────────┬────────┘ │ │
696
+ │ └───────────┼───────────┘ │
451
697
  │ │ │
452
- │ ┌───────────▼───────────┐ │
453
- │ │ PinePaper Studio │ │
454
- │ │ (Browser/App) │ │
455
- │ └───────────────────────┘ │
698
+ │ ┌───────────▼───────────┐ │
699
+ │ │ PinePaper Studio │ execute in browser │
700
+ │ │ (Browser/App) │ │
701
+ │ └───────────────────────┘ │
456
702
  └─────────────────────────────────────────────────────────────┘
457
703
  ```
458
704
 
@@ -477,10 +723,6 @@ bun run build
477
723
 
478
724
  1. Build the server:
479
725
  ```bash
480
- # Using npm
481
- npm run build
482
-
483
- # Using bun
484
726
  bun run build
485
727
  ```
486
728
 
@@ -502,24 +744,30 @@ bun run build
502
744
 
503
745
  ### Run Tests
504
746
 
505
- ```bash
506
- # Using npm
507
- npm test
747
+ Tests run on the Bun test runner.
508
748
 
509
- # Using bun
749
+ ```bash
510
750
  bun test
511
751
 
512
- # Run with coverage
752
+ # With coverage
513
753
  bun test --coverage
754
+
755
+ # Typecheck
756
+ bun run typecheck
514
757
  ```
515
758
 
516
- ### Development Watch Mode
759
+ ### Manifest Check
760
+
761
+ `manifest.json`'s `tools[]` must stay in sync with the served tool surface. This is enforced on publish (`prepublishOnly`), and you can run it directly:
517
762
 
518
763
  ```bash
519
- # Using npm
520
- npm run dev
764
+ bun run check:manifest # verify
765
+ bun run fix:manifest # rewrite manifest to match source
766
+ ```
767
+
768
+ ### Development Watch Mode
521
769
 
522
- # Using bun
770
+ ```bash
523
771
  bun run dev
524
772
  ```
525
773
 
@@ -538,20 +786,11 @@ PinePaper MCP Server supports 51 languages, providing localized tool description
538
786
  | **Middle Eastern** | Arabic, Hebrew, Persian (RTL support) |
539
787
  | **Indigenous (Canada)** | Chipewyan, Cree, Michif, Inuktitut, Mi'kmaq, Mohawk, Ojibwe |
540
788
 
541
- ### How It Works
542
-
543
- The i18n system provides localized:
544
- - Tool names and descriptions
545
- - Error messages
546
- - Success messages
547
- - UI labels for item types, relations, animations, and generators
548
-
549
789
  ### Setting Language
550
790
 
551
791
  Set the `PINEPAPER_LOCALE` environment variable:
552
792
 
553
- ```bash
554
- # In MCP client config (example for Claude Desktop)
793
+ ```json
555
794
  {
556
795
  "mcpServers": {
557
796
  "pinepaper": {
@@ -570,10 +809,7 @@ Or programmatically:
570
809
  ```typescript
571
810
  import { setLocale, t } from '@pinepaper.studio/mcp-server';
572
811
 
573
- // Set locale
574
812
  setLocale('fr');
575
-
576
- // Get translated string
577
813
  const description = t('tools.pinepaper_create_item.description');
578
814
  ```
579
815
 
@@ -593,17 +829,21 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
593
829
 
594
830
  | Variable | Description | Default |
595
831
  |----------|-------------|---------|
596
- | `PINEPAPER_DEBUG` | Enable debug logging | `false` |
597
- | `PINEPAPER_LOG_LEVEL` | Log level (error/warn/info/debug) | `info` |
832
+ | `PINEPAPER_STUDIO_URL` | PinePaper Studio URL to connect to (`/editor` is appended automatically) | `https://pinepaper.studio` |
833
+ | `PINEPAPER_HEADLESS` | Run the browser headless (set `false` to watch it work) | `true` |
834
+ | `PINEPAPER_EXECUTION_MODE` | `puppeteer` (execute in a real browser) or `code` (return generated code only) | `puppeteer` |
835
+ | `PINEPAPER_EXPORT_DIR` | Directory for exported files | `<tmpdir>/pinepaper-exports` |
598
836
  | `PINEPAPER_LOCALE` | Language locale code | `en` |
837
+ | `PINEPAPER_TOOLKIT` | Toolkit profile (`full`/`agent`/`diagram`/`map`/`font`/`minimal`) | auto-detected |
838
+ | `PINEPAPER_TOOLS` | Explicit comma-separated tool allowlist | unset |
839
+ | `PINEPAPER_VERBOSITY` | Description verbosity (`verbose`/`compact`/`minimal`) | `compact` |
840
+ | `PINEPAPER_TOOL_VERBOSITY` | Deprecated alias for `PINEPAPER_VERBOSITY` | unset |
599
841
  | `PINEPAPER_METRICS_ENABLED` | Enable performance metrics tracking | `true` |
600
842
  | `PINEPAPER_METRICS_RETENTION` | Max metrics to retain in memory | `1000` |
601
- | `PINEPAPER_SCREENSHOT_MODE` | Screenshot mode (on_request/always/never) | `on_request` |
843
+ | `PINEPAPER_SCREENSHOT_MODE` | Screenshot mode (`on_request`/`always`/`never`) | `on_request` |
602
844
 
603
845
  ### Performance Metrics
604
846
 
605
- PinePaper MCP Server includes built-in performance tracking to help AI assistants optimize workflows by identifying bottlenecks and choosing faster alternatives.
606
-
607
847
  **Key Features:**
608
848
  - ⚡ Automatic timing for all tool operations
609
849
  - 📊 Phase breakdown (validation, code generation, browser execution, screenshots)
@@ -641,9 +881,10 @@ export PINEPAPER_METRICS_RETENTION=5000
641
881
 
642
882
  ### Guides
643
883
 
644
- - **[Workflow Guide](docs/WORKFLOW_GUIDE.md)** - Decision trees, multi-step patterns, performance optimization, and troubleshooting
645
- - **[Performance Metrics](docs/PERFORMANCE_METRICS.md)** - In-memory metrics system for AI self-optimization
646
- - **[PinePaper Reference](https://pinepaper.studio/api/)** - Complete PinePaper Studio API reference
884
+ - **[Workflow Guide](docs/WORKFLOW_GUIDE.md)** — Decision trees, multi-step patterns, performance optimization, and troubleshooting
885
+ - **[Performance Metrics](docs/PERFORMANCE_METRICS.md)** — In-memory metrics system for AI self-optimization
886
+ - **[Testing Guide](TESTING_GUIDE.md)** — Test layout and conventions
887
+ - **[PinePaper Reference](https://pinepaper.studio/api/)** — Complete PinePaper Studio API reference
647
888
 
648
889
  ### External Documentation
649
890
 
@@ -661,7 +902,7 @@ We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guid
661
902
  1. Fork the repository
662
903
  2. Create a feature branch
663
904
  3. Make your changes
664
- 4. Run tests: `npm test`
905
+ 4. Run tests: `bun test`
665
906
  5. Submit a pull request
666
907
 
667
908
  ## License