@imgly/codesign-mcp 0.7.2 → 0.7.3-next.20261125135902.gfdc6ee3

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 (539) hide show
  1. package/README.md +35 -17
  2. package/dist/cli/license.js +1 -1
  3. package/dist/runtime/cli/commands.d.ts +2 -0
  4. package/dist/runtime/cli/commands.d.ts.map +1 -1
  5. package/dist/runtime/cli/commands.js +56 -1
  6. package/dist/runtime/cli/commands.js.map +1 -1
  7. package/dist/runtime/cli/main.d.ts.map +1 -1
  8. package/dist/runtime/cli/main.js +5 -0
  9. package/dist/runtime/cli/main.js.map +1 -1
  10. package/dist/runtime/codesign-shim/codesign-router/protocol/types.mjs +1 -0
  11. package/dist/runtime/codesign-shim/codesign-router/release-build.generated.mjs +1 -1
  12. package/dist/server-client-types/protocol/types.d.ts +25 -3
  13. package/dist/server-client.mjs +1 -0
  14. package/dist/server.d.ts +2 -0
  15. package/dist/server.d.ts.map +1 -1
  16. package/dist/server.js +4 -2
  17. package/dist/server.js.map +1 -1
  18. package/node_modules/@imgly/codesign-billing/README.md +138 -0
  19. package/node_modules/@imgly/{codesign-sdk/dist/executor/billing → codesign-billing/dist}/charge.d.ts +30 -5
  20. package/node_modules/@imgly/codesign-billing/dist/charge.d.ts.map +1 -0
  21. package/node_modules/@imgly/{codesign-sdk/dist/executor/billing → codesign-billing/dist}/charge.js +16 -1
  22. package/node_modules/@imgly/codesign-billing/dist/charge.js.map +1 -0
  23. package/node_modules/@imgly/codesign-billing/dist/charges.d.ts +71 -0
  24. package/node_modules/@imgly/codesign-billing/dist/charges.d.ts.map +1 -0
  25. package/node_modules/@imgly/codesign-billing/dist/charges.js +198 -0
  26. package/node_modules/@imgly/codesign-billing/dist/charges.js.map +1 -0
  27. package/node_modules/@imgly/codesign-billing/dist/index.d.ts +6 -0
  28. package/node_modules/@imgly/codesign-billing/dist/index.d.ts.map +1 -0
  29. package/node_modules/@imgly/codesign-billing/dist/index.js +6 -0
  30. package/node_modules/@imgly/codesign-billing/dist/index.js.map +1 -0
  31. package/node_modules/@imgly/codesign-billing/dist/ledger.d.ts +55 -0
  32. package/node_modules/@imgly/codesign-billing/dist/ledger.d.ts.map +1 -0
  33. package/node_modules/@imgly/codesign-billing/dist/ledger.js +80 -0
  34. package/node_modules/@imgly/codesign-billing/dist/ledger.js.map +1 -0
  35. package/node_modules/@imgly/{codesign-sdk/dist/executor/billing → codesign-billing/dist}/metering.d.ts +9 -1
  36. package/node_modules/@imgly/codesign-billing/dist/metering.d.ts.map +1 -0
  37. package/node_modules/@imgly/{codesign-sdk/dist/executor/billing → codesign-billing/dist}/metering.js +77 -21
  38. package/node_modules/@imgly/codesign-billing/dist/metering.js.map +1 -0
  39. package/node_modules/@imgly/codesign-billing/dist/refusal.d.ts +20 -0
  40. package/node_modules/@imgly/codesign-billing/dist/refusal.d.ts.map +1 -0
  41. package/node_modules/@imgly/codesign-billing/dist/refusal.js +13 -0
  42. package/node_modules/@imgly/codesign-billing/dist/refusal.js.map +1 -0
  43. package/node_modules/@imgly/codesign-billing/package.json +30 -0
  44. package/node_modules/@imgly/codesign-router/dist/config/unit-config.d.ts +13 -5
  45. package/node_modules/@imgly/codesign-router/dist/config/unit-config.d.ts.map +1 -1
  46. package/node_modules/@imgly/codesign-router/dist/config/unit-config.js +18 -12
  47. package/node_modules/@imgly/codesign-router/dist/config/unit-config.js.map +1 -1
  48. package/node_modules/@imgly/codesign-router/dist/consent.d.ts +6 -2
  49. package/node_modules/@imgly/codesign-router/dist/consent.d.ts.map +1 -1
  50. package/node_modules/@imgly/codesign-router/dist/consent.js +65 -9
  51. package/node_modules/@imgly/codesign-router/dist/consent.js.map +1 -1
  52. package/node_modules/@imgly/codesign-router/dist/protocol/types.d.ts +25 -3
  53. package/node_modules/@imgly/codesign-router/dist/protocol/types.d.ts.map +1 -1
  54. package/node_modules/@imgly/codesign-router/dist/protocol/types.js +1 -0
  55. package/node_modules/@imgly/codesign-router/dist/protocol/types.js.map +1 -1
  56. package/node_modules/@imgly/codesign-router/dist/release-build.generated.d.ts +1 -1
  57. package/node_modules/@imgly/codesign-router/dist/release-build.generated.d.ts.map +1 -1
  58. package/node_modules/@imgly/codesign-router/dist/release-build.generated.js +1 -1
  59. package/node_modules/@imgly/codesign-router/dist/release-build.generated.js.map +1 -1
  60. package/node_modules/@imgly/codesign-router/dist/router/channels-v2.d.ts.map +1 -1
  61. package/node_modules/@imgly/codesign-router/dist/router/channels-v2.js +14 -4
  62. package/node_modules/@imgly/codesign-router/dist/router/channels-v2.js.map +1 -1
  63. package/node_modules/@imgly/codesign-router/dist/router/main.d.ts.map +1 -1
  64. package/node_modules/@imgly/codesign-router/dist/router/main.js +9 -1
  65. package/node_modules/@imgly/codesign-router/dist/router/main.js.map +1 -1
  66. package/node_modules/@imgly/codesign-sdk/CHANGELOG.md +24 -0
  67. package/node_modules/@imgly/codesign-sdk/README.md +8 -7
  68. package/node_modules/@imgly/codesign-sdk/dist/abort.d.ts +1 -0
  69. package/node_modules/@imgly/codesign-sdk/dist/abort.js +18 -0
  70. package/node_modules/@imgly/codesign-sdk/dist/assets/inline.generated.js +12 -12
  71. package/node_modules/@imgly/codesign-sdk/dist/browser/index.d.ts +1 -1
  72. package/node_modules/@imgly/codesign-sdk/dist/browser/worker.d.ts +1 -1
  73. package/node_modules/@imgly/codesign-sdk/dist/browser/worker.js +15 -8
  74. package/node_modules/@imgly/codesign-sdk/dist/cesdk-utils/index.js +2 -0
  75. package/node_modules/@imgly/codesign-sdk/dist/codesign-error.d.ts +38 -1
  76. package/node_modules/@imgly/codesign-sdk/dist/codesign-error.js +9 -0
  77. package/node_modules/@imgly/codesign-sdk/dist/codesign.d.ts +19 -12
  78. package/node_modules/@imgly/codesign-sdk/dist/codesign.js +268 -43
  79. package/node_modules/@imgly/codesign-sdk/dist/design/animatable.generated.js +3 -0
  80. package/node_modules/@imgly/codesign-sdk/dist/design/capabilities.generated.js +1 -0
  81. package/node_modules/@imgly/codesign-sdk/dist/design/facade.d.ts +1 -1
  82. package/node_modules/@imgly/codesign-sdk/dist/design/facade.js +128 -36
  83. package/node_modules/@imgly/codesign-sdk/dist/design/keyframes.js +2 -1
  84. package/node_modules/@imgly/codesign-sdk/dist/design/lint.d.ts +1 -1
  85. package/node_modules/@imgly/codesign-sdk/dist/design/lint.js +82 -5
  86. package/node_modules/@imgly/codesign-sdk/dist/design/props.generated.js +3 -0
  87. package/node_modules/@imgly/codesign-sdk/dist/design/run-offsets.d.ts +10 -0
  88. package/node_modules/@imgly/codesign-sdk/dist/design/run-offsets.js +26 -0
  89. package/node_modules/@imgly/codesign-sdk/dist/design/scene-lint.d.ts +23 -1
  90. package/node_modules/@imgly/codesign-sdk/dist/design/scene-lint.js +194 -3
  91. package/node_modules/@imgly/codesign-sdk/dist/design/timeline-poses.d.ts +8 -0
  92. package/node_modules/@imgly/codesign-sdk/dist/design/timeline-poses.js +53 -0
  93. package/node_modules/@imgly/codesign-sdk/dist/design/variables.d.ts +14 -0
  94. package/node_modules/@imgly/codesign-sdk/dist/design/variables.js +250 -37
  95. package/node_modules/@imgly/codesign-sdk/dist/designs/s3-presigner.d.ts +50 -0
  96. package/node_modules/@imgly/codesign-sdk/dist/designs/s3-presigner.js +116 -0
  97. package/node_modules/@imgly/codesign-sdk/dist/designs/types.d.ts +79 -3
  98. package/node_modules/@imgly/codesign-sdk/dist/engine/audio-extract.d.ts +12 -1
  99. package/node_modules/@imgly/codesign-sdk/dist/engine/audio-extract.js +20 -4
  100. package/node_modules/@imgly/codesign-sdk/dist/engine/engine-capacity.d.ts +20 -7
  101. package/node_modules/@imgly/codesign-sdk/dist/engine/engine-capacity.js +31 -14
  102. package/node_modules/@imgly/codesign-sdk/dist/engine/headless.d.ts +4 -0
  103. package/node_modules/@imgly/codesign-sdk/dist/engine/headless.js +20 -0
  104. package/node_modules/@imgly/codesign-sdk/dist/executor/billing/check.d.ts +1 -14
  105. package/node_modules/@imgly/codesign-sdk/dist/executor/billing/check.js +2 -7
  106. package/node_modules/@imgly/codesign-sdk/dist/executor/billing/metered.d.ts +1 -2
  107. package/node_modules/@imgly/codesign-sdk/dist/executor/billing/metered.js +120 -91
  108. package/node_modules/@imgly/codesign-sdk/dist/executor/encode-watchdog.d.ts +2 -2
  109. package/node_modules/@imgly/codesign-sdk/dist/executor/encode-watchdog.js +10 -4
  110. package/node_modules/@imgly/codesign-sdk/dist/executor/engine-protocol.d.ts +1 -1
  111. package/node_modules/@imgly/codesign-sdk/dist/executor/engine-protocol.js +13 -3
  112. package/node_modules/@imgly/codesign-sdk/dist/executor/executor-options.d.ts +6 -7
  113. package/node_modules/@imgly/codesign-sdk/dist/executor/executor-options.js +14 -7
  114. package/node_modules/@imgly/codesign-sdk/dist/executor/handler.d.ts +47 -2
  115. package/node_modules/@imgly/codesign-sdk/dist/executor/handler.js +519 -8
  116. package/node_modules/@imgly/codesign-sdk/dist/executor/node.d.ts +42 -6
  117. package/node_modules/@imgly/codesign-sdk/dist/executor/node.js +231 -9
  118. package/node_modules/@imgly/codesign-sdk/dist/exporters/fig.d.ts +13 -0
  119. package/node_modules/@imgly/codesign-sdk/dist/exporters/fig.js +28 -0
  120. package/node_modules/@imgly/codesign-sdk/dist/exporters/html.d.ts +18 -2
  121. package/node_modules/@imgly/codesign-sdk/dist/exporters/html.js +129 -15
  122. package/node_modules/@imgly/codesign-sdk/dist/exporters/index.d.ts +5 -2
  123. package/node_modules/@imgly/codesign-sdk/dist/exporters/index.js +2 -2
  124. package/node_modules/@imgly/codesign-sdk/dist/exporters/node.d.ts +1 -1
  125. package/node_modules/@imgly/codesign-sdk/dist/exporters/node.js +4 -3
  126. package/node_modules/@imgly/codesign-sdk/dist/exporters/psd.js +1 -1
  127. package/node_modules/@imgly/codesign-sdk/dist/formats/av-limit.d.ts +2 -0
  128. package/node_modules/@imgly/codesign-sdk/dist/formats/av-limit.js +1 -1
  129. package/node_modules/@imgly/codesign-sdk/dist/formats/design-sniff.d.ts +3 -1
  130. package/node_modules/@imgly/codesign-sdk/dist/formats/design-sniff.js +7 -0
  131. package/node_modules/@imgly/codesign-sdk/dist/formats/import-registry.d.ts +1 -1
  132. package/node_modules/@imgly/codesign-sdk/dist/formats/import-registry.js +4 -2
  133. package/node_modules/@imgly/codesign-sdk/dist/formats/import-warnings.d.ts +5 -0
  134. package/node_modules/@imgly/codesign-sdk/dist/formats/import-warnings.js +31 -0
  135. package/node_modules/@imgly/codesign-sdk/dist/formats/media-facts.d.ts +15 -0
  136. package/node_modules/@imgly/codesign-sdk/dist/formats/media-facts.js +26 -0
  137. package/node_modules/@imgly/codesign-sdk/dist/formats/mime.d.ts +6 -0
  138. package/node_modules/@imgly/codesign-sdk/dist/formats/mime.js +37 -0
  139. package/node_modules/@imgly/codesign-sdk/dist/formats/refuse-media.d.ts +7 -0
  140. package/node_modules/@imgly/codesign-sdk/dist/formats/refuse-media.js +46 -0
  141. package/node_modules/@imgly/codesign-sdk/dist/formats/svg-export.d.ts +6 -0
  142. package/node_modules/@imgly/codesign-sdk/dist/formats/svg-export.js +20 -0
  143. package/node_modules/@imgly/codesign-sdk/dist/formats/svg-import.d.ts +3 -0
  144. package/node_modules/@imgly/codesign-sdk/dist/formats/svg-import.js +25 -0
  145. package/node_modules/@imgly/codesign-sdk/dist/formats/zip-entries.d.ts +2 -0
  146. package/node_modules/@imgly/codesign-sdk/dist/formats/zip-entries.js +1 -0
  147. package/node_modules/@imgly/codesign-sdk/dist/gateway/asset-generate.d.ts +10 -4
  148. package/node_modules/@imgly/codesign-sdk/dist/gateway/asset-generate.js +205 -79
  149. package/node_modules/@imgly/codesign-sdk/dist/gateway/client.d.ts +23 -2
  150. package/node_modules/@imgly/codesign-sdk/dist/gateway/client.js +40 -41
  151. package/node_modules/@imgly/codesign-sdk/dist/gateway/index.d.ts +3 -0
  152. package/node_modules/@imgly/codesign-sdk/dist/gateway/index.js +4 -0
  153. package/node_modules/@imgly/codesign-sdk/dist/gateway/types.d.ts +18 -3
  154. package/node_modules/@imgly/codesign-sdk/dist/gateway/upload-origin.d.ts +3 -0
  155. package/node_modules/@imgly/codesign-sdk/dist/gateway/upload-origin.js +5 -0
  156. package/node_modules/@imgly/codesign-sdk/dist/host/edit-code.d.ts +2 -0
  157. package/node_modules/@imgly/codesign-sdk/dist/host/edit-code.js +8 -1
  158. package/node_modules/@imgly/codesign-sdk/dist/host/preview-size.d.ts +4 -2
  159. package/node_modules/@imgly/codesign-sdk/dist/host/preview-size.js +7 -4
  160. package/node_modules/@imgly/codesign-sdk/dist/host.d.ts +34 -5
  161. package/node_modules/@imgly/codesign-sdk/dist/host.js +6 -0
  162. package/node_modules/@imgly/codesign-sdk/dist/importers/fig.d.ts +4 -0
  163. package/node_modules/@imgly/codesign-sdk/dist/importers/fig.js +57 -0
  164. package/node_modules/@imgly/codesign-sdk/dist/importers/index.d.ts +2 -2
  165. package/node_modules/@imgly/codesign-sdk/dist/importers/index.js +38 -25
  166. package/node_modules/@imgly/codesign-sdk/dist/importers/node.d.ts +5 -0
  167. package/node_modules/@imgly/codesign-sdk/dist/importers/node.js +8 -0
  168. package/node_modules/@imgly/codesign-sdk/dist/importers/pdf-fonts.d.ts +20 -0
  169. package/node_modules/@imgly/codesign-sdk/dist/importers/pdf-fonts.js +76 -0
  170. package/node_modules/@imgly/codesign-sdk/dist/importers/shared.d.ts +14 -0
  171. package/node_modules/@imgly/codesign-sdk/dist/importers/shared.js +18 -0
  172. package/node_modules/@imgly/codesign-sdk/dist/index.d.ts +5 -4
  173. package/node_modules/@imgly/codesign-sdk/dist/index.js +2 -1
  174. package/node_modules/@imgly/codesign-sdk/dist/internal/index.d.ts +24 -17
  175. package/node_modules/@imgly/codesign-sdk/dist/internal/index.js +19 -10
  176. package/node_modules/@imgly/codesign-sdk/dist/node/edit-renders.d.ts +5 -0
  177. package/node_modules/@imgly/codesign-sdk/dist/node/edit-renders.js +73 -0
  178. package/node_modules/@imgly/codesign-sdk/dist/node/engine-child.js +18 -2
  179. package/node_modules/@imgly/codesign-sdk/dist/node/engine-http.js +8 -2
  180. package/node_modules/@imgly/codesign-sdk/dist/node/index.d.ts +1 -0
  181. package/node_modules/@imgly/codesign-sdk/dist/node/index.js +1 -0
  182. package/node_modules/@imgly/codesign-sdk/dist/node/media-probe.js +1 -1
  183. package/node_modules/@imgly/codesign-sdk/dist/sdk-version.generated.js +2 -2
  184. package/node_modules/@imgly/codesign-sdk/dist/session/engine-session.d.ts +59 -13
  185. package/node_modules/@imgly/codesign-sdk/dist/session/engine-session.js +19 -0
  186. package/node_modules/@imgly/codesign-sdk/dist/session/export-facts.d.ts +1 -14
  187. package/node_modules/@imgly/codesign-sdk/dist/session/export-facts.js +15 -4
  188. package/node_modules/@imgly/codesign-sdk/dist/session/file-formats.d.ts +5 -0
  189. package/node_modules/@imgly/codesign-sdk/dist/session/guarded-engine-session.d.ts +2 -0
  190. package/node_modules/@imgly/codesign-sdk/dist/session/guarded-engine-session.js +18 -7
  191. package/node_modules/@imgly/codesign-sdk/dist/session/local-engine-session.js +247 -68
  192. package/node_modules/@imgly/codesign-sdk/dist/session/local-engine.js +2 -2
  193. package/node_modules/@imgly/codesign-sdk/dist/session/multipart.js +10 -2
  194. package/node_modules/@imgly/codesign-sdk/dist/session/pending-video.js +2 -3
  195. package/node_modules/@imgly/codesign-sdk/dist/session/read-resolved.js +93 -6
  196. package/node_modules/@imgly/codesign-sdk/dist/session/remote.d.ts +34 -10
  197. package/node_modules/@imgly/codesign-sdk/dist/session/remote.js +377 -87
  198. package/node_modules/@imgly/codesign-sdk/dist/session/render-id.js +11 -2
  199. package/node_modules/@imgly/codesign-sdk/dist/session/session.d.ts +67 -6
  200. package/node_modules/@imgly/codesign-sdk/dist/session/session.js +213 -32
  201. package/node_modules/@imgly/codesign-sdk/dist/session/silent-audio.d.ts +18 -0
  202. package/node_modules/@imgly/codesign-sdk/dist/session/silent-audio.js +47 -0
  203. package/node_modules/@imgly/codesign-sdk/dist/session/transfers.d.ts +85 -0
  204. package/node_modules/@imgly/codesign-sdk/dist/session/transfers.js +80 -0
  205. package/node_modules/@imgly/codesign-sdk/dist/session/url-guard.d.ts +30 -0
  206. package/node_modules/@imgly/codesign-sdk/dist/session/url-guard.js +187 -0
  207. package/node_modules/@imgly/codesign-sdk/dist/session/url-source.d.ts +21 -0
  208. package/node_modules/@imgly/codesign-sdk/dist/session/url-source.js +163 -0
  209. package/node_modules/@imgly/codesign-sdk/dist/session/wire.d.ts +8 -1
  210. package/node_modules/@imgly/codesign-sdk/dist/session/wire.js +2 -1
  211. package/node_modules/@imgly/codesign-sdk/dist/session-instructions.js +2 -2
  212. package/node_modules/@imgly/codesign-sdk/dist/sessions/state.d.ts +3 -1
  213. package/node_modules/@imgly/codesign-sdk/dist/sessions/state.js +5 -1
  214. package/node_modules/@imgly/codesign-sdk/dist/signed-urls.d.ts +3 -0
  215. package/node_modules/@imgly/codesign-sdk/dist/signed-urls.js +30 -0
  216. package/node_modules/@imgly/codesign-sdk/dist/skill-tool.js +12 -12
  217. package/node_modules/@imgly/codesign-sdk/dist/sources/handshake.d.ts +2 -0
  218. package/node_modules/@imgly/codesign-sdk/dist/sources/mime.js +0 -1
  219. package/node_modules/@imgly/codesign-sdk/dist/sources/route.d.ts +8 -1
  220. package/node_modules/@imgly/codesign-sdk/dist/sources/route.js +17 -2
  221. package/node_modules/@imgly/codesign-sdk/dist/sources/search.js +9 -2
  222. package/node_modules/@imgly/codesign-sdk/dist/sources/types.d.ts +8 -1
  223. package/node_modules/@imgly/codesign-sdk/dist/testing/conformance.js +11 -6
  224. package/node_modules/@imgly/codesign-sdk/dist/testing/fake-engine.d.ts +1 -1
  225. package/node_modules/@imgly/codesign-sdk/dist/testing/fake-engine.js +11 -4
  226. package/node_modules/@imgly/codesign-sdk/dist/tools/edit.js +11 -4
  227. package/node_modules/@imgly/codesign-sdk/dist/tools/errors.js +2 -2
  228. package/node_modules/@imgly/codesign-sdk/dist/tools/export-formats/table.d.ts +4 -4
  229. package/node_modules/@imgly/codesign-sdk/dist/tools/export-formats/table.js +8 -0
  230. package/node_modules/@imgly/codesign-sdk/dist/tools/export.d.ts +3 -1
  231. package/node_modules/@imgly/codesign-sdk/dist/tools/export.js +75 -12
  232. package/node_modules/@imgly/codesign-sdk/dist/tools/omit-defaults.d.ts +3 -0
  233. package/node_modules/@imgly/codesign-sdk/dist/tools/omit-defaults.js +7 -0
  234. package/node_modules/@imgly/codesign-sdk/dist/tools/preview.js +42 -19
  235. package/node_modules/@imgly/codesign-sdk/dist/tools/source-tools.js +11 -4
  236. package/node_modules/@imgly/codesign-sdk/package.json +18 -10
  237. package/node_modules/@imgly/codesign-server/assets/ai-plugins/apps.mjs +5 -5
  238. package/node_modules/@imgly/codesign-server/assets/ai-plugins/image-gateway.mjs +5 -5
  239. package/node_modules/@imgly/codesign-server/assets/ai-plugins/version.json +1 -1
  240. package/node_modules/@imgly/codesign-server/dist/catalog/link.d.ts.map +1 -1
  241. package/node_modules/@imgly/codesign-server/dist/catalog/link.js +2 -1
  242. package/node_modules/@imgly/codesign-server/dist/catalog/link.js.map +1 -1
  243. package/node_modules/@imgly/codesign-server/dist/catalog/local-server.d.ts.map +1 -1
  244. package/node_modules/@imgly/codesign-server/dist/catalog/local-server.js +1 -0
  245. package/node_modules/@imgly/codesign-server/dist/catalog/local-server.js.map +1 -1
  246. package/node_modules/@imgly/codesign-server/dist/catalog/tools/asset-add.d.ts +59 -1
  247. package/node_modules/@imgly/codesign-server/dist/catalog/tools/asset-add.d.ts.map +1 -1
  248. package/node_modules/@imgly/codesign-server/dist/catalog/tools/asset-add.js +127 -23
  249. package/node_modules/@imgly/codesign-server/dist/catalog/tools/asset-add.js.map +1 -1
  250. package/node_modules/@imgly/codesign-server/dist/catalog/tools/asset-search.d.ts +7 -0
  251. package/node_modules/@imgly/codesign-server/dist/catalog/tools/asset-search.d.ts.map +1 -1
  252. package/node_modules/@imgly/codesign-server/dist/catalog/tools/asset-search.js +65 -15
  253. package/node_modules/@imgly/codesign-server/dist/catalog/tools/asset-search.js.map +1 -1
  254. package/node_modules/@imgly/codesign-server/dist/catalog/tools/checklist.d.ts +2 -0
  255. package/node_modules/@imgly/codesign-server/dist/catalog/tools/checklist.d.ts.map +1 -1
  256. package/node_modules/@imgly/codesign-server/dist/catalog/tools/checklist.js +15 -5
  257. package/node_modules/@imgly/codesign-server/dist/catalog/tools/checklist.js.map +1 -1
  258. package/node_modules/@imgly/codesign-server/dist/catalog/tools/export-description.d.ts +1 -1
  259. package/node_modules/@imgly/codesign-server/dist/catalog/tools/export-description.d.ts.map +1 -1
  260. package/node_modules/@imgly/codesign-server/dist/catalog/tools/export-description.js +7 -6
  261. package/node_modules/@imgly/codesign-server/dist/catalog/tools/export-description.js.map +1 -1
  262. package/node_modules/@imgly/codesign-server/dist/catalog/tools/export-formats/modules.d.ts +2 -2
  263. package/node_modules/@imgly/codesign-server/dist/catalog/tools/export-formats/modules.d.ts.map +1 -1
  264. package/node_modules/@imgly/codesign-server/dist/catalog/tools/export-formats/modules.js +14 -4
  265. package/node_modules/@imgly/codesign-server/dist/catalog/tools/export-formats/modules.js.map +1 -1
  266. package/node_modules/@imgly/codesign-server/dist/catalog/tools/import.d.ts +10 -0
  267. package/node_modules/@imgly/codesign-server/dist/catalog/tools/import.d.ts.map +1 -1
  268. package/node_modules/@imgly/codesign-server/dist/catalog/tools/import.js +106 -22
  269. package/node_modules/@imgly/codesign-server/dist/catalog/tools/import.js.map +1 -1
  270. package/node_modules/@imgly/codesign-server/dist/cli/connectors.js +1 -1
  271. package/node_modules/@imgly/codesign-server/dist/cli/connectors.js.map +1 -1
  272. package/node_modules/@imgly/codesign-server/dist/cli/doctor/checks/mcp-servers.js +1 -1
  273. package/node_modules/@imgly/codesign-server/dist/cli/doctor/checks/mcp-servers.js.map +1 -1
  274. package/node_modules/@imgly/codesign-server/dist/cli/pack.d.ts +1 -1
  275. package/node_modules/@imgly/codesign-server/dist/cli/pack.d.ts.map +1 -1
  276. package/node_modules/@imgly/codesign-server/dist/cli/pack.js +24 -18
  277. package/node_modules/@imgly/codesign-server/dist/cli/pack.js.map +1 -1
  278. package/node_modules/@imgly/codesign-server/dist/conversation/instructions.js +1 -1
  279. package/node_modules/@imgly/codesign-server/dist/conversation/instructions.js.map +1 -1
  280. package/node_modules/@imgly/codesign-server/dist/conversation/main.d.ts.map +1 -1
  281. package/node_modules/@imgly/codesign-server/dist/conversation/main.js +4 -3
  282. package/node_modules/@imgly/codesign-server/dist/conversation/main.js.map +1 -1
  283. package/node_modules/@imgly/codesign-server/dist/conversation/stage.d.ts +4 -0
  284. package/node_modules/@imgly/codesign-server/dist/conversation/stage.d.ts.map +1 -1
  285. package/node_modules/@imgly/codesign-server/dist/conversation/stage.js +13 -0
  286. package/node_modules/@imgly/codesign-server/dist/conversation/stage.js.map +1 -1
  287. package/node_modules/@imgly/codesign-server/dist/credentials/credential-store.d.ts +0 -6
  288. package/node_modules/@imgly/codesign-server/dist/credentials/credential-store.d.ts.map +1 -1
  289. package/node_modules/@imgly/codesign-server/dist/credentials/credential-store.js +0 -58
  290. package/node_modules/@imgly/codesign-server/dist/credentials/credential-store.js.map +1 -1
  291. package/node_modules/@imgly/codesign-server/dist/credentials/keychain.d.ts +10 -0
  292. package/node_modules/@imgly/codesign-server/dist/credentials/keychain.d.ts.map +1 -0
  293. package/node_modules/@imgly/codesign-server/dist/credentials/keychain.js +84 -0
  294. package/node_modules/@imgly/codesign-server/dist/credentials/keychain.js.map +1 -0
  295. package/node_modules/@imgly/codesign-server/dist/credentials/token-store.d.ts +1 -3
  296. package/node_modules/@imgly/codesign-server/dist/credentials/token-store.d.ts.map +1 -1
  297. package/node_modules/@imgly/codesign-server/dist/credentials/token-store.js +3 -23
  298. package/node_modules/@imgly/codesign-server/dist/credentials/token-store.js.map +1 -1
  299. package/node_modules/@imgly/codesign-server/dist/design/design-library-tools.d.ts +59 -8
  300. package/node_modules/@imgly/codesign-server/dist/design/design-library-tools.d.ts.map +1 -1
  301. package/node_modules/@imgly/codesign-server/dist/design/design-library-tools.js +317 -40
  302. package/node_modules/@imgly/codesign-server/dist/design/design-library-tools.js.map +1 -1
  303. package/node_modules/@imgly/codesign-server/dist/design/engine.js +4 -9
  304. package/node_modules/@imgly/codesign-server/dist/design/engine.js.map +1 -1
  305. package/node_modules/@imgly/codesign-server/dist/design/engines.d.ts +5 -0
  306. package/node_modules/@imgly/codesign-server/dist/design/engines.d.ts.map +1 -1
  307. package/node_modules/@imgly/codesign-server/dist/design/engines.js +49 -0
  308. package/node_modules/@imgly/codesign-server/dist/design/engines.js.map +1 -1
  309. package/node_modules/@imgly/codesign-server/dist/design/host.d.ts +2 -0
  310. package/node_modules/@imgly/codesign-server/dist/design/host.d.ts.map +1 -1
  311. package/node_modules/@imgly/codesign-server/dist/design/host.js +10 -6
  312. package/node_modules/@imgly/codesign-server/dist/design/host.js.map +1 -1
  313. package/node_modules/@imgly/codesign-server/dist/design/lazy-executors.d.ts.map +1 -1
  314. package/node_modules/@imgly/codesign-server/dist/design/lazy-executors.js +34 -5
  315. package/node_modules/@imgly/codesign-server/dist/design/lazy-executors.js.map +1 -1
  316. package/node_modules/@imgly/codesign-server/dist/design/local-design.d.ts +42 -5
  317. package/node_modules/@imgly/codesign-server/dist/design/local-design.d.ts.map +1 -1
  318. package/node_modules/@imgly/codesign-server/dist/design/local-design.js +175 -38
  319. package/node_modules/@imgly/codesign-server/dist/design/local-design.js.map +1 -1
  320. package/node_modules/@imgly/codesign-server/dist/design/local-tools.d.ts +27 -1
  321. package/node_modules/@imgly/codesign-server/dist/design/local-tools.d.ts.map +1 -1
  322. package/node_modules/@imgly/codesign-server/dist/design/local-tools.js +65 -7
  323. package/node_modules/@imgly/codesign-server/dist/design/local-tools.js.map +1 -1
  324. package/node_modules/@imgly/codesign-server/dist/design/main.d.ts.map +1 -1
  325. package/node_modules/@imgly/codesign-server/dist/design/main.js +23 -10
  326. package/node_modules/@imgly/codesign-server/dist/design/main.js.map +1 -1
  327. package/node_modules/@imgly/codesign-server/dist/design/node-exporters.d.ts +4 -0
  328. package/node_modules/@imgly/codesign-server/dist/design/node-exporters.d.ts.map +1 -0
  329. package/node_modules/@imgly/codesign-server/dist/design/node-exporters.js +13 -0
  330. package/node_modules/@imgly/codesign-server/dist/design/node-exporters.js.map +1 -0
  331. package/node_modules/@imgly/codesign-server/dist/design/probe-media.d.ts +2 -0
  332. package/node_modules/@imgly/codesign-server/dist/design/probe-media.d.ts.map +1 -0
  333. package/node_modules/@imgly/codesign-server/dist/design/probe-media.js +16 -0
  334. package/node_modules/@imgly/codesign-server/dist/design/probe-media.js.map +1 -0
  335. package/node_modules/@imgly/codesign-server/dist/design/remote-resources.d.ts +22 -3
  336. package/node_modules/@imgly/codesign-server/dist/design/remote-resources.d.ts.map +1 -1
  337. package/node_modules/@imgly/codesign-server/dist/design/remote-resources.js +123 -32
  338. package/node_modules/@imgly/codesign-server/dist/design/remote-resources.js.map +1 -1
  339. package/node_modules/@imgly/codesign-server/dist/design/save.d.ts +5 -0
  340. package/node_modules/@imgly/codesign-server/dist/design/save.d.ts.map +1 -1
  341. package/node_modules/@imgly/codesign-server/dist/design/save.js +9 -0
  342. package/node_modules/@imgly/codesign-server/dist/design/save.js.map +1 -1
  343. package/node_modules/@imgly/codesign-server/dist/design/sessions/store.d.ts +33 -4
  344. package/node_modules/@imgly/codesign-server/dist/design/sessions/store.d.ts.map +1 -1
  345. package/node_modules/@imgly/codesign-server/dist/design/sessions/store.js +121 -43
  346. package/node_modules/@imgly/codesign-server/dist/design/sessions/store.js.map +1 -1
  347. package/node_modules/@imgly/codesign-server/dist/design/workspace-files.d.ts +8 -0
  348. package/node_modules/@imgly/codesign-server/dist/design/workspace-files.d.ts.map +1 -1
  349. package/node_modules/@imgly/codesign-server/dist/design/workspace-files.js +50 -61
  350. package/node_modules/@imgly/codesign-server/dist/design/workspace-files.js.map +1 -1
  351. package/node_modules/@imgly/codesign-server/dist/design/workspace-library.d.ts +24 -2
  352. package/node_modules/@imgly/codesign-server/dist/design/workspace-library.d.ts.map +1 -1
  353. package/node_modules/@imgly/codesign-server/dist/design/workspace-library.js +132 -17
  354. package/node_modules/@imgly/codesign-server/dist/design/workspace-library.js.map +1 -1
  355. package/node_modules/@imgly/codesign-server/dist/services/archives/create.d.ts.map +1 -1
  356. package/node_modules/@imgly/codesign-server/dist/services/archives/create.js +19 -6
  357. package/node_modules/@imgly/codesign-server/dist/services/archives/create.js.map +1 -1
  358. package/node_modules/@imgly/codesign-server/dist/services/archives/handlers.d.ts.map +1 -1
  359. package/node_modules/@imgly/codesign-server/dist/services/archives/handlers.js +10 -7
  360. package/node_modules/@imgly/codesign-server/dist/services/archives/handlers.js.map +1 -1
  361. package/node_modules/@imgly/codesign-server/dist/services/archives/pack.d.ts +3 -1
  362. package/node_modules/@imgly/codesign-server/dist/services/archives/pack.d.ts.map +1 -1
  363. package/node_modules/@imgly/codesign-server/dist/services/archives/pack.js +5 -4
  364. package/node_modules/@imgly/codesign-server/dist/services/archives/pack.js.map +1 -1
  365. package/node_modules/@imgly/codesign-server/dist/services/archives/seed-pack.d.ts +56 -0
  366. package/node_modules/@imgly/codesign-server/dist/services/archives/seed-pack.d.ts.map +1 -0
  367. package/node_modules/@imgly/codesign-server/dist/services/archives/seed-pack.js +218 -0
  368. package/node_modules/@imgly/codesign-server/dist/services/archives/seed-pack.js.map +1 -0
  369. package/node_modules/@imgly/codesign-server/dist/services/archives/seed.d.ts.map +1 -1
  370. package/node_modules/@imgly/codesign-server/dist/services/archives/seed.js +33 -124
  371. package/node_modules/@imgly/codesign-server/dist/services/archives/seed.js.map +1 -1
  372. package/node_modules/@imgly/codesign-server/dist/services/archives/template.d.ts +1 -0
  373. package/node_modules/@imgly/codesign-server/dist/services/archives/template.d.ts.map +1 -1
  374. package/node_modules/@imgly/codesign-server/dist/services/archives/template.js +1 -1
  375. package/node_modules/@imgly/codesign-server/dist/services/archives/template.js.map +1 -1
  376. package/node_modules/@imgly/codesign-server/dist/services/auth/login-manager.d.ts.map +1 -1
  377. package/node_modules/@imgly/codesign-server/dist/services/auth/login-manager.js +2 -1
  378. package/node_modules/@imgly/codesign-server/dist/services/auth/login-manager.js.map +1 -1
  379. package/node_modules/@imgly/codesign-server/dist/services/diagnostics/status.d.ts +9 -5
  380. package/node_modules/@imgly/codesign-server/dist/services/diagnostics/status.d.ts.map +1 -1
  381. package/node_modules/@imgly/codesign-server/dist/services/diagnostics/status.js +14 -19
  382. package/node_modules/@imgly/codesign-server/dist/services/diagnostics/status.js.map +1 -1
  383. package/node_modules/@imgly/codesign-server/dist/services/diagnostics/tool.d.ts +2 -0
  384. package/node_modules/@imgly/codesign-server/dist/services/diagnostics/tool.d.ts.map +1 -1
  385. package/node_modules/@imgly/codesign-server/dist/services/diagnostics/tool.js +1 -0
  386. package/node_modules/@imgly/codesign-server/dist/services/diagnostics/tool.js.map +1 -1
  387. package/node_modules/@imgly/codesign-server/dist/services/engine/workspace-image-source.d.ts.map +1 -1
  388. package/node_modules/@imgly/codesign-server/dist/services/engine/workspace-image-source.js +4 -1
  389. package/node_modules/@imgly/codesign-server/dist/services/engine/workspace-image-source.js.map +1 -1
  390. package/node_modules/@imgly/codesign-server/dist/services/engine/workspace-source-module.d.ts +5 -1
  391. package/node_modules/@imgly/codesign-server/dist/services/engine/workspace-source-module.d.ts.map +1 -1
  392. package/node_modules/@imgly/codesign-server/dist/services/engine/workspace-source-module.js +67 -6
  393. package/node_modules/@imgly/codesign-server/dist/services/engine/workspace-source-module.js.map +1 -1
  394. package/node_modules/@imgly/codesign-server/dist/services/flags/manifest.js +2 -2
  395. package/node_modules/@imgly/codesign-server/dist/services/flags/manifest.js.map +1 -1
  396. package/node_modules/@imgly/codesign-server/dist/services/flags/release-flags.generated.d.ts +3 -3
  397. package/node_modules/@imgly/codesign-server/dist/services/flags/release-flags.generated.d.ts.map +1 -1
  398. package/node_modules/@imgly/codesign-server/dist/services/flags/release-flags.generated.js +3 -3
  399. package/node_modules/@imgly/codesign-server/dist/services/flags/release-flags.generated.js.map +1 -1
  400. package/node_modules/@imgly/codesign-server/dist/services/gateway-bearer.d.ts +15 -0
  401. package/node_modules/@imgly/codesign-server/dist/services/gateway-bearer.d.ts.map +1 -0
  402. package/node_modules/@imgly/codesign-server/dist/services/gateway-bearer.js +14 -0
  403. package/node_modules/@imgly/codesign-server/dist/services/gateway-bearer.js.map +1 -0
  404. package/node_modules/@imgly/codesign-server/dist/services/telemetry/error-policy.d.ts.map +1 -1
  405. package/node_modules/@imgly/codesign-server/dist/services/telemetry/error-policy.js +36 -0
  406. package/node_modules/@imgly/codesign-server/dist/services/telemetry/error-policy.js.map +1 -1
  407. package/node_modules/@imgly/codesign-server/dist/services/telemetry/usage-sink.d.ts +2 -2
  408. package/node_modules/@imgly/codesign-server/dist/services/telemetry/usage-sink.d.ts.map +1 -1
  409. package/node_modules/@imgly/codesign-server/dist/services/telemetry/usage-sink.js +3 -5
  410. package/node_modules/@imgly/codesign-server/dist/services/telemetry/usage-sink.js.map +1 -1
  411. package/node_modules/@imgly/codesign-server/dist/services/viewer/ai-plugin-assets.d.ts.map +1 -1
  412. package/node_modules/@imgly/codesign-server/dist/services/viewer/ai-plugin-assets.js +5 -4
  413. package/node_modules/@imgly/codesign-server/dist/services/viewer/ai-plugin-assets.js.map +1 -1
  414. package/node_modules/@imgly/codesign-server/dist/services/viewer/spa-assets.generated.d.ts.map +1 -1
  415. package/node_modules/@imgly/codesign-server/dist/services/viewer/spa-assets.generated.js +0 -64
  416. package/node_modules/@imgly/codesign-server/dist/services/viewer/spa-assets.generated.js.map +1 -1
  417. package/node_modules/@imgly/codesign-server/dist/services/viewer/url-builder.d.ts +4 -0
  418. package/node_modules/@imgly/codesign-server/dist/services/viewer/url-builder.d.ts.map +1 -1
  419. package/node_modules/@imgly/codesign-server/dist/services/viewer/url-builder.js +4 -0
  420. package/node_modules/@imgly/codesign-server/dist/services/viewer/url-builder.js.map +1 -1
  421. package/node_modules/@imgly/codesign-server/dist/services/viewer/workspace-source-route.d.ts.map +1 -1
  422. package/node_modules/@imgly/codesign-server/dist/services/viewer/workspace-source-route.js +2 -24
  423. package/node_modules/@imgly/codesign-server/dist/services/viewer/workspace-source-route.js.map +1 -1
  424. package/node_modules/@imgly/codesign-server/dist/services/workspace/asset-sidecars.d.ts +4 -2
  425. package/node_modules/@imgly/codesign-server/dist/services/workspace/asset-sidecars.d.ts.map +1 -1
  426. package/node_modules/@imgly/codesign-server/dist/services/workspace/asset-sidecars.js +15 -14
  427. package/node_modules/@imgly/codesign-server/dist/services/workspace/asset-sidecars.js.map +1 -1
  428. package/node_modules/@imgly/codesign-server/dist/services/workspace/asset-store.d.ts +12 -2
  429. package/node_modules/@imgly/codesign-server/dist/services/workspace/asset-store.d.ts.map +1 -1
  430. package/node_modules/@imgly/codesign-server/dist/services/workspace/asset-store.js +42 -12
  431. package/node_modules/@imgly/codesign-server/dist/services/workspace/asset-store.js.map +1 -1
  432. package/node_modules/@imgly/codesign-server/dist/services/workspace/assets-handlers.d.ts.map +1 -1
  433. package/node_modules/@imgly/codesign-server/dist/services/workspace/assets-handlers.js +1 -2
  434. package/node_modules/@imgly/codesign-server/dist/services/workspace/assets-handlers.js.map +1 -1
  435. package/node_modules/@imgly/codesign-server/dist/services/workspace/image-listing.d.ts.map +1 -1
  436. package/node_modules/@imgly/codesign-server/dist/services/workspace/image-listing.js +24 -2
  437. package/node_modules/@imgly/codesign-server/dist/services/workspace/image-listing.js.map +1 -1
  438. package/node_modules/@imgly/codesign-server/dist/services/workspace/layout-keys.d.ts +47 -0
  439. package/node_modules/@imgly/codesign-server/dist/services/workspace/layout-keys.d.ts.map +1 -0
  440. package/node_modules/@imgly/codesign-server/dist/services/workspace/layout-keys.js +167 -0
  441. package/node_modules/@imgly/codesign-server/dist/services/workspace/layout-keys.js.map +1 -0
  442. package/node_modules/@imgly/codesign-server/dist/services/workspace/layout.d.ts +2 -0
  443. package/node_modules/@imgly/codesign-server/dist/services/workspace/layout.d.ts.map +1 -1
  444. package/node_modules/@imgly/codesign-server/dist/services/workspace/layout.js +2 -0
  445. package/node_modules/@imgly/codesign-server/dist/services/workspace/layout.js.map +1 -1
  446. package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store-fs.d.ts +32 -0
  447. package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store-fs.d.ts.map +1 -0
  448. package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store-fs.js +79 -0
  449. package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store-fs.js.map +1 -0
  450. package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store-workspace.d.ts +35 -0
  451. package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store-workspace.d.ts.map +1 -0
  452. package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store-workspace.js +185 -0
  453. package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store-workspace.js.map +1 -0
  454. package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store.d.ts +74 -0
  455. package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store.d.ts.map +1 -0
  456. package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store.js +82 -0
  457. package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store.js.map +1 -0
  458. package/node_modules/@imgly/codesign-server/dist/services/workspace/types.d.ts +10 -0
  459. package/node_modules/@imgly/codesign-server/dist/services/workspace/types.d.ts.map +1 -1
  460. package/node_modules/@imgly/codesign-server/dist/services/workspace/types.js +1 -0
  461. package/node_modules/@imgly/codesign-server/dist/services/workspace/types.js.map +1 -1
  462. package/node_modules/@imgly/codesign-server/dist/services/workspace/write-atomic.d.ts.map +1 -1
  463. package/node_modules/@imgly/codesign-server/dist/services/workspace/write-atomic.js +5 -0
  464. package/node_modules/@imgly/codesign-server/dist/services/workspace/write-atomic.js.map +1 -1
  465. package/node_modules/@imgly/codesign-server/package.json +13 -11
  466. package/node_modules/@imgly/design-lint/dist/rules/text-legibility.d.ts +2 -1
  467. package/node_modules/@imgly/design-lint/dist/rules/text-legibility.d.ts.map +1 -1
  468. package/node_modules/@imgly/design-lint/dist/rules/text-legibility.js +5 -1
  469. package/node_modules/@imgly/design-lint/dist/rules/text-legibility.js.map +1 -1
  470. package/node_modules/@imgly/design-lint/package.json +2 -2
  471. package/node_modules/@imgly/figma-exporter/CHANGELOG.md +79 -0
  472. package/node_modules/@imgly/figma-exporter/LICENSE.md +137 -0
  473. package/node_modules/@imgly/figma-exporter/README.md +201 -0
  474. package/node_modules/@imgly/figma-exporter/THIRD_PARTY_NOTICES.md +475 -0
  475. package/node_modules/@imgly/figma-exporter/dist/index.cjs +1 -0
  476. package/node_modules/@imgly/figma-exporter/dist/index.d.cts +8833 -0
  477. package/node_modules/@imgly/figma-exporter/dist/index.d.ts +8833 -0
  478. package/node_modules/@imgly/figma-exporter/dist/index.js +1 -0
  479. package/node_modules/@imgly/figma-exporter/package.json +92 -0
  480. package/node_modules/@imgly/figma-importer/CHANGELOG.md +84 -0
  481. package/node_modules/@imgly/figma-importer/LICENSE.md +137 -0
  482. package/node_modules/@imgly/figma-importer/README.md +256 -0
  483. package/node_modules/@imgly/figma-importer/THIRD_PARTY_NOTICES.md +446 -0
  484. package/node_modules/@imgly/figma-importer/dist/index.cjs +2 -0
  485. package/node_modules/@imgly/figma-importer/dist/index.d.cts +12831 -0
  486. package/node_modules/@imgly/figma-importer/dist/index.d.ts +12831 -0
  487. package/node_modules/@imgly/figma-importer/dist/index.js +2 -0
  488. package/node_modules/@imgly/figma-importer/package.json +85 -0
  489. package/node_modules/@imgly/html-exporter/CHANGELOG.md +35 -0
  490. package/node_modules/@imgly/html-exporter/README.md +45 -4
  491. package/node_modules/@imgly/html-exporter/dist/index.cjs +610 -493
  492. package/node_modules/@imgly/html-exporter/dist/index.d.cts +235 -216
  493. package/node_modules/@imgly/html-exporter/dist/index.d.ts +235 -216
  494. package/node_modules/@imgly/html-exporter/dist/index.js +610 -493
  495. package/node_modules/@imgly/html-exporter/package.json +15 -10
  496. package/node_modules/@imgly/idml-exporter/CHANGELOG.md +10 -0
  497. package/node_modules/@imgly/idml-exporter/README.md +17 -18
  498. package/node_modules/@imgly/idml-exporter/dist/harfbuzz.browser.js +1 -1
  499. package/node_modules/@imgly/idml-exporter/dist/index.cjs +8 -11
  500. package/node_modules/@imgly/idml-exporter/dist/index.d.cts +14480 -10275
  501. package/node_modules/@imgly/idml-exporter/dist/index.d.ts +14480 -10275
  502. package/node_modules/@imgly/idml-exporter/dist/index.js +8 -10
  503. package/node_modules/@imgly/idml-exporter/dist/woff2.browser.js +14 -14
  504. package/node_modules/@imgly/idml-exporter/package.json +17 -12
  505. package/node_modules/@imgly/idml-importer/CHANGELOG.md +37 -0
  506. package/node_modules/@imgly/idml-importer/README.md +148 -17
  507. package/node_modules/@imgly/idml-importer/dist/index.cjs +6 -5
  508. package/node_modules/@imgly/idml-importer/dist/index.d.cts +1003 -632
  509. package/node_modules/@imgly/idml-importer/dist/index.d.ts +1003 -632
  510. package/node_modules/@imgly/idml-importer/dist/index.js +6 -5
  511. package/node_modules/@imgly/idml-importer/package.json +9 -9
  512. package/node_modules/@imgly/pdf-importer/CHANGELOG.md +59 -0
  513. package/node_modules/@imgly/pdf-importer/README.md +71 -7
  514. package/node_modules/@imgly/pdf-importer/dist/browser.d.ts +940 -788
  515. package/node_modules/@imgly/pdf-importer/dist/browser.js +17 -15
  516. package/node_modules/@imgly/pdf-importer/dist/node.cjs +17 -16
  517. package/node_modules/@imgly/pdf-importer/dist/node.d.cts +940 -788
  518. package/node_modules/@imgly/pdf-importer/dist/node.d.ts +940 -788
  519. package/node_modules/@imgly/pdf-importer/dist/node.js +17 -15
  520. package/node_modules/@imgly/pdf-importer/dist/pdf.worker.mjs +80265 -61990
  521. package/node_modules/@imgly/pdf-importer/package.json +13 -13
  522. package/node_modules/@imgly/psd-exporter/CHANGELOG.md +12 -0
  523. package/node_modules/@imgly/psd-exporter/README.md +50 -7
  524. package/node_modules/@imgly/psd-exporter/dist/index.cjs +5 -7
  525. package/node_modules/@imgly/psd-exporter/dist/index.d.cts +14332 -10063
  526. package/node_modules/@imgly/psd-exporter/dist/index.d.ts +14332 -10063
  527. package/node_modules/@imgly/psd-exporter/dist/index.js +5 -6
  528. package/node_modules/@imgly/psd-exporter/dist/wawoff2-LICENSE.txt +19 -0
  529. package/node_modules/@imgly/psd-exporter/dist/woff2.browser.js +19 -0
  530. package/node_modules/@imgly/psd-exporter/package.json +26 -9
  531. package/node_modules/@imgly/psd-importer/CHANGELOG.md +29 -1
  532. package/node_modules/@imgly/psd-importer/README.md +22 -30
  533. package/node_modules/@imgly/psd-importer/dist/index.cjs +11 -11
  534. package/node_modules/@imgly/psd-importer/dist/index.d.cts +10479 -12978
  535. package/node_modules/@imgly/psd-importer/dist/index.d.ts +10479 -12978
  536. package/node_modules/@imgly/psd-importer/dist/index.js +11 -11
  537. package/node_modules/@imgly/psd-importer/package.json +8 -11
  538. package/package.json +28 -17
  539. package/node_modules/@imgly/pdf-importer/dist/browser.d.cts +0 -941
