@pinepaper.studio/mcp-server 1.6.15 → 1.6.16

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 (50) hide show
  1. package/README.de.md +1 -1
  2. package/README.es.md +1 -1
  3. package/README.fr.md +1 -1
  4. package/README.hi.md +1 -1
  5. package/README.ja.md +1 -1
  6. package/README.ko.md +1 -1
  7. package/README.md +64 -4
  8. package/README.pt-BR.md +1 -1
  9. package/README.zh-CN.md +1 -1
  10. package/dist/build-info.json +2 -2
  11. package/dist/ontology/upstream-vocabulary.d.ts +2 -2
  12. package/dist/ontology/upstream-vocabulary.js +2 -2
  13. package/dist/tools/definitions.d.ts.map +1 -1
  14. package/dist/tools/definitions.js +105 -8
  15. package/dist/tools/definitions.js.map +1 -1
  16. package/dist/tools/engine-surface.d.ts +1 -1
  17. package/dist/tools/engine-surface.d.ts.map +1 -1
  18. package/dist/tools/engine-surface.js +30 -9
  19. package/dist/tools/engine-surface.js.map +1 -1
  20. package/dist/tools/handlers/camera.d.ts.map +1 -1
  21. package/dist/tools/handlers/camera.js +11 -0
  22. package/dist/tools/handlers/camera.js.map +1 -1
  23. package/dist/tools/handlers/generate.d.ts +324 -0
  24. package/dist/tools/handlers/generate.d.ts.map +1 -0
  25. package/dist/tools/handlers/generate.js +264 -0
  26. package/dist/tools/handlers/generate.js.map +1 -0
  27. package/dist/tools/handlers.d.ts.map +1 -1
  28. package/dist/tools/handlers.js +39 -4
  29. package/dist/tools/handlers.js.map +1 -1
  30. package/dist/tools/minimal-descriptions.d.ts.map +1 -1
  31. package/dist/tools/minimal-descriptions.js +3 -0
  32. package/dist/tools/minimal-descriptions.js.map +1 -1
  33. package/dist/tools/shape-params.d.ts +2 -2
  34. package/dist/tools/shape-params.js +2 -2
  35. package/dist/tools/stick-vocabulary.d.ts +1 -1
  36. package/dist/tools/stick-vocabulary.js +1 -1
  37. package/dist/tools/toolkits.d.ts.map +1 -1
  38. package/dist/tools/toolkits.js +3 -0
  39. package/dist/tools/toolkits.js.map +1 -1
  40. package/dist/types/code-generator.d.ts +15 -0
  41. package/dist/types/code-generator.d.ts.map +1 -1
  42. package/dist/types/code-generator.js +279 -21
  43. package/dist/types/code-generator.js.map +1 -1
  44. package/dist/types/schemas.d.ts +527 -82
  45. package/dist/types/schemas.d.ts.map +1 -1
  46. package/dist/types/schemas.js +19 -7
  47. package/dist/types/schemas.js.map +1 -1
  48. package/dist/vendor/design/design-style.js +1 -1
  49. package/manifest.json +13 -1
  50. package/package.json +1 -1
@@ -46,6 +46,7 @@ import { mapHandlers } from './handlers/maps.js';
46
46
  import { ontologyHandlers } from './handlers/ontology.js';
47
47
  import * as designSystems from '../design/design-systems.js';
48
48
  import { exportHandlers } from './handlers/export.js';
49
+ import { generateHandlers } from './handlers/generate.js';
49
50
  import { planCharacter, generateCharacterCode } from './handlers/character.js';
50
51
  import { buildZip } from '../utils/zip.js';
51
52
  import { buildScc } from '../utils/scc.js';
@@ -64,6 +65,7 @@ function getDomainHandlers() {
64
65
  mapHandlers,
65
66
  ontologyHandlers,
66
67
  exportHandlers,
68
+ generateHandlers,
67
69
  ];
68
70
  }
