@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,8 +1,8 @@
1
1
  // The workspace source as a module plugin, for an engine in another process: it searches and stores through the
2
2
  // listener `viewer/workspace-source-route.ts` starts for it, and loads a stored file from the workspace's folder when
3
- // it is given it, else through that listener's `/r/`.
4
- import { pathToFileURL } from 'node:url';
5
- import { READABLE_SOURCE } from '../workspace/asset-store.js';
3
+ // it is given it, else through that listener's `/r/`. On an executor holding the store, through its server's assets.
4
+ import { ASSET_EXTENSION_OF_TYPE, ASSETS_URL_ENV, MAX_AV_FILE_BYTES } from '@imgly/codesign-sdk/internal';
5
+ import { READABLE_SOURCE, workspaceFileBase } from '../workspace/asset-store.js';
6
6
  import { SHORT_ASSET_SOURCE } from '../workspace/content-hash.js';
7
7
  import { WORKSPACE_IMAGE_SOURCE_ID, WORKSPACE_MIME_TYPES, workspaceSourceDescription } from './workspace-image-source.js';
8
8
  const MODULE = `
@@ -11,11 +11,56 @@ async function answer(response) {
11
11
  if (!response.ok) throw new Error('the workspace answered ' + response.status + ': ' + (await response.text()));
12
12
  return response.json();
13
13
  }
14
- export default ({ baseURL, fileBase, readable, short, id, description, mimeTypes }) => ({
14
+ const ASSET = /^assets\\/([0-9a-f]{64}\\.[a-z0-9]{1,16})$/;
15
+ // A file the workspace does not keep stays inside the design: its import goes on, and its answer names why.
16
+ const decline = (file, opts, reason) => {
17
+ console.warn('codesign: the workspace did not keep a ' + file.type + ' file, it stays inside the design: ' + reason);
18
+ opts?.decline?.(reason);
19
+ return undefined;
20
+ };
21
+ const NOT_STORED = 'this file type is not stored';
22
+ // The store's assets, as the executor's server process serves them on loopback: no listing, no packs.
23
+ const storeSource = (base, id, description, mimeTypes, extOfType, maxGB) => ({
24
+ id,
25
+ description,
26
+ getSupportedMimeTypes: () => [...mimeTypes],
27
+ findAssets: async (query) => ({ assets: [], currentPage: query.page, total: 0 }),
28
+ resolve: (uri) => {
29
+ const name = uri.startsWith(SCHEME) ? ASSET.exec(uri.slice(SCHEME.length))?.[1] : undefined;
30
+ return name === undefined ? undefined : base + '/' + name;
31
+ },
32
+ // Named by its type, read from its bytes: an import's carried files are named .bin or .json.
33
+ uploadFile: async (file, opts) => {
34
+ const ext = Object.hasOwn(extOfType, file.type) ? extOfType[file.type] : undefined;
35
+ if (ext === undefined) return decline(file, opts, NOT_STORED);
36
+ const bytes = await file.arrayBuffer();
37
+ // Its name, which the route checks the body against as it streams it to the store.
38
+ const digest = new Uint8Array(await crypto.subtle.digest('SHA-256', bytes));
39
+ const sha256 = Array.from(digest, (b) => b.toString(16).padStart(2, '0')).join('');
40
+ const response = await fetch(base + '/?ext=' + ext + '&sha256=' + sha256, {
41
+ method: 'POST',
42
+ body: bytes,
43
+ ...(opts?.signal ? { signal: opts.signal } : {})
44
+ });
45
+ // Too large, or a type the route does not store.
46
+ if (response.status === 413) return decline(file, opts, 'larger than ' + maxGB + ' GB');
47
+ if (response.status === 415) return decline(file, opts, NOT_STORED);
48
+ const { name } = await answer(response);
49
+ const uri = SCHEME + 'assets/' + name;
50
+ return { id: uri, meta: { uri, mimeType: file.type } };
51
+ }
52
+ });
53
+ export default ({ baseURL, store, extOfType, maxGB, fileBase, readable, short, id, description, mimeTypes }) => ({
15
54
  name: 'ly.img.codesign.workspace',
16
55
  version: '1.0.0',
17
56
  async initialize({ engine }) {
18
57
  if (engine.asset.findAllSources().includes(id)) engine.asset.removeSource(id);
58
+ if (store) {
59
+ const base = globalThis.process?.env?.[store];
60
+ if (!base) throw new Error('this executor serves no store assets: ' + store + ' is not set in its engine process');
61
+ engine.asset.addSource(storeSource(base, id, description, mimeTypes, extOfType, maxGB));
62
+ return;
63
+ }
19
64
  engine.asset.addSource({
20
65
  id,
21
66
  description,
@@ -57,15 +102,31 @@ export default ({ baseURL, fileBase, readable, short, id, description, mimeTypes
57
102
  }
58
103
  });
59
104
  `;
105
+ /** The workspace source for an engine whose executor serves its store's `assets/` (`Executor.assets`) at `ASSETS_URL_ENV`. */
106
+ export function storeWorkspaceSourceModule() {
107
+ return {
108
+ module: MODULE,
109
+ options: {
110
+ store: ASSETS_URL_ENV,
111
+ extOfType: ASSET_EXTENSION_OF_TYPE,
112
+ // The assets route's limit, in the decline the model reads.
113
+ maxGB: MAX_AV_FILE_BYTES / 1e9,
114
+ id: WORKSPACE_IMAGE_SOURCE_ID,
115
+ description: workspaceSourceDescription,
116
+ mimeTypes: WORKSPACE_MIME_TYPES
117
+ }
118
+ };
119
+ }
60
120
  /** The workspace source for an engine that reaches the workspace at `baseURL`; `fileRoot`: its folder, as `workspaceSource`'s. */
