@pinepaper.studio/mcp-server 1.5.0 → 1.5.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 (49) hide show
  1. package/README.md +0 -25
  2. package/dist/agent/export-manager.d.ts.map +1 -1
  3. package/dist/agent/export-manager.js +24 -14
  4. package/dist/agent/export-manager.js.map +1 -1
  5. package/dist/cli.js +61 -66
  6. package/dist/cli.js.map +1 -1
  7. package/dist/index.d.ts +4 -1
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +66 -17
  10. package/dist/index.js.map +1 -1
  11. package/dist/metrics/types.d.ts +3 -1
  12. package/dist/metrics/types.d.ts.map +1 -1
  13. package/dist/prompts/index.d.ts +3 -12
  14. package/dist/prompts/index.d.ts.map +1 -1
  15. package/dist/prompts/index.js +5 -96
  16. package/dist/prompts/index.js.map +1 -1
  17. package/dist/tools/compact-descriptions.d.ts +1 -1
  18. package/dist/tools/compact-descriptions.d.ts.map +1 -1
  19. package/dist/tools/compact-descriptions.js +44 -13
  20. package/dist/tools/compact-descriptions.js.map +1 -1
  21. package/dist/tools/definitions.d.ts +6 -4
  22. package/dist/tools/definitions.d.ts.map +1 -1
  23. package/dist/tools/definitions.js +154 -37
  24. package/dist/tools/definitions.js.map +1 -1
  25. package/dist/tools/handlers.d.ts.map +1 -1
  26. package/dist/tools/handlers.js +390 -5
  27. package/dist/tools/handlers.js.map +1 -1
  28. package/dist/tools/index.d.ts +3 -1
  29. package/dist/tools/index.d.ts.map +1 -1
  30. package/dist/tools/index.js +2 -1
  31. package/dist/tools/index.js.map +1 -1
  32. package/dist/tools/minimal-descriptions.d.ts +9 -0
  33. package/dist/tools/minimal-descriptions.d.ts.map +1 -0
  34. package/dist/tools/minimal-descriptions.js +158 -0
  35. package/dist/tools/minimal-descriptions.js.map +1 -0
  36. package/dist/tools/toolkits.d.ts +51 -0
  37. package/dist/tools/toolkits.d.ts.map +1 -0
  38. package/dist/tools/toolkits.js +336 -0
  39. package/dist/tools/toolkits.js.map +1 -0
  40. package/dist/types/code-generator.d.ts +1 -5
  41. package/dist/types/code-generator.d.ts.map +1 -1
  42. package/dist/types/code-generator.js +21 -192
  43. package/dist/types/code-generator.js.map +1 -1
  44. package/dist/types/schemas.d.ts +42 -65
  45. package/dist/types/schemas.d.ts.map +1 -1
  46. package/dist/types/schemas.js +24 -48
  47. package/dist/types/schemas.js.map +1 -1
  48. package/manifest.json +30 -6
  49. package/package.json +1 -1
@@ -1,38 +1,12 @@
1
1
  /**
2
2
  * MCP Prompts — Template Recipes
3
3
  *
4
- * Each prompt replicates a specific PinePaper template pattern.
5
- * The assistant message is kept ultra-concise to prevent:
6
- * - Token waste from verbose planning
7
- * - Pipeline restarts from step-by-step tool lists
8
- * - Duplicate items from re-execution
9
- *
10
- * Rules:
11
- * - User message: frames the request with the user's description
12
- * - Assistant message: short commitment to single-pass execution
13
- * - Visual templates: use SINGLE_PASS_RULES (batch_execute) with layer labels (CANVAS/ITEMS/ANIMATE/EFFECTS/PLAY)
14
- * - Diagram templates: use DIAGRAM_RULES (create_diagram_shape + connect + auto_layout)
15
- * - NEVER restart the pipeline
4
+ * Each prompt frames a user request as a single user message.
5
+ * No assistant pre-fill — let the model respond naturally.
6
+ * Workflow rules are handled by start_job guidance and tool descriptions.
16
7
  */
17
8
  // -----------------------------------------------------------------------------
18
- // Shared rules injected into every assistant message
19
- // -----------------------------------------------------------------------------
20
- const SINGLE_PASS_RULES = `RULES — follow exactly:
21
- - start_job → batch_execute (ALL operations in ONE call) → end_job (screenshot) → show user → iterate
22
- - batch_execute supports: set_canvas_size, set_background, execute_generator, create, modify, delete, animate, keyframe_animate, relation, apply_mask, apply_effect, play_timeline
23
- - Use execute_generator for rich backgrounds (drawBokeh, drawGradientMesh, drawWaves, etc.) — much better than solid colors
24
- - NEVER restart the pipeline — if user wants changes, modify items or start a new job
25
- - After end_job, SHOW the screenshot and ask user if the design looks good`;
26
- const DIAGRAM_RULES = `RULES — follow exactly:
27
- - start_job → create shapes (pinepaper_create_diagram_shape) → connect (pinepaper_connect) → optionally auto_layout → end_job
28
- - Analyze the description to infer ALL shapes, decisions, and connections
29
- - Shape types: terminal (start/end), process (steps), decision (branches), data (I/O), document, database
30
- - Position shapes explicitly when layout matters; use auto_layout only for tree/hierarchical flows
31
- - Curved connectors follow source→target regardless of positioning, so manual placement works fine
32
- - NEVER restart the pipeline
33
- - After end_job, SHOW the screenshot and ask user if the design looks good`;
34
- // -----------------------------------------------------------------------------
35
- // Prompt definitions — each has a single declarative description argument
9
+ // Prompt definitions
36
10
  // -----------------------------------------------------------------------------