69
71
  /**
@@ -592,6 +594,13 @@ function executedResult(code, result, screenshot, description, report) {
592
594
  const governor = {};
593
595
  if (warnings.length)
594
596
  governor.warnings = warnings;
597
+ // The engine's STRUCTURED warnings (GeneratedCodeRunner: report.warnings
598
+ // holds only their sentences; report.engineWarnings holds the objects —
599
+ // {message, code, droppedProperties, itemId, …}). Forwarded whole, so an
600
+ // agent can act on keyframe_track_replaced without parsing prose.
601
+ const engineWarnings = Array.isArray(report.engineWarnings) ? report.engineWarnings.filter((w) => w && typeof w === 'object') : [];
602
+ if (engineWarnings.length)
603
+ governor.engineWarnings = engineWarnings;
595
604
  if (items && typeof items.created === 'number')
596
605
  governor.itemsCreated = items.created;
597
606
  if (report.guard?.tripped)
@@ -1585,8 +1594,26 @@ async function handleToolCallInner(toolName, args, options, tracker, baseTimerId
1585
1594
  }
1586
1595
  case 'pinepaper_audio_beats': {
1587
1596
  const input = AudioBeatsInputSchema.parse(args);
1588
- const code = codeGenerator.generateAudioBeats(input);
1589
- return executeOrGenerate(code, `Audio: ${input.action}`, options, 'pinepaper_audio_beats');
1597
+ // A LARGE SOURCE GOES BESIDE THE CODE (gap 5.5). A data: URL over
1598
+ // ~350 KB inlined into the generated code made the governor's
1599
+ // transform bail and the analysis answered success with no result.
1600
+ // Same route as pinepaper_media: URLs, file:// and local paths are
1601
+ // read HERE (a path used to fail "Unable to decode audio data"), and
1602
+ // anything large is staged. Upload / asset ids pass through.
1603
+ let source = input.source;
1604
+ const looksLikeFile = typeof source === 'string'
1605
+ && (/^(data:|https?:|file:)/i.test(source.trim()) || /\.(wav|mp3|ogg|oga|m4a|aac|flac|webm|mp4|mov)$/i.test(source.trim()));
1606
+ if (looksLikeFile) {
1607
+ const resolved = await resolveMediaSource(source);
1608
+ if ('error' in resolved) {
1609
+ return errorResult(ErrorCodes.INVALID_PARAMS, resolved.error, { source }, { toolName: 'pinepaper_audio_beats' });
1610
+ }
1611
+ source = resolved.src;
1612
+ }
1613
+ const staged = typeof source === 'string' && source.startsWith('data:') && source.length > 64_000;
1614
+ const stageKey = staged ? `audio_${Date.now().toString(36)}` : undefined;
1615
+ const code = codeGenerator.generateAudioBeats({ ...input, source: staged ? `__ppStage:${stageKey}` : source });
1616
+ return executeOrGenerate(code, `Audio: ${input.action}`, options, 'pinepaper_audio_beats', staged ? { [stageKey]: source } : undefined);
1590
1617
  }
1591
1618
  case 'pinepaper_accessibility_check': {
1592
1619
  const input = AccessibilityCheckInputSchema.parse(args);
@@ -2570,7 +2597,12 @@ You can now start creating new items on a clean canvas.`,
2570
2597
  }
2571
2598
  // Import the SVG onto canvas using existing import_svg tool
2572
2599
  const code = codeGenerator.generateImportSVG(svg, undefined, input.position, input.scale);
2573
- const description = `Imported asset: ${metadata.title} (${metadata.license.name})`;
2600
+ // A URL import has no catalogue metadata (no title, no licence): this
2601
+ // line read metadata.license.name on it, so every URL import that
2602
+ // FETCHED fine then threw "Cannot read properties of undefined".
2603
+ const description = metadata?.source === 'url'
2604
+ ? `Imported SVG from ${metadata.url}`
2605
+ : `Imported asset: ${metadata?.title ?? input.assetId}${metadata?.license?.name ? ` (${metadata.license.name})` : ''}`;
2574
2606
  return executeOrGenerate(code, description, options, 'pinepaper_import_asset');
2575
2607
  }
2576
2608
  catch (error) {
@@ -3130,7 +3162,10 @@ You can now start creating new items on a clean canvas.`,
3130
3162
  return executeOrGenerate(code, soundDescription, options, 'pinepaper_sound');
3131
3163
  }
3132
3164
  }
3133
- const wavResult = await soundController.executeCode(code, false);
3165
+ // A soundtrack render is an export: it gets the export budget, not the
3166
+ // governor's 10 s default, which cut off any soundtrack that took
3167
+ // longer to render (the patch downstream kept re-applying).
3168
+ const wavResult = await soundController.executeCode(code, false, { governorTimeoutMs: exportGovernorTimeoutMs() });
3134
3169
  if (!wavResult.success) {
3135
3170
  const canvasState = await captureCanvasState(soundController);
3136
3171
  return errorResult(ErrorCodes.EXECUTION_ERROR, wavResult.error || 'Rendering the soundtrack failed', { code }, { toolName: 'pinepaper_sound', canvasState: canvasState || undefined });