@pinepaper.studio/mcp-server 1.6.28 → 1.6.29

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 (52) hide show
  1. package/README.md +27 -0
  2. package/SECURITY.md +2 -3
  3. package/dist/agent/export-manager.js +125 -125
  4. package/dist/assets/repositories/fontawesome.d.ts.map +1 -1
  5. package/dist/assets/repositories/fontawesome.js +2 -1
  6. package/dist/assets/repositories/fontawesome.js.map +1 -1
  7. package/dist/assets/repositories/iconify.d.ts.map +1 -1
  8. package/dist/assets/repositories/iconify.js +4 -3
  9. package/dist/assets/repositories/iconify.js.map +1 -1
  10. package/dist/browser/puppeteer-controller.js +38 -23
  11. package/dist/build-info.json +2 -2
  12. package/dist/cli.js +54 -54
  13. package/dist/execution/canvas-state.js +25 -25
  14. package/dist/i18n/locales/en.js +22 -22
  15. package/dist/i18n/locales/fil.js +44 -44
  16. package/dist/i18n/locales/is.js +22 -22
  17. package/dist/i18n/locales/ur.js +22 -22
  18. package/dist/index.js +5559 -5559
  19. package/dist/ontology/upstream-vocabulary.js +4 -4
  20. package/dist/tools/craft-tools.js +18 -18
  21. package/dist/tools/definitions.d.ts.map +1 -1
  22. package/dist/tools/definitions.js +2816 -2815
  23. package/dist/tools/definitions.js.map +1 -1
  24. package/dist/tools/effect-check.js +68 -68
  25. package/dist/tools/engine-methods.d.ts.map +1 -1
  26. package/dist/tools/engine-methods.js +1 -1
  27. package/dist/tools/engine-methods.js.map +1 -1
  28. package/dist/tools/handlers/font.js +22 -22
  29. package/dist/tools/handlers/generate.d.ts.map +1 -1
  30. package/dist/tools/handlers/generate.js +2 -1
  31. package/dist/tools/handlers/generate.js.map +1 -1
  32. package/dist/tools/handlers.js +16 -16
  33. package/dist/tools/lane.js +64 -64
  34. package/dist/tools/p5-compat/p5-helpers.js +341 -341
  35. package/dist/tools/timeline.js +82 -82
  36. package/dist/types/code-generator.d.ts.map +1 -1
  37. package/dist/types/code-generator.js +6616 -5859
  38. package/dist/types/code-generator.js.map +1 -1
  39. package/dist/types/schemas.d.ts +2 -0
  40. package/dist/types/schemas.d.ts.map +1 -1
  41. package/dist/types/schemas.js +2 -0
  42. package/dist/types/schemas.js.map +1 -1
  43. package/dist/utils/safe-fetch.d.ts +8 -0
  44. package/dist/utils/safe-fetch.d.ts.map +1 -1
  45. package/dist/utils/safe-fetch.js +125 -34
  46. package/dist/utils/safe-fetch.js.map +1 -1
  47. package/dist/vendor/design/device-mockup-generator.js +167 -150
  48. package/dist/vendor/design/recursive-subdivision-generator.js +107 -107
  49. package/dist/vendor/design/textile-weave-generator.js +429 -429
  50. package/dist/vendor/design/ui-kit-runtime.js +674 -674
  51. package/manifest.json +1 -1
  52. package/package.json +7 -4
@@ -16,74 +16,74 @@
16
16
  * playhead and live transforms, so during playback every no-op looked changed.
17
17
  */
18
18
  /** In-page fingerprint, shared by both probes. */