37
11
  const MOTIVATIONAL_QUOTE_PROMPT = {
38
12
  name: 'motivational-quote',
@@ -100,7 +74,7 @@ export const PROMPTS = [
100
74
  CINEMA_TITLES_PROMPT,
101
75
  ];
102
76
  // -----------------------------------------------------------------------------
103
- // Message builders — ultra-concise, batch-first, no tool lists
77
+ // Message builders — user message only, no assistant pre-fill
104
78
  // -----------------------------------------------------------------------------
105
79
  function buildMotivationalQuote(args = {}) {
106
80
  const description = args.description || 'Dream big — bold and energetic';
@@ -112,19 +86,6 @@ function buildMotivationalQuote(args = {}) {
112
86
  text: `Create an animated motivational quote poster: ${description}`,
113
87
  },
114
88
  },
115
- {
116
- role: 'assistant',
117
- content: {
118
- type: 'text',
119
- text: `I'll create this. All operations in one batch_execute call, then show you the result for feedback.
120
-
121
- ${SINGLE_PASS_RULES}
122
-
123
- CANVAS: execute_generator (match mood) / ITEMS: create text (quote + attribution) / ANIMATE: keyframe_animate (staggered reveals) / EFFECTS: apply_mask (wipeUp or iris) / PLAY: play_timeline.
124
-
125
- Starting now.`,
126
- },
127
- },
128
89
  ];
129
90
  }
130
91
  function buildTextRevealUp(args = {}) {
@@ -137,19 +98,6 @@ function buildTextRevealUp(args = {}) {
137
98
  text: `Create a text reveal animation: ${description}`,
138
99
  },
139
100
  },
140
- {
141
- role: 'assistant',
142
- content: {
143
- type: 'text',
144
- text: `I'll create this. All operations in one batch_execute call, then show you the result.
145
-
146
- ${SINGLE_PASS_RULES}
147
-
148
- CANVAS: execute_generator (match style) / ITEMS: create text (one per word, each on its own line — stack vertically with Y spacing ≥ fontSize × 1.4, NEVER same position) / ANIMATE: keyframe_animate (staggered fade-in, each word 0.3s after previous) / EFFECTS: apply_mask (wipeUp per item) / PLAY: play_timeline.
149
-
150
- Starting now.`,
151
- },
152
- },
153
101
  ];
154
102
  }
155
103
  function buildSimpleDecisionFlow(args = {}) {
@@ -162,19 +110,6 @@ function buildSimpleDecisionFlow(args = {}) {
162
110
  text: `Create a decision flowchart: ${description}`,
163
111
  },
164
112
  },
165
- {
166
- role: 'assistant',
167
- content: {
168
- type: 'text',
169
- text: `I'll create this flowchart using diagram tools, then show you the result.
170
-
171
- ${DIAGRAM_RULES}
172
-
173
- DESIGN: Analyze description → identify shapes (terminal, process, decision) → create_diagram_shape each (position explicitly or let auto_layout arrange) → connect with arrows.
174
-
175
- Starting now.`,
176
- },
177
- },
178
113
  ];
179
114
  }
180
115
  function buildSolarSystem(args = {}) {
@@ -187,19 +122,6 @@ function buildSolarSystem(args = {}) {
187
122
  text: `Create an animated solar system: ${description}`,
188
123
  },
189
124
  },
190
- {
191
- role: 'assistant',
192
- content: {
193
- type: 'text',
194
- text: `I'll create this. All operations in one batch_execute call, then show you the result.
195
-
196
- ${SINGLE_PASS_RULES}
197
-
198
- CANVAS: set_background (#0a0a2e) + execute_generator (drawBokeh starfield) / ITEMS: create (sun, orbits, planets) / ANIMATE: animate (sun pulse) + relation (orbits) + keyframe_animate (comet) / PLAY: play_timeline.
199
-
200
- Starting now.`,
201
- },
202
- },
203
125
  ];
204
126
  }
205
127
  function buildCinemaTitles(args = {}) {
@@ -212,19 +134,6 @@ function buildCinemaTitles(args = {}) {
212
134
  text: `Create a cinematic title sequence: ${description}`,
213
135
  },
214
136
  },
215
- {
216
- role: 'assistant',
217
- content: {
218
- type: 'text',
219
- text: `I'll create this. All operations in one batch_execute call, then show you the result.
220
-
221
- ${SINGLE_PASS_RULES}
222
-
223
- CANVAS: set_background (#000000) / ITEMS: create text (title + subtitle, opacity:0) / ANIMATE: keyframe_animate (fade in + scale, staggered) / EFFECTS: apply_mask (cinematic letterbox) / PLAY: play_timeline.
224
-
225
- Starting now.`,
226
- },
227
- },
228
137
  ];
229
138
  }
