@imgly/codesign-mcp 0.1.6 → 0.1.7

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 (360) hide show
  1. package/README.md +5 -10
  2. package/dist/cli/http.d.ts.map +1 -1
  3. package/dist/cli/http.js +12 -2
  4. package/dist/cli/http.js.map +1 -1
  5. package/dist/cli/stdio.d.ts.map +1 -1
  6. package/dist/cli/stdio.js +103 -35
  7. package/dist/cli/stdio.js.map +1 -1
  8. package/dist/config.d.ts +11 -2
  9. package/dist/config.d.ts.map +1 -1
  10. package/dist/config.js +12 -1
  11. package/dist/config.js.map +1 -1
  12. package/dist/diagnostics/events.d.ts +6 -0
  13. package/dist/diagnostics/events.d.ts.map +1 -1
  14. package/dist/diagnostics/events.js.map +1 -1
  15. package/dist/engine/cesdk-adapter.d.ts +5 -1
  16. package/dist/engine/cesdk-adapter.d.ts.map +1 -1
  17. package/dist/engine/cesdk-adapter.js +8 -1
  18. package/dist/engine/cesdk-adapter.js.map +1 -1
  19. package/dist/engine/engine-capacity.d.ts +16 -0
  20. package/dist/engine/engine-capacity.d.ts.map +1 -0
  21. package/dist/engine/engine-capacity.js +48 -0
  22. package/dist/engine/engine-capacity.js.map +1 -0
  23. package/dist/engine/engine-slots.d.ts +48 -0
  24. package/dist/engine/engine-slots.d.ts.map +1 -0
  25. package/dist/engine/engine-slots.js +182 -0
  26. package/dist/engine/engine-slots.js.map +1 -0
  27. package/dist/tools/engine.d.ts +13 -0
  28. package/dist/tools/engine.d.ts.map +1 -1
  29. package/dist/tools/engine.js +28 -0
  30. package/dist/tools/engine.js.map +1 -1
  31. package/package.json +2 -2
  32. package/dist/dashboard/router.d.ts +0 -3
  33. package/dist/dashboard/router.d.ts.map +0 -1
  34. package/dist/dashboard/router.js +0 -19
  35. package/dist/dashboard/router.js.map +0 -1
  36. package/dist/dashboard/spa-assets.generated.d.ts +0 -2
  37. package/dist/dashboard/spa-assets.generated.d.ts.map +0 -1
  38. package/dist/dashboard/spa-assets.generated.js +0 -220
  39. package/dist/dashboard/spa-assets.generated.js.map +0 -1
  40. package/dist/metrics/mount.d.ts +0 -11
  41. package/dist/metrics/mount.d.ts.map +0 -1
  42. package/dist/metrics/mount.js +0 -13
  43. package/dist/metrics/mount.js.map +0 -1
  44. package/dist/metrics/recorder.d.ts +0 -55
  45. package/dist/metrics/recorder.d.ts.map +0 -1
  46. package/dist/metrics/recorder.js +0 -97
  47. package/dist/metrics/recorder.js.map +0 -1
  48. package/dist/test/scripts/changelog-add.d.ts +0 -8
  49. package/dist/test/scripts/changelog-add.d.ts.map +0 -1
  50. package/dist/test/scripts/changelog-add.js +0 -50
  51. package/dist/test/scripts/changelog-add.js.map +0 -1
  52. package/dist/test/scripts/changelog-collate.d.ts +0 -38
  53. package/dist/test/scripts/changelog-collate.d.ts.map +0 -1
  54. package/dist/test/scripts/changelog-collate.js +0 -171
  55. package/dist/test/scripts/changelog-collate.js.map +0 -1
  56. package/dist/test/test/changelog.test.d.ts +0 -2
  57. package/dist/test/test/changelog.test.d.ts.map +0 -1
  58. package/dist/test/test/changelog.test.js +0 -293
  59. package/dist/test/test/changelog.test.js.map +0 -1
  60. package/dist/test/test/cli/dispatcher.test.d.ts +0 -2
  61. package/dist/test/test/cli/dispatcher.test.d.ts.map +0 -1
  62. package/dist/test/test/cli/dispatcher.test.js +0 -54
  63. package/dist/test/test/cli/dispatcher.test.js.map +0 -1
  64. package/dist/test/test/cli/redirect-console.test.d.ts +0 -2
  65. package/dist/test/test/cli/redirect-console.test.d.ts.map +0 -1
  66. package/dist/test/test/cli/redirect-console.test.js +0 -78
  67. package/dist/test/test/cli/redirect-console.test.js.map +0 -1
  68. package/dist/test/test/cli/resolve-license.test.d.ts +0 -2
  69. package/dist/test/test/cli/resolve-license.test.d.ts.map +0 -1
  70. package/dist/test/test/cli/resolve-license.test.js +0 -29
  71. package/dist/test/test/cli/resolve-license.test.js.map +0 -1
  72. package/dist/test/test/cli/stdio-diagnostics.test.d.ts +0 -2
  73. package/dist/test/test/cli/stdio-diagnostics.test.d.ts.map +0 -1
  74. package/dist/test/test/cli/stdio-diagnostics.test.js +0 -31
  75. package/dist/test/test/cli/stdio-diagnostics.test.js.map +0 -1
  76. package/dist/test/test/cli/stdio-license.test.d.ts +0 -2
  77. package/dist/test/test/cli/stdio-license.test.d.ts.map +0 -1
  78. package/dist/test/test/cli/stdio-license.test.js +0 -19
  79. package/dist/test/test/cli/stdio-license.test.js.map +0 -1
  80. package/dist/test/test/config.test.d.ts +0 -2
  81. package/dist/test/test/config.test.d.ts.map +0 -1
  82. package/dist/test/test/config.test.js +0 -95
  83. package/dist/test/test/config.test.js.map +0 -1
  84. package/dist/test/test/cross-ref.test.d.ts +0 -2
  85. package/dist/test/test/cross-ref.test.d.ts.map +0 -1
  86. package/dist/test/test/cross-ref.test.js +0 -39
  87. package/dist/test/test/cross-ref.test.js.map +0 -1
  88. package/dist/test/test/diagnostics/bundle.test.d.ts +0 -2
  89. package/dist/test/test/diagnostics/bundle.test.d.ts.map +0 -1
  90. package/dist/test/test/diagnostics/bundle.test.js +0 -53
  91. package/dist/test/test/diagnostics/bundle.test.js.map +0 -1
  92. package/dist/test/test/diagnostics/compose.test.d.ts +0 -2
  93. package/dist/test/test/diagnostics/compose.test.d.ts.map +0 -1
  94. package/dist/test/test/diagnostics/compose.test.js +0 -31
  95. package/dist/test/test/diagnostics/compose.test.js.map +0 -1
  96. package/dist/test/test/diagnostics/file-sink.test.d.ts +0 -2
  97. package/dist/test/test/diagnostics/file-sink.test.d.ts.map +0 -1
  98. package/dist/test/test/diagnostics/file-sink.test.js +0 -113
  99. package/dist/test/test/diagnostics/file-sink.test.js.map +0 -1
  100. package/dist/test/test/diagnostics/redact.test.d.ts +0 -2
  101. package/dist/test/test/diagnostics/redact.test.d.ts.map +0 -1
  102. package/dist/test/test/diagnostics/redact.test.js +0 -59
  103. package/dist/test/test/diagnostics/redact.test.js.map +0 -1
  104. package/dist/test/test/diagnostics/tool-call-adapter.test.d.ts +0 -2
  105. package/dist/test/test/diagnostics/tool-call-adapter.test.d.ts.map +0 -1
  106. package/dist/test/test/diagnostics/tool-call-adapter.test.js +0 -34
  107. package/dist/test/test/diagnostics/tool-call-adapter.test.js.map +0 -1
  108. package/dist/test/test/engine/asset-sources.test.d.ts +0 -2
  109. package/dist/test/test/engine/asset-sources.test.d.ts.map +0 -1
  110. package/dist/test/test/engine/asset-sources.test.js +0 -100
  111. package/dist/test/test/engine/asset-sources.test.js.map +0 -1
  112. package/dist/test/test/engine/cesdk-adapter.test.d.ts +0 -2
  113. package/dist/test/test/engine/cesdk-adapter.test.d.ts.map +0 -1
  114. package/dist/test/test/engine/cesdk-adapter.test.js +0 -32
  115. package/dist/test/test/engine/cesdk-adapter.test.js.map +0 -1
  116. package/dist/test/test/engine/mutex.test.d.ts +0 -2
  117. package/dist/test/test/engine/mutex.test.d.ts.map +0 -1
  118. package/dist/test/test/engine/mutex.test.js +0 -63
  119. package/dist/test/test/engine/mutex.test.js.map +0 -1
  120. package/dist/test/test/engine/session.test.d.ts +0 -2
  121. package/dist/test/test/engine/session.test.d.ts.map +0 -1
  122. package/dist/test/test/engine/session.test.js +0 -159
  123. package/dist/test/test/engine/session.test.js.map +0 -1
  124. package/dist/test/test/engine/unsplash-source.test.d.ts +0 -2
  125. package/dist/test/test/engine/unsplash-source.test.d.ts.map +0 -1
  126. package/dist/test/test/engine/unsplash-source.test.js +0 -129
  127. package/dist/test/test/engine/unsplash-source.test.js.map +0 -1
  128. package/dist/test/test/engine/uri-resolver.test.d.ts +0 -2
  129. package/dist/test/test/engine/uri-resolver.test.d.ts.map +0 -1
  130. package/dist/test/test/engine/uri-resolver.test.js +0 -38
  131. package/dist/test/test/engine/uri-resolver.test.js.map +0 -1
  132. package/dist/test/test/gateway/hosted-stub.test.d.ts +0 -2
  133. package/dist/test/test/gateway/hosted-stub.test.d.ts.map +0 -1
  134. package/dist/test/test/gateway/hosted-stub.test.js +0 -11
  135. package/dist/test/test/gateway/hosted-stub.test.js.map +0 -1
  136. package/dist/test/test/gateway/local.test.d.ts +0 -2
  137. package/dist/test/test/gateway/local.test.d.ts.map +0 -1
  138. package/dist/test/test/gateway/local.test.js +0 -29
  139. package/dist/test/test/gateway/local.test.js.map +0 -1
  140. package/dist/test/test/handbook-contract.test.d.ts +0 -2
  141. package/dist/test/test/handbook-contract.test.d.ts.map +0 -1
  142. package/dist/test/test/handbook-contract.test.js +0 -79
  143. package/dist/test/test/handbook-contract.test.js.map +0 -1
  144. package/dist/test/test/http/server.test.d.ts +0 -2
  145. package/dist/test/test/http/server.test.d.ts.map +0 -1
  146. package/dist/test/test/http/server.test.js +0 -338
  147. package/dist/test/test/http/server.test.js.map +0 -1
  148. package/dist/test/test/http/session-id-header.test.d.ts +0 -2
  149. package/dist/test/test/http/session-id-header.test.d.ts.map +0 -1
  150. package/dist/test/test/http/session-id-header.test.js +0 -76
  151. package/dist/test/test/http/session-id-header.test.js.map +0 -1
  152. package/dist/test/test/http/session-manager.test.d.ts +0 -2
  153. package/dist/test/test/http/session-manager.test.d.ts.map +0 -1
  154. package/dist/test/test/http/session-manager.test.js +0 -97
  155. package/dist/test/test/http/session-manager.test.js.map +0 -1
  156. package/dist/test/test/http/workspace-auth.test.d.ts +0 -2
  157. package/dist/test/test/http/workspace-auth.test.d.ts.map +0 -1
  158. package/dist/test/test/http/workspace-auth.test.js +0 -40
  159. package/dist/test/test/http/workspace-auth.test.js.map +0 -1
  160. package/dist/test/test/metrics/mount.test.d.ts +0 -2
  161. package/dist/test/test/metrics/mount.test.d.ts.map +0 -1
  162. package/dist/test/test/metrics/mount.test.js +0 -59
  163. package/dist/test/test/metrics/mount.test.js.map +0 -1
  164. package/dist/test/test/metrics/recorder.test.d.ts +0 -2
  165. package/dist/test/test/metrics/recorder.test.d.ts.map +0 -1
  166. package/dist/test/test/metrics/recorder.test.js +0 -118
  167. package/dist/test/test/metrics/recorder.test.js.map +0 -1
  168. package/dist/test/test/revisions/hash.test.d.ts +0 -2
  169. package/dist/test/test/revisions/hash.test.d.ts.map +0 -1
  170. package/dist/test/test/revisions/hash.test.js +0 -33
  171. package/dist/test/test/revisions/hash.test.js.map +0 -1
  172. package/dist/test/test/revisions/store.test.d.ts +0 -2
  173. package/dist/test/test/revisions/store.test.d.ts.map +0 -1
  174. package/dist/test/test/revisions/store.test.js +0 -315
  175. package/dist/test/test/revisions/store.test.js.map +0 -1
  176. package/dist/test/test/server.metrics.test.d.ts +0 -2
  177. package/dist/test/test/server.metrics.test.d.ts.map +0 -1
  178. package/dist/test/test/server.metrics.test.js +0 -87
  179. package/dist/test/test/server.metrics.test.js.map +0 -1
  180. package/dist/test/test/server.test.d.ts +0 -2
  181. package/dist/test/test/server.test.d.ts.map +0 -1
  182. package/dist/test/test/server.test.js +0 -146
  183. package/dist/test/test/server.test.js.map +0 -1
  184. package/dist/test/test/skill-tools.test.d.ts +0 -2
  185. package/dist/test/test/skill-tools.test.d.ts.map +0 -1
  186. package/dist/test/test/skill-tools.test.js +0 -84
  187. package/dist/test/test/skill-tools.test.js.map +0 -1
  188. package/dist/test/test/smoke.test.d.ts +0 -2
  189. package/dist/test/test/smoke.test.d.ts.map +0 -1
  190. package/dist/test/test/smoke.test.js +0 -8
  191. package/dist/test/test/smoke.test.js.map +0 -1
  192. package/dist/test/test/tools/asset-generate.test.d.ts +0 -2
  193. package/dist/test/test/tools/asset-generate.test.d.ts.map +0 -1
  194. package/dist/test/test/tools/asset-generate.test.js +0 -66
  195. package/dist/test/test/tools/asset-generate.test.js.map +0 -1
  196. package/dist/test/test/tools/asset-search.test.d.ts +0 -2
  197. package/dist/test/test/tools/asset-search.test.d.ts.map +0 -1
  198. package/dist/test/test/tools/asset-search.test.js +0 -121
  199. package/dist/test/test/tools/asset-search.test.js.map +0 -1
  200. package/dist/test/test/tools/edit-harness.d.ts +0 -14
  201. package/dist/test/test/tools/edit-harness.d.ts.map +0 -1
  202. package/dist/test/test/tools/edit-harness.js +0 -30
  203. package/dist/test/test/tools/edit-harness.js.map +0 -1
  204. package/dist/test/test/tools/edit.telemetry.test.d.ts +0 -2
  205. package/dist/test/test/tools/edit.telemetry.test.d.ts.map +0 -1
  206. package/dist/test/test/tools/edit.telemetry.test.js +0 -46
  207. package/dist/test/test/tools/edit.telemetry.test.js.map +0 -1
  208. package/dist/test/test/tools/edit.test.d.ts +0 -2
  209. package/dist/test/test/tools/edit.test.d.ts.map +0 -1
  210. package/dist/test/test/tools/edit.test.js +0 -267
  211. package/dist/test/test/tools/edit.test.js.map +0 -1
  212. package/dist/test/test/tools/export-harness.d.ts +0 -13
  213. package/dist/test/test/tools/export-harness.d.ts.map +0 -1
  214. package/dist/test/test/tools/export-harness.js +0 -27
  215. package/dist/test/test/tools/export-harness.js.map +0 -1
  216. package/dist/test/test/tools/export.telemetry.test.d.ts +0 -2
  217. package/dist/test/test/tools/export.telemetry.test.d.ts.map +0 -1
  218. package/dist/test/test/tools/export.telemetry.test.js +0 -65
  219. package/dist/test/test/tools/export.telemetry.test.js.map +0 -1
  220. package/dist/test/test/tools/export.test.d.ts +0 -2
  221. package/dist/test/test/tools/export.test.d.ts.map +0 -1
  222. package/dist/test/test/tools/export.test.js +0 -174
  223. package/dist/test/test/tools/export.test.js.map +0 -1
  224. package/dist/test/test/tools/history.test.d.ts +0 -2
  225. package/dist/test/test/tools/history.test.d.ts.map +0 -1
  226. package/dist/test/test/tools/history.test.js +0 -29
  227. package/dist/test/test/tools/history.test.js.map +0 -1
  228. package/dist/test/test/tools/import.test.d.ts +0 -2
  229. package/dist/test/test/tools/import.test.d.ts.map +0 -1
  230. package/dist/test/test/tools/import.test.js +0 -122
  231. package/dist/test/test/tools/import.test.js.map +0 -1
  232. package/dist/test/test/tools/index.test.d.ts +0 -2
  233. package/dist/test/test/tools/index.test.d.ts.map +0 -1
  234. package/dist/test/test/tools/index.test.js +0 -117
  235. package/dist/test/test/tools/index.test.js.map +0 -1
  236. package/dist/test/test/tools/inspect.test.d.ts +0 -2
  237. package/dist/test/test/tools/inspect.test.d.ts.map +0 -1
  238. package/dist/test/test/tools/inspect.test.js +0 -62
  239. package/dist/test/test/tools/inspect.test.js.map +0 -1
  240. package/dist/test/test/tools/list.test.d.ts +0 -2
  241. package/dist/test/test/tools/list.test.d.ts.map +0 -1
  242. package/dist/test/test/tools/list.test.js +0 -23
  243. package/dist/test/test/tools/list.test.js.map +0 -1
  244. package/dist/test/test/tools/load.integration.test.d.ts +0 -2
  245. package/dist/test/test/tools/load.integration.test.d.ts.map +0 -1
  246. package/dist/test/test/tools/load.integration.test.js +0 -165
  247. package/dist/test/test/tools/load.integration.test.js.map +0 -1
  248. package/dist/test/test/tools/load.test.d.ts +0 -2
  249. package/dist/test/test/tools/load.test.d.ts.map +0 -1
  250. package/dist/test/test/tools/load.test.js +0 -387
  251. package/dist/test/test/tools/load.test.js.map +0 -1
  252. package/dist/test/test/tools/metrics.test.d.ts +0 -2
  253. package/dist/test/test/tools/metrics.test.d.ts.map +0 -1
  254. package/dist/test/test/tools/metrics.test.js +0 -29
  255. package/dist/test/test/tools/metrics.test.js.map +0 -1
  256. package/dist/test/test/tools/open-editor.test.d.ts +0 -2
  257. package/dist/test/test/tools/open-editor.test.d.ts.map +0 -1
  258. package/dist/test/test/tools/open-editor.test.js +0 -53
  259. package/dist/test/test/tools/open-editor.test.js.map +0 -1
  260. package/dist/test/test/tools/preview-harness.d.ts +0 -9
  261. package/dist/test/test/tools/preview-harness.d.ts.map +0 -1
  262. package/dist/test/test/tools/preview-harness.js +0 -23
  263. package/dist/test/test/tools/preview-harness.js.map +0 -1
  264. package/dist/test/test/tools/preview.telemetry.test.d.ts +0 -2
  265. package/dist/test/test/tools/preview.telemetry.test.d.ts.map +0 -1
  266. package/dist/test/test/tools/preview.telemetry.test.js +0 -36
  267. package/dist/test/test/tools/preview.telemetry.test.js.map +0 -1
  268. package/dist/test/test/tools/preview.test.d.ts +0 -2
  269. package/dist/test/test/tools/preview.test.d.ts.map +0 -1
  270. package/dist/test/test/tools/preview.test.js +0 -75
  271. package/dist/test/test/tools/preview.test.js.map +0 -1
  272. package/dist/test/test/tools/rename.test.d.ts +0 -2
  273. package/dist/test/test/tools/rename.test.d.ts.map +0 -1
  274. package/dist/test/test/tools/rename.test.js +0 -16
  275. package/dist/test/test/tools/rename.test.js.map +0 -1
  276. package/dist/test/test/tools/save.test.d.ts +0 -2
  277. package/dist/test/test/tools/save.test.d.ts.map +0 -1
  278. package/dist/test/test/tools/save.test.js +0 -137
  279. package/dist/test/test/tools/save.test.js.map +0 -1
  280. package/dist/test/test/tools/schema-best-practices.d.ts +0 -13
  281. package/dist/test/test/tools/schema-best-practices.d.ts.map +0 -1
  282. package/dist/test/test/tools/schema-best-practices.js +0 -169
  283. package/dist/test/test/tools/schema-best-practices.js.map +0 -1
  284. package/dist/test/test/tools/schema-best-practices.test.d.ts +0 -3
  285. package/dist/test/test/tools/schema-best-practices.test.d.ts.map +0 -1
  286. package/dist/test/test/tools/schema-best-practices.test.js +0 -194
  287. package/dist/test/test/tools/schema-best-practices.test.js.map +0 -1
  288. package/dist/test/test/tools/spans.test.d.ts +0 -2
  289. package/dist/test/test/tools/spans.test.d.ts.map +0 -1
  290. package/dist/test/test/tools/spans.test.js +0 -84
  291. package/dist/test/test/tools/spans.test.js.map +0 -1
  292. package/dist/test/test/viewer/broadcaster.test.d.ts +0 -2
  293. package/dist/test/test/viewer/broadcaster.test.d.ts.map +0 -1
  294. package/dist/test/test/viewer/broadcaster.test.js +0 -53
  295. package/dist/test/test/viewer/broadcaster.test.js.map +0 -1
  296. package/dist/test/test/viewer/cesdk-cdn.test.d.ts +0 -2
  297. package/dist/test/test/viewer/cesdk-cdn.test.d.ts.map +0 -1
  298. package/dist/test/test/viewer/cesdk-cdn.test.js +0 -19
  299. package/dist/test/test/viewer/cesdk-cdn.test.js.map +0 -1
  300. package/dist/test/test/viewer/config-route.test.d.ts +0 -2
  301. package/dist/test/test/viewer/config-route.test.d.ts.map +0 -1
  302. package/dist/test/test/viewer/config-route.test.js +0 -28
  303. package/dist/test/test/viewer/config-route.test.js.map +0 -1
  304. package/dist/test/test/viewer/resource-route.test.d.ts +0 -2
  305. package/dist/test/test/viewer/resource-route.test.d.ts.map +0 -1
  306. package/dist/test/test/viewer/resource-route.test.js +0 -70
  307. package/dist/test/test/viewer/resource-route.test.js.map +0 -1
  308. package/dist/test/test/viewer/router.test.d.ts +0 -2
  309. package/dist/test/test/viewer/router.test.d.ts.map +0 -1
  310. package/dist/test/test/viewer/router.test.js +0 -227
  311. package/dist/test/test/viewer/router.test.js.map +0 -1
  312. package/dist/test/test/viewer/session-mount.test.d.ts +0 -2
  313. package/dist/test/test/viewer/session-mount.test.d.ts.map +0 -1
  314. package/dist/test/test/viewer/session-mount.test.js +0 -52
  315. package/dist/test/test/viewer/session-mount.test.js.map +0 -1
  316. package/dist/test/test/viewer/spa-version.test.d.ts +0 -2
  317. package/dist/test/test/viewer/spa-version.test.d.ts.map +0 -1
  318. package/dist/test/test/viewer/spa-version.test.js +0 -14
  319. package/dist/test/test/viewer/spa-version.test.js.map +0 -1
  320. package/dist/test/test/viewer/url-builder.test.d.ts +0 -2
  321. package/dist/test/test/viewer/url-builder.test.d.ts.map +0 -1
  322. package/dist/test/test/viewer/url-builder.test.js +0 -98
  323. package/dist/test/test/viewer/url-builder.test.js.map +0 -1
  324. package/dist/test/test/workspace/content-hash.test.d.ts +0 -2
  325. package/dist/test/test/workspace/content-hash.test.d.ts.map +0 -1
  326. package/dist/test/test/workspace/content-hash.test.js +0 -17
  327. package/dist/test/test/workspace/content-hash.test.js.map +0 -1
  328. package/dist/test/test/workspace/hosted-stub.test.d.ts +0 -2
  329. package/dist/test/test/workspace/hosted-stub.test.d.ts.map +0 -1
  330. package/dist/test/test/workspace/hosted-stub.test.js +0 -30
  331. package/dist/test/test/workspace/hosted-stub.test.js.map +0 -1
  332. package/dist/test/test/workspace/in-memory.test.d.ts +0 -2
  333. package/dist/test/test/workspace/in-memory.test.d.ts.map +0 -1
  334. package/dist/test/test/workspace/in-memory.test.js +0 -4
  335. package/dist/test/test/workspace/in-memory.test.js.map +0 -1
  336. package/dist/test/test/workspace/node-fs.test.d.ts +0 -2
  337. package/dist/test/test/workspace/node-fs.test.d.ts.map +0 -1
  338. package/dist/test/test/workspace/node-fs.test.js +0 -20
  339. package/dist/test/test/workspace/node-fs.test.js.map +0 -1
  340. package/dist/test/test/workspace/s3.test.d.ts +0 -2
  341. package/dist/test/test/workspace/s3.test.d.ts.map +0 -1
  342. package/dist/test/test/workspace/s3.test.js +0 -153
  343. package/dist/test/test/workspace/s3.test.js.map +0 -1
  344. package/dist/test/test/workspace/scoped.test.d.ts +0 -2
  345. package/dist/test/test/workspace/scoped.test.d.ts.map +0 -1
  346. package/dist/test/test/workspace/scoped.test.js +0 -59
  347. package/dist/test/test/workspace/scoped.test.js.map +0 -1
  348. package/dist/test/test/workspace/shared-contract.d.ts +0 -3
  349. package/dist/test/test/workspace/shared-contract.d.ts.map +0 -1
  350. package/dist/test/test/workspace/shared-contract.js +0 -92
  351. package/dist/test/test/workspace/shared-contract.js.map +0 -1
  352. package/dist/test/tsconfig.test.tsbuildinfo +0 -1
  353. package/dist/test/vitest.config.d.ts +0 -3
  354. package/dist/test/vitest.config.d.ts.map +0 -1
  355. package/dist/test/vitest.config.js +0 -8
  356. package/dist/test/vitest.config.js.map +0 -1
  357. package/dist/tools/metrics.d.ts +0 -11
  358. package/dist/tools/metrics.d.ts.map +0 -1
  359. package/dist/tools/metrics.js +0 -28
  360. package/dist/tools/metrics.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"inspect.test.js","sourceRoot":"","sources":["../../../../test/tools/inspect.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,E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describe, expect, it } from 'vitest';\nimport { RevisionStore } from '../../src/revisions/store.js';\nimport { createInspectTool } from '../../src/tools/inspect.js';\nimport { InMemoryWorkspaceFS } from '../../src/workspace/in-memory.js';\n\ndescribe('inspect tool', () => {\n it('returns revision meta plus the persisted code', async () => {\n const store = new RevisionStore(new InMemoryWorkspaceFS());\n const written = await store.write({\n scene: 'scene-bytes',\n parent: null,\n title: 'Holiday Card',\n note: 'blank A6 portrait',\n code: 'const page = engine.scene.create();'\n });\n const tool = createInspectTool({ store });\n const result = await tool.call({ revision: written.id });\n const body = JSON.parse((result.content[0] as { text: string }).text) as {\n revision: string;\n parent: string | null;\n note?: string;\n title?: string;\n code?: string;\n createdAt: number;\n };\n expect(body.revision).toBe(written.id);\n expect(body.parent).toBeNull();\n expect(body.title).toBe('Holiday Card');\n expect(body.note).toBe('blank A6 portrait');\n expect(body.code).toBe('const page = engine.scene.create();');\n expect(typeof body.createdAt).toBe('number');\n });\n\n it('omits code when the revision has none', async () => {\n const store = new RevisionStore(new InMemoryWorkspaceFS());\n const written = await store.write({ scene: 's', parent: null, title: 'T' });\n const tool = createInspectTool({ store });\n const result = await tool.call({ revision: written.id });\n const body = JSON.parse((result.content[0] as { text: string }).text) as {\n code?: string;\n };\n expect(body.code).toBeUndefined();\n });\n\n it('omits title for non-root revisions', async () => {\n const store = new RevisionStore(new InMemoryWorkspaceFS());\n const root = await store.write({ scene: 'v1', parent: null, title: 'T' });\n const child = await store.write({\n scene: 'v2',\n parent: root.id,\n note: 'tweak',\n code: '// child'\n });\n const tool = createInspectTool({ store });\n const result = await tool.call({ revision: child.id });\n const body = JSON.parse((result.content[0] as { text: string }).text) as {\n title?: string;\n parent: string | null;\n };\n expect(body.title).toBeUndefined();\n expect(body.parent).toBe(root.id);\n });\n\n it('returns isError for an unknown revision', async () => {\n const store = new RevisionStore(new InMemoryWorkspaceFS());\n const tool = createInspectTool({ store });\n const result = await tool.call({ revision: 'deadbeefdead' });\n expect(result.isError).toBe(true);\n expect((result.content[0] as { text: string }).text).toMatch(\n /unknown revision/i\n );\n });\n\n it('returns isError when revision argument is missing', async () => {\n const store = new RevisionStore(new InMemoryWorkspaceFS());\n const tool = createInspectTool({ store });\n const result = await tool.call({});\n expect(result.isError).toBe(true);\n });\n});\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=list.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list.test.d.ts","sourceRoot":"","sources":["../../../../test/tools/list.test.ts"],"names":[],"mappings":""}