19
- const FINGERPRINT_JS = `function __ppFingerprint() {
20
- // AUTHORED state, not the live frame. The engine's full snapshot carries the
21
- // playhead and every item's CURRENT transform, so while the timeline plays
22
- // every call looked changed — the three misses of the first live sweep
23
- // (re-applied colour, same canvas size, a repeated highlight). Animated
24
- // values are left out; what a call can author is kept.
25
- const o = {};
26
- const playing = !!app.isPlayingKeyframes;
27
- const plain = function (k, v) {
28
- if (typeof k === 'string' && (k.charAt(0) === '_' || /^(selected|hovered|isHovered|cached|lastRender|renderTick|frame|playbackTime|time)$/.test(k))) return undefined;
29
- if (typeof v === 'function') return undefined;
30
- if (v && typeof v === 'object' && (v.data instanceof Uint8ClampedArray || (typeof ImageData !== 'undefined' && v instanceof ImageData))) return undefined;
31
- if (v && typeof v === 'object' && typeof v.toCSS === 'function') return v.toCSS(true);
32
- return v;
33
- };
34
- const S = function (v) { try { return JSON.stringify(v, plain); } catch (e) { return ''; } };
35
- try {
36
- const reg = app.itemRegistry && app.itemRegistry.getAll ? app.itemRegistry.getAll() : null;
37
- if (reg) {
38
- o.items = reg.map(function (e) {
39
- const it = e.item || {};
40
- const d = it.data || {};
41
- const keys = Array.isArray(d.keyframes) ? d.keyframes : [];
42
- const animated = {};
43
- keys.forEach(function (k) { Object.keys((k && k.properties) || {}).forEach(function (p) { animated[p] = 1; }); });
44
- const moves = keys.length || (d.animationType && d.animationType !== 'none');
45
- const style = {};
46
- ['fillColor', 'strokeColor', 'strokeWidth', 'opacity', 'fontSize', 'fontFamily', 'content', 'visible', 'blendMode'].forEach(function (p) {
47
- if (!animated[p] && !(p === 'fillColor' && animated.color) && it[p] !== undefined) style[p] = plain(p, it[p]);
48
- });
49
- if (!moves && it.position) style.at = [Math.round(it.position.x), Math.round(it.position.y)];
50
- if (!moves && it.scaling) style.scale = [Math.round(it.scaling.x * 1000), Math.round(it.scaling.y * 1000)];
51
- if (!moves && typeof it.rotation === 'number') style.rot = Math.round(it.rotation * 100);
52
- return (e.id || e.itemId) + '|' + (e.type || '') + '|' + S(d) + '|' + S(style);
53
- }).join('\\n');
54
- }
55
- } catch (e) {}
56
- try { const rr = app.relationRegistry; if (rr && rr.exportForSave) o.relations = S(rr.exportForSave()); } catch (e) {}
57
- try { if (app.listRenderHooks) o.renderHooks = S(app.listRenderHooks()); } catch (e) {}
58
- // Patterns are scene state of their own: a phase_wave at t=0 or before its
59
- // window moves no member, so the items alone read a real create or modify as
60
- // no change.
61
- try { if (app.listPatterns) o.patterns = S(app.listPatterns()); } catch (e) {}
62
- // SCENE-LEVEL STATE OUTSIDE ITEMS (sweep v2: add_filter and camera_animate
63
- // were real changes read as none). The camera's track is a relation on the
64
- // pseudo-source 'camera', which no registry item carries.
65
- try { if (app.filterSystem && app.filterSystem.exportForSave) o.filters = S(app.filterSystem.exportForSave()); } catch (e) {}
66
- try {
67
- // Camera keyframes live in relationRegistry._cameraAnimation.params (a
68
- // virtual item, no registry entry), read through getCameraAnimationParams.
69
- // getRelations('camera') looks in the associations and is always empty
70
- // for them (sweep v3: camera_animate still read as no change).
71
- const rr = app.relationRegistry;
72
- const cam = rr && rr.getCameraAnimationParams ? rr.getCameraAnimationParams() : null;
73
- const tilt = rr && rr.cameraTilt;
74
- o.camera = S([cam, tilt && tilt.serialize ? tilt.serialize() : null]);
75
- } catch (e) {}
76
- try { const c = app.config || {}; o.background = S([c.currentBackgroundMode, c.currentBackgroundGenerator, c.generatorParams, app.canvasEl && app.canvasEl.style && app.canvasEl.style.backgroundColor]); } catch (e) {}
77
- try { const cs = app.getCanvasSize && app.getCanvasSize(); if (cs) o.canvas = cs.width + 'x' + cs.height + (cs.unbounded ? ':unbounded' : ''); } catch (e) {}
78
- try {
79
- // The view moves on its own while a camera animation plays.
80
- const v = app.view || (typeof paper !== 'undefined' && paper.view);
81
- if (!playing && v && v.center) o.view = Math.round(v.zoom * 1000) + '@' + Math.round(v.center.x) + ',' + Math.round(v.center.y);
82
- } catch (e) {}
83
- try { if (app.mapSystem && app.mapSystem.getRegionOverrideCount) o.mapColours = app.mapSystem.getRegionOverrideCount() + ':' + S(app.mapSystem._regionColorOverrides ? Array.from(app.mapSystem._regionColorOverrides.entries()) : null); } catch (e) {}
84
- try { if (app._initialized && app._initialized.has('synthSounds')) o.sounds = S(app.synthSounds.list().map(function (x) { return [x.id, x.startTime, x.duration]; })); } catch (e) {}
85
- return o;
86
- }`;
19
+ const FINGERPRINT_JS = ("function __ppFingerprint() {\n // AUTHORED state, not the live frame. The engine's full snapshot carries the\n // playhead and every item's CURRENT transform, so while the timeline plays\n // every call looked changed — the three misses of the first live sweep\n // (re-applied colour, same canvas size, a repeated highlight). Animated\n // values are left out; what a call can author is kept.\n const o = {};\n const playing = !!app.isPlayingKeyframes;\n const plain = function (k, v) {\n if (typeof k === 'string' && (k.charAt(0) === '_' || /^(selected|hovered|isHovered|cached|lastRender|renderTick|frame|playbackTime|time)$/.test(k))) return undefined;\n if (typeof v === 'functio" +
20
+ "n') return undefined;\n if (v && typeof v === 'object' && (v.data instanceof Uint8ClampedArray || (typeof ImageData !== 'undefined' && v instanceof ImageData))) return undefined;\n if (v && typeof v === 'object' && typeof v.toCSS === 'function') return v.toCSS(true);\n return v;\n };\n const S = function (v) { try { return JSON.stringify(v, plain); } catch (e) { return ''; } };\n try {\n const reg = app.itemRegistry && app.itemRegistry.getAll ? app.itemRegistry.getAll() : null;\n if (reg) {\n o.items = reg.map(function (e) {\n const it = e.item || {};\n const d = it.data || {};\n const keys = Array.isArray(d.keyframes) ? d.keyframes : [];\n " +
21
+ " const animated = {};\n keys.forEach(function (k) { Object.keys((k && k.properties) || {}).forEach(function (p) { animated[p] = 1; }); });\n const moves = keys.length || (d.animationType && d.animationType !== 'none');\n const style = {};\n ['fillColor', 'strokeColor', 'strokeWidth', 'opacity', 'fontSize', 'fontFamily', 'content', 'visible', 'blendMode'].forEach(function (p) {\n if (!animated[p] && !(p === 'fillColor' && animated.color) && it[p] !== undefined) style[p] = plain(p, it[p]);\n });\n if (!moves && it.position) style.at = [Math.round(it.position.x), Math.round(it.position.y)];\n if (!moves && it.scaling) style.scale = [M" +
22
+ "ath.round(it.scaling.x * 1000), Math.round(it.scaling.y * 1000)];\n if (!moves && typeof it.rotation === 'number') style.rot = Math.round(it.rotation * 100);\n return (e.id || e.itemId) + '|' + (e.type || '') + '|' + S(d) + '|' + S(style);\n }).join('\\n');\n }\n } catch (e) {}\n try { const rr = app.relationRegistry; if (rr && rr.exportForSave) o.relations = S(rr.exportForSave()); } catch (e) {}\n try { if (app.listRenderHooks) o.renderHooks = S(app.listRenderHooks()); } catch (e) {}\n // Patterns are scene state of their own: a phase_wave at t=0 or before its\n // window moves no member, so the items alone read a real create or modify as\n // no change.\n try" +
23
+ " { if (app.listPatterns) o.patterns = S(app.listPatterns()); } catch (e) {}\n // SCENE-LEVEL STATE OUTSIDE ITEMS (sweep v2: add_filter and camera_animate\n // were real changes read as none). The camera's track is a relation on the\n // pseudo-source 'camera', which no registry item carries.\n try { if (app.filterSystem && app.filterSystem.exportForSave) o.filters = S(app.filterSystem.exportForSave()); } catch (e) {}\n try {\n // Camera keyframes live in relationRegistry._cameraAnimation.params (a\n // virtual item, no registry entry), read through getCameraAnimationParams.\n // getRelations('camera') looks in the associations and is always empty\n // for them (sweep v3: c" +
24
+ "amera_animate still read as no change).\n const rr = app.relationRegistry;\n const cam = rr && rr.getCameraAnimationParams ? rr.getCameraAnimationParams() : null;\n const tilt = rr && rr.cameraTilt;\n o.camera = S([cam, tilt && tilt.serialize ? tilt.serialize() : null]);\n } catch (e) {}\n try { const c = app.config || {}; o.background = S([c.currentBackgroundMode, c.currentBackgroundGenerator, c.generatorParams, app.canvasEl && app.canvasEl.style && app.canvasEl.style.backgroundColor]); } catch (e) {}\n try { const cs = app.getCanvasSize && app.getCanvasSize(); if (cs) o.canvas = cs.width + 'x' + cs.height + (cs.unbounded ? ':unbounded' : ''); } catch (e) {}\n try {\n /" +
25
+ "/ The view moves on its own while a camera animation plays.\n const v = app.view || (typeof paper !== 'undefined' && paper.view);\n if (!playing && v && v.center) o.view = Math.round(v.zoom * 1000) + '@' + Math.round(v.center.x) + ',' + Math.round(v.center.y);\n } catch (e) {}\n try { if (app.mapSystem && app.mapSystem.getRegionOverrideCount) o.mapColours = app.mapSystem.getRegionOverrideCount() + ':' + S(app.mapSystem._regionColorOverrides ? Array.from(app.mapSystem._regionColorOverrides.entries()) : null); } catch (e) {}\n try { if (app._initialized && app._initialized.has('synthSounds')) o.sounds = S(app.synthSounds.list().map(function (x) { return [x.id, x.startTime, x.duratio" +
26
+ "n]; })); } catch (e) {}\n return o;\n}"
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+ );
87
87
  export const EFFECT_BEFORE_JS = `(function () {
88
88
  ${FINGERPRINT_JS}
89
89
  window.__ppEffectBefore = __ppFingerprint();
@@ -1 +1 @@
1
- {"version":3,"file":"engine-methods.d.ts","sourceRoot":"","sources":["../../src/tools/engine-methods.ts"],"names":[],"mappings":"AAUA;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAyOpD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAsDpD,CAAC"}
1
+ {"version":3,"file":"engine-methods.d.ts","sourceRoot":"","sources":["../../src/tools/engine-methods.ts"],"names":[],"mappings":"AAUA;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EA0OpD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAqDpD,CAAC"}
@@ -162,6 +162,7 @@ export const REQUIRED_ENGINE_METHODS = [
162
162
  'mapSystem.tourRegions',
163
163
  'mapSystem.worldTour',
164
164
  'matchCut',
165
+ 'modifyItem',
165
166
  'modifyRelationParams',
166
167
  'outlineStroke',
167
168
  'panWorldCamera',
@@ -294,7 +295,6 @@ export const OPTIONAL_ENGINE_METHODS = [
294
295
  'listTextPalettes',
295
296
  'mapSystem.canvasToGeo',
296
297
  'mapSystem.getMapSourceInfo',
297
- 'modifyItem',
298
298
  'poseAt',
299
299
  'registerItem',
300
300
  'relationRegistry.exportForSave',
@@ -1 +1 @@
1
- {"version":3,"file":"engine-methods.js","sourceRoot":"","sources":["../../src/tools/engine-methods.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAsB;IACxD,cAAc;IACd,YAAY;IACZ,oBAAoB;IACpB,kBAAkB;IAClB,aAAa;IACb,eAAe;IACf,eAAe;IACf,kBAAkB;IAClB,cAAc;IACd,gBAAgB;IAChB,uBAAuB;IACvB,cAAc;IACd,eAAe;IACf,gBAAg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ACd,eAAe;IACf,kBAAkB;IAClB,kBAAkB;IAClB,uBAAuB;IACvB,mBAAmB;IACnB,SAAS;IACT,oBAAoB;IACpB,cAAc;IACd,cAAc;IACd,UAAU;IACV,WAAW;IACX,eAAe;IACf,cAAc;IACd,eAAe;IACf,aAAa;IACb,UAAU;IACV,aAAa;IACb,eAAe;IACf,YAAY;IACZ,eAAe;IACf,aAAa;IACb,eAAe;IACf,gBAAgB;IAChB,kBAAkB;IAClB,gBAAgB;IAChB,YAAY;IACZ,6BAA6B;IAC7B,YAAY;IACZ,eAAe;IACf,oBAAoB;IACpB,kBAAkB;IAClB,eAAe;IACf,UAAU;CACX,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAsB;IACxD,eAAe;IACf,0BAA0B;IAC1B,YAAY;IACZ,gBAAgB;IAChB,0BAA0B;IAC1B,gBAAgB;IAChB,SAAS;IACT,sBAAsB;IACtB,sBAAsB;IACtB,kBAAkB;IAClB,cAAc;IACd,sBAAsB;IACtB,WAAW;IACX,aAAa;IACb,mBAAmB;IACnB,2BAA2B;IAC3B,6BAA6B;IAC7B,iBAAiB;IACjB,SAAS;IACT,mCAAmC;IACnC,eAAe;IACf,uBAAuB;IACvB,QAAQ;IACR,sBAAsB;IACtB,gBAAgB;IAChB,YAAY;IACZ,YAAY;IACZ,oBAAoB;IACpB,WAAW;IACX,qBAAqB;IACrB,kBAAkB;IAClB,qBAAqB;IACrB,cAAc;IACd,gBAAgB;IAChB,kBAAkB;IAClB,uBAAuB;IACvB,4BAA4B;IAC5B,YAAY;IACZ,QAAQ;IACR,cAAc;IACd,gCAAgC;IAChC,0BAA0B;IAC1B,2BAA2B;IAC3B,SAAS;IACT,sBAAsB;IACtB,kBAAkB;IAClB,oBAAoB;IACpB,eAAe;IACf,aAAa;IACb,eAAe;IACf,oBAAoB;IACpB,sBAAsB;IACtB,oBAAoB;CACrB,CAAC"}
1
+ {"version":3,"file":"engine-methods.js","sourceRoot":"","sources":["../../src/tools/engine-methods.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAsB;IACxD,cAAc;IACd,YAAY;IACZ,oBAAoB;IACpB,kBAAkB;IAClB,aAAa;IACb,eAAe;IACf,eAAe;IACf,kBAAkB;IAClB,cAAc;IACd,gBAAgB;IAChB,uBAAuB;IACvB,cAAc;IACd,eAAe;IACf,gBAAgB;IAChB,oBAAoB;IACpB,eAAe;IACf,kBAAkB;IAClB,WAAW;IACX,aAAa;IACb,uBAAuB;IACvB,qBAAqB;IACrB,kBAAkB;IAClB,gBAAgB;IAChB,yBAAyB;IACzB,iBAAiB;IACjB,gBAAgB;IAChB,qBAAqB;IACrB,iBAAiB;IACjB,iBAAiB;IACjB,sBAAsB;IACtB,WAAW;IACX,YAAY;IACZ,cAAc;IACd,cAAc;IACd,oBAAoB;IACpB,gBAAgB;IAChB,qBAAqB;IACrB,iBAAiB;IACjB,wBAAwB;IACxB,kBAAkB;IAClB,gBAAgB;IAChB,kBAAkB;IAClB,sBAAsB;IACtB,QAAQ;IACR,iBAAiB;IACjB,mBAAmB;IACnB,oBAAoB;IACpB,aAAa;IACb,cAAc;IACd,kBAAkB;IAClB,aAAa;IACb,eAAe;IACf,eAAe;IACf,WAAW;IACX,iBAAiB;IACjB,eAAe;IACf,YAAY;IACZ,iBAAiB;IACjB,yBAAyB;IACzB,eAAe;IACf,oBAAoB;IACpB,mBAAmB;IACnB,gBAAgB;IAChB,kBAAkB;IAClB,oBAAoB;IACpB,oBAAoB;IACpB,WAAW;IACX,iBAAiB;IACjB,gCAAgC;IAChC,6BAA6B;IAC7B,4BAA4B;IAC5B,+BAA+B;IAC/B,0BAA0B;IAC1B,yBAAyB;IACzB,4BAA4B;IAC5B,4BAA4B;IAC5B,mCAAmC;IACnC,WAAW;IACX,cAAc;IACd,mBAAmB;IACnB,eAAe;IACf,eAAe;IACf,UAAU;IACV,kBAAkB;IAClB,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;IAClB,uBAAuB;IACvB,4BAA4B;IAC5B,QAAQ;IACR,cAAc;IACd,gCAAgC;IAChC,0BAA0B;IAC1B,2BAA2B;IAC3B,SAAS;IACT,sBAAsB;IACtB,kBAAkB;IAClB,oBAAoB;IACpB,eAAe;IACf,aAAa;IACb,eAAe;IACf,oBAAoB;IACpB,sBAAsB;IACtB,oBAAoB;CACrB,CAAC"}
@@ -27,28 +27,28 @@ async function dispatchFontAction(args, options) {
27
27
  // is the one that decides the pixels. A font with four glyphs is present
28
28
  // and will still render most text in the fallback face — which is the
29
29
  // shape Font Studio produces, and the shape a naive probe gets wrong.
30
- const code = `(async function() {
31
- if (typeof app.checkFont !== 'function') {
32
- return { success: false, error: 'app.checkFont unavailable — update the studio. document.fonts.check() is not a substitute: it returns true for a family that does not exist.' };
33
- }
34
- const r = app.checkFont(${JSON.stringify(name)}${text !== undefined ? `, ${JSON.stringify(text)}` : ''});
35
- // "Unavailable" read as "cannot be used" — while create_item then loaded and
36
- // drew the same family (Caveat). Unavailable here means NOT LOADED YET; say
37
- // whether this studio can load it, and how.
38
- if (r && r.available === false) {
39
- r.loadable = 'unknown until tried';
40
- if (typeof app.listFonts === 'function') {
41
- try {
42
- const l = await app.listFonts({});
43
- const fam = ${JSON.stringify(name.split(',')[0].trim().replace(/^['"]|['"]$/g, ''))}.toLowerCase();
44
- const hit = l && Array.isArray(l.families) && l.families.find(function(f) { return String(f.name || f.family || '').toLowerCase() === fam; });
45
- if (hit) r.loadable = 'yes — in the studio catalogue';
46
- } catch (_) { /* keep unknown */ }
47
- }
48
- r.hint = 'not loaded yet. create_item / modify_item load a family on first use, or call pinepaper_font {action:"load", name} to load it now (studio catalogue first, then Google Fonts).';
49
- }
50
- return { success: true, ...r };
51
- })();`;
30
+ const code = ("(async function() {\n if (typeof app.checkFont !== 'function') {\n return { success: false, error: 'app.checkFont unavailable — update the studio. document.fonts.check() is not a substitute: it returns true for a family that does not exist.' };\n }\n const r = app.checkFont(" +
31
+ String(JSON.stringify(name)) +
32
+ String(text !== undefined ? `, ${JSON.stringify(text)}` : '') +
33
+ ");\n // \"Unavailable\" read as \"cannot be used\" — while create_item then loaded and\n // drew the same family (Caveat). Unavailable here means NOT LOADED YET; say\n // whether this studio can load it, and how.\n if (r && r.available === false) {\n r.loadable = 'unknown until tried';\n if (typeof app.listFonts === 'function') {\n try {\n const l = await app.listFonts({});\n const fam = " +
34
+ String(JSON.stringify(name.split(',')[0].trim().replace(/^['"]|['"]$/g, ''))) +
35
+ ".toLowerCase();\n const hit = l && Array.isArray(l.families) && l.families.find(function(f) { return String(f.name || f.family || '').toLowerCase() === fam; });\n if (hit) r.loadable = 'yes — in the studio catalogue';\n } catch (_) { /* keep unknown */ }\n }\n r.hint = 'not loaded yet. create_item / modify_item load a family on first use, or call pinepaper_font {action:\"load\", name} to load it now (studio catalogue first, then Google Fonts).';\n }\n return { success: true, ...r };\n})();"
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+ );
52
52
  return executeOrGenerate(code, `Check font "${name}"${text ? ' against the given text' : ''}`, options, 'pinepaper_font');
53
53
  }
54
54
  case 'load': {
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/tools/handlers/generate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAA+B,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AA8BlF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKyI,CAAC;AAEjL,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQkG,CAAC;AAElI,uDAAuD;AACvD,eAAO,MAAM,YAAY;iBACV,MAAM,SAAS,WAAW;gBAC3B,MAAM;;CAEnB,CAAC;AAoGF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,cAAc,CAAC,CAqGhI,CAAC"}
1
+ {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/tools/handlers/generate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAA+B,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AA+BlF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKyI,CAAC;AAEjL,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQkG,CAAC;AAElI,uDAAuD;AACvD,eAAO,MAAM,YAAY;iBACV,MAAM,SAAS,WAAW;gBAC3B,MAAM;;CAEnB,CAAC;AAoGF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,cAAc,CAAC,CAqGhI,CAAC"}
@@ -3,6 +3,7 @@ import { errorResult, handleToolCall } from '../handlers.js';
3
3
  import { ErrorCodes } from '../../types/schemas.js';
4
4
  import { emitTextLayersPlacement } from '../../types/code-generator.js';
5
5
  import { env } from '../../utils/env.js';
6
+ import { trustedFetch } from '../../utils/safe-fetch.js';
6
7
  const GenerateInputSchema = z.object({
7
8
  prompt: z.string().min(1),
8
9
  aspect: z.enum(['16:9', '9:16', '1:1', '4:5']).optional(),
@@ -44,7 +45,7 @@ export const GenerateArgsSchema = z.object({
44
45
  }).refine((v) => !!(v.model || v.useCase), { message: 'give a model (see pinepaper_generate_estimate listModels) or a useCase' });
45
46
  /** Injectable for tests: the network and the clock. */
46
47
  export const generateDeps = {
47
- fetch: (url, init) => fetch(url, init),
48
+ fetch: (url, init) => trustedFetch(url, init),
48
49
  sleep: (ms) => new Promise((r) => setTimeout(r, ms)),
49
50
  now: () => Date.now(),
50
51
  };
@@ -1 +1 @@
1
- {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/tools/handlers/generate.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,cAAc,EAAuB,MAAM,gBAAgB,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAEzC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE;IACzD,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC5C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACjC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,iEAAiE;IACjE,yEAAyE;IACzE,4DAA4D;IAC5D,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,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,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACtJ,GAAG,CAAC,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QAClH,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,IAAI,CAAC,CAAC,KAAK,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM;YAAE,GAAG,CAAC,SAAS,GAAG,MAAM,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACvK,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC;CACF,CAAC"}
@@ -960,22 +960,22 @@ const MARK_ITEMS_BEFORE_RUN = `(function () {
960
960
  return { ok: true };
961
961
  })();`;
962
962
  /** Page code: remove every item that was not there at the mark, outermost first. */
963
- const REMOVE_ITEMS_CREATED_SINCE_MARK = `(function () {
964
- const pre = window.__ppPreRunIds;
965
- window.__ppPreRunIds = null;
966
- if (!pre || typeof paper === 'undefined' || !paper.project) return { ok: false };
967
- const fresh = paper.project.getItems({}).filter(function (i) { return !pre.has(i.id); });
968
- const freshIds = new Set(fresh.map(function (i) { return i.id; }));
969
- const tops = fresh.filter(function (i) { return !(i.parent && freshIds.has(i.parent.id)); });
970
- let removed = 0;
971
- tops.forEach(function (it) {
972
- try { if (typeof app !== 'undefined' && typeof app.deleteItem === 'function' && app.deleteItem(it)) { removed++; return; } } catch (e) {}
973
- try { if (it.parent) { it.remove(); removed++; } } catch (e) {}
974
- });
975
- const left = paper.project.getItems({}).filter(function (i) { return !pre.has(i.id); }).length;
976
- try { if (paper.view) paper.view.update(); } catch (e) {}
977
- return { ok: left === 0, removed: removed, left: left };
978
- })();`;
963
+ const REMOVE_ITEMS_CREATED_SINCE_MARK = ("(function () {\n const pre = window.__ppPreRunIds;\n window.__ppPreRunIds = null;\n if (!pre || typeof paper === 'undefined' || !paper.project) return { ok: false };\n const fresh = paper.project.getItems({}).filter(function (i) { return !pre.has(i.id); });\n const freshIds = new Set(fresh.map(function (i) { return i.id; }));\n const tops = fresh.filter(function (i) { return !(i.parent && freshIds.has(i.parent.id)); });\n let removed = 0;\n tops.forEach(function (it) {\n try { if (typeof app !== 'undefined' && typeof app.deleteItem === 'function' && app.deleteItem(it)) { removed++; return; } } catch (e) {}\n try { if (it.parent) { it.remove(); removed++; } } catch (e) {}\n }" +
964
+ ");\n const left = paper.project.getItems({}).filter(function (i) { return !pre.has(i.id); }).length;\n try { if (paper.view) paper.view.update(); } catch (e) {}\n return { ok: left === 0, removed: removed, left: left };\n})();"
965
+
966
+
967
+
968
+
969
+
970
+
971
+
972
+
973
+
974
+
975
+
976
+
977
+
978
+ );
979
979
  /**
980
980
  * Record which canvas items exist before agent-written code runs, so a failed
981
981
  * run's leftovers can be told apart from the scene it started with. Returns
@@ -33,23 +33,23 @@ export const LANE_TOOL_NAMES = [
33
33
  /** The one keyframe shape, said once and used by both tools that take keyframes. */
34
34
  const KEYFRAME_RULE = `A keyframe is {"time": seconds, "properties": {…}, "easing"?: name}. The values go INSIDE properties, never beside time: {"time":1,"properties":{"opacity":1}}, not {"time":1,"opacity":1} (refused). easing shapes the move ARRIVING at that key: linear (default), easeIn, easeOut, easeInOut, easeOutBack, easeInOutCubic, easeOutBounce, spring, hold. Before its first key an item holds the first key's values; after its last, the last key's. Keyable: x, y (the centre), opacity, scale, scaleX, scaleY, rotation (degrees), fillColor, strokeColor, strokeWidth, width, height, radius, fontSize, trimEnd (0→1 draws a path on).`;
35
35
  /** Read by the model before any tool: what the lane is, the order of work, and what it cannot do. */
36
- export const LANE_INSTRUCTIONS = `PinePaper Studio, agent lane: eight tools that build an animated scene on a live canvas and export it to a file.
37
-
38
- ORDER OF WORK:
39
- 1. pinepaper_agent_batch_execute: ONE call with the canvas size, the background, every item, their keyframes and any relations.
40
- 2. pinepaper_lint_scene: check the scene before exporting (text running off the frame, unrelated items).
41
- 3. pinepaper_agent_export: format, duration and fps for a video. It returns the file path and the file's sha256 (a small SVG comes back inline).
42
- Use pinepaper_keyframe_animate to re-key one item afterwards, and pinepaper_pattern to move many named items with one declaration.
43
- Something that happens AT a time or ON a click (show, hide, recolour): make the event with pinepaper_event first, then bind it in the batch with relation ops.
44
- To start over, call pinepaper_clear_canvas: it empties the canvas and ids start again at item_1, so the same batch gives the same ids.
45
- MOTION THAT IS A FUNCTION OF TIME (a bob, a pulse, a sweep, a wave) is a relation, not keyframes: a track of hundreds of keys computed from a formula is the sign of the wrong route.
46
- - One item: a relation op {"type":"relation","sourceId":"$0","relationType":"time_expression","relationOptions":{"property":"y","expression":"360 + 40*sin(2*PI*t)"}} with no targetId; property is x, y, rotation, opacity or scale.
47
- - Many items, each offset (a wave across dots): define it once with pinepaper_register_custom_relation (on a server started with PINEPAPER_ALLOW_CODE=1), its formula reading params.index, and bind it to a name pattern (sourceId "dot-*"): each member gets index and count. Adding members later is the same op again.
48
-
49
- UNITS: pixels, top-left origin, y down; time in seconds; angles in degrees; colours as "#rrggbb".
50
- Every call acts on the live canvas at once: re-sending a batch ADDS its items again (clear first to replay it). A failed atomic batch removes the items it made, so fix it and send it again (edits it made to items that already existed stay: the result says so).
51
- Report a tool error as it is; do not write HTML or other code instead of these tools.
52
- This lane is for scenes built from shapes, text, keyframes and relations. For characters, styled scenes, maps, diagrams or sound, the full surface is PINEPAPER_TOOLKIT=agent.`;
36
+ export const LANE_INSTRUCTIONS = ("PinePaper Studio, agent lane: eight tools that build an animated scene on a live canvas and export it to a file.\n\nORDER OF WORK:\n1. pinepaper_agent_batch_execute: ONE call with the canvas size, the background, every item, their keyframes and any relations.\n2. pinepaper_lint_scene: check the scene before exporting (text running off the frame, unrelated items).\n3. pinepaper_agent_export: format, duration and fps for a video. It returns the file path and the file's sha256 (a small SVG comes back inline).\nUse pinepaper_keyframe_animate to re-key one item afterwards, and pinepaper_pattern to move many named items with one declaration.\nSomething that happens AT a time or ON a click (show," +
37
+ " hide, recolour): make the event with pinepaper_event first, then bind it in the batch with relation ops.\nTo start over, call pinepaper_clear_canvas: it empties the canvas and ids start again at item_1, so the same batch gives the same ids.\nMOTION THAT IS A FUNCTION OF TIME (a bob, a pulse, a sweep, a wave) is a relation, not keyframes: a track of hundreds of keys computed from a formula is the sign of the wrong route.\n- One item: a relation op {\"type\":\"relation\",\"sourceId\":\"$0\",\"relationType\":\"time_expression\",\"relationOptions\":{\"property\":\"y\",\"expression\":\"360 + 40*sin(2*PI*t)\"}} with no targetId; property is x, y, rotation, opacity or scale.\n- Many items, each " +
38
+ "offset (a wave across dots): define it once with pinepaper_register_custom_relation (on a server started with PINEPAPER_ALLOW_CODE=1), its formula reading params.index, and bind it to a name pattern (sourceId \"dot-*\"): each member gets index and count. Adding members later is the same op again.\n\nUNITS: pixels, top-left origin, y down; time in seconds; angles in degrees; colours as \"#rrggbb\".\nEvery call acts on the live canvas at once: re-sending a batch ADDS its items again (clear first to replay it). A failed atomic batch removes the items it made, so fix it and send it again (edits it made to items that already existed stay: the result says so).\nReport a tool error as it is; do n" +
39
+ "ot write HTML or other code instead of these tools.\nThis lane is for scenes built from shapes, text, keyframes and relations. For characters, styled scenes, maps, diagrams or sound, the full surface is PINEPAPER_TOOLKIT=agent."
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+ );
53
53
  const POSITION = {
54
54
  type: 'object',
55
55
  properties: { x: { type: 'number' }, y: { type: 'number' } },
@@ -69,37 +69,37 @@ const KEYFRAMES = {
69
69
  };
70
70
  export const LANE_TOOLS = {
71
71
  pinepaper_agent_batch_execute: {
72
- description: `Build the scene in ONE call: canvas, background, items, keyframes, relations. Ops run in order. "$0", "$1", … are the items THIS call made, in op order (create and group ops are numbered; a group of "$0","$1" made next is "$2"). The result lists their ids in itemIds; use those ids in later calls.
73
-
74
- Each line is a correct op:
75
- {"type":"set_canvas_size","width":1920,"height":1080}
76
- {"type":"set_background","backgroundColor":"#0b1026"}
77
- {"type":"create","itemType":"text","position":{"x":200,"y":130},"properties":{"content":"SIGNAL / NOISE","fontSize":72,"color":"#ffffff","anchor":"top-left","name":"title"}}
78
- {"type":"create","itemType":"circle","position":{"x":300,"y":600},"properties":{"radius":40,"color":"#22d3ee","name":"dot"}}
79
- {"type":"create","itemType":"rectangle","position":{"x":260,"y":900},"properties":{"width":120,"height":280,"color":"#38bdf8","anchor":"bottom-left","name":"bar-1"}}
80
- {"type":"keyframe_animate","itemId":"$0","keyframes":[{"time":0,"properties":{"opacity":0}},{"time":1,"properties":{"opacity":1}}]}
81
- {"type":"keyframe_animate","itemId":"$1","keyframes":[{"time":1,"properties":{"x":300}},{"time":7,"properties":{"x":1620},"easing":"easeInOut"}]}
82
- {"type":"relation","sourceId":"$1","targetId":"$2","relationType":"orbits","relationOptions":{"radius":260,"speed":0.1667}}
83
- {"type":"modify","itemId":"item_3","properties":{"color":"#f472b6"}}
84
- {"type":"timeline","defaults":{"ease":"power2.out"},"tweens":[{"to":"bar-*","from":{"scaleY":0},"vars":{"scaleY":1},"duration":0.8,"at":0.5,"stagger":0.15}]}
85
- {"type":"relation","sourceId":"item_9","targetId":"$0","relationType":"on_event_set_visibility","relationOptions":{"visible":true}}
86
- {"type":"relation","sourceId":"$1","targetId":"item_9","relationType":"on_click_fire"}
87
-
88
- RULES (each one has cost a failed build):
89
- - position {x,y} goes at the op's top level. Everything else about the item goes INSIDE properties: a text's words are properties.content, and so are fontSize, color, radius, width, height, opacity, name and anchor.
90
- - position is the item's CENTRE. A text grows both ways from it, so a title whose centre sits near an edge runs off the frame and the video shows "IGNAL / NOISE". When a spec gives a corner ("top-left at (200, 130)"), pass properties.anchor: "top-left" (or top-right, bottom-left, bottom-right). A bar that grows up from a baseline: anchor "bottom-left" at the baseline, key height.
91
- - ${KEYFRAME_RULE}
92
- - Two keyframe_animate ops on one item in a batch are merged into one track.
93
- - A timeline op is GSAP's timeline as JSON, compiled onto keyframe tracks: tweens [{to: a name, id, "$N", array or "bar-*"; vars: end values; from: start values; duration; at: seconds, "<", ">" or "+=0.2"; stagger; ease: "power2.out", "none", "back.out"…; repeat; yoyo}]. There x and y are OFFSETS from where the item was created, as in GSAP; scaleY on a bottom-anchored item holds its baseline; drawSVG "0%"→"100%" draws a path on. Every track lasts the whole timeline. What it cannot carry is refused by name; each tween gets a receipt. An item takes keys from a timeline or keyframe_animate ops, not both.
94
- - Name every item (properties.name). pinepaper_pattern selects members by name, e.g. "bar-*".
95
- - properties.id chooses an item's id ("dot"), so a replay after pinepaper_clear_canvas addresses the same ids.
96
- - A shape with a strokeColor and no color is an outline.
97
- - Relations: orbits {radius, speed (turns per second), direction, phaseDegrees}, follows {offset, smoothing}, attached_to {offset}, points_at, moves_along_path {path:[{x,y},…], speed}, time_expression {property, expression} (no targetId; the formula grammar: ${expressionGrammarText()}). sourceId moves; targetId is what it moves relative to. A name pattern as sourceId ("dot-*") binds every item named like it, in name order, each with index and count added to relationOptions; send the same op again after adding members and they join, with index and count updated. update: true changes the relationOptions of a relation already bound (same sourceId, targetId, relationType) instead of adding one.
98
- - Events (item_9 above is an eventId from pinepaper_event): an event → item relation is a reaction, run each time it fires: on_event_set_visibility {visible: true|false}, on_event_set_color {color}, on_event_set_property {property, value}. An item → event relation fires it: on_click_fire, on_pointer_enter_fire, on_key_fire {key}. An item a reaction reveals starts hidden: properties.visible false.
99
- - set_canvas_size comes first; a video exports at the canvas size.
100
- - The call is LIVE: sending it twice makes every item twice. atomic (default) stops at the first failure and removes every item the call created, so the canvas holds no half batch: fix the op it names and send it again. Edits to items that already existed are not undone; the result says what was removed.
101
-
102
- itemType: text, circle, rectangle, ellipse, star, triangle, polygon, line, arc, path, hexagon, diamond, arrow, heart.`,
72
+ description: ("Build the scene in ONE call: canvas, background, items, keyframes, relations. Ops run in order. \"$0\", \"$1\", … are the items THIS call made, in op order (create and group ops are numbered; a group of \"$0\",\"$1\" made next is \"$2\"). The result lists their ids in itemIds; use those ids in later calls.\n\nEach line is a correct op:\n{\"type\":\"set_canvas_size\",\"width\":1920,\"height\":1080}\n{\"type\":\"set_background\",\"backgroundColor\":\"#0b1026\"}\n{\"type\":\"create\",\"itemType\":\"text\",\"position\":{\"x\":200,\"y\":130},\"properties\":{\"content\":\"SIGNAL / NOISE\",\"fontSize\":72,\"color\":\"#ffffff\",\"anchor\":\"top-left\",\"name\":\"title\"}}\n{\"type\":\"create\",\"i" +
73
+ "temType\":\"circle\",\"position\":{\"x\":300,\"y\":600},\"properties\":{\"radius\":40,\"color\":\"#22d3ee\",\"name\":\"dot\"}}\n{\"type\":\"create\",\"itemType\":\"rectangle\",\"position\":{\"x\":260,\"y\":900},\"properties\":{\"width\":120,\"height\":280,\"color\":\"#38bdf8\",\"anchor\":\"bottom-left\",\"name\":\"bar-1\"}}\n{\"type\":\"keyframe_animate\",\"itemId\":\"$0\",\"keyframes\":[{\"time\":0,\"properties\":{\"opacity\":0}},{\"time\":1,\"properties\":{\"opacity\":1}}]}\n{\"type\":\"keyframe_animate\",\"itemId\":\"$1\",\"keyframes\":[{\"time\":1,\"properties\":{\"x\":300}},{\"time\":7,\"properties\":{\"x\":1620},\"easing\":\"easeInOut\"}]}\n{\"type\":\"relation\",\"sourceId\":\"$1\"," +
74
+ "\"targetId\":\"$2\",\"relationType\":\"orbits\",\"relationOptions\":{\"radius\":260,\"speed\":0.1667}}\n{\"type\":\"modify\",\"itemId\":\"item_3\",\"properties\":{\"color\":\"#f472b6\"}}\n{\"type\":\"timeline\",\"defaults\":{\"ease\":\"power2.out\"},\"tweens\":[{\"to\":\"bar-*\",\"from\":{\"scaleY\":0},\"vars\":{\"scaleY\":1},\"duration\":0.8,\"at\":0.5,\"stagger\":0.15}]}\n{\"type\":\"relation\",\"sourceId\":\"item_9\",\"targetId\":\"$0\",\"relationType\":\"on_event_set_visibility\",\"relationOptions\":{\"visible\":true}}\n{\"type\":\"relation\",\"sourceId\":\"$1\",\"targetId\":\"item_9\",\"relationType\":\"on_click_fire\"}\n\nRULES (each one has cost a failed build):\n- position {x,y} go" +
75
+ "es at the op's top level. Everything else about the item goes INSIDE properties: a text's words are properties.content, and so are fontSize, color, radius, width, height, opacity, name and anchor.\n- position is the item's CENTRE. A text grows both ways from it, so a title whose centre sits near an edge runs off the frame and the video shows \"IGNAL / NOISE\". When a spec gives a corner (\"top-left at (200, 130)\"), pass properties.anchor: \"top-left\" (or top-right, bottom-left, bottom-right). A bar that grows up from a baseline: anchor \"bottom-left\" at the baseline, key height.\n- " +
76
+ String(KEYFRAME_RULE) +
77
+ "\n- Two keyframe_animate ops on one item in a batch are merged into one track.\n- A timeline op is GSAP's timeline as JSON, compiled onto keyframe tracks: tweens [{to: a name, id, \"$N\", array or \"bar-*\"; vars: end values; from: start values; duration; at: seconds, \"<\", \">\" or \"+=0.2\"; stagger; ease: \"power2.out\", \"none\", \"back.out\"…; repeat; yoyo}]. There x and y are OFFSETS from where the item was created, as in GSAP; scaleY on a bottom-anchored item holds its baseline; drawSVG \"0%\"→\"100%\" draws a path on. Every track lasts the whole timeline. What it cannot carry is refused by name; each tween gets a receipt. An item takes keys from a timeline or keyframe_animate ops," +
78
+ " not both.\n- Name every item (properties.name). pinepaper_pattern selects members by name, e.g. \"bar-*\".\n- properties.id chooses an item's id (\"dot\"), so a replay after pinepaper_clear_canvas addresses the same ids.\n- A shape with a strokeColor and no color is an outline.\n- Relations: orbits {radius, speed (turns per second), direction, phaseDegrees}, follows {offset, smoothing}, attached_to {offset}, points_at, moves_along_path {path:[{x,y},…], speed}, time_expression {property, expression} (no targetId; the formula grammar: " +
79
+ String(expressionGrammarText()) +
80
+ "). sourceId moves; targetId is what it moves relative to. A name pattern as sourceId (\"dot-*\") binds every item named like it, in name order, each with index and count added to relationOptions; send the same op again after adding members and they join, with index and count updated. update: true changes the relationOptions of a relation already bound (same sourceId, targetId, relationType) instead of adding one.\n- Events (item_9 above is an eventId from pinepaper_event): an event → item relation is a reaction, run each time it fires: on_event_set_visibility {visible: true|false}, on_event_set_color {color}, on_event_set_property {property, value}. An item → event relation fires it: on_cl" +
81
+ "ick_fire, on_pointer_enter_fire, on_key_fire {key}. An item a reaction reveals starts hidden: properties.visible false.\n- set_canvas_size comes first; a video exports at the canvas size.\n- The call is LIVE: sending it twice makes every item twice. atomic (default) stops at the first failure and removes every item the call created, so the canvas holds no half batch: fix the op it names and send it again. Edits to items that already existed are not undone; the result says what was removed.\n\nitemType: text, circle, rectangle, ellipse, star, triangle, polygon, line, arc, path, hexagon, diamond, arrow, heart."
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+ ),
103
103
  inputSchema: {
104
104
  type: 'object',
105
105
  properties: {
@@ -154,16 +154,16 @@ EXAMPLE: {"itemId":"item_2","keyframes":[{"time":1,"properties":{"x":300}},{"tim
154
154
  },
155
155
  },
156
156
  pinepaper_pattern: {
157
- description: `Move many NAMED items with one stored declaration instead of a track on each. Change a parameter once and every member follows; remove it and they go back.
157
+ description: ("Move many NAMED items with one stored declaration instead of a track on each. Change a parameter once and every member follows; remove it and they go back.\n\nKINDS:\n- phase_wave: members move on a sine, each a phase after the last. params: property (\"y\" default, \"x\", \"rotation\", \"opacity\"), amplitude (px, degrees or 0..1), period (seconds a cycle), wavelength (members a cycle). window {from, to} in seconds limits when it plays.\n- stagger: each member's start is delayed by its place. params: step (seconds between neighbours), start, order (index, reverse, center, edges).\nmembers: {\"names\": \"bar-*\"} ('*' matches any run), or an array of ids. A name that matches nothing is rep" +
158
+ "orted.\nA relation between two items (orbits, follows) is a relation op in pinepaper_agent_batch_execute, not a pattern.\n\nACTIONS: create (id, kind, members, params) · modify (id + what changes) · remove (id) · list · get (id).\nEXAMPLE: {\"action\":\"create\",\"id\":\"wave\",\"kind\":\"phase_wave\",\"members\":{\"names\":\"bar-*\"},\"params\":{\"amplitude\":12,\"period\":1.2,\"wavelength\":5}}"
159
+
160
+
161
+
158
162
 
159
- KINDS:
160
- - phase_wave: members move on a sine, each a phase after the last. params: property ("y" default, "x", "rotation", "opacity"), amplitude (px, degrees or 0..1), period (seconds a cycle), wavelength (members a cycle). window {from, to} in seconds limits when it plays.
161
- - stagger: each member's start is delayed by its place. params: step (seconds between neighbours), start, order (index, reverse, center, edges).
162
- members: {"names": "bar-*"} ('*' matches any run), or an array of ids. A name that matches nothing is reported.
163
- A relation between two items (orbits, follows) is a relation op in pinepaper_agent_batch_execute, not a pattern.
164
163
 
165
- ACTIONS: create (id, kind, members, params) · modify (id + what changes) · remove (id) · list · get (id).
166
- EXAMPLE: {"action":"create","id":"wave","kind":"phase_wave","members":{"names":"bar-*"},"params":{"amplitude":12,"period":1.2,"wavelength":5}}`,
164
+
165
+
166
+ ),
167
167
  inputSchema: {
168
168
  type: 'object',
169
169
  properties: {
@@ -184,12 +184,12 @@ EXAMPLE: {"action":"create","id":"wave","kind":"phase_wave","members":{"names":"
184
184
  },
185
185
  },
186
186
  pinepaper_agent_export: {
187
- description: `Render the scene to a file and return where it is.
187
+ description: ("Render the scene to a file and return where it is.\n\nA video needs format, duration and fps: {\"format\":\"mp4\",\"duration\":8,\"fps\":30}. duration defaults to 5 s, so an 8 s piece without it is cut at 5. The file is the canvas size; leave platform out. A still: {\"format\":\"png\",\"time\":4}.\nAn 8 s 1080p video takes a few minutes to render: wait for this call, and do not send it again while it runs.\n\nRETURNS \"File: <path>\", plus file {sha256, bytes}: the sha256 of the file on disk. MP4 and WebM add frameDigest and frames, a digest of every rendered frame (two renders of the same scene agree frame for frame when their frameDigest agrees); unreadFrames counts frames the digest cou" +
188
+ "ld not read. A small SVG comes back inline, with no file. video.frames {fed, distinct} says whether anything moved. fidelity.warnings names what the format could not carry. A failed export is an error naming the reason; it never reports a file it did not write."
188
189
 
189
- A video needs format, duration and fps: {"format":"mp4","duration":8,"fps":30}. duration defaults to 5 s, so an 8 s piece without it is cut at 5. The file is the canvas size; leave platform out. A still: {"format":"png","time":4}.
190
- An 8 s 1080p video takes a few minutes to render: wait for this call, and do not send it again while it runs.
191
190
 
192
- RETURNS "File: <path>", plus file {sha256, bytes}: the sha256 of the file on disk. MP4 and WebM add frameDigest and frames, a digest of every rendered frame (two renders of the same scene agree frame for frame when their frameDigest agrees); unreadFrames counts frames the digest could not read. A small SVG comes back inline, with no file. video.frames {fed, distinct} says whether anything moved. fidelity.warnings names what the format could not carry. A failed export is an error naming the reason; it never reports a file it did not write.`,
191
+
192
+ ),
193
193
  inputSchema: {
194
194
  type: 'object',
195
195
  properties: {
@@ -227,11 +227,11 @@ A TIMED event fires itself at scene times, in the preview and in every video exp
227
227
  inputSchema: { type: 'object', properties: {} },
228
228
  },
229
229
  pinepaper_register_custom_relation: {
230
- description: `Needs a server started with PINEPAPER_ALLOW_CODE=1 (its bodies are JavaScript); otherwise it is refused, and time_expression relation ops do the motion instead. Define a relation of your own, then bind it in pinepaper_agent_batch_execute with relation ops: relationType is its name, relationOptions its params, targetId optional (leave it out when the motion needs no other item). One definition drives many items: bind it to a name pattern (sourceId "dot-*", each member gets index and count), and change a param later with one relation op with update: true. pinepaper_lint_scene lists the relations bound and the definitions registered. It lasts for this session: register it again after a restart.
230
+ description: ("Needs a server started with PINEPAPER_ALLOW_CODE=1 (its bodies are JavaScript); otherwise it is refused, and time_expression relation ops do the motion instead. Define a relation of your own, then bind it in pinepaper_agent_batch_execute with relation ops: relationType is its name, relationOptions its params, targetId optional (leave it out when the motion needs no other item). One definition drives many items: bind it to a name pattern (sourceId \"dot-*\", each member gets index and count), and change a param later with one relation op with update: true. pinepaper_lint_scene lists the relations bound and the definitions registered. It lasts for this session: register it again after a rest" +
231
+ "art.\n\ncomputeFunction is a function BODY that gets fromPosition, toPosition, params, delta and time (scene seconds) and returns what apply needs. applyFunction is a body that gets item, target, computed and params and changes the item.\n{\"name\":\"bobs\",\"params\":{\"amp\":{\"type\":\"number\",\"default\":40}},\"computeFunction\":\"return {y: 360 + params.amp * Math.sin(Math.PI * time)};\",\"applyFunction\":\"if (computed) item.position.y = computed.y;\"}\nthen in the batch: {\"type\":\"relation\",\"sourceId\":\"$0\",\"relationType\":\"bobs\",\"relationOptions\":{\"amp\":100}}"
232
+
231
233
 
232
- computeFunction is a function BODY that gets fromPosition, toPosition, params, delta and time (scene seconds) and returns what apply needs. applyFunction is a body that gets item, target, computed and params and changes the item.
233
- {"name":"bobs","params":{"amp":{"type":"number","default":40}},"computeFunction":"return {y: 360 + params.amp * Math.sin(Math.PI * time)};","applyFunction":"if (computed) item.position.y = computed.y;"}
234
- then in the batch: {"type":"relation","sourceId":"$0","relationType":"bobs","relationOptions":{"amp":100}}`,
234
+ ),
235
235
  inputSchema: {
236
236
  type: 'object',
237
237
  properties: {