@imgly/codesign-mcp 0.1.5 → 0.1.6

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 (973) hide show
  1. package/README.md +51 -1
  2. package/assets/docs/guide/SKILL.md +45 -53
  3. package/assets/docs/guide/animation/create/base.md +234 -243
  4. package/assets/docs/guide/animation/create/text.md +250 -231
  5. package/assets/docs/guide/animation/create.md +197 -231
  6. package/assets/docs/guide/animation/edit.md +196 -271
  7. package/assets/docs/guide/animation/types.md +182 -185
  8. package/assets/docs/guide/animation.md +9 -6
  9. package/assets/docs/guide/api/AssetAPI.md +7 -53
  10. package/assets/docs/guide/api/BlockAPI.md +725 -648
  11. package/assets/docs/guide/api/CreativeEngine.md +7 -16
  12. package/assets/docs/guide/api/EditorAPI.md +32 -93
  13. package/assets/docs/guide/api/EventAPI.md +1 -2
  14. package/assets/docs/guide/api/SceneAPI.md +47 -98
  15. package/assets/docs/guide/api/VariableAPI.md +1 -4
  16. package/assets/docs/guide/api/node/classes/assetapi.md +1090 -0
  17. package/assets/docs/guide/api/node/classes/blockapi.md +12965 -0
  18. package/assets/docs/guide/api/node/classes/creativeengine.md +319 -0
  19. package/assets/docs/guide/api/node/classes/editorapi.md +3417 -0
  20. package/assets/docs/guide/api/node/classes/engineactions.md +319 -0
  21. package/assets/docs/guide/api/node/classes/eventapi.md +56 -0
  22. package/assets/docs/guide/api/node/classes/sceneapi.md +1370 -0
  23. package/assets/docs/guide/api/node/classes/variableapi.md +143 -0
  24. package/assets/docs/guide/api/node/enumerations/compressionformat.md +23 -0
  25. package/assets/docs/guide/api/node/enumerations/compressionlevel.md +24 -0
  26. package/assets/docs/guide/api/node/functions/iscmykcolor.md +30 -0
  27. package/assets/docs/guide/api/node/functions/isrgbacolor.md +30 -0
  28. package/assets/docs/guide/api/node/functions/isspotcolor.md +30 -0
  29. package/assets/docs/guide/api/node/interfaces/addvideooptions.md +31 -0
  30. package/assets/docs/guide/api/node/interfaces/applyassetoptions.md +31 -0
  31. package/assets/docs/guide/api/node/interfaces/asset.md +30 -0
  32. package/assets/docs/guide/api/node/interfaces/assetbooleanproperty.md +25 -0
  33. package/assets/docs/guide/api/node/interfaces/assetcmykcolor.md +26 -0
  34. package/assets/docs/guide/api/node/interfaces/assetcolorproperty.md +25 -0
  35. package/assets/docs/guide/api/node/interfaces/assetcontentaspectratio.md +23 -0
  36. package/assets/docs/guide/api/node/interfaces/assetdefinition.md +31 -0
  37. package/assets/docs/guide/api/node/interfaces/assetenumproperty.md +26 -0
  38. package/assets/docs/guide/api/node/interfaces/assetfixedaspectratio.md +24 -0
  39. package/assets/docs/guide/api/node/interfaces/assetfixedsize.md +25 -0
  40. package/assets/docs/guide/api/node/interfaces/assetfreeaspectratio.md +22 -0
  41. package/assets/docs/guide/api/node/interfaces/assetnumberproperty.md +28 -0
  42. package/assets/docs/guide/api/node/interfaces/assetpayload.md +27 -0
  43. package/assets/docs/guide/api/node/interfaces/assetquerydata.md +32 -0
  44. package/assets/docs/guide/api/node/interfaces/assetresult.md +46 -0
  45. package/assets/docs/guide/api/node/interfaces/assetrgbcolor.md +25 -0
  46. package/assets/docs/guide/api/node/interfaces/assetsource.md +111 -0
  47. package/assets/docs/guide/api/node/interfaces/assetspotcolor.md +25 -0
  48. package/assets/docs/guide/api/node/interfaces/assetsqueryresult.md +31 -0
  49. package/assets/docs/guide/api/node/interfaces/assetstringproperty.md +25 -0
  50. package/assets/docs/guide/api/node/interfaces/assetstylepreset.md +39 -0
  51. package/assets/docs/guide/api/node/interfaces/assetstylepresetanimation.md +23 -0
  52. package/assets/docs/guide/api/node/interfaces/audiotrackinfo.md +32 -0
  53. package/assets/docs/guide/api/node/interfaces/blockevent.md +26 -0
  54. package/assets/docs/guide/api/node/interfaces/blockstateerror.md +26 -0
  55. package/assets/docs/guide/api/node/interfaces/blockstatepending.md +26 -0
  56. package/assets/docs/guide/api/node/interfaces/blockstateready.md +25 -0
  57. package/assets/docs/guide/api/node/interfaces/buffer.md +26 -0
  58. package/assets/docs/guide/api/node/interfaces/characterinkbox.md +29 -0
  59. package/assets/docs/guide/api/node/interfaces/cmykcolor.md +34 -0
  60. package/assets/docs/guide/api/node/interfaces/completeassetresult.md +46 -0
  61. package/assets/docs/guide/api/node/interfaces/configuration.md +38 -0
  62. package/assets/docs/guide/api/node/interfaces/dominantcolor.md +25 -0
  63. package/assets/docs/guide/api/node/interfaces/dominantcolorsoptions.md +23 -0
  64. package/assets/docs/guide/api/node/interfaces/engineactioninfo.md +24 -0
  65. package/assets/docs/guide/api/node/interfaces/engineactionsregistry.md +18 -0
  66. package/assets/docs/guide/api/node/interfaces/engineplugin.md +30 -0
  67. package/assets/docs/guide/api/node/interfaces/font.md +27 -0
  68. package/assets/docs/guide/api/node/interfaces/fontmetrics.md +32 -0
  69. package/assets/docs/guide/api/node/interfaces/gradientcolorstop.md +28 -0
  70. package/assets/docs/guide/api/node/interfaces/logger.md +39 -0
  71. package/assets/docs/guide/api/node/interfaces/pageduration.md +23 -0
  72. package/assets/docs/guide/api/node/interfaces/range.md +23 -0
  73. package/assets/docs/guide/api/node/interfaces/rgbacolor.md +32 -0
  74. package/assets/docs/guide/api/node/interfaces/rgbcolor.md +30 -0
  75. package/assets/docs/guide/api/node/interfaces/settings.md +126 -0
  76. package/assets/docs/guide/api/node/interfaces/size2.md +21 -0
  77. package/assets/docs/guide/api/node/interfaces/source.md +24 -0
  78. package/assets/docs/guide/api/node/interfaces/spotcolor.md +30 -0
  79. package/assets/docs/guide/api/node/interfaces/textdecorationconfig.md +31 -0
  80. package/assets/docs/guide/api/node/interfaces/textfontsizeoptions.md +24 -0
  81. package/assets/docs/guide/api/node/interfaces/textruninfo.md +33 -0
  82. package/assets/docs/guide/api/node/interfaces/transientresource.md +26 -0
  83. package/assets/docs/guide/api/node/interfaces/typeface.md +23 -0
  84. package/assets/docs/guide/api/node/interfaces/vec2.md +21 -0
  85. package/assets/docs/guide/api/node/interfaces/vec3.md +22 -0
  86. package/assets/docs/guide/api/node/type-aliases/addimageoptions.md +36 -0
  87. package/assets/docs/guide/api/node/type-aliases/animationbaselinedirection.md +18 -0
  88. package/assets/docs/guide/api/node/type-aliases/animationblockswipetextdirection.md +18 -0
  89. package/assets/docs/guide/api/node/type-aliases/animationeasing.md +18 -0
  90. package/assets/docs/guide/api/node/type-aliases/animationentry.md +28 -0
  91. package/assets/docs/guide/api/node/type-aliases/animationgrowdirection.md +18 -0
  92. package/assets/docs/guide/api/node/type-aliases/animationjumploopdirection.md +18 -0
  93. package/assets/docs/guide/api/node/type-aliases/animationkenburnsdirection.md +18 -0
  94. package/assets/docs/guide/api/node/type-aliases/animationmergetextdirection.md +18 -0
  95. package/assets/docs/guide/api/node/type-aliases/animationoptions.md +28 -0
  96. package/assets/docs/guide/api/node/type-aliases/animationspindirection.md +18 -0
  97. package/assets/docs/guide/api/node/type-aliases/animationspinloopdirection.md +18 -0
  98. package/assets/docs/guide/api/node/type-aliases/animationtype.md +24 -0
  99. package/assets/docs/guide/api/node/type-aliases/animationtypelonghand.md +21 -0
  100. package/assets/docs/guide/api/node/type-aliases/animationtypeshorthand.md +18 -0
  101. package/assets/docs/guide/api/node/type-aliases/animationtypewritertextwritingstyle.md +18 -0
  102. package/assets/docs/guide/api/node/type-aliases/animationwipedirection.md +18 -0
  103. package/assets/docs/guide/api/node/type-aliases/applicationmimetype.md +20 -0
  104. package/assets/docs/guide/api/node/type-aliases/assetcolor.md +23 -0
  105. package/assets/docs/guide/api/node/type-aliases/assetfilter.md +47 -0
  106. package/assets/docs/guide/api/node/type-aliases/assetgroups.md +25 -0
  107. package/assets/docs/guide/api/node/type-aliases/assetmetadata.md +42 -0
  108. package/assets/docs/guide/api/node/type-aliases/assetproperty.md +25 -0
  109. package/assets/docs/guide/api/node/type-aliases/assetpropertyfilter.md +41 -0
  110. package/assets/docs/guide/api/node/type-aliases/assetpropertypath.md +26 -0
  111. package/assets/docs/guide/api/node/type-aliases/assetstylepresetanimationproperties.md +34 -0
  112. package/assets/docs/guide/api/node/type-aliases/assetstylepresetproperties.md +29 -0
  113. package/assets/docs/guide/api/node/type-aliases/assetstylepresetpropertyvalue.md +29 -0
  114. package/assets/docs/guide/api/node/type-aliases/assetstylepresetscalableproperty.md +28 -0
  115. package/assets/docs/guide/api/node/type-aliases/assettransformpreset.md +24 -0
  116. package/assets/docs/guide/api/node/type-aliases/asyncuriresolver.md +36 -0
  117. package/assets/docs/guide/api/node/type-aliases/audioexportoptions.md +43 -0
  118. package/assets/docs/guide/api/node/type-aliases/audiofromvideooptions.md +27 -0
  119. package/assets/docs/guide/api/node/type-aliases/audiomimetype.md +20 -0
  120. package/assets/docs/guide/api/node/type-aliases/blendmode.md +18 -0
  121. package/assets/docs/guide/api/node/type-aliases/blockenumtype.md +63 -0
  122. package/assets/docs/guide/api/node/type-aliases/blockstate.md +26 -0
  123. package/assets/docs/guide/api/node/type-aliases/blurtype.md +24 -0
  124. package/assets/docs/guide/api/node/type-aliases/blurtypelonghand.md +21 -0
  125. package/assets/docs/guide/api/node/type-aliases/blurtypeshorthand.md +18 -0
  126. package/assets/docs/guide/api/node/type-aliases/booleanoperation.md +27 -0
  127. package/assets/docs/guide/api/node/type-aliases/boolpropertyname.md +79 -0
  128. package/assets/docs/guide/api/node/type-aliases/cameraclampingovershootmode.md +18 -0
  129. package/assets/docs/guide/api/node/type-aliases/captionhorizontalalignment.md +18 -0
  130. package/assets/docs/guide/api/node/type-aliases/captionverticalalignment.md +18 -0
  131. package/assets/docs/guide/api/node/type-aliases/cmyk.md +23 -0
  132. package/assets/docs/guide/api/node/type-aliases/color.md +23 -0
  133. package/assets/docs/guide/api/node/type-aliases/colorpickercolormode.md +18 -0
  134. package/assets/docs/guide/api/node/type-aliases/colorpropertyname.md +31 -0
  135. package/assets/docs/guide/api/node/type-aliases/colorspace.md +20 -0
  136. package/assets/docs/guide/api/node/type-aliases/contentfillmode.md +18 -0
  137. package/assets/docs/guide/api/node/type-aliases/controlgizmomovehandlevisibility.md +18 -0
  138. package/assets/docs/guide/api/node/type-aliases/controlgizmoresizehandlesvisibility.md +18 -0
  139. package/assets/docs/guide/api/node/type-aliases/controlgizmorotatehandlesvisibility.md +18 -0
  140. package/assets/docs/guide/api/node/type-aliases/controlgizmoscalehandlesvisibility.md +18 -0
  141. package/assets/docs/guide/api/node/type-aliases/createsceneoptions.md +30 -0
  142. package/assets/docs/guide/api/node/type-aliases/cutoutoperation.md +20 -0
  143. package/assets/docs/guide/api/node/type-aliases/cutouttype.md +18 -0
  144. package/assets/docs/guide/api/node/type-aliases/defaultassetsourceid.md +37 -0
  145. package/assets/docs/guide/api/node/type-aliases/demoassetsourceid.md +33 -0
  146. package/assets/docs/guide/api/node/type-aliases/designblockid.md +20 -0
  147. package/assets/docs/guide/api/node/type-aliases/designblocktype.md +24 -0
  148. package/assets/docs/guide/api/node/type-aliases/designblocktypelonghand.md +21 -0
  149. package/assets/docs/guide/api/node/type-aliases/designblocktypeshorthand.md +18 -0
  150. package/assets/docs/guide/api/node/type-aliases/designunit.md +18 -0
  151. package/assets/docs/guide/api/node/type-aliases/doubleclickselectionmode.md +18 -0
  152. package/assets/docs/guide/api/node/type-aliases/doublepropertyname.md +26 -0
  153. package/assets/docs/guide/api/node/type-aliases/dropshadowoptions.md +32 -0
  154. package/assets/docs/guide/api/node/type-aliases/editmode.md +27 -0
  155. package/assets/docs/guide/api/node/type-aliases/effecttype.md +24 -0
  156. package/assets/docs/guide/api/node/type-aliases/effecttypelonghand.md +21 -0
  157. package/assets/docs/guide/api/node/type-aliases/effecttypeshorthand.md +18 -0
  158. package/assets/docs/guide/api/node/type-aliases/engineactionid.md +20 -0
  159. package/assets/docs/guide/api/node/type-aliases/enginecustomactionfunction.md +30 -0
  160. package/assets/docs/guide/api/node/type-aliases/engineplugincontext.md +30 -0
  161. package/assets/docs/guide/api/node/type-aliases/enumpropertyname.md +59 -0
  162. package/assets/docs/guide/api/node/type-aliases/enumvalues.md +59 -0
  163. package/assets/docs/guide/api/node/type-aliases/exportoptions.md +57 -0
  164. package/assets/docs/guide/api/node/type-aliases/fillpixelstreamorientation.md +18 -0
  165. package/assets/docs/guide/api/node/type-aliases/filltype.md +24 -0
  166. package/assets/docs/guide/api/node/type-aliases/filltypelonghand.md +21 -0
  167. package/assets/docs/guide/api/node/type-aliases/filltypeshorthand.md +18 -0
  168. package/assets/docs/guide/api/node/type-aliases/floatpropertyname.md +184 -0
  169. package/assets/docs/guide/api/node/type-aliases/fontsizeunit.md +23 -0
  170. package/assets/docs/guide/api/node/type-aliases/fontstyle.md +20 -0
  171. package/assets/docs/guide/api/node/type-aliases/fontweight.md +30 -0
  172. package/assets/docs/guide/api/node/type-aliases/gradientstoprgba.md +23 -0
  173. package/assets/docs/guide/api/node/type-aliases/heightmode.md +18 -0
  174. package/assets/docs/guide/api/node/type-aliases/hexcolorstring.md +20 -0
  175. package/assets/docs/guide/api/node/type-aliases/historyid.md +20 -0
  176. package/assets/docs/guide/api/node/type-aliases/historyupdate.md +25 -0
  177. package/assets/docs/guide/api/node/type-aliases/horizontalblockalignment.md +18 -0
  178. package/assets/docs/guide/api/node/type-aliases/horizontalcontentfillalignment.md +18 -0
  179. package/assets/docs/guide/api/node/type-aliases/horizontaltextalignment.md +18 -0
  180. package/assets/docs/guide/api/node/type-aliases/imagemimetype.md +25 -0
  181. package/assets/docs/guide/api/node/type-aliases/intpropertyname.md +26 -0
  182. package/assets/docs/guide/api/node/type-aliases/liststyle.md +20 -0
  183. package/assets/docs/guide/api/node/type-aliases/locale.md +20 -0
  184. package/assets/docs/guide/api/node/type-aliases/loglevel.md +24 -0
  185. package/assets/docs/guide/api/node/type-aliases/mimetype.md +20 -0
  186. package/assets/docs/guide/api/node/type-aliases/objecttype.md +24 -0
  187. package/assets/docs/guide/api/node/type-aliases/objecttypelonghand.md +27 -0
  188. package/assets/docs/guide/api/node/type-aliases/objecttypeshorthand.md +27 -0
  189. package/assets/docs/guide/api/node/type-aliases/optionalprefix.md +24 -0
  190. package/assets/docs/guide/api/node/type-aliases/pageguidessource.md +18 -0
  191. package/assets/docs/guide/api/node/type-aliases/palettecolor.md +24 -0
  192. package/assets/docs/guide/api/node/type-aliases/positionmode.md +20 -0
  193. package/assets/docs/guide/api/node/type-aliases/positionxmode.md +18 -0
  194. package/assets/docs/guide/api/node/type-aliases/positionymode.md +18 -0
  195. package/assets/docs/guide/api/node/type-aliases/propertytype.md +31 -0
  196. package/assets/docs/guide/api/node/type-aliases/rgba.md +23 -0
  197. package/assets/docs/guide/api/node/type-aliases/rolestring.md +23 -0
  198. package/assets/docs/guide/api/node/type-aliases/scenefontsizeunit.md +18 -0
  199. package/assets/docs/guide/api/node/type-aliases/scenelayout.md +18 -0
  200. package/assets/docs/guide/api/node/type-aliases/scenemode.md +18 -0
  201. package/assets/docs/guide/api/node/type-aliases/scope.md +50 -0
  202. package/assets/docs/guide/api/node/type-aliases/settingboolpropertyname.md +62 -0
  203. package/assets/docs/guide/api/node/type-aliases/settingcolorpropertyname.md +38 -0
  204. package/assets/docs/guide/api/node/type-aliases/settingenumpropertyname.md +29 -0
  205. package/assets/docs/guide/api/node/type-aliases/settingenumtype.md +33 -0
  206. package/assets/docs/guide/api/node/type-aliases/settingenumvalues.md +29 -0
  207. package/assets/docs/guide/api/node/type-aliases/settingfloatpropertyname.md +25 -0
  208. package/assets/docs/guide/api/node/type-aliases/settingintpropertyname.md +18 -0
  209. package/assets/docs/guide/api/node/type-aliases/settingkey.md +20 -0
  210. package/assets/docs/guide/api/node/type-aliases/settingsbool.md +18 -0
  211. package/assets/docs/guide/api/node/type-aliases/settingscolor.md +20 -0
  212. package/assets/docs/guide/api/node/type-aliases/settingscolorrgba.md +24 -0
  213. package/assets/docs/guide/api/node/type-aliases/settingsenum.md +18 -0
  214. package/assets/docs/guide/api/node/type-aliases/settingsfloat.md +18 -0
  215. package/assets/docs/guide/api/node/type-aliases/settingsint.md +18 -0
  216. package/assets/docs/guide/api/node/type-aliases/settingsstring.md +18 -0
  217. package/assets/docs/guide/api/node/type-aliases/settingstringpropertyname.md +28 -0
  218. package/assets/docs/guide/api/node/type-aliases/settingtype.md +20 -0
  219. package/assets/docs/guide/api/node/type-aliases/settingvaluetype.md +26 -0
  220. package/assets/docs/guide/api/node/type-aliases/shapetype.md +24 -0
  221. package/assets/docs/guide/api/node/type-aliases/shapetypelonghand.md +21 -0
  222. package/assets/docs/guide/api/node/type-aliases/shapetypeshorthand.md +18 -0
  223. package/assets/docs/guide/api/node/type-aliases/shapevectorpathfillrule.md +18 -0
  224. package/assets/docs/guide/api/node/type-aliases/sizemode.md +20 -0
  225. package/assets/docs/guide/api/node/type-aliases/sortingorder.md +21 -0
  226. package/assets/docs/guide/api/node/type-aliases/sourcesetpropertyname.md +18 -0
  227. package/assets/docs/guide/api/node/type-aliases/splitoptions.md +28 -0
  228. package/assets/docs/guide/api/node/type-aliases/stringpropertyname.md +43 -0
  229. package/assets/docs/guide/api/node/type-aliases/strokecap.md +18 -0
  230. package/assets/docs/guide/api/node/type-aliases/strokecornergeometry.md +18 -0
  231. package/assets/docs/guide/api/node/type-aliases/strokedashendcap.md +18 -0
  232. package/assets/docs/guide/api/node/type-aliases/strokedashstartcap.md +18 -0
  233. package/assets/docs/guide/api/node/type-aliases/strokeendcap.md +18 -0
  234. package/assets/docs/guide/api/node/type-aliases/strokeposition.md +18 -0
  235. package/assets/docs/guide/api/node/type-aliases/strokestartcap.md +18 -0
  236. package/assets/docs/guide/api/node/type-aliases/strokestyle.md +18 -0
  237. package/assets/docs/guide/api/node/type-aliases/syncuriresolver.md +31 -0
  238. package/assets/docs/guide/api/node/type-aliases/textanimationwritingstyle.md +18 -0
  239. package/assets/docs/guide/api/node/type-aliases/textcase.md +20 -0
  240. package/assets/docs/guide/api/node/type-aliases/textdecorationline.md +27 -0
  241. package/assets/docs/guide/api/node/type-aliases/textdecorationstyle.md +26 -0
  242. package/assets/docs/guide/api/node/type-aliases/textverticalalignment.md +18 -0
  243. package/assets/docs/guide/api/node/type-aliases/timelinetrackvisibility.md +18 -0
  244. package/assets/docs/guide/api/node/type-aliases/touchpinchaction.md +18 -0
  245. package/assets/docs/guide/api/node/type-aliases/touchrotateaction.md +18 -0
  246. package/assets/docs/guide/api/node/type-aliases/typefacedefinition.md +41 -0
  247. package/assets/docs/guide/api/node/type-aliases/verticalblockalignment.md +18 -0
  248. package/assets/docs/guide/api/node/type-aliases/verticalcontentfillalignment.md +18 -0
  249. package/assets/docs/guide/api/node/type-aliases/videoexportoptions.md +54 -0
  250. package/assets/docs/guide/api/node/type-aliases/videomimetype.md +20 -0
  251. package/assets/docs/guide/api/node/type-aliases/widthmode.md +18 -0
  252. package/assets/docs/guide/api/node/type-aliases/xywh.md +23 -0
  253. package/assets/docs/guide/api/node/type-aliases/zoomautofitaxis.md +20 -0
  254. package/assets/docs/guide/api/node/type-aliases/zoomoptions.md +27 -0
  255. package/assets/docs/guide/api/node/variables/animation_types.md +21 -0
  256. package/assets/docs/guide/api/node/variables/animationbaselinedirectionvalues.md +18 -0
  257. package/assets/docs/guide/api/node/variables/animationblockswipetextdirectionvalues.md +18 -0
  258. package/assets/docs/guide/api/node/variables/animationeasingvalues.md +18 -0
  259. package/assets/docs/guide/api/node/variables/animationgrowdirectionvalues.md +18 -0
  260. package/assets/docs/guide/api/node/variables/animationjumploopdirectionvalues.md +18 -0
  261. package/assets/docs/guide/api/node/variables/animationkenburnsdirectionvalues.md +18 -0
  262. package/assets/docs/guide/api/node/variables/animationmergetextdirectionvalues.md +18 -0
  263. package/assets/docs/guide/api/node/variables/animationspindirectionvalues.md +18 -0
  264. package/assets/docs/guide/api/node/variables/animationspinloopdirectionvalues.md +18 -0
  265. package/assets/docs/guide/api/node/variables/animationtypewritertextwritingstylevalues.md +18 -0
  266. package/assets/docs/guide/api/node/variables/animationwipedirectionvalues.md +18 -0
  267. package/assets/docs/guide/api/node/variables/blendmodevalues.md +18 -0
  268. package/assets/docs/guide/api/node/variables/blur_types.md +21 -0
  269. package/assets/docs/guide/api/node/variables/cameraclampingovershootmodevalues.md +18 -0
  270. package/assets/docs/guide/api/node/variables/captionhorizontalalignmentvalues.md +18 -0
  271. package/assets/docs/guide/api/node/variables/captionverticalalignmentvalues.md +18 -0
  272. package/assets/docs/guide/api/node/variables/colorpickercolormodevalues.md +18 -0
  273. package/assets/docs/guide/api/node/variables/contentfillmodevalues.md +18 -0
  274. package/assets/docs/guide/api/node/variables/controlgizmomovehandlevisibilityvalues.md +18 -0
  275. package/assets/docs/guide/api/node/variables/controlgizmoresizehandlesvisibilityvalues.md +18 -0
  276. package/assets/docs/guide/api/node/variables/controlgizmorotatehandlesvisibilityvalues.md +18 -0
  277. package/assets/docs/guide/api/node/variables/controlgizmoscalehandlesvisibilityvalues.md +18 -0
  278. package/assets/docs/guide/api/node/variables/cutouttypevalues.md +18 -0
  279. package/assets/docs/guide/api/node/variables/design_block_types.md +21 -0
  280. package/assets/docs/guide/api/node/variables/doubleclickselectionmodevalues.md +18 -0
  281. package/assets/docs/guide/api/node/variables/effect_types.md +21 -0
  282. package/assets/docs/guide/api/node/variables/fill_types.md +21 -0
  283. package/assets/docs/guide/api/node/variables/fillpixelstreamorientationvalues.md +18 -0
  284. package/assets/docs/guide/api/node/variables/heightmodevalues.md +18 -0
  285. package/assets/docs/guide/api/node/variables/horizontalcontentfillalignmentvalues.md +18 -0
  286. package/assets/docs/guide/api/node/variables/loglevel.md +37 -0
  287. package/assets/docs/guide/api/node/variables/mimetype.md +41 -0
  288. package/assets/docs/guide/api/node/variables/pageguidessourcevalues.md +18 -0
  289. package/assets/docs/guide/api/node/variables/positionxmodevalues.md +18 -0
  290. package/assets/docs/guide/api/node/variables/positionymodevalues.md +18 -0
  291. package/assets/docs/guide/api/node/variables/scenedesignunitvalues.md +18 -0
  292. package/assets/docs/guide/api/node/variables/scenefontsizeunitvalues.md +18 -0
  293. package/assets/docs/guide/api/node/variables/scenelayoutvalues.md +18 -0
  294. package/assets/docs/guide/api/node/variables/scenemodevalues.md +18 -0
  295. package/assets/docs/guide/api/node/variables/shape_types.md +21 -0
  296. package/assets/docs/guide/api/node/variables/shapevectorpathfillrulevalues.md +18 -0
  297. package/assets/docs/guide/api/node/variables/strokecapvalues.md +18 -0
  298. package/assets/docs/guide/api/node/variables/strokecornergeometryvalues.md +18 -0
  299. package/assets/docs/guide/api/node/variables/strokedashendcapvalues.md +18 -0
  300. package/assets/docs/guide/api/node/variables/strokedashstartcapvalues.md +18 -0
  301. package/assets/docs/guide/api/node/variables/strokeendcapvalues.md +18 -0
  302. package/assets/docs/guide/api/node/variables/strokepositionvalues.md +18 -0
  303. package/assets/docs/guide/api/node/variables/strokestartcapvalues.md +18 -0
  304. package/assets/docs/guide/api/node/variables/strokestylevalues.md +18 -0
  305. package/assets/docs/guide/api/node/variables/textanimationwritingstylevalues.md +18 -0
  306. package/assets/docs/guide/api/node/variables/texthorizontalalignmentvalues.md +18 -0
  307. package/assets/docs/guide/api/node/variables/textverticalalignmentvalues.md +18 -0
  308. package/assets/docs/guide/api/node/variables/timelinetrackvisibilityvalues.md +18 -0
  309. package/assets/docs/guide/api/node/variables/touchpinchactionvalues.md +18 -0
  310. package/assets/docs/guide/api/node/variables/touchrotateactionvalues.md +18 -0
  311. package/assets/docs/guide/api/node/variables/verticalcontentfillalignmentvalues.md +18 -0
  312. package/assets/docs/guide/api/node/variables/widthmodevalues.md +18 -0
  313. package/assets/docs/guide/api/types.md +5 -9
  314. package/assets/docs/guide/api-reference/overview.md +7 -7
  315. package/assets/docs/guide/automation/auto-resize.md +263 -300
  316. package/assets/docs/guide/automation/data-merge.md +246 -275
  317. package/assets/docs/guide/automation/design-generation.md +102 -31
  318. package/assets/docs/guide/automation/multi-image-generation.md +758 -0
  319. package/assets/docs/guide/automation/overview.md +21 -4
  320. package/assets/docs/guide/automation.md +10 -5
  321. package/assets/docs/guide/capabilities.md +6 -4
  322. package/assets/docs/guide/colors/adjust.md +247 -249
  323. package/assets/docs/guide/colors/apply.md +127 -138
  324. package/assets/docs/guide/colors/basics.md +126 -150
  325. package/assets/docs/guide/colors/conversion.md +171 -177
  326. package/assets/docs/guide/colors/create-color-palette.md +244 -245
  327. package/assets/docs/guide/colors/extract-colors.md +144 -0
  328. package/assets/docs/guide/colors/for-print/cmyk.md +292 -352
  329. package/assets/docs/guide/colors/for-print/spot.md +521 -578
  330. package/assets/docs/guide/colors/for-print.md +9 -4
  331. package/assets/docs/guide/colors/for-screen/p3.md +12 -10
  332. package/assets/docs/guide/colors/for-screen/srgb.md +107 -133
  333. package/assets/docs/guide/colors/for-screen.md +9 -4
  334. package/assets/docs/guide/colors/overview.md +6 -4
  335. package/assets/docs/guide/colors/replace.md +381 -419
  336. package/assets/docs/guide/colors.md +9 -4
  337. package/assets/docs/guide/compatibility.md +7 -5
  338. package/assets/docs/guide/concepts/architecture.md +17 -15
  339. package/assets/docs/guide/concepts/assets.md +152 -140
  340. package/assets/docs/guide/concepts/blocks.md +227 -323
  341. package/assets/docs/guide/concepts/buffers.md +147 -276
  342. package/assets/docs/guide/concepts/design-units.md +95 -145
  343. package/assets/docs/guide/concepts/editing-workflow.md +69 -183
  344. package/assets/docs/guide/concepts/events.md +80 -122
  345. package/assets/docs/guide/concepts/headless-mode.md +237 -0
  346. package/assets/docs/guide/concepts/pages.md +137 -127
  347. package/assets/docs/guide/concepts/resources.md +156 -217
  348. package/assets/docs/guide/concepts/scenes.md +191 -210
  349. package/assets/docs/guide/concepts/templating.md +118 -74
  350. package/assets/docs/guide/concepts/terminology.md +49 -47
  351. package/assets/docs/guide/concepts/undo-and-history.md +229 -303
  352. package/assets/docs/guide/concepts.md +9 -7
  353. package/assets/docs/guide/configuration.md +252 -380
  354. package/assets/docs/guide/conversion/overview.md +33 -4
  355. package/assets/docs/guide/conversion/to-base64.md +127 -167
  356. package/assets/docs/guide/conversion/to-pdf.md +24 -474
  357. package/assets/docs/guide/conversion/to-png.md +168 -211
  358. package/assets/docs/guide/conversion.md +9 -4
  359. package/assets/docs/guide/create-audio/audio/add-music.md +301 -327
  360. package/assets/docs/guide/create-audio/audio/add-sound-effects.md +475 -359
  361. package/assets/docs/guide/create-audio/audio/loop.md +232 -272
  362. package/assets/docs/guide/create-composition/add-background.md +237 -239
  363. package/assets/docs/guide/create-composition/blend-modes.md +118 -209
  364. package/assets/docs/guide/create-composition/collage.md +538 -320
  365. package/assets/docs/guide/create-composition/group-and-ungroup.md +216 -261
  366. package/assets/docs/guide/create-composition/layer-management.md +219 -257
  367. package/assets/docs/guide/create-composition/layout.md +513 -315
  368. package/assets/docs/guide/create-composition/lock-design.md +90 -109
  369. package/assets/docs/guide/create-composition/multi-page.md +133 -113
  370. package/assets/docs/guide/create-composition/overview.md +16 -4
  371. package/assets/docs/guide/create-composition/programmatic.md +288 -344
  372. package/assets/docs/guide/create-composition.md +10 -5
  373. package/assets/docs/guide/create-templates/add-dynamic-content/placeholders.md +443 -569
  374. package/assets/docs/guide/create-templates/add-dynamic-content/set-editing-constraints.md +567 -470
  375. package/assets/docs/guide/create-templates/add-dynamic-content/text-variables.md +179 -516
  376. package/assets/docs/guide/create-templates/add-dynamic-content.md +226 -224
  377. package/assets/docs/guide/create-templates/add-to-template-library.md +183 -193
  378. package/assets/docs/guide/create-templates/edit-or-remove.md +297 -303
  379. package/assets/docs/guide/create-templates/from-scratch.md +207 -268
  380. package/assets/docs/guide/create-templates/import/from-scene-file.md +158 -236
  381. package/assets/docs/guide/create-templates/import.md +145 -161
  382. package/assets/docs/guide/create-templates/lock.md +42 -295
  383. package/assets/docs/guide/create-templates/overview.md +33 -4
  384. package/assets/docs/guide/create-templates.md +9 -5
  385. package/assets/docs/guide/create-video/audio/adjust-speed.md +157 -207
  386. package/assets/docs/guide/create-video/audio/adjust-volume.md +116 -227
  387. package/assets/docs/guide/create-video/control.md +352 -193
  388. package/assets/docs/guide/create-video/limitations.md +175 -280
  389. package/assets/docs/guide/create-video.md +11 -10
  390. package/assets/docs/guide/edit-image/add-watermark.md +283 -330
  391. package/assets/docs/guide/edit-image/overview.md +29 -4
  392. package/assets/docs/guide/edit-image/remove-bg.md +283 -337
  393. package/assets/docs/guide/edit-image/replace-colors.md +424 -502
  394. package/assets/docs/guide/edit-image/transform/crop.md +463 -402
  395. package/assets/docs/guide/edit-image/transform/flip.md +353 -0
  396. package/assets/docs/guide/edit-image/transform/move.md +143 -100
  397. package/assets/docs/guide/edit-image/transform/resize.md +118 -88
  398. package/assets/docs/guide/edit-image/transform/rotate.md +132 -165
  399. package/assets/docs/guide/edit-image/transform/scale.md +230 -228
  400. package/assets/docs/guide/edit-image/transform.md +10 -5
  401. package/assets/docs/guide/edit-image.md +11 -7
  402. package/assets/docs/guide/edit-video/add-captions.md +344 -421
  403. package/assets/docs/guide/edit-video/add-watermark.md +312 -258
  404. package/assets/docs/guide/edit-video/join-and-arrange.md +237 -371
  405. package/assets/docs/guide/edit-video/redaction.md +419 -385
  406. package/assets/docs/guide/edit-video/split.md +243 -493
  407. package/assets/docs/guide/edit-video/transform/crop.md +21 -352
  408. package/assets/docs/guide/edit-video/transform/flip.md +102 -76
  409. package/assets/docs/guide/edit-video/transform/move.md +258 -310
  410. package/assets/docs/guide/edit-video/transform/resize.md +264 -428
  411. package/assets/docs/guide/edit-video/transform/rotate.md +265 -228
  412. package/assets/docs/guide/edit-video/transform/scale.md +320 -417
  413. package/assets/docs/guide/edit-video/transform.md +10 -6
  414. package/assets/docs/guide/edit-video/trim.md +448 -494
  415. package/assets/docs/guide/engine-interface.md +51 -62
  416. package/assets/docs/guide/export-save-publish/create-thumbnail.md +148 -184
  417. package/assets/docs/guide/export-save-publish/export/compress.md +161 -559
  418. package/assets/docs/guide/export-save-publish/export/overview.md +224 -373
  419. package/assets/docs/guide/export-save-publish/export/partial-export.md +386 -577
  420. package/assets/docs/guide/export-save-publish/export/size-limits.md +215 -310
  421. package/assets/docs/guide/export-save-publish/export/to-jpeg.md +132 -213
  422. package/assets/docs/guide/export-save-publish/export/to-pdf.md +139 -267
  423. package/assets/docs/guide/export-save-publish/export/to-png.md +121 -165
  424. package/assets/docs/guide/export-save-publish/export/to-raw-data.md +187 -234
  425. package/assets/docs/guide/export-save-publish/export/to-webp.md +160 -190
  426. package/assets/docs/guide/export-save-publish/export/with-color-mask.md +359 -203
  427. package/assets/docs/guide/export-save-publish/export.md +14 -11
  428. package/assets/docs/guide/export-save-publish/for-printing.md +141 -237
  429. package/assets/docs/guide/export-save-publish/for-social-media.md +124 -261
  430. package/assets/docs/guide/export-save-publish/pre-export-validation.md +436 -522
  431. package/assets/docs/guide/export-save-publish/save.md +167 -226
  432. package/assets/docs/guide/export-save-publish/store-custom-metadata.md +97 -162
  433. package/assets/docs/guide/file-format-support.md +9 -9
  434. package/assets/docs/guide/fills/color.md +370 -347
  435. package/assets/docs/guide/fills/image.md +167 -196
  436. package/assets/docs/guide/fills/overview.md +6 -4
  437. package/assets/docs/guide/fills/video.md +286 -438
  438. package/assets/docs/guide/fills.md +12 -8
  439. package/assets/docs/guide/filters-and-effects/apply.md +598 -664
  440. package/assets/docs/guide/filters-and-effects/blur.md +261 -159
  441. package/assets/docs/guide/filters-and-effects/chroma-key-green-screen.md +194 -293
  442. package/assets/docs/guide/filters-and-effects/create-custom-filters.md +548 -466
  443. package/assets/docs/guide/filters-and-effects/create-custom-lut-filter.md +176 -244
  444. package/assets/docs/guide/filters-and-effects/distortion.md +317 -384
  445. package/assets/docs/guide/filters-and-effects/duotone.md +221 -217
  446. package/assets/docs/guide/filters-and-effects/gradients.md +670 -813
  447. package/assets/docs/guide/filters-and-effects/overview.md +7 -7
  448. package/assets/docs/guide/filters-and-effects/support.md +97 -132
  449. package/assets/docs/guide/filters-and-effects.md +11 -6
  450. package/assets/docs/guide/get-started/agent-skills.md +20 -18
  451. package/assets/docs/guide/get-started/build-with-ai.md +7 -4
  452. package/assets/docs/guide/get-started/bun.md +219 -0
  453. package/assets/docs/guide/get-started/deno.md +161 -0
  454. package/assets/docs/guide/get-started/mcp-server.md +6 -4
  455. package/assets/docs/guide/get-started/overview.md +11 -6
  456. package/assets/docs/guide/get-started/vanilla-aws-lambda.md +506 -0
  457. package/assets/docs/guide/get-started/vanilla-clone-github-project.md +124 -0
  458. package/assets/docs/guide/get-started/vanilla.md +235 -0
  459. package/assets/docs/guide/guides/export-save-publish/export/audio.md +80 -66
  460. package/assets/docs/guide/guides.md +10 -9
  461. package/assets/docs/guide/import-media/asset-panel/refresh-assets.md +259 -288
  462. package/assets/docs/guide/import-media/concepts.md +20 -38
  463. package/assets/docs/guide/import-media/content-json-schema.md +145 -125
  464. package/assets/docs/guide/import-media/default-assets.md +113 -161
  465. package/assets/docs/guide/import-media/edit-or-remove-assets.md +391 -395
  466. package/assets/docs/guide/import-media/file-format-support.md +78 -61
  467. package/assets/docs/guide/import-media/from-remote-source/asset-versioning.md +273 -244
  468. package/assets/docs/guide/import-media/from-remote-source/remote-asset.md +152 -222
  469. package/assets/docs/guide/import-media/from-remote-source.md +9 -11
  470. package/assets/docs/guide/import-media/overview.md +5 -5
  471. package/assets/docs/guide/import-media/retrieve-mimetype.md +216 -108
  472. package/assets/docs/guide/import-media/size-limits.md +6 -4
  473. package/assets/docs/guide/import-media/source-sets.md +190 -251
  474. package/assets/docs/guide/import-media.md +10 -8
  475. package/assets/docs/guide/insert-media/audio.md +202 -195
  476. package/assets/docs/guide/insert-media/images.md +190 -188
  477. package/assets/docs/guide/insert-media/position-and-align.md +284 -551
  478. package/assets/docs/guide/insert-media/shapes-or-stickers.md +402 -418
  479. package/assets/docs/guide/insert-media/videos.md +236 -203
  480. package/assets/docs/guide/insert-media.md +10 -5
  481. package/assets/docs/guide/key-capabilities.md +36 -4
  482. package/assets/docs/guide/key-concepts.md +6 -4
  483. package/assets/docs/guide/licensing.md +6 -4
  484. package/assets/docs/guide/llms-txt.md +11 -7
  485. package/assets/docs/guide/open-the-editor/blank-canvas.md +102 -63
  486. package/assets/docs/guide/open-the-editor/from-image.md +157 -127
  487. package/assets/docs/guide/open-the-editor/from-template.md +131 -92
  488. package/assets/docs/guide/open-the-editor/from-video.md +204 -212
  489. package/assets/docs/guide/open-the-editor/import-design/from-archive.md +310 -360
  490. package/assets/docs/guide/open-the-editor/import-design/from-indesign.md +716 -513
  491. package/assets/docs/guide/open-the-editor/import-design/from-photoshop.md +667 -695
  492. package/assets/docs/guide/open-the-editor/import-design.md +228 -266
  493. package/assets/docs/guide/open-the-editor/load-scene.md +72 -68
  494. package/assets/docs/guide/open-the-editor/overview.md +6 -4
  495. package/assets/docs/guide/open-the-editor/uri-resolver.md +160 -251
  496. package/assets/docs/guide/open-the-editor.md +11 -9
  497. package/assets/docs/guide/outlines/overview.md +12 -4
  498. package/assets/docs/guide/outlines/shadows-and-glows.md +105 -410
  499. package/assets/docs/guide/outlines/strokes.md +218 -166
  500. package/assets/docs/guide/outlines.md +9 -4
  501. package/assets/docs/guide/overview.md +14 -6
  502. package/assets/docs/guide/performance.md +220 -113
  503. package/assets/docs/guide/plugins/print-ready-pdf.md +273 -368
  504. package/assets/docs/guide/plugins.md +10 -16
  505. package/assets/docs/guide/rules/asset-handling.md +7 -18
  506. package/assets/docs/guide/rules/common-pitfalls.md +25 -42
  507. package/assets/docs/guide/rules/content-fill-mode.md +4 -4
  508. package/assets/docs/guide/rules/enforce-brand-guidelines.md +398 -567
  509. package/assets/docs/guide/rules/lock-content.md +188 -231
  510. package/assets/docs/guide/rules/moderate-content.md +580 -571
  511. package/assets/docs/guide/rules/overview.md +345 -380
  512. package/assets/docs/guide/rules/silent-init-errors.md +4 -1
  513. package/assets/docs/guide/rules/verify-properties-before-use.md +2 -11
  514. package/assets/docs/guide/rules.md +10 -5
  515. package/assets/docs/guide/security.md +7 -5
  516. package/assets/docs/guide/serve-assets.md +57 -284
  517. package/assets/docs/guide/settings.md +96 -74
  518. package/assets/docs/guide/shapes.md +10 -5
  519. package/assets/docs/guide/stickers-and-shapes/combine.md +397 -583
  520. package/assets/docs/guide/stickers-and-shapes/create-cutout.md +181 -268
  521. package/assets/docs/guide/stickers-and-shapes/create-edit/create-shapes.md +418 -431
  522. package/assets/docs/guide/stickers-and-shapes/create-edit/create-stickers.md +147 -226
  523. package/assets/docs/guide/stickers-and-shapes/create-edit/edit-shapes.md +138 -123
  524. package/assets/docs/guide/stickers-and-shapes/insert-qr-code.md +151 -149
  525. package/assets/docs/guide/stickers.md +9 -4
  526. package/assets/docs/guide/text/add.md +470 -482
  527. package/assets/docs/guide/text/adjust-spacing.md +179 -214
  528. package/assets/docs/guide/text/auto-size.md +210 -271
  529. package/assets/docs/guide/text/edit.md +294 -309
  530. package/assets/docs/guide/text/effects.md +154 -190
  531. package/assets/docs/guide/text/emojis.md +199 -232
  532. package/assets/docs/guide/text/language-support.md +369 -382
  533. package/assets/docs/guide/text/overview.md +41 -4
  534. package/assets/docs/guide/text/styling.md +239 -273
  535. package/assets/docs/guide/text/text-designs.md +405 -544
  536. package/assets/docs/guide/text.md +10 -9
  537. package/assets/docs/guide/to-v1-19.md +12 -10
  538. package/assets/docs/guide/upgrade.md +8 -9
  539. package/assets/docs/guide/use-templates/apply-template.md +174 -163
  540. package/assets/docs/guide/use-templates/generate.md +171 -152
  541. package/assets/docs/guide/use-templates/overview.md +32 -4
  542. package/assets/docs/guide/use-templates/programmatic.md +266 -301
  543. package/assets/docs/guide/use-templates/replace-content.md +181 -171
  544. package/assets/docs/guide/what-is-cesdk.md +71 -282
  545. package/assets/docs/handbook/SKILL.md +24 -0
  546. package/dist/assets/inline.generated.d.ts.map +1 -1
  547. package/dist/assets/inline.generated.js +544 -406
  548. package/dist/assets/inline.generated.js.map +1 -1
  549. package/dist/assets/load-browser.d.ts +1 -1
  550. package/dist/assets/load-browser.js +1 -1
  551. package/dist/assets/load-browser.js.map +1 -1
  552. package/dist/assets/load-node.d.ts +1 -1
  553. package/dist/assets/load-node.js +1 -1
  554. package/dist/assets/load-node.js.map +1 -1
  555. package/dist/cli/http.d.ts.map +1 -1
  556. package/dist/cli/http.js +4 -28
  557. package/dist/cli/http.js.map +1 -1
  558. package/dist/cli/redirect-console.d.ts +1 -1
  559. package/dist/cli/redirect-console.d.ts.map +1 -1
  560. package/dist/cli/redirect-console.js +12 -3
  561. package/dist/cli/redirect-console.js.map +1 -1
  562. package/dist/cli/resolve-license.d.ts.map +1 -1
  563. package/dist/cli/resolve-license.js +8 -6
  564. package/dist/cli/resolve-license.js.map +1 -1
  565. package/dist/cli/stdio.d.ts +9 -0
  566. package/dist/cli/stdio.d.ts.map +1 -1
  567. package/dist/cli/stdio.js +48 -4
  568. package/dist/cli/stdio.js.map +1 -1
  569. package/dist/cli.js +10 -1
  570. package/dist/cli.js.map +1 -1
  571. package/dist/config.d.ts +11 -2
  572. package/dist/config.d.ts.map +1 -1
  573. package/dist/config.js +20 -1
  574. package/dist/config.js.map +1 -1
  575. package/dist/diagnostics/bundle.d.ts +10 -0
  576. package/dist/diagnostics/bundle.d.ts.map +1 -0
  577. package/dist/diagnostics/bundle.js +148 -0
  578. package/dist/diagnostics/bundle.js.map +1 -0
  579. package/dist/diagnostics/compose.d.ts +3 -0
  580. package/dist/diagnostics/compose.d.ts.map +1 -0
  581. package/dist/diagnostics/compose.js +15 -0
  582. package/dist/diagnostics/compose.js.map +1 -0
  583. package/dist/diagnostics/events.d.ts +34 -0
  584. package/dist/diagnostics/events.d.ts.map +1 -0
  585. package/dist/diagnostics/events.js +3 -0
  586. package/dist/diagnostics/events.js.map +1 -0
  587. package/dist/diagnostics/file-sink.d.ts +38 -0
  588. package/dist/diagnostics/file-sink.d.ts.map +1 -0
  589. package/dist/diagnostics/file-sink.js +157 -0
  590. package/dist/diagnostics/file-sink.js.map +1 -0
  591. package/dist/diagnostics/redact.d.ts +7 -0
  592. package/dist/diagnostics/redact.d.ts.map +1 -0
  593. package/dist/diagnostics/redact.js +43 -0
  594. package/dist/diagnostics/redact.js.map +1 -0
  595. package/dist/diagnostics/tool-call-adapter.d.ts +4 -0
  596. package/dist/diagnostics/tool-call-adapter.d.ts.map +1 -0
  597. package/dist/diagnostics/tool-call-adapter.js +21 -0
  598. package/dist/diagnostics/tool-call-adapter.js.map +1 -0
  599. package/dist/engine/cesdk-adapter.d.ts +5 -1
  600. package/dist/engine/cesdk-adapter.d.ts.map +1 -1
  601. package/dist/engine/cesdk-adapter.js +9 -2
  602. package/dist/engine/cesdk-adapter.js.map +1 -1
  603. package/dist/engine/index.d.ts +1 -0
  604. package/dist/engine/index.d.ts.map +1 -1
  605. package/dist/engine/index.js +4 -0
  606. package/dist/engine/index.js.map +1 -1
  607. package/dist/engine/scene-resource-schemes.d.ts +2 -0
  608. package/dist/engine/scene-resource-schemes.d.ts.map +1 -0
  609. package/dist/engine/scene-resource-schemes.js +20 -0
  610. package/dist/engine/scene-resource-schemes.js.map +1 -0
  611. package/dist/http/server.d.ts +0 -6
  612. package/dist/http/server.d.ts.map +1 -1
  613. package/dist/http/server.js +1 -2
  614. package/dist/http/server.js.map +1 -1
  615. package/dist/server.d.ts +0 -4
  616. package/dist/server.d.ts.map +1 -1
  617. package/dist/server.js +4 -60
  618. package/dist/server.js.map +1 -1
  619. package/dist/test/scripts/changelog-add.d.ts +8 -0
  620. package/dist/test/scripts/changelog-add.d.ts.map +1 -0
  621. package/dist/test/scripts/changelog-add.js +50 -0
  622. package/dist/test/scripts/changelog-add.js.map +1 -0
  623. package/dist/test/scripts/changelog-collate.d.ts +38 -0
  624. package/dist/test/scripts/changelog-collate.d.ts.map +1 -0
  625. package/dist/test/scripts/changelog-collate.js +171 -0
  626. package/dist/test/scripts/changelog-collate.js.map +1 -0
  627. package/dist/test/test/changelog.test.d.ts +2 -0
  628. package/dist/test/test/changelog.test.d.ts.map +1 -0
  629. package/dist/test/test/changelog.test.js +293 -0
  630. package/dist/test/test/changelog.test.js.map +1 -0
  631. package/dist/test/test/cli/dispatcher.test.js +10 -3
  632. package/dist/test/test/cli/dispatcher.test.js.map +1 -1
  633. package/dist/test/test/cli/redirect-console.test.js +31 -0
  634. package/dist/test/test/cli/redirect-console.test.js.map +1 -1
  635. package/dist/test/test/cli/resolve-license.test.js +10 -1
  636. package/dist/test/test/cli/resolve-license.test.js.map +1 -1
  637. package/dist/test/test/cli/stdio-diagnostics.test.d.ts +2 -0
  638. package/dist/test/test/cli/stdio-diagnostics.test.d.ts.map +1 -0
  639. package/dist/test/test/cli/stdio-diagnostics.test.js +31 -0
  640. package/dist/test/test/cli/stdio-diagnostics.test.js.map +1 -0
  641. package/dist/test/test/config.test.js +17 -13
  642. package/dist/test/test/config.test.js.map +1 -1
  643. package/dist/test/test/diagnostics/bundle.test.d.ts +2 -0
  644. package/dist/test/test/diagnostics/bundle.test.d.ts.map +1 -0
  645. package/dist/test/test/diagnostics/bundle.test.js +53 -0
  646. package/dist/test/test/diagnostics/bundle.test.js.map +1 -0
  647. package/dist/test/test/diagnostics/compose.test.d.ts +2 -0
  648. package/dist/test/test/diagnostics/compose.test.d.ts.map +1 -0
  649. package/dist/test/test/diagnostics/compose.test.js +31 -0
  650. package/dist/test/test/diagnostics/compose.test.js.map +1 -0
  651. package/dist/test/test/diagnostics/file-sink.test.d.ts +2 -0
  652. package/dist/test/test/diagnostics/file-sink.test.d.ts.map +1 -0
  653. package/dist/test/test/diagnostics/file-sink.test.js +113 -0
  654. package/dist/test/test/diagnostics/file-sink.test.js.map +1 -0
  655. package/dist/test/test/diagnostics/redact.test.d.ts +2 -0
  656. package/dist/test/test/diagnostics/redact.test.d.ts.map +1 -0
  657. package/dist/test/test/diagnostics/redact.test.js +59 -0
  658. package/dist/test/test/diagnostics/redact.test.js.map +1 -0
  659. package/dist/test/test/diagnostics/tool-call-adapter.test.d.ts +2 -0
  660. package/dist/test/test/diagnostics/tool-call-adapter.test.d.ts.map +1 -0
  661. package/dist/test/test/diagnostics/tool-call-adapter.test.js +34 -0
  662. package/dist/test/test/diagnostics/tool-call-adapter.test.js.map +1 -0
  663. package/dist/test/test/engine/cesdk-adapter.test.d.ts +2 -0
  664. package/dist/test/test/engine/cesdk-adapter.test.d.ts.map +1 -0
  665. package/dist/test/test/engine/cesdk-adapter.test.js +32 -0
  666. package/dist/test/test/engine/cesdk-adapter.test.js.map +1 -0
  667. package/dist/test/test/handbook-contract.test.js +6 -2
  668. package/dist/test/test/handbook-contract.test.js.map +1 -1
  669. package/dist/test/test/http/server.test.js +0 -36
  670. package/dist/test/test/http/server.test.js.map +1 -1
  671. package/dist/test/test/http/workspace-auth.test.js +0 -1
  672. package/dist/test/test/http/workspace-auth.test.js.map +1 -1
  673. package/dist/test/test/server.test.js +0 -40
  674. package/dist/test/test/server.test.js.map +1 -1
  675. package/dist/test/test/tools/edit-harness.d.ts +14 -0
  676. package/dist/test/test/tools/edit-harness.d.ts.map +1 -0
  677. package/dist/test/test/tools/edit-harness.js +30 -0
  678. package/dist/test/test/tools/edit-harness.js.map +1 -0
  679. package/dist/test/test/tools/edit.telemetry.test.d.ts +2 -0
  680. package/dist/test/test/tools/edit.telemetry.test.d.ts.map +1 -0
  681. package/dist/test/test/tools/edit.telemetry.test.js +46 -0
  682. package/dist/test/test/tools/edit.telemetry.test.js.map +1 -0
  683. package/dist/test/test/tools/export-harness.d.ts +13 -0
  684. package/dist/test/test/tools/export-harness.d.ts.map +1 -0
  685. package/dist/test/test/tools/export-harness.js +27 -0
  686. package/dist/test/test/tools/export-harness.js.map +1 -0
  687. package/dist/test/test/tools/export.telemetry.test.d.ts +2 -0
  688. package/dist/test/test/tools/export.telemetry.test.d.ts.map +1 -0
  689. package/dist/test/test/tools/export.telemetry.test.js +65 -0
  690. package/dist/test/test/tools/export.telemetry.test.js.map +1 -0
  691. package/dist/test/test/tools/import.test.d.ts +2 -0
  692. package/dist/test/test/tools/import.test.d.ts.map +1 -0
  693. package/dist/test/test/tools/import.test.js +122 -0
  694. package/dist/test/test/tools/import.test.js.map +1 -0
  695. package/dist/test/test/tools/index.test.js +78 -16
  696. package/dist/test/test/tools/index.test.js.map +1 -1
  697. package/dist/test/test/tools/load.integration.test.d.ts +2 -0
  698. package/dist/test/test/tools/load.integration.test.d.ts.map +1 -0
  699. package/dist/test/test/tools/load.integration.test.js +165 -0
  700. package/dist/test/test/tools/load.integration.test.js.map +1 -0
  701. package/dist/test/test/tools/load.test.d.ts +2 -0
  702. package/dist/test/test/tools/load.test.d.ts.map +1 -0
  703. package/dist/test/test/tools/load.test.js +387 -0
  704. package/dist/test/test/tools/load.test.js.map +1 -0
  705. package/dist/test/test/tools/preview-harness.d.ts +9 -0
  706. package/dist/test/test/tools/preview-harness.d.ts.map +1 -0
  707. package/dist/test/test/tools/preview-harness.js +23 -0
  708. package/dist/test/test/tools/preview-harness.js.map +1 -0
  709. package/dist/test/test/tools/preview.telemetry.test.d.ts +2 -0
  710. package/dist/test/test/tools/preview.telemetry.test.d.ts.map +1 -0
  711. package/dist/test/test/tools/preview.telemetry.test.js +36 -0
  712. package/dist/test/test/tools/preview.telemetry.test.js.map +1 -0
  713. package/dist/test/test/tools/schema-best-practices.d.ts +13 -0
  714. package/dist/test/test/tools/schema-best-practices.d.ts.map +1 -0
  715. package/dist/test/test/tools/schema-best-practices.js +169 -0
  716. package/dist/test/test/tools/schema-best-practices.js.map +1 -0
  717. package/dist/test/test/tools/schema-best-practices.test.d.ts +3 -0
  718. package/dist/test/test/tools/schema-best-practices.test.d.ts.map +1 -0
  719. package/dist/test/test/tools/schema-best-practices.test.js +194 -0
  720. package/dist/test/test/tools/schema-best-practices.test.js.map +1 -0
  721. package/dist/test/test/tools/spans.test.d.ts +2 -0
  722. package/dist/test/test/tools/spans.test.d.ts.map +1 -0
  723. package/dist/test/test/tools/spans.test.js +84 -0
  724. package/dist/test/test/tools/spans.test.js.map +1 -0
  725. package/dist/test/test/viewer/cesdk-cdn.test.d.ts +2 -0
  726. package/dist/test/test/viewer/cesdk-cdn.test.d.ts.map +1 -0
  727. package/dist/test/test/viewer/cesdk-cdn.test.js +19 -0
  728. package/dist/test/test/viewer/cesdk-cdn.test.js.map +1 -0
  729. package/dist/test/test/viewer/config-route.test.d.ts +2 -0
  730. package/dist/test/test/viewer/config-route.test.d.ts.map +1 -0
  731. package/dist/test/test/viewer/config-route.test.js +28 -0
  732. package/dist/test/test/viewer/config-route.test.js.map +1 -0
  733. package/dist/test/test/viewer/spa-version.test.d.ts +2 -0
  734. package/dist/test/test/viewer/spa-version.test.d.ts.map +1 -0
  735. package/dist/test/test/viewer/spa-version.test.js +14 -0
  736. package/dist/test/test/viewer/spa-version.test.js.map +1 -0
  737. package/dist/test/test/workspace/content-hash.test.d.ts +2 -0
  738. package/dist/test/test/workspace/content-hash.test.d.ts.map +1 -0
  739. package/dist/test/test/workspace/content-hash.test.js +17 -0
  740. package/dist/test/test/workspace/content-hash.test.js.map +1 -0
  741. package/dist/test/tsconfig.test.tsbuildinfo +1 -1
  742. package/dist/test/vitest.config.js +1 -1
  743. package/dist/test/vitest.config.js.map +1 -1
  744. package/dist/tools/asset-generate.d.ts.map +1 -1
  745. package/dist/tools/asset-generate.js +1 -8
  746. package/dist/tools/asset-generate.js.map +1 -1
  747. package/dist/tools/edit.d.ts +3 -0
  748. package/dist/tools/edit.d.ts.map +1 -1
  749. package/dist/tools/edit.js +145 -96
  750. package/dist/tools/edit.js.map +1 -1
  751. package/dist/tools/export.d.ts +3 -0
  752. package/dist/tools/export.d.ts.map +1 -1
  753. package/dist/tools/export.js +146 -108
  754. package/dist/tools/export.js.map +1 -1
  755. package/dist/tools/import.d.ts +12 -0
  756. package/dist/tools/import.d.ts.map +1 -0
  757. package/dist/tools/import.js +144 -0
  758. package/dist/tools/import.js.map +1 -0
  759. package/dist/tools/index.d.ts +3 -0
  760. package/dist/tools/index.d.ts.map +1 -1
  761. package/dist/tools/index.js +44 -4
  762. package/dist/tools/index.js.map +1 -1
  763. package/dist/tools/load.d.ts +26 -0
  764. package/dist/tools/load.d.ts.map +1 -0
  765. package/dist/tools/load.js +400 -0
  766. package/dist/tools/load.js.map +1 -0
  767. package/dist/tools/preview.d.ts +3 -0
  768. package/dist/tools/preview.d.ts.map +1 -1
  769. package/dist/tools/preview.js +79 -44
  770. package/dist/tools/preview.js.map +1 -1
  771. package/dist/tools/result.d.ts +1 -1
  772. package/dist/tools/result.js +2 -2
  773. package/dist/tools/result.js.map +1 -1
  774. package/dist/tools/spans.d.ts +45 -0
  775. package/dist/tools/spans.d.ts.map +1 -0
  776. package/dist/tools/spans.js +77 -0
  777. package/dist/tools/spans.js.map +1 -0
  778. package/dist/tools/telemetry-wrapper.d.ts +4 -0
  779. package/dist/tools/telemetry-wrapper.d.ts.map +1 -0
  780. package/dist/tools/telemetry-wrapper.js +43 -0
  781. package/dist/tools/telemetry-wrapper.js.map +1 -0
  782. package/dist/viewer/cesdk-cdn.d.ts +16 -0
  783. package/dist/viewer/cesdk-cdn.d.ts.map +1 -0
  784. package/dist/viewer/cesdk-cdn.js +30 -0
  785. package/dist/viewer/cesdk-cdn.js.map +1 -0
  786. package/dist/viewer/router.d.ts +6 -0
  787. package/dist/viewer/router.d.ts.map +1 -1
  788. package/dist/viewer/router.js +4 -1
  789. package/dist/viewer/router.js.map +1 -1
  790. package/dist/viewer/spa-assets.generated.d.ts.map +1 -1
  791. package/dist/viewer/spa-assets.generated.js +2 -3
  792. package/dist/viewer/spa-assets.generated.js.map +1 -1
  793. package/dist/workspace/content-hash.d.ts +2 -0
  794. package/dist/workspace/content-hash.d.ts.map +1 -0
  795. package/dist/workspace/content-hash.js +15 -0
  796. package/dist/workspace/content-hash.js.map +1 -0
  797. package/package.json +18 -9
  798. package/assets/docs/guide/actions.md +0 -1038
  799. package/assets/docs/guide/animation/overview.md +0 -22
  800. package/assets/docs/guide/automation/batch-processing.md +0 -474
  801. package/assets/docs/guide/browser-support.md +0 -38
  802. package/assets/docs/guide/concepts/edit-modes.md +0 -431
  803. package/assets/docs/guide/concepts/headless-mode/browser.md +0 -291
  804. package/assets/docs/guide/create-audio/audio.md +0 -336
  805. package/assets/docs/guide/create-video/overview.md +0 -224
  806. package/assets/docs/guide/create-video/timeline-editor.md +0 -622
  807. package/assets/docs/guide/create-video/update-caption-presets.md +0 -676
  808. package/assets/docs/guide/edit-image/vectorize.md +0 -204
  809. package/assets/docs/guide/export-save-publish/export/to-html5.md +0 -474
  810. package/assets/docs/guide/export-save-publish/export/to-mp4.md +0 -364
  811. package/assets/docs/guide/get-started/vanilla-js/quickstart.md +0 -175
  812. package/assets/docs/guide/grid-and-rulers.md +0 -222
  813. package/assets/docs/guide/guides/text/rendering-internals.md +0 -796
  814. package/assets/docs/guide/import-media/asset-library.md +0 -23
  815. package/assets/docs/guide/import-media/asset-panel/basics.md +0 -324
  816. package/assets/docs/guide/import-media/asset-panel/customize.md +0 -478
  817. package/assets/docs/guide/import-media/asset-panel/thumbnails.md +0 -633
  818. package/assets/docs/guide/import-media/capture-from-camera/record-video.md +0 -137
  819. package/assets/docs/guide/import-media/capture-from-camera.md +0 -20
  820. package/assets/docs/guide/import-media/from-local-source/user-upload.md +0 -438
  821. package/assets/docs/guide/import-media/from-local-source.md +0 -20
  822. package/assets/docs/guide/import-media/from-remote-source/getty-images.md +0 -627
  823. package/assets/docs/guide/import-media/from-remote-source/imgly-premium-assets.md +0 -625
  824. package/assets/docs/guide/import-media/from-remote-source/pexels.md +0 -692
  825. package/assets/docs/guide/import-media/from-remote-source/soundstripe.md +0 -497
  826. package/assets/docs/guide/import-media/from-remote-source/third-party.md +0 -51
  827. package/assets/docs/guide/import-media/from-remote-source/unsplash.md +0 -914
  828. package/assets/docs/guide/import-media/from-remote-source/your-server.md +0 -764
  829. package/assets/docs/guide/open-the-editor/from-htmlcanvas.md +0 -228
  830. package/assets/docs/guide/open-the-editor/set-zoom-level.md +0 -303
  831. package/assets/docs/guide/plugins/asset-sources.md +0 -553
  832. package/assets/docs/guide/starterkits/3d-mockup-editor.md +0 -748
  833. package/assets/docs/guide/starterkits/advanced-editor.md +0 -698
  834. package/assets/docs/guide/starterkits/advanced-video-editor.md +0 -696
  835. package/assets/docs/guide/starterkits/ai-editor.md +0 -749
  836. package/assets/docs/guide/starterkits/airtable-image-editor.md +0 -672
  837. package/assets/docs/guide/starterkits/apparel-ui.md +0 -188
  838. package/assets/docs/guide/starterkits/assets.md +0 -27
  839. package/assets/docs/guide/starterkits/auto-resize.md +0 -586
  840. package/assets/docs/guide/starterkits/automated-video-generation.md +0 -692
  841. package/assets/docs/guide/starterkits/background-removal-editor.md +0 -480
  842. package/assets/docs/guide/starterkits/content-moderation.md +0 -863
  843. package/assets/docs/guide/starterkits/creative-automation.md +0 -28
  844. package/assets/docs/guide/starterkits/custom-built-uis.md +0 -26
  845. package/assets/docs/guide/starterkits/customization.md +0 -29
  846. package/assets/docs/guide/starterkits/cutout-lines-editor.md +0 -470
  847. package/assets/docs/guide/starterkits/data-merge.md +0 -850
  848. package/assets/docs/guide/starterkits/design-editor.md +0 -698
  849. package/assets/docs/guide/starterkits/design-generation.md +0 -719
  850. package/assets/docs/guide/starterkits/design-validation.md +0 -808
  851. package/assets/docs/guide/starterkits/editor-ui-configurations.md +0 -14
  852. package/assets/docs/guide/starterkits/export-options.md +0 -724
  853. package/assets/docs/guide/starterkits/export-using-renderer.md +0 -708
  854. package/assets/docs/guide/starterkits/extensibility.md +0 -28
  855. package/assets/docs/guide/starterkits/force-crop-editor.md +0 -675
  856. package/assets/docs/guide/starterkits/form-based-template-adoption.md +0 -522
  857. package/assets/docs/guide/starterkits/getty-images-editor.md +0 -700
  858. package/assets/docs/guide/starterkits/html5-ads-exporter.md +0 -719
  859. package/assets/docs/guide/starterkits/indesign-template-import.md +0 -580
  860. package/assets/docs/guide/starterkits/layouts-editor.md +0 -724
  861. package/assets/docs/guide/starterkits/mobile-ui.md +0 -185
  862. package/assets/docs/guide/starterkits/mockup-editor.md +0 -745
  863. package/assets/docs/guide/starterkits/multi-image-generation.md +0 -542
  864. package/assets/docs/guide/starterkits/page-sizes-editor.md +0 -657
  865. package/assets/docs/guide/starterkits/pexels-image-editor.md +0 -665
  866. package/assets/docs/guide/starterkits/photo-editor.md +0 -755
  867. package/assets/docs/guide/starterkits/photo-ui.md +0 -186
  868. package/assets/docs/guide/starterkits/photobook-ui.md +0 -188
  869. package/assets/docs/guide/starterkits/placeholders.md +0 -678
  870. package/assets/docs/guide/starterkits/player.md +0 -405
  871. package/assets/docs/guide/starterkits/plugins.md +0 -25
  872. package/assets/docs/guide/starterkits/postcard-editor.md +0 -202
  873. package/assets/docs/guide/starterkits/pptx-template-import.md +0 -581
  874. package/assets/docs/guide/starterkits/print-ready-pdf-editor.md +0 -746
  875. package/assets/docs/guide/starterkits/product-editor.md +0 -773
  876. package/assets/docs/guide/starterkits/psd-template-import.md +0 -580
  877. package/assets/docs/guide/starterkits/qr-code-editor.md +0 -470
  878. package/assets/docs/guide/starterkits/single-page-editor.md +0 -661
  879. package/assets/docs/guide/starterkits/start-with-image.md +0 -684
  880. package/assets/docs/guide/starterkits/start-with-video.md +0 -651
  881. package/assets/docs/guide/starterkits/t-shirt-designer.md +0 -742
  882. package/assets/docs/guide/starterkits/templating.md +0 -23
  883. package/assets/docs/guide/starterkits/theming.md +0 -662
  884. package/assets/docs/guide/starterkits/translation-internationalization.md +0 -662
  885. package/assets/docs/guide/starterkits/unsplash-editor.md +0 -839
  886. package/assets/docs/guide/starterkits/vectorizer-editor.md +0 -466
  887. package/assets/docs/guide/starterkits/version-history.md +0 -745
  888. package/assets/docs/guide/starterkits/video-animations.md +0 -853
  889. package/assets/docs/guide/starterkits/video-captions.md +0 -884
  890. package/assets/docs/guide/starterkits/video-editing.md +0 -25
  891. package/assets/docs/guide/starterkits/video-editor.md +0 -696
  892. package/assets/docs/guide/starterkits/video-export-options.md +0 -676
  893. package/assets/docs/guide/starterkits/viewer.md +0 -400
  894. package/assets/docs/guide/starterkits.md +0 -41
  895. package/assets/docs/guide/stickers-and-shapes/create-edit/vector-edit.md +0 -362
  896. package/assets/docs/guide/text/custom-fonts.md +0 -401
  897. package/assets/docs/guide/text/decorations.md +0 -330
  898. package/assets/docs/guide/text/enumerations.md +0 -258
  899. package/assets/docs/guide/to-v1-10.md +0 -131
  900. package/assets/docs/guide/to-v1-13.md +0 -165
  901. package/assets/docs/guide/to-v1-32.md +0 -110
  902. package/assets/docs/guide/to-v1-69.md +0 -468
  903. package/assets/docs/guide/to-v1-72.md +0 -193
  904. package/assets/docs/guide/use-templates/library.md +0 -450
  905. package/assets/docs/guide/user-interface/ai-integration/audio-generation.md +0 -428
  906. package/assets/docs/guide/user-interface/ai-integration/auto-captions.md +0 -337
  907. package/assets/docs/guide/user-interface/ai-integration/custom-provider.md +0 -853
  908. package/assets/docs/guide/user-interface/ai-integration/gateway-provider.md +0 -1045
  909. package/assets/docs/guide/user-interface/ai-integration/image-generation.md +0 -641
  910. package/assets/docs/guide/user-interface/ai-integration/integrate.md +0 -966
  911. package/assets/docs/guide/user-interface/ai-integration/proxy-server.md +0 -99
  912. package/assets/docs/guide/user-interface/ai-integration/text-generation.md +0 -498
  913. package/assets/docs/guide/user-interface/ai-integration/video-generation.md +0 -493
  914. package/assets/docs/guide/user-interface/ai-integration.md +0 -30
  915. package/assets/docs/guide/user-interface/appearance/change-ui-font.md +0 -316
  916. package/assets/docs/guide/user-interface/appearance/custom-labels.md +0 -509
  917. package/assets/docs/guide/user-interface/appearance/icons.md +0 -373
  918. package/assets/docs/guide/user-interface/appearance/theming.md +0 -665
  919. package/assets/docs/guide/user-interface/appearance.md +0 -23
  920. package/assets/docs/guide/user-interface/build-your-own-ui.md +0 -620
  921. package/assets/docs/guide/user-interface/customization/canvas-menu.md +0 -412
  922. package/assets/docs/guide/user-interface/customization/canvas.md +0 -281
  923. package/assets/docs/guide/user-interface/customization/color-palette.md +0 -413
  924. package/assets/docs/guide/user-interface/customization/crop-presets.md +0 -384
  925. package/assets/docs/guide/user-interface/customization/disable-or-enable.md +0 -676
  926. package/assets/docs/guide/user-interface/customization/dock.md +0 -399
  927. package/assets/docs/guide/user-interface/customization/force-crop.md +0 -289
  928. package/assets/docs/guide/user-interface/customization/inspector-bar.md +0 -371
  929. package/assets/docs/guide/user-interface/customization/navigation-bar.md +0 -516
  930. package/assets/docs/guide/user-interface/customization/page-format.md +0 -436
  931. package/assets/docs/guide/user-interface/customization/panel.md +0 -605
  932. package/assets/docs/guide/user-interface/customization/quick-start/add-action-buttons.md +0 -531
  933. package/assets/docs/guide/user-interface/customization/quick-start/add-dock-buttons.md +0 -358
  934. package/assets/docs/guide/user-interface/customization/quick-start/create-custom-components.md +0 -374
  935. package/assets/docs/guide/user-interface/customization/quick-start/reorder-components.md +0 -323
  936. package/assets/docs/guide/user-interface/customization/quick-start/show-hide-components.md +0 -294
  937. package/assets/docs/guide/user-interface/customization/quick-start.md +0 -12
  938. package/assets/docs/guide/user-interface/customization/reference/component-order-api.md +0 -519
  939. package/assets/docs/guide/user-interface/customization/reference/component-reference.md +0 -333
  940. package/assets/docs/guide/user-interface/customization/reference.md +0 -12
  941. package/assets/docs/guide/user-interface/customization.md +0 -39
  942. package/assets/docs/guide/user-interface/localization.md +0 -633
  943. package/assets/docs/guide/user-interface/overview.md +0 -167
  944. package/assets/docs/guide/user-interface/ui-extensions/add-custom-feature.md +0 -411
  945. package/assets/docs/guide/user-interface/ui-extensions/asset-library.md +0 -721
  946. package/assets/docs/guide/user-interface/ui-extensions/create-custom-panel.md +0 -331
  947. package/assets/docs/guide/user-interface/ui-extensions/customize-behaviour.md +0 -553
  948. package/assets/docs/guide/user-interface/ui-extensions/notifications-and-dialogs.md +0 -672
  949. package/assets/docs/guide/user-interface/ui-extensions/quick-actions.md +0 -415
  950. package/assets/docs/guide/user-interface/ui-extensions/register-new-component.md +0 -521
  951. package/assets/docs/guide/user-interface/ui-extensions.md +0 -26
  952. package/assets/docs/guide/user-interface.md +0 -25
  953. package/assets/prompts/evals-assetGenerate.md +0 -12
  954. package/assets/prompts/evals-brutalistCore.md +0 -34
  955. package/assets/prompts/evals-danskCatalogue.md +0 -31
  956. package/assets/prompts/evals-exportRoundTrip.md +0 -12
  957. package/assets/prompts/evals-inspectPriorCode.md +0 -16
  958. package/assets/prompts/evals-listProjectFiles.md +0 -6
  959. package/assets/prompts/evals-readAndExplainScript.md +0 -6
  960. package/assets/prompts/evals-resumeAcrossRestart.md +0 -15
  961. package/assets/prompts/evals-rewindRecovery.md +0 -10
  962. package/assets/prompts/evals-searchAcrossFiles.md +0 -6
  963. package/assets/prompts/evals-weddingCard.md +0 -20
  964. package/assets/prompts/explain.md +0 -6
  965. package/assets/prompts/review.md +0 -6
  966. package/dist/frontmatter.d.ts +0 -15
  967. package/dist/frontmatter.d.ts.map +0 -1
  968. package/dist/frontmatter.js +0 -46
  969. package/dist/frontmatter.js.map +0 -1
  970. package/dist/test/test/frontmatter.test.d.ts +0 -2
  971. package/dist/test/test/frontmatter.test.d.ts.map +0 -1
  972. package/dist/test/test/frontmatter.test.js +0 -55
  973. package/dist/test/test/frontmatter.test.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"router.js","sourceRoot":"","sources":["../../src/viewer/router.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,4EAA4E;AAC5E,yEAAyE;AACzE,qEAAqE;AACrE,+CAA+C;AAC/C,OAAO,EAIL,MAAM,EACP,MAAM,SAAS,CAAC;AAIjB,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAiBvD,MAAM,UAAU,kBAAkB,CAAC,IAA+B;IAChE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IACxC,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC;IAExB,4EAA4E;IAC5E,yEAAyE;IACzE,6EAA6E;IAC7E,wEAAwE;IACxE,2EAA2E;IAC3E,yEAAyE;IACzE,iEAAiE;IACjE,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,OAAe,EAAU,EAAE,CAC3D,IAAI,CAAC,UAAU,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IAE9C,MAAM,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACrC,yEAAyE;QACzE,sEAAsE;QACtE,GAAG,CAAC,IAAI,CAAC;YACP,OAAO,EAAE,IAAI,CAAC,YAAY,IAAI,EAAE;Y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AAC,CAAC;IAEH,4EAA4E;IAC5E,uEAAuE;IACvE,wEAAwE;IACxE,+CAA+C;IAC/C,MAAM,CAAC,GAAG,CACR,CAAC,IAAa,EAAE,IAAa,EAAE,GAAa,EAAE,KAAmB,EAAE,EAAE;QACnE,IAAI,GAAG,CAAC,WAAW;YAAE,OAAO;QAC5B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACtD,CAAC,CACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["//\n// Express router serving the read-only viewer + mini-studio + JSON snapshot\n// API + SSE channel. Stateless: every request reads through the supplied\n// store/fs. Same router mounts on the stdio listener and on the HTTP\n// transport's express app (one impl, no fork).\nimport {\n type NextFunction,\n type Request,\n type Response,\n Router\n} from 'express';\nimport type { RevisionStore } from '../revisions/store.js';\nimport type { WorkspaceFS } from '../workspace/types.js';\nimport type { SseBroadcaster } from './broadcaster.js';\nimport { createResourceRoute } from './resource-route.js';\nimport { SPA_ASSETS } from './spa-assets.generated.js';\n\nexport interface CreateViewerRouterOptions {\n store: RevisionStore;\n fs: WorkspaceFS;\n broadcaster: SseBroadcaster;\n /**\n * CE.SDK license served to the browser viewer via `/api/config`.\n * Without it, the SPA can't initialise CreativeEditorSDK and shows a\n * license error. The viewer requires a browser-shape license (which may\n * be a separate SKU from the @cesdk/node license used by the agent).\n */\n cesdkLicense?: string;\n /** Absolute workspace root, forwarded to the `/r/` route for disk streaming. Empty on object-store backends. */\n workspaceRoot?: string;\n}\n\nexport function createViewerRouter(opts: CreateViewerRouterOptions): Router {\n const { store, fs, broadcaster } = opts;\n const router = Router();\n\n // The SPA is mounted at root on the stdio listener (req.baseUrl === \"\") and\n // under \"/viewer\" on the HTTP transport (req.baseUrl === \"/viewer\"). Its\n // HTML/JS address assets and API routes by path, so we inject the live mount\n // prefix at serve time: the `{{VIEWER_BASE}}` token in the HTML becomes\n // req.baseUrl, and the inline `window.__VIEWER_BASE__` global it sets lets\n // the SPA's JS build matching URLs at runtime. Without this the absolute\n // paths resolve against the origin root and 404 under \"/viewer\".\n const renderHtml = (html: string, baseUrl: string): string =>\n html.replaceAll('{{VIEWER_BASE}}', baseUrl);\n\n router.get('/api/config', (req, res) => {\n // `resourceBase` is where the browser viewer resolves workspace:// asset\n // URIs. `req.baseUrl` is \"\" on the stdio listener, \"/viewer\" on HTTP.\n res.json({\n license: opts.cesdkLicense ?? '',\n resourceBase: `${req.baseUrl}/r/`\n });\n });\n\n router.use(\n createResourceRoute({ fs, workspaceRoot: opts.workspaceRoot ?? '' })\n );\n\n router.get('/', (req, res) => {\n res.type('html').send(renderHtml(SPA_ASSETS['studio.html'], req.baseUrl));\n });\n\n // `/d/<root>` (LIVE) and `/d/<root>/<rev>` (PINNED) both serve the viewer\n // SPA; viewer.js reads the path depth to choose the mode. The old\n // per-revision `/s/<rev>` route is gone — `open_editor` hands out `/d/`.\n const serveViewer = (req: Request, res: Response): void => {\n res.type('html').send(renderHtml(SPA_ASSETS['index.html'], req.baseUrl));\n };\n router.get('/d/:root', serveViewer);\n router.get('/d/:root/:rev', serveViewer);\n\n router.get('/static/:name', (req, res, next) => {\n const body = SPA_ASSETS[req.params.name];\n if (!body) return next();\n const ext = req.params.name.split('.').pop();\n const ctype =\n ext === 'html'\n ? 'text/html'\n : ext === 'js'\n ? 'application/javascript'\n : 'text/plain';\n res.type(ctype).send(body);\n });\n\n // NOTE: thumbnail MUST be registered before /snapshot/:rev so Express\n // matches it first (route registration order is resolution order).\n router.get('/snapshot/:rev/thumbnail', async (req, res, next) => {\n try {\n const rev = req.params.rev;\n const shard = rev.slice(0, 2);\n const rest = rev.slice(2);\n const relPath = `exports/${shard}/${rest}/preview.webp`;\n if (!(await fs.exists(relPath))) return next();\n const bytes = await fs.readFile(relPath);\n res.type('image/webp').send(Buffer.from(bytes));\n } catch (err) {\n next(err);\n }\n });\n\n router.get('/snapshot/:rev', async (req, res, next) => {\n try {\n const revision = await store.read(req.params.rev);\n const chain = await store.historyOf(req.params.rev);\n const rootRevision = chain[0].id;\n res.json({\n revision: revision.id,\n rootRevision,\n scene: revision.scene,\n title: await store.currentTitle(rootRevision),\n note: revision.meta.note,\n createdAt: revision.meta.createdAt\n });\n } catch (err) {\n if ((err as { code?: string }).code === 'ENOENT') {\n res.status(404).json({ error: 'unknown revision' });\n return;\n }\n // Non-ENOENT errors carry fs paths in their message — hand to the\n // sanitising error handler rather than echoing err.message.\n next(err);\n }\n });\n\n router.get('/sse/:root', (req, res) => {\n broadcaster.subscribe(req.params.root, res);\n });\n\n router.get('/api/designs', async (_req, res, next) => {\n try {\n res.json(await store.listRoots());\n } catch (err) {\n next(err);\n }\n });\n\n router.get('/api/design/:root', async (req, res, next) => {\n try {\n const roots = await store.listRoots();\n const design = roots.find((d) => d.rootRevision === req.params.root);\n if (!design) {\n res.status(404).json({ error: 'unknown design' });\n return;\n }\n res.json(design);\n } catch (err) {\n next(err);\n }\n });\n\n router.get('/api/design/:root/revisions', async (req, res, next) => {\n try {\n const tree = await store.treeOf(req.params.root);\n if (tree.length === 0) {\n res.status(404).json({ error: 'unknown design' });\n return;\n }\n res.json(tree);\n } catch (err) {\n next(err);\n }\n });\n\n // Sanitising error handler — fs errors embed the absolute workspace path in\n // their message; convert every error to a generic response so the path\n // never reaches a client. MUST be last, and MUST take all four args for\n // Express to recognise it as an error handler.\n router.use(\n (_err: unknown, _req: Request, res: Response, _next: NextFunction) => {\n if (res.headersSent) return;\n res.status(500).type('text').send('internal error');\n }\n );\n\n return router;\n}\n"]}
1
+ {"version":3,"file":"router.js","sourceRoot":"","sources":["../../src/viewer/router.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,4EAA4E;AAC5E,yEAAyE;AACzE,qEAAqE;AACrE,+CAA+C;AAC/C,OAAO,EAIL,MAAM,EACP,MAAM,SAAS,CAAC;AAIjB,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,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AC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC,CAAC;gBAClD,OAAO;YACT,CAAC;YACD,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,GAAG,CAAC,CAAC;QACZ,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,GAAG,CAAC,6BAA6B,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QACjE,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACjD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACtB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC,CAAC;gBAClD,OAAO;YACT,CAAC;YACD,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,GAAG,CAAC,CAAC;QACZ,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,4EAA4E;IAC5E,uEAAuE;IACvE,wEAAwE;IACxE,+CAA+C;IAC/C,MAAM,CAAC,GAAG,CACR,CAAC,IAAa,EAAE,IAAa,EAAE,GAAa,EAAE,KAAmB,EAAE,EAAE;QACnE,IAAI,GAAG,CAAC,WAAW;YAAE,OAAO;QAC5B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACtD,CAAC,CACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["//\n// Express router serving the read-only viewer + mini-studio + JSON snapshot\n// API + SSE channel. Stateless: every request reads through the supplied\n// store/fs. Same router mounts on the stdio listener and on the HTTP\n// transport's express app (one impl, no fork).\nimport {\n type NextFunction,\n type Request,\n type Response,\n Router\n} from 'express';\nimport type { RevisionStore } from '../revisions/store.js';\nimport type { WorkspaceFS } from '../workspace/types.js';\nimport type { SseBroadcaster } from './broadcaster.js';\nimport { createResourceRoute } from './resource-route.js';\nimport { SPA_ASSETS } from './spa-assets.generated.js';\nimport { cesdkCdnUrl, installedCesdkVersion } from './cesdk-cdn.js';\n\nexport interface CreateViewerRouterOptions {\n store: RevisionStore;\n fs: WorkspaceFS;\n broadcaster: SseBroadcaster;\n /**\n * CE.SDK license served to the browser viewer via `/api/config`.\n * Without it, the SPA can't initialise CreativeEditorSDK and shows a\n * license error. The viewer requires a browser-shape license (which may\n * be a separate SKU from the @cesdk/node license used by the agent).\n */\n cesdkLicense?: string;\n /** Absolute workspace root, forwarded to the `/r/` route for disk streaming. Empty on object-store backends. */\n workspaceRoot?: string;\n /**\n * Full cdn.img.ly URL the browser viewer imports the CE.SDK engine from.\n * Defaults to the installed engine version so the preview can never drift\n * from the node runtime. Overridable for tests.\n */\n cesdkEngineUrl?: string;\n}\n\nexport function createViewerRouter(opts: CreateViewerRouterOptions): Router {\n const { store, fs, broadcaster } = opts;\n const router = Router();\n const cesdkEngineUrl =\n opts.cesdkEngineUrl ?? cesdkCdnUrl(installedCesdkVersion());\n\n // The SPA is mounted at root on the stdio listener (req.baseUrl === \"\") and\n // under \"/viewer\" on the HTTP transport (req.baseUrl === \"/viewer\"). Its\n // HTML/JS address assets and API routes by path, so we inject the live mount\n // prefix at serve time: the `{{VIEWER_BASE}}` token in the HTML becomes\n // req.baseUrl, and the inline `window.__VIEWER_BASE__` global it sets lets\n // the SPA's JS build matching URLs at runtime. Without this the absolute\n // paths resolve against the origin root and 404 under \"/viewer\".\n const renderHtml = (html: string, baseUrl: string): string =>\n html.replaceAll('{{VIEWER_BASE}}', baseUrl);\n\n router.get('/api/config', (req, res) => {\n // `resourceBase` is where the browser viewer resolves workspace:// asset\n // URIs. `req.baseUrl` is \"\" on the stdio listener, \"/viewer\" on HTTP.\n res.json({\n license: opts.cesdkLicense ?? '',\n resourceBase: `${req.baseUrl}/r/`,\n cesdkEngineUrl\n });\n });\n\n router.use(\n createResourceRoute({ fs, workspaceRoot: opts.workspaceRoot ?? '' })\n );\n\n router.get('/', (req, res) => {\n res.type('html').send(renderHtml(SPA_ASSETS['studio.html'], req.baseUrl));\n });\n\n // `/d/<root>` (LIVE) and `/d/<root>/<rev>` (PINNED) both serve the viewer\n // SPA; viewer.js reads the path depth to choose the mode. The old\n // per-revision `/s/<rev>` route is gone — `open_editor` hands out `/d/`.\n const serveViewer = (req: Request, res: Response): void => {\n res.type('html').send(renderHtml(SPA_ASSETS['index.html'], req.baseUrl));\n };\n router.get('/d/:root', serveViewer);\n router.get('/d/:root/:rev', serveViewer);\n\n router.get('/static/:name', (req, res, next) => {\n const body = SPA_ASSETS[req.params.name];\n if (!body) return next();\n const ext = req.params.name.split('.').pop();\n const ctype =\n ext === 'html'\n ? 'text/html'\n : ext === 'js'\n ? 'application/javascript'\n : 'text/plain';\n res.type(ctype).send(body);\n });\n\n // NOTE: thumbnail MUST be registered before /snapshot/:rev so Express\n // matches it first (route registration order is resolution order).\n router.get('/snapshot/:rev/thumbnail', async (req, res, next) => {\n try {\n const rev = req.params.rev;\n const shard = rev.slice(0, 2);\n const rest = rev.slice(2);\n const relPath = `exports/${shard}/${rest}/preview.webp`;\n if (!(await fs.exists(relPath))) return next();\n const bytes = await fs.readFile(relPath);\n res.type('image/webp').send(Buffer.from(bytes));\n } catch (err) {\n next(err);\n }\n });\n\n router.get('/snapshot/:rev', async (req, res, next) => {\n try {\n const revision = await store.read(req.params.rev);\n const chain = await store.historyOf(req.params.rev);\n const rootRevision = chain[0].id;\n res.json({\n revision: revision.id,\n rootRevision,\n scene: revision.scene,\n title: await store.currentTitle(rootRevision),\n note: revision.meta.note,\n createdAt: revision.meta.createdAt\n });\n } catch (err) {\n if ((err as { code?: string }).code === 'ENOENT') {\n res.status(404).json({ error: 'unknown revision' });\n return;\n }\n // Non-ENOENT errors carry fs paths in their message — hand to the\n // sanitising error handler rather than echoing err.message.\n next(err);\n }\n });\n\n router.get('/sse/:root', (req, res) => {\n broadcaster.subscribe(req.params.root, res);\n });\n\n router.get('/api/designs', async (_req, res, next) => {\n try {\n res.json(await store.listRoots());\n } catch (err) {\n next(err);\n }\n });\n\n router.get('/api/design/:root', async (req, res, next) => {\n try {\n const roots = await store.listRoots();\n const design = roots.find((d) => d.rootRevision === req.params.root);\n if (!design) {\n res.status(404).json({ error: 'unknown design' });\n return;\n }\n res.json(design);\n } catch (err) {\n next(err);\n }\n });\n\n router.get('/api/design/:root/revisions', async (req, res, next) => {\n try {\n const tree = await store.treeOf(req.params.root);\n if (tree.length === 0) {\n res.status(404).json({ error: 'unknown design' });\n return;\n }\n res.json(tree);\n } catch (err) {\n next(err);\n }\n });\n\n // Sanitising error handler — fs errors embed the absolute workspace path in\n // their message; convert every error to a generic response so the path\n // never reaches a client. MUST be last, and MUST take all four args for\n // Express to recognise it as an error handler.\n router.use(\n (_err: unknown, _req: Request, res: Response, _next: NextFunction) => {\n if (res.headersSent) return;\n res.status(500).type('text').send('internal error');\n }\n );\n\n return router;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"spa-assets.generated.d.ts","sourceRoot":"","sources":["../../src/viewer/spa-assets.generated.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA09B7C,CAAC"}
1
+ {"version":3,"file":"spa-assets.generated.d.ts","sourceRoot":"","sources":["../../src/viewer/spa-assets.generated.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAy9B7C,CAAC"}
@@ -781,10 +781,9 @@ if (!match) {
781
781
  // is where workspace:// asset URIs resolve.
782
782
  const cfgRes = await fetch(\`\${BASE}/api/config\`);
783
783
  if (!cfgRes.ok) throw new Error(\`/api/config failed: \${cfgRes.status}\`);
784
- const { license, resourceBase } = await cfgRes.json();
784
+ const { license, resourceBase, cesdkEngineUrl } = await cfgRes.json();
785
785
 
786
- const cesdkMod =
787
- await import('https://cdn.img.ly/packages/imgly/cesdk-js/1.77.0-rc.4/index.js');
786
+ const cesdkMod = await import(cesdkEngineUrl);
788
787
  const CreativeEditorSDK = cesdkMod.default ?? cesdkMod.CreativeEditorSDK;
789
788
  const instance = await CreativeEditorSDK.create(
790
789
  document.getElementById('cesdk'),
@@ -1 +1 @@
1
- {"version":3,"file":"spa-assets.generated.js","sourceRoot":"","sources":["../../src/viewer/spa-assets.generated.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,CAAC,MAAM,UAAU,GAA2B;IACjD,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2Td;IACA,mBAAmB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwMrB;IACA,aAAa,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmIf;IACA,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoFb;IACA,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Pb;CACA,CAAC","sourcesContent":["// AUTO-GENERATED by scripts/generate-spa-assets.mjs. Do not edit by hand.\nexport const SPA_ASSETS: Record<string, string> = {\n\t\"index.html\": `<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <title>codesign viewer</title>\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />\n <!-- Mount prefix injected by the viewer router (router.ts). \"\" on the stdio\n listener, \"/viewer\" on the HTTP transport. Read by viewer.js. -->\n <script>\n window.__VIEWER_BASE__ = '{{VIEWER_BASE}}';\n </script>\n <style>\n /* -------- reset & canvas -------- */\n html,\n body {\n margin: 0;\n padding: 0;\n height: 100%;\n width: 100%;\n background: #1d1d1f;\n color: #eee;\n font-family: -apple-system, system-ui, sans-serif;\n }\n #cesdk {\n position: fixed;\n inset: 0;\n }\n\n /* -------- pill base (spec §7) -------- */\n .pill {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 6px 11px;\n border-radius: 999px;\n font:\n 500 12px -apple-system,\n system-ui,\n sans-serif;\n color: #e8e8e8;\n background: rgba(20, 20, 22, 0.72);\n backdrop-filter: blur(12px);\n -webkit-backdrop-filter: blur(12px);\n border: 1px solid rgba(255, 255, 255, 0.08);\n box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);\n text-decoration: none;\n cursor: pointer;\n white-space: nowrap;\n }\n .pill.icon {\n padding: 6px 9px;\n }\n .pill:hover {\n background: rgba(30, 30, 33, 0.82);\n }\n\n /* -------- cluster anchors -------- */\n #bar-left,\n #bar-right {\n position: fixed;\n top: 14px;\n z-index: 10;\n display: flex;\n gap: 8px;\n }\n #bar-left {\n left: 14px;\n }\n #bar-right {\n right: 14px;\n }\n\n /* -------- title pill --------\n\t\t\t Non-interactive (no click handler) — override .pill's cursor + hover so\n\t\t\t the title visually matches its actual behavior. For a local MCP the URL\n\t\t\t isn't shareable, so there's nothing useful to copy. Revisit when a\n\t\t\t remote MCP ships — copy-share-URL is the natural fit there. */\n #title {\n font-weight: 600;\n max-width: 240px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n cursor: default;\n }\n #title:hover {\n background: rgba(20, 20, 22, 0.72);\n }\n\n /* -------- LIVE pill (read-only) -------- */\n .pill.live {\n color: #c8e6c9;\n cursor: default;\n }\n .pill.live:hover {\n background: rgba(20, 20, 22, 0.72);\n }\n .pill.live::before {\n content: '';\n width: 6px;\n height: 6px;\n border-radius: 999px;\n background: #34c759;\n box-shadow: 0 0 5px rgba(52, 199, 89, 0.55);\n }\n\n /* -------- hash chip -------- */\n .pill.hash {\n font-family: ui-monospace, monospace;\n font-size: 11px;\n color: #b8b8b8;\n }\n\n /* -------- Go Live pill + count badge -------- */\n .pill.golive {\n color: #9ec8ff;\n }\n .pill.golive .count {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 16px;\n height: 16px;\n padding: 0 4px;\n border-radius: 999px;\n background: #2b6cb0;\n color: #fff;\n font-size: 10px;\n font-weight: 600;\n margin-left: 4px;\n }\n\n /* -------- History pill -------- */\n .pill.history::before {\n content: '⎇';\n opacity: 0.8;\n }\n .pill.history.active,\n .pill.history.active:hover {\n background: rgba(43, 108, 176, 0.85);\n border-color: rgba(43, 108, 176, 0.95);\n color: #fff;\n }\n\n /* -------- floating history panel (spec §6) -------- */\n #revision-panel {\n position: fixed;\n top: 62px;\n right: 14px;\n bottom: 14px;\n width: 280px;\n background: rgba(20, 20, 22, 0.88);\n backdrop-filter: blur(16px);\n -webkit-backdrop-filter: blur(16px);\n border: 1px solid rgba(255, 255, 255, 0.08);\n border-radius: 12px;\n box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);\n box-sizing: border-box;\n overflow-y: auto;\n display: none;\n opacity: 0;\n transform: translateX(8px);\n z-index: 10;\n }\n body.panel-open #revision-panel {\n display: block;\n }\n @media (prefers-reduced-motion: no-preference) {\n #revision-panel {\n transition:\n opacity 160ms ease-out,\n transform 160ms ease-out;\n }\n body.panel-open #revision-panel {\n opacity: 1;\n transform: translateX(0);\n }\n }\n @media (prefers-reduced-motion: reduce) {\n body.panel-open #revision-panel {\n opacity: 1;\n transform: none;\n }\n }\n\n /* -------- panel internals (polish pass) -------- */\n .rp-header {\n padding: 12px 14px 10px;\n font-size: 10px;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n color: #888;\n border-bottom: 1px solid rgba(255, 255, 255, 0.06);\n }\n .rp-tree {\n padding: 8px 6px;\n }\n .rp-empty {\n padding: 16px 14px;\n font-size: 12px;\n color: #888;\n }\n\n .rp-node {\n display: block;\n text-decoration: none;\n color: inherit;\n padding: 6px 8px;\n border-radius: 6px;\n }\n .rp-node:hover {\n background: rgba(255, 255, 255, 0.04);\n }\n .rp-node.rp-current {\n background: rgba(30, 47, 68, 0.6);\n box-shadow: inset 2px 0 0 #4a9eff;\n }\n .rp-node-row {\n display: flex;\n gap: 8px;\n align-items: baseline;\n }\n .rp-elbow {\n color: #555;\n flex: none;\n }\n .rp-dot {\n flex: none;\n width: 12px;\n text-align: center;\n font-size: 10px;\n color: #888;\n }\n .rp-node.rp-head .rp-dot {\n color: #4a9eff;\n }\n .rp-node.rp-branch .rp-dot {\n color: #d6973f;\n }\n .rp-body {\n flex: 1;\n min-width: 0;\n }\n .rp-id {\n display: flex;\n align-items: center;\n gap: 6px;\n font-family: ui-monospace, monospace;\n font-size: 10px;\n color: #888;\n }\n .rp-tag {\n border: 1px solid rgba(255, 255, 255, 0.1);\n border-radius: 4px;\n padding: 0 4px;\n font-size: 9px;\n }\n .rp-tag.rp-tag-head {\n background: rgba(43, 108, 176, 0.85);\n border-color: rgba(43, 108, 176, 0.95);\n color: #fff;\n }\n .rp-tag.rp-tag-fork {\n color: #d6973f;\n border-color: rgba(214, 151, 63, 0.35);\n }\n .rp-note {\n font-size: 12px;\n color: #eee;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n .rp-time {\n font-size: 10px;\n color: #777;\n }\n .rp-node.rp-current .rp-time::after {\n content: ' · on canvas';\n color: #4a9eff;\n }\n .rp-copy {\n font: inherit;\n font-size: 9px;\n color: #ccc;\n background: rgba(20, 20, 22, 0.72);\n border: 1px solid rgba(255, 255, 255, 0.08);\n border-radius: 999px;\n padding: 2px 7px;\n cursor: pointer;\n opacity: 0;\n margin-left: auto;\n transition:\n opacity 120ms ease-out,\n background 120ms ease-out;\n }\n .rp-node:hover .rp-copy {\n opacity: 1;\n }\n .rp-copy:hover {\n background: rgba(30, 30, 33, 0.82);\n }\n </style>\n </head>\n <body>\n <div id=\"cesdk\"></div>\n <div id=\"bar-left\">\n <a id=\"back\" class=\"pill icon\" href=\"{{VIEWER_BASE}}/\">←</a>\n <span id=\"title\" class=\"pill\">loading…</span>\n </div>\n <div id=\"bar-right\"></div>\n <aside id=\"revision-panel\"></aside>\n <script type=\"module\" src=\"{{VIEWER_BASE}}/static/viewer.js\"></script>\n </body>\n</html>\n`,\n\t\"revision-panel.js\": `// revision-panel.js — the in-viewer revision history panel. Fetches a design's\n// full revision tree from /api/design/<root>/revisions and renders it; clicking\n// a node asks the viewer to navigate there. The viewer drives setCurrent()\n// (highlight) and refresh() (re-fetch on SSE).\n//\n// All DOM is built with createElement + textContent: revision notes are\n// agent-authored text and must never reach innerHTML.\n\n// Mount prefix set by index.html (\"\" on stdio, \"/viewer\" on HTTP); node hrefs\n// and the revisions fetch are built relative to it. See router.ts.\nconst BASE = window.__VIEWER_BASE__ ?? '';\n\nexport function createRevisionPanel({ container, root, onNavigate, onCount }) {\n let currentRev = null;\n\n function relTime(ms) {\n const s = Math.max(0, Math.round((Date.now() - ms) / 1000));\n if (s < 60) return \\`\\${s}s ago\\`;\n const m = Math.round(s / 60);\n if (m < 60) return \\`\\${m}m ago\\`;\n const h = Math.round(m / 60);\n if (h < 24) return \\`\\${h}h ago\\`;\n return \\`\\${Math.round(h / 24)}d ago\\`;\n }\n\n // Depth-first walk. At each node the spine child (or, off-spine, the latest\n // child) continues at the same depth; other children are branches at\n // depth + 1, emitted before the continuation so the spine reads top-to-bottom.\n function order(nodes) {\n const byId = new Map(nodes.map((n) => [n.id, n]));\n const children = new Map();\n for (const n of nodes) {\n if (n.parent != null) {\n const sibs = children.get(n.parent) ?? [];\n sibs.push(n);\n children.set(n.parent, sibs);\n }\n }\n for (const sibs of children.values())\n sibs.sort((a, b) => a.createdAt - b.createdAt);\n const rootNode = nodes.find((n) => n.parent === null);\n const head = nodes.reduce((a, b) => (b.createdAt > a.createdAt ? b : a));\n const spine = new Set();\n for (let n = head; n; n = n.parent != null ? byId.get(n.parent) : null)\n spine.add(n.id);\n const out = [];\n function walk(node, depth) {\n out.push({\n node,\n depth,\n isHead: node.id === head.id,\n isRoot: node.parent === null\n });\n const kids = children.get(node.id) ?? [];\n if (kids.length === 0) return;\n const primary =\n kids.find((k) => spine.has(k.id)) ?? kids[kids.length - 1];\n for (const k of kids) if (k !== primary) walk(k, depth + 1);\n walk(primary, depth);\n }\n if (rootNode) walk(rootNode, 0);\n return out;\n }\n\n function tag(text, cls) {\n const el = document.createElement('span');\n el.className = cls ? \\`rp-tag \\${cls}\\` : 'rp-tag';\n el.textContent = text;\n return el;\n }\n\n function makeNode({ node, depth, isHead, isRoot }) {\n const a = document.createElement('a');\n a.className = \\`rp-node\\${depth > 0 ? ' rp-branch' : ''}\\${isHead ? ' rp-head' : ''}\\`;\n if (isRoot) a.dataset.root = '';\n a.dataset.rev = node.id;\n a.href = \\`\\${BASE}/d/\\${root}/\\${node.id}\\`;\n a.style.marginLeft = \\`\\${depth * 16}px\\`;\n if (node.id === currentRev) a.classList.add('rp-current');\n\n const row = document.createElement('div');\n row.className = 'rp-node-row';\n if (depth > 0) {\n const elbow = document.createElement('span');\n elbow.className = 'rp-elbow';\n elbow.textContent = '└';\n row.appendChild(elbow);\n }\n const dot = document.createElement('span');\n dot.className = 'rp-dot';\n dot.textContent = '●';\n row.appendChild(dot);\n\n const body = document.createElement('div');\n body.className = 'rp-body';\n\n const idLine = document.createElement('div');\n idLine.className = 'rp-id';\n const idText = document.createElement('span');\n idText.textContent = node.id.slice(0, 7);\n idLine.appendChild(idText);\n if (isRoot) idLine.appendChild(tag('root', ''));\n if (isHead) idLine.appendChild(tag('head', 'rp-tag-head'));\n if (depth > 0) idLine.appendChild(tag('⑂ fork', 'rp-tag-fork'));\n\n const copy = document.createElement('button');\n copy.type = 'button';\n copy.className = 'rp-copy';\n copy.textContent = '⧉ copy id';\n copy.addEventListener('click', async (e) => {\n e.preventDefault();\n e.stopPropagation();\n try {\n await navigator.clipboard?.writeText(node.id);\n copy.textContent = 'copied';\n setTimeout(() => {\n copy.textContent = '⧉ copy id';\n }, 1200);\n } catch {\n /* clipboard unavailable — fail quietly (spec §6) */\n }\n });\n idLine.appendChild(copy);\n body.appendChild(idLine);\n\n const note = document.createElement('div');\n note.className = 'rp-note';\n note.textContent = node.note || '(no note)';\n note.title = node.note || '';\n body.appendChild(note);\n\n const time = document.createElement('div');\n time.className = 'rp-time';\n time.textContent = relTime(node.createdAt);\n body.appendChild(time);\n\n row.appendChild(body);\n a.appendChild(row);\n\n a.addEventListener('click', (e) => {\n // Modified clicks (⌘/Ctrl/Shift/middle) fall through to the browser,\n // which opens the pinned /d/<root>/<rev> href in a new tab.\n if (e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey)\n return;\n e.preventDefault();\n onNavigate(node.id);\n });\n return a;\n }\n\n function paint(nodes) {\n container.replaceChildren();\n const header = document.createElement('div');\n header.className = 'rp-header';\n header.textContent = 'Revisions';\n container.appendChild(header);\n if (nodes.length === 0) {\n const empty = document.createElement('div');\n empty.className = 'rp-empty';\n empty.textContent = 'no revisions yet';\n container.appendChild(empty);\n return;\n }\n const tree = document.createElement('div');\n tree.className = 'rp-tree';\n for (const item of order(nodes)) tree.appendChild(makeNode(item));\n container.appendChild(tree);\n }\n\n function showError(message) {\n container.replaceChildren();\n const el = document.createElement('div');\n el.className = 'rp-empty';\n el.textContent = message;\n container.appendChild(el);\n }\n\n async function refresh() {\n try {\n const res = await fetch(\\`\\${BASE}/api/design/\\${root}/revisions\\`);\n if (!res.ok) throw new Error(String(res.status));\n const nodes = await res.json();\n paint(nodes);\n onCount(nodes.length);\n } catch {\n showError(\"couldn't load history\");\n onCount(0);\n }\n }\n\n function setCurrent(rev) {\n currentRev = rev;\n for (const el of container.querySelectorAll('.rp-node')) {\n el.classList.toggle('rp-current', el.dataset.rev === rev);\n }\n }\n\n refresh();\n return { setCurrent, refresh };\n}\n`,\n\t\"studio.html\": `<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <title>IMG.LY CODESIGN MCP Workspace</title>\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />\n <!-- Mount prefix injected by the viewer router (router.ts). \"\" on the stdio\n listener, \"/viewer\" on the HTTP transport. Read by studio.js. -->\n <script>\n window.__VIEWER_BASE__ = '{{VIEWER_BASE}}';\n </script>\n <style>\n /* -------- reset --------\n\t\t\t Same palette + typography as the viewer SPA so the overview reads\n\t\t\t as part of the same product. See src/viewer/spa/index.html. */\n html,\n body {\n margin: 0;\n padding: 0;\n min-height: 100%;\n background: #1d1d1f;\n color: #eee;\n font-family: -apple-system, system-ui, sans-serif;\n }\n\n /* -------- sticky frosted strip --------\n\t\t\t Same frosted-glass material as the viewer pills + history panel:\n\t\t\t translucent dark + backdrop-blur + 1px hairline border. Sticky so\n\t\t\t the title stays visible while scrolling. */\n #bar {\n position: sticky;\n top: 0;\n z-index: 10;\n padding: 14px 24px;\n background: rgba(20, 20, 22, 0.72);\n backdrop-filter: blur(12px);\n -webkit-backdrop-filter: blur(12px);\n border-bottom: 1px solid rgba(255, 255, 255, 0.08);\n }\n #bar .title {\n font:\n 600 14px -apple-system,\n system-ui,\n sans-serif;\n letter-spacing: 0.02em;\n color: #e8e8e8;\n }\n\n /* -------- design grid -------- */\n .grid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));\n gap: 16px;\n padding: 24px;\n }\n\n .empty {\n padding: 24px 4px;\n font-size: 13px;\n color: #888;\n }\n .empty code {\n font-family: ui-monospace, monospace;\n background: rgba(255, 255, 255, 0.05);\n border: 1px solid rgba(255, 255, 255, 0.08);\n border-radius: 4px;\n padding: 1px 6px;\n font-size: 12px;\n color: #cfcfcf;\n }\n\n /* -------- card --------\n\t\t\t Frosted-glass card, same materials as the history panel rows.\n\t\t\t Hover lifts the card and brightens the border + shadow to match the\n\t\t\t pill-hover pattern in the viewer chrome. */\n .card {\n display: block;\n text-decoration: none;\n color: inherit;\n background: rgba(20, 20, 22, 0.72);\n backdrop-filter: blur(12px);\n -webkit-backdrop-filter: blur(12px);\n border: 1px solid rgba(255, 255, 255, 0.08);\n border-radius: 12px;\n box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);\n overflow: hidden;\n transition:\n transform 120ms ease-out,\n border-color 120ms ease-out,\n box-shadow 120ms ease-out;\n }\n .card:hover {\n transform: translateY(-2px);\n border-color: rgba(255, 255, 255, 0.15);\n box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);\n }\n .card img {\n display: block;\n width: 100%;\n aspect-ratio: 4/3;\n object-fit: cover;\n background: #000;\n }\n .card .meta {\n padding: 12px 14px;\n }\n .card .title {\n font:\n 600 13px -apple-system,\n system-ui,\n sans-serif;\n color: #eee;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .card .updated {\n margin-top: 4px;\n font-size: 11px;\n color: #888;\n }\n </style>\n </head>\n <body>\n <header id=\"bar\">\n <span class=\"title\">IMG.LY CODESIGN MCP Workspace</span>\n </header>\n <div id=\"grid\" class=\"grid\"></div>\n <script type=\"module\" src=\"{{VIEWER_BASE}}/static/studio.js\"></script>\n </body>\n</html>\n`,\n\t\"studio.js\": `// Workspace overview landing page. Fetches /api/designs and renders one card\n// per design (keyed by root revision). Re-renders on tab focus and a 10s poll\n// so card links and thumbnails never go stale after the agent edits.\n//\n// DOM is built with createElement + textContent (never innerHTML for\n// design-supplied strings) so an author-controlled title can't escape into\n// HTML. Same pattern as viewer.js.\n\n// Mount prefix set by studio.html (\"\" on stdio, \"/viewer\" on HTTP); card\n// links, thumbnails, and the designs fetch are built relative to it. See\n// router.ts.\nconst BASE = window.__VIEWER_BASE__ ?? '';\n\nconst grid = document.getElementById('grid');\n\nfunction buildCard(d) {\n const card = document.createElement('a');\n card.className = 'card';\n card.href = \\`\\${BASE}/d/\\${d.rootRevision}\\`;\n\n const img = document.createElement('img');\n img.src = \\`\\${BASE}/snapshot/\\${d.latestLeaf}/thumbnail\\`;\n img.alt = '';\n img.addEventListener('error', () => {\n img.style.display = 'none';\n });\n card.appendChild(img);\n\n const meta = document.createElement('div');\n meta.className = 'meta';\n\n const title = document.createElement('div');\n title.className = 'title';\n title.textContent = d.title || 'Untitled';\n meta.appendChild(title);\n\n const updated = document.createElement('div');\n updated.className = 'updated';\n updated.textContent = \\`updated \\${new Date(d.updatedAt).toLocaleString()}\\`;\n meta.appendChild(updated);\n\n card.appendChild(meta);\n return card;\n}\n\nfunction renderEmptyText(text) {\n const div = document.createElement('div');\n div.className = 'empty';\n div.textContent = text;\n grid.replaceChildren(div);\n}\n\nfunction renderFirstRunEmpty() {\n const div = document.createElement('div');\n div.className = 'empty';\n div.appendChild(document.createTextNode('No designs yet — your first '));\n const code = document.createElement('code');\n code.textContent = 'edit({ parent: null, ... })';\n div.appendChild(code);\n div.appendChild(document.createTextNode(' will land here.'));\n grid.replaceChildren(div);\n}\n\nasync function render() {\n const res = await fetch(\\`\\${BASE}/api/designs\\`);\n if (!res.ok) {\n renderEmptyText(\\`failed to load designs: \\${res.status}\\`);\n return;\n }\n const designs = await res.json();\n if (designs.length === 0) {\n renderFirstRunEmpty();\n return;\n }\n grid.replaceChildren(...designs.map(buildCard));\n}\n\n// \\`render()\\` rejects on a network error; every caller logs it rather than\n// leaving an unhandled promise rejection.\nawait render().catch(console.error);\ndocument.addEventListener('visibilitychange', () => {\n if (!document.hidden) render().catch(console.error);\n});\nsetInterval(() => render().catch(console.error), 10000);\n`,\n\t\"viewer.js\": `// Read-only CE.SDK viewer with a revision-history side panel.\n// /d/<root> LIVE — opens at the design head, follows new revisions\n// /d/<root>/<rev> PINNED — opens frozen at <rev>\n//\n// Chrome is floating pill clusters in the corners; the history panel is a\n// detached card on the right.\n// See: docs/superpowers/specs/2026-05-24-viewer-ui-refresh-design.md\n//\n// Navigation is client-side: clicking a panel node (or the \"Go Live →\"\n// affordance) swaps the canvas and rewrites the URL via the History API — one\n// CE.SDK instance for the life of the tab. The SSE connection is held open\n// in BOTH modes so the panel's tree always stays fresh; it moves the canvas\n// only while \\`following\\`.\n\n// Mount prefix set by index.html (\"\" on stdio, \"/viewer\" on HTTP). Every\n// API/asset/history URL below is built relative to it so the SPA works under\n// any mount path. See router.ts.\nconst BASE = window.__VIEWER_BASE__ ?? '';\n\n// Path of the current page with the mount prefix stripped, so PATH_RE (which\n// is written relative to the SPA root) matches under \"/viewer\" too.\nconst relPath = () =>\n location.pathname.startsWith(BASE)\n ? location.pathname.slice(BASE.length)\n : location.pathname;\n\nconst { createRevisionPanel } = await import(\n \\`\\${BASE}/static/revision-panel.js\\`\n);\n\nconst PATH_RE = /^\\\\/d\\\\/([0-9a-f]{12})(?:\\\\/([0-9a-f]{12}))?$/;\nconst titleEl = document.getElementById('title');\nconst barRightEl = document.getElementById('bar-right');\nconst panelEl = document.getElementById('revision-panel');\n\nconst match = relPath().match(PATH_RE);\n\nif (!match) {\n titleEl.textContent = 'invalid URL';\n} else {\n const root = match[1];\n\n // Server-supplied license + resource base, fetched before bootstrapping\n // CE.SDK. CE.SDK validates the license regardless of role; \\`resourceBase\\`\n // is where workspace:// asset URIs resolve.\n const cfgRes = await fetch(\\`\\${BASE}/api/config\\`);\n if (!cfgRes.ok) throw new Error(\\`/api/config failed: \\${cfgRes.status}\\`);\n const { license, resourceBase } = await cfgRes.json();\n\n const cesdkMod =\n await import('https://cdn.img.ly/packages/imgly/cesdk-js/1.77.0-rc.4/index.js');\n const CreativeEditorSDK = cesdkMod.default ?? cesdkMod.CreativeEditorSDK;\n const instance = await CreativeEditorSDK.create(\n document.getElementById('cesdk'),\n {\n license,\n role: 'Viewer',\n theme: 'dark',\n // The refresh moved all chrome out of CE.SDK and into our own floating\n // pills + history panel — back / title / LIVE / Go Live / hash / History.\n // CE.SDK's own nav + dock would render in the same physical space and,\n // because #cesdk has no stacking context, their internal z-indexes\n // outrank our z:10 pills, hiding them. \\`ui.hide: true\\` disables the\n // CE.SDK chrome entirely; users keep mousewheel zoom + drag-to-pan via\n // the engine, which is unaffected.\n ui: { hide: true }\n }\n );\n\n // Resolve workspace:// asset URIs to the /r/ HTTP route.\n const absResourceBase = location.origin + resourceBase;\n instance.engine.editor.setURIResolver((uri, defaultResolver) =>\n uri.startsWith('workspace://')\n ? absResourceBase + uri.slice('workspace://'.length)\n : defaultResolver(uri)\n );\n\n // --- runtime state ----------------------------------------------------\n let head = null; // the design's latest leaf\n let currentRev = null; // the revision currently on canvas\n let following = false; // true → the canvas tracks head as SSE arrives\n let newCount = 0; // revisions arrived since following stopped\n let panelOpen = false; // whether the history panel is visible\n\n async function loadRevision(rev) {\n const res = await fetch(\\`\\${BASE}/snapshot/\\${rev}\\`);\n if (!res.ok) throw new Error(\\`snapshot \\${rev} \\${res.status}\\`);\n const snap = await res.json();\n await instance.engine.scene.loadFromString(snap.scene);\n titleEl.textContent = snap.title ?? 'Untitled';\n }\n\n // Builds the right-side cluster from current state. Idempotent — called on\n // every mode flip, panel toggle, and newCount change. Uses createElement +\n // textContent everywhere (never innerHTML) so any author-supplied strings\n // can't escape into HTML.\n function renderRightCluster() {\n const nodes = [];\n\n if (following) {\n // LIVE — read-only green-dot pill.\n const live = document.createElement('span');\n live.className = 'pill live';\n live.textContent = 'LIVE';\n nodes.push(live);\n } else {\n // PINNED — hash chip (click-to-copy) + Go Live (+ count badge).\n const hash = document.createElement('button');\n hash.type = 'button';\n hash.className = 'pill hash';\n hash.title = 'copy revision id';\n hash.textContent = currentRev ? currentRev.slice(0, 7) : '';\n hash.addEventListener('click', async () => {\n if (!currentRev) return;\n try {\n await navigator.clipboard?.writeText(currentRev);\n } catch {\n /* clipboard unavailable — fail quietly (matches .rp-copy) */\n }\n });\n nodes.push(hash);\n\n const golive = document.createElement('button');\n golive.type = 'button';\n golive.className = 'pill golive';\n golive.appendChild(document.createTextNode('Go Live →'));\n if (newCount > 0) {\n const count = document.createElement('span');\n count.className = 'count';\n count.textContent = String(newCount);\n golive.appendChild(count);\n }\n golive.addEventListener('click', (e) => {\n if (e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey)\n return;\n e.preventDefault();\n if (head) show(head, { following: true, historyMode: 'push' });\n });\n nodes.push(golive);\n }\n\n const history = document.createElement('button');\n history.type = 'button';\n history.className = \\`pill history\\${panelOpen ? ' active' : ''}\\`;\n history.textContent = 'History';\n history.addEventListener('click', () => setPanelOpen(!panelOpen));\n nodes.push(history);\n\n barRightEl.replaceChildren(...nodes);\n }\n\n function setPanelOpen(open) {\n panelOpen = open;\n document.body.classList.toggle('panel-open', open);\n renderRightCluster();\n }\n\n // The single navigation primitive. Loads \\`rev\\` onto the canvas, sets the\n // LIVE/PINNED state, and writes the URL. \\`historyMode\\`: \"push\" adds a\n // history entry, \"replace\" rewrites in place, \"none\" leaves history alone\n // (used by popstate, where the browser already changed the URL).\n async function show(rev, { following: nextFollowing, historyMode }) {\n try {\n await loadRevision(rev);\n currentRev = rev;\n following = nextFollowing;\n if (following) newCount = 0;\n const url = following ? \\`\\${BASE}/d/\\${root}\\` : \\`\\${BASE}/d/\\${root}/\\${rev}\\`;\n if (historyMode === 'push') window.history.pushState({ rev }, '', url);\n else if (historyMode === 'replace')\n window.history.replaceState({ rev }, '', url);\n panel.setCurrent(rev);\n } catch {\n titleEl.textContent = 'unknown revision';\n }\n renderRightCluster();\n }\n\n // --- revision panel ---------------------------------------------------\n const panel = createRevisionPanel({\n container: panelEl,\n root,\n // Clicking a node pins it — unless it is the head, which is LIVE.\n onNavigate: (rev) =>\n show(rev, { following: rev === head, historyMode: 'push' }),\n onCount: () => {\n /* The History pill no longer carries the total count; the unseen-since-\n\t\t\t pin count lives on Go Live and is driven by \\`newCount\\` directly. */\n }\n });\n\n // --- keyboard ---------------------------------------------------------\n window.addEventListener('keydown', (e) => {\n if (e.key === 'Escape' && panelOpen) setPanelOpen(false);\n });\n\n // --- bootstrap --------------------------------------------------------\n let latestLeaf;\n try {\n const res = await fetch(\\`\\${BASE}/api/design/\\${root}\\`);\n if (!res.ok) throw new Error(String(res.status));\n latestLeaf = (await res.json()).latestLeaf;\n } catch {\n titleEl.textContent = 'unknown design';\n }\n\n if (latestLeaf !== undefined) {\n head = latestLeaf;\n const pinned = match[2]; // undefined → LIVE\n // Mode is the URL shape: a pinned URL stays pinned even if <rev> is head.\n await show(pinned ?? head, {\n following: pinned === undefined,\n historyMode: 'replace'\n });\n\n // SSE — held open for the life of the tab, in both modes. Every event\n // refreshes the panel's tree; it moves the canvas only while following.\n const es = new EventSource(\\`\\${BASE}/sse/\\${root}\\`);\n es.onmessage = (ev) => {\n let payload;\n try {\n payload = JSON.parse(ev.data);\n } catch (err) {\n console.error('sse parse failed', err);\n return;\n }\n if (!payload || typeof payload.revision !== 'string') return;\n head = payload.revision;\n panel.refresh();\n if (following) {\n show(head, { following: true, historyMode: 'replace' });\n } else {\n newCount += 1;\n renderRightCluster();\n }\n };\n }\n\n // Browser back/forward: re-resolve the URL shape and sync, without writing\n // history (the entry already changed).\n window.addEventListener('popstate', () => {\n const m = relPath().match(PATH_RE);\n if (!m || m[1] !== root) return;\n const pinned = m[2];\n show(pinned ?? head, {\n following: pinned === undefined,\n historyMode: 'none'\n });\n });\n}\n`,\n};\n"]}
1
+ {"version":3,"file":"spa-assets.generated.js","sourceRoot":"","sources":["../../src/viewer/spa-assets.generated.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,CAAC,MAAM,UAAU,GAA2B;IACjD,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2Td;IACA,mBAAmB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwMrB;IACA,aAAa,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmIf;IACA,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoFb;IACA,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyPb;CACA,CAAC","sourcesContent":["// AUTO-GENERATED by scripts/generate-spa-assets.mjs. Do not edit by hand.\nexport const SPA_ASSETS: Record<string, string> = {\n\t\"index.html\": `<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <title>codesign viewer</title>\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />\n <!-- Mount prefix injected by the viewer router (router.ts). \"\" on the stdio\n listener, \"/viewer\" on the HTTP transport. Read by viewer.js. -->\n <script>\n window.__VIEWER_BASE__ = '{{VIEWER_BASE}}';\n </script>\n <style>\n /* -------- reset & canvas -------- */\n html,\n body {\n margin: 0;\n padding: 0;\n height: 100%;\n width: 100%;\n background: #1d1d1f;\n color: #eee;\n font-family: -apple-system, system-ui, sans-serif;\n }\n #cesdk {\n position: fixed;\n inset: 0;\n }\n\n /* -------- pill base (spec §7) -------- */\n .pill {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 6px 11px;\n border-radius: 999px;\n font:\n 500 12px -apple-system,\n system-ui,\n sans-serif;\n color: #e8e8e8;\n background: rgba(20, 20, 22, 0.72);\n backdrop-filter: blur(12px);\n -webkit-backdrop-filter: blur(12px);\n border: 1px solid rgba(255, 255, 255, 0.08);\n box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);\n text-decoration: none;\n cursor: pointer;\n white-space: nowrap;\n }\n .pill.icon {\n padding: 6px 9px;\n }\n .pill:hover {\n background: rgba(30, 30, 33, 0.82);\n }\n\n /* -------- cluster anchors -------- */\n #bar-left,\n #bar-right {\n position: fixed;\n top: 14px;\n z-index: 10;\n display: flex;\n gap: 8px;\n }\n #bar-left {\n left: 14px;\n }\n #bar-right {\n right: 14px;\n }\n\n /* -------- title pill --------\n\t\t\t Non-interactive (no click handler) — override .pill's cursor + hover so\n\t\t\t the title visually matches its actual behavior. For a local MCP the URL\n\t\t\t isn't shareable, so there's nothing useful to copy. Revisit when a\n\t\t\t remote MCP ships — copy-share-URL is the natural fit there. */\n #title {\n font-weight: 600;\n max-width: 240px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n cursor: default;\n }\n #title:hover {\n background: rgba(20, 20, 22, 0.72);\n }\n\n /* -------- LIVE pill (read-only) -------- */\n .pill.live {\n color: #c8e6c9;\n cursor: default;\n }\n .pill.live:hover {\n background: rgba(20, 20, 22, 0.72);\n }\n .pill.live::before {\n content: '';\n width: 6px;\n height: 6px;\n border-radius: 999px;\n background: #34c759;\n box-shadow: 0 0 5px rgba(52, 199, 89, 0.55);\n }\n\n /* -------- hash chip -------- */\n .pill.hash {\n font-family: ui-monospace, monospace;\n font-size: 11px;\n color: #b8b8b8;\n }\n\n /* -------- Go Live pill + count badge -------- */\n .pill.golive {\n color: #9ec8ff;\n }\n .pill.golive .count {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 16px;\n height: 16px;\n padding: 0 4px;\n border-radius: 999px;\n background: #2b6cb0;\n color: #fff;\n font-size: 10px;\n font-weight: 600;\n margin-left: 4px;\n }\n\n /* -------- History pill -------- */\n .pill.history::before {\n content: '⎇';\n opacity: 0.8;\n }\n .pill.history.active,\n .pill.history.active:hover {\n background: rgba(43, 108, 176, 0.85);\n border-color: rgba(43, 108, 176, 0.95);\n color: #fff;\n }\n\n /* -------- floating history panel (spec §6) -------- */\n #revision-panel {\n position: fixed;\n top: 62px;\n right: 14px;\n bottom: 14px;\n width: 280px;\n background: rgba(20, 20, 22, 0.88);\n backdrop-filter: blur(16px);\n -webkit-backdrop-filter: blur(16px);\n border: 1px solid rgba(255, 255, 255, 0.08);\n border-radius: 12px;\n box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);\n box-sizing: border-box;\n overflow-y: auto;\n display: none;\n opacity: 0;\n transform: translateX(8px);\n z-index: 10;\n }\n body.panel-open #revision-panel {\n display: block;\n }\n @media (prefers-reduced-motion: no-preference) {\n #revision-panel {\n transition:\n opacity 160ms ease-out,\n transform 160ms ease-out;\n }\n body.panel-open #revision-panel {\n opacity: 1;\n transform: translateX(0);\n }\n }\n @media (prefers-reduced-motion: reduce) {\n body.panel-open #revision-panel {\n opacity: 1;\n transform: none;\n }\n }\n\n /* -------- panel internals (polish pass) -------- */\n .rp-header {\n padding: 12px 14px 10px;\n font-size: 10px;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n color: #888;\n border-bottom: 1px solid rgba(255, 255, 255, 0.06);\n }\n .rp-tree {\n padding: 8px 6px;\n }\n .rp-empty {\n padding: 16px 14px;\n font-size: 12px;\n color: #888;\n }\n\n .rp-node {\n display: block;\n text-decoration: none;\n color: inherit;\n padding: 6px 8px;\n border-radius: 6px;\n }\n .rp-node:hover {\n background: rgba(255, 255, 255, 0.04);\n }\n .rp-node.rp-current {\n background: rgba(30, 47, 68, 0.6);\n box-shadow: inset 2px 0 0 #4a9eff;\n }\n .rp-node-row {\n display: flex;\n gap: 8px;\n align-items: baseline;\n }\n .rp-elbow {\n color: #555;\n flex: none;\n }\n .rp-dot {\n flex: none;\n width: 12px;\n text-align: center;\n font-size: 10px;\n color: #888;\n }\n .rp-node.rp-head .rp-dot {\n color: #4a9eff;\n }\n .rp-node.rp-branch .rp-dot {\n color: #d6973f;\n }\n .rp-body {\n flex: 1;\n min-width: 0;\n }\n .rp-id {\n display: flex;\n align-items: center;\n gap: 6px;\n font-family: ui-monospace, monospace;\n font-size: 10px;\n color: #888;\n }\n .rp-tag {\n border: 1px solid rgba(255, 255, 255, 0.1);\n border-radius: 4px;\n padding: 0 4px;\n font-size: 9px;\n }\n .rp-tag.rp-tag-head {\n background: rgba(43, 108, 176, 0.85);\n border-color: rgba(43, 108, 176, 0.95);\n color: #fff;\n }\n .rp-tag.rp-tag-fork {\n color: #d6973f;\n border-color: rgba(214, 151, 63, 0.35);\n }\n .rp-note {\n font-size: 12px;\n color: #eee;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n .rp-time {\n font-size: 10px;\n color: #777;\n }\n .rp-node.rp-current .rp-time::after {\n content: ' · on canvas';\n color: #4a9eff;\n }\n .rp-copy {\n font: inherit;\n font-size: 9px;\n color: #ccc;\n background: rgba(20, 20, 22, 0.72);\n border: 1px solid rgba(255, 255, 255, 0.08);\n border-radius: 999px;\n padding: 2px 7px;\n cursor: pointer;\n opacity: 0;\n margin-left: auto;\n transition:\n opacity 120ms ease-out,\n background 120ms ease-out;\n }\n .rp-node:hover .rp-copy {\n opacity: 1;\n }\n .rp-copy:hover {\n background: rgba(30, 30, 33, 0.82);\n }\n </style>\n </head>\n <body>\n <div id=\"cesdk\"></div>\n <div id=\"bar-left\">\n <a id=\"back\" class=\"pill icon\" href=\"{{VIEWER_BASE}}/\">←</a>\n <span id=\"title\" class=\"pill\">loading…</span>\n </div>\n <div id=\"bar-right\"></div>\n <aside id=\"revision-panel\"></aside>\n <script type=\"module\" src=\"{{VIEWER_BASE}}/static/viewer.js\"></script>\n </body>\n</html>\n`,\n\t\"revision-panel.js\": `// revision-panel.js — the in-viewer revision history panel. Fetches a design's\n// full revision tree from /api/design/<root>/revisions and renders it; clicking\n// a node asks the viewer to navigate there. The viewer drives setCurrent()\n// (highlight) and refresh() (re-fetch on SSE).\n//\n// All DOM is built with createElement + textContent: revision notes are\n// agent-authored text and must never reach innerHTML.\n\n// Mount prefix set by index.html (\"\" on stdio, \"/viewer\" on HTTP); node hrefs\n// and the revisions fetch are built relative to it. See router.ts.\nconst BASE = window.__VIEWER_BASE__ ?? '';\n\nexport function createRevisionPanel({ container, root, onNavigate, onCount }) {\n let currentRev = null;\n\n function relTime(ms) {\n const s = Math.max(0, Math.round((Date.now() - ms) / 1000));\n if (s < 60) return \\`\\${s}s ago\\`;\n const m = Math.round(s / 60);\n if (m < 60) return \\`\\${m}m ago\\`;\n const h = Math.round(m / 60);\n if (h < 24) return \\`\\${h}h ago\\`;\n return \\`\\${Math.round(h / 24)}d ago\\`;\n }\n\n // Depth-first walk. At each node the spine child (or, off-spine, the latest\n // child) continues at the same depth; other children are branches at\n // depth + 1, emitted before the continuation so the spine reads top-to-bottom.\n function order(nodes) {\n const byId = new Map(nodes.map((n) => [n.id, n]));\n const children = new Map();\n for (const n of nodes) {\n if (n.parent != null) {\n const sibs = children.get(n.parent) ?? [];\n sibs.push(n);\n children.set(n.parent, sibs);\n }\n }\n for (const sibs of children.values())\n sibs.sort((a, b) => a.createdAt - b.createdAt);\n const rootNode = nodes.find((n) => n.parent === null);\n const head = nodes.reduce((a, b) => (b.createdAt > a.createdAt ? b : a));\n const spine = new Set();\n for (let n = head; n; n = n.parent != null ? byId.get(n.parent) : null)\n spine.add(n.id);\n const out = [];\n function walk(node, depth) {\n out.push({\n node,\n depth,\n isHead: node.id === head.id,\n isRoot: node.parent === null\n });\n const kids = children.get(node.id) ?? [];\n if (kids.length === 0) return;\n const primary =\n kids.find((k) => spine.has(k.id)) ?? kids[kids.length - 1];\n for (const k of kids) if (k !== primary) walk(k, depth + 1);\n walk(primary, depth);\n }\n if (rootNode) walk(rootNode, 0);\n return out;\n }\n\n function tag(text, cls) {\n const el = document.createElement('span');\n el.className = cls ? \\`rp-tag \\${cls}\\` : 'rp-tag';\n el.textContent = text;\n return el;\n }\n\n function makeNode({ node, depth, isHead, isRoot }) {\n const a = document.createElement('a');\n a.className = \\`rp-node\\${depth > 0 ? ' rp-branch' : ''}\\${isHead ? ' rp-head' : ''}\\`;\n if (isRoot) a.dataset.root = '';\n a.dataset.rev = node.id;\n a.href = \\`\\${BASE}/d/\\${root}/\\${node.id}\\`;\n a.style.marginLeft = \\`\\${depth * 16}px\\`;\n if (node.id === currentRev) a.classList.add('rp-current');\n\n const row = document.createElement('div');\n row.className = 'rp-node-row';\n if (depth > 0) {\n const elbow = document.createElement('span');\n elbow.className = 'rp-elbow';\n elbow.textContent = '└';\n row.appendChild(elbow);\n }\n const dot = document.createElement('span');\n dot.className = 'rp-dot';\n dot.textContent = '●';\n row.appendChild(dot);\n\n const body = document.createElement('div');\n body.className = 'rp-body';\n\n const idLine = document.createElement('div');\n idLine.className = 'rp-id';\n const idText = document.createElement('span');\n idText.textContent = node.id.slice(0, 7);\n idLine.appendChild(idText);\n if (isRoot) idLine.appendChild(tag('root', ''));\n if (isHead) idLine.appendChild(tag('head', 'rp-tag-head'));\n if (depth > 0) idLine.appendChild(tag('⑂ fork', 'rp-tag-fork'));\n\n const copy = document.createElement('button');\n copy.type = 'button';\n copy.className = 'rp-copy';\n copy.textContent = '⧉ copy id';\n copy.addEventListener('click', async (e) => {\n e.preventDefault();\n e.stopPropagation();\n try {\n await navigator.clipboard?.writeText(node.id);\n copy.textContent = 'copied';\n setTimeout(() => {\n copy.textContent = '⧉ copy id';\n }, 1200);\n } catch {\n /* clipboard unavailable — fail quietly (spec §6) */\n }\n });\n idLine.appendChild(copy);\n body.appendChild(idLine);\n\n const note = document.createElement('div');\n note.className = 'rp-note';\n note.textContent = node.note || '(no note)';\n note.title = node.note || '';\n body.appendChild(note);\n\n const time = document.createElement('div');\n time.className = 'rp-time';\n time.textContent = relTime(node.createdAt);\n body.appendChild(time);\n\n row.appendChild(body);\n a.appendChild(row);\n\n a.addEventListener('click', (e) => {\n // Modified clicks (⌘/Ctrl/Shift/middle) fall through to the browser,\n // which opens the pinned /d/<root>/<rev> href in a new tab.\n if (e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey)\n return;\n e.preventDefault();\n onNavigate(node.id);\n });\n return a;\n }\n\n function paint(nodes) {\n container.replaceChildren();\n const header = document.createElement('div');\n header.className = 'rp-header';\n header.textContent = 'Revisions';\n container.appendChild(header);\n if (nodes.length === 0) {\n const empty = document.createElement('div');\n empty.className = 'rp-empty';\n empty.textContent = 'no revisions yet';\n container.appendChild(empty);\n return;\n }\n const tree = document.createElement('div');\n tree.className = 'rp-tree';\n for (const item of order(nodes)) tree.appendChild(makeNode(item));\n container.appendChild(tree);\n }\n\n function showError(message) {\n container.replaceChildren();\n const el = document.createElement('div');\n el.className = 'rp-empty';\n el.textContent = message;\n container.appendChild(el);\n }\n\n async function refresh() {\n try {\n const res = await fetch(\\`\\${BASE}/api/design/\\${root}/revisions\\`);\n if (!res.ok) throw new Error(String(res.status));\n const nodes = await res.json();\n paint(nodes);\n onCount(nodes.length);\n } catch {\n showError(\"couldn't load history\");\n onCount(0);\n }\n }\n\n function setCurrent(rev) {\n currentRev = rev;\n for (const el of container.querySelectorAll('.rp-node')) {\n el.classList.toggle('rp-current', el.dataset.rev === rev);\n }\n }\n\n refresh();\n return { setCurrent, refresh };\n}\n`,\n\t\"studio.html\": `<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <title>IMG.LY CODESIGN MCP Workspace</title>\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />\n <!-- Mount prefix injected by the viewer router (router.ts). \"\" on the stdio\n listener, \"/viewer\" on the HTTP transport. Read by studio.js. -->\n <script>\n window.__VIEWER_BASE__ = '{{VIEWER_BASE}}';\n </script>\n <style>\n /* -------- reset --------\n\t\t\t Same palette + typography as the viewer SPA so the overview reads\n\t\t\t as part of the same product. See src/viewer/spa/index.html. */\n html,\n body {\n margin: 0;\n padding: 0;\n min-height: 100%;\n background: #1d1d1f;\n color: #eee;\n font-family: -apple-system, system-ui, sans-serif;\n }\n\n /* -------- sticky frosted strip --------\n\t\t\t Same frosted-glass material as the viewer pills + history panel:\n\t\t\t translucent dark + backdrop-blur + 1px hairline border. Sticky so\n\t\t\t the title stays visible while scrolling. */\n #bar {\n position: sticky;\n top: 0;\n z-index: 10;\n padding: 14px 24px;\n background: rgba(20, 20, 22, 0.72);\n backdrop-filter: blur(12px);\n -webkit-backdrop-filter: blur(12px);\n border-bottom: 1px solid rgba(255, 255, 255, 0.08);\n }\n #bar .title {\n font:\n 600 14px -apple-system,\n system-ui,\n sans-serif;\n letter-spacing: 0.02em;\n color: #e8e8e8;\n }\n\n /* -------- design grid -------- */\n .grid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));\n gap: 16px;\n padding: 24px;\n }\n\n .empty {\n padding: 24px 4px;\n font-size: 13px;\n color: #888;\n }\n .empty code {\n font-family: ui-monospace, monospace;\n background: rgba(255, 255, 255, 0.05);\n border: 1px solid rgba(255, 255, 255, 0.08);\n border-radius: 4px;\n padding: 1px 6px;\n font-size: 12px;\n color: #cfcfcf;\n }\n\n /* -------- card --------\n\t\t\t Frosted-glass card, same materials as the history panel rows.\n\t\t\t Hover lifts the card and brightens the border + shadow to match the\n\t\t\t pill-hover pattern in the viewer chrome. */\n .card {\n display: block;\n text-decoration: none;\n color: inherit;\n background: rgba(20, 20, 22, 0.72);\n backdrop-filter: blur(12px);\n -webkit-backdrop-filter: blur(12px);\n border: 1px solid rgba(255, 255, 255, 0.08);\n border-radius: 12px;\n box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);\n overflow: hidden;\n transition:\n transform 120ms ease-out,\n border-color 120ms ease-out,\n box-shadow 120ms ease-out;\n }\n .card:hover {\n transform: translateY(-2px);\n border-color: rgba(255, 255, 255, 0.15);\n box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);\n }\n .card img {\n display: block;\n width: 100%;\n aspect-ratio: 4/3;\n object-fit: cover;\n background: #000;\n }\n .card .meta {\n padding: 12px 14px;\n }\n .card .title {\n font:\n 600 13px -apple-system,\n system-ui,\n sans-serif;\n color: #eee;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .card .updated {\n margin-top: 4px;\n font-size: 11px;\n color: #888;\n }\n </style>\n </head>\n <body>\n <header id=\"bar\">\n <span class=\"title\">IMG.LY CODESIGN MCP Workspace</span>\n </header>\n <div id=\"grid\" class=\"grid\"></div>\n <script type=\"module\" src=\"{{VIEWER_BASE}}/static/studio.js\"></script>\n </body>\n</html>\n`,\n\t\"studio.js\": `// Workspace overview landing page. Fetches /api/designs and renders one card\n// per design (keyed by root revision). Re-renders on tab focus and a 10s poll\n// so card links and thumbnails never go stale after the agent edits.\n//\n// DOM is built with createElement + textContent (never innerHTML for\n// design-supplied strings) so an author-controlled title can't escape into\n// HTML. Same pattern as viewer.js.\n\n// Mount prefix set by studio.html (\"\" on stdio, \"/viewer\" on HTTP); card\n// links, thumbnails, and the designs fetch are built relative to it. See\n// router.ts.\nconst BASE = window.__VIEWER_BASE__ ?? '';\n\nconst grid = document.getElementById('grid');\n\nfunction buildCard(d) {\n const card = document.createElement('a');\n card.className = 'card';\n card.href = \\`\\${BASE}/d/\\${d.rootRevision}\\`;\n\n const img = document.createElement('img');\n img.src = \\`\\${BASE}/snapshot/\\${d.latestLeaf}/thumbnail\\`;\n img.alt = '';\n img.addEventListener('error', () => {\n img.style.display = 'none';\n });\n card.appendChild(img);\n\n const meta = document.createElement('div');\n meta.className = 'meta';\n\n const title = document.createElement('div');\n title.className = 'title';\n title.textContent = d.title || 'Untitled';\n meta.appendChild(title);\n\n const updated = document.createElement('div');\n updated.className = 'updated';\n updated.textContent = \\`updated \\${new Date(d.updatedAt).toLocaleString()}\\`;\n meta.appendChild(updated);\n\n card.appendChild(meta);\n return card;\n}\n\nfunction renderEmptyText(text) {\n const div = document.createElement('div');\n div.className = 'empty';\n div.textContent = text;\n grid.replaceChildren(div);\n}\n\nfunction renderFirstRunEmpty() {\n const div = document.createElement('div');\n div.className = 'empty';\n div.appendChild(document.createTextNode('No designs yet — your first '));\n const code = document.createElement('code');\n code.textContent = 'edit({ parent: null, ... })';\n div.appendChild(code);\n div.appendChild(document.createTextNode(' will land here.'));\n grid.replaceChildren(div);\n}\n\nasync function render() {\n const res = await fetch(\\`\\${BASE}/api/designs\\`);\n if (!res.ok) {\n renderEmptyText(\\`failed to load designs: \\${res.status}\\`);\n return;\n }\n const designs = await res.json();\n if (designs.length === 0) {\n renderFirstRunEmpty();\n return;\n }\n grid.replaceChildren(...designs.map(buildCard));\n}\n\n// \\`render()\\` rejects on a network error; every caller logs it rather than\n// leaving an unhandled promise rejection.\nawait render().catch(console.error);\ndocument.addEventListener('visibilitychange', () => {\n if (!document.hidden) render().catch(console.error);\n});\nsetInterval(() => render().catch(console.error), 10000);\n`,\n\t\"viewer.js\": `// Read-only CE.SDK viewer with a revision-history side panel.\n// /d/<root> LIVE — opens at the design head, follows new revisions\n// /d/<root>/<rev> PINNED — opens frozen at <rev>\n//\n// Chrome is floating pill clusters in the corners; the history panel is a\n// detached card on the right.\n// See: docs/superpowers/specs/2026-05-24-viewer-ui-refresh-design.md\n//\n// Navigation is client-side: clicking a panel node (or the \"Go Live →\"\n// affordance) swaps the canvas and rewrites the URL via the History API — one\n// CE.SDK instance for the life of the tab. The SSE connection is held open\n// in BOTH modes so the panel's tree always stays fresh; it moves the canvas\n// only while \\`following\\`.\n\n// Mount prefix set by index.html (\"\" on stdio, \"/viewer\" on HTTP). Every\n// API/asset/history URL below is built relative to it so the SPA works under\n// any mount path. See router.ts.\nconst BASE = window.__VIEWER_BASE__ ?? '';\n\n// Path of the current page with the mount prefix stripped, so PATH_RE (which\n// is written relative to the SPA root) matches under \"/viewer\" too.\nconst relPath = () =>\n location.pathname.startsWith(BASE)\n ? location.pathname.slice(BASE.length)\n : location.pathname;\n\nconst { createRevisionPanel } = await import(\n \\`\\${BASE}/static/revision-panel.js\\`\n);\n\nconst PATH_RE = /^\\\\/d\\\\/([0-9a-f]{12})(?:\\\\/([0-9a-f]{12}))?$/;\nconst titleEl = document.getElementById('title');\nconst barRightEl = document.getElementById('bar-right');\nconst panelEl = document.getElementById('revision-panel');\n\nconst match = relPath().match(PATH_RE);\n\nif (!match) {\n titleEl.textContent = 'invalid URL';\n} else {\n const root = match[1];\n\n // Server-supplied license + resource base, fetched before bootstrapping\n // CE.SDK. CE.SDK validates the license regardless of role; \\`resourceBase\\`\n // is where workspace:// asset URIs resolve.\n const cfgRes = await fetch(\\`\\${BASE}/api/config\\`);\n if (!cfgRes.ok) throw new Error(\\`/api/config failed: \\${cfgRes.status}\\`);\n const { license, resourceBase, cesdkEngineUrl } = await cfgRes.json();\n\n const cesdkMod = await import(cesdkEngineUrl);\n const CreativeEditorSDK = cesdkMod.default ?? cesdkMod.CreativeEditorSDK;\n const instance = await CreativeEditorSDK.create(\n document.getElementById('cesdk'),\n {\n license,\n role: 'Viewer',\n theme: 'dark',\n // The refresh moved all chrome out of CE.SDK and into our own floating\n // pills + history panel — back / title / LIVE / Go Live / hash / History.\n // CE.SDK's own nav + dock would render in the same physical space and,\n // because #cesdk has no stacking context, their internal z-indexes\n // outrank our z:10 pills, hiding them. \\`ui.hide: true\\` disables the\n // CE.SDK chrome entirely; users keep mousewheel zoom + drag-to-pan via\n // the engine, which is unaffected.\n ui: { hide: true }\n }\n );\n\n // Resolve workspace:// asset URIs to the /r/ HTTP route.\n const absResourceBase = location.origin + resourceBase;\n instance.engine.editor.setURIResolver((uri, defaultResolver) =>\n uri.startsWith('workspace://')\n ? absResourceBase + uri.slice('workspace://'.length)\n : defaultResolver(uri)\n );\n\n // --- runtime state ----------------------------------------------------\n let head = null; // the design's latest leaf\n let currentRev = null; // the revision currently on canvas\n let following = false; // true → the canvas tracks head as SSE arrives\n let newCount = 0; // revisions arrived since following stopped\n let panelOpen = false; // whether the history panel is visible\n\n async function loadRevision(rev) {\n const res = await fetch(\\`\\${BASE}/snapshot/\\${rev}\\`);\n if (!res.ok) throw new Error(\\`snapshot \\${rev} \\${res.status}\\`);\n const snap = await res.json();\n await instance.engine.scene.loadFromString(snap.scene);\n titleEl.textContent = snap.title ?? 'Untitled';\n }\n\n // Builds the right-side cluster from current state. Idempotent — called on\n // every mode flip, panel toggle, and newCount change. Uses createElement +\n // textContent everywhere (never innerHTML) so any author-supplied strings\n // can't escape into HTML.\n function renderRightCluster() {\n const nodes = [];\n\n if (following) {\n // LIVE — read-only green-dot pill.\n const live = document.createElement('span');\n live.className = 'pill live';\n live.textContent = 'LIVE';\n nodes.push(live);\n } else {\n // PINNED — hash chip (click-to-copy) + Go Live (+ count badge).\n const hash = document.createElement('button');\n hash.type = 'button';\n hash.className = 'pill hash';\n hash.title = 'copy revision id';\n hash.textContent = currentRev ? currentRev.slice(0, 7) : '';\n hash.addEventListener('click', async () => {\n if (!currentRev) return;\n try {\n await navigator.clipboard?.writeText(currentRev);\n } catch {\n /* clipboard unavailable — fail quietly (matches .rp-copy) */\n }\n });\n nodes.push(hash);\n\n const golive = document.createElement('button');\n golive.type = 'button';\n golive.className = 'pill golive';\n golive.appendChild(document.createTextNode('Go Live →'));\n if (newCount > 0) {\n const count = document.createElement('span');\n count.className = 'count';\n count.textContent = String(newCount);\n golive.appendChild(count);\n }\n golive.addEventListener('click', (e) => {\n if (e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey)\n return;\n e.preventDefault();\n if (head) show(head, { following: true, historyMode: 'push' });\n });\n nodes.push(golive);\n }\n\n const history = document.createElement('button');\n history.type = 'button';\n history.className = \\`pill history\\${panelOpen ? ' active' : ''}\\`;\n history.textContent = 'History';\n history.addEventListener('click', () => setPanelOpen(!panelOpen));\n nodes.push(history);\n\n barRightEl.replaceChildren(...nodes);\n }\n\n function setPanelOpen(open) {\n panelOpen = open;\n document.body.classList.toggle('panel-open', open);\n renderRightCluster();\n }\n\n // The single navigation primitive. Loads \\`rev\\` onto the canvas, sets the\n // LIVE/PINNED state, and writes the URL. \\`historyMode\\`: \"push\" adds a\n // history entry, \"replace\" rewrites in place, \"none\" leaves history alone\n // (used by popstate, where the browser already changed the URL).\n async function show(rev, { following: nextFollowing, historyMode }) {\n try {\n await loadRevision(rev);\n currentRev = rev;\n following = nextFollowing;\n if (following) newCount = 0;\n const url = following ? \\`\\${BASE}/d/\\${root}\\` : \\`\\${BASE}/d/\\${root}/\\${rev}\\`;\n if (historyMode === 'push') window.history.pushState({ rev }, '', url);\n else if (historyMode === 'replace')\n window.history.replaceState({ rev }, '', url);\n panel.setCurrent(rev);\n } catch {\n titleEl.textContent = 'unknown revision';\n }\n renderRightCluster();\n }\n\n // --- revision panel ---------------------------------------------------\n const panel = createRevisionPanel({\n container: panelEl,\n root,\n // Clicking a node pins it — unless it is the head, which is LIVE.\n onNavigate: (rev) =>\n show(rev, { following: rev === head, historyMode: 'push' }),\n onCount: () => {\n /* The History pill no longer carries the total count; the unseen-since-\n\t\t\t pin count lives on Go Live and is driven by \\`newCount\\` directly. */\n }\n });\n\n // --- keyboard ---------------------------------------------------------\n window.addEventListener('keydown', (e) => {\n if (e.key === 'Escape' && panelOpen) setPanelOpen(false);\n });\n\n // --- bootstrap --------------------------------------------------------\n let latestLeaf;\n try {\n const res = await fetch(\\`\\${BASE}/api/design/\\${root}\\`);\n if (!res.ok) throw new Error(String(res.status));\n latestLeaf = (await res.json()).latestLeaf;\n } catch {\n titleEl.textContent = 'unknown design';\n }\n\n if (latestLeaf !== undefined) {\n head = latestLeaf;\n const pinned = match[2]; // undefined → LIVE\n // Mode is the URL shape: a pinned URL stays pinned even if <rev> is head.\n await show(pinned ?? head, {\n following: pinned === undefined,\n historyMode: 'replace'\n });\n\n // SSE — held open for the life of the tab, in both modes. Every event\n // refreshes the panel's tree; it moves the canvas only while following.\n const es = new EventSource(\\`\\${BASE}/sse/\\${root}\\`);\n es.onmessage = (ev) => {\n let payload;\n try {\n payload = JSON.parse(ev.data);\n } catch (err) {\n console.error('sse parse failed', err);\n return;\n }\n if (!payload || typeof payload.revision !== 'string') return;\n head = payload.revision;\n panel.refresh();\n if (following) {\n show(head, { following: true, historyMode: 'replace' });\n } else {\n newCount += 1;\n renderRightCluster();\n }\n };\n }\n\n // Browser back/forward: re-resolve the URL shape and sync, without writing\n // history (the entry already changed).\n window.addEventListener('popstate', () => {\n const m = relPath().match(PATH_RE);\n if (!m || m[1] !== root) return;\n const pinned = m[2];\n show(pinned ?? head, {\n following: pinned === undefined,\n historyMode: 'none'\n });\n });\n}\n`,\n};\n"]}
@@ -0,0 +1,2 @@
1
+ export declare function shortHash(bytes: Uint8Array): Promise<string>;
2
+ //# sourceMappingURL=content-hash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-hash.d.ts","sourceRoot":"","sources":["../../src/workspace/content-hash.ts"],"names":[],"mappings":"AAOA,wBAAsB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAMlE"}
@@ -0,0 +1,15 @@
1
+ //
2
+ // Content-addressing hash for the workspace `assets/<sha>.<ext>` store.
3
+ // 6 bytes of SHA-256 as hex — short enough for readable paths, collision-safe
4
+ // at this workspace's scale. Shared by asset_generate and load so identical
5
+ // bytes land at the identical path (automatic dedup) regardless of which tool
6
+ // wrote them.
7
+ export async function shortHash(bytes) {
8
+ const digest = await globalThis.crypto.subtle.digest('SHA-256', bytes);
9
+ const view = new Uint8Array(digest);
10
+ let hex = '';
11
+ for (let i = 0; i < 6; i++)
12
+ hex += view[i].toString(16).padStart(2, '0');
13
+ return hex;
14
+ }
15
+ //# sourceMappingURL=content-hash.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-hash.js","sourceRoot":"","sources":["../../src/workspace/content-hash.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,wEAAwE;AACxE,8EAA8E;AAC9E,4EAA4E;AAC5E,8EAA8E;AAC9E,cAAc;AAEd,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,KAAiB;IAC/C,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IACvE,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;QAAE,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACzE,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["//\n// Content-addressing hash for the workspace `assets/<sha>.<ext>` store.\n// 6 bytes of SHA-256 as hex — short enough for readable paths, collision-safe\n// at this workspace's scale. Shared by asset_generate and load so identical\n// bytes land at the identical path (automatic dedup) regardless of which tool\n// wrote them.\n\nexport async function shortHash(bytes: Uint8Array): Promise<string> {\n const digest = await globalThis.crypto.subtle.digest('SHA-256', bytes);\n const view = new Uint8Array(digest);\n let hex = '';\n for (let i = 0; i < 6; i++) hex += view[i].toString(16).padStart(2, '0');\n return hex;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imgly/codesign-mcp",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Codesign MCP server: SYSTEM prompt, prompts, skills, design tools as MCP resources/prompts/tools.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "homepage": "https://github.com/imgly/imgly-codesign/tree/main/packages/codesign-mcp",
@@ -35,7 +35,12 @@
35
35
  "./tools/design": {
36
36
  "types": "./dist/tools/index.d.ts",
37
37
  "import": "./dist/tools/index.js"
38
- }
38
+ },
39
+ "./engine": {
40
+ "types": "./dist/engine/index.d.ts",
41
+ "import": "./dist/engine/index.js"
42
+ },
43
+ "./package.json": "./package.json"
39
44
  },
40
45
  "files": [
41
46
  "dist",
@@ -45,11 +50,11 @@
45
50
  "scripts": {
46
51
  "clean": "shx rm -rf dist *.tsbuildinfo",
47
52
  "sync:cesdk-api": "node --experimental-strip-types scripts/sync-cesdk-api.ts",
53
+ "sync:cesdk-skills": "node --experimental-strip-types scripts/sync-cesdk-skills.ts",
48
54
  "generate-assets": "node scripts/generate-inline-assets.mjs",
49
55
  "generate-spa-assets": "node scripts/generate-spa-assets.mjs",
50
- "generate-dashboard-assets": "node scripts/generate-spa-assets.mjs src/dashboard/spa src/dashboard/spa-assets.generated.ts",
51
56
  "generate-trial-license": "node scripts/generate-trial-license.mjs",
52
- "refresh-assets": "pnpm run sync:cesdk-api && pnpm run generate-assets && pnpm run generate-spa-assets && pnpm run generate-dashboard-assets && pnpm run generate-trial-license",
57
+ "refresh-assets": "pnpm run sync:cesdk-api && pnpm run generate-assets && pnpm run generate-spa-assets && pnpm run generate-trial-license",
53
58
  "prebuild": "pnpm run refresh-assets",
54
59
  "precheck": "pnpm run refresh-assets",
55
60
  "pretest": "pnpm run refresh-assets",
@@ -57,15 +62,19 @@
57
62
  "prepare": "pnpm run build",
58
63
  "pack:release": "node scripts/pack-release.mjs",
59
64
  "publish:beta": "node scripts/publish-beta.mjs",
60
- "check": "tsc --build tsconfig.src.json && tsc --build tsconfig.test.json",
61
- "test": "vitest --run"
65
+ "check": "tsc --build tsconfig.src.json && tsc --build tsconfig.test.json && tsc -p tsconfig.scripts.json",
66
+ "test": "vitest --run",
67
+ "dev:claude": "bash scripts/dev-claude.sh",
68
+ "changelog:collate": "node --experimental-strip-types scripts/changelog-collate.ts",
69
+ "changelog:add": "node --experimental-strip-types scripts/changelog-add.ts",
70
+ "bump:cesdk": "node --experimental-strip-types scripts/bump-cesdk.ts"
62
71
  },
63
72
  "dependencies": {
64
73
  "@aws-sdk/client-s3": "^3.1063.0",
65
74
  "@aws-sdk/s3-request-presigner": "^3.1063.0",
66
- "@cesdk/engine": "1.77.0-rc.4",
67
- "@cesdk/node": "1.77.0-rc.4",
68
- "@cesdk/node-native": "1.77.0-rc.4",
75
+ "@cesdk/engine": "1.77.0",
76
+ "@cesdk/node": "1.77.0",
77
+ "@cesdk/node-native": "1.77.0",
69
78
  "@modelcontextprotocol/sdk": "^1.0.0",
70
79
  "@sinclair/typebox": "^0.34.0",
71
80
  "cors": "^2.8.5",