@@ -1,23 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
- import { RevisionStore } from '../../src/revisions/store.js';
3
- import { createListTool } from '../../src/tools/list.js';
4
- import { InMemoryWorkspaceFS } from '../../src/workspace/in-memory.js';
5
- describe('list tool', () => {
6
- it('returns roots from the workspace as JSON in a text part', async () => {
7
- const store = new RevisionStore(new InMemoryWorkspaceFS());
8
- await store.write({ scene: 'a', parent: null, title: 'One' });
9
- await new Promise((r) => setTimeout(r, 5));
10
- await store.write({ scene: 'b', parent: null, title: 'Two' });
11
- const tool = createListTool({ store });
12
- const result = await tool.call({});
13
- const body = JSON.parse(result.content[0].text);
14
- expect(body.map((d) => d.title)).toEqual(['Two', 'One']); // newest first
15
- });
16
- it('returns an empty array when the workspace has no designs', async () => {
17
- const store = new RevisionStore(new InMemoryWorkspaceFS());
18
- const tool = createListTool({ store });
19
- const result = await tool.call({});
20
- expect(JSON.parse(result.content[0].text)).toEqual([]);
21
- });
22
- });
23
- //# sourceMappingURL=list.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list.test.js","sourceRoot":"","sources":["../../../../test/tools/list.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO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AAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACnC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAsB,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CACtE,EAAE,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { describe, expect, it } from 'vitest';\nimport { RevisionStore } from '../../src/revisions/store.js';\nimport { createListTool } from '../../src/tools/list.js';\nimport { InMemoryWorkspaceFS } from '../../src/workspace/in-memory.js';\n\ndescribe('list tool', () => {\n it('returns roots from the workspace as JSON in a text part', async () => {\n const store = new RevisionStore(new InMemoryWorkspaceFS());\n await store.write({ scene: 'a', parent: null, title: 'One' });\n await new Promise((r) => setTimeout(r, 5));\n await store.write({ scene: 'b', parent: null, title: 'Two' });\n const tool = createListTool({ store });\n const result = await tool.call({});\n const body = JSON.parse(\n (result.content[0] as { text: string }).text\n ) as Array<{ title: string }>;\n expect(body.map((d) => d.title)).toEqual(['Two', 'One']); // newest first\n });\n\n it('returns an empty array when the workspace has no designs', async () => {\n const store = new RevisionStore(new InMemoryWorkspaceFS());\n const tool = createListTool({ store });\n const result = await tool.call({});\n expect(JSON.parse((result.content[0] as { text: string }).text)).toEqual(\n []\n );\n });\n});\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=load.integration.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"load.integration.test.d.ts","sourceRoot":"","sources":["../../../../test/tools/load.integration.test.ts"],"names":[],"mappings":""}
@@ -1,165 +0,0 @@
1
- // test/tools/load.integration.test.ts
2
- //
3
- // Real-engine integration test for the CODE-3 archive flow. Skipped unless
4
- // CESDK_LICENSE is set (CI secret / packages/codesign-mcp/.env — export it
5
- // into the shell before running; vitest does not read .env).
6
- //
7
- // Builds its own fixture archive with the real engine (no network): a scene
8
- // with one image block backed by a local PNG, saved via saveToArchive. This
9
- // is exactly the shape of the premium-template zips from the original bug.
10
- import { mkdtemp, rm, writeFile } from 'node:fs/promises';
11
- import { tmpdir } from 'node:os';
12
- import { join } from 'node:path';
13
- import { pathToFileURL } from 'node:url';
14
- import { afterAll, describe, expect, it } from 'vitest';
15
- import { cesdkAdapter } from '../../src/engine/cesdk-adapter.js';
16
- import { Mutex } from '../../src/engine/mutex.js';
17
- import { SCENE_ALLOWED_RESOURCE_SCHEMES } from '../../src/engine/scene-resource-schemes.js';
18
- import { EngineSession } from '../../src/engine/session.js';
19
- import { RevisionStore } from '../../src/revisions/store.js';
20
- import { ensureHeadlessEngine } from '../../src/tools/engine.js';
21
- import { createLoadTool } from '../../src/tools/load.js';
22
- import { InMemoryWorkspaceFS } from '../../src/workspace/in-memory.js';
23
- const LICENSE = process.env.CESDK_LICENSE;
24
- // 1x1 red PNG.
25
- const TINY_PNG = new Uint8Array(Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==', 'base64'));
26
- const tmpDirs = [];
27
- afterAll(async () => {
28
- for (const d of tmpDirs)
29
- await rm(d, { recursive: true, force: true });
30
- });
31
- describe.skipIf(!LICENSE)('load tool — real engine integration', () => {
32
- it('archive load → explode → save round-trips with no buffer: schemes; re-load dedupes', { timeout: 180_000 }, async () => {
33
- const engine = await ensureHeadlessEngine(LICENSE);
34
- // --- Build the fixture archive.
35
- const dir = await mkdtemp(join(tmpdir(), 'load-integration-'));
36
- tmpDirs.push(dir);
37
- const pngPath = join(dir, 'red.png');
38
- await writeFile(pngPath, TINY_PNG);
39
- engine.scene.create();
40
- const scene = engine.scene.get();
41
- if (scene === null)
42
- throw new Error('scene.create produced no scene');
43
- const page = engine.block.create('page');
44
- engine.block.appendChild(scene, page);
45
- const graphic = engine.block.create('graphic');
46
- engine.block.setShape(graphic, engine.block.createShape('rect'));
47
- const fill = engine.block.createFill('image');
48
- engine.block.setString(fill, 'fill/image/imageFileURI', pathToFileURL(pngPath).href);
49
- engine.block.setFill(graphic, fill);
50
- engine.block.appendChild(page, graphic);
51
- await engine.block.forceLoadResources([page]);
52
- const blob = await engine.scene.saveToArchive();
53
- const zipPath = join(dir, 'fixture.zip');
54
- await writeFile(zipPath, new Uint8Array(await blob.arrayBuffer()));
55
- // --- Load it through the real tool.
56
- const fs = new InMemoryWorkspaceFS();
57
- const store = new RevisionStore(fs);
58
- const session = new EngineSession({
59
- size: 1,
60
- adapter: cesdkAdapter(engine)
61
- });
62
- const tool = createLoadTool({
63
- fs,
64
- store,
65
- session,
66
- engineLock: new Mutex(),
67
- allowPath: true
68
- });
69
- const result = await tool.call({
70
- source: { path: zipPath },
71
- title: 'Fixture'
72
- });
73
- expect(result.isError, result.content[0].text).toBeUndefined();
74
- const body = JSON.parse(result.content[0].text);
75
- expect(body.title).toBe('Fixture');
76
- // The archive's bundled bytes landed content-addressed in assets/.
77
- const assets = await fs.readdir('assets');
78
- expect(assets.length).toBeGreaterThanOrEqual(1);
79
- expect(assets.some((f) => f.endsWith('.png'))).toBe(true);
80
- // Durability: the persisted scene reloads with ZERO transients —
81
- // nothing would be lost on a future save. (This is the bug's inverse.)
82
- const rev = await store.read(body.revision);
83
- await engine.scene.loadFromString(rev.scene);
84
- expect(engine.editor.findAllTransientResources()).toEqual([]);
85
- // Regression (CODE-3 acceptance): the EDIT save path — the adapter's
86
- // saveToString — must serialize a workspace://-referencing scene too.
87
- const adapter = cesdkAdapter(engine);
88
- const reSaved = await adapter.saveToString(engine);
89
- expect(reSaved.length).toBeGreaterThan(0);
90
- // Idempotence: re-loading the same zip dedupes to the same shas.
91
- const again = await tool.call({ source: { path: zipPath } });
92
- expect(again.isError).toBeUndefined();
93
- expect((await fs.readdir('assets')).sort()).toEqual(assets.sort());
94
- });
95
- it('bare .scene load returns a scheme-classified report from real engine state (no workspace-dangling)', { timeout: 180_000 }, async () => {
96
- const engine = await ensureHeadlessEngine(LICENSE);
97
- // Build a bare scene referencing a local file:// image — no network, and
98
- // file:// is a durable engine scheme, so it survives saveToString.
99
- const dir = await mkdtemp(join(tmpdir(), 'load-bare-integration-'));
100
- tmpDirs.push(dir);
101
- const pngPath = join(dir, 'red.png');
102
- await writeFile(pngPath, TINY_PNG);
103
- engine.scene.create();
104
- const scene = engine.scene.get();
105
- if (scene === null)
106
- throw new Error('scene.create produced no scene');
107
- const page = engine.block.create('page');
108
- engine.block.appendChild(scene, page);
109
- const graphic = engine.block.create('graphic');
110
- engine.block.setShape(graphic, engine.block.createShape('rect'));
111
- const fill = engine.block.createFill('image');
112
- engine.block.setString(fill, 'fill/image/imageFileURI', pathToFileURL(pngPath).href);
113
- engine.block.setFill(graphic, fill);
114
- engine.block.appendChild(page, graphic);
115
- await engine.block.forceLoadResources([page]);
116
- const bareScene = await engine.scene.saveToString({
117
- allowedResourceSchemes: SCENE_ALLOWED_RESOURCE_SCHEMES
118
- });
119
- const scenePath = join(dir, 'poster.scene');
120
- await writeFile(scenePath, bareScene);
121
- // Load it through the real tool.
122
- const fs = new InMemoryWorkspaceFS();
123
- const store = new RevisionStore(fs);
124
- const session = new EngineSession({
125
- size: 1,
126
- adapter: cesdkAdapter(engine)
127
- });
128
- const tool = createLoadTool({
129
- fs,
130
- store,
131
- session,
132
- engineLock: new Mutex(),
133
- allowPath: true
134
- });
135
- const result = await tool.call({
136
- source: { path: scenePath },
137
- title: 'Bare'
138
- });
139
- expect(result.isError, result.content[0].text).toBeUndefined();
140
- const body = JSON.parse(result.content[0].text);
141
- // Bare scenes are persisted verbatim (not re-serialized).
142
- expect((await store.read(body.revision)).scene).toBe(bareScene);
143
- // The report is a real array; the dropped `workspace-dangling` never
144
- // appears, and every class is one of the five scheme buckets.
145
- expect(Array.isArray(body.assets)).toBe(true);
146
- const CLASSES = ['workspace', 'external', 'bundle', 'transient', 'other'];
147
- for (const a of body.assets)
148
- expect(CLASSES).toContain(a.class);
149
- // Regression (the mock-vs-real gap that this whole change fixes): the
150
- // file:// image the engine actually loaded is a DURABLE reference — it is
151
- // classified by scheme (`other`), never as a phantom `transient`. And no
152
- // durable-scheme URI anywhere is labeled `transient`.
153
- const fileEntries = body.assets.filter((a) => a.uri.startsWith('file://'));
154
- expect(fileEntries.length).toBeGreaterThanOrEqual(1);
155
- for (const a of fileEntries)
156
- expect(a.class).toBe('other');
157
- const isDurable = (u) => u.startsWith('workspace://') ||
158
- u.startsWith('http://') ||
159
- u.startsWith('https://') ||
160
- u.startsWith('bundle://') ||
161
- u.startsWith('file://');
162
- expect(body.assets.filter((a) => isDurable(a.uri) && a.class === 'transient')).toEqual([]);
163
- });
164
- });
165
- //# sourceMappingURL=load.integration.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"load.integration.test.js","sourceRoot":"","sources":["../../../../test/tools/load.integration.test.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,EAAE;AACF,2EAA2E;AAC3E,2EAA2E;AAC3E,6DAA6D;AAC7D,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,2EAA2E;AAC3E,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAC;AAC5F,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D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AAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAC3C,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,CAC5B,CAAC;QACF,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;QACrD,KAAK,MAAM,CAAC,IAAI,WAAW;YAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC3D,MAAM,SAAS,GAAG,CAAC,CAAS,EAAE,EAAE,CAC9B,CAAC,CAAC,UAAU,CAAC,cAAc,CAAC;YAC5B,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC;YACvB,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;YACxB,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC;YACzB,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QAC1B,MAAM,CACJ,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,WAAW,CAAC,CACvE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAChB,CAAC,CACF,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["// test/tools/load.integration.test.ts\n//\n// Real-engine integration test for the CODE-3 archive flow. Skipped unless\n// CESDK_LICENSE is set (CI secret / packages/codesign-mcp/.env — export it\n// into the shell before running; vitest does not read .env).\n//\n// Builds its own fixture archive with the real engine (no network): a scene\n// with one image block backed by a local PNG, saved via saveToArchive. This\n// is exactly the shape of the premium-template zips from the original bug.\nimport { mkdtemp, rm, writeFile } from 'node:fs/promises';\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport { afterAll, describe, expect, it } from 'vitest';\nimport { cesdkAdapter } from '../../src/engine/cesdk-adapter.js';\nimport { Mutex } from '../../src/engine/mutex.js';\nimport { SCENE_ALLOWED_RESOURCE_SCHEMES } from '../../src/engine/scene-resource-schemes.js';\nimport { EngineSession } from '../../src/engine/session.js';\nimport { RevisionStore } from '../../src/revisions/store.js';\nimport { ensureHeadlessEngine } from '../../src/tools/engine.js';\nimport { createLoadTool } from '../../src/tools/load.js';\nimport { InMemoryWorkspaceFS } from '../../src/workspace/in-memory.js';\n\nconst LICENSE = process.env.CESDK_LICENSE;\n\n// 1x1 red PNG.\nconst TINY_PNG = new Uint8Array(\n Buffer.from(\n 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==',\n 'base64'\n )\n);\n\nconst tmpDirs: string[] = [];\nafterAll(async () => {\n for (const d of tmpDirs) await rm(d, { recursive: true, force: true });\n});\n\ndescribe.skipIf(!LICENSE)('load tool — real engine integration', () => {\n it(\n 'archive load → explode → save round-trips with no buffer: schemes; re-load dedupes',\n { timeout: 180_000 },\n async () => {\n const engine = await ensureHeadlessEngine(LICENSE as string);\n\n // --- Build the fixture archive.\n const dir = await mkdtemp(join(tmpdir(), 'load-integration-'));\n tmpDirs.push(dir);\n const pngPath = join(dir, 'red.png');\n await writeFile(pngPath, TINY_PNG);\n engine.scene.create();\n const scene = engine.scene.get();\n if (scene === null) throw new Error('scene.create produced no scene');\n const page = engine.block.create('page');\n engine.block.appendChild(scene, page);\n const graphic = engine.block.create('graphic');\n engine.block.setShape(graphic, engine.block.createShape('rect'));\n const fill = engine.block.createFill('image');\n engine.block.setString(\n fill,\n 'fill/image/imageFileURI',\n pathToFileURL(pngPath).href\n );\n engine.block.setFill(graphic, fill);\n engine.block.appendChild(page, graphic);\n await engine.block.forceLoadResources([page]);\n const blob = await engine.scene.saveToArchive();\n const zipPath = join(dir, 'fixture.zip');\n await writeFile(zipPath, new Uint8Array(await blob.arrayBuffer()));\n\n // --- Load it through the real tool.\n const fs = new InMemoryWorkspaceFS();\n const store = new RevisionStore(fs);\n const session = new EngineSession({\n size: 1,\n adapter: cesdkAdapter(engine)\n });\n const tool = createLoadTool({\n fs,\n store,\n session,\n engineLock: new Mutex(),\n allowPath: true\n });\n const result = await tool.call({\n source: { path: zipPath },\n title: 'Fixture'\n });\n expect(\n result.isError,\n (result.content[0] as { text: string }).text\n ).toBeUndefined();\n const body = JSON.parse((result.content[0] as { text: string }).text) as {\n revision: string;\n title: string;\n };\n expect(body.title).toBe('Fixture');\n\n // The archive's bundled bytes landed content-addressed in assets/.\n const assets = await fs.readdir('assets');\n expect(assets.length).toBeGreaterThanOrEqual(1);\n expect(assets.some((f) => f.endsWith('.png'))).toBe(true);\n\n // Durability: the persisted scene reloads with ZERO transients —\n // nothing would be lost on a future save. (This is the bug's inverse.)\n const rev = await store.read(body.revision);\n await engine.scene.loadFromString(rev.scene);\n expect(engine.editor.findAllTransientResources()).toEqual([]);\n\n // Regression (CODE-3 acceptance): the EDIT save path — the adapter's\n // saveToString — must serialize a workspace://-referencing scene too.\n const adapter = cesdkAdapter(engine);\n const reSaved = await adapter.saveToString(engine);\n expect(reSaved.length).toBeGreaterThan(0);\n\n // Idempotence: re-loading the same zip dedupes to the same shas.\n const again = await tool.call({ source: { path: zipPath } });\n expect(again.isError).toBeUndefined();\n expect((await fs.readdir('assets')).sort()).toEqual(assets.sort());\n }\n );\n\n it(\n 'bare .scene load returns a scheme-classified report from real engine state (no workspace-dangling)',\n { timeout: 180_000 },\n async () => {\n const engine = await ensureHeadlessEngine(LICENSE as string);\n\n // Build a bare scene referencing a local file:// image — no network, and\n // file:// is a durable engine scheme, so it survives saveToString.\n const dir = await mkdtemp(join(tmpdir(), 'load-bare-integration-'));\n tmpDirs.push(dir);\n const pngPath = join(dir, 'red.png');\n await writeFile(pngPath, TINY_PNG);\n engine.scene.create();\n const scene = engine.scene.get();\n if (scene === null) throw new Error('scene.create produced no scene');\n const page = engine.block.create('page');\n engine.block.appendChild(scene, page);\n const graphic = engine.block.create('graphic');\n engine.block.setShape(graphic, engine.block.createShape('rect'));\n const fill = engine.block.createFill('image');\n engine.block.setString(\n fill,\n 'fill/image/imageFileURI',\n pathToFileURL(pngPath).href\n );\n engine.block.setFill(graphic, fill);\n engine.block.appendChild(page, graphic);\n await engine.block.forceLoadResources([page]);\n const bareScene = await engine.scene.saveToString({\n allowedResourceSchemes: SCENE_ALLOWED_RESOURCE_SCHEMES\n });\n const scenePath = join(dir, 'poster.scene');\n await writeFile(scenePath, bareScene);\n\n // Load it through the real tool.\n const fs = new InMemoryWorkspaceFS();\n const store = new RevisionStore(fs);\n const session = new EngineSession({\n size: 1,\n adapter: cesdkAdapter(engine)\n });\n const tool = createLoadTool({\n fs,\n store,\n session,\n engineLock: new Mutex(),\n allowPath: true\n });\n const result = await tool.call({\n source: { path: scenePath },\n title: 'Bare'\n });\n expect(\n result.isError,\n (result.content[0] as { text: string }).text\n ).toBeUndefined();\n const body = JSON.parse((result.content[0] as { text: string }).text) as {\n revision: string;\n title: string;\n assets: Array<{ uri: string; class: string }>;\n };\n\n // Bare scenes are persisted verbatim (not re-serialized).\n expect((await store.read(body.revision)).scene).toBe(bareScene);\n // The report is a real array; the dropped `workspace-dangling` never\n // appears, and every class is one of the five scheme buckets.\n expect(Array.isArray(body.assets)).toBe(true);\n const CLASSES = ['workspace', 'external', 'bundle', 'transient', 'other'];\n for (const a of body.assets) expect(CLASSES).toContain(a.class);\n // Regression (the mock-vs-real gap that this whole change fixes): the\n // file:// image the engine actually loaded is a DURABLE reference — it is\n // classified by scheme (`other`), never as a phantom `transient`. And no\n // durable-scheme URI anywhere is labeled `transient`.\n const fileEntries = body.assets.filter((a) =>\n a.uri.startsWith('file://')\n );\n expect(fileEntries.length).toBeGreaterThanOrEqual(1);\n for (const a of fileEntries) expect(a.class).toBe('other');\n const isDurable = (u: string) =>\n u.startsWith('workspace://') ||\n u.startsWith('http://') ||\n u.startsWith('https://') ||\n u.startsWith('bundle://') ||\n u.startsWith('file://');\n expect(\n body.assets.filter((a) => isDurable(a.uri) && a.class === 'transient')\n ).toEqual([]);\n }\n );\n});\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=load.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"load.test.d.ts","sourceRoot":"","sources":["../../../../test/tools/load.test.ts"],"names":[],"mappings":""}