@pinepaper.studio/mcp-server 1.0.0

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 (295) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +406 -0
  3. package/dist/__tests__/fixtures/index.d.ts +8 -0
  4. package/dist/__tests__/fixtures/index.d.ts.map +1 -0
  5. package/dist/__tests__/fixtures/index.js +8 -0
  6. package/dist/__tests__/fixtures/index.js.map +1 -0
  7. package/dist/__tests__/fixtures/mock-animations.d.ts +213 -0
  8. package/dist/__tests__/fixtures/mock-animations.d.ts.map +1 -0
  9. package/dist/__tests__/fixtures/mock-animations.js +96 -0
  10. package/dist/__tests__/fixtures/mock-animations.js.map +1 -0
  11. package/dist/__tests__/fixtures/mock-generators.d.ts +147 -0
  12. package/dist/__tests__/fixtures/mock-generators.d.ts.map +1 -0
  13. package/dist/__tests__/fixtures/mock-generators.js +90 -0
  14. package/dist/__tests__/fixtures/mock-generators.js.map +1 -0
  15. package/dist/__tests__/fixtures/mock-items.d.ts +157 -0
  16. package/dist/__tests__/fixtures/mock-items.d.ts.map +1 -0
  17. package/dist/__tests__/fixtures/mock-items.js +74 -0
  18. package/dist/__tests__/fixtures/mock-items.js.map +1 -0
  19. package/dist/__tests__/fixtures/mock-relations.d.ts +147 -0
  20. package/dist/__tests__/fixtures/mock-relations.d.ts.map +1 -0
  21. package/dist/__tests__/fixtures/mock-relations.js +90 -0
  22. package/dist/__tests__/fixtures/mock-relations.js.map +1 -0
  23. package/dist/browser/bridge.d.ts +127 -0
  24. package/dist/browser/bridge.d.ts.map +1 -0
  25. package/dist/browser/bridge.js +320 -0
  26. package/dist/browser/bridge.js.map +1 -0
  27. package/dist/browser/index.d.ts +8 -0
  28. package/dist/browser/index.d.ts.map +1 -0
  29. package/dist/browser/index.js +8 -0
  30. package/dist/browser/index.js.map +1 -0
  31. package/dist/browser/puppeteer-controller.d.ts +93 -0
  32. package/dist/browser/puppeteer-controller.d.ts.map +1 -0
  33. package/dist/browser/puppeteer-controller.js +280 -0
  34. package/dist/browser/puppeteer-controller.js.map +1 -0
  35. package/dist/cli.d.ts +8 -0
  36. package/dist/cli.d.ts.map +1 -0
  37. package/dist/cli.js +109 -0
  38. package/dist/cli.js.map +1 -0
  39. package/dist/i18n/i18n-manager.d.ts +88 -0
  40. package/dist/i18n/i18n-manager.d.ts.map +1 -0
  41. package/dist/i18n/i18n-manager.js +209 -0
  42. package/dist/i18n/i18n-manager.js.map +1 -0
  43. package/dist/i18n/index.d.ts +10 -0
  44. package/dist/i18n/index.d.ts.map +1 -0
  45. package/dist/i18n/index.js +10 -0
  46. package/dist/i18n/index.js.map +1 -0
  47. package/dist/i18n/locales/ar.d.ts +6 -0
  48. package/dist/i18n/locales/ar.d.ts.map +1 -0
  49. package/dist/i18n/locales/ar.js +106 -0
  50. package/dist/i18n/locales/ar.js.map +1 -0
  51. package/dist/i18n/locales/base.d.ts +17 -0
  52. package/dist/i18n/locales/base.d.ts.map +1 -0
  53. package/dist/i18n/locales/base.js +213 -0
  54. package/dist/i18n/locales/base.js.map +1 -0
  55. package/dist/i18n/locales/bn.d.ts +6 -0
  56. package/dist/i18n/locales/bn.d.ts.map +1 -0
  57. package/dist/i18n/locales/bn.js +106 -0
  58. package/dist/i18n/locales/bn.js.map +1 -0
  59. package/dist/i18n/locales/chp.d.ts +8 -0
  60. package/dist/i18n/locales/chp.d.ts.map +1 -0
  61. package/dist/i18n/locales/chp.js +11 -0
  62. package/dist/i18n/locales/chp.js.map +1 -0
  63. package/dist/i18n/locales/cr.d.ts +8 -0
  64. package/dist/i18n/locales/cr.d.ts.map +1 -0
  65. package/dist/i18n/locales/cr.js +11 -0
  66. package/dist/i18n/locales/cr.js.map +1 -0
  67. package/dist/i18n/locales/crg.d.ts +8 -0
  68. package/dist/i18n/locales/crg.d.ts.map +1 -0
  69. package/dist/i18n/locales/crg.js +11 -0
  70. package/dist/i18n/locales/crg.js.map +1 -0
  71. package/dist/i18n/locales/cs.d.ts +6 -0
  72. package/dist/i18n/locales/cs.d.ts.map +1 -0
  73. package/dist/i18n/locales/cs.js +106 -0
  74. package/dist/i18n/locales/cs.js.map +1 -0
  75. package/dist/i18n/locales/da.d.ts +6 -0
  76. package/dist/i18n/locales/da.d.ts.map +1 -0
  77. package/dist/i18n/locales/da.js +106 -0
  78. package/dist/i18n/locales/da.js.map +1 -0
  79. package/dist/i18n/locales/de.d.ts +6 -0
  80. package/dist/i18n/locales/de.d.ts.map +1 -0
  81. package/dist/i18n/locales/de.js +106 -0
  82. package/dist/i18n/locales/de.js.map +1 -0
  83. package/dist/i18n/locales/el.d.ts +6 -0
  84. package/dist/i18n/locales/el.d.ts.map +1 -0
  85. package/dist/i18n/locales/el.js +106 -0
  86. package/dist/i18n/locales/el.js.map +1 -0
  87. package/dist/i18n/locales/en.d.ts +6 -0
  88. package/dist/i18n/locales/en.d.ts.map +1 -0
  89. package/dist/i18n/locales/en.js +383 -0
  90. package/dist/i18n/locales/en.js.map +1 -0
  91. package/dist/i18n/locales/es.d.ts +6 -0
  92. package/dist/i18n/locales/es.d.ts.map +1 -0
  93. package/dist/i18n/locales/es.js +106 -0
  94. package/dist/i18n/locales/es.js.map +1 -0
  95. package/dist/i18n/locales/fa.d.ts +6 -0
  96. package/dist/i18n/locales/fa.d.ts.map +1 -0
  97. package/dist/i18n/locales/fa.js +106 -0
  98. package/dist/i18n/locales/fa.js.map +1 -0
  99. package/dist/i18n/locales/fi.d.ts +6 -0
  100. package/dist/i18n/locales/fi.d.ts.map +1 -0
  101. package/dist/i18n/locales/fi.js +106 -0
  102. package/dist/i18n/locales/fi.js.map +1 -0
  103. package/dist/i18n/locales/fil.d.ts +6 -0
  104. package/dist/i18n/locales/fil.d.ts.map +1 -0
  105. package/dist/i18n/locales/fil.js +383 -0
  106. package/dist/i18n/locales/fil.js.map +1 -0
  107. package/dist/i18n/locales/fr.d.ts +6 -0
  108. package/dist/i18n/locales/fr.d.ts.map +1 -0
  109. package/dist/i18n/locales/fr.js +106 -0
  110. package/dist/i18n/locales/fr.js.map +1 -0
  111. package/dist/i18n/locales/gu.d.ts +6 -0
  112. package/dist/i18n/locales/gu.d.ts.map +1 -0
  113. package/dist/i18n/locales/gu.js +106 -0
  114. package/dist/i18n/locales/gu.js.map +1 -0
  115. package/dist/i18n/locales/he.d.ts +6 -0
  116. package/dist/i18n/locales/he.d.ts.map +1 -0
  117. package/dist/i18n/locales/he.js +106 -0
  118. package/dist/i18n/locales/he.js.map +1 -0
  119. package/dist/i18n/locales/hi.d.ts +6 -0
  120. package/dist/i18n/locales/hi.d.ts.map +1 -0
  121. package/dist/i18n/locales/hi.js +106 -0
  122. package/dist/i18n/locales/hi.js.map +1 -0
  123. package/dist/i18n/locales/hu.d.ts +6 -0
  124. package/dist/i18n/locales/hu.d.ts.map +1 -0
  125. package/dist/i18n/locales/hu.js +106 -0
  126. package/dist/i18n/locales/hu.js.map +1 -0
  127. package/dist/i18n/locales/id.d.ts +6 -0
  128. package/dist/i18n/locales/id.d.ts.map +1 -0
  129. package/dist/i18n/locales/id.js +106 -0
  130. package/dist/i18n/locales/id.js.map +1 -0
  131. package/dist/i18n/locales/index.d.ts +110 -0
  132. package/dist/i18n/locales/index.d.ts.map +1 -0
  133. package/dist/i18n/locales/index.js +123 -0
  134. package/dist/i18n/locales/index.js.map +1 -0
  135. package/dist/i18n/locales/is.d.ts +6 -0
  136. package/dist/i18n/locales/is.d.ts.map +1 -0
  137. package/dist/i18n/locales/is.js +383 -0
  138. package/dist/i18n/locales/is.js.map +1 -0
  139. package/dist/i18n/locales/it.d.ts +6 -0
  140. package/dist/i18n/locales/it.d.ts.map +1 -0
  141. package/dist/i18n/locales/it.js +106 -0
  142. package/dist/i18n/locales/it.js.map +1 -0
  143. package/dist/i18n/locales/iu.d.ts +8 -0
  144. package/dist/i18n/locales/iu.d.ts.map +1 -0
  145. package/dist/i18n/locales/iu.js +11 -0
  146. package/dist/i18n/locales/iu.js.map +1 -0
  147. package/dist/i18n/locales/ja.d.ts +6 -0
  148. package/dist/i18n/locales/ja.d.ts.map +1 -0
  149. package/dist/i18n/locales/ja.js +106 -0
  150. package/dist/i18n/locales/ja.js.map +1 -0
  151. package/dist/i18n/locales/kn.d.ts +6 -0
  152. package/dist/i18n/locales/kn.d.ts.map +1 -0
  153. package/dist/i18n/locales/kn.js +106 -0
  154. package/dist/i18n/locales/kn.js.map +1 -0
  155. package/dist/i18n/locales/ko.d.ts +6 -0
  156. package/dist/i18n/locales/ko.d.ts.map +1 -0
  157. package/dist/i18n/locales/ko.js +106 -0
  158. package/dist/i18n/locales/ko.js.map +1 -0
  159. package/dist/i18n/locales/mic.d.ts +8 -0
  160. package/dist/i18n/locales/mic.d.ts.map +1 -0
  161. package/dist/i18n/locales/mic.js +11 -0
  162. package/dist/i18n/locales/mic.js.map +1 -0
  163. package/dist/i18n/locales/ml.d.ts +6 -0
  164. package/dist/i18n/locales/ml.d.ts.map +1 -0
  165. package/dist/i18n/locales/ml.js +106 -0
  166. package/dist/i18n/locales/ml.js.map +1 -0
  167. package/dist/i18n/locales/moh.d.ts +8 -0
  168. package/dist/i18n/locales/moh.d.ts.map +1 -0
  169. package/dist/i18n/locales/moh.js +11 -0
  170. package/dist/i18n/locales/moh.js.map +1 -0
  171. package/dist/i18n/locales/mr.d.ts +6 -0
  172. package/dist/i18n/locales/mr.d.ts.map +1 -0
  173. package/dist/i18n/locales/mr.js +106 -0
  174. package/dist/i18n/locales/mr.js.map +1 -0
  175. package/dist/i18n/locales/ms.d.ts +6 -0
  176. package/dist/i18n/locales/ms.d.ts.map +1 -0
  177. package/dist/i18n/locales/ms.js +106 -0
  178. package/dist/i18n/locales/ms.js.map +1 -0
  179. package/dist/i18n/locales/nl.d.ts +6 -0
  180. package/dist/i18n/locales/nl.d.ts.map +1 -0
  181. package/dist/i18n/locales/nl.js +106 -0
  182. package/dist/i18n/locales/nl.js.map +1 -0
  183. package/dist/i18n/locales/no.d.ts +6 -0
  184. package/dist/i18n/locales/no.d.ts.map +1 -0
  185. package/dist/i18n/locales/no.js +106 -0
  186. package/dist/i18n/locales/no.js.map +1 -0
  187. package/dist/i18n/locales/oj.d.ts +8 -0
  188. package/dist/i18n/locales/oj.d.ts.map +1 -0
  189. package/dist/i18n/locales/oj.js +11 -0
  190. package/dist/i18n/locales/oj.js.map +1 -0
  191. package/dist/i18n/locales/pa.d.ts +6 -0
  192. package/dist/i18n/locales/pa.d.ts.map +1 -0
  193. package/dist/i18n/locales/pa.js +106 -0
  194. package/dist/i18n/locales/pa.js.map +1 -0
  195. package/dist/i18n/locales/pl.d.ts +6 -0
  196. package/dist/i18n/locales/pl.d.ts.map +1 -0
  197. package/dist/i18n/locales/pl.js +106 -0
  198. package/dist/i18n/locales/pl.js.map +1 -0
  199. package/dist/i18n/locales/pt-BR.d.ts +6 -0
  200. package/dist/i18n/locales/pt-BR.d.ts.map +1 -0
  201. package/dist/i18n/locales/pt-BR.js +106 -0
  202. package/dist/i18n/locales/pt-BR.js.map +1 -0
  203. package/dist/i18n/locales/pt.d.ts +6 -0
  204. package/dist/i18n/locales/pt.d.ts.map +1 -0
  205. package/dist/i18n/locales/pt.js +106 -0
  206. package/dist/i18n/locales/pt.js.map +1 -0
  207. package/dist/i18n/locales/ro.d.ts +6 -0
  208. package/dist/i18n/locales/ro.d.ts.map +1 -0
  209. package/dist/i18n/locales/ro.js +106 -0
  210. package/dist/i18n/locales/ro.js.map +1 -0
  211. package/dist/i18n/locales/ru.d.ts +6 -0
  212. package/dist/i18n/locales/ru.d.ts.map +1 -0
  213. package/dist/i18n/locales/ru.js +106 -0
  214. package/dist/i18n/locales/ru.js.map +1 -0
  215. package/dist/i18n/locales/sv.d.ts +6 -0
  216. package/dist/i18n/locales/sv.d.ts.map +1 -0
  217. package/dist/i18n/locales/sv.js +106 -0
  218. package/dist/i18n/locales/sv.js.map +1 -0
  219. package/dist/i18n/locales/ta.d.ts +6 -0
  220. package/dist/i18n/locales/ta.d.ts.map +1 -0
  221. package/dist/i18n/locales/ta.js +106 -0
  222. package/dist/i18n/locales/ta.js.map +1 -0
  223. package/dist/i18n/locales/te.d.ts +6 -0
  224. package/dist/i18n/locales/te.d.ts.map +1 -0
  225. package/dist/i18n/locales/te.js +106 -0
  226. package/dist/i18n/locales/te.js.map +1 -0
  227. package/dist/i18n/locales/th.d.ts +6 -0
  228. package/dist/i18n/locales/th.d.ts.map +1 -0
  229. package/dist/i18n/locales/th.js +106 -0
  230. package/dist/i18n/locales/th.js.map +1 -0
  231. package/dist/i18n/locales/tl.d.ts +6 -0
  232. package/dist/i18n/locales/tl.d.ts.map +1 -0
  233. package/dist/i18n/locales/tl.js +106 -0
  234. package/dist/i18n/locales/tl.js.map +1 -0
  235. package/dist/i18n/locales/tr.d.ts +6 -0
  236. package/dist/i18n/locales/tr.d.ts.map +1 -0
  237. package/dist/i18n/locales/tr.js +106 -0
  238. package/dist/i18n/locales/tr.js.map +1 -0
  239. package/dist/i18n/locales/uk.d.ts +6 -0
  240. package/dist/i18n/locales/uk.d.ts.map +1 -0
  241. package/dist/i18n/locales/uk.js +106 -0
  242. package/dist/i18n/locales/uk.js.map +1 -0
  243. package/dist/i18n/locales/ur.d.ts +6 -0
  244. package/dist/i18n/locales/ur.d.ts.map +1 -0
  245. package/dist/i18n/locales/ur.js +383 -0
  246. package/dist/i18n/locales/ur.js.map +1 -0
  247. package/dist/i18n/locales/vi.d.ts +6 -0
  248. package/dist/i18n/locales/vi.d.ts.map +1 -0
  249. package/dist/i18n/locales/vi.js +106 -0
  250. package/dist/i18n/locales/vi.js.map +1 -0
  251. package/dist/i18n/locales/zh-CN.d.ts +6 -0
  252. package/dist/i18n/locales/zh-CN.d.ts.map +1 -0
  253. package/dist/i18n/locales/zh-CN.js +106 -0
  254. package/dist/i18n/locales/zh-CN.js.map +1 -0
  255. package/dist/i18n/locales/zh-TW.d.ts +6 -0
  256. package/dist/i18n/locales/zh-TW.d.ts.map +1 -0
  257. package/dist/i18n/locales/zh-TW.js +106 -0
  258. package/dist/i18n/locales/zh-TW.js.map +1 -0
  259. package/dist/i18n/types.d.ts +101 -0
  260. package/dist/i18n/types.d.ts.map +1 -0
  261. package/dist/i18n/types.js +65 -0
  262. package/dist/i18n/types.js.map +1 -0
  263. package/dist/index.d.ts +20 -0
  264. package/dist/index.d.ts.map +1 -0
  265. package/dist/index.js +472 -0
  266. package/dist/index.js.map +1 -0
  267. package/dist/server/index.d.ts +39 -0
  268. package/dist/server/index.d.ts.map +1 -0
  269. package/dist/server/index.js +89 -0
  270. package/dist/server/index.js.map +1 -0
  271. package/dist/tools/definitions.d.ts +26 -0
  272. package/dist/tools/definitions.d.ts.map +1 -0
  273. package/dist/tools/definitions.js +785 -0
  274. package/dist/tools/definitions.js.map +1 -0
  275. package/dist/tools/handlers.d.ts +19 -0
  276. package/dist/tools/handlers.d.ts.map +1 -0
  277. package/dist/tools/handlers.js +477 -0
  278. package/dist/tools/handlers.js.map +1 -0
  279. package/dist/tools/index.d.ts +3 -0
  280. package/dist/tools/index.d.ts.map +1 -0
  281. package/dist/tools/index.js +3 -0
  282. package/dist/tools/index.js.map +1 -0
  283. package/dist/types/code-generator.d.ts +97 -0
  284. package/dist/types/code-generator.d.ts.map +1 -0
  285. package/dist/types/code-generator.js +545 -0
  286. package/dist/types/code-generator.js.map +1 -0
  287. package/dist/types/index.d.ts +3 -0
  288. package/dist/types/index.d.ts.map +1 -0
  289. package/dist/types/index.js +3 -0
  290. package/dist/types/index.js.map +1 -0
  291. package/dist/types/schemas.d.ts +707 -0
  292. package/dist/types/schemas.d.ts.map +1 -0
  293. package/dist/types/schemas.js +341 -0
  294. package/dist/types/schemas.js.map +1 -0
  295. package/package.json +81 -0