230
139
  // -----------------------------------------------------------------------------
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAuBH,gFAAgF;AAChF,qDAAqD;AACrD,gFAAgF;AAEhF,MAAM,iBAAiB,GAAG;;;;;2EAKiD,CAAC;AAE5E,MAAM,aAAa,GAAG;;;;;;;2EAOqD,CAAC;AAE5E,gFAAgF;AAChF,0EAA0E;AAC1E,gFAAgF;AAEhF,MAAM,yBAAyB,GAAmB;IAChD,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EACT,sFAAsF;IACxF,SAAS,EAAE;QACT;YACE,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,mFAAmF;YAChG,QAAQ,EAAE,IAAI;SACf;KACF;CACF,CAAC;AAEF,MAAM,qBAAqB,GAAmB;IAC5C,IAAI,EAAE,gBAAgB;IACtB,WAAW,EACT,iEAAiE;IACnE,SAAS,EAAE;QACT;YACE,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,iFAAiF;YAC9F,QAAQ,EAAE,IAAI;SACf;KACF;CACF,CAAC;AAEF,MAAM,2BAA2B,GAAmB;IAClD,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EACT,8DAA8D;IAChE,SAAS,EAAE;QACT;YACE,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,8EAA8E;YAC3F,QAAQ,EAAE,IAAI;SACf;KACF;CACF,CAAC;AAEF,MAAM,mBAAmB,GAAmB;IAC1C,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EACT,wEAAwE;IAC1E,SAAS,EAAE;QACT;YACE,IAAI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IACtC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;IACD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAE,CAAC;IACjD,OAAO;QACL,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,QAAQ,EAAE,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;KAC9B,CAAC;AACJ,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Compact tool descriptions for reduced context usage.
3
3
  *
4
- * Activated via PINEPAPER_TOOL_VERBOSITY=compact env var.
4
+ * Activated via PINEPAPER_VERBOSITY=compact env var.
5
5
  * Cuts ~58% from the 13 largest tool descriptions while preserving
6
6
  * USE WHEN guidance, critical warnings, and resource doc references.