61
121
  export function workspaceSourceModule(opts) {
122
+ const fileBase = opts.fileRoot !== undefined ? workspaceFileBase(opts.fileRoot) : undefined;
62
123
  return {
63
124
  module: MODULE,
64
125
  options: {
65
126
  baseURL: opts.baseURL.replace(/\/+$/, ''),
66
- ...(opts.fileRoot !== undefined
127
+ ...(fileBase !== undefined
67
128
  ? {
68
- fileBase: pathToFileURL(opts.fileRoot).href.replace(/\/+$/, ''),
129
+ fileBase,
69
130
  readable: READABLE_SOURCE,
70
131
  short: SHORT_ASSET_SOURCE
71
132
  }
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-source-module.js","sourceRoot":"","sources":["../../../src/services/engine/workspace-source-module.ts"],"names":[],"mappings":"AAAA,gHAAgH;AAChH,sHAAsH;AACtH,sDAAsD;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAIzC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,0BAA0B,EAC3B,MAAM,6BAA6B,CAAC;AAErC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDd,CAAC;AAEF,kIAAkI;AAClI,MAAM,UAAU,qBAAqB,CAAC,IAGrC;IACC,OAAO;QACL,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;YACzC,GAAG,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS;gBAC7B,CAAC,CAAC;oBACE,QAAQ,EAAE,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;oBAC/D,QAAQ,EAAE,eAAe;oBACzB,KAAK,EAAE,kBAAkB;iBAC1B;gBACH,CAAC,CAAC,EAAE,CAAC;YACP,EAAE,EAAE,yBAAyB;YAC7B,WAAW,EAAE,0BAA0B;YACvC,SAAS,EAAE,oBAAoB;SAChC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// The workspace source as a module plugin, for an engine in another process: it searches and stores through the\n// listener `viewer/workspace-source-route.ts` starts for it, and loads a stored file from the workspace's folder when\n// it is given it, else through that listener's `/r/`.\nimport { pathToFileURL } from 'node:url';\n\nimport type { EnginePluginModule } from '@imgly/codesign-sdk/internal';\n\nimport { READABLE_SOURCE } from '../workspace/asset-store.js';\nimport { SHORT_ASSET_SOURCE } from '../workspace/content-hash.js';\nimport {\n WORKSPACE_IMAGE_SOURCE_ID,\n WORKSPACE_MIME_TYPES,\n workspaceSourceDescription\n} from './workspace-image-source.js';\n\nconst MODULE = `\nconst SCHEME = 'workspace://';\nasync function answer(response) {\n if (!response.ok) throw new Error('the workspace answered ' + response.status + ': ' + (await response.text()));\n return response.json();\n}\nexport default ({ baseURL, fileBase, readable, short, id, description, mimeTypes }) => ({\n name: 'ly.img.codesign.workspace',\n version: '1.0.0',\n async initialize({ engine }) {\n if (engine.asset.findAllSources().includes(id)) engine.asset.removeSource(id);\n engine.asset.addSource({\n id,\n description,\n getSupportedMimeTypes: () => [...mimeTypes],\n findAssets: async (query) =>\n (await answer(await fetch(baseURL + '/api/workspace-source/find', {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(query)\n }))) ?? undefined,\n resolve: (uri) => {\n if (!uri.startsWith(SCHEME)) return undefined;\n const rel = uri.slice(SCHEME.length);\n // A 12-hex asset of an earlier build may be renamed: only the listener's /r/ finds it under its full name.\n const direct = fileBase !== undefined && new RegExp(readable).test(rel) && !(short && new RegExp(short).test(rel));\n return direct ? fileBase + '/' + rel : baseURL + '/r/' + rel;\n },\n uploadFile: async (file, opts) =>\n answer(await fetch(\n baseURL + '/api/workspace-source/upload?name=' + encodeURIComponent(file.name) + '&type=' + encodeURIComponent(file.type),\n { method: 'POST', body: await file.arrayBuffer(), ...(opts?.signal ? { signal: opts.signal } : {}) }\n ))\n });\n // Installed packs' sources, as they are when this engine starts.\n let packs = [];\n try {\n packs = await answer(await fetch(baseURL + '/api/workspace-source/packs'));\n } catch (err) {\n console.warn('codesign: the installed packs did not load: ' + err.message);\n }\n for (const source of packs) {\n if (engine.asset.findAllSources().includes(source.id)) engine.asset.removeSource(source.id);\n try {\n await engine.asset.addLocalAssetSourceFromJSONString(source.json);\n } catch (err) {\n console.warn('codesign: the pack source ' + source.id + ' did not load: ' + err.message);\n }\n }\n }\n});\n`;\n\n/** The workspace source for an engine that reaches the workspace at `baseURL`; `fileRoot`: its folder, as `workspaceSource`'s. */\nexport function workspaceSourceModule(opts: {\n baseURL: string;\n fileRoot?: string;\n}): EnginePluginModule & { options: Record<string, unknown> } {\n return {\n module: MODULE,\n options: {\n baseURL: opts.baseURL.replace(/\\/+$/, ''),\n ...(opts.fileRoot !== undefined\n ? {\n fileBase: pathToFileURL(opts.fileRoot).href.replace(/\\/+$/, ''),\n readable: READABLE_SOURCE,\n short: SHORT_ASSET_SOURCE\n }\n : {}),\n id: WORKSPACE_IMAGE_SOURCE_ID,\n description: workspaceSourceDescription,\n mimeTypes: WORKSPACE_MIME_TYPES\n }\n };\n}\n"]}
1
+ {"version":3,"file":"workspace-source-module.js","sourceRoot":"","sources":["../../../src/services/engine/workspace-source-module.ts"],"names":[],"mappings":"AAAA,gHAAgH;AAChH,sHAAsH;AACtH,qHAAqH;AACrH,OAAO,EACL,uBAAuB,EACvB,cAAc,EACd,iBAAiB,EAElB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,eAAe,EACf,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,0BAA0B,EAC3B,MAAM,6BAA6B,CAAC;AAErC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgGd,CAAC;AAEF,8HAA8H;AAC9H,MAAM,UAAU,0BAA0B;IAGxC,OAAO;QACL,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,KAAK,EAAE,cAAc;YACrB,SAAS,EAAE,uBAAuB;YAClC,4DAA4D;YAC5D,KAAK,EAAE,iBAAiB,GAAG,GAAG;YAC9B,EAAE,EAAE,yBAAyB;YAC7B,WAAW,EAAE,0BAA0B;YACvC,SAAS,EAAE,oBAAoB;SAChC;KACF,CAAC;AACJ,CAAC;AAED,kIAAkI;AAClI,MAAM,UAAU,qBAAqB,CAAC,IAGrC;IACC,MAAM,QAAQ,GACZ,IAAI,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7E,OAAO;QACL,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;YACzC,GAAG,CAAC,QAAQ,KAAK,SAAS;gBACxB,CAAC,CAAC;oBACE,QAAQ;oBACR,QAAQ,EAAE,eAAe;oBACzB,KAAK,EAAE,kBAAkB;iBAC1B;gBACH,CAAC,CAAC,EAAE,CAAC;YACP,EAAE,EAAE,yBAAyB;YAC7B,WAAW,EAAE,0BAA0B;YACvC,SAAS,EAAE,oBAAoB;SAChC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// The workspace source as a module plugin, for an engine in another process: it searches and stores through the\n// listener `viewer/workspace-source-route.ts` starts for it, and loads a stored file from the workspace's folder when\n// it is given it, else through that listener's `/r/`. On an executor holding the store, through its server's assets.\nimport {\n ASSET_EXTENSION_OF_TYPE,\n ASSETS_URL_ENV,\n MAX_AV_FILE_BYTES,\n type EnginePluginModule\n} from '@imgly/codesign-sdk/internal';\n\nimport {\n READABLE_SOURCE,\n workspaceFileBase\n} from '../workspace/asset-store.js';\nimport { SHORT_ASSET_SOURCE } from '../workspace/content-hash.js';\nimport {\n WORKSPACE_IMAGE_SOURCE_ID,\n WORKSPACE_MIME_TYPES,\n workspaceSourceDescription\n} from './workspace-image-source.js';\n\nconst MODULE = `\nconst SCHEME = 'workspace://';\nasync function answer(response) {\n if (!response.ok) throw new Error('the workspace answered ' + response.status + ': ' + (await response.text()));\n return response.json();\n}\nconst ASSET = /^assets\\\\/([0-9a-f]{64}\\\\.[a-z0-9]{1,16})$/;\n// A file the workspace does not keep stays inside the design: its import goes on, and its answer names why.\nconst decline = (file, opts, reason) => {\n console.warn('codesign: the workspace did not keep a ' + file.type + ' file, it stays inside the design: ' + reason);\n opts?.decline?.(reason);\n return undefined;\n};\nconst NOT_STORED = 'this file type is not stored';\n// The store's assets, as the executor's server process serves them on loopback: no listing, no packs.\nconst storeSource = (base, id, description, mimeTypes, extOfType, maxGB) => ({\n id,\n description,\n getSupportedMimeTypes: () => [...mimeTypes],\n findAssets: async (query) => ({ assets: [], currentPage: query.page, total: 0 }),\n resolve: (uri) => {\n const name = uri.startsWith(SCHEME) ? ASSET.exec(uri.slice(SCHEME.length))?.[1] : undefined;\n return name === undefined ? undefined : base + '/' + name;\n },\n // Named by its type, read from its bytes: an import's carried files are named .bin or .json.\n uploadFile: async (file, opts) => {\n const ext = Object.hasOwn(extOfType, file.type) ? extOfType[file.type] : undefined;\n if (ext === undefined) return decline(file, opts, NOT_STORED);\n const bytes = await file.arrayBuffer();\n // Its name, which the route checks the body against as it streams it to the store.\n const digest = new Uint8Array(await crypto.subtle.digest('SHA-256', bytes));\n const sha256 = Array.from(digest, (b) => b.toString(16).padStart(2, '0')).join('');\n const response = await fetch(base + '/?ext=' + ext + '&sha256=' + sha256, {\n method: 'POST',\n body: bytes,\n ...(opts?.signal ? { signal: opts.signal } : {})\n });\n // Too large, or a type the route does not store.\n if (response.status === 413) return decline(file, opts, 'larger than ' + maxGB + ' GB');\n if (response.status === 415) return decline(file, opts, NOT_STORED);\n const { name } = await answer(response);\n const uri = SCHEME + 'assets/' + name;\n return { id: uri, meta: { uri, mimeType: file.type } };\n }\n});\nexport default ({ baseURL, store, extOfType, maxGB, fileBase, readable, short, id, description, mimeTypes }) => ({\n name: 'ly.img.codesign.workspace',\n version: '1.0.0',\n async initialize({ engine }) {\n if (engine.asset.findAllSources().includes(id)) engine.asset.removeSource(id);\n if (store) {\n const base = globalThis.process?.env?.[store];\n if (!base) throw new Error('this executor serves no store assets: ' + store + ' is not set in its engine process');\n engine.asset.addSource(storeSource(base, id, description, mimeTypes, extOfType, maxGB));\n return;\n }\n engine.asset.addSource({\n id,\n description,\n getSupportedMimeTypes: () => [...mimeTypes],\n findAssets: async (query) =>\n (await answer(await fetch(baseURL + '/api/workspace-source/find', {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(query)\n }))) ?? undefined,\n resolve: (uri) => {\n if (!uri.startsWith(SCHEME)) return undefined;\n const rel = uri.slice(SCHEME.length);\n // A 12-hex asset of an earlier build may be renamed: only the listener's /r/ finds it under its full name.\n const direct = fileBase !== undefined && new RegExp(readable).test(rel) && !(short && new RegExp(short).test(rel));\n return direct ? fileBase + '/' + rel : baseURL + '/r/' + rel;\n },\n uploadFile: async (file, opts) =>\n answer(await fetch(\n baseURL + '/api/workspace-source/upload?name=' + encodeURIComponent(file.name) + '&type=' + encodeURIComponent(file.type),\n { method: 'POST', body: await file.arrayBuffer(), ...(opts?.signal ? { signal: opts.signal } : {}) }\n ))\n });\n // Installed packs' sources, as they are when this engine starts.\n let packs = [];\n try {\n packs = await answer(await fetch(baseURL + '/api/workspace-source/packs'));\n } catch (err) {\n console.warn('codesign: the installed packs did not load: ' + err.message);\n }\n for (const source of packs) {\n if (engine.asset.findAllSources().includes(source.id)) engine.asset.removeSource(source.id);\n try {\n await engine.asset.addLocalAssetSourceFromJSONString(source.json);\n } catch (err) {\n console.warn('codesign: the pack source ' + source.id + ' did not load: ' + err.message);\n }\n }\n }\n});\n`;\n\n/** The workspace source for an engine whose executor serves its store's `assets/` (`Executor.assets`) at `ASSETS_URL_ENV`. */\nexport function storeWorkspaceSourceModule(): EnginePluginModule & {\n options: Record<string, unknown>;\n} {\n return {\n module: MODULE,\n options: {\n store: ASSETS_URL_ENV,\n extOfType: ASSET_EXTENSION_OF_TYPE,\n // The assets route's limit, in the decline the model reads.\n maxGB: MAX_AV_FILE_BYTES / 1e9,\n id: WORKSPACE_IMAGE_SOURCE_ID,\n description: workspaceSourceDescription,\n mimeTypes: WORKSPACE_MIME_TYPES\n }\n };\n}\n\n/** The workspace source for an engine that reaches the workspace at `baseURL`; `fileRoot`: its folder, as `workspaceSource`'s. */\nexport function workspaceSourceModule(opts: {\n baseURL: string;\n fileRoot?: string;\n}): EnginePluginModule & { options: Record<string, unknown> } {\n const fileBase =\n opts.fileRoot !== undefined ? workspaceFileBase(opts.fileRoot) : undefined;\n return {\n module: MODULE,\n options: {\n baseURL: opts.baseURL.replace(/\\/+$/, ''),\n ...(fileBase !== undefined\n ? {\n fileBase,\n readable: READABLE_SOURCE,\n short: SHORT_ASSET_SOURCE\n }\n : {}),\n id: WORKSPACE_IMAGE_SOURCE_ID,\n description: workspaceSourceDescription,\n mimeTypes: WORKSPACE_MIME_TYPES\n }\n };\n}\n"]}
@@ -25,8 +25,8 @@ export const KNOBS = [
25
25
  onOff('IMGLY_DISABLE_VIEWER', 'on hides the browser viewer; designs are delivered as files (default: off).', { stable: false, next: false, canary: false }, { honored: true }),
26
26
  onOff('IMGLY_TELEMETRY', 'on | off — usage telemetry (default: on).', { stable: true, next: true, canary: true }, { honored: true }),
27
27
  onOff('IMGLY_ERROR_REPORTING', 'on | off — send error reports (crashes, failed tool calls) to IMG.LY (default: on).', { stable: true, next: true, canary: true }, { honored: true }),
28
- onOff('IMGLY_PLUGIN_TELEMETRY', 'on | off — set by the Claude plugin\'s "Send usage data" setting; off turns usage telemetry and error reports off (default: on).', { stable: true, next: true, canary: true }, { honored: true }),
29
- onOff('IMGLY_PLUGIN_ERROR_REPORTING', 'on | off — set by the Claude plugin\'s "Send error reports" setting; off turns error reports off (default: on).', { stable: true, next: true, canary: true }, { honored: true }),
28
+ onOff('IMGLY_PLUGIN_TELEMETRY', 'on | off — set by earlier Claude plugins\' "Send usage data" setting; off turns usage telemetry and error reports off (default: on).', { stable: true, next: true, canary: true }, { honored: true }),
29
+ onOff('IMGLY_PLUGIN_ERROR_REPORTING', 'on | off — set by earlier Claude plugins\' "Send error reports" setting; off turns error reports off (default: on).', { stable: true, next: true, canary: true }, { honored: true }),
30
30
  value('IMGLY_SENTRY_DSN', 'error-report destination for source builds; a published build uses its own.'),
31
31
  onOff('IMGLY_DIAGNOSTICS_FILE', 'on | off — local diagnostics logging (default: on).', { stable: true, next: true, canary: true }),
32
32
  onOff('IMGLY_DIAGNOSTICS_TOOL', 'on | off — the diagnostics tool (default: on).', { stable: true, next: true, canary: true }),
@@ -1 +1 @@
1
- {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../src/services/flags/manifest.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,EAAE;AACF,6EAA6E;AAC7E,8CAA8C;AAC9C,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,6EAA6E;AAC7E,4EAA4E;AAC5E,gFAAgF;AAChF,oEAAoE;AACpE,qEAAqE;AA+BrE,MAAM,KAAK,GAAG,CACZ,IAAY,EACZ,OAAe,EACf,QAAkC,EAClC,QAA+B,EAAE,EACtB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;AAExE,MAAM,KAAK,GAAG,CACZ,IAAY,EACZ,OAAe,EACf,QAA+B,EAAE,EACtB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;AAE7D,MAAM,CAAC,MAAM,KAAK,GAAoB;IACpC;QACE,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,oBAAoB;QAC1B,MAAM,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;QAC1B,qEAAqE;QACrE,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE;QACxD,OAAO,EAAE,IAAI;QACb,OAAO,EACL,0FAA0F;K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E,EAAE,OAAO,EAAE,IAAI,EAAE,CAClB;IACD,KAAK,CACH,wBAAwB,EACxB,+CAA+C,CAChD;IACD,KAAK,CACH,+BAA+B,EAC/B,oEAAoE,CACrE;IACD,KAAK,CACH,4BAA4B,EAC5B,iEAAiE,CAClE;IACD,KAAK,CACH,0BAA0B,EAC1B,6IAA6I,CAC9I;CACF,CAAC;AAEF,MAAM,UAAU,IAAI,CAAC,IAAY;IAC/B,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IACjD,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,qBAAqB,CAAC,CAAC;IACxE,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,OAAgB;IACzD,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,IAAI,IAAI,kCAAkC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;IACvE,CAAC;IACD,OAAO,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,OAAgB;IACxD,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,IAAI,IAAI,gCAAgC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["// packages/codesign-server/src/services/flags/manifest.ts\n//\n// The declared set of product knobs. One entry per environment variable, and\n// the single place a default is written down.\n//\n// Why this exists: a knob used to be four things in four places that nothing\n// forced to agree — a reader in features.ts, a line in status.config, an entry\n// in a hand-written DEV_ENV_HELP string, and a prefix rule in frozen-env.ts.\n// The first three now derive from here, and so does frozen-env.ts's list of\n// knobs that survive a release build (`honored`). The freeze itself is still by\n// PREFIX: a knob missing from this file is still frozen, it is just\n// undocumented, which is the pre-existing failure mode and no worse.\n\n/** Which build profile a bundle was produced for. */\nexport type Channel = 'stable' | 'next' | 'canary';\n\ntype Base = {\n name: string;\n /** One line, used verbatim by --help and the README table. */\n summary: string;\n /** Survives the release-build freeze (src/cli/frozen-env.ts says why each one does). */\n honored?: true;\n};\n\n/** on/off, true/false or 1/0, any case (config.ts `boolEnv`). Anything else throws — a typo must not mean \"off\". */\nexport type OnOffKnob = Base & {\n kind: 'on-off';\n defaults: Record<Channel, boolean>;\n};\n\n/** A closed set of spellings. A `null` default means unset — resolved later. */\nexport type EnumKnob = Base & {\n kind: 'enum';\n values: readonly string[];\n defaults: Record<Channel, string | null>;\n};\n\n/** Free-form string (URLs, paths, credentials). No channel defaults. */\nexport type ValueKnob = Base & { kind: 'value' };\n\nexport type Knob = OnOffKnob | EnumKnob | ValueKnob;\n\nconst onOff = (\n name: string,\n summary: string,\n defaults: Record<Channel, boolean>,\n extra: Pick<Base, 'honored'> = {}\n): OnOffKnob => ({ kind: 'on-off', name, summary, defaults, ...extra });\n\nconst value = (\n name: string,\n summary: string,\n extra: Pick<Base, 'honored'> = {}\n): ValueKnob => ({ kind: 'value', name, summary, ...extra });\n\nexport const KNOBS: readonly Knob[] = [\n {\n kind: 'enum',\n name: 'IMGLY_CESDK_ENGINE',\n values: ['wasm', 'native'],\n // null = native with WASM fallback; canary requires native outright.\n defaults: { stable: null, next: null, canary: 'native' },\n honored: true,\n summary:\n 'engine flavor: wasm | native (default: native, falling back to wasm if it cannot start).'\n },\n onOff(\n 'IMGLY_DISABLE_VIEWER',\n 'on hides the browser viewer; designs are delivered as files (default: off).',\n { stable: false, next: false, canary: false },\n { honored: true }\n ),\n onOff(\n 'IMGLY_TELEMETRY',\n 'on | off — usage telemetry (default: on).',\n { stable: true, next: true, canary: true },\n { honored: true }\n ),\n onOff(\n 'IMGLY_ERROR_REPORTING',\n 'on | off — send error reports (crashes, failed tool calls) to IMG.LY (default: on).',\n { stable: true, next: true, canary: true },\n { honored: true }\n ),\n onOff(\n 'IMGLY_PLUGIN_TELEMETRY',\n 'on | off — set by the Claude plugin\\'s \"Send usage data\" setting; off turns usage telemetry and error reports off (default: on).',\n { stable: true, next: true, canary: true },\n { honored: true }\n ),\n onOff(\n 'IMGLY_PLUGIN_ERROR_REPORTING',\n 'on | off — set by the Claude plugin\\'s \"Send error reports\" setting; off turns error reports off (default: on).',\n { stable: true, next: true, canary: true },\n { honored: true }\n ),\n value(\n 'IMGLY_SENTRY_DSN',\n 'error-report destination for source builds; a published build uses its own.'\n ),\n onOff(\n 'IMGLY_DIAGNOSTICS_FILE',\n 'on | off — local diagnostics logging (default: on).',\n { stable: true, next: true, canary: true }\n ),\n onOff(\n 'IMGLY_DIAGNOSTICS_TOOL',\n 'on | off — the diagnostics tool (default: on).',\n { stable: true, next: true, canary: true }\n ),\n value(\n 'IMGLY_DIAGNOSTICS_DIR',\n 'where diagnostics logs are written (default: the platform state dir).'\n ),\n value(\n 'IMGLY_GATEWAY_API_KEY',\n 'AI gateway key; an alternative to signing in with the login tool.',\n { honored: true }\n ),\n value(\n 'IMGLY_GATEWAY_BASE_URL',\n 'AI gateway endpoint (default: IMG.LY hosted).'\n ),\n value(\n 'IMGLY_DEFAULT_ASSETS_BASE_URL',\n 'manifest root for the default asset sources (default: IMG.LY CDN).'\n ),\n value(\n 'IMGLY_DEMO_ASSETS_BASE_URL',\n 'manifest root for the demo asset sources (default: IMG.LY CDN).'\n ),\n value(\n 'IMGLY_GFONTS_CONTENT_URL',\n 'Google Fonts catalogue, `<root>/ly.img.gfonts/content.json`; its aliases load from `<root>/ly.img.gfonts-fallbacks/` (default: IMG.LY CDN).'\n )\n];\n\nexport function knob(name: string): Knob {\n const found = KNOBS.find((k) => k.name === name);\n if (!found) throw new Error(`unknown knob \"${name}\" — add it to KNOBS`);\n return found;\n}\n\nexport function onOffDefault(name: string, channel: Channel): boolean {\n const k = knob(name);\n if (k.kind !== 'on-off') {\n throw new Error(`\"${name}\" is not an on-off knob (kind: ${k.kind})`);\n }\n return k.defaults[channel];\n}\n\nexport function enumDefault(name: string, channel: Channel): string | null {\n const k = knob(name);\n if (k.kind !== 'enum') {\n throw new Error(`\"${name}\" is not an enum knob (kind: ${k.kind})`);\n }\n return k.defaults[channel];\n}\n"]}
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../src/services/flags/manifest.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,EAAE;AACF,6EAA6E;AAC7E,8CAA8C;AAC9C,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,6EAA6E;AAC7E,4EAA4E;AAC5E,gFAAgF;AAChF,oEAAoE;AACpE,qEAAqE;AA+BrE,MAAM,KAAK,GAAG,CACZ,IAAY,EACZ,OAAe,EACf,QAAkC,EAClC,QAA+B,EAAE,EACtB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;AAExE,MAAM,KAAK,GAAG,CACZ,IAAY,EACZ,OAAe,EACf,QAA+B,EAAE,EACtB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;AAE7D,MAAM,CAAC,MAAM,KAAK,GAAoB;IACpC;QACE,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,oBAAoB;QAC1B,MAAM,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;QAC1B,qEAAqE;QACrE,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IA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AAC,CAAC;AAC7B,CAAC","sourcesContent":["// packages/codesign-server/src/services/flags/manifest.ts\n//\n// The declared set of product knobs. One entry per environment variable, and\n// the single place a default is written down.\n//\n// Why this exists: a knob used to be four things in four places that nothing\n// forced to agree — a reader in features.ts, a line in status.config, an entry\n// in a hand-written DEV_ENV_HELP string, and a prefix rule in frozen-env.ts.\n// The first three now derive from here, and so does frozen-env.ts's list of\n// knobs that survive a release build (`honored`). The freeze itself is still by\n// PREFIX: a knob missing from this file is still frozen, it is just\n// undocumented, which is the pre-existing failure mode and no worse.\n\n/** Which build profile a bundle was produced for. */\nexport type Channel = 'stable' | 'next' | 'canary';\n\ntype Base = {\n name: string;\n /** One line, used verbatim by --help and the README table. */\n summary: string;\n /** Survives the release-build freeze (src/cli/frozen-env.ts says why each one does). */\n honored?: true;\n};\n\n/** on/off, true/false or 1/0, any case (config.ts `boolEnv`). Anything else throws — a typo must not mean \"off\". */\nexport type OnOffKnob = Base & {\n kind: 'on-off';\n defaults: Record<Channel, boolean>;\n};\n\n/** A closed set of spellings. A `null` default means unset — resolved later. */\nexport type EnumKnob = Base & {\n kind: 'enum';\n values: readonly string[];\n defaults: Record<Channel, string | null>;\n};\n\n/** Free-form string (URLs, paths, credentials). No channel defaults. */\nexport type ValueKnob = Base & { kind: 'value' };\n\nexport type Knob = OnOffKnob | EnumKnob | ValueKnob;\n\nconst onOff = (\n name: string,\n summary: string,\n defaults: Record<Channel, boolean>,\n extra: Pick<Base, 'honored'> = {}\n): OnOffKnob => ({ kind: 'on-off', name, summary, defaults, ...extra });\n\nconst value = (\n name: string,\n summary: string,\n extra: Pick<Base, 'honored'> = {}\n): ValueKnob => ({ kind: 'value', name, summary, ...extra });\n\nexport const KNOBS: readonly Knob[] = [\n {\n kind: 'enum',\n name: 'IMGLY_CESDK_ENGINE',\n values: ['wasm', 'native'],\n // null = native with WASM fallback; canary requires native outright.\n defaults: { stable: null, next: null, canary: 'native' },\n honored: true,\n summary:\n 'engine flavor: wasm | native (default: native, falling back to wasm if it cannot start).'\n },\n onOff(\n 'IMGLY_DISABLE_VIEWER',\n 'on hides the browser viewer; designs are delivered as files (default: off).',\n { stable: false, next: false, canary: false },\n { honored: true }\n ),\n onOff(\n 'IMGLY_TELEMETRY',\n 'on | off — usage telemetry (default: on).',\n { stable: true, next: true, canary: true },\n { honored: true }\n ),\n onOff(\n 'IMGLY_ERROR_REPORTING',\n 'on | off — send error reports (crashes, failed tool calls) to IMG.LY (default: on).',\n { stable: true, next: true, canary: true },\n { honored: true }\n ),\n onOff(\n 'IMGLY_PLUGIN_TELEMETRY',\n 'on | off — set by earlier Claude plugins\\' \"Send usage data\" setting; off turns usage telemetry and error reports off (default: on).',\n { stable: true, next: true, canary: true },\n { honored: true }\n ),\n onOff(\n 'IMGLY_PLUGIN_ERROR_REPORTING',\n 'on | off — set by earlier Claude plugins\\' \"Send error reports\" setting; off turns error reports off (default: on).',\n { stable: true, next: true, canary: true },\n { honored: true }\n ),\n value(\n 'IMGLY_SENTRY_DSN',\n 'error-report destination for source builds; a published build uses its own.'\n ),\n onOff(\n 'IMGLY_DIAGNOSTICS_FILE',\n 'on | off — local diagnostics logging (default: on).',\n { stable: true, next: true, canary: true }\n ),\n onOff(\n 'IMGLY_DIAGNOSTICS_TOOL',\n 'on | off — the diagnostics tool (default: on).',\n { stable: true, next: true, canary: true }\n ),\n value(\n 'IMGLY_DIAGNOSTICS_DIR',\n 'where diagnostics logs are written (default: the platform state dir).'\n ),\n value(\n 'IMGLY_GATEWAY_API_KEY',\n 'AI gateway key; an alternative to signing in with the login tool.',\n { honored: true }\n ),\n value(\n 'IMGLY_GATEWAY_BASE_URL',\n 'AI gateway endpoint (default: IMG.LY hosted).'\n ),\n value(\n 'IMGLY_DEFAULT_ASSETS_BASE_URL',\n 'manifest root for the default asset sources (default: IMG.LY CDN).'\n ),\n value(\n 'IMGLY_DEMO_ASSETS_BASE_URL',\n 'manifest root for the demo asset sources (default: IMG.LY CDN).'\n ),\n value(\n 'IMGLY_GFONTS_CONTENT_URL',\n 'Google Fonts catalogue, `<root>/ly.img.gfonts/content.json`; its aliases load from `<root>/ly.img.gfonts-fallbacks/` (default: IMG.LY CDN).'\n )\n];\n\nexport function knob(name: string): Knob {\n const found = KNOBS.find((k) => k.name === name);\n if (!found) throw new Error(`unknown knob \"${name}\" — add it to KNOBS`);\n return found;\n}\n\nexport function onOffDefault(name: string, channel: Channel): boolean {\n const k = knob(name);\n if (k.kind !== 'on-off') {\n throw new Error(`\"${name}\" is not an on-off knob (kind: ${k.kind})`);\n }\n return k.defaults[channel];\n}\n\nexport function enumDefault(name: string, channel: Channel): string | null {\n const k = knob(name);\n if (k.kind !== 'enum') {\n throw new Error(`\"${name}\" is not an enum knob (kind: ${k.kind})`);\n }\n return k.defaults[channel];\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  export declare const RELEASE_BUILD = true;
2
- export declare const CHANNEL = "stable";
2
+ export declare const CHANNEL = "next";
3
3
  export declare const SENTRY_DSN = "https://10cdfd2ee884954aab53abe5a2878b75@o497090.ingest.us.sentry.io/4512209592909824";
4
- export declare const COMMIT = "0d413470203d084fdcf261ac17b8a907935ea4a0";
5
- export declare const KNOB_ENV_HELP = " IMGLY_CESDK_ENGINE engine flavor: wasm | native (default: native,\n falling back to wasm if it cannot start).\n IMGLY_DISABLE_VIEWER on hides the browser viewer; designs are\n delivered as files (default: off).\n IMGLY_TELEMETRY on | off \u2014 usage telemetry (default: on).\n IMGLY_ERROR_REPORTING on | off \u2014 send error reports (crashes, failed\n tool calls) to IMG.LY (default: on).\n IMGLY_PLUGIN_TELEMETRY on | off \u2014 set by the Claude plugin's \"Send\n usage data\" setting; off turns usage telemetry\n and error reports off (default: on).\n IMGLY_PLUGIN_ERROR_REPORTING on | off \u2014 set by the Claude plugin's \"Send\n error reports\" setting; off turns error reports\n off (default: on).\n IMGLY_GATEWAY_API_KEY AI gateway key; an alternative to signing in\n with the login tool.\n";
4
+ export declare const COMMIT = "fdc6ee373e7238d547f646bd1e6836c369969d15";
5
+ export declare const KNOB_ENV_HELP = " IMGLY_CESDK_ENGINE engine flavor: wasm | native (default: native,\n falling back to wasm if it cannot start).\n IMGLY_DISABLE_VIEWER on hides the browser viewer; designs are\n delivered as files (default: off).\n IMGLY_TELEMETRY on | off \u2014 usage telemetry (default: on).\n IMGLY_ERROR_REPORTING on | off \u2014 send error reports (crashes, failed\n tool calls) to IMG.LY (default: on).\n IMGLY_PLUGIN_TELEMETRY on | off \u2014 set by earlier Claude plugins' \"Send\n usage data\" setting; off turns usage telemetry\n and error reports off (default: on).\n IMGLY_PLUGIN_ERROR_REPORTING on | off \u2014 set by earlier Claude plugins' \"Send\n error reports\" setting; off turns error reports\n off (default: on).\n IMGLY_GATEWAY_API_KEY AI gateway key; an alternative to signing in\n with the login tool.\n";
6
6
  //# sourceMappingURL=release-flags.generated.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"release-flags.generated.d.ts","sourceRoot":"","sources":["../../../src/services/flags/release-flags.generated.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,OAAO,CAAC;AAElC,eAAO,MAAM,OAAO,WAAW,CAAC;AAEhC,eAAO,MAAM,UAAU,0FAA0F,CAAC;AAElH,eAAO,MAAM,MAAM,6CAA6C,CAAC;AAGjE,eAAO,MAAM,aAAa,+mCAA2lC,CAAC"}
1
+ {"version":3,"file":"release-flags.generated.d.ts","sourceRoot":"","sources":["../../../src/services/flags/release-flags.generated.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,OAAO,CAAC;AAElC,eAAO,MAAM,OAAO,SAAS,CAAC;AAE9B,eAAO,MAAM,UAAU,0FAA0F,CAAC;AAElH,eAAO,MAAM,MAAM,6CAA6C,CAAC;AAGjE,eAAO,MAAM,aAAa,unCAAmmC,CAAC"}
@@ -2,12 +2,12 @@
2
2
  // True only when IMGLY_RELEASE_BUILD=true was set at build/publish time.
3
3
  export const RELEASE_BUILD = true;
4
4
  // Build profile: stable | next | canary. See src/services/flags/manifest.ts.
5
- export const CHANNEL = 'stable';
5
+ export const CHANNEL = 'next';
6
6
  // Error-report destination; empty unless a release build was given IMGLY_SENTRY_DSN.
7
7
  export const SENTRY_DSN = "https://10cdfd2ee884954aab53abe5a2878b75@o497090.ingest.us.sentry.io/4512209592909824";
8
8
  // The commit it is built from; empty when it is not known.
9
- export const COMMIT = "0d413470203d084fdcf261ac17b8a907935ea4a0";
9
+ export const COMMIT = "fdc6ee373e7238d547f646bd1e6836c369969d15";
10
10
  // The knob --help text. A release build lists only the honored knobs, so
11
11
  // the frozen names are absent from the published dist, not just unprinted.
12
- export const KNOB_ENV_HELP = " IMGLY_CESDK_ENGINE engine flavor: wasm | native (default: native,\n falling back to wasm if it cannot start).\n IMGLY_DISABLE_VIEWER on hides the browser viewer; designs are\n delivered as files (default: off).\n IMGLY_TELEMETRY on | off — usage telemetry (default: on).\n IMGLY_ERROR_REPORTING on | off — send error reports (crashes, failed\n tool calls) to IMG.LY (default: on).\n IMGLY_PLUGIN_TELEMETRY on | off — set by the Claude plugin's \"Send\n usage data\" setting; off turns usage telemetry\n and error reports off (default: on).\n IMGLY_PLUGIN_ERROR_REPORTING on | off — set by the Claude plugin's \"Send\n error reports\" setting; off turns error reports\n off (default: on).\n IMGLY_GATEWAY_API_KEY AI gateway key; an alternative to signing in\n with the login tool.\n";
12
+ export const KNOB_ENV_HELP = " IMGLY_CESDK_ENGINE engine flavor: wasm | native (default: native,\n falling back to wasm if it cannot start).\n IMGLY_DISABLE_VIEWER on hides the browser viewer; designs are\n delivered as files (default: off).\n IMGLY_TELEMETRY on | off — usage telemetry (default: on).\n IMGLY_ERROR_REPORTING on | off — send error reports (crashes, failed\n tool calls) to IMG.LY (default: on).\n IMGLY_PLUGIN_TELEMETRY on | off — set by earlier Claude plugins' \"Send\n usage data\" setting; off turns usage telemetry\n and error reports off (default: on).\n IMGLY_PLUGIN_ERROR_REPORTING on | off — set by earlier Claude plugins' \"Send\n error reports\" setting; off turns error reports\n off (default: on).\n IMGLY_GATEWAY_API_KEY AI gateway key; an alternative to signing in\n with the login tool.\n";
13
13
  //# sourceMappingURL=release-flags.generated.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"release-flags.generated.js","sourceRoot":"","sources":["../../../src/services/flags/release-flags.generated.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,yEAAyE;AACzE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAClC,6EAA6E;AAC7E,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC;AAChC,qFAAqF;AACrF,MAAM,CAAC,MAAM,UAAU,GAAG,uFAAuF,CAAC;AAClH,2DAA2D;AAC3D,MAAM,CAAC,MAAM,MAAM,GAAG,0CAA0C,CAAC;AACjE,yEAAyE;AACzE,2EAA2E;AAC3E,MAAM,CAAC,MAAM,aAAa,GAAG,wlCAAwlC,CAAC","sourcesContent":["// AUTO-GENERATED by scripts/generate-release-flags.mjs — do not edit.\n// True only when IMGLY_RELEASE_BUILD=true was set at build/publish time.\nexport const RELEASE_BUILD = true;\n// Build profile: stable | next | canary. See src/services/flags/manifest.ts.\nexport const CHANNEL = 'stable';\n// Error-report destination; empty unless a release build was given IMGLY_SENTRY_DSN.\nexport const SENTRY_DSN = \"https://10cdfd2ee884954aab53abe5a2878b75@o497090.ingest.us.sentry.io/4512209592909824\";\n// The commit it is built from; empty when it is not known.\nexport const COMMIT = \"0d413470203d084fdcf261ac17b8a907935ea4a0\";\n// The knob --help text. A release build lists only the honored knobs, so\n// the frozen names are absent from the published dist, not just unprinted.\nexport const KNOB_ENV_HELP = \" IMGLY_CESDK_ENGINE engine flavor: wasm | native (default: native,\\n falling back to wasm if it cannot start).\\n IMGLY_DISABLE_VIEWER on hides the browser viewer; designs are\\n delivered as files (default: off).\\n IMGLY_TELEMETRY on | off — usage telemetry (default: on).\\n IMGLY_ERROR_REPORTING on | off — send error reports (crashes, failed\\n tool calls) to IMG.LY (default: on).\\n IMGLY_PLUGIN_TELEMETRY on | off — set by the Claude plugin's \\\"Send\\n usage data\\\" setting; off turns usage telemetry\\n and error reports off (default: on).\\n IMGLY_PLUGIN_ERROR_REPORTING on | off — set by the Claude plugin's \\\"Send\\n error reports\\\" setting; off turns error reports\\n off (default: on).\\n IMGLY_GATEWAY_API_KEY AI gateway key; an alternative to signing in\\n with the login tool.\\n\";\n"]}
1
+ {"version":3,"file":"release-flags.generated.js","sourceRoot":"","sources":["../../../src/services/flags/release-flags.generated.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,yEAAyE;AACzE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAClC,6EAA6E;AAC7E,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC;AAC9B,qFAAqF;AACrF,MAAM,CAAC,MAAM,UAAU,GAAG,uFAAuF,CAAC;AAClH,2DAA2D;AAC3D,MAAM,CAAC,MAAM,MAAM,GAAG,0CAA0C,CAAC;AACjE,yEAAyE;AACzE,2EAA2E;AAC3E,MAAM,CAAC,MAAM,aAAa,GAAG,gmCAAgmC,CAAC","sourcesContent":["// AUTO-GENERATED by scripts/generate-release-flags.mjs — do not edit.\n// True only when IMGLY_RELEASE_BUILD=true was set at build/publish time.\nexport const RELEASE_BUILD = true;\n// Build profile: stable | next | canary. See src/services/flags/manifest.ts.\nexport const CHANNEL = 'next';\n// Error-report destination; empty unless a release build was given IMGLY_SENTRY_DSN.\nexport const SENTRY_DSN = \"https://10cdfd2ee884954aab53abe5a2878b75@o497090.ingest.us.sentry.io/4512209592909824\";\n// The commit it is built from; empty when it is not known.\nexport const COMMIT = \"fdc6ee373e7238d547f646bd1e6836c369969d15\";\n// The knob --help text. A release build lists only the honored knobs, so\n// the frozen names are absent from the published dist, not just unprinted.\nexport const KNOB_ENV_HELP = \" IMGLY_CESDK_ENGINE engine flavor: wasm | native (default: native,\\n falling back to wasm if it cannot start).\\n IMGLY_DISABLE_VIEWER on hides the browser viewer; designs are\\n delivered as files (default: off).\\n IMGLY_TELEMETRY on | off — usage telemetry (default: on).\\n IMGLY_ERROR_REPORTING on | off — send error reports (crashes, failed\\n tool calls) to IMG.LY (default: on).\\n IMGLY_PLUGIN_TELEMETRY on | off — set by earlier Claude plugins' \\\"Send\\n usage data\\\" setting; off turns usage telemetry\\n and error reports off (default: on).\\n IMGLY_PLUGIN_ERROR_REPORTING on | off — set by earlier Claude plugins' \\\"Send\\n error reports\\\" setting; off turns error reports\\n off (default: on).\\n IMGLY_GATEWAY_API_KEY AI gateway key; an alternative to signing in\\n with the login tool.\\n\";\n"]}
@@ -0,0 +1,15 @@
1
+ import { type Env } from './config.js';
2
+ export interface GatewayBearerOptions {
3
+ env: Env;
4
+ loginManager?: {
5
+ ensureFreshTokens(opts: {
6
+ force: boolean;
7
+ }): Promise<{
8
+ accessToken: string;
9
+ } | undefined>;
10
+ };
11
+ }
12
+ export declare function gatewayBearer(opts: GatewayBearerOptions): (call?: {
13
+ forceRefresh?: boolean;
14
+ }) => Promise<string | undefined>;
15
+ //# sourceMappingURL=gateway-bearer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gateway-bearer.d.ts","sourceRoot":"","sources":["../../src/services/gateway-bearer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,GAAG,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,GAAG,CAAC;IACT,YAAY,CAAC,EAAE;QACb,iBAAiB,CAAC,IAAI,EAAE;YACtB,KAAK,EAAE,OAAO,CAAC;SAChB,GAAG,OAAO,CAAC;YAAE,WAAW,EAAE,MAAM,CAAA;SAAE,GAAG,SAAS,CAAC,CAAC;KAClD,CAAC;CACH;AAED,wBAAgB,aAAa,CAC3B,IAAI,EAAE,oBAAoB,GACzB,CAAC,IAAI,CAAC,EAAE;IAAE,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAUpE"}
@@ -0,0 +1,14 @@
1
+ // The bearer for the AI gateway, resolved per request: the IMGLY_GATEWAY_API_KEY(_FILE) key beats the sign-in. The
2
+ // file is read again each time, so a host that rotates it never sends an expired one.
3
+ import { resolveSecret } from './config.js';
4
+ export function gatewayBearer(opts) {
5
+ return async (call) => {
6
+ const key = resolveSecret('IMGLY_GATEWAY_API_KEY', opts.env).value?.trim();
7
+ if (key)
8
+ return key;
9
+ return (await opts.loginManager?.ensureFreshTokens({
10
+ force: call?.forceRefresh === true
11
+ }))?.accessToken;
12
+ };
13
+ }
14
+ //# sourceMappingURL=gateway-bearer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gateway-bearer.js","sourceRoot":"","sources":["../../src/services/gateway-bearer.ts"],"names":[],"mappings":"AAAA,mHAAmH;AACnH,sFAAsF;AACtF,OAAO,EAAE,aAAa,EAAY,MAAM,aAAa,CAAC;AAWtD,MAAM,UAAU,aAAa,CAC3B,IAA0B;IAE1B,OAAO,KAAK,EAAE,IAAI,EAAE,EAAE;QACpB,MAAM,GAAG,GAAG,aAAa,CAAC,uBAAuB,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC;QAC3E,IAAI,GAAG;YAAE,OAAO,GAAG,CAAC;QACpB,OAAO,CACL,MAAM,IAAI,CAAC,YAAY,EAAE,iBAAiB,CAAC;YACzC,KAAK,EAAE,IAAI,EAAE,YAAY,KAAK,IAAI;SACnC,CAAC,CACH,EAAE,WAAW,CAAC;IACjB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["// The bearer for the AI gateway, resolved per request: the IMGLY_GATEWAY_API_KEY(_FILE) key beats the sign-in. The\n// file is read again each time, so a host that rotates it never sends an expired one.\nimport { resolveSecret, type Env } from './config.js';\n\nexport interface GatewayBearerOptions {\n env: Env;\n loginManager?: {\n ensureFreshTokens(opts: {\n force: boolean;\n }): Promise<{ accessToken: string } | undefined>;\n };\n}\n\nexport function gatewayBearer(\n opts: GatewayBearerOptions\n): (call?: { forceRefresh?: boolean }) => Promise<string | undefined> {\n return async (call) => {\n const key = resolveSecret('IMGLY_GATEWAY_API_KEY', opts.env).value?.trim();\n if (key) return key;\n return (\n await opts.loginManager?.ensureFreshTokens({\n force: call?.forceRefresh === true\n })\n )?.accessToken;\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"error-policy.d.ts","sourceRoot":"","sources":["../../../src/services/telemetry/error-policy.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,cAAc,EACpB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;AAE3D,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,CAiChD,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,eAAe,EAAE,KAAK,GAAG,QAAQ,CAmDlE,CAAC;AAEF,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,KAAK,IAAI,eAAe,CAE1B;AAED,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;AAsCvD,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAqB9D;AAGD,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAInD;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;AAE7C,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACnC,wFAAwF;IACxF,MAAM,EAAE,WAAW,CAAC;IACpB,uGAAuG;IACvG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,KAAK,CA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O,GAAE,OAAiB,GACzB,OAAO,GAAG,SAAS,CAKrB"}
@@ -161,6 +161,7 @@ export const ENGINE_CODE_FAULT = {
161
161
  'BLOCK.VALUE_NOT_FINITE': { fault: 'agent' },
162
162
  'BLOCK.VALUES_NOT_FINITE_THREE': { fault: 'agent' },
163
163
  'BLOCK.NOT_KNOWN_BLOCK_TYPE': { fault: 'agent' },
164
+ 'BLOCK.UNKNOWN_BLOCK_TYPE': { fault: 'agent' },
164
165
  'BLOCK.NOT_ATTACHED_TO_SCENE': { fault: 'agent' },
165
166
  'BLOCK.TEXT_RANGE_FROM_OUT_OF_RANGE': { fault: 'agent' },
166
167
  'BLOCK.TEXT_RANGE_TO_OUT_OF_RANGE': { fault: 'agent' },
@@ -173,6 +174,41 @@ export const ENGINE_CODE_FAULT = {
173
174
  'BLOCK.ANIMATION_NOT_LOOP_TYPE': { fault: 'agent' },
174
175
  'BLOCK.ANIMATION_NOT_IN_TYPE': { fault: 'agent' },
175
176
  'BLOCK.ANIMATION_NOT_OUT_TYPE': { fault: 'agent' },
177
+ // Our code passes the model's gradient stops through as written.
178
+ 'BLOCK.GRADIENT_COLOR_STOPS_DUPLICATE': { fault: 'agent' },
179
+ 'BLOCK.GRADIENT_COLOR_STOPS_NOT_SORTED': { fault: 'agent' },
180
+ 'BLOCK.GRADIENT_COLOR_STOPS_OUT_OF_RANGE': { fault: 'agent' },
181
+ // Values and type names the model's code passes; engine-code-faults.engine.test.ts raises each.
182
+ 'BLOCK.STROKE_WIDTH_INVALID': { fault: 'agent' },
183
+ 'BLOCK.STROKE_DASH_ARRAY_INVALID': { fault: 'agent' },
184
+ 'BLOCK.STROKE_MITER_LIMIT_INVALID': { fault: 'agent' },
185
+ 'BLOCK.SHADOW_X_BLUR_INVALID': { fault: 'agent' },
186
+ 'BLOCK.SHADOW_Y_BLUR_INVALID': { fault: 'agent' },
187
+ 'BLOCK.SHADOW_X_OFFSET_INVALID': { fault: 'agent' },
188
+ 'BLOCK.SHADOW_Y_OFFSET_INVALID': { fault: 'agent' },
189
+ 'BLOCK.TEXT_INVALID_FONT_SIZE': { fault: 'agent' },
190
+ 'BLOCK.TEXT_LINE_HEIGHT_INVALID': { fault: 'agent' },
191
+ 'BLOCK.TEXT_LIST_LEVEL_NEGATIVE': { fault: 'agent' },
192
+ 'BLOCK.TEXT_LIST_LEVEL_TOO_LARGE': { fault: 'agent' },
193
+ 'BLOCK.TEXT_INVALID_BASELINE_SHIFT': { fault: 'agent' },
194
+ 'BLOCK.TEXT_INVALID_KERNING': { fault: 'agent' },
195
+ 'BLOCK.COLOR_TINT_OUT_OF_RANGE': { fault: 'agent' },
196
+ 'BLOCK.VALUE_NOT_FINITE_IN_UNIT_RANGE': { fault: 'agent' },
197
+ 'BLOCK.UNKNOWN_FILL_TYPE': { fault: 'agent' },
198
+ 'BLOCK.FILL_TEXT_SOLID_COLOR_ONLY': { fault: 'agent' },
199
+ 'BLOCK.UNKNOWN_SHAPE_TYPE': { fault: 'agent' },
200
+ 'BLOCK.BLUR_UNKNOWN_TYPE': { fault: 'agent' },
201
+ 'BLOCK.EFFECT_UNKNOWN_TYPE': { fault: 'agent' },
202
+ 'BLOCK.ANIMATION_TYPE_NOT_REGISTERED': { fault: 'agent' },
203
+ 'EDITOR.PLAYBACK_SPEED_OUT_OF_RANGE': { fault: 'agent' },
204
+ 'EDITOR.PLAYBACK_SPEED_TOO_LOW': { fault: 'agent' },
205
+ // The facade checks these itself, so only the model's raw call is the model's fault.
206
+ 'BLOCK.KEYFRAMES_EMPTY': { fault: 'agent', rawOnly: true },
207
+ 'BLOCK.VARIABLE_NAME_INVALID': { fault: 'agent', rawOnly: true },
208
+ 'BLOCK.VALUE_SET_NAME_INVALID': { fault: 'agent', rawOnly: true },
209
+ 'BLOCK.VARIABLE_TYPE_MISMATCH': { fault: 'agent', rawOnly: true },
210
+ 'BLOCK.FILL_MISSING': { fault: 'agent', rawOnly: true },
211
+ 'BLOCK.FILL_NOT_VALID': { fault: 'agent', rawOnly: true },
176
212
  // A page a stack places; our code moves only a page's children.
177
213
  'BLOCK.POSITION_PARENT_CONTROLLED': { fault: 'agent' },
178
214
  'EDITOR.AV_OPERATION_BLOCK_TYPE_UNSUPPORTED': { fault: 'agent' },
@@ -1 +1 @@
1
- {"version":3,"file":"error-policy.js","sourceRoot":"","sources":["../../../src/services/telemetry/error-policy.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EAItB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAK9C,MAAM,CAAC,MAAM,WAAW,GAA6B;IACnD,iBAAiB,EAAE,MAAM;IACzB,iBAAiB,EAAE,UAAU;IAC7B,QAAQ,EAAE,OAAO;IACjB,gBAAgB,EAAE,OAAO;IACzB,gBAAgB,EAAE,MAAM;IACxB,kBAAkB,EAAE,MAAM;IAC1B,cAAc,EAAE,MAAM;IACtB,cAAc,EAAE,MAAM;IACtB,eAAe,EAAE,MAAM;IACvB,eAAe,EAAE,MAAM;IACvB,SAAS,EAAE,MAAM;IACjB,cAAc,EAAE,OAAO;IACvB,aAAa,EAAE,MAAM;IACrB,mBAAmB,EAAE,MAAM;IAC3B,oBAAoB,EAAE,UAAU;IAChC,cAAc,EAAE,UAAU;IAC1B,oBAAoB,EAAE,MAAM;IAC5B,UAAU,EAAE,OAAO;IACnB,iBAAiB,EAAE,OAAO;IAC1B,cAAc,EAAE,OAAO;IACvB,kBAAkB,EAAE,OAAO;IAC3B,qBAAqB,EAAE,MAAM;IAC7B,YAAY,EAAE,UAAU;IACxB,cAAc,EAAE,UAAU;IAC1B,oBAAoB,EAAE,UAAU;IAChC,eAAe,EAAE,UAAU;IAC3B,iBAAiB,EAAE,UAAU;IAC7B,kBAAkB,EAAE,UAAU;IAC9B,kBAAkB,EAAE,UAAU;IAC9B,sBAAsB,EAAE,UAAU;IAClC,aAAa,EAAE,UAAU;IACzB,aAAa,EAAE,UAAU;C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AC,IAAI,CAAC,CAAC;IAChC,OAAO,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,OAAO;QAC1C,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE;QAC3B,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC","sourcesContent":["// Which failed tool calls are ours to report, and where a thrown error came from.\nimport {\n DESIGN_ERROR_CODES,\n ENGINE_NOT_APPLICABLE,\n type DesignErrorCode,\n type ErrorCode,\n type ToolCallReport\n} from '@imgly/codesign-sdk/internal';\nimport { CHANNEL } from '../flags/channel.js';\nimport type { Channel } from '../flags/manifest.js';\n\nexport type Fault = 'agent' | 'user' | 'upstream' | 'ours';\n\nexport const ERROR_FAULT: Record<ErrorCode, Fault> = {\n executor_capacity: 'user',\n resources_pending: 'upstream',\n bad_args: 'agent',\n unknown_revision: 'agent',\n feature_disabled: 'user',\n engine_unsupported: 'user',\n internal_error: 'ours',\n design_changed: 'user',\n design_conflict: 'user',\n unsaved_changes: 'user',\n cancelled: 'user',\n unknown_format: 'agent',\n render_failed: 'ours',\n pdfx_convert_failed: 'ours',\n profile_fetch_failed: 'upstream',\n export_refused: 'upstream',\n outpath_write_failed: 'user',\n code_threw: 'agent',\n dialect_violation: 'agent',\n scene_file_uri: 'agent',\n scene_inline_bytes: 'agent',\n engine_option_refused: 'ours',\n unauthorized: 'upstream',\n no_credentials: 'upstream',\n insufficient_credits: 'upstream',\n model_not_found: 'upstream',\n generation_failed: 'upstream',\n generation_timeout: 'upstream',\n result_unavailable: 'upstream',\n output_download_failed: 'upstream',\n service_error: 'upstream',\n gateway_error: 'upstream'\n};\n\n/** Who caused a design facade error, by the code the facade gave it. */\nexport const DESIGN_FAULT: Record<DesignErrorCode, Fault | 'engine'> = {\n 'DESIGN.UNKNOWN_UUID': 'agent',\n 'DESIGN.UNKNOWN_BLOCK': 'agent',\n 'DESIGN.BAD_ARGUMENT': 'agent',\n 'DESIGN.PROMISE_AS_ID': 'agent',\n 'DESIGN.TREE_NODE_WITHOUT_UUID': 'agent',\n 'DESIGN.UNKNOWN_LEAF': 'agent',\n 'DESIGN.LEAF_VALUE': 'agent',\n 'DESIGN.UNKNOWN_SELECTOR': 'agent',\n 'DESIGN.EMPTY_SELECT': 'agent',\n 'DESIGN.WRITE_ONLY': 'agent',\n 'DESIGN.NO_SCENE_FOR_UNITS': 'agent',\n 'DESIGN.FONT_SIZE_FORMAT': 'agent',\n 'DESIGN.NO_SLOT': 'agent',\n 'DESIGN.NO_FILL': 'agent',\n 'DESIGN.NOT_APPLICABLE': 'agent',\n 'DESIGN.BLOCK_REF': 'agent',\n 'DESIGN.MATTE_SOURCE': 'agent',\n 'DESIGN.EFFECT_SOURCE': 'agent',\n 'DESIGN.ANIMATION_LEAF': 'agent',\n 'DESIGN.KEYFRAMES': 'agent',\n 'DESIGN.NOT_ANIMATABLE': 'agent',\n 'DESIGN.TEXT_FILL_COLOR': 'agent',\n 'DESIGN.TEXT_FRAME_TOO_SMALL': 'agent',\n 'DESIGN.METRICS_NOT_CACHED': 'agent',\n 'DESIGN.SPEC_TYPE': 'agent',\n 'DESIGN.TRANSITION_WITHOUT_NEXT': 'agent',\n 'DESIGN.PATH_SPEC': 'agent',\n 'DESIGN.CREATE_INSTEAD': 'agent',\n 'DESIGN.GROUP_WITHOUT_CHILDREN': 'agent',\n 'DESIGN.INDEX_OUT_OF_BOUNDS': 'agent',\n 'DESIGN.ORDER_TARGET': 'agent',\n 'DESIGN.CAPTION_PARENT': 'agent',\n 'DESIGN.FONT_ARGS': 'agent',\n 'DESIGN.FONT_NEEDS_ASYNC': 'agent',\n 'DESIGN.FONT_WEIGHT': 'agent',\n 'DESIGN.NO_TYPEFACE': 'agent',\n 'DESIGN.NO_STYLED_RUN': 'agent',\n 'DESIGN.FONT_NOT_FOUND': 'agent',\n 'DESIGN.FONT_NO_FILES': 'upstream',\n 'DESIGN.FONT_NAME_TAKEN': 'agent',\n 'DESIGN.FONT_SOURCE_MISSING': 'upstream',\n 'DESIGN.FONT_METRICS_FETCH': 'upstream',\n 'DESIGN.RESOURCE_LOAD_FAILED': 'upstream',\n 'DESIGN.TRANSCRIPT_READ': 'agent',\n 'DESIGN.TEXT_NOT_FOUND': 'agent',\n 'DESIGN.TEXT_AMBIGUOUS': 'agent',\n 'DESIGN.PROPERTY_BOUND': 'agent',\n 'DESIGN.VARIABLE_TYPE': 'agent',\n 'DESIGN.INTERNAL': 'ours',\n 'DESIGN.ENGINE': 'engine'\n};\n\nexport function isDesignErrorCode(\n value: string | undefined\n): value is DesignErrorCode {\n return (DESIGN_ERROR_CODES as readonly string[]).includes(value ?? '');\n}\n\nexport type ThrowSite = 'engine' | 'model' | 'unknown';\n\nconst EDIT_SCOPE_FRAME = /codesign-sdk[\\\\/]dist[\\\\/]host[\\\\/]edit-scope\\.js/;\nconst FACADE_FRAME = /codesign-sdk[\\\\/]dist[\\\\/]design[\\\\/]/;\nconst ENGINE_FRAME =\n /node_modules[\\\\/]@cesdk[\\\\/]|codesign-sdk[\\\\/]dist[\\\\/](?:design[\\\\/]|host[\\\\/]edit-scope\\.js)/;\n// edit's wrapper around engine.design, between the facade and the model's code.\nconst EDIT_CODE_FRAME = /codesign-sdk[\\\\/]dist[\\\\/]host[\\\\/]edit-code\\.js:/;\nconst MODEL_FRAME = /eval at runEditCode/;\n// CE.SDK's argument checks: WASM's validation and native's binding.\nconst ARGUMENT_ERROR =\n /^(?:StructError: |TypeError: (?:Error in argument |[^\\n]* expected\\n))/;\n// edit's patch of scene.create, between the engine and the model's code.\nconst SCENE_PATCH_FRAME = /codesign-sdk[\\\\/]dist[\\\\/]host[\\\\/]scene\\.js:/;\n// A text helper tripping over a value of the wrong shape; from the facade, which names what it refuses, it is a bug of ours.\nconst BUILTIN_ERROR = /^(?:TypeError|RangeError): /;\n\n// A parse error in edit code is thrown by the AsyncFunction constructor that runEditCode calls.\nconst MODEL_PARSE =\n /^\\s*at new AsyncFunction \\(<anonymous>\\)\\n\\s*at (?:async )?runEditCode /;\n\nconst sourceFrames = (stack: string | undefined): string[] =>\n stack\n ?.split('\\n')\n .filter(\n (line) =>\n line.trimStart().startsWith('at ') &&\n !/\\((?:<anonymous>|native)\\)$|[( ]node:|[( ]wasm:\\/\\//.test(line)\n ) ?? [];\n\nconst callerOf = (frames: string[]): string | undefined =>\n frames.find(\n (f) =>\n !ENGINE_FRAME.test(f) &&\n !SCENE_PATCH_FRAME.test(f) &&\n !(EDIT_CODE_FRAME.test(f) && !f.includes('runEditCode'))\n );\n\nexport function throwSite(stack: string | undefined): ThrowSite {\n const frames = stack?.slice(stack.indexOf('\\n at ') + 1);\n if (frames !== undefined && MODEL_PARSE.test(frames)) return 'model';\n const all = sourceFrames(stack);\n const top = all[0];\n if (top === undefined) return 'unknown';\n if (ENGINE_FRAME.test(top)) {\n const caller = callerOf(all);\n const builtin = BUILTIN_ERROR.test(stack ?? '');\n const refused =\n ARGUMENT_ERROR.test(stack ?? '') ||\n (EDIT_SCOPE_FRAME.test(top) && builtin);\n if (refused && caller !== undefined && MODEL_FRAME.test(caller))\n return 'model';\n // The text helpers and the facade are our code, not the engine's: stable must still hear of them.\n return EDIT_SCOPE_FRAME.test(top) || (FACADE_FRAME.test(top) && builtin)\n ? 'unknown'\n : 'engine';\n }\n if (MODEL_FRAME.test(top)) return 'model';\n return 'unknown';\n}\n\n// Looks past engine and design-layer frames to who called them.\nexport function thrownByModel(err: unknown): boolean {\n if (!(err instanceof Error)) return false;\n const caller = callerOf(sourceFrames(err.stack));\n return caller !== undefined && MODEL_FRAME.test(caller);\n}\n\nexport type FaultSource = 'rule' | 'default';\n\nexport interface Verdict {\n fault: 'ours' | 'engine' | 'agent';\n /** `default` when no table or list named the failure and a fallback chose its fault. */\n source: FaultSource;\n /** The engine code a render failure was matched by: its own, or the listed one its text stands for. */\n engineCode?: string;\n /** Sentry's level when it is not `error`: see levelOf. */\n level?: 'info' | 'warning';\n}\n\n/** The model's mistakes go out as info, engine faults on stable as warnings until their volume is known; the rest as errors. */\nexport function levelOf(\n fault: Verdict['fault'],\n channel: Channel\n): 'info' | 'warning' | undefined {\n if (fault === 'agent') return 'info';\n return fault === 'engine' && channel === 'stable' ? 'warning' : undefined;\n}\n\nexport type Owner = 'agent' | 'engine' | 'environment';\ntype Owned = Omit<Verdict, 'fault'> & {\n fault: Verdict['fault'] | 'environment';\n};\n\n/** One owner per engine code for edit, export and preview; rawOnly and text: see the Sentry spec. */\nexport const ENGINE_CODE_FAULT: Readonly<\n Record<string, { fault: Owner; rawOnly?: true; text?: RegExp }>\n> = {\n // The model's raw read of a property its block lacks; the facade answers the same refusal as DESIGN.NOT_APPLICABLE.\n ...Object.fromEntries(\n [...ENGINE_NOT_APPLICABLE].map((code) => [\n code,\n { fault: 'agent', rawOnly: true } as const\n ])\n ),\n 'BLOCK.ENUM_VALUE_INVALID': { fault: 'agent' },\n 'BLOCK.COLOR_COMPONENT_OUT_OF_RANGE': { fault: 'agent' },\n 'BLOCK.VALUE_NOT_FINITE': { fault: 'agent' },\n 'BLOCK.VALUES_NOT_FINITE_THREE': { fault: 'agent' },\n 'BLOCK.NOT_KNOWN_BLOCK_TYPE': { fault: 'agent' },\n 'BLOCK.NOT_ATTACHED_TO_SCENE': { fault: 'agent' },\n 'BLOCK.TEXT_RANGE_FROM_OUT_OF_RANGE': { fault: 'agent' },\n 'BLOCK.TEXT_RANGE_TO_OUT_OF_RANGE': { fault: 'agent' },\n 'BLOCK.OPERATION_PRECONDITION_FAILED': { fault: 'agent' },\n 'BLOCK.SCOPE_INVALID': { fault: 'agent' },\n 'BLOCK.PROPERTY_INVALID_ENUM_VALUE_CHOICES': { fault: 'agent' },\n 'BLOCK.CREATION_NOT_ALLOWED': { fault: 'agent' },\n 'BLOCK.PROPERTY_NOT_WRITEABLE': { fault: 'agent' },\n 'BLOCK.NOT_A_TEXT_BLOCK_SIMPLE': { fault: 'agent' },\n 'BLOCK.ANIMATION_NOT_LOOP_TYPE': { fault: 'agent' },\n 'BLOCK.ANIMATION_NOT_IN_TYPE': { fault: 'agent' },\n 'BLOCK.ANIMATION_NOT_OUT_TYPE': { fault: 'agent' },\n // A page a stack places; our code moves only a page's children.\n 'BLOCK.POSITION_PARENT_CONTROLLED': { fault: 'agent' },\n 'EDITOR.AV_OPERATION_BLOCK_TYPE_UNSUPPORTED': { fault: 'agent' },\n 'EDITOR.NEGATIVE_DURATION': { fault: 'agent' },\n // The page's size, which the model chose (GH PR #859); export answers it before the policy.\n 'CODEC.VIDEO_ENCODER_INVALID_RESOLUTION': { fault: 'agent' },\n // A resource the model's code set made no loading progress; a deep video's slow decode is PENDING_VIDEO, uncoded.\n 'ENCODE.BLOCKS_STAYED_PENDING': { fault: 'agent' },\n 'BLOCK.UNKNOWN': { fault: 'agent', rawOnly: true },\n 'BLOCK.PROPERTY_NOT_FOUND_WITH_HINT': { fault: 'agent', rawOnly: true },\n 'ENCODE.BLOCK_MUST_BE_PAGE': {\n fault: 'agent',\n text: /\\bThe block to export must be a page\\./\n },\n 'ENCODE.BLOCK_SIZE_ZERO': {\n fault: 'agent',\n text: /\\bBlock to export has size 0\\./\n },\n 'ENCODE.OUTPUT_SIZE_EXCEEDS_MAX': {\n fault: 'agent',\n text: /\\bThe output size of \\d+x\\d+ px for the export exceeds the maximum supported size\\b/\n },\n // An image, gradient or effect the model sized rasterizes past the device's maximum at the scene's DPI.\n 'ENCODE.PDF_RENDER_SIZE_EXCEEDS_MAX': {\n fault: 'agent',\n text: /\\bAn image, gradient or effect of the PDF export renders at \\d+x\\d+ px\\b/\n },\n // The device ran out of memory: nobody's code is at fault, so it is never reported.\n 'ENCODE.OUTPUT_SIZE_INSUFFICIENT_RESOURCES': {\n fault: 'environment',\n text: /\\bCould not export at \\d+x\\d+\\. Not enough resources available on device\\./\n },\n 'ENCODE.PDF_CREATE_FAILED_RESOURCES': {\n fault: 'environment',\n text: /\\bFailed to create PDF document\\. Not enough resources available on device\\./\n },\n // The temporary directory is missing, read-only or full.\n 'ENCODE.VIDEO_STAGING_WRITE_FAILED': { fault: 'environment' },\n 'ENCODE.AUDIO_STAGING_WRITE_FAILED': { fault: 'environment' },\n 'ENCODE.PDF_STAGING_WRITE_FAILED': { fault: 'environment' },\n 'ENCODE.INSUFFICIENT_RESOURCES': {\n fault: 'environment',\n text: /\\bNot enough resources available on device\\./\n }\n};\n\nconst ENGINE_CODE_TEXTS = Object.entries(ENGINE_CODE_FAULT).flatMap(\n ([code, { text }]) => (text !== undefined ? [{ code, text }] : [])\n);\n\nfunction engineCodeFault(code: string, byModel: boolean): Owner | undefined {\n const entry = ENGINE_CODE_FAULT[code];\n return entry === undefined || (entry.rawOnly === true && !byModel)\n ? undefined\n : entry.fault;\n}\n\n// An engine code has a dot, which a Node code like `ERR_INVALID_ARG_TYPE` never has.\nconst HEAD_ENGINE_CODE = /^\\w+ \\[([A-Z0-9_]+(?:\\.[A-Z0-9_]+)+)\\]/;\nconst MESSAGE_ENGINE_CODE = /^\\[([A-Z0-9_]+(?:\\.[A-Z0-9_]+)+)\\]/;\nconst ENGINE_CODE_SHAPE = /^[A-Z0-9_]+(?:\\.[A-Z0-9_]+)+$/;\n\nfunction engineCodeOf(message: string, stack: string | undefined) {\n const head = stack?.split('\\n', 1)[0] ?? '';\n return (\n HEAD_ENGINE_CODE.exec(head)?.[1] ??\n MESSAGE_ENGINE_CODE.exec(message)?.[1] ??\n ENGINE_CODE_TEXTS.find((t) => t.text.test(`${message}\\n${head}`))?.code\n );\n}\n\n/** The engine code and the table's owner of an engine error a call from the model's code threw, outside any tool call. */\nexport function modelEngineError(\n err: Error\n): { code: string; owner: Owner | undefined } | undefined {\n const code = engineCodeOf(err.message, err.stack);\n return code === undefined\n ? undefined\n : { code, owner: engineCodeFault(code, true) };\n}\n\nfunction renderFault(\n error: ToolCallReport['error'],\n engineCode = engineCodeOf(error?.message ?? '', error?.stack)\n): Owned {\n if (engineCode === undefined) return { fault: 'ours', source: 'default' };\n const fault = engineCodeFault(engineCode, false);\n return fault !== undefined\n ? { fault, source: 'rule', engineCode }\n : { fault: 'engine', source: 'default', engineCode };\n}\n\nexport function reportable(\n report: ToolCallReport,\n channel: Channel = CHANNEL\n): Verdict | undefined {\n const verdict = faultOf(report);\n if (verdict === undefined) return undefined;\n const level = levelOf(verdict.fault, channel);\n return level === undefined ? verdict : { ...verdict, level };\n}\n\nfunction faultOf(report: ToolCallReport): Verdict | undefined {\n const onChannel = (v: Owned): Verdict | undefined =>\n v.fault === 'environment' ? undefined : { ...v, fault: v.fault };\n if (report.succeeded) return undefined;\n const code = report.errorCode;\n if (code === undefined)\n return report.error ? { fault: 'ours', source: 'default' } : undefined;\n if (code === 'code_threw' && isDesignErrorCode(report.errorDetail)) {\n if (report.errorDetail === 'DESIGN.ENGINE') {\n const fault = engineCodeFault(\n report.designError?.engineCode ?? '',\n false\n );\n return onChannel(\n fault !== undefined\n ? { fault, source: 'rule' }\n : { fault: 'engine', source: 'default' }\n );\n }\n const fault = DESIGN_FAULT[report.errorDetail];\n return fault === 'ours' || fault === 'agent' || fault === 'engine'\n ? onChannel({ fault, source: 'rule' })\n : undefined;\n }\n if (code === 'code_threw') {\n const stack = report.error?.stack;\n const caller = callerOf(sourceFrames(stack));\n const detail = report.errorDetail ?? '';\n const site = throwSite(stack);\n // Native CE.SDK rejects an awaited call with no frames at all.\n const frameless =\n stack !== undefined &&\n sourceFrames(stack).length === 0 &&\n ENGINE_CODE_SHAPE.test(detail);\n if (site === 'engine' || frameless) {\n const listed = engineCodeFault(\n detail,\n caller !== undefined && MODEL_FRAME.test(caller)\n );\n if (listed !== undefined)\n return onChannel({ fault: listed, source: 'rule' });\n // No frames say who called; only the model's code makes raw calls.\n if (frameless && ENGINE_CODE_FAULT[detail]?.rawOnly === true)\n return { fault: 'agent', source: 'default' };\n // An engine code nobody listed keeps the throw site's fault, marked as a fallback.\n return onChannel({\n fault: 'engine',\n source: ENGINE_CODE_SHAPE.test(detail) ? 'default' : 'rule'\n });\n }\n if (site === 'model')\n return {\n fault: 'agent',\n source:\n ENGINE_CODE_SHAPE.test(detail) && !(detail in ENGINE_CODE_FAULT)\n ? 'default'\n : 'rule'\n };\n if (stack !== undefined) return { fault: 'ours', source: 'default' };\n return { fault: 'agent', source: 'default' };\n }\n if (code === 'render_failed' || code === 'pdfx_convert_failed')\n return onChannel(renderFault(report.error));\n // An error answer that carries an engine error, or names its code as the detail, has that code's owner.\n if (code === 'internal_error') {\n const detail = report.errorDetail ?? '';\n const engineCode =\n engineCodeOf(report.error?.message ?? '', report.error?.stack) ??\n (ENGINE_CODE_SHAPE.test(detail) ? detail : undefined);\n if (engineCode !== undefined)\n return onChannel(renderFault(report.error, engineCode));\n }\n const fault = ERROR_FAULT[code];\n return fault === 'ours' || fault === 'agent'\n ? { fault, source: 'rule' }\n : undefined;\n}\n"]}
1
+ {"version":3,"file":"error-policy.js","sourceRoot":"","sources":["../../../src/services/telemetry/error-policy.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EAItB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAK9C,MAAM,CAAC,MAAM,WAAW,GAA6B;IACnD,iBAAiB,EAAE,MAAM;IACzB,iBAAiB,EAAE,UAAU;IAC7B,QAAQ,EAAE,OAAO;IACjB,gBAAgB,EAAE,OAAO;IACzB,gBAAgB,EAAE,MAAM;IACxB,kBAAkB,EAAE,MAAM;IAC1B,cAAc,EAAE,MAAM;IACtB,cAAc,EAAE,MAAM;IACtB,eAAe,EAAE,MAAM;IACvB,eAAe,EAAE,MAAM;IACvB,SAAS,EAAE,MAAM;IACjB,cAAc,EAAE,OAAO;IACvB,aAAa,EAAE,MAAM;IACrB,mBAAmB,EAAE,MAAM;IAC3B,oBAAoB,EAAE,UAAU;IAChC,cAAc,EAAE,UAAU;IAC1B,oBAAoB,EAAE,MAAM;IAC5B,UAAU,EAAE,OAAO;IACnB,iBAAiB,EAAE,OAAO;IAC1B,cAAc,EAAE,OAAO;IACvB,kBA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CAAC,IAAI,CAAC,CAAC,MAAM,IAAI,iBAAiB,CAAC;oBAC9D,CAAC,CAAC,SAAS;oBACX,CAAC,CAAC,MAAM;aACb,CAAC;QACJ,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;QACrE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAC/C,CAAC;IACD,IAAI,IAAI,KAAK,eAAe,IAAI,IAAI,KAAK,qBAAqB;QAC5D,OAAO,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9C,wGAAwG;IACxG,IAAI,IAAI,KAAK,gBAAgB,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,IAAI,EAAE,CAAC;QACxC,MAAM,UAAU,GACd,YAAY,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC;YAC9D,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACxD,IAAI,UAAU,KAAK,SAAS;YAC1B,OAAO,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;IAC5D,CAAC;IACD,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAChC,OAAO,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,OAAO;QAC1C,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE;QAC3B,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC","sourcesContent":["// Which failed tool calls are ours to report, and where a thrown error came from.\nimport {\n DESIGN_ERROR_CODES,\n ENGINE_NOT_APPLICABLE,\n type DesignErrorCode,\n type ErrorCode,\n type ToolCallReport\n} from '@imgly/codesign-sdk/internal';\nimport { CHANNEL } from '../flags/channel.js';\nimport type { Channel } from '../flags/manifest.js';\n\nexport type Fault = 'agent' | 'user' | 'upstream' | 'ours';\n\nexport const ERROR_FAULT: Record<ErrorCode, Fault> = {\n executor_capacity: 'user',\n resources_pending: 'upstream',\n bad_args: 'agent',\n unknown_revision: 'agent',\n feature_disabled: 'user',\n engine_unsupported: 'user',\n internal_error: 'ours',\n design_changed: 'user',\n design_conflict: 'user',\n unsaved_changes: 'user',\n cancelled: 'user',\n unknown_format: 'agent',\n render_failed: 'ours',\n pdfx_convert_failed: 'ours',\n profile_fetch_failed: 'upstream',\n export_refused: 'upstream',\n outpath_write_failed: 'user',\n code_threw: 'agent',\n dialect_violation: 'agent',\n scene_file_uri: 'agent',\n scene_inline_bytes: 'agent',\n engine_option_refused: 'ours',\n unauthorized: 'upstream',\n no_credentials: 'upstream',\n insufficient_credits: 'upstream',\n model_not_found: 'upstream',\n generation_failed: 'upstream',\n generation_timeout: 'upstream',\n result_unavailable: 'upstream',\n output_download_failed: 'upstream',\n service_error: 'upstream',\n gateway_error: 'upstream'\n};\n\n/** Who caused a design facade error, by the code the facade gave it. */\nexport const DESIGN_FAULT: Record<DesignErrorCode, Fault | 'engine'> = {\n 'DESIGN.UNKNOWN_UUID': 'agent',\n 'DESIGN.UNKNOWN_BLOCK': 'agent',\n 'DESIGN.BAD_ARGUMENT': 'agent',\n 'DESIGN.PROMISE_AS_ID': 'agent',\n 'DESIGN.TREE_NODE_WITHOUT_UUID': 'agent',\n 'DESIGN.UNKNOWN_LEAF': 'agent',\n 'DESIGN.LEAF_VALUE': 'agent',\n 'DESIGN.UNKNOWN_SELECTOR': 'agent',\n 'DESIGN.EMPTY_SELECT': 'agent',\n 'DESIGN.WRITE_ONLY': 'agent',\n 'DESIGN.NO_SCENE_FOR_UNITS': 'agent',\n 'DESIGN.FONT_SIZE_FORMAT': 'agent',\n 'DESIGN.NO_SLOT': 'agent',\n 'DESIGN.NO_FILL': 'agent',\n 'DESIGN.NOT_APPLICABLE': 'agent',\n 'DESIGN.BLOCK_REF': 'agent',\n 'DESIGN.MATTE_SOURCE': 'agent',\n 'DESIGN.EFFECT_SOURCE': 'agent',\n 'DESIGN.ANIMATION_LEAF': 'agent',\n 'DESIGN.KEYFRAMES': 'agent',\n 'DESIGN.NOT_ANIMATABLE': 'agent',\n 'DESIGN.TEXT_FILL_COLOR': 'agent',\n 'DESIGN.TEXT_FRAME_TOO_SMALL': 'agent',\n 'DESIGN.METRICS_NOT_CACHED': 'agent',\n 'DESIGN.SPEC_TYPE': 'agent',\n 'DESIGN.TRANSITION_WITHOUT_NEXT': 'agent',\n 'DESIGN.PATH_SPEC': 'agent',\n 'DESIGN.CREATE_INSTEAD': 'agent',\n 'DESIGN.GROUP_WITHOUT_CHILDREN': 'agent',\n 'DESIGN.INDEX_OUT_OF_BOUNDS': 'agent',\n 'DESIGN.ORDER_TARGET': 'agent',\n 'DESIGN.CAPTION_PARENT': 'agent',\n 'DESIGN.FONT_ARGS': 'agent',\n 'DESIGN.FONT_NEEDS_ASYNC': 'agent',\n 'DESIGN.FONT_WEIGHT': 'agent',\n 'DESIGN.NO_TYPEFACE': 'agent',\n 'DESIGN.NO_STYLED_RUN': 'agent',\n 'DESIGN.FONT_NOT_FOUND': 'agent',\n 'DESIGN.FONT_NO_FILES': 'upstream',\n 'DESIGN.FONT_NAME_TAKEN': 'agent',\n 'DESIGN.FONT_SOURCE_MISSING': 'upstream',\n 'DESIGN.FONT_METRICS_FETCH': 'upstream',\n 'DESIGN.RESOURCE_LOAD_FAILED': 'upstream',\n 'DESIGN.TRANSCRIPT_READ': 'agent',\n 'DESIGN.TEXT_NOT_FOUND': 'agent',\n 'DESIGN.TEXT_AMBIGUOUS': 'agent',\n 'DESIGN.PROPERTY_BOUND': 'agent',\n 'DESIGN.VARIABLE_TYPE': 'agent',\n 'DESIGN.INTERNAL': 'ours',\n 'DESIGN.ENGINE': 'engine'\n};\n\nexport function isDesignErrorCode(\n value: string | undefined\n): value is DesignErrorCode {\n return (DESIGN_ERROR_CODES as readonly string[]).includes(value ?? '');\n}\n\nexport type ThrowSite = 'engine' | 'model' | 'unknown';\n\nconst EDIT_SCOPE_FRAME = /codesign-sdk[\\\\/]dist[\\\\/]host[\\\\/]edit-scope\\.js/;\nconst FACADE_FRAME = /codesign-sdk[\\\\/]dist[\\\\/]design[\\\\/]/;\nconst ENGINE_FRAME =\n /node_modules[\\\\/]@cesdk[\\\\/]|codesign-sdk[\\\\/]dist[\\\\/](?:design[\\\\/]|host[\\\\/]edit-scope\\.js)/;\n// edit's wrapper around engine.design, between the facade and the model's code.\nconst EDIT_CODE_FRAME = /codesign-sdk[\\\\/]dist[\\\\/]host[\\\\/]edit-code\\.js:/;\nconst MODEL_FRAME = /eval at runEditCode/;\n// CE.SDK's argument checks: WASM's validation and native's binding.\nconst ARGUMENT_ERROR =\n /^(?:StructError: |TypeError: (?:Error in argument |[^\\n]* expected\\n))/;\n// edit's patch of scene.create, between the engine and the model's code.\nconst SCENE_PATCH_FRAME = /codesign-sdk[\\\\/]dist[\\\\/]host[\\\\/]scene\\.js:/;\n// A text helper tripping over a value of the wrong shape; from the facade, which names what it refuses, it is a bug of ours.\nconst BUILTIN_ERROR = /^(?:TypeError|RangeError): /;\n\n// A parse error in edit code is thrown by the AsyncFunction constructor that runEditCode calls.\nconst MODEL_PARSE =\n /^\\s*at new AsyncFunction \\(<anonymous>\\)\\n\\s*at (?:async )?runEditCode /;\n\nconst sourceFrames = (stack: string | undefined): string[] =>\n stack\n ?.split('\\n')\n .filter(\n (line) =>\n line.trimStart().startsWith('at ') &&\n !/\\((?:<anonymous>|native)\\)$|[( ]node:|[( ]wasm:\\/\\//.test(line)\n ) ?? [];\n\nconst callerOf = (frames: string[]): string | undefined =>\n frames.find(\n (f) =>\n !ENGINE_FRAME.test(f) &&\n !SCENE_PATCH_FRAME.test(f) &&\n !(EDIT_CODE_FRAME.test(f) && !f.includes('runEditCode'))\n );\n\nexport function throwSite(stack: string | undefined): ThrowSite {\n const frames = stack?.slice(stack.indexOf('\\n at ') + 1);\n if (frames !== undefined && MODEL_PARSE.test(frames)) return 'model';\n const all = sourceFrames(stack);\n const top = all[0];\n if (top === undefined) return 'unknown';\n if (ENGINE_FRAME.test(top)) {\n const caller = callerOf(all);\n const builtin = BUILTIN_ERROR.test(stack ?? '');\n const refused =\n ARGUMENT_ERROR.test(stack ?? '') ||\n (EDIT_SCOPE_FRAME.test(top) && builtin);\n if (refused && caller !== undefined && MODEL_FRAME.test(caller))\n return 'model';\n // The text helpers and the facade are our code, not the engine's: stable must still hear of them.\n return EDIT_SCOPE_FRAME.test(top) || (FACADE_FRAME.test(top) && builtin)\n ? 'unknown'\n : 'engine';\n }\n if (MODEL_FRAME.test(top)) return 'model';\n return 'unknown';\n}\n\n// Looks past engine and design-layer frames to who called them.\nexport function thrownByModel(err: unknown): boolean {\n if (!(err instanceof Error)) return false;\n const caller = callerOf(sourceFrames(err.stack));\n return caller !== undefined && MODEL_FRAME.test(caller);\n}\n\nexport type FaultSource = 'rule' | 'default';\n\nexport interface Verdict {\n fault: 'ours' | 'engine' | 'agent';\n /** `default` when no table or list named the failure and a fallback chose its fault. */\n source: FaultSource;\n /** The engine code a render failure was matched by: its own, or the listed one its text stands for. */\n engineCode?: string;\n /** Sentry's level when it is not `error`: see levelOf. */\n level?: 'info' | 'warning';\n}\n\n/** The model's mistakes go out as info, engine faults on stable as warnings until their volume is known; the rest as errors. */\nexport function levelOf(\n fault: Verdict['fault'],\n channel: Channel\n): 'info' | 'warning' | undefined {\n if (fault === 'agent') return 'info';\n return fault === 'engine' && channel === 'stable' ? 'warning' : undefined;\n}\n\nexport type Owner = 'agent' | 'engine' | 'environment';\ntype Owned = Omit<Verdict, 'fault'> & {\n fault: Verdict['fault'] | 'environment';\n};\n\n/** One owner per engine code for edit, export and preview; rawOnly and text: see the Sentry spec. */\nexport const ENGINE_CODE_FAULT: Readonly<\n Record<string, { fault: Owner; rawOnly?: true; text?: RegExp }>\n> = {\n // The model's raw read of a property its block lacks; the facade answers the same refusal as DESIGN.NOT_APPLICABLE.\n ...Object.fromEntries(\n [...ENGINE_NOT_APPLICABLE].map((code) => [\n code,\n { fault: 'agent', rawOnly: true } as const\n ])\n ),\n 'BLOCK.ENUM_VALUE_INVALID': { fault: 'agent' },\n 'BLOCK.COLOR_COMPONENT_OUT_OF_RANGE': { fault: 'agent' },\n 'BLOCK.VALUE_NOT_FINITE': { fault: 'agent' },\n 'BLOCK.VALUES_NOT_FINITE_THREE': { fault: 'agent' },\n 'BLOCK.NOT_KNOWN_BLOCK_TYPE': { fault: 'agent' },\n 'BLOCK.UNKNOWN_BLOCK_TYPE': { fault: 'agent' },\n 'BLOCK.NOT_ATTACHED_TO_SCENE': { fault: 'agent' },\n 'BLOCK.TEXT_RANGE_FROM_OUT_OF_RANGE': { fault: 'agent' },\n 'BLOCK.TEXT_RANGE_TO_OUT_OF_RANGE': { fault: 'agent' },\n 'BLOCK.OPERATION_PRECONDITION_FAILED': { fault: 'agent' },\n 'BLOCK.SCOPE_INVALID': { fault: 'agent' },\n 'BLOCK.PROPERTY_INVALID_ENUM_VALUE_CHOICES': { fault: 'agent' },\n 'BLOCK.CREATION_NOT_ALLOWED': { fault: 'agent' },\n 'BLOCK.PROPERTY_NOT_WRITEABLE': { fault: 'agent' },\n 'BLOCK.NOT_A_TEXT_BLOCK_SIMPLE': { fault: 'agent' },\n 'BLOCK.ANIMATION_NOT_LOOP_TYPE': { fault: 'agent' },\n 'BLOCK.ANIMATION_NOT_IN_TYPE': { fault: 'agent' },\n 'BLOCK.ANIMATION_NOT_OUT_TYPE': { fault: 'agent' },\n // Our code passes the model's gradient stops through as written.\n 'BLOCK.GRADIENT_COLOR_STOPS_DUPLICATE': { fault: 'agent' },\n 'BLOCK.GRADIENT_COLOR_STOPS_NOT_SORTED': { fault: 'agent' },\n 'BLOCK.GRADIENT_COLOR_STOPS_OUT_OF_RANGE': { fault: 'agent' },\n // Values and type names the model's code passes; engine-code-faults.engine.test.ts raises each.\n 'BLOCK.STROKE_WIDTH_INVALID': { fault: 'agent' },\n 'BLOCK.STROKE_DASH_ARRAY_INVALID': { fault: 'agent' },\n 'BLOCK.STROKE_MITER_LIMIT_INVALID': { fault: 'agent' },\n 'BLOCK.SHADOW_X_BLUR_INVALID': { fault: 'agent' },\n 'BLOCK.SHADOW_Y_BLUR_INVALID': { fault: 'agent' },\n 'BLOCK.SHADOW_X_OFFSET_INVALID': { fault: 'agent' },\n 'BLOCK.SHADOW_Y_OFFSET_INVALID': { fault: 'agent' },\n 'BLOCK.TEXT_INVALID_FONT_SIZE': { fault: 'agent' },\n 'BLOCK.TEXT_LINE_HEIGHT_INVALID': { fault: 'agent' },\n 'BLOCK.TEXT_LIST_LEVEL_NEGATIVE': { fault: 'agent' },\n 'BLOCK.TEXT_LIST_LEVEL_TOO_LARGE': { fault: 'agent' },\n 'BLOCK.TEXT_INVALID_BASELINE_SHIFT': { fault: 'agent' },\n 'BLOCK.TEXT_INVALID_KERNING': { fault: 'agent' },\n 'BLOCK.COLOR_TINT_OUT_OF_RANGE': { fault: 'agent' },\n 'BLOCK.VALUE_NOT_FINITE_IN_UNIT_RANGE': { fault: 'agent' },\n 'BLOCK.UNKNOWN_FILL_TYPE': { fault: 'agent' },\n 'BLOCK.FILL_TEXT_SOLID_COLOR_ONLY': { fault: 'agent' },\n 'BLOCK.UNKNOWN_SHAPE_TYPE': { fault: 'agent' },\n 'BLOCK.BLUR_UNKNOWN_TYPE': { fault: 'agent' },\n 'BLOCK.EFFECT_UNKNOWN_TYPE': { fault: 'agent' },\n 'BLOCK.ANIMATION_TYPE_NOT_REGISTERED': { fault: 'agent' },\n 'EDITOR.PLAYBACK_SPEED_OUT_OF_RANGE': { fault: 'agent' },\n 'EDITOR.PLAYBACK_SPEED_TOO_LOW': { fault: 'agent' },\n // The facade checks these itself, so only the model's raw call is the model's fault.\n 'BLOCK.KEYFRAMES_EMPTY': { fault: 'agent', rawOnly: true },\n 'BLOCK.VARIABLE_NAME_INVALID': { fault: 'agent', rawOnly: true },\n 'BLOCK.VALUE_SET_NAME_INVALID': { fault: 'agent', rawOnly: true },\n 'BLOCK.VARIABLE_TYPE_MISMATCH': { fault: 'agent', rawOnly: true },\n 'BLOCK.FILL_MISSING': { fault: 'agent', rawOnly: true },\n 'BLOCK.FILL_NOT_VALID': { fault: 'agent', rawOnly: true },\n // A page a stack places; our code moves only a page's children.\n 'BLOCK.POSITION_PARENT_CONTROLLED': { fault: 'agent' },\n 'EDITOR.AV_OPERATION_BLOCK_TYPE_UNSUPPORTED': { fault: 'agent' },\n 'EDITOR.NEGATIVE_DURATION': { fault: 'agent' },\n // The page's size, which the model chose (GH PR #859); export answers it before the policy.\n 'CODEC.VIDEO_ENCODER_INVALID_RESOLUTION': { fault: 'agent' },\n // A resource the model's code set made no loading progress; a deep video's slow decode is PENDING_VIDEO, uncoded.\n 'ENCODE.BLOCKS_STAYED_PENDING': { fault: 'agent' },\n 'BLOCK.UNKNOWN': { fault: 'agent', rawOnly: true },\n 'BLOCK.PROPERTY_NOT_FOUND_WITH_HINT': { fault: 'agent', rawOnly: true },\n 'ENCODE.BLOCK_MUST_BE_PAGE': {\n fault: 'agent',\n text: /\\bThe block to export must be a page\\./\n },\n 'ENCODE.BLOCK_SIZE_ZERO': {\n fault: 'agent',\n text: /\\bBlock to export has size 0\\./\n },\n 'ENCODE.OUTPUT_SIZE_EXCEEDS_MAX': {\n fault: 'agent',\n text: /\\bThe output size of \\d+x\\d+ px for the export exceeds the maximum supported size\\b/\n },\n // An image, gradient or effect the model sized rasterizes past the device's maximum at the scene's DPI.\n 'ENCODE.PDF_RENDER_SIZE_EXCEEDS_MAX': {\n fault: 'agent',\n text: /\\bAn image, gradient or effect of the PDF export renders at \\d+x\\d+ px\\b/\n },\n // The device ran out of memory: nobody's code is at fault, so it is never reported.\n 'ENCODE.OUTPUT_SIZE_INSUFFICIENT_RESOURCES': {\n fault: 'environment',\n text: /\\bCould not export at \\d+x\\d+\\. Not enough resources available on device\\./\n },\n 'ENCODE.PDF_CREATE_FAILED_RESOURCES': {\n fault: 'environment',\n text: /\\bFailed to create PDF document\\. Not enough resources available on device\\./\n },\n // The temporary directory is missing, read-only or full.\n 'ENCODE.VIDEO_STAGING_WRITE_FAILED': { fault: 'environment' },\n 'ENCODE.AUDIO_STAGING_WRITE_FAILED': { fault: 'environment' },\n 'ENCODE.PDF_STAGING_WRITE_FAILED': { fault: 'environment' },\n 'ENCODE.INSUFFICIENT_RESOURCES': {\n fault: 'environment',\n text: /\\bNot enough resources available on device\\./\n }\n};\n\nconst ENGINE_CODE_TEXTS = Object.entries(ENGINE_CODE_FAULT).flatMap(\n ([code, { text }]) => (text !== undefined ? [{ code, text }] : [])\n);\n\nfunction engineCodeFault(code: string, byModel: boolean): Owner | undefined {\n const entry = ENGINE_CODE_FAULT[code];\n return entry === undefined || (entry.rawOnly === true && !byModel)\n ? undefined\n : entry.fault;\n}\n\n// An engine code has a dot, which a Node code like `ERR_INVALID_ARG_TYPE` never has.\nconst HEAD_ENGINE_CODE = /^\\w+ \\[([A-Z0-9_]+(?:\\.[A-Z0-9_]+)+)\\]/;\nconst MESSAGE_ENGINE_CODE = /^\\[([A-Z0-9_]+(?:\\.[A-Z0-9_]+)+)\\]/;\nconst ENGINE_CODE_SHAPE = /^[A-Z0-9_]+(?:\\.[A-Z0-9_]+)+$/;\n\nfunction engineCodeOf(message: string, stack: string | undefined) {\n const head = stack?.split('\\n', 1)[0] ?? '';\n return (\n HEAD_ENGINE_CODE.exec(head)?.[1] ??\n MESSAGE_ENGINE_CODE.exec(message)?.[1] ??\n ENGINE_CODE_TEXTS.find((t) => t.text.test(`${message}\\n${head}`))?.code\n );\n}\n\n/** The engine code and the table's owner of an engine error a call from the model's code threw, outside any tool call. */\nexport function modelEngineError(\n err: Error\n): { code: string; owner: Owner | undefined } | undefined {\n const code = engineCodeOf(err.message, err.stack);\n return code === undefined\n ? undefined\n : { code, owner: engineCodeFault(code, true) };\n}\n\nfunction renderFault(\n error: ToolCallReport['error'],\n engineCode = engineCodeOf(error?.message ?? '', error?.stack)\n): Owned {\n if (engineCode === undefined) return { fault: 'ours', source: 'default' };\n const fault = engineCodeFault(engineCode, false);\n return fault !== undefined\n ? { fault, source: 'rule', engineCode }\n : { fault: 'engine', source: 'default', engineCode };\n}\n\nexport function reportable(\n report: ToolCallReport,\n channel: Channel = CHANNEL\n): Verdict | undefined {\n const verdict = faultOf(report);\n if (verdict === undefined) return undefined;\n const level = levelOf(verdict.fault, channel);\n return level === undefined ? verdict : { ...verdict, level };\n}\n\nfunction faultOf(report: ToolCallReport): Verdict | undefined {\n const onChannel = (v: Owned): Verdict | undefined =>\n v.fault === 'environment' ? undefined : { ...v, fault: v.fault };\n if (report.succeeded) return undefined;\n const code = report.errorCode;\n if (code === undefined)\n return report.error ? { fault: 'ours', source: 'default' } : undefined;\n if (code === 'code_threw' && isDesignErrorCode(report.errorDetail)) {\n if (report.errorDetail === 'DESIGN.ENGINE') {\n const fault = engineCodeFault(\n report.designError?.engineCode ?? '',\n false\n );\n return onChannel(\n fault !== undefined\n ? { fault, source: 'rule' }\n : { fault: 'engine', source: 'default' }\n );\n }\n const fault = DESIGN_FAULT[report.errorDetail];\n return fault === 'ours' || fault === 'agent' || fault === 'engine'\n ? onChannel({ fault, source: 'rule' })\n : undefined;\n }\n if (code === 'code_threw') {\n const stack = report.error?.stack;\n const caller = callerOf(sourceFrames(stack));\n const detail = report.errorDetail ?? '';\n const site = throwSite(stack);\n // Native CE.SDK rejects an awaited call with no frames at all.\n const frameless =\n stack !== undefined &&\n sourceFrames(stack).length === 0 &&\n ENGINE_CODE_SHAPE.test(detail);\n if (site === 'engine' || frameless) {\n const listed = engineCodeFault(\n detail,\n caller !== undefined && MODEL_FRAME.test(caller)\n );\n if (listed !== undefined)\n return onChannel({ fault: listed, source: 'rule' });\n // No frames say who called; only the model's code makes raw calls.\n if (frameless && ENGINE_CODE_FAULT[detail]?.rawOnly === true)\n return { fault: 'agent', source: 'default' };\n // An engine code nobody listed keeps the throw site's fault, marked as a fallback.\n return onChannel({\n fault: 'engine',\n source: ENGINE_CODE_SHAPE.test(detail) ? 'default' : 'rule'\n });\n }\n if (site === 'model')\n return {\n fault: 'agent',\n source:\n ENGINE_CODE_SHAPE.test(detail) && !(detail in ENGINE_CODE_FAULT)\n ? 'default'\n : 'rule'\n };\n if (stack !== undefined) return { fault: 'ours', source: 'default' };\n return { fault: 'agent', source: 'default' };\n }\n if (code === 'render_failed' || code === 'pdfx_convert_failed')\n return onChannel(renderFault(report.error));\n // An error answer that carries an engine error, or names its code as the detail, has that code's owner.\n if (code === 'internal_error') {\n const detail = report.errorDetail ?? '';\n const engineCode =\n engineCodeOf(report.error?.message ?? '', report.error?.stack) ??\n (ENGINE_CODE_SHAPE.test(detail) ? detail : undefined);\n if (engineCode !== undefined)\n return onChannel(renderFault(report.error, engineCode));\n }\n const fault = ERROR_FAULT[code];\n return fault === 'ours' || fault === 'agent'\n ? { fault, source: 'rule' }\n : undefined;\n}\n"]}
@@ -272,8 +272,8 @@ export declare class UsageTelemetrySink implements TelemetrySink {
272
272
  private scheduleRetry;
273
273
  private drain;
274
274
  /**
275
- * One POST, in the engine's form: a lone event merged into the envelope,
276
- * several under `events`. Resolves true when the queue may move on (sent,
275
+ * One POST, in the engine's form: the envelope with every event under
276
+ * `events`, one event too (CE.SDK 1.86). Resolves true when the queue may move on (sent,
277
277
  * or refused for good), false to retry. Never rejects.
278
278
  */
279
279
  private send;
@@ -1 +1 @@
1
- {"version":3,"file":"usage-sink.d.ts","sourceRoot":"","sources":["../../../src/services/telemetry/usage-sink.ts"],"names":[],"mappings":"AAOA,OAAO,EAEL,KAAK,YAAY,EAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,cAAc,EACpB,MAAM,8BAA8B,CAAC;AAGtC,8GAA8G;AAC9G,eAAO,MA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O;IASf,OAAO,CAAC,gBAAgB;IAUxB,4FAA4F;IAC5F,OAAO,CAAC,SAAS;IAgBjB,0EAA0E;IAC1E,OAAO,CAAC,IAAI;IAaZ,OAAO,CAAC,aAAa;YAQP,KAAK;IAsBnB;;;;OAIG;YACW,IAAI;IAoFlB,OAAO,CAAC,MAAM;YAKA,cAAc;CAyE7B;AAED,yEAAyE;AACzE,wBAAgB,YAAY,CAAC,GAAG,KAAK,EAAE,aAAa,EAAE,GAAG,aAAa,CAQrE"}
@@ -460,16 +460,14 @@ export class UsageTelemetrySink {
460
460
  await this.spoolWrite;
461
461
  }
462
462
  /**
463
- * One POST, in the engine's form: a lone event merged into the envelope,
464
- * several under `events`. Resolves true when the queue may move on (sent,
463
+ * One POST, in the engine's form: the envelope with every event under
464
+ * `events`, one event too (CE.SDK 1.86). Resolves true when the queue may move on (sent,
465
465
  * or refused for good), false to retry. Never rejects.
466
466
  */
467
467
  async send(batch, signal) {
468
468
  const { userId, sessionId } = batch[0];
469
469
  const envelope = { userId, deviceId: '', sessionId };
470
- const body = batch.length === 1
471
- ? { ...envelope, ...batch[0].event }
472
- : { ...envelope, events: batch.map((e) => e.event) };
470
+ const body = { ...envelope, events: batch.map((e) => e.event) };
473
471
  for (const e of batch)
474
472
  this.inFlightEvents.add(e);
475
473
  let outcome;