@@ -0,0 +1,785 @@
1
+ /**
2
+ * PinePaper MCP Tool Definitions
3
+ *
4
+ * This file contains all the tool definitions for the MCP server.
5
+ * Each tool has a name, description, and JSON schema for inputs.
6
+ *
7
+ * Note: Tool descriptions remain in English for optimal AI/LLM understanding.
8
+ * User-facing messages (errors, success) are translated via i18n.
9
+ */
10
+ // =============================================================================
11
+ // TOOL DEFINITIONS
12
+ // =============================================================================
13
+ export const PINEPAPER_TOOLS = [
14
+ // ---------------------------------------------------------------------------
15
+ // ITEM TOOLS
16
+ // ---------------------------------------------------------------------------
17
+ {
18
+ name: 'pinepaper_create_item',
19
+ description: `Create an item on the PinePaper canvas. Returns an itemId (e.g., "item_1") that you MUST save to reference this item later.
20
+
21
+ USE WHEN:
22
+ - User wants to add text, shapes, or graphics to the canvas
23
+ - Creating new visual elements (circles, stars, rectangles, etc.)
24
+ - Starting a new scene or composition
25
+
26
+ IMPORTANT:
27
+ - Save the returned itemId! You need it for pinepaper_add_relation, pinepaper_modify_item, pinepaper_delete_item, etc.
28
+ - If there's a welcome template on the canvas, use pinepaper_clear_canvas first
29
+ - Position defaults to canvas center (400, 300). Use position: {x, y} to place elsewhere.
30
+
31
+ ITEM TYPES:
32
+ - text: Text content with font styling (properties: content, fontSize, color, fontFamily)
33
+ - circle: Circular shape (properties: radius, color, strokeColor, strokeWidth)
34
+ - star: Star shape (properties: radius1, radius2, points, color)
35
+ - rectangle: Rectangle (properties: width, height, color, cornerRadius)
36
+ - triangle: Triangular shape (properties: color)
37
+ - polygon: Regular polygon with N sides (properties: sides, radius, color)
38
+ - ellipse: Oval shape (properties: color)
39
+ - path: Custom path with segments or SVG data (properties: segments, pathData, strokeColor)
40
+ - line: Line between two points (properties: from, to, strokeColor, strokeWidth)
41
+ - arc: Curved arc through three points (properties: from, through, to, strokeColor)
42
+
43
+ EXAMPLES:
44
+ - "Create red text saying HELLO" → itemType: "text", properties: {content: "HELLO", color: "#ef4444", fontSize: 48}
45
+ - "Add a blue circle" → itemType: "circle", properties: {radius: 50, color: "#3b82f6"}
46
+ - "Create a 5-pointed gold star" → itemType: "star", properties: {radius1: 60, radius2: 30, points: 5, color: "#fbbf24"}
47
+
48
+ WORKFLOW TIP:
49
+ After creating items, use pinepaper_add_relation to animate them (e.g., orbits, follows, attached_to).`,
50
+ inputSchema: {
51
+ type: 'object',
52
+ properties: {
53
+ itemType: {
54
+ type: 'string',
55
+ enum: ['text', 'circle', 'star', 'rectangle', 'triangle', 'polygon', 'ellipse', 'path', 'line', 'arc'],
56
+ description: 'Type of item to create',
57
+ },
58
+ position: {
59
+ type: 'object',
60
+ properties: {
61
+ x: { type: 'number', description: 'X coordinate (default: 400)' },
62
+ y: { type: 'number', description: 'Y coordinate (default: 300)' },
63
+ },
64
+ description: 'Position on canvas',
65
+ },
66
+ properties: {
67
+ type: 'object',
68
+ description: 'Type-specific properties (content, radius, color, fontSize, etc.)',
69
+ additionalProperties: true,
70
+ },
71
+ },
72
+ required: ['itemType'],
73
+ },
74
+ },
75
+ {
76
+ name: 'pinepaper_modify_item',
77
+ description: `Modify an existing item's properties.
78
+
79
+ USE WHEN:
80
+ - Changing color, size, position of an existing item
81
+ - Updating text content
82
+ - Adjusting styling properties
83
+
84
+ MODIFIABLE PROPERTIES:
85
+ - position: {x, y} or separate x, y
86
+ - color/fillColor: Fill color
87
+ - strokeColor: Outline color
88
+ - strokeWidth: Outline thickness
89
+ - fontSize: Text size
90
+ - content: Text content
91
+ - opacity: Transparency (0-1)
92
+ - rotation: Rotation in degrees
93
+ - scale: Size multiplier`,
94
+ inputSchema: {
95
+ type: 'object',
96
+ properties: {
97
+ itemId: {
98
+ type: 'string',
99
+ description: 'Registry ID of the item (e.g., "item_1")',
100
+ },
101
+ properties: {
102
+ type: 'object',
103
+ description: 'Properties to update',
104
+ additionalProperties: true,
105
+ },
106
+ },
107
+ required: ['itemId', 'properties'],
108
+ },
109
+ },
110
+ {
111
+ name: 'pinepaper_delete_item',
112
+ description: `Delete a single item from the canvas by its registry ID.
113
+
114
+ USE WHEN:
115
+ - Removing a specific unwanted item
116
+ - Cleaning up individual elements
117
+ - Undoing a creation mistake
118
+
119
+ HOW TO FIND ITEM IDs:
120
+ 1. The itemId is returned when you create an item (e.g., "item_1", "item_2")
121
+ 2. Use pinepaper_get_items to list all items and their IDs
122
+ 3. Items are typically named sequentially: item_1, item_2, item_3, etc.
123
+
124
+ IF DELETION FAILS:
125
+ - Verify the itemId exists with pinepaper_get_items first
126
+ - If the item is part of the welcome template, use pinepaper_clear_canvas instead
127
+ - For stubborn items, try pinepaper_refresh_page to reset the entire canvas
128
+
129
+ TO DELETE ALL ITEMS:
130
+ Use pinepaper_clear_canvas instead of deleting items one by one.`,
131
+ inputSchema: {
132
+ type: 'object',
133
+ properties: {
134
+ itemId: {
135
+ type: 'string',
136
+ description: 'Registry ID of the item to delete (e.g., "item_1")',
137
+ },
138
+ },
139
+ required: ['itemId'],
140
+ },
141
+ },
142
+ // ---------------------------------------------------------------------------
143
+ // RELATION TOOLS (KEY FOR ANIMATION)
144
+ // ---------------------------------------------------------------------------
145
+ {
146
+ name: 'pinepaper_add_relation',
147
+ description: `Create a behavior relationship between two items. Relations are the PRIMARY way to add animation in PinePaper - they describe HOW items should behave relative to each other.
148
+
149
+ USE WHEN:
150
+ - "moon orbits earth" → relationType: orbits
151
+ - "label follows player" → relationType: follows
152
+ - "hat attached to character" → relationType: attached_to
153
+ - "keep satellite 200px from station" → relationType: maintains_distance
154
+ - "arrow points at target" → relationType: points_at
155
+ - "reflection mirrors original" → relationType: mirrors
156
+ - "background moves with parallax" → relationType: parallax
157
+ - "player stays in arena" → relationType: bounds_to
158
+ - Creating physics-based or behavioral animations
159
+
160
+ RELATION TYPES:
161
+ - orbits: Circular motion around target (params: radius, speed, direction, phase)
162
+ - follows: Move toward target with smoothing (params: offset, smoothing, delay)
163
+ - attached_to: Fixed offset from target (params: offset, inherit_rotation)
164
+ - maintains_distance: Stay fixed distance from target (params: distance, strength)
165
+ - points_at: Rotate to face target (params: offset_angle, smoothing)
166
+ - mirrors: Mirror position across axis (params: axis, center)
167
+ - parallax: Move relative by depth (params: depth, origin)
168
+ - bounds_to: Stay within bounds (params: padding, bounce)
169
+
170
+ VERIFYING ANIMATION WORKS:
171
+ After adding a relation, verify the animation is running:
172
+ 1. Use pinepaper_browser_screenshot to see the canvas
173
+ 2. Wait 1-2 seconds and take another screenshot - items should have moved
174
+ 3. Use pinepaper_query_relations to confirm the relation was added
175
+
176
+ Relations are COMPOSITIONAL - an item can have multiple relations that work together!`,
177
+ inputSchema: {
178
+ type: 'object',
179
+ properties: {
180
+ sourceId: {
181
+ type: 'string',
182
+ description: 'Registry ID of the source item (the item that will be affected)',
183
+ },
184
+ targetId: {
185
+ type: 'string',
186
+ description: 'Registry ID of the target item (the item being related to)',
187
+ },
188
+ relationType: {
189
+ type: 'string',
190
+ enum: ['orbits', 'follows', 'attached_to', 'maintains_distance', 'points_at', 'mirrors', 'parallax', 'bounds_to'],
191
+ description: 'Type of relationship',
192
+ },
193
+ params: {
194
+ type: 'object',
195
+ description: 'Relation-specific parameters',
196
+ additionalProperties: true,
197
+ },
198
+ },
199
+ required: ['sourceId', 'targetId', 'relationType'],
200
+ },
201
+ },
202
+ {
203
+ name: 'pinepaper_remove_relation',
204
+ description: `Remove a relationship between items.
205
+
206
+ USE WHEN:
207
+ - Stopping an orbital animation
208
+ - Detaching items from each other
209
+ - Removing behavioral connections`,
210
+ inputSchema: {
211
+ type: 'object',
212
+ properties: {
213
+ sourceId: { type: 'string', description: 'Source item ID' },
214
+ targetId: { type: 'string', description: 'Target item ID' },
215
+ relationType: {
216
+ type: 'string',
217
+ enum: ['orbits', 'follows', 'attached_to', 'maintains_distance', 'points_at', 'mirrors', 'parallax', 'bounds_to'],
218
+ description: 'Specific relation type to remove (optional - removes all if not specified)',
219
+ },
220
+ },
221
+ required: ['sourceId', 'targetId'],
222
+ },
223
+ },
224
+ {
225
+ name: 'pinepaper_query_relations',
226
+ description: `Query relationships for an item.
227
+
228
+ USE WHEN:
229
+ - Finding what items orbit a central object
230
+ - Checking existing relations before adding new ones
231
+ - Debugging animation behaviors`,
232
+ inputSchema: {
233
+ type: 'object',
234
+ properties: {
235
+ itemId: { type: 'string', description: 'Item to query relations for' },
236
+ relationType: {
237
+ type: 'string',
238
+ enum: ['orbits', 'follows', 'attached_to', 'maintains_distance', 'points_at', 'mirrors', 'parallax', 'bounds_to'],
239
+ description: 'Filter by relation type (optional)',
240
+ },
241
+ direction: {
242
+ type: 'string',
243
+ enum: ['outgoing', 'incoming'],
244
+ description: 'outgoing = relations FROM item, incoming = relations TO item',
245
+ },
246
+ },
247
+ required: ['itemId'],
248
+ },
249
+ },
250
+ // ---------------------------------------------------------------------------
251
+ // ANIMATION TOOLS
252
+ // ---------------------------------------------------------------------------
253
+ {
254
+ name: 'pinepaper_animate',
255
+ description: `Apply a simple LOOP animation to an item. These are continuous animations that repeat infinitely.
256
+
257
+ USE WHEN:
258
+ - "make it pulse" → animationType: pulse
259
+ - "rotating logo" → animationType: rotate
260
+ - "bouncing text" → animationType: bounce
261
+ - "fading effect" → animationType: fade
262
+ - "wobbling button" → animationType: wobble
263
+ - "sliding header" → animationType: slide
264
+ - "typewriter effect" → animationType: typewriter (text only)
265
+
266
+ DO NOT USE WHEN:
267
+ - User specifies exact timing ("fade in over 3 seconds") → Use keyframe animation
268
+ - User wants sequential animations ("first fade, then rotate") → Use keyframe animation
269
+ - User describes relationships ("orbit around") → Use relations
270
+
271
+ ANIMATION TYPES:
272
+ - pulse: Scale up/down rhythmically
273
+ - rotate: Continuous rotation
274
+ - bounce: Vertical bouncing motion
275
+ - fade: Opacity cycling
276
+ - wobble: Side-to-side wobbling
277
+ - slide: Horizontal sliding
278
+ - typewriter: Character-by-character reveal`,
279
+ inputSchema: {
280
+ type: 'object',
281
+ properties: {
282
+ itemId: { type: 'string', description: 'Registry ID of the item' },
283
+ animationType: {
284
+ type: 'string',
285
+ enum: ['pulse', 'rotate', 'bounce', 'fade', 'wobble', 'slide', 'typewriter'],
286
+ description: 'Type of animation',
287
+ },
288
+ speed: {
289
+ type: 'number',
290
+ description: 'Animation speed multiplier (default: 1.0)',
291
+ },
292
+ },
293
+ required: ['itemId', 'animationType'],
294
+ },
295
+ },
296
+ {
297
+ name: 'pinepaper_keyframe_animate',
298
+ description: `Apply keyframe-based animation with precise timing and property control.
299
+
300
+ USE WHEN:
301
+ - "fade in over 3 seconds"
302
+ - "move from left to right in 2 seconds"
303
+ - "change color from red to blue"
304
+ - "first fade in, then rotate, then fade out"
305
+ - Any animation with specific timing or sequential stages
306
+
307
+ ANIMATABLE PROPERTIES:
308
+ - position: [x, y] array
309
+ - x, y: Individual coordinates
310
+ - scale: Uniform scale
311
+ - scaleX, scaleY: Axis scaling
312
+ - rotation: Degrees
313
+ - opacity: 0-1
314
+ - fillColor: Color string
315
+ - strokeColor: Color string
316
+ - fontSize: Number
317
+
318
+ EASING OPTIONS:
319
+ - linear: Constant speed
320
+ - easeIn: Slow start
321
+ - easeOut: Slow end
322
+ - easeInOut: Slow start and end
323
+ - bounce: Bounce effect
324
+ - elastic: Elastic overshoot`,
325
+ inputSchema: {
326
+ type: 'object',
327
+ properties: {
328
+ itemId: { type: 'string', description: 'Registry ID of the item' },
329
+ keyframes: {
330
+ type: 'array',
331
+ items: {
332
+ type: 'object',
333
+ properties: {
334
+ time: { type: 'number', description: 'Time in seconds' },
335
+ properties: {
336
+ type: 'object',
337
+ description: 'Property values at this keyframe',
338
+ additionalProperties: true,
339
+ },
340
+ easing: {
341
+ type: 'string',
342
+ enum: ['linear', 'easeIn', 'easeOut', 'easeInOut', 'bounce', 'elastic'],
343
+ },
344
+ },
345
+ required: ['time', 'properties'],
346
+ },
347
+ description: 'Array of keyframes',
348
+ },
349
+ duration: {
350
+ type: 'number',
351
+ description: 'Total animation duration in seconds',
352
+ },
353
+ loop: {
354
+ type: 'boolean',
355
+ description: 'Whether to loop the animation',
356
+ },
357
+ },
358
+ required: ['itemId', 'keyframes'],
359
+ },
360
+ },
361
+ {
362
+ name: 'pinepaper_play_timeline',
363
+ description: `Control keyframe animation playback.
364
+
365
+ USE WHEN:
366
+ - Starting/stopping timeline playback
367
+ - Seeking to specific time
368
+ - Controlling animation state`,
369
+ inputSchema: {
370
+ type: 'object',
371
+ properties: {
372
+ action: {
373
+ type: 'string',
374
+ enum: ['play', 'stop', 'seek'],
375
+ description: 'Playback action',
376
+ },
377
+ duration: {
378
+ type: 'number',
379
+ description: 'Duration for play action',
380
+ },
381
+ loop: {
382
+ type: 'boolean',
383
+ description: 'Whether to loop',
384
+ },
385
+ time: {
386
+ type: 'number',
387
+ description: 'Time to seek to (for seek action)',
388
+ },
389
+ },
390
+ required: ['action'],
391
+ },
392
+ },
393
+ // ---------------------------------------------------------------------------
394
+ // GENERATOR TOOLS
395
+ // ---------------------------------------------------------------------------
396
+ {
397
+ name: 'pinepaper_execute_generator',
398
+ description: `Execute a background generator to create procedural patterns.
399
+
400
+ USE WHEN:
401
+ - "add a sunburst background"
402
+ - "create wave pattern"
403
+ - "grid background"
404
+ - "circuit board pattern"
405
+ - Creating dynamic procedural backgrounds
406
+
407
+ GENERATORS:
408
+ - drawSunburst: Radial rays from center (rayCount, colors, bgColor)
409
+ - drawSunsetScene: Animated sunset with clouds (sunColor, skyColors, cloudCount)
410
+ - drawGrid: Lines, dots, or squares (gridType, spacing, lineColor)
411
+ - drawStackedCircles: Overlapping circles (count, colors, distribution)
412
+ - drawCircuit: Tech circuit board (lineColor, nodeColor, density)
413
+ - drawWaves: Layered wave pattern (waveCount, colors, amplitude)
414
+ - drawPattern: Geometric shapes in orbit`,
415
+ inputSchema: {
416
+ type: 'object',
417
+ properties: {
418
+ generatorName: {
419
+ type: 'string',
420
+ enum: ['drawSunburst', 'drawSunsetScene', 'drawGrid', 'drawStackedCircles', 'drawCircuit', 'drawWaves', 'drawPattern'],
421
+ description: 'Generator name',
422
+ },
423
+ params: {
424
+ type: 'object',
425
+ description: 'Generator-specific parameters',
426
+ additionalProperties: true,
427
+ },
428
+ },
429
+ required: ['generatorName'],
430
+ },
431
+ },
432
+ {
433
+ name: 'pinepaper_list_generators',
434
+ description: `Get a list of all available background generators with their parameters.
435
+
436
+ USE WHEN:
437
+ - User asks "what backgrounds are available?"
438
+ - Need to show generator options
439
+ - Discovering generator capabilities`,
440
+ inputSchema: {
441
+ type: 'object',
442
+ properties: {},
443
+ },
444
+ },
445
+ // ---------------------------------------------------------------------------
446
+ // EFFECT TOOLS
447
+ // ---------------------------------------------------------------------------
448
+ {
449
+ name: 'pinepaper_apply_effect',
450
+ description: `Apply a visual effect to an item.
451
+
452
+ USE WHEN:
453
+ - Adding sparkle/glitter effects
454
+ - Creating burst/explosion effects
455
+ - Enhancing visual impact
456
+
457
+ EFFECTS:
458
+ - sparkle: Glitter/sparkle particles (color, speed, size)
459
+ - blast: Explosion burst effect (color, radius, count)`,
460
+ inputSchema: {
461
+ type: 'object',
462
+ properties: {
463
+ itemId: { type: 'string', description: 'Registry ID of the item' },
464
+ effectType: {
465
+ type: 'string',
466
+ enum: ['sparkle', 'blast'],
467
+ description: 'Type of effect',
468
+ },
469
+ params: {
470
+ type: 'object',
471
+ description: 'Effect parameters',
472
+ additionalProperties: true,
473
+ },
474
+ },
475
+ required: ['itemId', 'effectType'],
476
+ },
477
+ },
478
+ // ---------------------------------------------------------------------------
479
+ // QUERY TOOLS
480
+ // ---------------------------------------------------------------------------
481
+ {
482
+ name: 'pinepaper_get_items',
483
+ description: `Get all or filtered items from the canvas.
484
+
485
+ USE WHEN:
486
+ - Listing what's on the canvas
487
+ - Finding items by type
488
+ - Checking animated items
489
+ - Scene inspection`,
490
+ inputSchema: {
491
+ type: 'object',
492
+ properties: {
493
+ filter: {
494
+ type: 'object',
495
+ properties: {
496
+ type: {
497
+ type: 'string',
498
+ enum: ['text', 'circle', 'star', 'rectangle', 'triangle', 'polygon', 'ellipse', 'path', 'line', 'arc'],
499
+ description: 'Filter by item type',
500
+ },
501
+ source: {
502
+ type: 'string',
503
+ enum: ['user', 'generator', 'import'],
504
+ description: 'Filter by item source',
505
+ },
506
+ hasAnimation: {
507
+ type: 'boolean',
508
+ description: 'Filter by animation status',
509
+ },
510
+ hasRelation: {
511
+ type: 'boolean',
512
+ description: 'Filter by relation status',
513
+ },
514
+ },
515
+ },
516
+ },
517
+ },
518
+ },
519
+ {
520
+ name: 'pinepaper_get_relation_stats',
521
+ description: `Get statistics about active relations in the scene.
522
+
523
+ USE WHEN:
524
+ - Debugging relation system
525
+ - Understanding scene complexity
526
+ - Analytics and reporting`,
527
+ inputSchema: {
528
+ type: 'object',
529
+ properties: {},
530
+ },
531
+ },
532
+ // ---------------------------------------------------------------------------
533
+ // CANVAS TOOLS
534
+ // ---------------------------------------------------------------------------
535
+ {
536
+ name: 'pinepaper_set_background_color',
537
+ description: `Set the canvas background color.
538
+
539
+ USE WHEN:
540
+ - Changing scene background
541
+ - Setting up canvas before adding items`,
542
+ inputSchema: {
543
+ type: 'object',
544
+ properties: {
545
+ color: {
546
+ type: 'string',
547
+ description: 'Background color (hex, rgb, or named)',
548
+ },
549
+ },
550
+ required: ['color'],
551
+ },
552
+ },
553
+ {
554
+ name: 'pinepaper_set_canvas_size',
555
+ description: `Change the canvas dimensions.
556
+
557
+ IMPORTANT: Call this BEFORE creating items if you need a specific canvas size. The default canvas is 800x600 which may be too small for complex designs.
558
+
559
+ USE WHEN:
560
+ - Starting a new design - SET SIZE FIRST before adding items
561
+ - Setting up for specific format (Instagram, YouTube, etc.)
562
+ - Custom canvas size requirements
563
+ - Design elements extend beyond current canvas bounds
564
+
565
+ COMMON PRESETS:
566
+ - instagram-square: 1080x1080
567
+ - instagram-story: 1080x1920
568
+ - youtube-thumbnail: 1280x720
569
+ - twitter-post: 1200x675
570
+ - hd-landscape: 1920x1080
571
+ - hd-portrait: 1080x1920
572
+
573
+ For wedding invitations, event cards, or detailed designs, use at least 1080x1080 or larger.`,
574
+ inputSchema: {
575
+ type: 'object',
576
+ properties: {
577
+ width: { type: 'number', description: 'Canvas width in pixels' },
578
+ height: { type: 'number', description: 'Canvas height in pixels' },
579
+ preset: {
580
+ type: 'string',
581
+ description: 'Optional preset name',
582
+ },
583
+ },
584
+ required: ['width', 'height'],
585
+ },
586
+ },
587
+ {
588
+ name: 'pinepaper_get_canvas_size',
589
+ description: `Get the current canvas dimensions.
590
+
591
+ USE WHEN:
592
+ - Need to know current canvas size before positioning items
593
+ - Checking if canvas needs to be resized
594
+ - Calculating positions relative to canvas bounds`,
595
+ inputSchema: {
596
+ type: 'object',
597
+ properties: {},
598
+ },
599
+ },
600
+ {
601
+ name: 'pinepaper_clear_canvas',
602
+ description: `Clear all items from the canvas, removing everything including any welcome template items.
603
+
604
+ USE WHEN:
605
+ - User wants to start fresh with an empty canvas
606
+ - Need to remove all existing items before creating new ones
607
+ - Clearing the welcome template that appears for first-time visitors
608
+ - User says "clear everything", "start over", "reset canvas", "remove all items"
609
+
610
+ IMPORTANT NOTES:
611
+ - This removes ALL items from the canvas permanently
612
+ - The welcome template (shown to first-time visitors) will be cleared
613
+ - After clearing, use pinepaper_get_items to verify the canvas is empty
614
+ - If items persist after clearing, try pinepaper_refresh_page instead`,
615
+ inputSchema: {
616
+ type: 'object',
617
+ properties: {},
618
+ },
619
+ },
620
+ {
621
+ name: 'pinepaper_refresh_page',
622
+ description: `Refresh the PinePaper Studio page in the browser. This is the most reliable way to get a completely clean canvas.
623
+
624
+ USE WHEN:
625
+ - pinepaper_clear_canvas didn't fully remove all items
626
+ - Need a guaranteed clean slate
627
+ - Want to remove the welcome template completely
628
+ - Troubleshooting issues with the canvas state
629
+ - User explicitly asks to "refresh" or "reload"
630
+
631
+ IMPORTANT NOTES:
632
+ - This reloads the entire page, which resets everything
633
+ - The welcome template will NOT appear after refresh (only shows for first-time visitors)
634
+ - After refresh, the canvas will be completely empty
635
+ - All unsaved work will be lost
636
+ - You may need to wait a moment after refresh before executing other commands`,
637
+ inputSchema: {
638
+ type: 'object',
639
+ properties: {},
640
+ },
641
+ },
642
+ // ---------------------------------------------------------------------------
643
+ // EXPORT TOOLS
644
+ // ---------------------------------------------------------------------------
645
+ {
646
+ name: 'pinepaper_export_svg',
647
+ description: `Export the scene as animated SVG.
648
+
649
+ USE WHEN:
650
+ - Saving work as SVG file
651
+ - Generating shareable graphics
652
+ - Final export`,
653
+ inputSchema: {
654
+ type: 'object',
655
+ properties: {
656
+ animated: {
657
+ type: 'boolean',
658
+ description: 'Include CSS animations (default: true)',
659
+ },
660
+ },
661
+ },
662
+ },
663
+ {
664
+ name: 'pinepaper_export_training_data',
665
+ description: `Export relation data as training pairs for LLM fine-tuning. This generates instruction/code pairs from the current scene's relations.
666
+
667
+ USE WHEN:
668
+ - Generating training data for fine-tuning
669
+ - Creating examples from current scene
670
+ - Building custom animation model training sets
671
+
672
+ OUTPUT FORMAT:
673
+ - json: Array of {instruction, code, relation, params}
674
+ - jsonl: JSONL format with messages array for chat fine-tuning`,
675
+ inputSchema: {
676
+ type: 'object',
677
+ properties: {
678
+ format: {
679
+ type: 'string',
680
+ enum: ['json', 'jsonl'],
681
+ description: 'Output format (default: json)',
682
+ },
683
+ includeMetadata: {
684
+ type: 'boolean',
685
+ description: 'Include relation metadata (default: true)',
686
+ },
687
+ },
688
+ },
689
+ },
690
+ // ---------------------------------------------------------------------------
691
+ // BROWSER CONTROL TOOLS
692
+ // ---------------------------------------------------------------------------
693
+ {
694
+ name: 'pinepaper_browser_connect',
695
+ description: `Connect to PinePaper Studio Editor in a browser. This launches a browser window and navigates to the PinePaper Editor.
696
+
697
+ USE WHEN:
698
+ - Starting a new PinePaper session
699
+ - Need to execute commands in the actual application
700
+ - User wants to see changes live in the browser
701
+
702
+ IMPORTANT: Call this FIRST before using any other pinepaper tools. Without connecting, tools only generate code but don't execute it.
703
+
704
+ The browser will open and navigate to https://pinepaper.studio/editor where the code console and JavaScript API are available.`,
705
+ inputSchema: {
706
+ type: 'object',
707
+ properties: {
708
+ url: {
709
+ type: 'string',
710
+ description: 'Custom PinePaper Studio URL (default: https://pinepaper.studio/editor)',
711
+ },
712
+ headless: {
713
+ type: 'boolean',
714
+ description: 'Run browser in headless mode - no visible window (default: false)',
715
+ },
716
+ },
717
+ },
718
+ },
719
+ {
720
+ name: 'pinepaper_browser_disconnect',
721
+ description: `Disconnect from the browser and close PinePaper Studio.
722
+
723
+ USE WHEN:
724
+ - Done working with PinePaper
725
+ - Need to clean up browser resources
726
+ - Switching to a different project`,
727
+ inputSchema: {
728
+ type: 'object',
729
+ properties: {},
730
+ },
731
+ },
732
+ {
733
+ name: 'pinepaper_browser_screenshot',
734
+ description: `Take a screenshot of the current PinePaper canvas.
735
+
736
+ USE WHEN:
737
+ - User wants to see the current state
738
+ - Verifying that changes were applied correctly
739
+ - Debugging visual issues
740
+
741
+ Returns a base64-encoded PNG image of the canvas.`,
742
+ inputSchema: {
743
+ type: 'object',
744
+ properties: {},
745
+ },
746
+ },
747
+ {
748
+ name: 'pinepaper_browser_status',
749
+ description: `Check the current browser connection status.
750
+
751
+ USE WHEN:
752
+ - Need to verify if connected to PinePaper
753
+ - Debugging connection issues
754
+ - Before executing commands`,
755
+ inputSchema: {
756
+ type: 'object',
757
+ properties: {},
758
+ },
759
+ },
760
+ ];
761
+ /**
762
+ * Get a tool definition by name
763
+ */
764
+ export function getToolByName(name) {
765
+ return PINEPAPER_TOOLS.find((t) => t.name === name);
766
+ }
767
+ /**
768
+ * Get all tool names
769
+ */
770
+ export function getToolNames() {
771
+ return PINEPAPER_TOOLS.map((t) => t.name);
772
+ }
773
+ /**
774
+ * Get tools with localized descriptions from i18n manager
775
+ * Tool descriptions remain in English for AI, but names can be localized for UI
776
+ */
777
+ export function getLocalizedTools(i18n) {
778
+ return PINEPAPER_TOOLS.map((tool) => ({
779
+ ...tool,
780
+ // Tool descriptions intentionally kept in English for AI understanding
781
+ // The i18n manager provides translated tool names for UI purposes
782
+ description: i18n.getToolDescription(tool.name) || tool.description,
783
+ }));
784
+ }
785
+ //# sourceMappingURL=definitions.js.map