7
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"compact-descriptions.d.ts","sourceRoot":"","sources":["../../src/tools/compact-descriptions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAyQvD,CAAC"}
1
+ {"version":3,"file":"compact-descriptions.d.ts","sourceRoot":"","sources":["../../src/tools/compact-descriptions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAwTvD,CAAC"}
@@ -1,15 +1,43 @@
1
1
  /**
2
2
  * Compact tool descriptions for reduced context usage.
3
3
  *
4
- * Activated via PINEPAPER_TOOL_VERBOSITY=compact env var.
4
+ * Activated via PINEPAPER_VERBOSITY=compact env var.
5
5
  * Cuts ~58% from the 13 largest tool descriptions while preserving
6
6
  * USE WHEN guidance, critical warnings, and resource doc references.
7
7
  */
8
8
  export const COMPACT_DESCRIPTIONS = {
9
+ // -------------------------------------------------------------------------
10
+ // Minimal toolkit tools — outcome-focused descriptions
11
+ // -------------------------------------------------------------------------
12
+ pinepaper_set_background_color: `Set the canvas background color. Pass a hex color string (e.g. "#0f172a").`,
13
+ pinepaper_set_canvas_size: `Set canvas dimensions. Use width+height or a preset: instagram (1080x1080), youtube (1920x1080), tiktok (1080x1920), twitter (1200x675). Call BEFORE creating items.`,
14
+ pinepaper_get_canvas_size: `Get current canvas width and height.`,
15
+ pinepaper_clear_canvas: `Remove all items from the canvas.`,
16
+ pinepaper_refresh_page: `Reload the PinePaper browser page for a clean start.`,
17
+ pinepaper_browser_connect: `Connect to PinePaper Studio. Usually NOT needed — auto-connects on first tool call.`,
18
+ pinepaper_browser_disconnect: `Disconnect from the browser.`,
19
+ pinepaper_browser_screenshot: `Take a screenshot of the current canvas to show the user.`,
20
+ pinepaper_browser_status: `Check browser connection status.`,
21
+ pinepaper_agent_start_job: `Begin creating an animation or graphic. Call this FIRST, then use batch_execute to build the scene, then end_job to finish.
22
+
23
+ Pass the user's request as "description" for creative direction tips. Use canvasPreset for platform sizing (instagram, youtube, tiktok, twitter).
24
+
25
+ WORKFLOW: start_job → batch_execute (ONE call with ALL operations) → end_job → show screenshot → export if requested.`,
26
+ pinepaper_agent_end_job: `Finish the current animation job. Returns a screenshot — SHOW it to the user and ask if the design looks good.`,
27
+ pinepaper_agent_reset: `Quick canvas reset. Faster than refresh_page.`,
28
+ pinepaper_agent_analyze: `Analyze what's on the canvas and get export recommendations.`,
29
+ pinepaper_get_canvas_presets: `List available canvas size presets (YouTube, Instagram, TikTok, etc.).`,
30
+ pinepaper_tool_guide: `Get detailed docs for any tool or category. Call with no args for the full workflow guide. Call with tool name for that tool's full description.`,
31
+ pinepaper_set_toolkit: `Switch available tools at runtime. Use when the user needs tools not currently visible.
32
+
33
+ Toolkits: agent (animations/graphics), diagram (flowcharts/UML), map (geographic maps), font (font creation), full (all 120+ tools), minimal (core only).
34
+ Verbosity: verbose (full docs), compact (shorter), minimal (1-line summaries).
35
+
36
+ Example: User asks for a map → call set_toolkit({toolkit: "map"}).`,
9
37
  // -------------------------------------------------------------------------
10
38
  // batch_execute — 4382 → ~1200 chars
11
39
  // -------------------------------------------------------------------------
12
- pinepaper_agent_batch_execute: `Execute ALL operations in a single call for building animated scenes — canvas setup, backgrounds, items, animations, masks, effects, and playback.
40
+ pinepaper_agent_batch_execute: `Create animated scenes in a single call — canvas setup, backgrounds, text, shapes, animations, masks, effects, and playback. This is how you build animations on PinePaper.
13
41
 
14
42
  NOTE: For diagrams (flowcharts, UML), use pinepaper_create_diagram_shape + pinepaper_connect instead.
15
43
 
@@ -17,7 +45,14 @@ NOTE: For diagrams (flowcharts, UML), use pinepaper_create_diagram_shape + pinep
17
45
 
18
46
  WORKFLOW: pinepaper_agent_start_job → pinepaper_agent_batch_execute → pinepaper_agent_end_job
19
47
 
20
- OPERATION TYPES (12, use in order): set_canvas_size, set_background, execute_generator, create, modify, delete, animate, keyframe_animate, relation, apply_mask, apply_effect, play_timeline.
48
+ PATTERN — Always follow this order:
49
+ 1. set_canvas_size / set_background / execute_generator (canvas setup)
50
+ 2. create (items — text, shapes, etc.)
51
+ 3. animate or keyframe_animate for EACH created item ("$0", "$1", ...) — REQUIRED for animated content
52
+ 4. relation / apply_mask / apply_effect (optional enhancements)
53
+ 5. play_timeline (REQUIRED — starts playback, without this nothing moves)
54
+
55
+ OPERATION TYPES (12): set_canvas_size, set_background, execute_generator, create, modify, delete, animate, keyframe_animate, relation, apply_mask, apply_effect, play_timeline.
21
56
 
22
57
  VARIABLE REFERENCES: "$0", "$1" etc. reference items by creation order within the batch.
23
58
 
@@ -238,23 +273,19 @@ RETURNS: itemId (for further modifications), metadata (including license).`,
238
273
  // -------------------------------------------------------------------------
239
274
  // agent_export — 1615 → ~900 chars
240
275
  // -------------------------------------------------------------------------
241
- pinepaper_agent_export: `Smart export with automatic format detection and platform optimization.
242
-
243
- USE WHEN: Exporting for social media, print, or web with optimal format auto-selected.
276
+ pinepaper_agent_export: `Export your animation as MP4 video, GIF, PNG, SVG, or PDF. When user asks for "video" or "export", default to MP4.
244
277
 
245
- PLATFORMS:
278
+ PLATFORMS & FORMATS:
246
279
  | Platform | Size | Static | Animated |
247
280
  |------------------|------------|--------|----------|
248
281
  | instagram | 1080x1080 | PNG | MP4 |
249
- | instagram-story | 1080x1920 | PNG | MP4 |
250
- | tiktok | 1080x1920 | PNG | MP4@60fps|
282
+ | tiktok | 1080x1920 | PNG | MP4 |
251
283
  | youtube | 1920x1080 | PNG | MP4 |
252
- | youtube-thumbnail| 1280x720 | PNG | PNG |
253
284
  | twitter | 1200x675 | PNG | GIF |
254
- | linkedin | 1200x627 | PNG | GIF |
255
285
  | web | flexible | SVG | SVG |
256
- | print-a4/letter | A4/Letter | PDF | PDF |
257
286
 
258
- Format override: svg, png, gif, mp4, webm, pdf. Quality: draft, standard, high. See inputSchema for details.`,
287
+ DEFAULT: When user asks for "video" or "export", use format: "mp4". Only use svg/gif if user specifically requests them.
288
+ Formats: svg, png, gif, mp4, webm, pdf. Quality: draft, standard, high.
289
+ ⚠️ If export fails, do NOT retry with different formats — report the error to the user.`,
259
290
  };
260
291
  //# sourceMappingURL=compact-descriptions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"compact-descriptions.js","sourceRoot":"","sources":["../../src/tools/compact-descriptions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAA2B;IAE1D,4EAA4E;IAC5E,qCAAqC;IACrC,4EAA4E;IAC5E,6BAA6B,EAAE;;;;;;;;;;;;;;kHAciF;IAEhH,4EAA4E;IAC5E,mCAAmC;IACnC,4EAA4E;IAC5E,qBAAqB,EAAE;;;;;;;;;;;;;;;;;;;;kEAoByC;IAEhE,4EAA4E;IAC5E,+BAA+B;IAC/B,4EAA4E;IAC5E,iBAAiB,EAAE;;;;;;;;;;;;;;;;EAgBnB;IAEA,4EAA4E;IAC5E,oCAAoC;IACpC,4EAA4E;IAC5E,sB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E,iBAAiB,EAAE;;;;;;;;;;;;;;;yFAeoE;IAEvF,4EAA4E;IAC5E,mCAAmC;IACnC,4EAA4E;IAC5E,qBAAqB,EAAE;;;;;;;;;;;;;;;;oDAgB2B;IAElD,4EAA4E;IAC5E,mCAAmC;IACnC,4EAA4E;IAC5E,sBAAsB,EAAE;;;;;;;;;;;;2EAYiD;IAEzE,4EAA4E;IAC5E,mCAAmC;IACnC,4EAA4E;IAC5E,sBAAsB,EAAE;;;;;;;;;;;;;wFAa8D;CAEvF,CAAC"}
@@ -9,6 +9,7 @@
9
9
  */
10
10
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
11
11
  import { I18nManager } from '../i18n/index.js';
12
+ export declare const AI_AGENT_GUIDE = "WORKFLOW \u2014 Create \u2192 Validate \u2192 Iterate:\n\n1. pinepaper_agent_start_job (clearCanvas: true, canvasPreset)\n2. pinepaper_agent_batch_execute \u2014 ONE call with ALL operations:\n set_canvas_size \u2192 set_background / execute_generator \u2192 create items \u2192 animate / keyframe_animate \u2192 relation \u2192 apply_mask \u2192 apply_effect \u2192 play_timeline\n3. pinepaper_agent_end_job \u2014 returns screenshot\n4. Show screenshot to user for validation\n5. If user wants changes \u2192 modify specific items or start a new job\n\n\u26A0\uFE0F CRITICAL \u2014 Every operation is LIVE on the canvas:\nEvery create, animate, relation, or generator call IMMEDIATELY executes on the connected browser canvas.\nCalling the same operation twice creates DUPLICATE elements. There is no \"preview\" \u2014 it's all live.\nIf you restart the pipeline or re-call batch_execute, you DOUBLE every item on the canvas.\nTo fix mistakes: use modify/delete operations, or start a NEW job with clearCanvas: true.\n\nRULES:\n- NEVER restart the pipeline \u2014 one start_job, one batch_execute, one end_job\n- ALL operations go in batch_execute \u2014 canvas, background, items, animation, masks, effects, playback\n- EXCEPTION: Diagrams (flowcharts, UML) use pinepaper_create_diagram_shape + pinepaper_connect, NOT batch_execute\n- Use generators for rich backgrounds \u2014 the built-in templates are limited, generators create much better visuals\n- Use \"$0\", \"$1\" to reference items by creation order within the batch\n\n\u2500\u2500\u2500 BATCH OPERATIONS (12 types, in order) \u2500\u2500\u2500\n\nCANVAS: set_canvas_size (width/height or preset) \u2192 set_background (color) \u2192 execute_generator (procedural art)\nITEMS: create (itemType, position, properties) \u2192 modify (itemId, properties) \u2192 delete (itemId)\nANIMATE: animate (loop presets) \u2192 keyframe_animate (timed reveals) \u2192 relation (behavioral links)\nEFFECTS: apply_mask (reveal animations) \u2192 apply_effect (sparkle/blast)\nPLAY: play_timeline (start playback)\n\n\u2500\u2500\u2500 GENERATORS (prefer these for backgrounds) \u2500\u2500\u2500\n\nGenerators fill the canvas with procedural art \u2014 much richer than solid colors.\nChoose based on mood:\n Dreamy/soft: drawBokeh, drawGradientMesh, drawOrganicFlow\n Techy/modern: drawCircuit, drawGrid, drawWindField\n Nature/warm: drawSunsetScene, drawSunburst, drawWaves\n Abstract: drawGeometricAbstract, drawFluidFlow, drawNoiseTexture\n Decorative: drawPattern, drawStackedCircles\n\n\u2500\u2500\u2500 ITEMS \u2500\u2500\u2500\n\nShapes: circle, rectangle, star, ellipse, triangle, polygon, line, arc, path\nText: text (content, fontSize, fontFamily, color, fontWeight)\nAll items: opacity, shadowColor, shadowBlur, blendMode, strokeColor, strokeWidth\n\nSVG imports for recognizable objects (planes, cars, animals, buildings):\n pinepaper_search_assets \u2192 pinepaper_import_asset (850k+ SVG icons)\n\n\u2500\u2500\u2500 ANIMATION (all in batch) \u2500\u2500\u2500\n\nLoop presets (animate): pulse, rotate, bounce, fade, wobble, slide, typewriter\nKeyframe (keyframe_animate): [{time, properties, easing}] \u2192 opacity, scale, scaleX, scaleY, x, y, rotation, fillColor, strokeColor, fontSize\nRelations (relation): orbits, follows, attached_to, points_at, mirrors, parallax, wave_through, morphs_to (+ 9 more in batch_execute schema)\nMasks (apply_mask): wipeLeft, wipeRight, wipeUp, wipeDown, iris, irisOut, star, heart, curtainHorizontal, curtainVertical, cinematic, diagonalWipe, revealUp, revealDown\nEffects (apply_effect): sparkle, blast\n\nComposability: one item can have loop + keyframe + relation + mask simultaneously.\n\nTiming templates (stagger reveals across duration):\n 5s: bg 0s \u2192 elements 1-2s \u2192 text 2.5-3.5s \u2192 final 4-5s\n 10s: bg 0-1s \u2192 elements 1-4s \u2192 main 4-7s \u2192 details 7-9s \u2192 finale 9-10s\n\n\u2500\u2500\u2500 VISUAL COMPOSITION \u2500\u2500\u2500\n\nLayer order: background \u2192 large shapes (low opacity) \u2192 main subjects \u2192 text on top\nColor: dark bg (#0f172a) + bright accents (#f472b6, #818cf8, #fbbf24)\nScale: main subject 40-60% of canvas, supporting elements smaller\nSpacing: distribute across canvas with breathing room, don't cluster\n\n\u26A0\uFE0F SIZING \u2014 All positions and sizes MUST fit within the canvas:\n Default canvas is 800x600. For infographics/social media, SET A PRESET FIRST.\n start_job returns canvasSize \u2014 use it to calculate positions.\n Keep all items within 5%-95% of canvas width/height (leave margins).\n Font sizes relative to canvas: titles \u2264 5% of canvas width, body \u2264 3%.\n Example for 1080x1080: title fontSize \u2264 54, body \u2264 32, positions 54-1026.\n Example for 800x600: title fontSize \u2264 40, body \u2264 24, positions 40-760.\n\n\u26A0\uFE0F TEXT OVERLAP \u2014 NEVER place multiple text items at the same position:\n Each text item MUST have a unique Y position. Stack vertically with spacing \u2265 fontSize \u00D7 1.4.\n For N words stacked vertically: startY = centerY - (N-1) \u00D7 spacing / 2, then increment Y by spacing.\n Example for 5 words at fontSize 48 on 800x600: spacing=67, startY=166, positions: 166, 233, 300, 367, 434.\n\n\u2500\u2500\u2500 DIAGRAMS (flowcharts, UML \u2014 do NOT use batch_execute) \u2500\u2500\u2500\n\nDiagrams use their own tools, not batch_execute:\n pinepaper_create_diagram_shape \u2192 pinepaper_connect \u2192 pinepaper_auto_layout\nShapes: process (rect), decision (diamond), terminal (rounded), data, document, database, cloud, server\nWorkflow: create shapes with positions \u2192 connect with arrows \u2192 optional auto_layout\nSee pinepaper://docs/diagrams for full examples.\n\n\u2500\u2500\u2500 CANVAS & EXPORT \u2500\u2500\u2500\n\nPresets: instagram (1080x1080), youtube (1920x1080), tiktok (1080x1920), twitter (1200x675)\nExport: pinepaper_agent_export (SVG/PNG/GIF/MP4/WebM/PDF), pinepaper_export_svg";
12
13
  export declare const PINEPAPER_TOOLS: Tool[];
13
14
  /**
14
15
  * Get a tool definition by name
@@ -25,14 +26,15 @@ export declare function getToolNames(): string[];
25
26
  export declare function getLocalizedTools(i18n: I18nManager): Tool[];
26
27
  /**
27
28
  * Tool description verbosity level.
28
- * - 'verbose': Full descriptions (default, ~42K tokens)
29
+ * - 'verbose': Full descriptions (~42K tokens for full toolkit)
29
30
  * - 'compact': Trimmed descriptions for the 13 largest tools (~37K tokens)
31
+ * - 'minimal': 1-line summaries for all tools (~22K tokens). Use pinepaper_tool_guide for details.
30
32
  */
31
- export type ToolVerbosity = 'verbose' | 'compact';
33
+ export type ToolVerbosity = 'verbose' | 'compact' | 'minimal';
32
34
  /**
33
35
  * Get tools with the specified verbosity level.
34
- * Compact mode swaps in shorter descriptions for the 13 largest tools,
35
- * reducing context usage by ~5K tokens while preserving critical guidance.
36
+ * Compact mode swaps in shorter descriptions for the 13 largest tools.
37
+ * Minimal mode swaps in 1-line summaries for ALL tools (on-demand guide available).
36
38
  */
37
39
  export declare function getToolsForVerbosity(verbosity: ToolVerbosity): Tool[];
38
40
  //# sourceMappingURL=definitions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/tools/definitions.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AA4G/C,eAAO,MAAM,eAAe,EAAE,IAAI,EAq5LjC,CAAC;AAEF;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAE5D;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,EAAE,CAEvC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,EAAE,CAO3D;AAED;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,CAAC;AAElD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,aAAa,GAAG,IAAI,EAAE,CAMrE"}
1
+ {"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/tools/definitions.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAQ/C,eAAO,MAAM,cAAc,83LA8FqD,CAAC;AAWjF,eAAO,MAAM,eAAe,EAAE,IAAI,EAygMjC,CAAC;AAEF;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAE5D;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,EAAE,CAEvC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,EAAE,CAO3D;AAED;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAE9D;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,aAAa,GAAG,IAAI,EAAE,CAQrE"}
@@ -8,11 +8,11 @@
8
8
  * User-facing messages (errors, success) are translated via i18n.
9
9
  */
10
10
  import { COMPACT_DESCRIPTIONS } from './compact-descriptions.js';
11
+ import { MINIMAL_DESCRIPTIONS } from './minimal-descriptions.js';
11
12
  // =============================================================================
12
- // AI AGENT GUIDE
13
+ // AI AGENT GUIDE (exported for pinepaper_tool_guide)
13
14
  // =============================================================================
14
- /*
15
- WORKFLOW — Create → Validate → Iterate:
15
+ export const AI_AGENT_GUIDE = `WORKFLOW — Create → Validate → Iterate:
16
16
 
17
17
  1. pinepaper_agent_start_job (clearCanvas: true, canvasPreset)
18
18
  2. pinepaper_agent_batch_execute — ONE call with ALL operations:
@@ -106,8 +106,11 @@ See pinepaper://docs/diagrams for full examples.
106
106
  ─── CANVAS & EXPORT ───
107
107
 
108
108
  Presets: instagram (1080x1080), youtube (1920x1080), tiktok (1080x1920), twitter (1200x675)
109
- Export: pinepaper_agent_export (SVG/PNG/GIF/MP4/WebM/PDF), pinepaper_export_svg
110
- */
109
+ Export: pinepaper_agent_export (SVG/PNG/GIF/MP4/WebM/PDF), pinepaper_export_svg`;
110
+ /*
111
+ * The AI_AGENT_GUIDE constant above is included as a comment in verbose/compact modes
112
+ * and served on-demand via pinepaper_tool_guide in minimal mode.
113
+ */
111
114
  // =============================================================================
112
115
  // TOOL DEFINITIONS
113
116
  // =============================================================================
@@ -5396,7 +5399,7 @@ If you see significantly higher numbers, investigate:
5396
5399
  },
5397
5400
  phase: {
5398
5401
  type: 'string',
5399
- enum: ['validation', 'code_generation', 'browser_execution', 'screenshot', 'total'],
5402
+ enum: ['validation', 'code_generation', 'browser_execution', 'screenshot', 'total', 'response_size'],
5400
5403
  description: 'Filter by execution phase (optional)',
5401
5404
  },
5402
5405
  since: {
@@ -5416,6 +5419,50 @@ If you see significantly higher numbers, investigate:
5416
5419
  },
5417
5420
  },
5418
5421
  // ---------------------------------------------------------------------------
5422
+ // INFRASTRUCTURE: DIAGNOSTIC REPORT
5423
+ // ---------------------------------------------------------------------------
5424
+ {
5425
+ name: 'pinepaper_diagnostic_report',
5426
+ annotations: {
5427
+ title: 'Generate Diagnostic Report',
5428
+ readOnlyHint: true,
5429
+ destructiveHint: false,
5430
+ idempotentHint: true,
5431
+ openWorldHint: false,
5432
+ },
5433
+ description: `[Utility] Generate a diagnostic report for bug reporting. Collects server config, browser state, session history, canvas snapshot, performance metrics, and token usage estimates into a JSON file.
5434
+
5435
+ USE WHEN:
5436
+ - User encounters an error or unexpected behavior
5437
+ - Filing a bug report and need debugging context
5438
+ - Troubleshooting performance or connection issues
5439
+ - Checking token consumption per tool call to optimize costs
5440
+
5441
+ RETURNS:
5442
+ - JSON file saved to disk with full diagnostic data
5443
+ - Summary text with key state information
5444
+ - Token usage breakdown: estimated response tokens per tool, top consumers, total payload size
5445
+
5446
+ PRIVACY: No screenshots, no tool call arguments, no user content — only structural/timing data.`,
5447
+ inputSchema: {
5448
+ type: 'object',
5449
+ properties: {
5450
+ includeMetrics: {
5451
+ type: 'boolean',
5452
+ description: 'Include performance metrics (default: true)',
5453
+ },
5454
+ includeCanvas: {
5455
+ type: 'boolean',
5456
+ description: 'Include canvas state snapshot (default: true)',
5457
+ },
5458
+ metricsLimit: {
5459
+ type: 'number',
5460
+ description: 'Max metrics entries to include (default: 100)',
5461
+ },
5462
+ },
5463
+ },
5464
+ },
5465
+ // ---------------------------------------------------------------------------
5419
5466
  // INFRASTRUCTURE: AGENT FLOW MODE TOOLS
5420
5467
  // ---------------------------------------------------------------------------
5421
5468
  {
@@ -5443,6 +5490,10 @@ CANVAS PRESETS: instagram (1080x1080), instagram-story (1080x1920), tiktok (1080
5443
5490
  type: 'string',
5444
5491
  description: 'Optional job name for tracking',
5445
5492
  },
5493
+ description: {
5494
+ type: 'string',
5495
+ description: 'Pass the user\'s request/prompt here — the server returns contextual design guidance when the prompt is vague',
5496
+ },
5446
5497
  screenshotPolicy: {
5447
5498
  type: 'string',
5448
5499
  enum: ['on_complete', 'on_error', 'never', 'on_request'],
@@ -5759,12 +5810,6 @@ EXAMPLE — Animated sky scene with timed reveals:
5759
5810
  },
5760
5811
  description: `Smart export with automatic format detection and platform optimization.
5761
5812
 
5762
- USE WHEN:
5763
- - Exporting content for a specific social media platform
5764
- - Need optimal format automatically selected
5765
- - Want platform-specific dimensions and quality
5766
- - Exporting for print or web
5767
-
5768
5813
  PLATFORMS & OPTIMAL FORMATS:
5769
5814
  | Platform | Dimensions | Static | Animated |
5770
5815
  |-----------------|------------|--------|----------|
@@ -5772,31 +5817,19 @@ PLATFORMS & OPTIMAL FORMATS:
5772
5817
  | instagram-story | 1080x1920 | PNG | MP4 |
5773
5818
  | tiktok | 1080x1920 | PNG | MP4@60fps|
5774
5819
  | youtube | 1920x1080 | PNG | MP4 |
5775
- | youtube-thumbnail| 1280x720 | PNG | PNG |
5776
5820
  | twitter | 1200x675 | PNG | GIF |
5777
- | linkedin | 1200x627 | PNG | GIF |
5778
5821
  | web | flexible | SVG | SVG |
5779
- | print-a4 | 2480x3508 | PDF | PDF |
5780
- | print-letter | 2550x3300 | PDF | PDF |
5781
-
5782
- FORMAT OVERRIDE:
5783
- You can specify a format to override auto-detection:
5784
- - svg: Scalable vector (best for web, smallest file)
5785
- - png: High quality raster (best for static social media)
5786
- - gif: Animated (limited to 256 colors)
5787
- - mp4: Video (best quality animations)
5788
- - webm: Video (smaller file, modern browsers)
5789
- - pdf: Print-ready document
5790
-
5791
- QUALITY LEVELS:
5792
- - draft: Fast export, lower quality (good for previews)
5793
- - standard: Balanced quality and file size (default)
5794
- - high: Maximum quality (best for final export)
5822
+
5823
+ FORMATS: svg, png, gif, mp4, webm, pdf.
5824
+ QUALITY: draft, standard, high.
5825
+
5826
+ ⚠️ If export fails, do NOT retry with different formats — report the error to the user.
5827
+ ⚠️ When user asks for "video", always use format: "mp4".
5795
5828
 
5796
5829
  EXAMPLES:
5797
- - Auto-export for Instagram: {platform: "instagram"}
5798
- - Force SVG export: {platform: "web", format: "svg"}
5799
- - High-quality print: {platform: "print-a4", quality: "high"}`,
5830
+ - {platform: "instagram"} — auto-selects best format
5831
+ - {platform: "instagram", format: "mp4"} — force MP4
5832
+ - {platform: "web", format: "svg"} — animated SVG`,
5800
5833
  inputSchema: {
5801
5834
  type: 'object',
5802
5835
  properties: {
@@ -6071,6 +6104,89 @@ EXAMPLES:
6071
6104
  required: ['itemJson', 'itemType'],
6072
6105
  },
6073
6106
  },
6107
+ // ---------------------------------------------------------------------------
6108
+ // ON-DEMAND TOOL GUIDE (RLM-inspired — query detailed docs in minimal mode)
6109
+ // ---------------------------------------------------------------------------
6110
+ {
6111
+ name: 'pinepaper_tool_guide',
6112
+ annotations: {
6113
+ title: 'Tool Guide',
6114
+ readOnlyHint: true,
6115
+ destructiveHint: false,
6116
+ idempotentHint: true,
6117
+ openWorldHint: false,
6118
+ },
6119
+ description: `Get detailed guidance for PinePaper tools on demand.
6120
+
6121
+ USE WHEN: You need full parameter docs, examples, or workflow guidance — especially in minimal verbosity mode where tool descriptions are short summaries.
6122
+
6123
+ MODES:
6124
+ - No args → returns the full AI Agent Guide (workflow, rules, batch operations, visual composition tips)
6125
+ - tool: "pinepaper_agent_batch_execute" → returns that tool's full verbose description
6126
+ - category: "animation" → returns all tools in that category with full descriptions
6127
+
6128
+ CATEGORIES: agent, browser, canvas, core, import, assets, batch, relations, animation, masks, camera, generators, effects, filters, scene, template, query, export, diagram, map, font, letter_collage, triggers, quiz, performance, custom_code, p5, register, guide`,
6129
+ inputSchema: {
6130
+ type: 'object',
6131
+ properties: {
6132
+ tool: {
6133
+ type: 'string',
6134
+ description: 'Tool name to get detailed description for (e.g., "pinepaper_agent_batch_execute")',
6135
+ },
6136
+ category: {
6137
+ type: 'string',
6138
+ description: 'Category/tag name to list all tools with descriptions (e.g., "animation", "map")',
6139
+ },
6140
+ },
6141
+ },
6142
+ },
6143
+ // ---------------------------------------------------------------------------
6144
+ // RUNTIME TOOLKIT SWITCHING
6145
+ // ---------------------------------------------------------------------------
6146
+ {
6147
+ name: 'pinepaper_set_toolkit',
6148
+ annotations: {
6149
+ title: 'Set Toolkit',
6150
+ readOnlyHint: false,
6151
+ destructiveHint: false,
6152
+ idempotentHint: true,
6153
+ openWorldHint: false,
6154
+ },
6155
+ description: `Switch the active toolkit profile and/or verbosity level at runtime. The tools/list updates immediately.
6156
+
6157
+ USE WHEN:
6158
+ - You need diagram tools but are on the 'agent' profile → switch to 'diagram' or 'full'
6159
+ - You need map tools → switch to 'map' or 'full'
6160
+ - You want more/less detail in tool descriptions → switch verbosity
6161
+
6162
+ PROFILES:
6163
+ - full: All 120+ tools
6164
+ - agent: Core creative tools (~50 tools) — default
6165
+ - diagram: Diagram/flowchart tools
6166
+ - map: Map/choropleth tools
6167
+ - font: Font creation tools
6168
+ - minimal: Bare essentials (~15 tools)
6169
+
6170
+ VERBOSITY:
6171
+ - verbose: Full descriptions
6172
+ - compact: Shorter descriptions for 13 largest tools — default
6173
+ - minimal: 1-line summaries (use pinepaper_tool_guide for details)`,
6174
+ inputSchema: {
6175
+ type: 'object',
6176
+ properties: {
6177
+ toolkit: {
6178
+ type: 'string',
6179
+ description: 'Toolkit profile: full, agent, diagram, map, font, minimal',
6180
+ enum: ['full', 'agent', 'diagram', 'map', 'font', 'minimal'],
6181
+ },
6182
+ verbosity: {
6183
+ type: 'string',
6184
+ description: 'Description verbosity: verbose, compact, minimal',
6185
+ enum: ['verbose', 'compact', 'minimal'],
6186
+ },
6187
+ },
6188
+ },
6189
+ },
6074
6190
  ];
6075
6191
  /**
6076
6192
  * Get a tool definition by name
@@ -6098,15 +6214,16 @@ export function getLocalizedTools(i18n) {
6098
6214
  }
6099
6215
  /**
6100
6216
  * Get tools with the specified verbosity level.
6101
- * Compact mode swaps in shorter descriptions for the 13 largest tools,
6102
- * reducing context usage by ~5K tokens while preserving critical guidance.
6217
+ * Compact mode swaps in shorter descriptions for the 13 largest tools.
6218
+ * Minimal mode swaps in 1-line summaries for ALL tools (on-demand guide available).
6103
6219
  */
6104
6220
  export function getToolsForVerbosity(verbosity) {
6105
6221
  if (verbosity === 'verbose')
6106
6222
  return PINEPAPER_TOOLS;
6223
+ const descMap = verbosity === 'minimal' ? MINIMAL_DESCRIPTIONS : COMPACT_DESCRIPTIONS;
6107
6224
  return PINEPAPER_TOOLS.map(tool => {
6108
- const compact = COMPACT_DESCRIPTIONS[tool.name];
6109
- return compact ? { ...tool, description: compact } : tool;
6225
+ const replacement = descMap[tool.name];
6226
+ return replacement ? { ...tool, description: replacement } : tool;
6110
6227
  });
6111
6228
  }
6112
6229
  //# sourceMappingURL=definitions.js.map