@@ -1 +1 @@
1
- {"version":3,"file":"write-atomic.d.ts","sourceRoot":"","sources":["../../../src/services/workspace/write-atomic.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE/D;;;;;;GAMG;AACH,uHAAuH;AACvH,MAAM,MAAM,QAAQ,GAAG,WAAW,GAAG;IAAE,IAAI,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC;AAE5E,wBAAsB,WAAW,CAC/B,EAAE,EAAE,QAAQ,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,UAAU,GAAG,MAAM,GACxB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,EAAE,EAAE,QAAQ,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,UAAU,GAAG,MAAM,GACxB,OAAO,CAAC,eAAe,CAAC,CAE1B;AAiCD,yGAAyG;AACzG,wBAAsB,aAAa,CACjC,EAAE,EAA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AAO,CAAC,IAAI,CAAC,CAEf;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,EAAE,EAAE,QAAQ,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,UAAU,GAAG,MAAM,GACxB,OAAO,CAAC,eAAe,CAAC,CAE1B;AAsCD,yGAAyG;AACzG,wBAAsB,aAAa,CACjC,EAAE,EAAE;IAAE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,EACvD,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,iBAgBX;AAaD,sEAAsE;AACtE,eAAO,MAAM,WAAW,QAAwB,CAAC;AACjD,6FAA6F;AAC7F,eAAO,MAAM,aAAa,QAAc,CAAC;AAEzC;;;GAGG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,MAAM,EACd,EAAE,KAAK,EAAE,WAAe,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAClE,OAAO,CAAC,IAAI,CAAC,CAiBf;AAED,mHAAmH;AACnH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYlE;AAmDD;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,EAAE,IAAY,EAAE,IAAI,EAAE,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAC7D,IAAI,CAmBN"}
@@ -14,6 +14,11 @@ export async function writeAtomicStamped(fs, path, data) {
14
14
  return (await replace(fs, path, data, true));
15
15
  }
16
16
  async function replace(fs, path, data, stamped) {
17
+ // ObjectStoreWorkspaceFS: its writeFile is one object-store PUT, already whole or absent; a rename there is a copy.
18
+ if ('atomicWrites' in fs && fs.atomicWrites === true) {
19
+ await fs.writeFile(path, data);
20
+ return stamped ? fs.stat(path) : undefined;
21
+ }
17
22
  const tmp = `${path}.${globalThis.crypto.randomUUID().slice(0, 8)}.tmp`;
18
23
  let stamp;
19
24
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"write-atomic.js","sourceRoot":"","sources":["../../../src/services/workspace/write-atomic.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,SAAS,EACV,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,IAAI,EAAE,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAc/D,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,EAAY,EACZ,IAAY,EACZ,IAAyB;IAEzB,MAAM,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AACvC,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,EAAY,EACZ,IAAY,EACZ,IAAyB;IAEzB,OAAO,CAAC,MAAM,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAE,CAAC;AAChD,CAAC;AAED,KAAK,UAAU,OAAO,CACpB,EAAY,EACZ,IAAY,EACZ,IAAyB,EACzB,OAAgB;IAEhB,MAAM,GAAG,GAAG,GAAG,IAAI,IAAI,UAAU,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC;IACxE,IAAI,KAAkC,CAAC;IACvC,IAAI,CAA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,CAAC,KAAK,IAAI;gBAAE,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QAC3C,CAAC;QACD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChC,0FAA0F;QAC1F,IAAI,SAAS,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,KAAK,CAAC,MAAM;YACvC,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,gCAAgC,CAAC,CAAC;QAC3D,IAAI,IAAI;YAAE,SAAS,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC;YAAS,CAAC;QACT,SAAS,CAAC,EAAE,CAAC,CAAC;IAChB,CAAC;AACH,CAAC","sourcesContent":["import {\n closeSync,\n fstatSync,\n fsyncSync,\n mkdirSync,\n openSync,\n readSync,\n writeSync\n} from 'node:fs';\nimport { readdir, readFile, rm, stat } from 'node:fs/promises';\nimport { hostname } from 'node:os';\nimport path, { posix as posixPath } from 'node:path';\n\nimport { parseLockFile } from '@imgly/codesign-router/lock.js';\n\nimport type { FileHandleStats, WorkspaceFS } from './types.js';\n\n/**\n * Replace `path` so a reader sees the old file or the new one, never a part of either, durably (spec W12): the\n * temporary's bytes are synced before the rename makes them the file, and the folder after it, so the new name is on\n * the disk too. `sync` is there on NodeWorkspaceFS (a test pins that); only test fakes lack it.\n * The folder's sync comes after the file already replaced the old one, so a failure there is not the write's. Only the\n * file's own folder is synced: a folder writeFile makes on the way (a new design shard) is not.\n */\n/** A WorkspaceFS that can flush a file's bytes or a folder's entries to the disk: NodeWorkspaceFS (a test pins it). */\nexport type Syncable = WorkspaceFS & { sync?(path: string): Promise<void> };\n\nexport async function writeAtomic(\n fs: Syncable,\n path: string,\n data: Uint8Array | string\n): Promise<void> {\n await replace(fs, path, data, false);\n}\n\n/**\n * writeAtomic, answering the file's stat as written: taken from the temporary before the rename (which keeps it), so a\n * write that replaces the file right after cannot lend its own.\n */\nexport async function writeAtomicStamped(\n fs: Syncable,\n path: string,\n data: Uint8Array | string\n): Promise<FileHandleStats> {\n return (await replace(fs, path, data, true))!;\n}\n\nasync function replace(\n fs: Syncable,\n path: string,\n data: Uint8Array | string,\n stamped: boolean\n): Promise<FileHandleStats | undefined> {\n const tmp = `${path}.${globalThis.crypto.randomUUID().slice(0, 8)}.tmp`;\n let stamp: FileHandleStats | undefined;\n try {\n await fs.writeFile(tmp, data);\n await fs.sync?.(tmp);\n if (stamped) stamp = await fs.stat(tmp);\n await renameRetried(fs, tmp, path);\n } catch (err) {\n await fs.rm(tmp, { force: true });\n throw err;\n }\n await fs.sync?.(folderOf(path)).catch((err: { code?: string }) => {\n // A folder gone, or one the OS cannot sync (Windows): nothing to do. Anything else is said, as the file is in\n // place but its name may not be on the disk yet.\n if (!FOLDER_SYNC_UNSUPPORTED.has(err.code ?? ''))\n process.stderr.write(\n `codesign: the folder of ${path} could not be synced to the disk (${err.code ?? String(err)}); the file is written.\\n`\n );\n });\n return stamp;\n}\n\n/** What Windows answers while another process has the file open or a scanner reads it: gone in moments (graceful-fs). */\nconst WINDOWS_HELD = new Set(['EPERM', 'EACCES', 'EBUSY']);\n\n/** The rename, tried again on Windows for about a second (20..180 ms apart) while the target is held. */\nexport async function renameRetried(\n fs: { rename(from: string, to: string): Promise<void> },\n from: string,\n to: string\n) {\n for (let attempt = 1; ; attempt++) {\n try {\n return await fs.rename(from, to);\n } catch (err) {\n const code = (err as { code?: string }).code ?? '';\n if (\n process.platform !== 'win32' ||\n !WINDOWS_HELD.has(code) ||\n attempt === 10\n )\n throw err;\n await new Promise((resolve) => setTimeout(resolve, attempt * 20));\n }\n }\n}\n\nconst FOLDER_SYNC_UNSUPPORTED = new Set([\n 'ENOENT',\n 'EISDIR',\n 'EPERM',\n 'EINVAL',\n 'EBADF'\n]);\n\n/** A WorkspaceFS path's folder ('/'-separated on every OS; '.' for the workspace itself). */\nconst folderOf = (file: string) => posixPath.dirname(file);\n\n/** The name writeAtomic gives its temporary: `<file>.<8 hex>.tmp`. */\nexport const ATOMIC_TEMP = /\\.[0-9a-f]{8}\\.tmp$/;\n/** A temporary this old is a killed writer's: a live save renames its own within moments. */\nexport const STALE_TEMP_MS = 10 * 60_000;\n\n/**\n * Removes the temporaries a killed writer left in `folder` and below: names `match` matches, last written more than\n * `olderThanMs` ago (0: every one, for a writer that holds the lock against all others).\n */\nexport async function sweepTemps(\n folder: string,\n { match, olderThanMs = 0 }: { match: RegExp; olderThanMs?: number }\n): Promise<void> {\n const entries = await readdir(folder, {\n recursive: true,\n withFileTypes: true\n }).catch(() => []);\n for (const e of entries) {\n if (!e.isFile() || !match.test(e.name)) continue;\n const file = path.join(e.parentPath, e.name);\n if (olderThanMs > 0) {\n const at = await stat(file).then(\n (st) => st.mtimeMs,\n () => undefined\n );\n if (at === undefined || Date.now() - at <= olderThanMs) continue;\n }\n await rm(file, { force: true });\n }\n}\n\n/** writeAtomic's temporaries a killed writer left in the folders it writes, by age (a live save keeps its own). */\nexport async function sweepAtomicTemps(root: string): Promise<void> {\n for (const folder of ['designs', 'styles', 'sources', 'assets'])\n await sweepTemps(path.join(root, folder), {\n match: ATOMIC_TEMP,\n olderThanMs: STALE_TEMP_MS\n });\n // An import's conversion of an archive (import-workspace.ts), by the same age rule.\n await sweepTemps(path.join(root, 'designs'), {\n match: /\\.imgly\\.importing$/,\n olderThanMs: STALE_TEMP_MS\n });\n await sweepCasLocks(root);\n}\n\n/** Another host's lock is taken over only once unseen this long (the router's rule, R8). */\nconst OTHER_HOST_STALE_MS = 30 * 60_000;\n\n/**\n * The record locks (`.cas/`, compareAndSet, R37) a killed write left: one older than STALE_TEMP_MS whose holder is no live\n * process of this host, or another host's older than OTHER_HOST_STALE_MS. A live compareAndSet holds its lock for\n * milliseconds; a fresh one is never touched.\n */\nasync function sweepCasLocks(root: string): Promise<void> {\n const dir = path.join(root, '.cas');\n for (const name of await readdir(dir).catch(() => [] as string[])) {\n const file = path.join(dir, name);\n const at = await stat(file).then(\n (st) => (st.isFile() ? st.mtimeMs : undefined),\n () => undefined\n );\n if (at === undefined) continue;\n const age = Date.now() - at;\n if (age <= STALE_TEMP_MS) continue;\n const text = await readFile(file, 'utf8').catch(() => '');\n const held = parseLockFile(text);\n const elsewhere = held?.host !== undefined && held.host !== hostname();\n if (\n elsewhere\n ? age <= OTHER_HOST_STALE_MS\n : held !== undefined && alive(held.pid)\n )\n continue;\n // A live writer may have taken the dead one's lock over meanwhile: only the same, still old file goes.\n const again = await readFile(file, 'utf8').catch(() => undefined);\n const unchanged = await stat(file).then(\n (st) => st.mtimeMs === at,\n () => false\n );\n if (again === text && unchanged) await rm(file, { force: true });\n }\n}\n\n/** Whether `pid` is a live process of this host, as the router judges it: any error but ESRCH counts as alive. */\nfunction alive(pid: number): boolean {\n if (!Number.isInteger(pid) || pid <= 0) return false;\n try {\n process.kill(pid, 0);\n return true;\n } catch (err) {\n return (err as NodeJS.ErrnoException).code !== 'ESRCH';\n }\n}\n\n/**\n * Appends `line` and a newline to the JSONL file at `file` in one small write (W6): readers skip a torn line, and a torn\n * tail (a crash, a short write) gets a newline first, so it never glues onto the next record. `sync`: on disk before it\n * returns (a log later imports trust); a stream of updates leaves it off.\n */\nexport function appendLine(\n file: string,\n line: string,\n { sync = false, mode }: { sync?: boolean; mode?: number } = {}\n): void {\n mkdirSync(path.dirname(file), { recursive: true });\n const fd = openSync(file, 'a+', mode);\n try {\n let text = `${line}\\n`;\n const { size } = fstatSync(fd);\n if (size > 0) {\n const last = Buffer.alloc(1);\n readSync(fd, last, 0, 1, size - 1);\n if (last[0] !== 0x0a) text = `\\n${text}`;\n }\n const bytes = Buffer.from(text);\n // A short write (a full disk) is an error: the next append starts on a fresh line anyway.\n if (writeSync(fd, bytes) !== bytes.length)\n throw new Error(`${file}: the line was written in part`);\n if (sync) fsyncSync(fd);\n } finally {\n closeSync(fd);\n }\n}\n"]}
1
+ {"version":3,"file":"write-atomic.js","sourceRoot":"","sources":["../../../src/services/workspace/write-atomic.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAC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AAC,CAAC,KAAK,IAAI;gBAAE,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QAC3C,CAAC;QACD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChC,0FAA0F;QAC1F,IAAI,SAAS,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,KAAK,CAAC,MAAM;YACvC,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,gCAAgC,CAAC,CAAC;QAC3D,IAAI,IAAI;YAAE,SAAS,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC;YAAS,CAAC;QACT,SAAS,CAAC,EAAE,CAAC,CAAC;IAChB,CAAC;AACH,CAAC","sourcesContent":["import {\n closeSync,\n fstatSync,\n fsyncSync,\n mkdirSync,\n openSync,\n readSync,\n writeSync\n} from 'node:fs';\nimport { readdir, readFile, rm, stat } from 'node:fs/promises';\nimport { hostname } from 'node:os';\nimport path, { posix as posixPath } from 'node:path';\n\nimport { parseLockFile } from '@imgly/codesign-router/lock.js';\n\nimport type { FileHandleStats, WorkspaceFS } from './types.js';\n\n/**\n * Replace `path` so a reader sees the old file or the new one, never a part of either, durably (spec W12): the\n * temporary's bytes are synced before the rename makes them the file, and the folder after it, so the new name is on\n * the disk too. `sync` is there on NodeWorkspaceFS (a test pins that); only test fakes lack it.\n * The folder's sync comes after the file already replaced the old one, so a failure there is not the write's. Only the\n * file's own folder is synced: a folder writeFile makes on the way (a new design shard) is not.\n */\n/** A WorkspaceFS that can flush a file's bytes or a folder's entries to the disk: NodeWorkspaceFS (a test pins it). */\nexport type Syncable = WorkspaceFS & { sync?(path: string): Promise<void> };\n\nexport async function writeAtomic(\n fs: Syncable,\n path: string,\n data: Uint8Array | string\n): Promise<void> {\n await replace(fs, path, data, false);\n}\n\n/**\n * writeAtomic, answering the file's stat as written: taken from the temporary before the rename (which keeps it), so a\n * write that replaces the file right after cannot lend its own.\n */\nexport async function writeAtomicStamped(\n fs: Syncable,\n path: string,\n data: Uint8Array | string\n): Promise<FileHandleStats> {\n return (await replace(fs, path, data, true))!;\n}\n\nasync function replace(\n fs: Syncable,\n path: string,\n data: Uint8Array | string,\n stamped: boolean\n): Promise<FileHandleStats | undefined> {\n // ObjectStoreWorkspaceFS: its writeFile is one object-store PUT, already whole or absent; a rename there is a copy.\n if ('atomicWrites' in fs && fs.atomicWrites === true) {\n await fs.writeFile(path, data);\n return stamped ? fs.stat(path) : undefined;\n }\n const tmp = `${path}.${globalThis.crypto.randomUUID().slice(0, 8)}.tmp`;\n let stamp: FileHandleStats | undefined;\n try {\n await fs.writeFile(tmp, data);\n await fs.sync?.(tmp);\n if (stamped) stamp = await fs.stat(tmp);\n await renameRetried(fs, tmp, path);\n } catch (err) {\n await fs.rm(tmp, { force: true });\n throw err;\n }\n await fs.sync?.(folderOf(path)).catch((err: { code?: string }) => {\n // A folder gone, or one the OS cannot sync (Windows): nothing to do. Anything else is said, as the file is in\n // place but its name may not be on the disk yet.\n if (!FOLDER_SYNC_UNSUPPORTED.has(err.code ?? ''))\n process.stderr.write(\n `codesign: the folder of ${path} could not be synced to the disk (${err.code ?? String(err)}); the file is written.\\n`\n );\n });\n return stamp;\n}\n\n/** What Windows answers while another process has the file open or a scanner reads it: gone in moments (graceful-fs). */\nconst WINDOWS_HELD = new Set(['EPERM', 'EACCES', 'EBUSY']);\n\n/** The rename, tried again on Windows for about a second (20..180 ms apart) while the target is held. */\nexport async function renameRetried(\n fs: { rename(from: string, to: string): Promise<void> },\n from: string,\n to: string\n) {\n for (let attempt = 1; ; attempt++) {\n try {\n return await fs.rename(from, to);\n } catch (err) {\n const code = (err as { code?: string }).code ?? '';\n if (\n process.platform !== 'win32' ||\n !WINDOWS_HELD.has(code) ||\n attempt === 10\n )\n throw err;\n await new Promise((resolve) => setTimeout(resolve, attempt * 20));\n }\n }\n}\n\nconst FOLDER_SYNC_UNSUPPORTED = new Set([\n 'ENOENT',\n 'EISDIR',\n 'EPERM',\n 'EINVAL',\n 'EBADF'\n]);\n\n/** A WorkspaceFS path's folder ('/'-separated on every OS; '.' for the workspace itself). */\nconst folderOf = (file: string) => posixPath.dirname(file);\n\n/** The name writeAtomic gives its temporary: `<file>.<8 hex>.tmp`. */\nexport const ATOMIC_TEMP = /\\.[0-9a-f]{8}\\.tmp$/;\n/** A temporary this old is a killed writer's: a live save renames its own within moments. */\nexport const STALE_TEMP_MS = 10 * 60_000;\n\n/**\n * Removes the temporaries a killed writer left in `folder` and below: names `match` matches, last written more than\n * `olderThanMs` ago (0: every one, for a writer that holds the lock against all others).\n */\nexport async function sweepTemps(\n folder: string,\n { match, olderThanMs = 0 }: { match: RegExp; olderThanMs?: number }\n): Promise<void> {\n const entries = await readdir(folder, {\n recursive: true,\n withFileTypes: true\n }).catch(() => []);\n for (const e of entries) {\n if (!e.isFile() || !match.test(e.name)) continue;\n const file = path.join(e.parentPath, e.name);\n if (olderThanMs > 0) {\n const at = await stat(file).then(\n (st) => st.mtimeMs,\n () => undefined\n );\n if (at === undefined || Date.now() - at <= olderThanMs) continue;\n }\n await rm(file, { force: true });\n }\n}\n\n/** writeAtomic's temporaries a killed writer left in the folders it writes, by age (a live save keeps its own). */\nexport async function sweepAtomicTemps(root: string): Promise<void> {\n for (const folder of ['designs', 'styles', 'sources', 'assets'])\n await sweepTemps(path.join(root, folder), {\n match: ATOMIC_TEMP,\n olderThanMs: STALE_TEMP_MS\n });\n // An import's conversion of an archive (import-workspace.ts), by the same age rule.\n await sweepTemps(path.join(root, 'designs'), {\n match: /\\.imgly\\.importing$/,\n olderThanMs: STALE_TEMP_MS\n });\n await sweepCasLocks(root);\n}\n\n/** Another host's lock is taken over only once unseen this long (the router's rule, R8). */\nconst OTHER_HOST_STALE_MS = 30 * 60_000;\n\n/**\n * The record locks (`.cas/`, compareAndSet, R37) a killed write left: one older than STALE_TEMP_MS whose holder is no live\n * process of this host, or another host's older than OTHER_HOST_STALE_MS. A live compareAndSet holds its lock for\n * milliseconds; a fresh one is never touched.\n */\nasync function sweepCasLocks(root: string): Promise<void> {\n const dir = path.join(root, '.cas');\n for (const name of await readdir(dir).catch(() => [] as string[])) {\n const file = path.join(dir, name);\n const at = await stat(file).then(\n (st) => (st.isFile() ? st.mtimeMs : undefined),\n () => undefined\n );\n if (at === undefined) continue;\n const age = Date.now() - at;\n if (age <= STALE_TEMP_MS) continue;\n const text = await readFile(file, 'utf8').catch(() => '');\n const held = parseLockFile(text);\n const elsewhere = held?.host !== undefined && held.host !== hostname();\n if (\n elsewhere\n ? age <= OTHER_HOST_STALE_MS\n : held !== undefined && alive(held.pid)\n )\n continue;\n // A live writer may have taken the dead one's lock over meanwhile: only the same, still old file goes.\n const again = await readFile(file, 'utf8').catch(() => undefined);\n const unchanged = await stat(file).then(\n (st) => st.mtimeMs === at,\n () => false\n );\n if (again === text && unchanged) await rm(file, { force: true });\n }\n}\n\n/** Whether `pid` is a live process of this host, as the router judges it: any error but ESRCH counts as alive. */\nfunction alive(pid: number): boolean {\n if (!Number.isInteger(pid) || pid <= 0) return false;\n try {\n process.kill(pid, 0);\n return true;\n } catch (err) {\n return (err as NodeJS.ErrnoException).code !== 'ESRCH';\n }\n}\n\n/**\n * Appends `line` and a newline to the JSONL file at `file` in one small write (W6): readers skip a torn line, and a torn\n * tail (a crash, a short write) gets a newline first, so it never glues onto the next record. `sync`: on disk before it\n * returns (a log later imports trust); a stream of updates leaves it off.\n */\nexport function appendLine(\n file: string,\n line: string,\n { sync = false, mode }: { sync?: boolean; mode?: number } = {}\n): void {\n mkdirSync(path.dirname(file), { recursive: true });\n const fd = openSync(file, 'a+', mode);\n try {\n let text = `${line}\\n`;\n const { size } = fstatSync(fd);\n if (size > 0) {\n const last = Buffer.alloc(1);\n readSync(fd, last, 0, 1, size - 1);\n if (last[0] !== 0x0a) text = `\\n${text}`;\n }\n const bytes = Buffer.from(text);\n // A short write (a full disk) is an error: the next append starts on a fresh line anyway.\n if (writeSync(fd, bytes) !== bytes.length)\n throw new Error(`${file}: the line was written in part`);\n if (sync) fsyncSync(fd);\n } finally {\n closeSync(fd);\n }\n}\n"]}
@@ -42,21 +42,23 @@
42
42
  "dependencies": {
43
43
  "@imgly/codesign-agent": "0.7.2",
44
44
  "@imgly/codesign-router": "0.7.2",
45
- "@imgly/codesign-sdk": "1.85.0",
46
- "@imgly/html-exporter": "0.2.0"
45
+ "@imgly/codesign-sdk": "1.86.0",
46
+ "@imgly/html-exporter": "0.3.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@cesdk/engine": "1.85.3",
50
- "@imgly/idml-exporter": "^0.1.0",
51
- "@imgly/idml-importer": "^2.0.2",
49
+ "@cesdk/engine": "1.86.2",
50
+ "@imgly/figma-exporter": "^0.2.1",
51
+ "@imgly/figma-importer": "^0.2.1",
52
+ "@imgly/idml-exporter": "^0.1.1",
53
+ "@imgly/idml-importer": "^3.0.0",
52
54
  "@imgly/lottie-importer": "^0.2.0",
53
- "@imgly/pdf-importer": "^0.3.2",
54
- "@imgly/plugin-ai-apps-web": "1.85.3",
55
- "@imgly/plugin-ai-image-generation-web": "1.85.3",
56
- "@imgly/plugin-ai-text-generation-web": "1.85.3",
55
+ "@imgly/pdf-importer": "^0.6.0",
56
+ "@imgly/plugin-ai-apps-web": "1.86.2",
57
+ "@imgly/plugin-ai-image-generation-web": "1.86.2",
58
+ "@imgly/plugin-ai-text-generation-web": "1.86.2",
57
59
  "@imgly/pptx-importer": "^0.3.1",
58
- "@imgly/psd-exporter": "^0.1.0",
59
- "@imgly/psd-importer": "^0.5.1",
60
+ "@imgly/psd-exporter": "^0.2.0",
61
+ "@imgly/psd-importer": "^0.6.0",
60
62
  "@types/express": "^4.17.21",
61
63
  "@types/node": "^24.3.0",
62
64
  "@types/pngjs": "^6.0.5",
@@ -8,7 +8,8 @@ import type { DesignRule } from '../rule.js';
8
8
  * Deliberately under-detects (skips rather than guesses) in three cases, all the safe direction:
9
9
  * - foreground/background color is CMYK or Spot (no luminance without conversion),
10
10
  * - nothing opaque sits behind the text (`backgroundBehind` is null — unknown background),
11
- * - the background is an image/gradient fill (no readable RGBA color).
11
+ * - the background is an image/gradient fill (no readable RGBA color),
12
+ * - the background's fill colour is translucent (what shows through it is not read).
12
13
  */
13
14
  export declare const textLegibility: DesignRule;
14
15
  //# sourceMappingURL=text-legibility.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-legibility.d.ts","sourceRoot":"","sources":["../../src/rules/text-legibility.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AA6C7C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,EAAE,UAiE5B,CAAC"}
1
+ {"version":3,"file":"text-legibility.d.ts","sourceRoot":"","sources":["../../src/rules/text-legibility.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AA+C7C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,EAAE,UAiE5B,CAAC"}
@@ -31,6 +31,9 @@ function rgbaFillBehind(engine, bg) {
31
31
  // Only sRGB is luminance-comparable here. CMYK/Spot would need conversion → skip.
32
32
  if (colorSpaceOf(color) !== 'sRGB')
33
33
  return null;
34
+ // A translucent fill shows what is behind it: its colour alone is not the background → skip.
35
+ if (color.a < 1)
36
+ return null;
34
37
  return color;
35
38
  }
36
39
  /** The text's own opaque sRGB background field, when it is on. */
@@ -51,7 +54,8 @@ function ownField(engine, text) {
51
54
  * Deliberately under-detects (skips rather than guesses) in three cases, all the safe direction:
52
55
  * - foreground/background color is CMYK or Spot (no luminance without conversion),
53
56
  * - nothing opaque sits behind the text (`backgroundBehind` is null — unknown background),
54
- * - the background is an image/gradient fill (no readable RGBA color).
57
+ * - the background is an image/gradient fill (no readable RGBA color),
58
+ * - the background's fill colour is translucent (what shows through it is not read).
55
59
  */
56
60
  export const textLegibility = {
57
61
  meta: {
@@ -1 +1 @@
1
- {"version":3,"file":"text-legibility.js","sourceRoot":"","sources":["../../src/rules/text-legibility.ts"],"names":[],"mappings":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,EAAE,GAAG,KAAK,aAAa;iBAChC,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC;QAEF,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACzB,CAAC;CACF,CAAC","sourcesContent":["import {\n backgroundBehind,\n togetherOption\n} from '../block-queries/background.js';\nimport { colorProps } from '../block-queries/color-props.js';\nimport { contrastRatio } from '../block-queries/contrast.js';\nimport type { RGBAColor } from '../color.js';\nimport { colorSpaceOf } from '../color.js';\nimport type { BlockId, EngineLike, FontWeight } from '../engine-types.js';\nimport type { DesignRule } from '../rule.js';\n\n// WCAG AA contrast thresholds. Normal text needs ≥ 4.5:1; large text needs only ≥ 3.0:1.\nconst AA_NORMAL = 4.5;\nconst AA_LARGE = 3.0;\n\n// \"Large text\" per WCAG: ≥ 18pt, OR ≥ 14pt when bold.\nconst LARGE_PT = 18;\nconst LARGE_BOLD_PT = 14;\n\n// Requested-bold weights that qualify a 14pt run as \"large\" for the relaxed threshold.\nconst BOLD_WEIGHTS: ReadonlySet<FontWeight> = new Set<FontWeight>([\n 'bold',\n 'extraBold',\n 'heavy',\n 'semiBold'\n]);\n\n/**\n * The background block's solid FILL color, when it has one and it's a readable RGBA value.\n *\n * `colorProps` only emits a fill-color target for a genuine color fill (it checks the fill type\n * first), so an image/gradient background produces no fill target and we skip it — the spec's\n * caveat. We pick the fill target explicitly (its key ends with `fill/color/value`), not just any\n * target (which could be a stroke).\n */\nfunction rgbaFillBehind(engine: EngineLike, bg: BlockId): RGBAColor | null {\n const fillTarget = colorProps(engine, bg).find((t) =>\n t.key.endsWith(':fill/color/value')\n );\n if (!fillTarget) return null; // image/gradient/no color fill → skip\n const color = fillTarget.read(engine);\n // Only sRGB is luminance-comparable here. CMYK/Spot would need conversion → skip.\n if (colorSpaceOf(color) !== 'sRGB') return null;\n return color as RGBAColor;\n}\n\n/** The text's own opaque sRGB background field, when it is on. */\nfunction ownField(engine: EngineLike, text: BlockId): RGBAColor | null {\n if (!engine.block.getBool(text, 'backgroundColor/enabled')) return null;\n const color = engine.block.getColor(text, 'backgroundColor/color');\n if (colorSpaceOf(color) !== 'sRGB') return null;\n return (color as RGBAColor).a >= 1 ? (color as RGBAColor) : null;\n}\n\n/**\n * Flags text whose contrast against its opaque background falls below WCAG AA. This is the one\n * true hard-fail of the lint set: `type: 'problem'` and every finding is `severity: 'error'`.\n *\n * Report-only — recoloring is a design decision, never auto-applied.\n *\n * Deliberately under-detects (skips rather than guesses) in three cases, all the safe direction:\n * - foreground/background color is CMYK or Spot (no luminance without conversion),\n * - nothing opaque sits behind the text (`backgroundBehind` is null — unknown background),\n * - the background is an image/gradient fill (no readable RGBA color).\n */\nexport const textLegibility: DesignRule = {\n meta: {\n id: 'text/legibility',\n type: 'problem',\n docs: {\n description: 'Text must meet WCAG AA contrast against its background.'\n },\n messages: {\n lowContrast:\n 'Text block {{id}} has contrast {{ratio}}:1 against its background (WCAG AA needs {{min}}:1).'\n }\n },\n create(ctx) {\n const { engine } = ctx;\n // WCAG's large-text sizes in points, overridable for an engine whose font sizes use another unit.\n const largePt = (ctx.options.largePt as number | undefined) ?? LARGE_PT;\n const largeBoldPt =\n (ctx.options.largeBoldPt as number | undefined) ??\n (largePt * LARGE_BOLD_PT) / LARGE_PT;\n const together = togetherOption(ctx.options);\n\n const check = (block: BlockId) => {\n // 1. Foreground: first text color, only if it's RGBA.\n const fg = engine.block.getTextColors(block)[0];\n if (!fg || colorSpaceOf(fg) !== 'sRGB') return; // skip CMYK/Spot (no luminance)\n\n // 2. Background: the text's own opaque field, else the opaque covering sibling behind it, with a readable RGBA fill.\n let bgColor = ownField(engine, block);\n let bg: BlockId | null = block;\n if (!bgColor) {\n bg = backgroundBehind(engine, block, undefined, together);\n if (bg == null) return; // unknown background — skip (safe direction)\n bgColor = rgbaFillBehind(engine, bg);\n }\n if (!bgColor) return; // image/gradient/non-RGBA background — skip\n\n // 3. Threshold by text size: large text gets the relaxed 3.0:1.\n const sizes = engine.block.getTextFontSizes(block);\n const maxPt = sizes.length ? Math.max(...sizes) : 0;\n const isBold = engine.block\n .getTextFontWeights(block)\n .some((w) => BOLD_WEIGHTS.has(w));\n const isLarge = maxPt >= largePt || (isBold && maxPt >= largeBoldPt);\n const min = isLarge ? AA_LARGE : AA_NORMAL;\n\n // 4. Compare and report.\n const ratio = contrastRatio(fg as RGBAColor, bgColor);\n if (ratio < min) {\n ctx.report({\n blockId: block,\n messageId: 'lowContrast',\n severity: 'error',\n data: {\n id: String(block),\n ratio: +ratio.toFixed(2),\n min,\n bg: String(bg)\n },\n property: `${block}:text/color`\n });\n }\n };\n\n return { text: check };\n }\n};\n"]}
1
+ {"version":3,"file":"text-legibility.js","sourceRoot":"","sources":["../../src/rules/text-legibility.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,cAAc,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI3C,yFAAyF;AACzF,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,QAAQ,GAAG,GAAG,CAAC;AAErB,sDAAsD;AACtD,MAAM,QAAQ,GAAG,EAAE,CAAC;AACpB,MAAM,aAAa,GAAG,EAAE,CAAC;AAEzB,uFAAuF;AACvF,MAAM,YAAY,GAA4B,IAAI,GAAG,CAAa;IAChE,MAAM;IACN,WAAW;IACX,OAAO;IACP,UAAU;CACX,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,SAAS,cAAc,CAAC,MAAkB,EAAE,EAAW;IACrD,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CACnD,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CACpC,CAAC;IACF,IAAI,CAAC,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,MAAM,IAAI,KAAK,IAAI,WAAW,CAAC,CAAC;YACrE,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;YAE3C,yBAAyB;YACzB,MAAM,KAAK,GAAG,aAAa,CAAC,EAAe,EAAE,OAAO,CAAC,CAAC;YACtD,IAAI,KAAK,GAAG,GAAG,EAAE,CAAC;gBAChB,GAAG,CAAC,MAAM,CAAC;oBACT,OAAO,EAAE,KAAK;oBACd,SAAS,EAAE,aAAa;oBACxB,QAAQ,EAAE,OAAO;oBACjB,IAAI,EAAE;wBACJ,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC;wBACjB,KAAK,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;wBACxB,GAAG;wBACH,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC;qBACf;oBACD,QAAQ,EAAE,GAAG,KAAK,aAAa;iBAChC,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC;QAEF,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACzB,CAAC;CACF,CAAC","sourcesContent":["import {\n backgroundBehind,\n togetherOption\n} from '../block-queries/background.js';\nimport { colorProps } from '../block-queries/color-props.js';\nimport { contrastRatio } from '../block-queries/contrast.js';\nimport type { RGBAColor } from '../color.js';\nimport { colorSpaceOf } from '../color.js';\nimport type { BlockId, EngineLike, FontWeight } from '../engine-types.js';\nimport type { DesignRule } from '../rule.js';\n\n// WCAG AA contrast thresholds. Normal text needs ≥ 4.5:1; large text needs only ≥ 3.0:1.\nconst AA_NORMAL = 4.5;\nconst AA_LARGE = 3.0;\n\n// \"Large text\" per WCAG: ≥ 18pt, OR ≥ 14pt when bold.\nconst LARGE_PT = 18;\nconst LARGE_BOLD_PT = 14;\n\n// Requested-bold weights that qualify a 14pt run as \"large\" for the relaxed threshold.\nconst BOLD_WEIGHTS: ReadonlySet<FontWeight> = new Set<FontWeight>([\n 'bold',\n 'extraBold',\n 'heavy',\n 'semiBold'\n]);\n\n/**\n * The background block's solid FILL color, when it has one and it's a readable RGBA value.\n *\n * `colorProps` only emits a fill-color target for a genuine color fill (it checks the fill type\n * first), so an image/gradient background produces no fill target and we skip it — the spec's\n * caveat. We pick the fill target explicitly (its key ends with `fill/color/value`), not just any\n * target (which could be a stroke).\n */\nfunction rgbaFillBehind(engine: EngineLike, bg: BlockId): RGBAColor | null {\n const fillTarget = colorProps(engine, bg).find((t) =>\n t.key.endsWith(':fill/color/value')\n );\n if (!fillTarget) return null; // image/gradient/no color fill → skip\n const color = fillTarget.read(engine);\n // Only sRGB is luminance-comparable here. CMYK/Spot would need conversion → skip.\n if (colorSpaceOf(color) !== 'sRGB') return null;\n // A translucent fill shows what is behind it: its colour alone is not the background → skip.\n if ((color as RGBAColor).a < 1) return null;\n return color as RGBAColor;\n}\n\n/** The text's own opaque sRGB background field, when it is on. */\nfunction ownField(engine: EngineLike, text: BlockId): RGBAColor | null {\n if (!engine.block.getBool(text, 'backgroundColor/enabled')) return null;\n const color = engine.block.getColor(text, 'backgroundColor/color');\n if (colorSpaceOf(color) !== 'sRGB') return null;\n return (color as RGBAColor).a >= 1 ? (color as RGBAColor) : null;\n}\n\n/**\n * Flags text whose contrast against its opaque background falls below WCAG AA. This is the one\n * true hard-fail of the lint set: `type: 'problem'` and every finding is `severity: 'error'`.\n *\n * Report-only — recoloring is a design decision, never auto-applied.\n *\n * Deliberately under-detects (skips rather than guesses) in three cases, all the safe direction:\n * - foreground/background color is CMYK or Spot (no luminance without conversion),\n * - nothing opaque sits behind the text (`backgroundBehind` is null — unknown background),\n * - the background is an image/gradient fill (no readable RGBA color),\n * - the background's fill colour is translucent (what shows through it is not read).\n */\nexport const textLegibility: DesignRule = {\n meta: {\n id: 'text/legibility',\n type: 'problem',\n docs: {\n description: 'Text must meet WCAG AA contrast against its background.'\n },\n messages: {\n lowContrast:\n 'Text block {{id}} has contrast {{ratio}}:1 against its background (WCAG AA needs {{min}}:1).'\n }\n },\n create(ctx) {\n const { engine } = ctx;\n // WCAG's large-text sizes in points, overridable for an engine whose font sizes use another unit.\n const largePt = (ctx.options.largePt as number | undefined) ?? LARGE_PT;\n const largeBoldPt =\n (ctx.options.largeBoldPt as number | undefined) ??\n (largePt * LARGE_BOLD_PT) / LARGE_PT;\n const together = togetherOption(ctx.options);\n\n const check = (block: BlockId) => {\n // 1. Foreground: first text color, only if it's RGBA.\n const fg = engine.block.getTextColors(block)[0];\n if (!fg || colorSpaceOf(fg) !== 'sRGB') return; // skip CMYK/Spot (no luminance)\n\n // 2. Background: the text's own opaque field, else the opaque covering sibling behind it, with a readable RGBA fill.\n let bgColor = ownField(engine, block);\n let bg: BlockId | null = block;\n if (!bgColor) {\n bg = backgroundBehind(engine, block, undefined, together);\n if (bg == null) return; // unknown background — skip (safe direction)\n bgColor = rgbaFillBehind(engine, bg);\n }\n if (!bgColor) return; // image/gradient/non-RGBA background — skip\n\n // 3. Threshold by text size: large text gets the relaxed 3.0:1.\n const sizes = engine.block.getTextFontSizes(block);\n const maxPt = sizes.length ? Math.max(...sizes) : 0;\n const isBold = engine.block\n .getTextFontWeights(block)\n .some((w) => BOLD_WEIGHTS.has(w));\n const isLarge = maxPt >= largePt || (isBold && maxPt >= largeBoldPt);\n const min = isLarge ? AA_LARGE : AA_NORMAL;\n\n // 4. Compare and report.\n const ratio = contrastRatio(fg as RGBAColor, bgColor);\n if (ratio < min) {\n ctx.report({\n blockId: block,\n messageId: 'lowContrast',\n severity: 'error',\n data: {\n id: String(block),\n ratio: +ratio.toFixed(2),\n min,\n bg: String(bg)\n },\n property: `${block}:text/color`\n });\n }\n };\n\n return { text: check };\n }\n};\n"]}
@@ -23,8 +23,8 @@
23
23
  "lint:archive": "pnpm run build && node scripts/lint-archive.mjs"
24
24
  },
25
25
  "devDependencies": {
26
- "@cesdk/engine": "1.85.3",
27
- "@cesdk/node": "1.85.3",
26
+ "@cesdk/engine": "1.86.2",
27
+ "@cesdk/node": "1.86.2",
28
28
  "@types/node": "^24.3.0",
29
29
  "shx": "^0.4.0",
30
30
  "vitest": "^3.2.0"
@@ -0,0 +1,79 @@
1
+ # Changelog
2
+
3
+ ## 0.2.1
4
+
5
+ ### Fixed
6
+
7
+ - TypeScript now accepts the engine of a CE.SDK version whose `getFill`,
8
+ `getShape` and `getBlur` return `null` for an empty slot.
9
+
10
+ ## 0.2.0
11
+
12
+ ### Added
13
+
14
+ - Export `.fig` files in the browser with `@cesdk/engine` or the editor's engine.
15
+ Safari needs version 16.4 or newer, for WebAssembly SIMD. A Content Security
16
+ Policy must allow `'wasm-unsafe-eval'` and `'unsafe-eval'`.
17
+
18
+ ### Changed
19
+
20
+ - A block that is exported as an image keeps its opacity in the image, and its
21
+ Figma layer has 100% opacity.
22
+ - Imported frames return to their original canvas positions and stacking
23
+ order. New pages and duplicates go in a row below the imported content.
24
+ - Loose layers return to their canvas positions and stacking order. Empty, clipped or
25
+ restyled pages retain a frame to preserve their bounds and appearance.
26
+
27
+ ### Fixed
28
+
29
+ - An export no longer changes the scene. It converted a scene in millimetres or
30
+ inches to pixels and back, and set the blocks that it exports as images to
31
+ full opacity while they rendered. If the scene's design unit changes while
32
+ the export runs, or the resolution of a scene in millimetres or inches, the
33
+ export fails with an error.
34
+ - An export no longer fails when the user edits a text while its font loads,
35
+ or undoes a shape change while its image loads. A property edited during the
36
+ export, such as a color or a text, has its old or its new value. An export
37
+ during which layers are added, deleted or rearranged, or the editor loads
38
+ another scene, fails with an error. Before, such an export could write a file
39
+ with missing, misplaced or repeated layers. The export compares the scene
40
+ when it ends, so a change that is undone before then is not detected.
41
+
42
+ ## 0.1.2
43
+
44
+ ### Changed
45
+
46
+ - One `exportFig` call now counts as one export toward your usage, also when
47
+ the exporter renders blocks as images. This needs CE.SDK 1.86.0 or newer.
48
+ With an older version, each rendered block still counts as an image export.
49
+
50
+ ## 0.1.1
51
+
52
+ ### Fixed
53
+
54
+ - Accept newer CE.SDK versions with additional block types in TypeScript integrations.
55
+
56
+ ## 0.1.0
57
+
58
+ ### Added
59
+
60
+ - Export CE.SDK scenes as Figma `.fig` files in Node.js, with one canvas and
61
+ a frame for each page.
62
+ - Keep supported text, graphics, images, gradients, strokes and effects
63
+ editable. Report rendered-image fallbacks through conversion notes.
64
+ - Restore supported Figma-specific metadata from the companion importer
65
+ while retaining mapped properties edited in CE.SDK.
66
+
67
+ ### Fixed
68
+
69
+ - Preserve custom stroke dash patterns even when the stroke style is Solid.
70
+ - Use font-file family and style names for HTTP font resources.
71
+ - Keep the selected font when CE.SDK uses a fallback to draw emoji.
72
+ - Use Figma's SemiBold style name for Overpass Mono text.
73
+ - Include the visible clips in nested groups and tracks at the current
74
+ playhead, including the final frame of a page.
75
+ - Retain text sizing edits instead of restoring an older Figma sizing mode.
76
+ - Retain the stroke color and visible placement of horizontal, rotated and
77
+ flipped lines.
78
+ - Use image source sets before an older single image URI.
79
+ - Report unverified font names once per family in each export.
@@ -0,0 +1,137 @@
1
+ # Creative Editor Software Development Kit (SDK)
2
+
3
+ ## Terms of Service
4
+
5
+ ### 1. Subject Matter
6
+
7
+ 1.1 These Terms of Service (together with any applicable Order Form the "**Agreement**") govern all rights granted by Licensor to use and commercially exploit any of the IMG.LY SDKs (the "**Software**"), namely the CreativeEditor SDK and/or PhotoEditor SDK and/or VideoEditor SDK and/or imglyKit SDK.
8
+
9
+ 1.2 The Agreement is entered into by and between IMG.LY GmbH, Kortumstraße 19-21, 44787 Bochum, Germany (the "**Licensor**") and the entity identified in the Order Form (the "**Licensee**", together with Licensor the "**Parties**") as of the effective date the Order Form is last signed on.
10
+
11
+ 1.3 This Agreement shall govern the use of the Software for commercial purposes. To the extent the Software is intended to be used for non-commercial purposes only, an alternative licensing scheme may be available upon Licensor's discretion.
12
+
13
+ ### 2. Order Form
14
+
15
+ 2.1 An "**Order Form**" may either be executed (i) by the Parties upon individual negotiation or (ii) via an online order issued by Licensee via Licensor's website at img.ly (the "**Website**") that has been confirmed by Licensor. Online orders not confirmed within 14 days after issuance shall be considered denied.
16
+
17
+ 2.2 No rights shall be granted to Licensee by virtue of these Terms of Service alone as such grant requires the execution of an Order Form making reference to these Terms of Service.
18
+
19
+ 2.3 The Order Form shall specify the environment for the Software that shall be licensed by Licensee. The Software is currently available for integration in the following environments, but is not limited to: (i) Web, (ii) iOS, (iii) Android, and (iv) Node.js.
20
+
21
+ 2.4 The Order Form shall specify (i) the Subscription Term and (ii) the License Fees. Unless specified otherwise in the Order Form, the Subscription Term shall be based on monthly or annual periods for payment of the License Fees (the "**Payment Periods**").
22
+
23
+ 2.5 Licensor may choose to offer Licensee a trial period specified by Licensor to test the Software in a dedicated testing environment not subject to License Fees (the "**Trial Period**"). Licensor may also choose to offer Licensee extended trial periods subject to License Fees (“Extended Trial Period”). These Trial Periods and/or Extended Trial Periods will automatically end upon completion and do not require termination. Licensee acknowledges that converting from a Trial Period and/or Extended Trial Period to a regular Subscription Term may require additional steps, as outlined in the Order Form. Upon expiration of the Trial Period and/or Extended Trial Period, the right to test the Software shall cease without further notice. Licensee shall then be required to execute an Order Form to obtain a License for a Subscription Term in case the Software shall be further used.
24
+
25
+ 2.6 The Order Form can include usage-based pricing models based on factors such as monthly active users or number of exports. The pricing can also be based on Licensee’s company size. Licensee shall not make any false statements in regard to the eligibility thresholds stated on the Order Form or relevant for pricing. Further Licensee is solely responsible to keep Licensor informed about any changes on its part with respect to the eligibility thresholds or aspects relevant for pricing stated on the Order Form. 
26
+
27
+ 2.7 Licensee shall inform Licensor of any "**agency relationship”, if necessary under a Non-Disclosure Agreement, under which Licensee effectively shall not be the entity making use of the Software but intends to source the Software for use by a third party. In such case, Licensor shall be free to execute an Agreement with the entity effectively making use of the Software as Licensee only.  
28
+
29
+ ### 3. Grant of Rights
30
+
31
+ 3.1 Licensor shall grant to Licensee a worldwide, non-exclusive, non-transferable, non-sublicensable right to use the Software subject to the terms of this Agreement, in particular with the specifications as set out in the Order Form (the "**License**").
32
+
33
+ 3.2 The License shall pertain to the Software in object code format as well as to content data (fonts, stickers, stock images, etc.) included therein. In order to enable integration of the Software, parts of the Software may be provided in source code format if agreed upon in the Order Form individually or if offered by Licensor in its free discretion; in such case, the License shall also pertain to the Software in source code format.
34
+
35
+ 3.3 The License shall be limited to the right (i) to copy and – in case of disclosure in source code format – modify the Software solely for integration into one of Licensee's products (website or app) (the "**Licensee’s Product**") in accordance with the requirements of interfaces and implementation guidelines as issued by Licensor (the "**Integrated Software**") and (ii) to copy, distribute and make available the Integrated Software to Licensee's end customers in object code format (the License does not cover distribution, making available or disclosure of the Software or any part thereof in source code format).
36
+
37
+ ### 4. Obligations and Restrictions
38
+
39
+ 4.1 Licensee shall not reproduce, disassemble, or reverse assemble any portion of the Software or otherwise derive its source code, except to the extent that such activity is specifically permitted by this Agreement or by statutory law.
40
+
41
+ 4.2 Licensee shall not redistribute the Software or its modifications other than by integrating the Software into Licensee's Product. Use in context of more than one of Licensee's Products shall require multiple Licenses accordingly via respective Order Forms. Licensee's Product shall have a substantially different functionality than the Software (i.e. must not be described as a photo editor and/or video editor, respective development kit, library, or product commercially competing with the Software); otherwise, Licensor shall be entitled to terminate the Agreement and revoke the License at any time.
42
+
43
+ 4.3 Licensee shall not use the Software in connection with or to promote any products, services, or materials that constitute or promote spyware, adware, or other malicious programs or code, unsolicited mass distribution of email (spam), defamatory, pornographic, abusive or otherwise offensive content; otherwise, Licensor shall be entitled to terminate the Agreement and revoke the License at any time.
44
+
45
+ 4.4 Licensor shall be entitled to verify and validate Licensee's use of the Software in line with this Agreement via respective functionalities of the Software. In particular, Licensor is entitled to make access to the Software dependent from successful remote validation (via API) of a license key allocated to an active Subscription Term and covering the intended access and use.
46
+
47
+ 4.5 Licensor shall be entitled to use server-side monitoring tools to analyze use of the Software by users. Licensee shall safeguard that such monitoring by Licensor can be performed in accordance with applicable privacy and data protection law via respective notices and, if required, opt-in procedures. Licensor will support Licensee to the extent required by providing required information and instruction. 
48
+
49
+ ### 5. Proprietary Rights
50
+
51
+ 5.1 All rights not expressly granted to Licensee are reserved by Licensor. Licensee acknowledges and agrees that all rights to modifications of the source code made by Licensee to enable integration of the Software shall belong to the Licensor as part of the Software; the Licensee shall assign all respective rights to Licensor or, in case no assignment is feasible under applicable law, Licensee shall grant a worldwide, exclusive, transferable, sublicensable right to use such modifications without any restrictions. Licensee shall have no rights to use, copy, or reproduce the Software except as expressly set forth in this Agreement.
52
+
53
+ 5.2 No rights shall be granted with regard to trademarks, trade names, trade dress and trade secrets to Licensee except for the limited right of use provided under the License.
54
+
55
+ ### 6. Third Party Components
56
+
57
+ 6.1 The Software implements components licensed under open source licenses ("OSS Components**") and further software components and content data (fonts, stickers, stock images, etc.) provided by third parties under applicable licensing terms ("Third Party Components**"). The use of the OSS Components and the Third Party Components is subject to the applicable separate licensing terms. A list of the OSS Components and Third Party Components with reference to the applicable licensing terms is accessible online via https://img.ly/acknowledgements. Licensor does not act as sublicensor or agent in this regard and assumes or acknowledges no warranty or liability for the OSS Components and the Third Party Components.
58
+
59
+ 6.2 Licensee shall only use further third party software components or content data (fonts, stickers, stock images, etc.) with the Software to the extent that Licensee is entitled to such use. Licensor shall not be liable or responsible for any use of third party software components or content data by Licensee. Licensee shall indemnify and hold harmless Licensor from any third-party claims caused by Licensee's actions involving third party software components or content data.
60
+
61
+ ### 7. Payment
62
+
63
+ 7.1 The license fees as specified in the Order Form (the "**License Fees**") shall be due and payable in line with the Payment Periods. To the extent the due date is not specified in the Order Form, the License Fees shall be due upon the execution of the Order Form and then upon the commencement of each further Payment Period for all of the Subscription Term.
64
+
65
+ 7.2 Licensor shall invoice the License Fees to Licensee. Invoices are payable without deduction within 14 days of the date of the invoice and may be made by direct payment on the Website via credit card, if a respective option is provided by Licensor. If Licensee is in default of payment, the outstanding amount shall bear interest as applicable under statutory law. Licensor reserves all further rights resulting from default.
66
+
67
+ 7.3 Unless specified otherwise in the Order Form, the License Fees shall be paid in Euros. All amounts stated in the Order Form are excluding any applicable value added tax (VAT), unless explicitly specified otherwise. Licensee shall be responsible for any applicable sales, use, value added or similar taxes payable with respect to the licensing of the Software, or arising out of or in connection with this Agreement, other than taxes levied or imposed based upon Licensor's income or gross revenues. If Licensee has tax-exempt status, Licensee shall provide written evidence of such status to Licensor. Upon Licensor's request, Licensee shall provide its VAT identification number or other identification information required for invoicing purposes.
68
+
69
+ 7.4 The license fees specified in the Order Form (the "**License Fees**") are subject to price adjustments in accordance with changes in the Consumer Price Index ("CPI**") published by the European Central Bank (https://www.ecb.europa.eu/). Corresponding License Fee adjustments are made at renewal for annual Subscription Terms and after every 12 months for other Subscription Terms. 
70
+
71
+ ### 8. Delivery and Maintenance
72
+
73
+ 8.1 The Software shall be delivered via download from designated package repositories. The designated link for such download shall be provided in the Order Form. The use of the Software in a Subscription Term requires a key that shall be provided upon the initial payment of the License Fees, subject to the terms agreed upon in the Order Form. The key required for a Trial Period shall be provided upon commencement and deactivated upon expiration of the Trial Period.
74
+
75
+ 8.2 The Software and Documentation shall be provided in English language.
76
+
77
+ 8.3 Licensee shall be responsible for installing the Software and providing the system environment required to operate the Software in accordance with the requirements as set forth in the Documentation.
78
+
79
+ 8.4 Subject to any other specification in the Order Form, Licensor shall not provide any support and maintenance services other than the issuance of such updates, upgrades or patches for the Software as made available via the Website. Licensor shall have no obligation to provide support or maintenance for the Integrated Software or any modifications to the Software made by Licensee for integration into one of Licensee's Products.
80
+
81
+ 8.5 Licensor may choose to offer Licensee a separate Service Level Agreement detailing specific availability commitments against additional remuneration. Such availability commitments always exclude downtime due to planned maintenance and downtime outside Licensor’s control. In case of planned maintenance leading to downtime exceeding three hours, Licensor will notify Licensee via email.
82
+
83
+ ### 9. Term and Termination
84
+
85
+ 9.1 The term of the License shall be determined in the Order Form (the "**Subscription Term**"). The License shall commence upon initial payment of the License Fees and expire upon the end of the Subscription Term(s). Unless stated otherwise in the Order Form, the initial Subscription Term shall automatically be extended by further consecutive Subscription Terms unless either party notifies the other in writing of its intent not to extend the License prior to the end of the current Subscription Term. For monthly Subscription Terms, the notification must be given one week prior to the end of the then-current Subscription Term in order to be valid. For other Subscription Terms, the notification must be given one month prior to the end of the then-current Subscription Term in order to be valid. Upon expiration of the Subscription Term(s), the right to use the Software shall cease without further notice. To the extent the Subscription Term is not specified in the Order Form, Licensor shall be entitled to terminate the Agreement and revoke the License at any time.
86
+
87
+ 9.2 Either Party shall be entitled to immediately terminate this Agreement or suspend any rights granted hereunder upon notice to the other in the event that: (i) the other Party breaches any material term of this Agreement, Licensor may particularly revoke the License in case of default or other non-payment of License Fees or use of the Software in breach of Sections 3.3 or 5.1; or (ii) upon the other Party's dissolution, liquidation, or the appointment of a receiver, trustee, custodian, or similar agent for the Party's business or property. A change of control of Licensee, the sale of all or more than 50% of Licensee's assets, or a merger or reorganization of Licensee in which Licensee is not the surviving organization is considered dissolution of Licensee. In the event that Licensor terminates this Agreement for breach, all amounts due or to become due under this Agreement shall immediately become due and payable.
88
+
89
+ 9.3 Upon expiration of the Subscription Term or termination, each Party shall promptly remit to the other all unpaid monies due, or to become due, under this Agreement. Licensee shall return to Licensor or destroy all copies of the Software in its possession and provide written confirmation to that effect; this particularly applies to the Software in source code format in case such disclosure has occurred. In case of termination or revocation of the License, paid monies or due payments for any commenced Payment Periods shall not be refunded to Licensee.
90
+
91
+ 9.4 In addition to those provisions which by their nature are intended to survive any termination or expiration of this Agreement or any license granted hereunder, Sections 11, 12 and 13 of this Agreement shall specifically survive such expiration or termination.
92
+
93
+ 9.5 In the event of termination or expiration of the Subscription Term, the Licensee is obliged to promptly cease use of and remove the Software from all of its products. Until the Software is confirmed to be completely removed from all of the Licensee's products, Licensor reserves the right to continue to charge the Licensee the agreed License Fees. The Licensee must provide satisfactory evidence of the complete removal of the Software upon request of the Licensor.
94
+
95
+ ### 10. Warranty Claims
96
+
97
+ 10.1 Product descriptions shall not be deemed guaranteed unless separately agreed in writing.
98
+
99
+ 10.2 Rights in case of defects shall be excluded in case of minor or immaterial deviations from the characteristics of the Software or in the case of only slight impairment of use. Licensor shall further not be responsible for defects which are caused by improper use or operation. Licensor shall not be responsible for ensuring that any modifications made by Licensee to the Software for integration into one of Licensee's Products will work other versions of the Software.
100
+
101
+ 10.3 Any claims for damages are subject to the limitations set forth under Section 11 of this Agreement.
102
+
103
+ ### 11. Limitation of Liability
104
+
105
+ 11.1 Licensor shall be liable without restriction for damages caused intentionally or with gross negligence by Licensor, its legal representatives or assistants in performance. Licensor shall also be liable without restriction for death, personal injury or damage to health caused by Licensor, its legal representatives or assistants in performance. Furthermore, Licensor shall be liable without restriction for damages in accordance with the German Product Liability Act.
106
+
107
+ 11.2 Licensor shall be liable for damages caused by breach of its primary obligations under this Agreement by Licensor, its legal representatives or assistants in performance. Primary obligations are such duties that form the essence of the Agreement, which were decisive for the conclusion of the Agreement and on the performance of which Licensee may rely. If Licensor breaches its primary obligations with simple negligence, then its liability shall be limited to the amount which was foreseeable for Licensor at the time when the respective duty was performed. Any further liability of Licensor shall be excluded on the merits. In particular, any liability of Licensor for initial defects of the Software already present at the start of the Subscription Term shall be excluded. 
108
+
109
+ 11.3 The right to set off a claim shall be limited to such claims that are uncontested or have been finally established with legal effect.
110
+
111
+ ### 12. Confidentiality
112
+
113
+ 12.1 Each Party may be granted access to confidential information of the other Party during the term of this Agreement. Confidential information does not include information that: (i) is or becomes publicly available through no act or omission of the other party, (ii) is rightfully acquired by the recipient from a third party that was not under an obligation to hold the information in confidence, (iii) is independently developed by the recipient or, (iv) is previously known to the recipient without non-disclosure obligations. The terms of this Agreement and the source code to the Software shall constitute confidential information under this Agreement.
114
+
115
+ 12.2 Neither Party shall use any confidential information of the other Party other than for the purpose of exercising its rights or performing its obligations under this Agreement or disclose to any third party any confidential information of the other Party except as permitted under this Agreement. Disclosure of confidential information shall not be precluded if such disclosure is in response to a valid order of a court or other governmental body or is otherwise required by statutory law.
116
+
117
+ 12.3 Subject to the exceptions under Section 12.2., Licensee shall not disclose the terms of this Agreement to any third party.
118
+
119
+ 12.4 Non-disclosure agreements executed by the Parties independent from this Agreement shall remain in force.
120
+
121
+ ### 13. Final Provisions
122
+
123
+ 13.1 Licensor shall be entitled to identify Licensee as a customer and to refer to Licensee and its business by name, trademark and trade name, if applicable, on the Website and in Licensor's marketing materials.
124
+
125
+ 13.2 Licensor shall not accept, and this Agreement does not operate as an acceptance of, any different or additional terms and conditions, and this Agreement shall prevail over any such different or additional provisions, of any Licensee's order.
126
+
127
+ 13.3 All notices or reports shall be in writing or sent by email.
128
+
129
+ 13.4 Licensee may not assign this Agreement, in whole or in part to any third party without the prior written consent of Licensor.
130
+
131
+ 13.5 Amendments or additions to this Agreement must be made in writing to be effective. This shall also apply to amendments of this written form requirement.
132
+
133
+ 13.6 This Agreement shall be governed by the laws of the Federal Republic of Germany; the regulations of the UN Sales Convention shall be excluded.
134
+
135
+ 13.7 The courts for Licensor's registered office shall have exclusive jurisdiction over all disputes under and in connection with this Agreement.
136
+
137
+ 13.8 Should any provision of this Agreement be or become invalid, this shall not affect the validity of the remaining terms. In such event, the Parties shall be obliged to cooperate in the creation of terms which achieve such legally valid result as comes closest commercially to that of the invalid provision. The above shall apply accordingly to the closing of any gaps in the Agreement.