allyhub 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (580) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/bin/allyhub.js +10 -0
  3. package/dist/args.js +1 -1
  4. package/dist/command.js +1 -1
  5. package/dist/commands/add.js +1 -1
  6. package/dist/commands/auth.js +1 -1
  7. package/dist/commands/cloud-tools.js +1 -1
  8. package/dist/commands/cloud.js +1 -1
  9. package/dist/commands/contributed.js +1 -1
  10. package/dist/commands/found-extensions.js +2 -0
  11. package/dist/commands/frames/common.js +1 -1
  12. package/dist/commands/frames/doc.js +1 -1
  13. package/dist/commands/frames.js +9 -9
  14. package/dist/commands/index.js +1 -1
  15. package/dist/commands/inspect/common.js +3 -3
  16. package/dist/commands/inspect/index.js +1 -1
  17. package/dist/commands/inspect/layout.js +1 -1
  18. package/dist/commands/inspect/views.js +1 -1
  19. package/dist/commands/list.js +2 -0
  20. package/dist/commands/mail.js +1 -1
  21. package/dist/commands/render.js +1 -1
  22. package/dist/commands/run-context.js +2 -0
  23. package/dist/commands.json +1 -0
  24. package/dist/fields.js +1 -1
  25. package/dist/main.js +7 -7
  26. package/dist/node_modules/@allyhub/3d-extension/dist/build.js +1 -1
  27. package/dist/node_modules/@allyhub/3d-extension/dist/scenery-build.js +1 -1
  28. package/dist/node_modules/@allyhub/3d-extension/package.json +3 -2
  29. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  30. package/dist/node_modules/@allyhub/browser/package.json +1 -1
  31. package/dist/node_modules/@allyhub/build/dist/build-plugins.js +1 -1
  32. package/dist/node_modules/@allyhub/build/dist/index.js +1 -1
  33. package/dist/node_modules/@allyhub/build/dist/meta-worker.js +1 -1
  34. package/dist/node_modules/@allyhub/build/dist/plugin.js +9 -9
  35. package/dist/node_modules/@allyhub/build/dist/prepare.js +3 -3
  36. package/dist/node_modules/@allyhub/build/dist/project-root.js +1 -1
  37. package/dist/node_modules/@allyhub/build/dist/scan.js +1 -1
  38. package/dist/node_modules/@allyhub/build/dist/sdk-parts.js +2 -0
  39. package/dist/node_modules/@allyhub/build/dist/vite.js +2 -2
  40. package/dist/node_modules/@allyhub/build/package.json +9 -1
  41. package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
  42. package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
  43. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  44. package/dist/node_modules/@allyhub/check/dist/check.js +2 -2
  45. package/dist/node_modules/@allyhub/check/package.json +1 -1
  46. package/dist/node_modules/@allyhub/cloud/dist/blobs.js +1 -1
  47. package/dist/node_modules/@allyhub/cloud/dist/call.js +1 -1
  48. package/dist/node_modules/@allyhub/cloud/dist/catalog.js +1 -1
  49. package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
  50. package/dist/node_modules/@allyhub/cloud/dist/config.js +1 -1
  51. package/dist/node_modules/@allyhub/cloud/dist/credentials.js +1 -1
  52. package/dist/node_modules/@allyhub/cloud/dist/device.js +1 -1
  53. package/dist/node_modules/@allyhub/cloud/dist/errors.js +1 -1
  54. package/dist/node_modules/@allyhub/cloud/dist/index.js +1 -1
  55. package/dist/node_modules/@allyhub/cloud/dist/loopback.js +2 -2
  56. package/dist/node_modules/@allyhub/cloud/dist/mail.js +1 -1
  57. package/dist/node_modules/@allyhub/cloud/dist/records.js +1 -1
  58. package/dist/node_modules/@allyhub/cloud/dist/signin.js +2 -2
  59. package/dist/node_modules/@allyhub/cloud/dist/sites.js +1 -1
  60. package/dist/node_modules/@allyhub/cloud/dist/token.js +1 -1
  61. package/dist/node_modules/@allyhub/cloud/dist/tools.js +2 -0
  62. package/dist/node_modules/@allyhub/cloud/dist/uploads.js +1 -1
  63. package/dist/node_modules/@allyhub/cloud/dist/voice.js +1 -1
  64. package/dist/node_modules/@allyhub/cloud/package.json +5 -1
  65. package/dist/node_modules/@allyhub/components/package.json +1 -1
  66. package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
  67. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  68. package/dist/node_modules/@allyhub/doc/package.json +1 -1
  69. package/dist/node_modules/@allyhub/doc-extension/dist/cli/find.js +1 -1
  70. package/dist/node_modules/@allyhub/doc-extension/dist/workspace.js +1 -1
  71. package/dist/node_modules/@allyhub/doc-extension/package.json +1 -1
  72. package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
  73. package/dist/node_modules/@allyhub/export/package.json +1 -1
  74. package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
  75. package/dist/node_modules/@allyhub/extension-host/dist/points.js +1 -1
  76. package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
  77. package/dist/node_modules/@allyhub/formats/dist/items.d.ts +24 -7
  78. package/dist/node_modules/@allyhub/formats/dist/items.js +1 -1
  79. package/dist/node_modules/@allyhub/formats/dist/note-shape.d.ts +1 -1
  80. package/dist/node_modules/@allyhub/formats/package.json +25 -1
  81. package/dist/node_modules/@allyhub/html-extension/package.json +1 -1
  82. package/dist/node_modules/@allyhub/i18n/package.json +1 -1
  83. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  84. package/dist/node_modules/@allyhub/image-extension/package.json +1 -1
  85. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  86. package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
  87. package/dist/node_modules/@allyhub/image-render/package.json +1 -1
  88. package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
  89. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  90. package/dist/node_modules/@allyhub/jobs/package.json +1 -1
  91. package/dist/node_modules/@allyhub/linkedin-extension/package.json +1 -1
  92. package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
  93. package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
  94. package/dist/node_modules/@allyhub/linkedin-view/src/style.css +1 -600
  95. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  96. package/dist/node_modules/@allyhub/media/package.json +5 -1
  97. package/dist/node_modules/@allyhub/media-extension/dist/asr/hear.js +1 -1
  98. package/dist/node_modules/@allyhub/media-extension/dist/vision/track.js +1 -1
  99. package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
  100. package/dist/node_modules/@allyhub/model/package.json +1 -1
  101. package/dist/node_modules/@allyhub/office-extension/package.json +1 -1
  102. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  103. package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +1 -2
  104. package/dist/node_modules/@allyhub/piece/dist/media.d.ts +1 -1
  105. package/dist/node_modules/@allyhub/piece/dist/source.d.ts +2 -2
  106. package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +2 -2
  107. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  108. package/dist/node_modules/@allyhub/project/package.json +1 -1
  109. package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
  110. package/dist/node_modules/@allyhub/protocol/dist/blobs.js +1 -1
  111. package/dist/node_modules/@allyhub/protocol/dist/cli.js +1 -1
  112. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  113. package/dist/node_modules/@allyhub/protocol/dist/errors.js +1 -1
  114. package/dist/node_modules/@allyhub/protocol/dist/events.js +1 -1
  115. package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
  116. package/dist/node_modules/@allyhub/protocol/dist/jsonrpc.js +1 -1
  117. package/dist/node_modules/@allyhub/protocol/dist/kinds.js +1 -1
  118. package/dist/node_modules/@allyhub/protocol/dist/mail.js +1 -1
  119. package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
  120. package/dist/node_modules/@allyhub/protocol/dist/paywall.js +1 -1
  121. package/dist/node_modules/@allyhub/protocol/dist/purposes.js +1 -1
  122. package/dist/node_modules/@allyhub/protocol/dist/registry.js +1 -1
  123. package/dist/node_modules/@allyhub/protocol/dist/sites.js +1 -1
  124. package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
  125. package/dist/node_modules/@allyhub/protocol/dist/teams.js +1 -1
  126. package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
  127. package/dist/node_modules/@allyhub/protocol/package.json +41 -1
  128. package/dist/node_modules/@allyhub/registry/package.json +1 -1
  129. package/dist/node_modules/@allyhub/render/dist/errors.js +1 -1
  130. package/dist/node_modules/@allyhub/render/dist/post-probe.js +1 -1
  131. package/dist/node_modules/@allyhub/render/package.json +9 -1
  132. package/dist/node_modules/@allyhub/runtime/package.json +1 -1
  133. package/dist/node_modules/@allyhub/runtimes/dist/bundled.js +1 -1
  134. package/dist/node_modules/@allyhub/runtimes/dist/declared.js +1 -1
  135. package/dist/node_modules/@allyhub/runtimes/dist/index.js +1 -1
  136. package/dist/node_modules/@allyhub/runtimes/dist/manifest.js +1 -1
  137. package/dist/node_modules/@allyhub/runtimes/dist/runtimes.js +1 -1
  138. package/dist/node_modules/@allyhub/runtimes/package.json +9 -1
  139. package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
  140. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  141. package/dist/node_modules/@allyhub/scenery-host/dist/bundle.js +3 -3
  142. package/dist/node_modules/@allyhub/scenery-host/dist/fact.d.ts +1 -1
  143. package/dist/node_modules/@allyhub/scenery-host/dist/model-stage.js +2 -2
  144. package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
  145. package/dist/node_modules/@allyhub/sheet/dist/annotations.js +1 -1
  146. package/dist/node_modules/@allyhub/sheet/dist/api/workbook.js +1 -1
  147. package/dist/node_modules/@allyhub/sheet/dist/arrange.js +1 -1
  148. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
  149. package/dist/node_modules/@allyhub/sheet/dist/filter.js +1 -1
  150. package/dist/node_modules/@allyhub/sheet/dist/generated.js +1 -1
  151. package/dist/node_modules/@allyhub/sheet/dist/html.js +6 -6
  152. package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
  153. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  154. package/dist/node_modules/@allyhub/sheet-extension/dist/cli/open.js +1 -1
  155. package/dist/node_modules/@allyhub/sheet-extension/dist/code.js +1 -1
  156. package/dist/node_modules/@allyhub/sheet-extension/dist/export.js +2 -2
  157. package/dist/node_modules/@allyhub/sheet-extension/package.json +1 -1
  158. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  159. package/dist/node_modules/@allyhub/slides-extension/package.json +1 -1
  160. package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
  161. package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
  162. package/dist/node_modules/@allyhub/stage/package.json +1 -1
  163. package/dist/node_modules/@allyhub/stage-page/dist/fonts/arimo/400-italic.css +1 -79
  164. package/dist/node_modules/@allyhub/stage-page/dist/fonts/arimo/400.css +1 -79
  165. package/dist/node_modules/@allyhub/stage-page/dist/fonts/arimo/700-italic.css +1 -79
  166. package/dist/node_modules/@allyhub/stage-page/dist/fonts/arimo/700.css +1 -79
  167. package/dist/node_modules/@allyhub/stage-page/dist/fonts/arimo/arial.css +1 -316
  168. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400-italic.css +1 -19
  169. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400.css +1 -19
  170. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700-italic.css +1 -19
  171. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700.css +1 -19
  172. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/cambria.css +1 -76
  173. package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/400-italic.css +1 -69
  174. package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/400.css +1 -69
  175. package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/700-italic.css +1 -69
  176. package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/700.css +1 -69
  177. package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/calibri.css +1 -276
  178. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400-italic.css +1 -79
  179. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400.css +1 -79
  180. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700-italic.css +1 -79
  181. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700.css +1 -79
  182. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/courier-new.css +1 -316
  183. package/dist/node_modules/@allyhub/stage-page/dist/fonts/noto-color-emoji/emoji.css +1 -8
  184. package/dist/node_modules/@allyhub/stage-page/dist/fonts/noto-sans-sc/400.css +1 -1009
  185. package/dist/node_modules/@allyhub/stage-page/dist/fonts/noto-sans-sc/700.css +1 -1009
  186. package/dist/node_modules/@allyhub/stage-page/dist/fonts/noto-sans-sc/microsoft-yahei.css +1 -2018
  187. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400-italic.css +1 -79
  188. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400.css +1 -79
  189. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700-italic.css +1 -79
  190. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700.css +1 -79
  191. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/times-new-roman.css +1 -316
  192. package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
  193. package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
  194. package/dist/node_modules/@allyhub/telemetry/dist/doc.js +1 -1
  195. package/dist/node_modules/@allyhub/telemetry/dist/errors.js +1 -1
  196. package/dist/node_modules/@allyhub/telemetry/dist/telemetry.js +2 -2
  197. package/dist/node_modules/@allyhub/telemetry/package.json +1 -1
  198. package/dist/node_modules/@allyhub/text-extension/package.json +1 -1
  199. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  200. package/dist/node_modules/@allyhub/video-extension/dist/build-plugins.js +1 -1
  201. package/dist/node_modules/@allyhub/video-extension/package.json +6 -2
  202. package/dist/node_modules/@allyhub/video-measure/dist/plans.js +2 -2
  203. package/dist/node_modules/@allyhub/video-measure/dist/reference/video.js +1 -1
  204. package/dist/node_modules/@allyhub/video-measure/package.json +5 -1
  205. package/dist/node_modules/@allyhub/video-sdk/dist/config.js +2 -0
  206. package/dist/node_modules/@allyhub/video-sdk/dist/piece.js +1 -1
  207. package/dist/node_modules/@allyhub/video-sdk/package.json +5 -1
  208. package/dist/node_modules/@allyhub/website/package.json +1 -1
  209. package/dist/node_modules/@allyhub/website-extension/dist/build.js +1 -1
  210. package/dist/node_modules/@allyhub/website-extension/package.json +4 -4
  211. package/dist/node_modules/@allyhub/x-extension/dist/build.js +1 -1
  212. package/dist/node_modules/@allyhub/x-extension/package.json +8 -2
  213. package/dist/node_modules/@allyhub/x-model/package.json +1 -1
  214. package/dist/node_modules/@allyhub/x-view/package.json +1 -1
  215. package/dist/node_modules/@allyhub/x-view/src/style.css +1 -709
  216. package/dist/package.json +14 -14
  217. package/dist/project.js +1 -1
  218. package/dist/resources.js +1 -1
  219. package/dist/sdk-docs.js +1 -1
  220. package/dist/slot.js +4 -0
  221. package/dist/telemetry.js +1 -1
  222. package/dist/version.js +1 -1
  223. package/editor-web/assets/{abnfDiagram-WEYOIA3C-Hy4-O0wN.js → abnfDiagram-WEYOIA3C-DYaMS_BB.js} +1 -1
  224. package/editor-web/assets/{architecture-WOLXFQ4H-43JEVxqz.js → architecture-WOLXFQ4H-g_Tjfl_y.js} +1 -1
  225. package/editor-web/assets/{architectureDiagram-ZHVYKT53-7bFTl41n.js → architectureDiagram-ZHVYKT53-CqdhofOL.js} +1 -1
  226. package/editor-web/assets/{article-CS48wwvk.js → article-8evPh712.js} +1 -1
  227. package/editor-web/assets/{article-Cyle57uq.js → article-BhRtWYMd.js} +1 -1
  228. package/editor-web/assets/{blockDiagram-RJAE7QA3-DcoNo1WH.js → blockDiagram-RJAE7QA3-Bc-28Bci.js} +1 -1
  229. package/editor-web/assets/{c4Diagram-XDPPPE54-CsMt61gx.js → c4Diagram-XDPPPE54-CTGJb8FB.js} +1 -1
  230. package/editor-web/assets/{calc-worker-BdHh5LXM.js → calc-worker-oEIqrrTM.js} +1 -1
  231. package/editor-web/assets/channel-wIj_OqDm.js +1 -0
  232. package/editor-web/assets/{chart-file-CfbWK9l1.js → chart-file-dGiRgFcH.js} +1 -1
  233. package/editor-web/assets/{chunk-2E7WHVMD-fj-TJIRG.js → chunk-2E7WHVMD-B2MPOVTU.js} +1 -1
  234. package/editor-web/assets/{chunk-4EMNKR2T-Du5cRy-Y.js → chunk-4EMNKR2T-BUV1ZHP0.js} +1 -1
  235. package/editor-web/assets/{chunk-55XCU76K-BHXxBBtm.js → chunk-55XCU76K-BZlpspL5.js} +1 -1
  236. package/editor-web/assets/{chunk-7S6XSTFO-R5HW6X5I.js → chunk-7S6XSTFO-CpKeisWE.js} +1 -1
  237. package/editor-web/assets/{chunk-AQDTSKZB-C98F2BUb.js → chunk-AQDTSKZB-BJqwAPyo.js} +1 -1
  238. package/editor-web/assets/{chunk-DSNLSHJZ-NIGsJ2cK.js → chunk-DSNLSHJZ-D6oPWl_W.js} +1 -1
  239. package/editor-web/assets/{chunk-HAGFOTED-BtHxtfW5.js → chunk-HAGFOTED-B5pk4MZF.js} +1 -1
  240. package/editor-web/assets/{chunk-HNE4Q36P-BI8i7Vkk.js → chunk-HNE4Q36P-DHbSPvxQ.js} +1 -1
  241. package/editor-web/assets/{chunk-NQOKRVIF-DP_Z_zEA.js → chunk-NQOKRVIF-CcL_GcRA.js} +1 -1
  242. package/editor-web/assets/{chunk-UHW7PFBP-C_8bui28.js → chunk-UHW7PFBP-YgiOL6XE.js} +1 -1
  243. package/editor-web/assets/{chunk-VQ5W62QI-CKZgzWB2.js → chunk-VQ5W62QI-p14b4UYc.js} +1 -1
  244. package/editor-web/assets/{chunk-WQQL4CDK-Ff4DgCht.js → chunk-WQQL4CDK-BWW0x-XH.js} +1 -1
  245. package/editor-web/assets/{chunk-YZO67HFG-Csbx1-pi.js → chunk-YZO67HFG-oG3qd68C.js} +1 -1
  246. package/editor-web/assets/{chunk-ZAUX2LTX-BO1kcV3w.js → chunk-ZAUX2LTX-CpcheH0u.js} +1 -1
  247. package/editor-web/assets/{chunk-ZCHMQSOR-CxeNZYZG.js → chunk-ZCHMQSOR-cWQvLl1w.js} +1 -1
  248. package/editor-web/assets/{classDiagram-v2-4MYWR3UA-D8eHQa5i.js → classDiagram-v2-4MYWR3UA-7PG7YcdU.js} +1 -1
  249. package/editor-web/assets/{cynefin-EF2NZ3EQ-lIUY3WQQ.js → cynefin-EF2NZ3EQ-CtcknEQ_.js} +1 -1
  250. package/editor-web/assets/{cynefinDiagram-WF24UDRP-CFOOhEEs.js → cynefinDiagram-WF24UDRP-Ca7VIsjN.js} +1 -1
  251. package/editor-web/assets/{dagre-NK4GIZVX-DdHVup2I.js → dagre-NK4GIZVX-BzcSLtsr.js} +1 -1
  252. package/editor-web/assets/deck-C7fN0Qtn.js +1 -0
  253. package/editor-web/assets/{diagram-CBK3MWTC-CFAD9Y2B.js → diagram-CBK3MWTC-DpRmTGlG.js} +1 -1
  254. package/editor-web/assets/{diagram-I5XIIV2D-DZJAn95A.js → diagram-I5XIIV2D-BTrs_AX8.js} +1 -1
  255. package/editor-web/assets/{diagram-ODIL2UCW-BcIeYTaY.js → diagram-ODIL2UCW-CkIVjPqH.js} +1 -1
  256. package/editor-web/assets/{diagram-PFBEJUXE-CnZmh_fl.js → diagram-PFBEJUXE-BlFMbAG1.js} +1 -1
  257. package/editor-web/assets/{diagram-RJA3I4VV-DpDd9rGx.js → diagram-RJA3I4VV-D3f8VJ-D.js} +1 -1
  258. package/editor-web/assets/{diagram-TYUNFSNR-ouGiUQcR.js → diagram-TYUNFSNR-Bbpngj6F.js} +1 -1
  259. package/editor-web/assets/{dist-DGKjn59H.js → dist-3iovns9K.js} +1 -1
  260. package/editor-web/assets/dist-BkHnbOEj.js +4 -0
  261. package/editor-web/assets/dist-BvOrNcK-.js +19 -0
  262. package/editor-web/assets/dist-CEIszq39.js +1 -0
  263. package/editor-web/assets/{dist-BI8QjOsV.js → dist-CU5RbLNH.js} +1 -1
  264. package/editor-web/assets/dist-CWZj8IAm.js +1 -0
  265. package/editor-web/assets/{dist-NQNQ5HqZ.js → dist-C_Mtrnif.js} +3 -3
  266. package/editor-web/assets/{dist-BajH5QfK.js → dist-CdqpwdCV.js} +4 -4
  267. package/editor-web/assets/{dist-SV0sOVIC.js → dist-CjT76RAw.js} +1 -1
  268. package/editor-web/assets/{dist-elglzHMT.js → dist-CpzEn9T8.js} +1 -1
  269. package/editor-web/assets/dist-CrFYWl5-.js +3 -0
  270. package/editor-web/assets/{dist-hHcrvNn9.js → dist-D4eBFGVL.js} +1 -1
  271. package/editor-web/assets/dist-DTcjb3cP.js +18 -0
  272. package/editor-web/assets/dist-D_WSM29I.js +17 -0
  273. package/editor-web/assets/{dist-Y_XZZa8q.js → dist-Dp_9ISjP.js} +10 -10
  274. package/editor-web/assets/{dist-BBshIz1Q.js → dist-J-tPYKGS.js} +4 -4
  275. package/editor-web/assets/{docx-draw-C4aiB8HI.js → docx-draw-CoK1oqQD.js} +1 -1
  276. package/editor-web/assets/{ebnfDiagram-V4P3TTPT-HRjVlbUf.js → ebnfDiagram-V4P3TTPT-BaKj-yL6.js} +1 -1
  277. package/editor-web/assets/{elk-QONTBCTQ-BFmtKyOf.js → elk-QONTBCTQ-Cn2qv1_U.js} +1 -1
  278. package/editor-web/assets/{erDiagram-KYQIGQAA-C9gcGEgK.js → erDiagram-KYQIGQAA-Bd7AEIDo.js} +1 -1
  279. package/editor-web/assets/{esm-DzxAod8Q.js → esm-Cjv8ogpP.js} +1 -1
  280. package/editor-web/assets/{eventmodeling-K75KTNOO-Bpma5Bdb.js → eventmodeling-K75KTNOO-Sfp7_461.js} +1 -1
  281. package/editor-web/assets/flowDiagram-IUGLLWBU-BlVUglzw.js +1 -0
  282. package/editor-web/assets/{ganttDiagram-R7GPNTJY-CE5ut4C3.js → ganttDiagram-R7GPNTJY-CBqcGdHI.js} +1 -1
  283. package/editor-web/assets/{gitGraph-VSP46ZUC-Dva3iGx2.js → gitGraph-VSP46ZUC-WTokXKTW.js} +1 -1
  284. package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-CJXFsAWp.js → gitGraphDiagram-PDYL7XHY-BIWZHD9q.js} +1 -1
  285. package/editor-web/assets/index-BQWZnyAQ.js +28 -0
  286. package/editor-web/assets/{info-OHQRW6UA-BY0AOfex.js → info-OHQRW6UA-COC6G-_J.js} +1 -1
  287. package/editor-web/assets/{infoDiagram-MVDRKAX5-4Up1gMvC.js → infoDiagram-MVDRKAX5-DpaqdKBD.js} +1 -1
  288. package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-BkvB9Qbn.js → ishikawaDiagram-HPEHV2GE-Dyn2MAy1.js} +1 -1
  289. package/editor-web/assets/{iso-ahTwmFwH.js → iso-DoC-ZoBr.js} +1 -1
  290. package/editor-web/assets/{journeyDiagram-BOSHW7O7-BxV09WdR.js → journeyDiagram-BOSHW7O7-DeSVfmm7.js} +1 -1
  291. package/editor-web/assets/{kanban-definition-FNSA4HC5-zTJtIDPG.js → kanban-definition-FNSA4HC5-Bfg0lj7B.js} +1 -1
  292. package/editor-web/assets/{mermaid-parser.core-BWT9UQh_.js → mermaid-parser.core-CyhovuYE.js} +3 -3
  293. package/editor-web/assets/{mermaid.core-DFf_Vg5X.js → mermaid.core-Dx1fBVUG.js} +4 -4
  294. package/editor-web/assets/{mindmap-definition-6OY57UG3-BYexiugS.js → mindmap-definition-6OY57UG3-QEU2HF_m.js} +1 -1
  295. package/editor-web/assets/{packet-JDAUHWVQ-DX_kSrI6.js → packet-JDAUHWVQ-ReJTa_hw.js} +1 -1
  296. package/editor-web/assets/{pegDiagram-ECIUJNBX-I3SrcMLp.js → pegDiagram-ECIUJNBX-Bo1jFrvb.js} +1 -1
  297. package/editor-web/assets/{pie-XZMESJXO-BmAFSw3E.js → pie-XZMESJXO-BrtYafNA.js} +1 -1
  298. package/editor-web/assets/{pieDiagram-GNMPY74T-DIZKcme5.js → pieDiagram-GNMPY74T-Cj0zQqs_.js} +1 -1
  299. package/editor-web/assets/{props-form-DUFxM5eb.js → props-form-BpSXbrSF.js} +1 -1
  300. package/editor-web/assets/{quadrantDiagram-D57K4MC3-CO3oSqpQ.js → quadrantDiagram-D57K4MC3-D5npDAVn.js} +1 -1
  301. package/editor-web/assets/{radar-ABXABTNO-D5CkFrrb.js → radar-ABXABTNO-C8RDrRqi.js} +1 -1
  302. package/editor-web/assets/{railroad-I3PHUGI6-BeKY1p0K.js → railroad-I3PHUGI6-ebDrmYTK.js} +1 -1
  303. package/editor-web/assets/{railroad-abnf-LNEFI6M7-CIYV9_3-.js → railroad-abnf-LNEFI6M7-BxKuqg6V.js} +1 -1
  304. package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-DN0zDl6d.js → railroad-ebnf-DWYD2UWJ-DOclnfpr.js} +1 -1
  305. package/editor-web/assets/{railroad-peg-JR7BVNR7-Bd_GcO24.js → railroad-peg-JR7BVNR7-DN0A1fpq.js} +1 -1
  306. package/editor-web/assets/{railroadDiagram-Y72NRBL7-DlFoiMhb.js → railroadDiagram-Y72NRBL7-B3PjoVWw.js} +1 -1
  307. package/editor-web/assets/{requirementDiagram-EQYSW5RA-LWAEz8Gy.js → requirementDiagram-EQYSW5RA-DLdzkQk5.js} +1 -1
  308. package/editor-web/assets/{sankeyDiagram-SY24JHO5-B_pZGwUK.js → sankeyDiagram-SY24JHO5-Dip4Piv_.js} +1 -1
  309. package/editor-web/assets/schemas-CQ_UU8-Z.js +1 -0
  310. package/editor-web/assets/{sequenceDiagram-BLEHNHQU-bNhyCq0C.js → sequenceDiagram-BLEHNHQU-QnPcoybL.js} +1 -1
  311. package/editor-web/assets/{session-Beijw9EK.js → session-DMlLCFWg.js} +1 -1
  312. package/editor-web/assets/slides-7xWhREpt.js +1 -0
  313. package/editor-web/assets/snapshots-BLX4NTQC.js +1 -0
  314. package/editor-web/assets/{split-zARio3J8.js → split-tFGKk-x8.js} +1 -1
  315. package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-DI-oM3qz.js → stateDiagram-v2-A6IESKWZ-D103CiMX.js} +1 -1
  316. package/editor-web/assets/{swimlanes-B3ENRKFQ-awDmoLdW.js → swimlanes-B3ENRKFQ-y4gCqEoa.js} +1 -1
  317. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-DKzB_wSf.js +8 -0
  318. package/editor-web/assets/{tabs-BHBvbekZ.js → tabs-CuEawka3.js} +1 -1
  319. package/editor-web/assets/{timeline-definition-JXYKGLGB-CayduPvL.js → timeline-definition-JXYKGLGB-BMp76v4V.js} +1 -1
  320. package/editor-web/assets/{treeView-D4JQ5SDB-BVEuNzCO.js → treeView-D4JQ5SDB-Q_GYyk0b.js} +1 -1
  321. package/editor-web/assets/{treemap-SAJKECNS-BOB14HP3.js → treemap-SAJKECNS-B5lRWdQB.js} +1 -1
  322. package/editor-web/assets/{usecaseDiagram-WPOLBNNX-DxT99uaq.js → usecaseDiagram-WPOLBNNX--QRllA-U.js} +1 -1
  323. package/editor-web/assets/{vennDiagram-Q3Y3IDCW-CWUKom-r.js → vennDiagram-Q3Y3IDCW-CzkATPA3.js} +1 -1
  324. package/editor-web/assets/{video-oJ3qa1Qv.js → video-D0uTbHWx.js} +1 -1
  325. package/editor-web/assets/{wardley-7MLQ67FV-BAQyTneD.js → wardley-7MLQ67FV-BXzwcdJa.js} +1 -1
  326. package/editor-web/assets/{wardleyDiagram-IVAIDKWA-CiIYz4lZ.js → wardleyDiagram-IVAIDKWA-BQvC8Agx.js} +1 -1
  327. package/editor-web/assets/{words-0Ww2RyT4.js → words-CaUHhQHf.js} +1 -1
  328. package/editor-web/assets/workbook-CiCXkjmN.js +45 -0
  329. package/editor-web/assets/{xychartDiagram-4URNHDU4-D_D5IGmd.js → xychartDiagram-4URNHDU4-aY-lsD5o.js} +1 -1
  330. package/editor-web/index.html +3 -3
  331. package/package.json +2 -2
  332. package/dist/node_modules/@allyhub/browser/dist/browser.d.ts +0 -24
  333. package/dist/node_modules/@allyhub/browser/dist/capture.d.ts +0 -61
  334. package/dist/node_modules/@allyhub/browser/dist/cdp.d.ts +0 -51
  335. package/dist/node_modules/@allyhub/browser/dist/emoji.d.ts +0 -29
  336. package/dist/node_modules/@allyhub/browser/dist/flags.d.ts +0 -13
  337. package/dist/node_modules/@allyhub/browser/dist/frames.d.ts +0 -35
  338. package/dist/node_modules/@allyhub/browser/dist/html.d.ts +0 -19
  339. package/dist/node_modules/@allyhub/browser/dist/index.d.ts +0 -10
  340. package/dist/node_modules/@allyhub/browser/dist/launch.d.ts +0 -35
  341. package/dist/node_modules/@allyhub/browser/dist/page.d.ts +0 -74
  342. package/dist/node_modules/@allyhub/browser/dist/picture.d.ts +0 -18
  343. package/dist/node_modules/@allyhub/browser/dist/server.d.ts +0 -26
  344. package/dist/node_modules/@allyhub/build/dist/build-plugins.d.ts +0 -91
  345. package/dist/node_modules/@allyhub/build/dist/cli-command.d.ts +0 -84
  346. package/dist/node_modules/@allyhub/build/dist/code.d.ts +0 -26
  347. package/dist/node_modules/@allyhub/build/dist/content.d.ts +0 -64
  348. package/dist/node_modules/@allyhub/build/dist/data.d.ts +0 -11
  349. package/dist/node_modules/@allyhub/build/dist/evaluate.d.ts +0 -44
  350. package/dist/node_modules/@allyhub/build/dist/file-check.d.ts +0 -35
  351. package/dist/node_modules/@allyhub/build/dist/files.d.ts +0 -4
  352. package/dist/node_modules/@allyhub/build/dist/fonts.d.ts +0 -26
  353. package/dist/node_modules/@allyhub/build/dist/generated.d.ts +0 -29
  354. package/dist/node_modules/@allyhub/build/dist/imports.d.ts +0 -17
  355. package/dist/node_modules/@allyhub/build/dist/index.d.ts +0 -37
  356. package/dist/node_modules/@allyhub/build/dist/inspect-view.d.ts +0 -119
  357. package/dist/node_modules/@allyhub/build/dist/kind-build.d.ts +0 -530
  358. package/dist/node_modules/@allyhub/build/dist/made-notes.d.ts +0 -9
  359. package/dist/node_modules/@allyhub/build/dist/matrix.d.ts +0 -19
  360. package/dist/node_modules/@allyhub/build/dist/media.d.ts +0 -10
  361. package/dist/node_modules/@allyhub/build/dist/messages.d.ts +0 -60
  362. package/dist/node_modules/@allyhub/build/dist/meta-worker.d.ts +0 -59
  363. package/dist/node_modules/@allyhub/build/dist/meta.d.ts +0 -24
  364. package/dist/node_modules/@allyhub/build/dist/model-info.d.ts +0 -6
  365. package/dist/node_modules/@allyhub/build/dist/move-refs.d.ts +0 -16
  366. package/dist/node_modules/@allyhub/build/dist/places.d.ts +0 -23
  367. package/dist/node_modules/@allyhub/build/dist/plugin.d.ts +0 -50
  368. package/dist/node_modules/@allyhub/build/dist/prepare.d.ts +0 -138
  369. package/dist/node_modules/@allyhub/build/dist/project-root.d.ts +0 -19
  370. package/dist/node_modules/@allyhub/build/dist/project-tool.d.ts +0 -136
  371. package/dist/node_modules/@allyhub/build/dist/references.d.ts +0 -6
  372. package/dist/node_modules/@allyhub/build/dist/scan.d.ts +0 -45
  373. package/dist/node_modules/@allyhub/build/dist/stage-route.d.ts +0 -80
  374. package/dist/node_modules/@allyhub/build/dist/takes.d.ts +0 -9
  375. package/dist/node_modules/@allyhub/build/dist/types.d.ts +0 -11
  376. package/dist/node_modules/@allyhub/build/dist/uses.d.ts +0 -44
  377. package/dist/node_modules/@allyhub/build/dist/version.d.ts +0 -56
  378. package/dist/node_modules/@allyhub/build/dist/vite.d.ts +0 -115
  379. package/dist/node_modules/@allyhub/build/dist/work.d.ts +0 -38
  380. package/dist/node_modules/@allyhub/cloud/dist/blobs.d.ts +0 -48
  381. package/dist/node_modules/@allyhub/cloud/dist/call.d.ts +0 -91
  382. package/dist/node_modules/@allyhub/cloud/dist/catalog.d.ts +0 -12
  383. package/dist/node_modules/@allyhub/cloud/dist/client.d.ts +0 -64
  384. package/dist/node_modules/@allyhub/cloud/dist/config.d.ts +0 -40
  385. package/dist/node_modules/@allyhub/cloud/dist/credentials.d.ts +0 -76
  386. package/dist/node_modules/@allyhub/cloud/dist/device.d.ts +0 -14
  387. package/dist/node_modules/@allyhub/cloud/dist/errors.d.ts +0 -24
  388. package/dist/node_modules/@allyhub/cloud/dist/hashes.d.ts +0 -43
  389. package/dist/node_modules/@allyhub/cloud/dist/index.d.ts +0 -19
  390. package/dist/node_modules/@allyhub/cloud/dist/keychain.d.ts +0 -18
  391. package/dist/node_modules/@allyhub/cloud/dist/loopback.d.ts +0 -22
  392. package/dist/node_modules/@allyhub/cloud/dist/mail.d.ts +0 -16
  393. package/dist/node_modules/@allyhub/cloud/dist/pkce.d.ts +0 -11
  394. package/dist/node_modules/@allyhub/cloud/dist/records.d.ts +0 -42
  395. package/dist/node_modules/@allyhub/cloud/dist/signin-worker.d.ts +0 -2
  396. package/dist/node_modules/@allyhub/cloud/dist/signin.d.ts +0 -48
  397. package/dist/node_modules/@allyhub/cloud/dist/sites.d.ts +0 -20
  398. package/dist/node_modules/@allyhub/cloud/dist/token.d.ts +0 -20
  399. package/dist/node_modules/@allyhub/cloud/dist/uploads.d.ts +0 -58
  400. package/dist/node_modules/@allyhub/cloud/dist/voice.d.ts +0 -22
  401. package/dist/node_modules/@allyhub/jobs/dist/index.d.ts +0 -3
  402. package/dist/node_modules/@allyhub/jobs/dist/jobs.d.ts +0 -139
  403. package/dist/node_modules/@allyhub/jobs/dist/show.d.ts +0 -41
  404. package/dist/node_modules/@allyhub/measure/dist/compare.d.ts +0 -195
  405. package/dist/node_modules/@allyhub/measure/dist/grain.d.ts +0 -8
  406. package/dist/node_modules/@allyhub/measure/dist/image.d.ts +0 -16
  407. package/dist/node_modules/@allyhub/measure/dist/index.d.ts +0 -4
  408. package/dist/node_modules/@allyhub/media/dist/analysis.d.ts +0 -25
  409. package/dist/node_modules/@allyhub/media/dist/audio.d.ts +0 -16
  410. package/dist/node_modules/@allyhub/media/dist/beats.d.ts +0 -100
  411. package/dist/node_modules/@allyhub/media/dist/cache.d.ts +0 -26
  412. package/dist/node_modules/@allyhub/media/dist/errors.d.ts +0 -34
  413. package/dist/node_modules/@allyhub/media/dist/fetch.d.ts +0 -11
  414. package/dist/node_modules/@allyhub/media/dist/grid.d.ts +0 -101
  415. package/dist/node_modules/@allyhub/media/dist/index.d.ts +0 -21
  416. package/dist/node_modules/@allyhub/media/dist/picture.d.ts +0 -130
  417. package/dist/node_modules/@allyhub/media/dist/probe.d.ts +0 -52
  418. package/dist/node_modules/@allyhub/media/dist/progress.d.ts +0 -16
  419. package/dist/node_modules/@allyhub/media/dist/run.d.ts +0 -25
  420. package/dist/node_modules/@allyhub/media/dist/sheet.d.ts +0 -67
  421. package/dist/node_modules/@allyhub/media/dist/shots.d.ts +0 -110
  422. package/dist/node_modules/@allyhub/media/dist/sync.d.ts +0 -156
  423. package/dist/node_modules/@allyhub/media/dist/tools.d.ts +0 -25
  424. package/dist/node_modules/@allyhub/media/dist/video.d.ts +0 -35
  425. package/dist/node_modules/@allyhub/media/dist/vision/cache.d.ts +0 -42
  426. package/dist/node_modules/@allyhub/media/dist/vision/probe.d.ts +0 -39
  427. package/dist/node_modules/@allyhub/media/dist/vision/types.d.ts +0 -2
  428. package/dist/node_modules/@allyhub/media/dist/voice-shape.d.ts +0 -51
  429. package/dist/node_modules/@allyhub/model/dist/authoring.d.ts +0 -48
  430. package/dist/node_modules/@allyhub/model/dist/bevel-attributes.d.ts +0 -19
  431. package/dist/node_modules/@allyhub/model/dist/bevel-collapse.d.ts +0 -12
  432. package/dist/node_modules/@allyhub/model/dist/bevel-corner-plan.d.ts +0 -24
  433. package/dist/node_modules/@allyhub/model/dist/bevel-deform.d.ts +0 -5
  434. package/dist/node_modules/@allyhub/model/dist/bevel-fans.d.ts +0 -12
  435. package/dist/node_modules/@allyhub/model/dist/bevel-junction.d.ts +0 -16
  436. package/dist/node_modules/@allyhub/model/dist/bevel-marks.d.ts +0 -14
  437. package/dist/node_modules/@allyhub/model/dist/bevel-metric.d.ts +0 -4
  438. package/dist/node_modules/@allyhub/model/dist/bevel-mixed.d.ts +0 -12
  439. package/dist/node_modules/@allyhub/model/dist/bevel-offsets.d.ts +0 -22
  440. package/dist/node_modules/@allyhub/model/dist/bevel-patch.d.ts +0 -45
  441. package/dist/node_modules/@allyhub/model/dist/bevel-profile.d.ts +0 -13
  442. package/dist/node_modules/@allyhub/model/dist/bevel-projection.d.ts +0 -10
  443. package/dist/node_modules/@allyhub/model/dist/bevel-reflex.d.ts +0 -10
  444. package/dist/node_modules/@allyhub/model/dist/bevel-square-out.d.ts +0 -18
  445. package/dist/node_modules/@allyhub/model/dist/bevel-strips.d.ts +0 -8
  446. package/dist/node_modules/@allyhub/model/dist/bmesh-cycles.d.ts +0 -52
  447. package/dist/node_modules/@allyhub/model/dist/build-cache.d.ts +0 -42
  448. package/dist/node_modules/@allyhub/model/dist/build-job.d.ts +0 -34
  449. package/dist/node_modules/@allyhub/model/dist/build-worker.d.ts +0 -2
  450. package/dist/node_modules/@allyhub/model/dist/build.d.ts +0 -67
  451. package/dist/node_modules/@allyhub/model/dist/cancel.d.ts +0 -8
  452. package/dist/node_modules/@allyhub/model/dist/curve-math.d.ts +0 -21
  453. package/dist/node_modules/@allyhub/model/dist/curve-mesh.d.ts +0 -30
  454. package/dist/node_modules/@allyhub/model/dist/evaluation-guard.d.ts +0 -11
  455. package/dist/node_modules/@allyhub/model/dist/export.d.ts +0 -12
  456. package/dist/node_modules/@allyhub/model/dist/mesh-queries.d.ts +0 -34
  457. package/dist/node_modules/@allyhub/model/dist/names.d.ts +0 -9
  458. package/dist/node_modules/@allyhub/model/dist/png.d.ts +0 -12
  459. package/dist/node_modules/@allyhub/model/dist/polygon-triangulation.d.ts +0 -4
  460. package/dist/node_modules/@allyhub/model/dist/program-location.d.ts +0 -7
  461. package/dist/node_modules/@allyhub/model/dist/report.d.ts +0 -70
  462. package/dist/node_modules/@allyhub/piece/dist/page/console.d.ts +0 -21
  463. package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +0 -4
  464. package/dist/node_modules/@allyhub/piece/dist/page/locate.d.ts +0 -17
  465. package/dist/node_modules/@allyhub/piece/dist/page/runtimes.d.ts +0 -9
  466. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +0 -661
  467. package/dist/node_modules/@allyhub/protocol/dist/account.js +0 -2
  468. package/dist/node_modules/@allyhub/protocol/dist/app.d.ts +0 -30
  469. package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +0 -200
  470. package/dist/node_modules/@allyhub/protocol/dist/blobs.d.ts +0 -44
  471. package/dist/node_modules/@allyhub/protocol/dist/cli.d.ts +0 -68
  472. package/dist/node_modules/@allyhub/protocol/dist/cloud-computer.d.ts +0 -77
  473. package/dist/node_modules/@allyhub/protocol/dist/cloud-computer.js +0 -2
  474. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +0 -577
  475. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +0 -674
  476. package/dist/node_modules/@allyhub/protocol/dist/errors.d.ts +0 -7
  477. package/dist/node_modules/@allyhub/protocol/dist/events.d.ts +0 -803
  478. package/dist/node_modules/@allyhub/protocol/dist/files.d.ts +0 -103
  479. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +0 -247
  480. package/dist/node_modules/@allyhub/protocol/dist/image.d.ts +0 -8
  481. package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +0 -38
  482. package/dist/node_modules/@allyhub/protocol/dist/jobs.d.ts +0 -91
  483. package/dist/node_modules/@allyhub/protocol/dist/jsonrpc.d.ts +0 -83
  484. package/dist/node_modules/@allyhub/protocol/dist/kinds.d.ts +0 -144
  485. package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +0 -274
  486. package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +0 -211
  487. package/dist/node_modules/@allyhub/protocol/dist/open.d.ts +0 -13
  488. package/dist/node_modules/@allyhub/protocol/dist/paywall.d.ts +0 -134
  489. package/dist/node_modules/@allyhub/protocol/dist/peer.d.ts +0 -59
  490. package/dist/node_modules/@allyhub/protocol/dist/peer.js +0 -2
  491. package/dist/node_modules/@allyhub/protocol/dist/place.d.ts +0 -21
  492. package/dist/node_modules/@allyhub/protocol/dist/presence.d.ts +0 -125
  493. package/dist/node_modules/@allyhub/protocol/dist/purposes.d.ts +0 -47
  494. package/dist/node_modules/@allyhub/protocol/dist/registry.d.ts +0 -191
  495. package/dist/node_modules/@allyhub/protocol/dist/routes.d.ts +0 -14
  496. package/dist/node_modules/@allyhub/protocol/dist/routes.js +0 -2
  497. package/dist/node_modules/@allyhub/protocol/dist/runtimes.d.ts +0 -96
  498. package/dist/node_modules/@allyhub/protocol/dist/shape.d.ts +0 -35
  499. package/dist/node_modules/@allyhub/protocol/dist/shape.js +0 -2
  500. package/dist/node_modules/@allyhub/protocol/dist/shares.d.ts +0 -156
  501. package/dist/node_modules/@allyhub/protocol/dist/shares.js +0 -2
  502. package/dist/node_modules/@allyhub/protocol/dist/sidebar-deletion.d.ts +0 -34
  503. package/dist/node_modules/@allyhub/protocol/dist/sidebar-deletion.js +0 -2
  504. package/dist/node_modules/@allyhub/protocol/dist/sites.d.ts +0 -298
  505. package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +0 -503
  506. package/dist/node_modules/@allyhub/protocol/dist/sources.d.ts +0 -14
  507. package/dist/node_modules/@allyhub/protocol/dist/studio-server.d.ts +0 -264
  508. package/dist/node_modules/@allyhub/protocol/dist/studio-server.js +0 -2
  509. package/dist/node_modules/@allyhub/protocol/dist/studio-tool-calls.d.ts +0 -18
  510. package/dist/node_modules/@allyhub/protocol/dist/studio-tool-calls.js +0 -2
  511. package/dist/node_modules/@allyhub/protocol/dist/studio-window-requests.d.ts +0 -97
  512. package/dist/node_modules/@allyhub/protocol/dist/studio-window-requests.js +0 -2
  513. package/dist/node_modules/@allyhub/protocol/dist/teams.d.ts +0 -196
  514. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +0 -578
  515. package/dist/node_modules/@allyhub/protocol/dist/turns.d.ts +0 -71
  516. package/dist/node_modules/@allyhub/protocol/dist/turns.js +0 -2
  517. package/dist/node_modules/@allyhub/runtimes/dist/bundled.d.ts +0 -10
  518. package/dist/node_modules/@allyhub/runtimes/dist/declared.d.ts +0 -14
  519. package/dist/node_modules/@allyhub/runtimes/dist/download.d.ts +0 -38
  520. package/dist/node_modules/@allyhub/runtimes/dist/errors.d.ts +0 -20
  521. package/dist/node_modules/@allyhub/runtimes/dist/ffmpeg.d.ts +0 -15
  522. package/dist/node_modules/@allyhub/runtimes/dist/home.d.ts +0 -2
  523. package/dist/node_modules/@allyhub/runtimes/dist/index.d.ts +0 -12
  524. package/dist/node_modules/@allyhub/runtimes/dist/lock.d.ts +0 -14
  525. package/dist/node_modules/@allyhub/runtimes/dist/manifest.d.ts +0 -3
  526. package/dist/node_modules/@allyhub/runtimes/dist/node-program.d.ts +0 -12
  527. package/dist/node_modules/@allyhub/runtimes/dist/packages.d.ts +0 -101
  528. package/dist/node_modules/@allyhub/runtimes/dist/runtimes.d.ts +0 -73
  529. package/dist/node_modules/@allyhub/runtimes/dist/unpack.d.ts +0 -14
  530. package/dist/node_modules/@allyhub/scenery-host/dist/allyhub.d.ts +0 -20
  531. package/dist/node_modules/@allyhub/scenery-host/dist/bake/digest.d.ts +0 -14
  532. package/dist/node_modules/@allyhub/scenery-host/dist/bake/envmap.d.ts +0 -21
  533. package/dist/node_modules/@allyhub/scenery-host/dist/bake/run.d.ts +0 -63
  534. package/dist/node_modules/@allyhub/scenery-host/dist/budget.d.ts +0 -40
  535. package/dist/node_modules/@allyhub/scenery-host/dist/bundle.d.ts +0 -92
  536. package/dist/node_modules/@allyhub/scenery-host/dist/commands.d.ts +0 -54
  537. package/dist/node_modules/@allyhub/scenery-host/dist/draw2d.d.ts +0 -47
  538. package/dist/node_modules/@allyhub/scenery-host/dist/glass.d.ts +0 -39
  539. package/dist/node_modules/@allyhub/scenery-host/dist/index.d.ts +0 -25
  540. package/dist/node_modules/@allyhub/scenery-host/dist/inventory.d.ts +0 -18
  541. package/dist/node_modules/@allyhub/scenery-host/dist/layer/fidelity.d.ts +0 -70
  542. package/dist/node_modules/@allyhub/scenery-host/dist/layer/grade.d.ts +0 -7
  543. package/dist/node_modules/@allyhub/scenery-host/dist/layer/moire.d.ts +0 -6
  544. package/dist/node_modules/@allyhub/scenery-host/dist/measure/contacts.d.ts +0 -45
  545. package/dist/node_modules/@allyhub/scenery-host/dist/measure/health.d.ts +0 -10
  546. package/dist/node_modules/@allyhub/scenery-host/dist/measure/index.d.ts +0 -110
  547. package/dist/node_modules/@allyhub/scenery-host/dist/measure/relations.d.ts +0 -17
  548. package/dist/node_modules/@allyhub/scenery-host/dist/measure/solid.d.ts +0 -32
  549. package/dist/node_modules/@allyhub/scenery-host/dist/measure/support.d.ts +0 -11
  550. package/dist/node_modules/@allyhub/scenery-host/dist/model-stage.d.ts +0 -32
  551. package/dist/node_modules/@allyhub/scenery-host/dist/queries/inventory.d.ts +0 -5
  552. package/dist/node_modules/@allyhub/scenery-host/dist/queries/map.d.ts +0 -5
  553. package/dist/node_modules/@allyhub/scenery-host/dist/queries/view.d.ts +0 -10
  554. package/dist/node_modules/@allyhub/scenery-host/dist/scene.d.ts +0 -35
  555. package/dist/node_modules/@allyhub/scenery-host/dist/screen-dom.d.ts +0 -24
  556. package/dist/node_modules/@allyhub/scenery-host/dist/stage/bakes.d.ts +0 -42
  557. package/dist/node_modules/@allyhub/scenery-host/dist/stage/index.d.ts +0 -6
  558. package/dist/node_modules/@allyhub/scenery-host/dist/stage/page.d.ts +0 -70
  559. package/dist/node_modules/@allyhub/scenery-host/dist/stage/solve.d.ts +0 -49
  560. package/dist/node_modules/@allyhub/scenery-host/dist/stage/version.d.ts +0 -73
  561. package/dist/node_modules/@allyhub/scenery-host/dist/stage/view.d.ts +0 -18
  562. package/dist/node_modules/@allyhub/scenery-host/dist/steady.d.ts +0 -4
  563. package/dist/node_modules/@allyhub/scenery-host/dist/viewer.d.ts +0 -134
  564. package/editor-web/assets/channel-HUlo15J7.js +0 -1
  565. package/editor-web/assets/deck-CtEtDHo2.js +0 -1
  566. package/editor-web/assets/dist-Bl74xqMW.js +0 -19
  567. package/editor-web/assets/dist-BrUtQth3.js +0 -18
  568. package/editor-web/assets/dist-CN5A7Au2.js +0 -1
  569. package/editor-web/assets/dist-CcL6r6l3.js +0 -1
  570. package/editor-web/assets/dist-D2E3cgRP.js +0 -4
  571. package/editor-web/assets/dist-ZrBAbqyJ.js +0 -3
  572. package/editor-web/assets/dist-d4dayaWE.js +0 -17
  573. package/editor-web/assets/flowDiagram-IUGLLWBU-tz5ewhC5.js +0 -1
  574. package/editor-web/assets/index-q7X6hdHp.js +0 -28
  575. package/editor-web/assets/schemas-moE_A7Nj.js +0 -1
  576. package/editor-web/assets/slides-oQ_C0SVJ.js +0 -1
  577. package/editor-web/assets/snapshots-Dd0Wd_qM.js +0 -1
  578. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-X35m3xN6.js +0 -8
  579. package/editor-web/assets/workbook-DznVDqoE.js +0 -45
  580. /package/dist/node_modules/@allyhub/{protocol/dist/runtimes.js → runtimes/dist/schema.js} +0 -0
package/dist/fields.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import"zod";import{PROJECT_DIR as e}from"@allyhub/build";export const indexing=t=>t.ALLYHUB_NO_INDEX!=="1",dir=e,GLOBAL={dir},isGlobal=t=>Object.values(GLOBAL).includes(t),hidden=t=>t.meta({hidden:!0}),isHidden=t=>t.meta()?.hidden===!0;
2
+ import"zod";import{PROJECT_DIR as e}from"@allyhub/build/inspect-view";export const indexing=t=>t.ALLYHUB_NO_INDEX!=="1",dir=e,GLOBAL={dir},isGlobal=t=>Object.values(GLOBAL).includes(t),hidden=t=>t.meta({hidden:!0}),isHidden=t=>t.meta()?.hidden===!0;
package/dist/main.js CHANGED
@@ -1,9 +1,9 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{mkdir as Y,writeFile as V}from"node:fs/promises";import{tmpdir as X}from"node:os";import{dirname as q,join as T}from"node:path";import"@allyhub/stage-runtime/use";import{EXIT as l,PROBLEMS_FOUND as z,describeCommand as D}from"@allyhub/protocol";import{WORK_DIR as Q}from"@allyhub/formats";import{projectAt as Z}from"./project.js";import{cutLong as tt}from"./text/index.js";import{readArgs as et}from"./args.js";import{CLI_VERSION as I}from"./cli-version.js";import{CommandError as x}from"./command.js";import{COMMAND_SOURCES as H,COMMANDS as U,allCommands as nt}from"./commands/index.js";import{contributedSpecs as ot}from"./commands/contributed.js";import{builtInExtensions as rt}from"./commands/extensions.js";import{commandHelp as B,groupHelp as it,listHelp as st,workHelp as at}from"./help.js";import{sdkDocs as ct}from"./sdk-docs.js";import{cliTelemetry as lt}from"./telemetry.js";import{turnOf as dt}from"./turn.js";import{WORKS as mt,cloudNouns as ut,withJoined as J,workNamed as pt,workTitle as P}from"./works.js";const A={stdout:n=>process.stdout.write(n),stderr:n=>process.stderr.write(n),cwd:process.cwd(),env:process.env};export function findCommand(n,i=U){let h;for(const d of i){const u=d.spec.name.split(" ");u.every((w,g)=>n[g]===w)&&u.length>(h?.length??0)&&(h={command:d,length:u.length})}return h?{command:h.command,rest:n.slice(h.length)}:{rest:[...n]}}export async function resolveCommand(n,i,h=U,d=H){const u=findCommand(n,h);if(u.command){const w=u.command.spec.name;if(u.rest.length>0)for(const g of d.filter(o=>o.under===w)){const o=await g.resolve(n,i);if(o)return o}return u}for(const w of d){const g=await w.resolve(n,i);if(g)return g}return u}const F=n=>({...D(n.spec),...n.about?.value});export async function main(n,i=A,h,d=H,u){rt();const w=h??await nt(),g=n.includes("--json"),o=n.filter(t=>t!=="--json"),b=async(t,e,$)=>{if(g){i.stdout(`${JSON.stringify(t,null,2)}
3
- `);return}const k=await Z(i.cwd),s=T(k===void 0?T(X(),"allyhub"):T(k,Q),"out",`${$.replaceAll(" ","-")}.txt`),f=tt(e,s);f!==void 0&&(await Y(q(s),{recursive:!0}),await V(s,`${e}
4
- `)),i.stdout(`${f??e}
5
- `)},N=w.map(t=>t.spec),S=t=>N.filter(e=>t.length>0&&e.name.startsWith(`${t.join(" ")} `)),O=new AbortController,y={cwd:i.cwd,env:{ALLYHUB_CLIENT:`AllyHub-CLI/${I}`,...i.env},progress:t=>{i.stderr(`${t}
6
- `)},signal:O.signal};if(o[0]==="--version"||o[0]==="-v")return await b({version:I},I,"version"),l.ok;if(o.length===0||o[0]==="help"||o[0]==="--help"||o[0]==="-h"){const t=o.slice(1).findIndex(r=>r.startsWith("-")),e=(t<0?o.slice(1):o.slice(1,t+1)).flatMap(r=>r.split(" ").filter(c=>c!=="")),$=await ct(i.cwd).catch(()=>{}),k=async()=>{const r=await Promise.all(d.map(c=>c.nouns(y).then(G=>G.map(K=>({...K,work:c.works!==!1}))).catch(()=>{})));return r.some(c=>c===void 0)?void 0:r.flatMap(c=>c??[])},s=await ot(y);if(e.length===0){const r=await k();return await b({version:I,docs:$?.dir,works:mt.map(c=>({...J(c,s),title:P(c,r)})),commands:N.map(D),made:[...d.flatMap(c=>c.entries),...r??[]]},st(N,d,r,$?.dir),"help"),l.ok}const f=e.length===1?pt(e[0]??""):void 0,m=f&&J(f,s);if(m){const r=m.cloud===void 0?[]:await k();return await b({...m,title:P(m,r),...m.cloud===void 0?{}:{cloudWorks:r&&ut(m,r)},docsDir:$?.dir},at(m,N,d,$?.dir,r,s),`help ${e.join(" ")}`),l.ok}let C;try{C=await resolveCommand(e,y,w,d)}catch(r){return j(r)}const{command:a,rest:p}=C;if(a&&C.list===!0)return await R(a,p);const L=S(e);return!a&&L.length>0?(await b({commands:L.map(D)},it(e.join(" "),L),`help ${e.join(" ")}`),l.ok):!a||p.length>0?j(new x("unknown-command",`allyhub has no command "${e.join(" ")}".`,{exit:l.usage,hint:"allyhub help lists them and the works."})):(await b(F(a),B(a.spec,a.about?.lines,S(a.spec.name.split(" "))),`help ${a.spec.name}`),l.ok)}let M;try{M=await resolveCommand(o,y,w,d)}catch(t){return j(t)}const{command:v,rest:E}=M;if(!v){const t=S(o.slice(0,1));return j(new x("unknown-command",`allyhub has no command "${o.join(" ")}".`,{exit:l.usage,hint:t.length>0?`${o[0]??""} has these: ${t.map(e=>e.name).join(", ")}.`:"allyhub help lists them."}))}if(E.includes("--help")||E.includes("-h"))return await b(F(v),B(v.spec,v.about?.lines,S(v.spec.name.split(" "))),`${v.spec.name} help`),l.ok;return await R(v,E);async function R(t,e){const $=()=>{O.abort(new x("interrupted","Stopped.",{exit:l.interrupted}))};process.once("SIGINT",$);const k=Date.now();let s=l.failed,f;const m=await dt(y.env,y.cwd),C=m===void 0?y:{...y,env:{...y.env,TRACEPARENT:m}};try{const a=et(t.spec,e),p=await t.run(a,C);await b(p.value,p.text,t.spec.name),s=p.exit??l.ok,s!==l.ok&&(f=p.code??z)}catch(a){const p=_(a);s=p.exit,f=p.code,W(p)}finally{process.off("SIGINT",$)}return await u?.({command:t.spec.name,ms:Date.now()-k,exit:s,...f===void 0?{}:{code:f},...m===void 0?{}:{traceparent:m}}),s}function j(t){const e=_(t);return W(e),e.exit}function _(t){return t instanceof x?t:O.signal.aborted?new x("interrupted","Stopped.",{exit:l.interrupted}):new x("failed",t instanceof Error?t.message:String(t))}function W(t){g?i.stdout(`${JSON.stringify({error:{code:t.code,message:t.message,...t.hint?{hint:t.hint}:{}}},null,2)}
7
- `):i.stderr(`${t.message}${t.hint?`
2
+ import{mkdir as J,writeFile as P}from"node:fs/promises";import{tmpdir as F}from"node:os";import{dirname as G,join as A}from"node:path";import"@allyhub/stage-runtime/use";import{EXIT as m,PROBLEMS_FOUND as K}from"@allyhub/protocol/cli";import{WORK_DIR as Y}from"@allyhub/formats/layout";import{projectAt as V}from"./project.js";import{cutLong as X}from"./text/long-text.js";import{readArgs as q}from"./args.js";import{CLI_VERSION as N}from"./cli-version.js";import{CommandError as I}from"./command.js";import{COMMAND_SOURCES as L}from"./commands/index.js";import{commandEntries as z,commandEntry as Q,entriesOf as Z,joinedCommands as tt}from"./commands/list.js";import{contributedSpecs as nt}from"./commands/contributed.js";import{groupHelp as et,listHelp as ot,workHelp as rt}from"./help.js";import{sdkDocs as it}from"./sdk-docs.js";import{cliTelemetry as at}from"./telemetry.js";import{turnOf as st}from"./turn.js";import{WORKS as ct,cloudNouns as dt,withJoined as _,workNamed as mt,workTitle as W}from"./works.js";const E={stdout:i=>process.stdout.write(i),stderr:i=>process.stderr.write(i),cwd:process.cwd(),env:process.env};export function findCommand(i,a){let f;for(const l of a){const y=l.name.split(" ");y.every((p,e)=>i[e]===p)&&y.length>(f?.length??0)&&(f={command:l,length:y.length})}return f?{command:f.command,rest:i.slice(f.length)}:{rest:[...i]}}export async function resolveCommand(i,a,f,l=L){const y=async e=>{const r=await e.resolve(i,a);return r&&{...r,command:Q(r.command,f)}},p=findCommand(i,f);if(p.command){const e=p.command.name;if(p.rest.length>0)for(const r of l.filter($=>$.under===e)){const $=await y(r);if($)return $}return p}for(const e of l){const r=await y(e);if(r)return r}return p}export async function main(i,a=E,f,l=L,y){const p=i.includes("--json"),e=i.filter(t=>t!=="--json"),r=async(t,n,g)=>{if(p){a.stdout(`${JSON.stringify(t,null,2)}
3
+ `);return}const b=await V(a.cwd),c=A(b===void 0?A(F(),"allyhub"):A(b,Y),"out",`${g.replaceAll(" ","-")}.txt`),h=X(n,c);h!==void 0&&(await J(G(c),{recursive:!0}),await P(c,`${n}
4
+ `)),a.stdout(`${h??n}
5
+ `)},$=new AbortController,w={cwd:a.cwd,env:{ALLYHUB_CLIENT:`AllyHub-CLI/${N}`,...a.env},progress:t=>{a.stderr(`${t}
6
+ `)},signal:$.signal};if(e[0]==="--version"||e[0]==="-v")return await r({version:N},N,"version"),m.ok;const x=f===void 0?await z():Z(f),T=t=>x.filter(n=>t.length>0&&n.name.startsWith(`${t.join(" ")} `));if(e.length===0||e[0]==="help"||e[0]==="--help"||e[0]==="-h"){const t=e.slice(1).findIndex(o=>o.startsWith("-")),n=(t<0?e.slice(1):e.slice(1,t+1)).flatMap(o=>o.split(" ").filter(s=>s!=="")),g=await it(a.cwd).catch(()=>{}),b=async()=>{const o=await Promise.all(l.map(s=>s.nouns(w).then(U=>U.map(B=>({...B,work:s.works!==!1}))).catch(()=>{})));return o.some(s=>s===void 0)?void 0:o.flatMap(s=>s??[])},c=await nt(w,await tt());if(n.length===0){const o=await b();return await r({version:N,docs:g?.dir,works:ct.map(s=>({..._(s,c),title:W(s,o)})),commands:x.map(s=>s.spec),made:[...l.flatMap(s=>s.entries),...o??[]]},ot(x,l,o,g?.dir),"help"),m.ok}const h=n.length===1?mt(n[0]??""):void 0,u=h&&_(h,c);if(u){const o=u.cloud===void 0?[]:await b();return await r({...u,title:W(u,o),...u.cloud===void 0?{}:{cloudWorks:o&&dt(u,o)},docsDir:g?.dir},rt(u,x,l,g?.dir,o,c),`help ${n.join(" ")}`),m.ok}let C;try{C=await resolveCommand(n,w,x,l)}catch(o){return S(o)}const{command:d,rest:k}=C;if(d&&C.list===!0)return await D(d,k);const v=T(n);return!d&&v.length>0?(await r({commands:v.map(o=>o.spec)},et(n.join(" "),v),`help ${n.join(" ")}`),m.ok):!d||k.length>0?S(new I("unknown-command",`allyhub has no command "${n.join(" ")}".`,{exit:m.usage,hint:"allyhub help lists them and the works."})):(await r(d.described,d.help,`help ${d.name}`),m.ok)}let R;try{R=await resolveCommand(e,w,x,l)}catch(t){return S(t)}const{command:j,rest:O}=R;if(!j){const t=T(e.slice(0,1));return S(new I("unknown-command",`allyhub has no command "${e.join(" ")}".`,{exit:m.usage,hint:t.length>0?`${e[0]??""} has these: ${t.map(n=>n.name).join(", ")}.`:"allyhub help lists them."}))}if(O.includes("--help")||O.includes("-h"))return await r(j.described,j.help,`${j.name} help`),m.ok;return await D(j,O);async function D(t,n){const g=()=>{$.abort(new I("interrupted","Stopped.",{exit:m.interrupted}))};process.once("SIGINT",g);const b=Date.now();let c=m.failed,h;const u=await st(w.env,w.cwd),C=u===void 0?w:{...w,env:{...w.env,TRACEPARENT:u}};try{const d=await t.command(),k=q(d.spec,n),v=await d.run(k,C);await r(v.value,v.text,d.spec.name),c=v.exit??m.ok,c!==m.ok&&(h=v.code??K)}catch(d){const k=H(d);c=k.exit,h=k.code,M(k)}finally{process.off("SIGINT",g)}return await y?.({command:t.name,ms:Date.now()-b,exit:c,...h===void 0?{}:{code:h},...u===void 0?{}:{traceparent:u}}),c}function S(t){const n=H(t);return M(n),n.exit}function H(t){return t instanceof I?t:$.signal.aborted?new I("interrupted","Stopped.",{exit:m.interrupted}):new I("failed",t instanceof Error?t.message:String(t))}function M(t){if(p){const n={error:{code:t.code,message:t.message,...t.hint?{hint:t.hint}:{}}};a.stdout(`${JSON.stringify(n,null,2)}
7
+ `)}else a.stderr(`${t.message}${t.hint?`
8
8
  ${t.hint}`:""}
9
- `)}}export function run(n){return main(n,A,void 0,H,lt({ALLYHUB_CLIENT:`AllyHub-CLI/${I}`,...A.env},i=>{A.stderr(i)}))}
9
+ `)}}export function run(i){return main(i,E,void 0,L,at({ALLYHUB_CLIENT:`AllyHub-CLI/${N}`,...E.env},a=>{E.stderr(a)}))}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{join as a}from"node:path";import{problem as u}from"@allyhub/diagnostics";import"@allyhub/build";import{CACHE_DIR as f}from"@allyhub/formats";import{writeModelStage as m}from"@allyhub/scenery-host/bundle";async function d(e,r,t){const{buildModule:n}=await import("@allyhub/model/build");await n(a(e,r),{root:e,...t===void 0?{}:{out:t},cache:a(e,f,"model"),log:()=>{}})}const c=e=>e instanceof Error?e.message:String(e),p={view:async e=>{const{viewerBundle:r}=await import("@allyhub/scenery-host/stage");return r(e,()=>m({root:e.root,model:e.file,outDir:e.outDir}))},check:async(e,{root:r})=>{try{return await d(r,e.entry),[]}catch(t){return[u("AK-B010",`${e.entry} does not build: ${c(t)}`,{piece:e.id,where:{file:e.entry}})]}},render:async(e,{root:r,types:t,out:n,log:s})=>{const o=[];for(const i of t){s?.(`Building ${e.entry}…`);try{await d(r,e.entry,n(i)),o.push({type:i,files:[n(i)]})}catch(l){o.push({type:i,failure:{code:"model-failed",message:`${e.entry}: ${c(l)}`,hint:"Fix it, then render again."}})}}return o}};export default p;
2
+ import{join as a}from"node:path";import{problem as u}from"@allyhub/diagnostics";import{CACHE_DIR as f}from"@allyhub/formats";import{writeModelStage as m}from"@allyhub/scenery-host/bundle";async function d(e,r,n){const{buildModule:t}=await import("@allyhub/model/build");await t(a(e,r),{root:e,...n===void 0?{}:{out:n},cache:a(e,f,"model"),log:()=>{}})}const c=e=>e instanceof Error?e.message:String(e),y={view:async e=>{const{viewerBundle:r}=await import("@allyhub/scenery-host/stage");return r(e,()=>m({root:e.root,model:e.file,outDir:e.outDir}))},check:async(e,{root:r})=>{try{return await d(r,e.entry),[]}catch(n){return[u("AK-B010",`${e.entry} does not build: ${c(n)}`,{piece:e.id,where:{file:e.entry}})]}},render:async(e,{root:r,types:n,out:t,log:s})=>{const o=[];for(const i of n){s?.(`Building ${e.entry}…`);try{await d(r,e.entry,t(i)),o.push({type:i,files:[t(i)]})}catch(l){o.push({type:i,failure:{code:"model-failed",message:`${e.entry}: ${c(l)}`,hint:"Fix it, then render again."}})}}return o}};export default y;
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- const t=()=>import("@allyhub/scenery-host/stage"),s={facts:async a=>(await t()).sceneryLayerFacts(a),readBack:async a=>(await(await t()).screenFidelity(a)).facts,current:async(a,e)=>(await t()).withBakes(a,e.root)},c={view:async a=>(await t()).viewerBundle(a),layers:s};export default c;
2
+ const e=()=>import("@allyhub/scenery-host/stage"),c={facts:async a=>(await e()).sceneryLayerFacts(a),readBack:async a=>(await(await e()).screenFidelity(a)).facts,current:async(a,t)=>a.some(s=>s.kind==="scenery-bake")?(await e()).withBakes(a,t.root):[...a]},i={view:async a=>(await e()).viewerBundle(a),layers:c};export default i;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/3d-extension",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./tools": {
@@ -62,7 +62,8 @@
62
62
  },
63
63
  "icon": "box",
64
64
  "color": "kind-slate",
65
- "build": "./dist/scenery-build.js"
65
+ "build": "./dist/scenery-build.js",
66
+ "layers": true
66
67
  },
67
68
  {
68
69
  "id": "model",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/audio",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/browser",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{pathToFileURL as l}from"node:url";import{SDK as u}from"./scan.js";const i=new Map;function f(n){let t=i.get(n);return t||(t=import(n.includes("://")?n:l(n).href).then(o=>{if(typeof o.default!="object"||o.default===null)throw new Error(`The build plugins module ${n} has no default export.`);return o.default}),i.set(n,t)),t}export function buildPluginModules(n){return[...new Set(n.flatMap(t=>t.buildPlugins??[]))]}export async function stageAdditions(n,t,e){const o=[];for(const r of buildPluginModules(n))try{o.push(await f(r))}catch(s){if(!e)throw s;e(r,s)}return{plugins:o.flatMap(r=>r.plugins?.({root:t})??[]),lent:Object.assign({},...o.map(r=>r.lent??{})),sdk:sdkEntriesOf(...o),bound:sdkBindingsOf(...o),async written(r){const s=[];for(const c of o)s.push(...await c.written?.(r)??[]);return s}}}const d=n=>n==="."?u:`${u}/${n.replace(/^\.\//u,"")}`;export function sdkEntriesOf(...n){const t={};for(const e of n)for(const[o,r]of Object.entries(e.sdk??{}))t[d(o)]=r;return t}export function sdkBindingsOf(...n){const t={};for(const e of n)for(const[o,r]of Object.entries(e.bound??{}))t[d(o)]=r;return t}export async function nodeLending(n,t){const e=await stageAdditions(n,t,()=>{});return{lent:e.lent,sdk:e.sdk,bound:e.bound,buildPlugins:buildPluginModules(n)}}export async function nodeAdditions(n,t){const e=[];for(const o of n){const r=await f(o).catch(()=>{});e.push(...r?.node?.({root:t})??[])}return e}
2
+ import{pathToFileURL as a}from"node:url";import{SDK as f}from"./scan.js";const i=new Map;function c(t){let n=i.get(t);return n||(n=import(t.includes("://")?t:a(t).href).then(o=>{if(typeof o.default!="object"||o.default===null)throw new Error(`The build plugins module ${t} has no default export.`);return o.default}),i.set(t,n)),n}export function buildPluginModules(t){return[...new Set(t.flatMap(n=>n.buildPlugins??[]))]}export async function stageAdditions(t,n,e){const o=[];for(const r of buildPluginModules(t))try{o.push(await c(r))}catch(s){if(!e)throw s;e(r,s)}return{plugins:o.flatMap(r=>r.plugins?.({root:n})??[]),lent:Object.assign({},...o.map(r=>r.lent??{})),sdk:sdkEntriesOf(...o),bound:sdkBindingsOf(...o),parts:sdkPartsOf(...o),async written(r){const s=[];for(const d of o)s.push(...await d.written?.(r)??[]);return s}}}const u=t=>t==="."?f:`${f}/${t.replace(/^\.\//u,"")}`;export function sdkEntriesOf(...t){const n={};for(const e of t)for(const[o,r]of Object.entries(e.sdk??{}))n[u(o)]=r;return n}export function sdkBindingsOf(...t){const n={};for(const e of t)for(const[o,r]of Object.entries(e.bound??{}))n[u(o)]=r;return n}export function sdkPartsOf(...t){const n={};for(const e of t)for(const[o,r]of Object.entries(e.parts??{}))n[u(o)]={of:u(r.of),names:[...r.names]};return n}export async function nodeLending(t,n){const e=await stageAdditions(t,n,()=>{});return{lent:e.lent,sdk:e.sdk,bound:e.bound,parts:e.parts,buildPlugins:buildPluginModules(t)}}export async function nodeAdditions(t,n){const e=[];for(const o of t){const r=await c(o).catch(()=>{});e.push(...r?.node?.({root:n})??[])}return e}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- export{dependenciesOf,listFiles}from"./files.js";export{listWork,projectItems,readWork,unlistedWork}from"./work.js";export{moveEdits,movedPath,referencesOf,referringFiles}from"./move-refs.js";export{bundleForStage,compileErrorOf,createModuleLoader,createStageDevServer,loadUserVite}from"./vite.js";export{nodeStackPlace,placeFinder}from"./places.js";export{mergeScript,pieceLocales,readScripts,readMessages}from"./messages.js";export{MAX_DATA_BYTES,isDataFile,parseCsv,parseData,readData}from"./data.js";export{itemKindBuild,kindBuildOf}from"./kind-build.js";export{madeNotes}from"./made-notes.js";export{FACTS_HEAD,MOMENTS,PROJECT_DIR,STRETCH,VERSION_FIELDS,allFindings,defineView}from"./inspect-view.js";export{fileCheckOf,fileProblems,listedFileProblems}from"./file-check.js";export{FRESH,defineCliCommand,existingFile,fromMedia,media,parameters,progressLines,sizeOf}from"./cli-command.js";export{defineProjectTool}from"./project-tool.js";export{projectAt,projectOfFile,projectRoot}from"./project-root.js";export{buildPluginModules,nodeLending,sdkBindingsOf,sdkEntriesOf,stageAdditions}from"./build-plugins.js";export{deckReferences,referenceModule}from"./references.js";export{messagePrefix,parseComponentRef,readPropsText,resolveDims}from"@allyhub/piece";export{readMedia}from"./media.js";export{modelInfo}from"./model-info.js";export{takeVoice}from"./takes.js";export{resolveMatrix}from"./matrix.js";export{FONTS_MODULE,fontStyles,fontsDigest,fontsModule}from"./fonts.js";export{SDK,checkImports,discover,lineAt,packageName,parse,walk}from"./scan.js";export{allyhubPlugin,boundEntry,mediaHref}from"./plugin.js";export{MetaLoader}from"./meta.js";export{besideModule,fromFolder,plain}from"./evaluate.js";export{MESSAGE_TYPES,messageTypes,writeMessageTypes}from"./types.js";export{BUILD_FOLDER,inTime,issuesText,itemProblem,loadFailure,prepare,sourceOf,stageId,stageItem,stageName}from"./prepare.js";export{codeOf}from"./code.js";export{ProjectError,StuckError}from"./version.js";export{generatedFile,generatedPagedFact,mismatchFacts,secondsOf}from"./generated.js";export{importedItems}from"./imports.js";export{madeType,resolveUses,splitReference,usersOf,usesInOrder}from"./uses.js";
2
+ export{dependenciesOf,listFiles}from"./files.js";export{listWork,projectItems,readWork,unlistedWork}from"./work.js";export{moveEdits,movedPath,referencesOf,referringFiles}from"./move-refs.js";export{bundleForStage,compileErrorOf,createModuleLoader,createStageDevServer,loadUserVite}from"./vite.js";export{nodeStackPlace,placeFinder}from"./places.js";export{mergeScript,pieceLocales,readScripts,readMessages}from"./messages.js";export{MAX_DATA_BYTES,isDataFile,parseCsv,parseData,readData}from"./data.js";export{itemKindBuild,kindBuildOf}from"./kind-build.js";export{madeNotes}from"./made-notes.js";export{FACTS_HEAD,MOMENTS,PROJECT_DIR,STRETCH,VERSION_FIELDS,allFindings,defineView}from"./inspect-view.js";export{fileCheckOf,fileProblems,listedFileProblems}from"./file-check.js";export{FRESH,defineCliCommand,existingFile,fromMedia,media,parameters,progressLines,sizeOf}from"./cli-command.js";export{defineProjectTool}from"./project-tool.js";export{projectAt,projectOfFile,projectRoot}from"./project-root.js";export{buildPluginModules,nodeLending,sdkBindingsOf,sdkEntriesOf,sdkPartsOf,stageAdditions}from"./build-plugins.js";export{deckReferences,referenceModule}from"./references.js";export{messagePrefix,parseComponentRef,readPropsText,resolveDims}from"@allyhub/piece";export{readMedia}from"./media.js";export{modelInfo}from"./model-info.js";export{takeVoice}from"./takes.js";export{resolveMatrix}from"./matrix.js";export{FONTS_MODULE,fontStyles,fontsDigest,fontsModule}from"./fonts.js";export{SDK,checkImports,discover,lineAt,packageName,parse,walk}from"./scan.js";export{allyhubPlugin,boundEntry,mediaHref}from"./plugin.js";export{MetaLoader}from"./meta.js";export{besideModule,fromFolder,plain}from"./evaluate.js";export{MESSAGE_TYPES,messageTypes,writeMessageTypes}from"./types.js";export{BUILD_FOLDER,inTime,issuesText,itemProblem,loadFailure,prepare,sourceOf,stageId,stageItem,stageName}from"./prepare.js";export{codeOf}from"./code.js";export{ProjectError,StuckError}from"./version.js";export{generatedFile,generatedPagedFact,mismatchFacts,secondsOf}from"./generated.js";export{importedItems}from"./imports.js";export{madeType,resolveUses,splitReference,usersOf,usesInOrder}from"./uses.js";
@@ -1,3 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
2
  import b from"node:net";import{join as m}from"node:path";import{format as U}from"node:util";import{parentPort as g,workerData as N}from"node:worker_threads";import{problem as E}from"@allyhub/diagnostics";import{framedComponent as P}from"@allyhub/piece";import{nodeAdditions as V}from"./build-plugins.js";import{plain as k}from"./evaluate.js";import{allyhubPlugin as _}from"./plugin.js";import{SDK as H}from"./scan.js";import{createModuleLoader as I,loadUserVite as K}from"./vite.js";const r=N,u=[];let $=!1;for(const t of["log","info","warn","error","debug"])console[t]=(...o)=>{$||process.stderr.write(`${U(...o)}
3
- `)};const R=Date.UTC(2026,0,1),T=Date,B=Math.random,F=globalThis.fetch,L=Reflect.get(b.Socket.prototype,"connect");function z(t){let o=t>>>0;return()=>{o=o+1831565813|0;let e=Math.imul(o^o>>>15,1|o);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function G(t){let o=2166136261;for(let e=0;e<t.length;e++)o^=t.charCodeAt(e),o=Math.imul(o,16777619);return o>>>0}async function f(t,o,e,i=`reading the metadata of ${o}`,c=!0,n){const s=globalThis;class l extends T{constructor(...d){d.length===0?(super(R),n?.("the clock (new Date())")):super(...d)}static now(){return n?.("the clock (Date.now)"),R}}const M=a=>{u.push(E("AK-B003",`A network request was made while ${i}: ${a}. The build has no network: put the data in the project and import it.`,{where:{file:o}}))};s.Date=l;const j=z(G(t));Math.random=n?()=>(n("a random number (Math.random)"),j()):j;const D=[];if(n){const a=(h,y,O,S)=>{const w=h[y];typeof w=="function"&&(h[y]=function(...C){return n(O),S===void 0?w.apply(this,C):S},D.push(()=>{h[y]=w}))};a(performance,"now","the clock (performance.now)",0);const{crypto:d}=globalThis,A=d;a(A,"randomUUID","a random number (crypto.randomUUID)",void 0),a(A,"getRandomValues","a random number (crypto.getRandomValues)",void 0),a(process,"getBuiltinModule","Node's own modules, which reach outside the project",void 0)}s.fetch=a=>(M(typeof a=="string"?a:a.url??"a request"),Promise.reject(new TypeError("network blocked by AllyHub"))),Reflect.set(b.Socket.prototype,"connect",function(...a){const[d]=a;return M(typeof d=="object"&&d!==null?`${d.host??""}:${String(d.port??"")}`:String(d)),this.destroy(new Error("network blocked by AllyHub")),this}),$=c;try{return await e()}finally{$=!1;for(const a of D)a();s.Date=T,Math.random=B,s.fetch=F,Reflect.set(b.Socket.prototype,"connect",L)}}process.env.NODE_ENV="production";const p=(async()=>{const t=r.user?await K(r.root):void 0;return I(r.root,[_({root:r.root,media:r.media,dependencies:new Set(r.dependencies),inNode:!0,...r.lent?{lent:r.lent}:{},...r.sdk?{sdk:r.sdk}:{},...r.bound?{bound:r.bound}:{}}),...await V(r.buildPlugins??[],r.root)],{mode:"production",inline:[H,...Object.keys(r.lent??{})],...t?{user:t}:{}})})();async function J(t){const o=await f(t,t,async()=>(await p).import(m(r.root,t))),e=[];for(const[i,c]of Object.entries(o)){if(typeof c!="function")continue;const n=c.info;if(n===void 0||typeof c.componentName!="string")continue;const s=[],l=k(n,"",s);s.length>0&&u.push(E("AK-M001",`These places in the component declaration in ${t} are functions and cannot be read as metadata: ${s.join(", ")}. The types and examples of props must be plain data.`,{where:{file:t}})),e.push({...l,file:t,export:i})}return e}async function Q(t,o){const e=await f(t,t,async()=>(await p).import(m(r.root,t)));if(!Object.hasOwn(e,o)){const s=Object.keys(e).filter(l=>l!=="__esModule");return{not:`${t} has no export ${o} (it has ${s.join(", ")||"none"})`}}const i=P(o,e[o]);if(!i)return{not:`${t}'s ${o} is not a component: make it with defineComponent`};const c=[],n=k(i.props,"",c);return c.length>0?{not:`${t}'s ${o} has functions in its props' types (${c.join(", ")}): they must be plain data`}:{name:o,...i.label===void 0?{}:{label:i.label},props:n}}async function W(t){const o=await f(t,t,async()=>(await p).import(m(r.root,t)),void 0,!1);return k(o.default,"",[])}const v=(t,o,e={})=>f(e.seed??t,t,o,e.doing,e.silent??!0,e.strict),x=new Map;async function X(t){let o=x.get(t.module);o||(o=import(t.module).then(n=>{if(typeof n.default!="function")throw new Error(`${t.module} has no default export to run an entry with.`);return n.default}),x.set(t.module,o));const e=await o,i=async n=>(await p).import(m(r.root,n)),c={root:r.root,file:t.file,input:t.input,import:(n,s)=>v(n,()=>i(n),s),load:i,guarded:(n,s)=>v(t.file,n,s),report:n=>{u.push(n)}};return e(c)}g?.on("message",t=>{(async()=>{u.length=0;try{await p;const o=t.type==="run"?await X(t):t.type==="components"?await J(t.file):t.type==="component"?await Q(t.file,t.name):await W(t.file),e={id:t.id,ok:!0,value:o,problems:[...u]};g?.postMessage(e)}catch(o){const e={id:t.id,ok:!1,error:o instanceof Error?o.message:String(o),...o instanceof Error&&o.stack?{stack:o.stack}:{},problems:[...u]};g?.postMessage(e)}})()});
3
+ `)};const R=Date.UTC(2026,0,1),T=Date,B=Math.random,F=globalThis.fetch,L=Reflect.get(b.Socket.prototype,"connect");function z(t){let o=t>>>0;return()=>{o=o+1831565813|0;let e=Math.imul(o^o>>>15,1|o);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function G(t){let o=2166136261;for(let e=0;e<t.length;e++)o^=t.charCodeAt(e),o=Math.imul(o,16777619);return o>>>0}async function f(t,o,e,i=`reading the metadata of ${o}`,c=!0,n){const s=globalThis;class p extends T{constructor(...d){d.length===0?(super(R),n?.("the clock (new Date())")):super(...d)}static now(){return n?.("the clock (Date.now)"),R}}const M=a=>{u.push(E("AK-B003",`A network request was made while ${i}: ${a}. The build has no network: put the data in the project and import it.`,{where:{file:o}}))};s.Date=p;const j=z(G(t));Math.random=n?()=>(n("a random number (Math.random)"),j()):j;const D=[];if(n){const a=(h,y,O,S)=>{const w=h[y];typeof w=="function"&&(h[y]=function(...C){return n(O),S===void 0?w.apply(this,C):S},D.push(()=>{h[y]=w}))};a(performance,"now","the clock (performance.now)",0);const{crypto:d}=globalThis,A=d;a(A,"randomUUID","a random number (crypto.randomUUID)",void 0),a(A,"getRandomValues","a random number (crypto.getRandomValues)",void 0),a(process,"getBuiltinModule","Node's own modules, which reach outside the project",void 0)}s.fetch=a=>(M(typeof a=="string"?a:a.url??"a request"),Promise.reject(new TypeError("network blocked by AllyHub"))),Reflect.set(b.Socket.prototype,"connect",function(...a){const[d]=a;return M(typeof d=="object"&&d!==null?`${d.host??""}:${String(d.port??"")}`:String(d)),this.destroy(new Error("network blocked by AllyHub")),this}),$=c;try{return await e()}finally{$=!1;for(const a of D)a();s.Date=T,Math.random=B,s.fetch=F,Reflect.set(b.Socket.prototype,"connect",L)}}process.env.NODE_ENV="production";const l=(async()=>{const t=r.user?await K(r.root):void 0;return I(r.root,[_({root:r.root,media:r.media,dependencies:new Set(r.dependencies),inNode:!0,...r.lent?{lent:r.lent}:{},...r.sdk?{sdk:r.sdk}:{},...r.bound?{bound:r.bound}:{},...r.parts?{parts:r.parts}:{}}),...await V(r.buildPlugins??[],r.root)],{mode:"production",inline:[H,...Object.keys(r.lent??{})],...t?{user:t}:{}})})();async function J(t){const o=await f(t,t,async()=>(await l).import(m(r.root,t))),e=[];for(const[i,c]of Object.entries(o)){if(typeof c!="function")continue;const n=c.info;if(n===void 0||typeof c.componentName!="string")continue;const s=[],p=k(n,"",s);s.length>0&&u.push(E("AK-M001",`These places in the component declaration in ${t} are functions and cannot be read as metadata: ${s.join(", ")}. The types and examples of props must be plain data.`,{where:{file:t}})),e.push({...p,file:t,export:i})}return e}async function Q(t,o){const e=await f(t,t,async()=>(await l).import(m(r.root,t)));if(!Object.hasOwn(e,o)){const s=Object.keys(e).filter(p=>p!=="__esModule");return{not:`${t} has no export ${o} (it has ${s.join(", ")||"none"})`}}const i=P(o,e[o]);if(!i)return{not:`${t}'s ${o} is not a component: make it with defineComponent`};const c=[],n=k(i.props,"",c);return c.length>0?{not:`${t}'s ${o} has functions in its props' types (${c.join(", ")}): they must be plain data`}:{name:o,...i.label===void 0?{}:{label:i.label},props:n}}async function W(t){const o=await f(t,t,async()=>(await l).import(m(r.root,t)),void 0,!1);return k(o.default,"",[])}const v=(t,o,e={})=>f(e.seed??t,t,o,e.doing,e.silent??!0,e.strict),x=new Map;async function X(t){let o=x.get(t.module);o||(o=import(t.module).then(n=>{if(typeof n.default!="function")throw new Error(`${t.module} has no default export to run an entry with.`);return n.default}),x.set(t.module,o));const e=await o,i=async n=>(await l).import(m(r.root,n)),c={root:r.root,file:t.file,input:t.input,import:(n,s)=>v(n,()=>i(n),s),load:i,guarded:(n,s)=>v(t.file,n,s),report:n=>{u.push(n)}};return e(c)}g?.on("message",t=>{(async()=>{u.length=0;try{await l;const o=t.type==="run"?await X(t):t.type==="components"?await J(t.file):t.type==="component"?await Q(t.file,t.name):await W(t.file),e={id:t.id,ok:!0,value:o,problems:[...u]};g?.postMessage(e)}catch(o){const e={id:t.id,ok:!1,error:o instanceof Error?o.message:String(o),...o instanceof Error&&o.stack?{stack:o.stack}:{},problems:[...u]};g?.postMessage(e)}})()});
@@ -1,12 +1,12 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{realpathSync as W}from"node:fs";import{readFile as w}from"node:fs/promises";import{builtinModules as J}from"node:module";import{isAbsolute as u,relative as k,sep as x}from"node:path";import{mediaKindOf as v}from"@allyhub/piece";import{parseCsv as j,parseData as B}from"./data.js";import{FONTS_MODULE as p,fontsModule as D}from"./fonts.js";import{SDK as y,currentName as E,packageName as I}from"./scan.js";const f="\0allyhub-blocked:",c="\0allyhub-sdk:",_=`\0${p}`,U=new Set([...J,...J.map(n=>`node:${n}`)]),S=n=>n.replace(/[?#].*$/u,"");export const mediaHref=n=>`media/${n.split("/").map(encodeURIComponent).join("/")}`;const H=n=>`new URL(${JSON.stringify(`../../${mediaHref(n)}`)}, __allyhubHere).href`;export function boundEntry(n,i,o){return[`export * from ${JSON.stringify(n)};`,`import { ${i.factory} as __allyhubBind } from ${JSON.stringify(n)};`,`export const { ${i.names.join(", ")} } = __allyhubBind({ file: ${JSON.stringify(o)} });`,""].join(`
3
- `)}const L=(n,i)=>`${c}${n}\0${i}`;export function allyhubPlugin(n){const{root:i}=n,o=[i];try{const t=W.native(i);t!==i&&o.push(t)}catch{}const b=t=>{for(const r of o){const e=k(r,t);if(!e.startsWith("..")&&!u(e))return e}},N=t=>(b(t)??k(i,t)).split(x).join("/"),h=t=>b(t)!==void 0,$=t=>t.split(x).includes("node_modules");return{name:"allyhub",enforce:"pre",async resolveId(t,r,e){if(t===p)return _;if(t.startsWith(c))return t;if(t.startsWith("\0"))return null;const l=r?S(r):void 0,a=l!==void 0&&u(l)&&h(l)&&!$(l);if(/^(https?:)?\/\//iu.test(t))return`${f}${t}`;const g=E(t);if(g!==t)return this.resolve(g,r,{...e,skipSelf:!1});const d=I(t);if(d===y){if(a&&n.bound?.[t])return L(t,N(l));const s=await this.resolve(t,r,{...e,skipSelf:!0});return s||(n.dependencies.has(y)?`${f}${t}`:n.sdk?.[t]??`${f}${t}`)}const O=n.lent?.[d];if(O!==void 0&&!n.dependencies.has(d))return await this.resolve(t,O,{...e,skipSelf:!0})??`${f}${t}`;if(!a)return null;if(!t.startsWith(".")&&!t.startsWith("/")&&!u(t)&&!U.has(t))return n.dependencies.has(d)?null:`${f}${t}`;const m=await this.resolve(t,r,{...e,skipSelf:!0});if(m&&!m.external){const s=S(m.id);if(u(s)&&!h(s)&&!$(s))return`${f}${t}`}return m},async load(t){if(t===_)return D(i,n.fonts?.()??[]);if(t.startsWith(c)){const[e="",l=""]=t.slice(c.length).split("\0"),a=n.bound?.[e];return a?boundEntry(e,a,l):null}if(t.startsWith(f)){const e=`AllyHub blocked the import of ${t.slice(f.length)}`;return`throw new Error(${JSON.stringify(e)});
2
+ import{realpathSync as W}from"node:fs";import{readFile as O}from"node:fs/promises";import{builtinModules as k}from"node:module";import{isAbsolute as c,relative as J,sep as x}from"node:path";import{mediaKindOf as v}from"@allyhub/piece";import{parseCsv as j,parseData as B}from"./data.js";import{FONTS_MODULE as S,fontsModule as D}from"./fonts.js";import{SDK as b,currentName as I,packageName as E}from"./scan.js";import{partImports as U,withParts as H}from"./sdk-parts.js";const a="\0allyhub-blocked:",y="\0allyhub-sdk:",_=`\0${S}`,L=new Set([...k,...k.map(n=>`node:${n}`)]),g=n=>n.replace(/[?#].*$/u,"");export const mediaHref=n=>`media/${n.split("/").map(encodeURIComponent).join("/")}`;const P=n=>`new URL(${JSON.stringify(`../../${mediaHref(n)}`)}, __allyhubHere).href`;export function boundEntry(n,s,d){return[`export * from ${JSON.stringify(n)};`,`import { ${s.factory} as __allyhubBind } from ${JSON.stringify(n)};`,`export const { ${s.names.join(", ")} } = __allyhubBind({ file: ${JSON.stringify(d)} });`,""].join(`
3
+ `)}const C=(n,s)=>`${y}${n}\0${s}`;export function allyhubPlugin(n){const{root:s}=n,d=[s];try{const t=W.native(s);t!==s&&d.push(t)}catch{}const N=t=>{for(const e of d){const r=J(e,t);if(!r.startsWith("..")&&!c(r))return r}},w=t=>(N(t)??J(s,t)).split(x).join("/"),h=t=>N(t)!==void 0,p=t=>t.split(x).includes("node_modules");return{name:"allyhub",enforce:"pre",async resolveId(t,e,r){if(t===S)return _;if(t.startsWith(y))return t;if(t.startsWith("\0"))return null;const i=e?g(e):void 0,l=i!==void 0&&c(i)&&h(i)&&!p(i);if(/^(https?:)?\/\//iu.test(t))return`${a}${t}`;const u=I(t);if(u!==t)return this.resolve(u,e,{...r,skipSelf:!1});const f=E(t);if(f===b){if(l&&n.bound?.[t])return C(t,w(i));const o=await this.resolve(t,e,{...r,skipSelf:!0});return o||(n.dependencies.has(b)?`${a}${t}`:n.sdk?.[t]??`${a}${t}`)}const m=n.lent?.[f];if(m!==void 0&&!n.dependencies.has(f))return await this.resolve(t,m,{...r,skipSelf:!0})??`${a}${t}`;if(!l)return null;if(!t.startsWith(".")&&!t.startsWith("/")&&!c(t)&&!L.has(t))return n.dependencies.has(f)?null:`${a}${t}`;const $=await this.resolve(t,e,{...r,skipSelf:!0});if($&&!$.external){const o=g($.id);if(c(o)&&!h(o)&&!p(o))return`${a}${t}`}return $},async load(t){if(t===_)return D(s,n.fonts?.()??[]);if(t.startsWith(y)){const[r="",i=""]=t.slice(y.length).split("\0"),l=n.bound?.[r];return l?boundEntry(r,l,i):null}if(t.startsWith(a)){const r=`AllyHub blocked the import of ${t.slice(a.length)}`;return`throw new Error(${JSON.stringify(r)});
4
4
  export default undefined;
5
- `}if(t.startsWith("\0")||/[?#]/u.test(t)||!u(t)||!h(t)||$(t))return null;const r=N(t);if(v(r)){const e=n.media[r];if(!e)return null;const l=n.inNode?JSON.stringify(mediaHref(r)):H(r);return`import { media } from ${JSON.stringify(`${y}/media`)};
5
+ `}if(t.startsWith("\0")||/[?#]/u.test(t)||!c(t)||!h(t)||p(t))return null;const e=w(t);if(v(e)){const r=n.media[e];if(!r)return null;const i=n.inNode?JSON.stringify(mediaHref(e)):P(e);return`import { media } from ${JSON.stringify(`${b}/media`)};
6
6
  const __allyhubHere = import.meta.url;
7
- export default media({ ...${JSON.stringify(e)}, url: ${l} });
8
- `}return/\.csv$/iu.test(r)?`export default ${JSON.stringify(j(await w(t,"utf8")))};
9
- `:/\.ya?ml$/iu.test(r)?`export default ${JSON.stringify(B(r,await w(t,"utf8")))};
10
- `:null},transform(t,r){const e=S(r);return n.stageEntries?.has(e)?{code:`${t}
11
- import ${JSON.stringify(p)};
12
- `,map:null}:null}}}
7
+ export default media({ ...${JSON.stringify(r)}, url: ${i} });
8
+ `}return/\.csv$/iu.test(e)?`export default ${JSON.stringify(j(await O(t,"utf8")))};
9
+ `:/\.ya?ml$/iu.test(e)?`export default ${JSON.stringify(B(e,await O(t,"utf8")))};
10
+ `:null},async transform(t,e){const r=g(e),i=n.parts&&c(r)&&h(r)&&!p(r)?U(r,t,n.parts):[],l=[];for(const f of i){const m=await this.resolve(f.to,e,{skipSelf:!1}).catch(()=>null);m&&!m.id.startsWith(a)&&l.push(f)}const u=l.length>0?H(t,l):t;return n.stageEntries?.has(r)?{code:`${u}
11
+ import ${JSON.stringify(S)};
12
+ `,map:null}:u===t?null:{code:u,map:null}}}}
@@ -1,4 +1,4 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{mkdir as ie,readFile as oe,readdir as ae,writeFile as ce}from"node:fs/promises";import{join as y}from"node:path";import{BAKE_DIR as q,CACHE_DIR as re,CONFIG_FILES as le,ConfigSchema as T,TEXT_DIR as M,USE_FORMS as fe,itemsOf as de,pointEntriesIn as me,WORK_FILE as w}from"@allyhub/formats";import{problem as g}from"@allyhub/diagnostics";import{looksOf as G,resolveDims as ue}from"@allyhub/piece";import{readData as he}from"./data.js";import{dependenciesOf as ge,listFiles as pe}from"./files.js";import{readWork as we}from"./work.js";import{fontStyles as be}from"./fonts.js";import{kindBuildOf as V}from"./kind-build.js";import{readMedia as ke}from"./media.js";import{readMessages as $e}from"./messages.js";import{MetaLoader as ye}from"./meta.js";import{allyhubPlugin as xe,mediaHref as X}from"./plugin.js";import{buildPluginModules as Se,stageAdditions as Oe}from"./build-plugins.js";import{checkImports as Me,discover as je,parse as Ee}from"./scan.js";import{writeMessageTypes as ve}from"./types.js";import{resolveUses as Ae}from"./uses.js";import{bundleForStage as De,loadUserVite as Fe}from"./vite.js";import{nodeStackPlace as Te}from"./places.js";export const inTime=(e,n)=>n.find(s=>s.id===e.kind)?.pages!==!0;export function itemProblem(e){switch(e.code){case"unknown-kind":return g("AK-M002",`${w} lists ${e.file} as a ${e.kind}, a kind no extension here contributes.`,{where:{file:w}});case"no-editor":return g("AK-M002",`${w} lists ${e.file} with no kind, and no editor here opens a file of its name. Name its kind, or take it out of the list.`,{where:{file:w}});case"missing":return g("AK-M002",`${w} lists ${e.file}, which is not in the project. Write it, or take it out of the list.`,{where:{file:w}});case"same-id":return g("AK-M003",`${w} lists ${e.files.join(" and ")}, one id (${e.id}) for two pieces, so only the first is shown: rename one, or list it once.`,{where:{file:w}})}}export function loadFailure(e,n,s){const o=s?`${n} (at ${s.file}:${String(s.line)}:${String(s.column)})`:n,f=/\b(window|document|navigator|self|HTMLElement|customElements) is not defined/u.test(n);return g("AK-R001",f?`${e} uses something at its top level that only exists in the browser (${o}). The top level of a piece module must load in Node: move it into the output's function, or import it inside a component.`:`Failed to load ${e}: ${o}`,{where:s?{file:s.file,line:s.line}:{file:e}})}export const issuesText=e=>e.issues.map(n=>`${n.path.map(String).join(".")||"(root)"}: ${n.message}`).join("; ");async function Ke(e){return(await ae(y(e,q)).catch(()=>[])).filter(s=>/^[0-9a-f]+\.[\w-]+\.bin$/u.test(s)).map(s=>`${q}/${s}`)}async function Ie(e){const n=[],s=new Set;for(const o of e){const f=await V(o)?.catch(()=>{});!f?.config||s.has(f)||(s.add(f),n.push(f.config))}return n}export async function prepare(e,n){const s=[],o=await pe(e),f=await we(e);for(const m of f.problems)s.push(g("AK-M002",m,{where:{file:w}}));const i=de(f.work,n.kinds,new Set(o));for(const m of i.problems)s.push(itemProblem(m));const r=await ge(e),c=await ke(e,[...o,...await Ke(e)]),l=await Oe(n.kinds,e,(m,p)=>{s.push(g("AK-R001",`The build plugins module ${m} did not load, so the stage's bundles go without it: ${p instanceof Error?p.message:String(p)}`,{}))}),b=new ye({root:e,media:c,dependencies:[...r],user:!0,lent:{...l.lent},sdk:{...l.sdk},bound:{...l.bound},buildPlugins:Se(n.kinds)},n.metaTimeout);try{let m=T.parse({});const p=le.find(t=>o.includes(t));if(p){const t=await b.request({type:"config",file:p});if(s.push(...t.problems),!t.ok)s.push(loadFailure(p,t.error??"",Te(t.stack,e)));else{const a=t.value??{},d=await Ie(n.kinds),u=new Set(d.flatMap(h=>Object.keys(h.shape??{}))),$=T.safeParse(Object.fromEntries(Object.entries(a).filter(([h])=>!u.has(h)||Object.hasOwn(T.shape,h)))),W=d.map(h=>h.safeParse(a)),H=[...$.success?[]:[issuesText($.error)],...W.flatMap(h=>h.success?[]:[issuesText(h.error)])];if($.success&&H.length===0){m=$.data;for(const h of W)h.success&&(m={...m,...h.data})}else s.push(g("AK-M001",`${p} is not valid: ${H.join("; ")}.`,{where:{file:p}}))}}const I=m.defaults?.format,R=typeof I=="string"?I:"16x9",j=be(e,m);for(const t of j.missing)s.push(g("AK-A001",`allyhub.config's fonts name ${t}, which is not in the project or its packages.`,{where:{file:p??"allyhub.config.ts"}}));const x=await $e(e,o,{...m.locales?{locales:m.locales}:{},text:m.text??M});s.push(...x.problems);const Q=o.filter(t=>/\.(ts|tsx|js|jsx|mts|mjs)$/u.test(t)&&!t.endsWith(".d.ts")),E=new Map;for(const t of Q){const a=Ee(t,await oe(y(e,t),"utf8"));E.set(t,a),s.push(...Me(t,a,r,new Set(Object.keys(l.lent)),new Set(Object.keys(l.sdk))))}const _=[];for(const[t,a]of E){if(!je(t,a).components)continue;const d=await b.request({type:"components",file:t});if(s.push(...d.problems),!!d.ok)for(const u of d.value??[])typeof u.name=="string"&&typeof u.export=="string"&&_.push({name:u.name,file:t,export:u.export,...typeof u.label=="string"||typeof u.label=="object"&&u.label!==null?{label:u.label}:{}})}const v=await _e(i.items,n.kinds,s),P=new Map,N=(t,a)=>({root:e,files:o,meta:b,media:c,messages:x,defaultFormat:R,config:m,lent:t,data:a,parsed:d=>E.get(d),items:i.items,claim:(d,u)=>{const $=P.get(d);return $===void 0&&P.set(d,u),$},contributionsTo:()=>[]}),L=(t,a)=>({...t,contributionsTo:d=>me(n.kinds,a.kind,d)}),k=[];let S={};const Y=N({},{}),A=new Map,D=new Map,B=(t,a)=>{A.set(t,[...A.get(t)??[],...a.files??[]]),a.uses&&a.uses.length>0&&D.set(t,[...D.get(t)??[],...a.uses])};for(const t of i.items){const a=await v.get(t)?.lend?.(t,L(Y,t));a&&(k.push(a),B(t,a),S={...S,...a.data})}const C={...await he(e,o.filter(t=>!i.items.some(a=>a.entry===t)),m.text??M),...S},Z=N(S,C);for(const t of i.items){const a=await v.get(t)?.read?.(t,L(Z,t));a&&(k.push(a),B(t,a));const d=new Set([t.entry]);t.files=[{path:t.entry,role:"entry"},...(A.get(t)??[]).filter(u=>!d.has(u.path)&&!!d.add(u.path))]}for(const t of k)s.push(...t.problems??[]);const ee=new Set(i.items.flatMap(t=>v.get(t)?.onStage?[t.kind]:[]));s.push(...Ae(i.items,n.kinds,D,{live:t=>ee.has(t),lent:new Set(Object.keys(S))}));const te=k.flatMap(t=>t.piece?[t.piece]:[]),se=k.flatMap(t=>t.doc?[t.doc]:[]),ne=k.flatMap(t=>t.sheet?[t.sheet]:[]),J=[...k.filter(t=>t.piece),...k.filter(t=>!t.piece)].flatMap(t=>t.stage?[t.stage]:[]),O=x.locales[0];await ve(e,O===void 0?{}:x.messages[O]??{},O===void 0?void 0:x.files[O]);let F;if(n.buildDir&&J.length>0){const t=Object.fromEntries(await Promise.all(J.map(async d=>[d.name,await Re(e,d)]))),a=await Fe(e);try{const d=await De({root:e,entries:t,outDir:n.buildDir,plugins:[xe({root:e,media:c,dependencies:r,fonts:()=>j.styles,stageEntries:new Set(Object.values(t)),lent:l.lent,sdk:l.sdk,bound:l.bound}),...l.plugins],...a?{user:a}:{}}),u=await l.written(n.buildDir);F={dir:n.buildDir,chunks:d,beside:u}}catch(d){s.push(g("AK-R001",`The pieces could not be bundled for the stage: ${d.message.split(`
3
- `).slice(0,3).join(" ")}`,{}))}}const U=new Set;return{root:e,kinds:n.kinds,files:o,items:i.items,config:m,defaultFormat:R,dependencies:[...r].sort(),messages:x,media:c,data:C,docs:se,sheets:ne,pieces:te,components:_,fonts:j.styles,...F?{bundle:F}:{},problems:s.filter(t=>{const a=`${t.code}|${t.message}|${t.where?.file??""}|${String(t.where?.line??"")}`;return U.has(a)?!1:(U.add(a),!0)})}}finally{await b.close()}}export const BUILD_FOLDER="build/",stageName=e=>e.replaceAll("/","__"),stageId=e=>"components"in e?e.place:e.id;export function stageItem(e,n){return e.pieces.find(s=>s.id===n)??e.docs.find(s=>s.place===n&&s.components.length>0)}async function Re(e,n){const s=(n.components??[]).filter(c=>c.item!==!0);if(s.length===0&&n.module!==void 0)return y(e,n.module);const o=y(e,re,"stage-entries");await ie(o,{recursive:!0});const f=y(o,`${n.name}.ts`),i=[...new Set(s.map(c=>c.module))],r=[`// The components ${n.of??n.module??n.name} shows by their module (generated by the build).`,...n.module===void 0?[]:[`export { default } from ${JSON.stringify(y(e,n.module))};`],...i.map((c,l)=>`import * as m${String(l)} from ${JSON.stringify(y(e,c))};`),"export const components = {",...s.map(c=>` ${JSON.stringify(c.of)}: m${String(i.indexOf(c.module))}[${JSON.stringify(c.name)}],`),"};",""];return await ce(f,r.join(`
4
- `)),f}async function _e(e,n,s){const o=new Map,f=new Map;for(const i of e){if(!o.has(i.kind)){const c=n.find(l=>l.id===i.kind);o.set(i.kind,await V(c)?.catch(l=>{s.push(g("AK-R001",`The ${c?.extension??i.kind} extension's build module did not load, so its items are not read: ${l instanceof Error?l.message:String(l)}`,{}))}))}const r=o.get(i.kind);r&&f.set(i,r)}return f}function K(e,n){const s=[],o=new Set,f=new Set,i=r=>{if(f.has(r))return;f.add(r);const c=e.bundle?.chunks.chunks[r];if(c){r!==n&&s.push(`${BUILD_FOLDER}${r}`);for(const l of c.css)o.add(`${BUILD_FOLDER}${l}`);for(const l of c.imports)i(l)}};return i(n),{imports:s,styles:[...o]}}export function sourceOf(e,n){if("components"in n)return Ne(e,n);const s=n,o=BUILD_FOLDER,f=stageName(s.id),i=e.bundle?.chunks.entries[f];if(!i)throw new Error(`${s.id} was not bundled for the stage.`);const{imports:r,styles:c}=K(e,i.file);return{piece:s.id,file:s.file,module:`${o}${i.file}`,imports:r,styles:c,dims:s.dims,...s.matrix?{matrix:{space:s.matrix.space,rules:s.matrix.rules}}:{},format:s.format,locales:e.messages.locales,messages:e.messages.messages,anchors:e.messages.anchors,text:e.config.text??M,...s.script===void 0?{}:{script:s.script},media:Object.fromEntries(Object.entries(e.media).map(([l,b])=>[l,{...b,url:X(l)}])),data:e.data,kind:s.kind,...s.loads,...G(e.config),pieces:z(e,s.place)}}function z(e,n){const s=new Map(e.items.map(i=>[i.id,i])),o=new Set,f=i=>{for(const r of s.get(i)?.uses??[])r.type!==fe.live||o.has(r.item)||(o.add(r.item),f(r.item))};return f(n),Object.fromEntries(e.pieces.map(i=>{const r={file:i.file,dims:i.dims,format:i.format,...i.matrix?{matrix:{space:i.matrix.space,rules:i.matrix.rules}}:{}},c=e.bundle?.chunks.entries[stageName(i.id)];if(!o.has(i.place)||i.place===n||!c)return[i.id,r];const{imports:l,styles:b}=K(e,c.file);return[i.id,{...r,kind:i.kind,module:`${BUILD_FOLDER}${c.file}`,imports:l,styles:b,...i.script===void 0?{}:{script:i.script},...i.loads?.kindData===void 0?{}:{kindData:i.loads.kindData}}]}))}const Pe="1920x1080";function Ne(e,n){const s=stageName(n.place),o=e.bundle?.chunks.entries[s];if(!o)throw new Error(`${n.place} shows no component: it has no stage bundle.`);const{imports:f,styles:i}=K(e,o.file);return{kind:"doc",piece:n.place,file:n.file,module:`${BUILD_FOLDER}${o.file}`,imports:f,styles:i,dims:ue(void 0,{locales:e.messages.locales}),format:Pe,locales:e.messages.locales,messages:e.messages.messages,anchors:e.messages.anchors,text:e.config.text??M,media:Object.fromEntries(Object.entries(e.media).map(([r,c])=>[r,{...c,url:X(r)}])),data:e.data,...G(e.config),pieces:z(e,n.place)}}
2
+ import{mkdir as ie,readFile as oe,readdir as ae,writeFile as ce}from"node:fs/promises";import{join as y}from"node:path";import{BAKE_DIR as q,CACHE_DIR as re,CONFIG_FILES as le,ConfigSchema as T,TEXT_DIR as j,USE_FORMS as fe,itemsOf as de,kindsUsed as me,pointEntriesIn as ue,WORK_FILE as w}from"@allyhub/formats";import{problem as p}from"@allyhub/diagnostics";import{looksOf as G,resolveDims as he}from"@allyhub/piece";import{readData as pe}from"./data.js";import{dependenciesOf as ge,listFiles as we}from"./files.js";import{readWork as be}from"./work.js";import{fontStyles as ke}from"./fonts.js";import{kindBuildOf as V}from"./kind-build.js";import{readMedia as $e}from"./media.js";import{readMessages as ye}from"./messages.js";import{MetaLoader as xe}from"./meta.js";import{allyhubPlugin as Se,mediaHref as X}from"./plugin.js";import{buildPluginModules as Oe,stageAdditions as je}from"./build-plugins.js";import{checkImports as Me,discover as Ee,parse as ve}from"./scan.js";import{writeMessageTypes as Ae}from"./types.js";import{resolveUses as De}from"./uses.js";import{bundleForStage as Fe,loadUserVite as Te}from"./vite.js";import{nodeStackPlace as Ke}from"./places.js";export const inTime=(e,n)=>n.find(s=>s.id===e.kind)?.pages!==!0;export function itemProblem(e){switch(e.code){case"unknown-kind":return p("AK-M002",`${w} lists ${e.file} as a ${e.kind}, a kind no extension here contributes.`,{where:{file:w}});case"no-editor":return p("AK-M002",`${w} lists ${e.file} with no kind, and no editor here opens a file of its name. Name its kind, or take it out of the list.`,{where:{file:w}});case"missing":return p("AK-M002",`${w} lists ${e.file}, which is not in the project. Write it, or take it out of the list.`,{where:{file:w}});case"same-id":return p("AK-M003",`${w} lists ${e.files.join(" and ")}, one id (${e.id}) for two pieces, so only the first is shown: rename one, or list it once.`,{where:{file:w}})}}export function loadFailure(e,n,s){const r=s?`${n} (at ${s.file}:${String(s.line)}:${String(s.column)})`:n,f=/\b(window|document|navigator|self|HTMLElement|customElements) is not defined/u.test(n);return p("AK-R001",f?`${e} uses something at its top level that only exists in the browser (${r}). The top level of a piece module must load in Node: move it into the output's function, or import it inside a component.`:`Failed to load ${e}: ${r}`,{where:s?{file:s.file,line:s.line}:{file:e}})}export const issuesText=e=>e.issues.map(n=>`${n.path.map(String).join(".")||"(root)"}: ${n.message}`).join("; ");async function Ie(e){return(await ae(y(e,q)).catch(()=>[])).filter(s=>/^[0-9a-f]+\.[\w-]+\.bin$/u.test(s)).map(s=>`${q}/${s}`)}async function Re(e,n,s){const r=o=>typeof s=="object"&&s!==null&&Object.hasOwn(s,o),f=[],i=new Set,l=new Set(me(e,n));for(const o of e){if(!l.has(o)&&!(o.config??[]).some(r))continue;const a=await V(o)?.catch(()=>{});!a?.config||i.has(a)||(i.add(a),f.push(a.config))}return f}export async function prepare(e,n){const s=[],r=await we(e),f=await be(e);for(const m of f.problems)s.push(p("AK-M002",m,{where:{file:w}}));const i=de(f.work,n.kinds,new Set(r));for(const m of i.problems)s.push(itemProblem(m));const l=await ge(e),o=await $e(e,[...r,...await Ie(e)]),a=await je(n.kinds,e,(m,g)=>{s.push(p("AK-R001",`The build plugins module ${m} did not load, so the stage's bundles go without it: ${g instanceof Error?g.message:String(g)}`,{}))}),b=new xe({root:e,media:o,dependencies:[...l],user:!0,lent:{...a.lent},sdk:{...a.sdk},bound:{...a.bound},parts:{...a.parts},buildPlugins:Oe(n.kinds)},n.metaTimeout);try{let m=T.parse({});const g=le.find(t=>r.includes(t));if(g){const t=await b.request({type:"config",file:g});if(s.push(...t.problems),!t.ok)s.push(loadFailure(g,t.error??"",Ke(t.stack,e)));else{const c=t.value??{},d=await Re(n.kinds,i.items,c),u=new Set(d.flatMap(h=>Object.keys(h.shape??{}))),$=T.safeParse(Object.fromEntries(Object.entries(c).filter(([h])=>!u.has(h)||Object.hasOwn(T.shape,h)))),W=d.map(h=>h.safeParse(c)),H=[...$.success?[]:[issuesText($.error)],...W.flatMap(h=>h.success?[]:[issuesText(h.error)])];if($.success&&H.length===0){m=$.data;for(const h of W)h.success&&(m={...m,...h.data})}else s.push(p("AK-M001",`${g} is not valid: ${H.join("; ")}.`,{where:{file:g}}))}}const I=m.defaults?.format,R=typeof I=="string"?I:"16x9",M=ke(e,m);for(const t of M.missing)s.push(p("AK-A001",`allyhub.config's fonts name ${t}, which is not in the project or its packages.`,{where:{file:g??"allyhub.config.ts"}}));const x=await ye(e,r,{...m.locales?{locales:m.locales}:{},text:m.text??j});s.push(...x.problems);const Q=r.filter(t=>/\.(ts|tsx|js|jsx|mts|mjs)$/u.test(t)&&!t.endsWith(".d.ts")),E=new Map;for(const t of Q){const c=ve(t,await oe(y(e,t),"utf8"));E.set(t,c),s.push(...Me(t,c,l,new Set(Object.keys(a.lent)),new Set(Object.keys(a.sdk))))}const _=[];for(const[t,c]of E){if(!Ee(t,c).components)continue;const d=await b.request({type:"components",file:t});if(s.push(...d.problems),!!d.ok)for(const u of d.value??[])typeof u.name=="string"&&typeof u.export=="string"&&_.push({name:u.name,file:t,export:u.export,...typeof u.label=="string"||typeof u.label=="object"&&u.label!==null?{label:u.label}:{}})}const v=await Pe(i.items,n.kinds,s),P=new Map,N=(t,c)=>({root:e,files:r,meta:b,media:o,messages:x,defaultFormat:R,config:m,lent:t,data:c,parsed:d=>E.get(d),items:i.items,claim:(d,u)=>{const $=P.get(d);return $===void 0&&P.set(d,u),$},contributionsTo:()=>[]}),L=(t,c)=>({...t,contributionsTo:d=>ue(n.kinds,c.kind,d)}),k=[];let S={};const Y=N({},{}),A=new Map,D=new Map,B=(t,c)=>{A.set(t,[...A.get(t)??[],...c.files??[]]),c.uses&&c.uses.length>0&&D.set(t,[...D.get(t)??[],...c.uses])};for(const t of i.items){const c=await v.get(t)?.lend?.(t,L(Y,t));c&&(k.push(c),B(t,c),S={...S,...c.data})}const C={...await pe(e,r.filter(t=>!i.items.some(c=>c.entry===t)),m.text??j),...S},Z=N(S,C);for(const t of i.items){const c=await v.get(t)?.read?.(t,L(Z,t));c&&(k.push(c),B(t,c));const d=new Set([t.entry]);t.files=[{path:t.entry,role:"entry"},...(A.get(t)??[]).filter(u=>!d.has(u.path)&&!!d.add(u.path))]}for(const t of k)s.push(...t.problems??[]);const ee=new Set(i.items.flatMap(t=>v.get(t)?.onStage?[t.kind]:[]));s.push(...De(i.items,n.kinds,D,{live:t=>ee.has(t),lent:new Set(Object.keys(S))}));const te=k.flatMap(t=>t.piece?[t.piece]:[]),se=k.flatMap(t=>t.doc?[t.doc]:[]),ne=k.flatMap(t=>t.sheet?[t.sheet]:[]),U=[...k.filter(t=>t.piece),...k.filter(t=>!t.piece)].flatMap(t=>t.stage?[t.stage]:[]),O=x.locales[0];await Ae(e,O===void 0?{}:x.messages[O]??{},O===void 0?void 0:x.files[O]);let F;if(n.buildDir&&U.length>0){const t=Object.fromEntries(await Promise.all(U.map(async d=>[d.name,await _e(e,d)]))),c=await Te(e);try{const d=await Fe({root:e,entries:t,outDir:n.buildDir,plugins:[Se({root:e,media:o,dependencies:l,fonts:()=>M.styles,stageEntries:new Set(Object.values(t)),lent:a.lent,sdk:a.sdk,bound:a.bound,parts:a.parts}),...a.plugins],...c?{user:c}:{}}),u=await a.written(n.buildDir);F={dir:n.buildDir,chunks:d,beside:u}}catch(d){s.push(p("AK-R001",`The pieces could not be bundled for the stage: ${d.message.split(`
3
+ `).slice(0,3).join(" ")}`,{}))}}const J=new Set;return{root:e,kinds:n.kinds,files:r,items:i.items,config:m,defaultFormat:R,dependencies:[...l].sort(),messages:x,media:o,data:C,docs:se,sheets:ne,pieces:te,components:_,fonts:M.styles,...F?{bundle:F}:{},problems:s.filter(t=>{const c=`${t.code}|${t.message}|${t.where?.file??""}|${String(t.where?.line??"")}`;return J.has(c)?!1:(J.add(c),!0)})}}finally{await b.close()}}export const BUILD_FOLDER="build/",stageName=e=>e.replaceAll("/","__"),stageId=e=>"components"in e?e.place:e.id;export function stageItem(e,n){return e.pieces.find(s=>s.id===n)??e.docs.find(s=>s.place===n&&s.components.length>0)}async function _e(e,n){const s=(n.components??[]).filter(o=>o.item!==!0);if(s.length===0&&n.module!==void 0)return y(e,n.module);const r=y(e,re,"stage-entries");await ie(r,{recursive:!0});const f=y(r,`${n.name}.ts`),i=[...new Set(s.map(o=>o.module))],l=[`// The components ${n.of??n.module??n.name} shows by their module (generated by the build).`,...n.module===void 0?[]:[`export { default } from ${JSON.stringify(y(e,n.module))};`],...i.map((o,a)=>`import * as m${String(a)} from ${JSON.stringify(y(e,o))};`),"export const components = {",...s.map(o=>` ${JSON.stringify(o.of)}: m${String(i.indexOf(o.module))}[${JSON.stringify(o.name)}],`),"};",""];return await ce(f,l.join(`
4
+ `)),f}async function Pe(e,n,s){const r=new Map,f=new Map;for(const i of e){if(!r.has(i.kind)){const o=n.find(a=>a.id===i.kind);r.set(i.kind,await V(o)?.catch(a=>{s.push(p("AK-R001",`The ${o?.extension??i.kind} extension's build module did not load, so its items are not read: ${a instanceof Error?a.message:String(a)}`,{}))}))}const l=r.get(i.kind);l&&f.set(i,l)}return f}function K(e,n){const s=[],r=new Set,f=new Set,i=l=>{if(f.has(l))return;f.add(l);const o=e.bundle?.chunks.chunks[l];if(o){l!==n&&s.push(`${BUILD_FOLDER}${l}`);for(const a of o.css)r.add(`${BUILD_FOLDER}${a}`);for(const a of o.imports)i(a)}};return i(n),{imports:s,styles:[...r]}}export function sourceOf(e,n){if("components"in n)return Le(e,n);const s=n,r=BUILD_FOLDER,f=stageName(s.id),i=e.bundle?.chunks.entries[f];if(!i)throw new Error(`${s.id} was not bundled for the stage.`);const{imports:l,styles:o}=K(e,i.file);return{piece:s.id,file:s.file,module:`${r}${i.file}`,imports:l,styles:o,dims:s.dims,...s.matrix?{matrix:{space:s.matrix.space,rules:s.matrix.rules}}:{},format:s.format,locales:e.messages.locales,messages:e.messages.messages,anchors:e.messages.anchors,text:e.config.text??j,...s.script===void 0?{}:{script:s.script},media:Object.fromEntries(Object.entries(e.media).map(([a,b])=>[a,{...b,url:X(a)}])),data:e.data,kind:s.kind,...s.loads,...G(e.config),pieces:z(e,s.place)}}function z(e,n){const s=new Map(e.items.map(i=>[i.id,i])),r=new Set,f=i=>{for(const l of s.get(i)?.uses??[])l.type!==fe.live||r.has(l.item)||(r.add(l.item),f(l.item))};return f(n),Object.fromEntries(e.pieces.map(i=>{const l={file:i.file,dims:i.dims,format:i.format,...i.matrix?{matrix:{space:i.matrix.space,rules:i.matrix.rules}}:{}},o=e.bundle?.chunks.entries[stageName(i.id)];if(!r.has(i.place)||i.place===n||!o)return[i.id,l];const{imports:a,styles:b}=K(e,o.file);return[i.id,{...l,kind:i.kind,module:`${BUILD_FOLDER}${o.file}`,imports:a,styles:b,...i.script===void 0?{}:{script:i.script},...i.loads?.kindData===void 0?{}:{kindData:i.loads.kindData}}]}))}const Ne="1920x1080";function Le(e,n){const s=stageName(n.place),r=e.bundle?.chunks.entries[s];if(!r)throw new Error(`${n.place} shows no component: it has no stage bundle.`);const{imports:f,styles:i}=K(e,r.file);return{kind:"doc",piece:n.place,file:n.file,module:`${BUILD_FOLDER}${r.file}`,imports:f,styles:i,dims:he(void 0,{locales:e.messages.locales}),format:Ne,locales:e.messages.locales,messages:e.messages.messages,anchors:e.messages.anchors,text:e.config.text??j,media:Object.fromEntries(Object.entries(e.media).map(([l,o])=>[l,{...o,url:X(l)}])),data:e.data,...G(e.config),pieces:z(e,n.place)}}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{readFile as c,realpath as u,stat as d}from"node:fs/promises";import{dirname as a,join as s,resolve as i}from"node:path";import{CONFIG_FILES as p,PACKAGE_FILE as l}from"@allyhub/formats";const h=["allyhub","@allyhub/sdk"];async function y(t){const e=await c(s(t,l),"utf8").catch(()=>{});if(e!==void 0)try{const r=JSON.parse(e);for(const o of["dependencies","devDependencies"]){const n=r[o];if(typeof n=="object"&&n!==null&&h.some(f=>f in n))return!0}}catch{}for(const r of p)if(await d(s(t,r)).then(()=>!0,()=>!1))return!0;return!1}export async function projectRoot(t,e){const r=i(t,e??".");return await projectAt(r)??r}export async function projectAt(t){for(let e=i(t);;e=a(e)){if(await y(e))return e;if(a(e)===e)return}}export async function projectOfFile(t,e,r){if(r!==void 0)return{root:i(e,r),foundBy:"dir"};const o=await projectAt(e),n=await projectAt(a(i(e,t)));return n!==void 0?o!==void 0&&await u(n).catch(()=>n)===await u(o).catch(()=>o)?{root:n,foundBy:"file"}:{root:n,foundBy:"file",warning:`${t} is in the project ${n}, ${o===void 0?"and the current folder is in none":`not the current folder's (${o})`}: what is measured of it is kept there.`}:o!==void 0?{root:o,foundBy:"cwd"}:{root:i(e),foundBy:"none",warning:`No project above ${t} or the current folder: what is measured is kept in ${i(e)}.`}}
2
+ import{readFile as c,realpath as s,stat as d}from"node:fs/promises";import{dirname as a,join as u,resolve as i}from"node:path";import{CONFIG_FILES as p,PACKAGE_FILE as l}from"@allyhub/formats/layout";export const SDK="@allyhub/sdk";const h=["allyhub",SDK];async function y(t){const e=await c(u(t,l),"utf8").catch(()=>{});if(e!==void 0)try{const r=JSON.parse(e);for(const o of["dependencies","devDependencies"]){const n=r[o];if(typeof n=="object"&&n!==null&&h.some(f=>f in n))return!0}}catch{}for(const r of p)if(await d(u(t,r)).then(()=>!0,()=>!1))return!0;return!1}export async function projectRoot(t,e){const r=i(t,e??".");return await projectAt(r)??r}export async function projectAt(t){for(let e=i(t);;e=a(e)){if(await y(e))return e;if(a(e)===e)return}}export async function projectOfFile(t,e,r){if(r!==void 0)return{root:i(e,r),foundBy:"dir"};const o=await projectAt(e),n=await projectAt(a(i(e,t)));return n!==void 0?o!==void 0&&await s(n).catch(()=>n)===await s(o).catch(()=>o)?{root:n,foundBy:"file"}:{root:n,foundBy:"file",warning:`${t} is in the project ${n}, ${o===void 0?"and the current folder is in none":`not the current folder's (${o})`}: what is measured of it is kept there.`}:o!==void 0?{root:o,foundBy:"cwd"}:{root:i(e),foundBy:"none",warning:`No project above ${t} or the current folder: what is measured is kept in ${i(e)}.`}}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{builtinModules as A}from"node:module";import{parseSync as E,visitorKeys as K}from"oxc-parser";import{problem as u}from"@allyhub/diagnostics";import{repoPath as k}from"@allyhub/piece";export function parse(t,r){const e=E(t,r,{sourceType:"module"});return{program:e.program,errors:e.errors.map(o=>({message:o.message,...o.labels[0]?{start:o.labels[0].start}:{}})),source:r}}export function lineAt(t,r){let e=1;for(let o=0;o<r&&o<t.length;o++)t.charCodeAt(o)===10&&e++;return e}const d=t=>typeof t=="object"&&t!==null&&typeof t.type=="string",I=new Set(["typeAnnotation","typeParameters","typeArguments","returnType","superTypeArguments","implements"]);export function walk(t,r){const e=[],o=s=>{if(s.type.startsWith("TS")){const i=s.expression;d(i)&&(e.push(s),o(i),e.pop());return}if(!((s.type==="ImportDeclaration"||s.type==="ExportNamedDeclaration")&&s.importKind==="type")){r(s,e),e.push(s);for(const i of K[s.type]??Object.keys(s)){if(I.has(i))continue;const a=s[i];if(Array.isArray(a))for(const l of a)d(l)&&o(l);else d(a)&&o(a)}e.pop()}};o(t)}export const SDK="@allyhub/sdk";function w(t,r,e=SDK){const o=new Set;for(const s of t.body)if(!(s.type!=="ImportDeclaration"||s.source.value!==e))for(const a of s.specifiers??[]){if(a.type!=="ImportSpecifier")continue;const l=a.imported;(l.name??l.value)===r&&o.add(a.local.name)}return o}function y(t){let r=t;for(;["TSAsExpression","TSSatisfiesExpression","ParenthesizedExpression","TSNonNullExpression"].includes(r.type)&&d(r.expression);)r=r.expression;return r}const x=(t,r)=>{if(!t)return!1;const e=y(t);if(e.type!=="CallExpression")return!1;const o=e.callee;return o.type==="Identifier"&&r.has(o.name)},S=[["video",SDK],["presentation",`${SDK}/slides`]];export function discover(t,r){const e=[],{program:o,source:s}=r,i=new Set(S.flatMap(([c,m])=>[...w(o,c,m)])),a=w(o,"defineComponent").size>0,l=o.body,p=l.find(c=>c.type==="ExportDefaultDeclaration"),h=c=>({file:t,line:lineAt(s,c.start)});if(!p)return i.size>0&&/\bexport\s+\{[^}]*\bdefault\b/.test(s)&&e.push(u("AK-M001",`${t} imports ${[...i].join(" and ")}, but its default export is a re-export. An item's entry file writes export default video({ … }) (or presentation(…)) itself: AllyHub does not look in other files.`,{where:{file:t}})),{piece:!1,components:a,problems:e};const n=p.declaration;if(x(n,i))return{piece:!0,components:a,problems:e};const f=y(n);if(f.type==="Identifier"){const c=f.name;for(const m of l)if(m.type==="VariableDeclaration")for(const $ of m.declarations){const b=$.id;if(b.type==="Identifier"&&b.name===c&&x($.init,i))return{piece:!0,components:a,problems:e}}}return i.size>0?e.push(u("AK-M001",`${t} imports ${[...i].join(" and ")}, but its default export is not a video(…) or presentation(…) call. Write export default video({ … }) (presentation(…) for a deck), or const film = video({ … }); export default film. AllyHub does not follow factory functions or conditional expressions.`,{where:h(p)})):x(n,new Set(S.map(([c])=>c)))&&e.push(u("AK-M001",`The ${String(y(n).callee.name)} that ${t} calls is not imported from ${SDK}. Write import { video } from "${SDK}" (import { presentation } from "${SDK}/slides" for a deck).`,{where:h(p)})),{piece:!1,components:a,problems:e}}const j=new Set([...A,...A.map(t=>`node:${t}`)]),g="@allyhub-next/";export function currentName(t){return t.startsWith(g)?`@allyhub/${t.slice(g.length)}`:t}export function packageName(t){const r=t.split("/");return t.startsWith("@")?r.slice(0,2).join("/"):r[0]??t}export function checkImports(t,r,e,o,s){const i=[],{program:a,source:l}=r;for(const p of a.body){if(!/^(Import|ExportNamed|ExportAll)Declaration$/.test(p.type)||p.importKind==="type"||p.exportKind==="type")continue;const n=p.source?.value;if(typeof n!="string")continue;const f={file:t,line:lineAt(l,p.start)};if(/^(https?:)?\/\//i.test(n)){i.push(u("AK-B005",`${t} imports the remote address ${n}. The build has no network: install it as an npm package, or put it in the project.`,{where:f}));continue}if(n.startsWith(".")||n.startsWith("/")){k(t,n)===void 0&&i.push(u("AK-B005",`${t} imports ${n}, a file outside the project. Put it in the project.`,{where:f}));continue}if(packageName(n)===SDK){s.has(n)||i.push(u("AK-B006",n===`${SDK}/components`?`${t} imports ${n}: the components are not part of the SDK. A project has its own copies: allyhub add lists the starter components and copies one in (allyhub add component/screen-demo).`:`${t} imports ${n}, which ${SDK} does not have. Its entry points: ${[...s].sort().join(", ")}.`,{where:f}));continue}if(j.has(n))continue;const c=packageName(currentName(n));o.has(c)||e.has(packageName(n))||i.push(u("AK-B005",`${t} imports ${n}, but package.json does not declare ${packageName(n)}. Add it with npm install ${packageName(n)}${n.startsWith("@fontsource/")?", or keep the font and a .css of @font-face rules under assets/fonts/":""}.`,{where:f}))}return i}
2
+ import{builtinModules as w}from"node:module";import{parseSync as K,visitorKeys as I}from"oxc-parser";import{problem as m}from"@allyhub/diagnostics";import{repoPath as j}from"@allyhub/piece";import{SDK as l}from"./project-root.js";export function parse(t,r){const e=K(t,r,{sourceType:"module"});return{program:e.program,errors:e.errors.map(o=>({message:o.message,...o.labels[0]?{start:o.labels[0].start}:{}})),source:r}}export function lineAt(t,r){let e=1;for(let o=0;o<r&&o<t.length;o++)t.charCodeAt(o)===10&&e++;return e}const h=t=>typeof t=="object"&&t!==null&&typeof t.type=="string",k=new Set(["typeAnnotation","typeParameters","typeArguments","returnType","superTypeArguments","implements"]);export function walk(t,r){const e=[],o=s=>{if(s.type.startsWith("TS")){const i=s.expression;h(i)&&(e.push(s),o(i),e.pop());return}if(!((s.type==="ImportDeclaration"||s.type==="ExportNamedDeclaration")&&s.importKind==="type")){r(s,e),e.push(s);for(const i of I[s.type]??Object.keys(s)){if(k.has(i))continue;const p=s[i];if(Array.isArray(p))for(const f of p)h(f)&&o(f);else h(p)&&o(p)}e.pop()}};o(t)}export{l as SDK};function S(t,r,e=l){const o=new Set;for(const s of t.body)if(!(s.type!=="ImportDeclaration"||s.source.value!==e))for(const p of s.specifiers??[]){if(p.type!=="ImportSpecifier")continue;const f=p.imported;(f.name??f.value)===r&&o.add(p.local.name)}return o}function x(t){let r=t;for(;["TSAsExpression","TSSatisfiesExpression","ParenthesizedExpression","TSNonNullExpression"].includes(r.type)&&h(r.expression);)r=r.expression;return r}const $=(t,r)=>{if(!t)return!1;const e=x(t);if(e.type!=="CallExpression")return!1;const o=e.callee;return o.type==="Identifier"&&r.has(o.name)},g=[["video",l],["presentation",`${l}/slides`]];export function discover(t,r){const e=[],{program:o,source:s}=r,i=new Set(g.flatMap(([c,d])=>[...S(o,c,d)])),p=S(o,"defineComponent").size>0,f=o.body,a=f.find(c=>c.type==="ExportDefaultDeclaration"),y=c=>({file:t,line:lineAt(s,c.start)});if(!a)return i.size>0&&/\bexport\s+\{[^}]*\bdefault\b/.test(s)&&e.push(m("AK-M001",`${t} imports ${[...i].join(" and ")}, but its default export is a re-export. An item's entry file writes export default video({ … }) (or presentation(…)) itself: AllyHub does not look in other files.`,{where:{file:t}})),{piece:!1,components:p,problems:e};const n=a.declaration;if($(n,i))return{piece:!0,components:p,problems:e};const u=x(n);if(u.type==="Identifier"){const c=u.name;for(const d of f)if(d.type==="VariableDeclaration")for(const b of d.declarations){const A=b.id;if(A.type==="Identifier"&&A.name===c&&$(b.init,i))return{piece:!0,components:p,problems:e}}}return i.size>0?e.push(m("AK-M001",`${t} imports ${[...i].join(" and ")}, but its default export is not a video(…) or presentation(…) call. Write export default video({ … }) (presentation(…) for a deck), or const film = video({ … }); export default film. AllyHub does not follow factory functions or conditional expressions.`,{where:y(a)})):$(n,new Set(g.map(([c])=>c)))&&e.push(m("AK-M001",`The ${String(x(n).callee.name)} that ${t} calls is not imported from ${l}. Write import { video } from "${l}" (import { presentation } from "${l}/slides" for a deck).`,{where:y(a)})),{piece:!1,components:p,problems:e}}const T=new Set([...w,...w.map(t=>`node:${t}`)]),E="@allyhub-next/";export function currentName(t){return t.startsWith(E)?`@allyhub/${t.slice(E.length)}`:t}export function packageName(t){const r=t.split("/");return t.startsWith("@")?r.slice(0,2).join("/"):r[0]??t}export function checkImports(t,r,e,o,s){const i=[],{program:p,source:f}=r;for(const a of p.body){if(!/^(Import|ExportNamed|ExportAll)Declaration$/.test(a.type)||a.importKind==="type"||a.exportKind==="type")continue;const n=a.source?.value;if(typeof n!="string")continue;const u={file:t,line:lineAt(f,a.start)};if(/^(https?:)?\/\//i.test(n)){i.push(m("AK-B005",`${t} imports the remote address ${n}. The build has no network: install it as an npm package, or put it in the project.`,{where:u}));continue}if(n.startsWith(".")||n.startsWith("/")){j(t,n)===void 0&&i.push(m("AK-B005",`${t} imports ${n}, a file outside the project. Put it in the project.`,{where:u}));continue}if(packageName(n)===l){s.has(n)||i.push(m("AK-B006",n===`${l}/components`?`${t} imports ${n}: the components are not part of the SDK. A project has its own copies: allyhub add lists the starter components and copies one in (allyhub add component/screen-demo).`:`${t} imports ${n}, which ${l} does not have. Its entry points: ${[...s].sort().join(", ")}.`,{where:u}));continue}if(T.has(n))continue;const c=packageName(currentName(n));o.has(c)||e.has(packageName(n))||i.push(m("AK-B005",`${t} imports ${n}, but package.json does not declare ${packageName(n)}. Add it with npm install ${packageName(n)}${n.startsWith("@fontsource/")?", or keep the font and a .css of @font-face rules under assets/fonts/":""}.`,{where:u}))}return i}
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{parseSync as w}from"oxc-parser";export function partImports(u,r,o){const s=new Set(Object.values(o).map(t=>t.of));if(![...s].some(t=>r.includes(t)))return[];const i=w(u,r,{sourceType:"module"});if(i.errors.length>0)return[];const{staticImports:c,staticExports:p,dynamicImports:h}=i.module,a=[];for(const t of s){const l=c.filter(e=>e.moduleRequest.value===t);if(l.length===0)continue;const q=p.some(e=>e.entries.some(n=>n.moduleRequest?.value===t)),R=h.some(e=>r.slice(e.moduleRequest.start,e.moduleRequest.end).includes(t));if(q||R)continue;const f=new Set;let m=!1;for(const e of l){e.entries.length===0&&(m=!0);for(const n of e.entries)n.importName.name===null?m=!0:f.add(n.importName.name)}if(m)continue;const d=Object.entries(o).find(([,e])=>e.of===t&&[...f].every(n=>e.names.includes(n)));if(d)for(const e of l)a.push({start:e.moduleRequest.start,end:e.moduleRequest.end,to:d[0]})}return a}export function withParts(u,r){let o=u;for(const s of[...r].sort((i,c)=>c.start-i.start))o=`${o.slice(0,s.start)}${JSON.stringify(s.to)}${o.slice(s.end)}`;return o}
@@ -1,3 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{join as f}from"node:path";import{build as d,createServer as u,createServerModuleRunner as m,loadConfigFromFile as p,mergeConfig as h}from"vite";import{CACHE_DIR as g}from"@allyhub/formats";const y=["plugins","resolve","css","define","json","assetsInclude","oxc"];export async function loadUserVite(e,r="production"){const s=await p({command:r==="production"?"build":"serve",mode:r},void 0,e,"silent",void 0,"runner");if(!s)return;const t={};for(const n of y)s.config[n]!==void 0&&Object.assign(t,{[n]:s.config[n]});return{file:s.path.startsWith(e)?s.path.slice(e.length+1):s.path,config:t}}const l=(e,r,s,t=[])=>{const n={ssr:{noExternal:[...t]}},{plugins:o,...i}=s?.config??{},a=h(n,i),c=o?[o]:[];return{...a,root:e,configFile:!1,envDir:!1,publicDir:!1,logLevel:"silent",clearScreen:!1,plugins:[...r,...c]}};export async function createModuleLoader(e,r,s={}){const t=await u({...l(e,r,s.user,s.inline),mode:s.mode??"production",appType:"custom",server:{middlewareMode:!0,hmr:!1,ws:!1,watch:null},optimizeDeps:{noDiscovery:!0,include:[]}}),n=t.environments.ssr,o=m(n,{hmr:!1});return{async import(i){return o.import(i)},async close(){await o.close(),await t.close()}}}export function compileErrorOf(e){const r=e,s=r.loc?.file??r.id;return{message:(r.message??String(e)).split(`
3
- `)[0]??"",...s?{file:s.replace(/[?#].*$/,"")}:{},...r.loc?.line===void 0?{}:{line:r.loc.line},...r.loc?.column===void 0?{}:{column:r.loc.column},...r.frame?{frame:r.frame}:{}}}export async function createStageDevServer(e){const r=await u({...l(e.root,e.plugins,e.user),base:e.base,appType:"custom",mode:"development",cacheDir:f(e.root,g,"vite"),server:{middlewareMode:!0,hmr:!1,ws:!1,watch:null,fs:{strict:!0,allow:[e.root,...e.allow]}},optimizeDeps:{noDiscovery:!0,include:[]},build:{target:"es2022"}}),s=r.environments.client.moduleGraph;return{handle(t,n,o){r.middlewares(t,n,o)},changed(t){const n=new Set,o=i=>{const a=i.id??"";if(!n.has(a)){n.add(a);for(const c of i.importers)o(c)}};for(const i of t){for(const a of s.getModulesByFile(i)??[])o(a);s.onFileChange(i)}return n},invalidate(t){for(const n of t){const o=s.getModuleById(n);o&&s.invalidateModule(o)}},async close(){await r.close()}}}function v(e){const r=Array.isArray(e)?e:[e],s={entries:{},chunks:{},files:[]};for(const t of r)if("output"in t)for(const n of t.output){if(n.fileName.endsWith(".map")||s.files.push(n.fileName),n.type!=="chunk")continue;const o=n.viteMetadata,i={file:n.fileName,imports:[...n.imports],dynamicImports:[...n.dynamicImports],css:[...o?.importedCss??[]],assets:[...o?.importedAssets??[]],modules:[...n.moduleIds]};s.chunks[n.fileName]=i,n.isEntry&&(s.entries[n.name]=i)}return s}export async function bundleForStage(e){const r=await d({...l(e.root,e.plugins,e.user),base:"./",mode:"production",build:{outDir:e.outDir,emptyOutDir:!1,write:!0,copyPublicDir:!1,minify:!1,sourcemap:"hidden",target:"es2022",modulePreload:!1,reportCompressedSize:!1,cssCodeSplit:!0,assetsDir:"assets",rolldownOptions:{input:e.entries,preserveEntrySignatures:"exports-only",output:{format:"es",entryFileNames:"pieces/[name].[hash].js",chunkFileNames:"chunks/[name].[hash].js",assetFileNames:"assets/[name].[hash][extname]"}}}});return v(r)}
2
+ import{join as d}from"node:path";import{CACHE_DIR as m}from"@allyhub/formats";const l=()=>import("vite"),p=["plugins","resolve","css","define","json","assetsInclude","oxc"];export async function loadUserVite(e,t="production"){const{loadConfigFromFile:s}=await l(),i=await s({command:t==="production"?"build":"serve",mode:t},void 0,e,"silent",void 0,"runner");if(!i)return;const n={};for(const r of p)i.config[r]!==void 0&&Object.assign(n,{[r]:i.config[r]});return{file:i.path.startsWith(e)?i.path.slice(e.length+1):i.path,config:n}}const f=async(e,t,s,i=[])=>{const n={ssr:{noExternal:[...i]}},{plugins:r,...o}=s?.config??{},{mergeConfig:a}=await l(),c=a(n,o),u=r?[r]:[];return{...c,root:e,configFile:!1,envDir:!1,publicDir:!1,logLevel:"silent",clearScreen:!1,plugins:[...t,...u]}};export async function createModuleLoader(e,t,s={}){const{createServer:i,createServerModuleRunner:n}=await l(),r=await i({...await f(e,t,s.user,s.inline),mode:s.mode??"production",appType:"custom",server:{middlewareMode:!0,hmr:!1,ws:!1,watch:null},optimizeDeps:{noDiscovery:!0,include:[]}}),o=r.environments.ssr,a=n(o,{hmr:!1});return{async import(c){return a.import(c)},async close(){await a.close(),await r.close()}}}export function compileErrorOf(e){const t=e,s=t.loc?.file??t.id;return{message:(t.message??String(e)).split(`
3
+ `)[0]??"",...s?{file:s.replace(/[?#].*$/,"")}:{},...t.loc?.line===void 0?{}:{line:t.loc.line},...t.loc?.column===void 0?{}:{column:t.loc.column},...t.frame?{frame:t.frame}:{}}}export async function createStageDevServer(e){const{createServer:t}=await l(),s=await t({...await f(e.root,e.plugins,e.user),base:e.base,appType:"custom",mode:"development",cacheDir:d(e.root,m,"vite"),server:{middlewareMode:!0,hmr:!1,ws:!1,watch:null,fs:{strict:!0,allow:[e.root,...e.allow]}},optimizeDeps:{noDiscovery:!0,include:[]},build:{target:"es2022"}}),i=s.environments.client.moduleGraph;return{handle(n,r,o){s.middlewares(n,r,o)},changed(n){const r=new Set,o=a=>{const c=a.id??"";if(!r.has(c)){r.add(c);for(const u of a.importers)o(u)}};for(const a of n){for(const c of i.getModulesByFile(a)??[])o(c);i.onFileChange(a)}return r},invalidate(n){for(const r of n){const o=i.getModuleById(r);o&&i.invalidateModule(o)}},async close(){await s.close()}}}function h(e){const t=Array.isArray(e)?e:[e],s={entries:{},chunks:{},files:[]};for(const i of t)if("output"in i)for(const n of i.output){if(n.fileName.endsWith(".map")||s.files.push(n.fileName),n.type!=="chunk")continue;const r=n.viteMetadata,o={file:n.fileName,imports:[...n.imports],dynamicImports:[...n.dynamicImports],css:[...r?.importedCss??[]],assets:[...r?.importedAssets??[]],modules:[...n.moduleIds]};s.chunks[n.fileName]=o,n.isEntry&&(s.entries[n.name]=o)}return s}export async function bundleForStage(e){const{build:t}=await l(),s=await t({...await f(e.root,e.plugins,e.user),base:"./",mode:"production",build:{outDir:e.outDir,emptyOutDir:!1,write:!0,copyPublicDir:!1,minify:!1,sourcemap:"hidden",target:"es2022",modulePreload:!1,reportCompressedSize:!1,cssCodeSplit:!0,assetsDir:"assets",rolldownOptions:{input:e.entries,preserveEntrySignatures:"exports-only",output:{format:"es",entryFileNames:"pieces/[name].[hash].js",chunkFileNames:"chunks/[name].[hash].js",assetFileNames:"assets/[name].[hash][extname]"}}}});return h(s)}
@@ -1,11 +1,19 @@
1
1
  {
2
2
  "name": "@allyhub/build",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
8
8
  "default": "./dist/index.js"
9
+ },
10
+ "./project-root": {
11
+ "types": "./dist/project-root.d.ts",
12
+ "default": "./dist/project-root.js"
13
+ },
14
+ "./inspect-view": {
15
+ "types": "./dist/inspect-view.d.ts",
16
+ "default": "./dist/inspect-view.js"
9
17
  }
10
18
  },
11
19
  "private": true,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/canvas-extension",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./package.json": "./package.json",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/canvas-model",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/chart",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,3 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{itemFiles as Me,listsFile as Ce,within as Le}from"@allyhub/formats";import{createHash as ae}from"node:crypto";import{uniformInt as fe}from"pure-rand/distribution/uniformInt";import{xoroshiro128plus as Pe}from"pure-rand/generator/xoroshiro128plus";import{fileProblems as Ie,listedFileProblems as ve,inTime as de,itemKindBuild as N}from"@allyhub/build";import{readPng as me}from"@allyhub/measure";import{countLevels as De,problem as ue}from"@allyhub/diagnostics";import{comboIdOf as j,comboKey as le,comboMatches as Ee,coverCombos as Fe,pieceNamed as B,CONSOLE_LIMIT as Oe}from"@allyhub/piece";import{OutputCache as Ke,cacheKey as _e,checkerId as Ae}from"./cache.js";import{consoleOf as Te,baseDigest as Ne,outputDigest as pe,dedupe as he,StuckError as we,CheckSession as je,runtimeDigest as Be,extraCombos as He,measureParts as Re,kindsNeeded as ze}from"@allyhub/project";export function checkStats(e,s,i,t=0){const o=s.length;return{loaded:s,reused:i,outputs:{total:e,checked:o,reused:Math.max(0,e-o-t),covered:t}}}export const plural=(e,s)=>`${String(e)} ${s}${e===1?"":"s"}`;const be=e=>Pe(ae("sha256").update(e).digest().readInt32BE(0));export function samplesFor(e,s,i,t){const o=new Set(e.slice(0,t)),r=be(i),c=Math.floor(s*30);for(let a=0;o.size<Math.min(t,c)&&a<t*20;a++)o.add(fe(r,0,c-1)/30);return[...o]}export function shuffled(e,s){const i=[...e],t=be(s);for(let o=i.length-1;o>0;o--){const r=fe(t,0,o),c=i[o],a=i[r];c===void 0||a===void 0||(i[o]=a,i[r]=c)}return i}export const RASTER_NOISE=3,RASTER_SPECKS=8;export function frameDifference(e,s){const i=me(e),t=me(s);if(i.width!==t.width||i.height!==t.height)return{max:255,pixels:Math.max(i.width*i.height,1)};let o=0,r=0;for(let c=0;c<i.data.length;c+=4){let a=0;for(let p=0;p<4;p++)a=Math.max(a,Math.abs((i.data[c+p]??0)-(t.data[c+p]??0)));a>RASTER_NOISE&&r++,a>o&&(o=a)}return{max:o,pixels:r}}const ge=e=>ae("sha256").update(e).digest("hex");export async function determinism(e,s,i){const t=e.timeline,o=samplesFor(t.parts.map(f=>f.still),t.duration,s,i),r=new Map;for(const f of[...o].sort((m,k)=>m-k))r.set(f,await e.shot(f));const c=[];let a=0;for(const f of shuffled(o,`${s}:shuffle`)){const m=r.get(f),k=await e.shot(f);if(!m||ge(k)===ge(m))continue;const S=frameDifference(m,k);S.pixels>RASTER_SPECKS&&(c.push(f),a=Math.max(a,S.max))}if(c.length===0)return[];c.sort((f,m)=>f-m);const p=[...new Set(c.flatMap(f=>t.parts.filter(m=>f>=m.start&&f<m.end).map(m=>m.key)))];return[ue("AK-D002",`${plural(c.length,"moment")} drew differently in order and out of order (${c.map(f=>`${f.toFixed(2)}s`).join(", ")}; pixels differ by up to ${String(a)} levels). render must depend only on t, not on state left by an earlier frame.`,{piece:e.target.piece,output:e.target.output,combo:e.target.combo,format:e.target.format,t:c[0]??0,...p.length===1&&p[0]?{part:p[0]}:{}})]}function Ge(e,s){const i=e.piece===void 0?void 0:s.pieces.find(o=>o.id===e.piece)?.place??e.piece,t=e.where?.file;return s.items.filter(o=>o.id===i||t!==void 0&&Ce(Me(o),t))}export function askedProblems(e,s){return e.problems.filter(i=>{if(s===void 0)return!0;const t=Ge(i,e);return t.length===0||t.some(o=>B({id:o.id,path:o.entry},s))})}export function summarize(e){const s=De(e);return{status:s.errors>0?"failed":s.warnings>0?"warnings":"passed",...s}}function Ue(e,s){const i=r=>[r.piece??"",r.output??"",r.combo?le(r.combo):"",r.format??"",r.part??"",r.where?.file??"",String(r.where?.line??0).padStart(6,"0"),r.code].join("\0"),t=i(e),o=i(s);return t<o?-1:t>o?1:0}class Ye{spent=new Map;on=process.env.ALLYHUB_CHECK_TIMINGS==="1";async time(s,i){if(!this.on)return i();const t=performance.now();try{return await i()}finally{this.spent.set(s,(this.spent.get(s)??0)+(performance.now()-t)/1e3)}}report(){if(!this.on)return;const s=[...this.spent].sort((i,t)=>t[1]-i[1]);process.stderr.write(`Check timings (s): ${s.map(([i,t])=>`${i} ${t.toFixed(2)}`).join(", ")}
3
- `)}}async function qe(e){const s=[],i=new Set;for(const t of e){const o=await N(e,{kind:t.id});!o?.layers||i.has(o)||(i.add(o),s.push(o.layers))}return s}export async function runCheck(e){const s=new Ye,i=e.session??await s.time("prepare (discover, metadata, bundle)",()=>je.open({root:e.dir,kinds:ze(e.kinds),...e.buildDir===void 0?{}:{buildDir:e.buildDir},...e.gpu===void 0?{}:{gpu:e.gpu},...e.consoleLimit===void 0?{}:{consoleLimit:e.consoleLimit}}));try{const t=i.prepared,o=e.samples??12,r=i.consoleLimit,c=await Be(),a=await Ke.open(t.root,await Ae({kinds:t.kinds,runtimeSha:c,samples:o,gpu:i.gpu,...r===Oe?{}:{consoleLimit:r}})),p=e.facts!==!1,f=await qe(t.kinds),m=[],k=[...askedProblems(t,e.piece),...e.files===void 0?[]:await Ie(t.root,t.files.filter(n=>e.piece===void 0||Le(n,e.piece.replace(/^\.\//u,"").replace(/\/+$/u,""))),t.items,e.files),...e.files===void 0||e.piece!==void 0?[]:await ve(t.root,t.files,t.kinds,e.files)];let S=[];const K=[],H=[],R=[];let z=0,G=0;const U=[],ke=t.pieces.filter(n=>e.piece===void 0||B({id:n.id,path:n.place},e.piece));for(const n of ke){if(!t.bundle?.chunks.entries[n.id.replaceAll("/","__")])continue;const w=n.kind,M=n.format,q=await Ne(t,n,c),J=async y=>{const $={problems:[],facts:[]},W=new Set,v=[...n.combos.filter(u=>!e.combos?.length||e.combos.some(h=>Ee(u,h,j(n.matrix,u)))),...He(n,e.combos)],Se=new Set(n.matrix?Fe(n.matrix.space,n.dims,v):v.keys()),X=[],Z=u=>{H.push(u);for(const h of u.reads?.media??[])W.add(h.path);u.timeline&&X.push({...u,timeline:u.timeline})};let T=!1;const $e=(u,h,D)=>{if(e.fresh===!0)return;const d=a.get(u),C=d?.result.reads,E=d?.result.timeline;return!d||!C||!E||D&&!d.sampled||d.factless===!0&&p?void 0:pe(t,q,n,h,C)===d.digest?d:void 0};for(const[u,h]of v.entries()){const D=j(n.matrix,h),d={piece:n.id,output:w,combo:h,format:M},C=le(h);if(K.push({...d,...D?{id:D}:{},key:C}),!Se.has(u)){G++;continue}const E=de(n,t.kinds)&&!T,F=_e(n.id,w,C,M),x=$e(F,h,E);if(x){z++,x.sampled&&(T=!0),$.problems.push(...x.problems),$.facts.push(...x.facts),m.push({version:d,log:x.console}),Z({...x.result,digest:x.digest}),a.set(F,x);continue}R.push(`${n.id}/${w}/${C}/${M}`);const b=await s.time("load (mount, stills)",()=>i.open(n,d));try{const g=b.summary,L=[],P=[...g?.facts??[]],ee={problems:L,facts:P},te={target:d,layout:()=>s.time("layout measure",()=>de(n,t.kinds)?b.measure():Re(i,n,b,{fresh:e.fresh===!0}))};let ne=!1;try{if(g){try{await y.layout?.(b,ee,te)}catch(l){if(l instanceof we)throw l}if(p)for(const l of f){const I=l.facts?.bind(l);I&&P.push(...await s.time("layers' facts",()=>I(b)))}}if(g&&E&&(T=!0,ne=!0,L.push(...await s.time("determinism",()=>determinism(b,`${n.id}:${w}:${M}`,o))),await y.timing?.(b,ee,te)),g&&p)for(const l of f){const I=l.readBack?.bind(l);I&&P.push(...await s.time("layers read back",()=>I(b)))}}catch(l){if(!(l instanceof we))throw l;l.kept||L.push(ue("AK-P003",l.message,{piece:d.piece,output:d.output,combo:d.combo,format:d.format}))}L.push(...await b.problems());const ie=he(L);$.problems.push(...ie);const se=y.keep?.bind(y),oe=se?P.filter(l=>se(l)):P;$.facts.push(...oe);const re=await b.console();m.push({version:d,log:re});const O=g?pe(t,q,n,h,g.reads):void 0,ce={...d,...g?{timeline:g.timeline,reads:g.reads}:{}};Z({...ce,...O?{digest:O}:{}}),O&&a.set(F,{digest:O,result:ce,problems:ie,facts:oe,sampled:ne,...p?{}:{factless:!0},console:re})}finally{await b.close()}}return{...$,loaded:X,combos:v.map(u=>{const h=j(n.matrix,u);return{combo:u,...h===void 0?{}:{id:h}}}),media:W}},Q=await N(t.kinds,n),xe={root:t.root,piece:n,prepared:t,facts:p,...e.ffmpeg===void 0?{}:{ffmpeg:e.ffmpeg},mediaPath:y=>i.mediaPath(y),time:(y,$)=>s.time(y,$),versions:J},V=Q?.checkPiece?.bind(Q),A=V?await V(xe):await J({});k.push(...A.problems),S.push(...A.facts),U.push(...A.wholes??[])}for(const n of t.items){const w=await N(t.kinds,n);if(!w?.check||e.piece!==void 0&&!B({id:n.id,path:n.entry},e.piece))continue;const M=w.check.bind(w);k.push(...await s.time("items' own checks",()=>M(n,{root:t.root})))}await a.save(new Set(t.pieces.map(n=>n.id)));const Y=he(k).sort(Ue);for(const n of f){const w=n.current?.bind(n);w&&(S=await w(S,{root:t.root}))}s.report();const ye=new Set(t.pieces.map(n=>n.place)),_={};for(const n of t.items)ye.has(n.id)||(_[n.kind]=(_[n.kind]??0)+1);return{targets:K,items:_,check:summarize(Y),problems:Y,facts:S,results:H,wholes:U,stats:checkStats(K.length,R,z,G),console:Te(r,m)}}finally{e.session||await i.close()}}
2
+ import{itemFiles as Me,kindsUsed as Ce,listsFile as Le,within as Pe}from"@allyhub/formats";import{createHash as ae}from"node:crypto";import{uniformInt as de}from"pure-rand/distribution/uniformInt";import{xoroshiro128plus as Ie}from"pure-rand/generator/xoroshiro128plus";import{fileProblems as ve,listedFileProblems as De,inTime as fe,itemKindBuild as N}from"@allyhub/build";import{readPng as ue}from"@allyhub/measure";import{countLevels as Ee,problem as me}from"@allyhub/diagnostics";import{comboIdOf as j,comboKey as le,comboMatches as Fe,coverCombos as Oe,pieceNamed as B,CONSOLE_LIMIT as Ke}from"@allyhub/piece";import{OutputCache as _e,cacheKey as Ae,checkerId as Te}from"./cache.js";import{consoleOf as Ne,baseDigest as je,outputDigest as pe,dedupe as he,StuckError as we,CheckSession as Be,runtimeDigest as He,extraCombos as Re,measureParts as ze,kindsNeeded as Ue}from"@allyhub/project";export function checkStats(e,i,n,t=0){const o=i.length;return{loaded:i,reused:n,outputs:{total:e,checked:o,reused:Math.max(0,e-o-t),covered:t}}}export const plural=(e,i)=>`${String(e)} ${i}${e===1?"":"s"}`;const be=e=>Ie(ae("sha256").update(e).digest().readInt32BE(0));export function samplesFor(e,i,n,t){const o=new Set(e.slice(0,t)),r=be(n),c=Math.floor(i*30);for(let a=0;o.size<Math.min(t,c)&&a<t*20;a++)o.add(de(r,0,c-1)/30);return[...o]}export function shuffled(e,i){const n=[...e],t=be(i);for(let o=n.length-1;o>0;o--){const r=de(t,0,o),c=n[o],a=n[r];c===void 0||a===void 0||(n[o]=a,n[r]=c)}return n}export const RASTER_NOISE=3,RASTER_SPECKS=8;export function frameDifference(e,i){const n=ue(e),t=ue(i);if(n.width!==t.width||n.height!==t.height)return{max:255,pixels:Math.max(n.width*n.height,1)};let o=0,r=0;for(let c=0;c<n.data.length;c+=4){let a=0;for(let p=0;p<4;p++)a=Math.max(a,Math.abs((n.data[c+p]??0)-(t.data[c+p]??0)));a>RASTER_NOISE&&r++,a>o&&(o=a)}return{max:o,pixels:r}}const ge=e=>ae("sha256").update(e).digest("hex");export async function determinism(e,i,n){const t=e.timeline,o=samplesFor(t.parts.map(d=>d.still),t.duration,i,n),r=new Map;for(const d of[...o].sort((u,k)=>u-k))r.set(d,await e.shot(d));const c=[];let a=0;for(const d of shuffled(o,`${i}:shuffle`)){const u=r.get(d),k=await e.shot(d);if(!u||ge(k)===ge(u))continue;const S=frameDifference(u,k);S.pixels>RASTER_SPECKS&&(c.push(d),a=Math.max(a,S.max))}if(c.length===0)return[];c.sort((d,u)=>d-u);const p=[...new Set(c.flatMap(d=>t.parts.filter(u=>d>=u.start&&d<u.end).map(u=>u.key)))];return[me("AK-D002",`${plural(c.length,"moment")} drew differently in order and out of order (${c.map(d=>`${d.toFixed(2)}s`).join(", ")}; pixels differ by up to ${String(a)} levels). render must depend only on t, not on state left by an earlier frame.`,{piece:e.target.piece,output:e.target.output,combo:e.target.combo,format:e.target.format,t:c[0]??0,...p.length===1&&p[0]?{part:p[0]}:{}})]}function Ge(e,i){const n=e.piece===void 0?void 0:i.pieces.find(o=>o.id===e.piece)?.place??e.piece,t=e.where?.file;return i.items.filter(o=>o.id===n||t!==void 0&&Le(Me(o),t))}export function askedProblems(e,i){return e.problems.filter(n=>{if(i===void 0)return!0;const t=Ge(n,e);return t.length===0||t.some(o=>B({id:o.id,path:o.entry},i))})}export function summarize(e){const i=Ee(e);return{status:i.errors>0?"failed":i.warnings>0?"warnings":"passed",...i}}function Ye(e,i){const n=r=>[r.piece??"",r.output??"",r.combo?le(r.combo):"",r.format??"",r.part??"",r.where?.file??"",String(r.where?.line??0).padStart(6,"0"),r.code].join("\0"),t=n(e),o=n(i);return t<o?-1:t>o?1:0}class qe{spent=new Map;on=process.env.ALLYHUB_CHECK_TIMINGS==="1";async time(i,n){if(!this.on)return n();const t=performance.now();try{return await n()}finally{this.spent.set(i,(this.spent.get(i)??0)+(performance.now()-t)/1e3)}}report(){if(!this.on)return;const i=[...this.spent].sort((n,t)=>t[1]-n[1]);process.stderr.write(`Check timings (s): ${i.map(([n,t])=>`${n} ${t.toFixed(2)}`).join(", ")}
3
+ `)}}const Je=(e,i)=>{const n=new Set(Ce(e,i));return e.filter(t=>n.has(t)||t.layers===!0)};async function Qe(e){const i=[],n=new Set;for(const t of e){if(t.layers!==!0)continue;const o=await N(e,{kind:t.id});!o?.layers||n.has(o)||(n.add(o),i.push(o.layers))}return i}export async function runCheck(e){const i=new qe,n=e.session??await i.time("prepare (discover, metadata, bundle)",()=>Be.open({root:e.dir,kinds:Ue(e.kinds),...e.buildDir===void 0?{}:{buildDir:e.buildDir},...e.gpu===void 0?{}:{gpu:e.gpu},...e.consoleLimit===void 0?{}:{consoleLimit:e.consoleLimit}}));try{const t=n.prepared,o=e.samples??12,r=n.consoleLimit,c=await He(),a=await _e.open(t.root,await Te({kinds:Je(t.kinds,t.items),runtimeSha:c,samples:o,gpu:n.gpu,...r===Ke?{}:{consoleLimit:r}})),p=e.facts!==!1,d=await Qe(t.kinds),u=[],k=[...askedProblems(t,e.piece),...e.files===void 0?[]:await ve(t.root,t.files.filter(s=>e.piece===void 0||Pe(s,e.piece.replace(/^\.\//u,"").replace(/\/+$/u,""))),t.items,e.files),...e.files===void 0||e.piece!==void 0?[]:await De(t.root,t.files,t.kinds,e.files)];let S=[];const K=[],H=[],R=[];let z=0,U=0;const G=[],ke=t.pieces.filter(s=>e.piece===void 0||B({id:s.id,path:s.place},e.piece));for(const s of ke){if(!t.bundle?.chunks.entries[s.id.replaceAll("/","__")])continue;const w=s.kind,M=s.format,q=await je(t,s,c),J=async y=>{const $={problems:[],facts:[]},W=new Set,v=[...s.combos.filter(m=>!e.combos?.length||e.combos.some(h=>Fe(m,h,j(s.matrix,m)))),...Re(s,e.combos)],Se=new Set(s.matrix?Oe(s.matrix.space,s.dims,v):v.keys()),X=[],Z=m=>{H.push(m);for(const h of m.reads?.media??[])W.add(h.path);m.timeline&&X.push({...m,timeline:m.timeline})};let T=!1;const $e=(m,h,D)=>{if(e.fresh===!0)return;const f=a.get(m),C=f?.result.reads,E=f?.result.timeline;return!f||!C||!E||D&&!f.sampled||f.factless===!0&&p?void 0:pe(t,q,s,h,C)===f.digest?f:void 0};for(const[m,h]of v.entries()){const D=j(s.matrix,h),f={piece:s.id,output:w,combo:h,format:M},C=le(h);if(K.push({...f,...D?{id:D}:{},key:C}),!Se.has(m)){U++;continue}const E=fe(s,t.kinds)&&!T,F=Ae(s.id,w,C,M),x=$e(F,h,E);if(x){z++,x.sampled&&(T=!0),$.problems.push(...x.problems),$.facts.push(...x.facts),u.push({version:f,log:x.console}),Z({...x.result,digest:x.digest}),a.set(F,x);continue}R.push(`${s.id}/${w}/${C}/${M}`);const b=await i.time("load (mount, stills)",()=>n.open(s,f));try{const g=b.summary,L=[],P=[...g?.facts??[]],ee={problems:L,facts:P},te={target:f,layout:()=>i.time("layout measure",()=>fe(s,t.kinds)?b.measure():ze(n,s,b,{fresh:e.fresh===!0}))};let ne=!1;try{if(g){try{await y.layout?.(b,ee,te)}catch(l){if(l instanceof we)throw l}if(p)for(const l of d){const I=l.facts?.bind(l);I&&P.push(...await i.time("layers' facts",()=>I(b)))}}if(g&&E&&(T=!0,ne=!0,L.push(...await i.time("determinism",()=>determinism(b,`${s.id}:${w}:${M}`,o))),await y.timing?.(b,ee,te)),g&&p)for(const l of d){const I=l.readBack?.bind(l);I&&P.push(...await i.time("layers read back",()=>I(b)))}}catch(l){if(!(l instanceof we))throw l;l.kept||L.push(me("AK-P003",l.message,{piece:f.piece,output:f.output,combo:f.combo,format:f.format}))}L.push(...await b.problems());const ie=he(L);$.problems.push(...ie);const se=y.keep?.bind(y),oe=se?P.filter(l=>se(l)):P;$.facts.push(...oe);const re=await b.console();u.push({version:f,log:re});const O=g?pe(t,q,s,h,g.reads):void 0,ce={...f,...g?{timeline:g.timeline,reads:g.reads}:{}};Z({...ce,...O?{digest:O}:{}}),O&&a.set(F,{digest:O,result:ce,problems:ie,facts:oe,sampled:ne,...p?{}:{factless:!0},console:re})}finally{await b.close()}}return{...$,loaded:X,combos:v.map(m=>{const h=j(s.matrix,m);return{combo:m,...h===void 0?{}:{id:h}}}),media:W}},Q=await N(t.kinds,s),xe={root:t.root,piece:s,prepared:t,facts:p,...e.ffmpeg===void 0?{}:{ffmpeg:e.ffmpeg},mediaPath:y=>n.mediaPath(y),time:(y,$)=>i.time(y,$),versions:J},V=Q?.checkPiece?.bind(Q),A=V?await V(xe):await J({});k.push(...A.problems),S.push(...A.facts),G.push(...A.wholes??[])}for(const s of t.items){const w=await N(t.kinds,s);if(!w?.check||e.piece!==void 0&&!B({id:s.id,path:s.entry},e.piece))continue;const M=w.check.bind(w);k.push(...await i.time("items' own checks",()=>M(s,{root:t.root})))}await a.save(new Set(t.pieces.map(s=>s.id)));const Y=he(k).sort(Ye);for(const s of d){const w=s.current?.bind(s);w&&(S=await w(S,{root:t.root}))}i.report();const ye=new Set(t.pieces.map(s=>s.place)),_={};for(const s of t.items)ye.has(s.id)||(_[s.kind]=(_[s.kind]??0)+1);return{targets:K,items:_,check:summarize(Y),problems:Y,facts:S,results:H,wholes:G,stats:checkStats(K.length,R,z,U),console:Ne(r,u)}}finally{e.session||await n.close()}}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/check",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{mkdir as S,readFile as p,writeFile as k}from"node:fs/promises";import{dirname as E}from"node:path";import{BLOBS_MAX as y,BlobsResponseSchema as O}from"@allyhub/protocol";import{z as r}from"zod";import{CloudError as v}from"./errors.js";import{sha256Of as N}from"./hashes.js";export class BlobsUnavailable extends Error{sha256s;constructor(e){super(`${String(e.length)} blob(s) storage lacks cannot be put from here: their bytes are not here any more.`),this.name="BlobsUnavailable",this.sha256s=e}}const A=r.object({scope:r.string(),held:r.array(r.string())}),B=4,x=30*6e4,T=3*6e4;export class BlobStore{cloud;path;file;known;constructor(e,t){this.cloud=e,this.path=t.path,this.file=t.file}async scope(){const e=await this.cloud.requireKey();return JSON.stringify([e.account,e.organization??null])}async load(){const e=await this.scope();return this.known?.scope!==e&&(this.known={scope:e,held:await this.read(e)}),this.known.held}async read(e){if(this.file===void 0)return new Set;let t;try{t=JSON.parse(await p(this.file,"utf8"))}catch(o){if(o instanceof SyntaxError||o instanceof Error&&"code"in o&&o.code==="ENOENT")return new Set;throw o}const s=A.safeParse(t);return s.success&&s.data.scope===e?new Set(s.data.held):new Set}async save(){this.file===void 0||this.known===void 0||(await S(E(this.file),{recursive:!0}),await k(this.file,JSON.stringify({scope:this.known.scope,held:[...this.known.held]})))}async bytesOf(e){if(e.bytes!==void 0)return e.bytes;if(e.file===void 0)return;let t;try{t=await p(e.file)}catch(s){if(s instanceof Error&&"code"in s&&s.code==="ENOENT")return;throw s}return e.checkBytes===!0&&N(t)!==e.sha256?void 0:t}async forget(e){const t=await this.load();for(const s of e)t.delete(s);await this.save()}async put(e){let t=0;const s=await this.load(),o=new Map;for(const i of e)s.has(i.sha256)||o.set(i.sha256,i);const f=[...o.values()],a=[];for(let i=0;i<f.length;i+=y){const d=f.slice(i,i+y),{uploads:c}=O.parse(await this.cloud.json(this.path,{method:"POST",signal:AbortSignal.timeout(T),body:{blobs:d.map(n=>({sha256:n.sha256,size:n.size,contentType:n.type}))}}));let u=0;const b=async()=>{for(;u<c.length;){const n=c[u++],h=n&&o.get(n.sha256);if(!n||!h)continue;const w=await this.bytesOf(h);if(w===void 0){a.push(h.sha256);continue}const l=await this.cloud.config.fetch(n.url,{method:"PUT",headers:n.headers,body:new Uint8Array(w),signal:AbortSignal.timeout(x)});if(!l.ok)throw new v("blob-refused",`Storage refused a blob: ${String(l.status)} ${(await l.text()).slice(0,200)}`);t+=1}};await Promise.all(Array.from({length:Math.min(B,c.length)},b));const g=new Set(a);for(const n of d)g.has(n.sha256)||s.add(n.sha256);await this.save()}if(a.length>0)throw new BlobsUnavailable(a);return t}}
2
+ import{mkdir as S,readFile as p,writeFile as k}from"node:fs/promises";import{dirname as E}from"node:path";import{BLOBS_MAX as y,BlobsResponseSchema as O}from"@allyhub/protocol/blobs";import{z as r}from"zod";import{CloudError as v}from"./errors.js";import{sha256Of as N}from"./hashes.js";export class BlobsUnavailable extends Error{sha256s;constructor(e){super(`${String(e.length)} blob(s) storage lacks cannot be put from here: their bytes are not here any more.`),this.name="BlobsUnavailable",this.sha256s=e}}const A=r.object({scope:r.string(),held:r.array(r.string())}),B=4,x=30*6e4,T=3*6e4;export class BlobStore{cloud;path;file;known;constructor(e,t){this.cloud=e,this.path=t.path,this.file=t.file}async scope(){const e=await this.cloud.requireKey();return JSON.stringify([e.account,e.organization??null])}async load(){const e=await this.scope();return this.known?.scope!==e&&(this.known={scope:e,held:await this.read(e)}),this.known.held}async read(e){if(this.file===void 0)return new Set;let t;try{t=JSON.parse(await p(this.file,"utf8"))}catch(o){if(o instanceof SyntaxError||o instanceof Error&&"code"in o&&o.code==="ENOENT")return new Set;throw o}const s=A.safeParse(t);return s.success&&s.data.scope===e?new Set(s.data.held):new Set}async save(){this.file===void 0||this.known===void 0||(await S(E(this.file),{recursive:!0}),await k(this.file,JSON.stringify({scope:this.known.scope,held:[...this.known.held]})))}async bytesOf(e){if(e.bytes!==void 0)return e.bytes;if(e.file===void 0)return;let t;try{t=await p(e.file)}catch(s){if(s instanceof Error&&"code"in s&&s.code==="ENOENT")return;throw s}return e.checkBytes===!0&&N(t)!==e.sha256?void 0:t}async forget(e){const t=await this.load();for(const s of e)t.delete(s);await this.save()}async put(e){let t=0;const s=await this.load(),o=new Map;for(const i of e)s.has(i.sha256)||o.set(i.sha256,i);const f=[...o.values()],a=[];for(let i=0;i<f.length;i+=y){const d=f.slice(i,i+y),{uploads:c}=O.parse(await this.cloud.json(this.path,{method:"POST",signal:AbortSignal.timeout(T),body:{blobs:d.map(n=>({sha256:n.sha256,size:n.size,contentType:n.type}))}}));let u=0;const b=async()=>{for(;u<c.length;){const n=c[u++],h=n&&o.get(n.sha256);if(!n||!h)continue;const w=await this.bytesOf(h);if(w===void 0){a.push(h.sha256);continue}const l=await this.cloud.config.fetch(n.url,{method:"PUT",headers:n.headers,body:new Uint8Array(w),signal:AbortSignal.timeout(x)});if(!l.ok)throw new v("blob-refused",`Storage refused a blob: ${String(l.status)} ${(await l.text()).slice(0,200)}`);t+=1}};await Promise.all(Array.from({length:Math.min(B,c.length)},b));const g=new Set(a);for(const n of d)g.has(n.sha256)||s.add(n.sha256);await this.save()}if(a.length>0)throw new BlobsUnavailable(a);return t}}
@@ -1,5 +1,5 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{randomUUID as X}from"node:crypto";import{mkdir as D,readdir as Y,readFile as E,rm as q,writeFile as A}from"node:fs/promises";import{basename as $,dirname as k,extname as S,join as j}from"node:path";import{EXIT as p,FileContentResponseSchema as Q,ToolCallSchema as _,callPath as V,fileContentPath as tt,parseAllyFilePath as I,toolCallsPath as et}from"@allyhub/protocol";import{genFileFor as U}from"@allyhub/formats";import{CloudError as d}from"./errors.js";import{genRecord as H,inputHash as nt,namedFile as it,readGen as at,toolWords as ot,writeGen as M,writeWords as rt}from"./records.js";import{withKnownUploads as st}from"./uploads.js";export const WAIT_SECONDS=900,POLL_SECONDS={least:1,most:60},RETRY_SECONDS={least:1,most:30},READ_SECONDS=120;const lt=new Set([408,429,500,502,503,504]),ut=t=>t instanceof d&&(t.code==="network"||t.status!==void 0&&lt.has(t.status));function ft(t){if(!/^https?:\/\//iu.test(t))return t;let e;try{e=new URL(t)}catch{return t}if(e.search==="")return t.replace(/^https?:\/\//iu,"");const i=/filename\*?=(?:UTF-8'')?"?([^";]+)/iu.exec(e.searchParams.get("response-content-disposition")??"")?.[1];return i===void 0?void 0:decodeURIComponent(i)}export function inputSlug(t){return Object.values(t).flatMap(e=>Array.isArray(e)?e:[e]).filter(e=>typeof e=="string").flatMap(e=>ft(e)??[]).join("-").replace(/[^\p{L}\p{N}._]+/gu,"-").replace(/^-+|-+$/gu,"").slice(0,40).replace(/-+$/u,"")}const L=t=>t.replace(/[^A-Za-z0-9_-]/gu,"_").slice(0,8),W=(t,e)=>{const i=S(t);return`${$(t,i)}-${L(e)}${i}`};async function ct(t,e,i,n,o){await D(t,{recursive:!0});const s=[e,inputSlug(i),L(n)].filter(Boolean).join("-"),r=j(t,`${s}.output.json`);return await A(r,`${JSON.stringify(o,null,2)}
2
+ import{randomUUID as X}from"node:crypto";import{mkdir as D,readdir as Y,readFile as E,rm as q,writeFile as A}from"node:fs/promises";import{basename as $,dirname as k,extname as S,join as j}from"node:path";import{EXIT as p}from"@allyhub/protocol/cli";import{FileContentResponseSchema as Q,ToolCallSchema as _,callPath as V,fileContentPath as tt,parseAllyFilePath as I,toolCallsPath as et}from"@allyhub/protocol/cloud";import{genFileFor as U}from"@allyhub/formats/data/gen";import{CloudError as d}from"./errors.js";import{genRecord as H,inputHash as nt,namedFile as it,readGen as at,toolWords as ot,writeGen as M,writeWords as rt}from"./records.js";import{withKnownUploads as st}from"./uploads.js";export const WAIT_SECONDS=900,POLL_SECONDS={least:1,most:60},RETRY_SECONDS={least:1,most:30},READ_SECONDS=120;const lt=new Set([408,429,500,502,503,504]),ut=t=>t instanceof d&&(t.code==="network"||t.status!==void 0&&lt.has(t.status));function ft(t){if(!/^https?:\/\//iu.test(t))return t;let e;try{e=new URL(t)}catch{return t}if(e.search==="")return t.replace(/^https?:\/\//iu,"");const i=/filename\*?=(?:UTF-8'')?"?([^";]+)/iu.exec(e.searchParams.get("response-content-disposition")??"")?.[1];return i===void 0?void 0:decodeURIComponent(i)}export function inputSlug(t){return Object.values(t).flatMap(e=>Array.isArray(e)?e:[e]).filter(e=>typeof e=="string").flatMap(e=>ft(e)??[]).join("-").replace(/[^\p{L}\p{N}._]+/gu,"-").replace(/^-+|-+$/gu,"").slice(0,40).replace(/-+$/u,"")}const L=t=>t.replace(/[^A-Za-z0-9_-]/gu,"_").slice(0,8),W=(t,e)=>{const i=S(t);return`${$(t,i)}-${L(e)}${i}`};async function ct(t,e,i,n,o){await D(t,{recursive:!0});const s=[e,inputSlug(i),L(n)].filter(Boolean).join("-"),r=j(t,`${s}.output.json`);return await A(r,`${JSON.stringify(o,null,2)}
3
3
  `),r}async function dt(t,e){const i=S(t)===""?`${t}.json`:t;return await D(k(i),{recursive:!0}),await A(i,`${JSON.stringify(e,null,2)}
4
4
  `),i}const T=t=>j(t.config.cacheDir,"jobs"),C=(t,e)=>j(T(t),`${e.replace(/[^A-Za-z0-9_-]/gu,"_")}.json`);async function wt(t,e,i){await D(k(C(t,e)),{recursive:!0}),await A(C(t,e),`${JSON.stringify(i,null,2)}
5
5
  `)}const P=(t,e)=>q(C(t,e),{force:!0});async function ht(t,e,i){const n=await Y(T(t)).catch(()=>[]);for(const o of n.filter(s=>s.endsWith(".json")).sort()){const s=await E(j(T(t),o),"utf8").then(r=>JSON.parse(r)).catch(()=>{});if(s?.jobId!==void 0&&s.file===e&&s.inputHash===i)return s.jobId}}async function pt(t,e){try{return JSON.parse(await E(C(t,e),"utf8"))}catch{throw new d("unknown-job",`No job ${e} was started on this computer.`,{exit:p.notFound,hint:"Call the tool again: that is a new call."})}}async function B(t,e,i,n,o){const{url:s}=Q.parse(await t.json(tt(e,"attachment"),{signal:v(o)}));let r;try{const f=await t.config.fetch(s,o?{signal:o}:{});if(!f.ok)throw new d("download-failed",`Downloading ${i} answered ${String(f.status)}.`,{exit:p.platform,status:f.status});r=Buffer.from(await f.arrayBuffer())}catch(f){throw f instanceof d||o?.aborted===!0?f:new d("network",`Downloading ${i} failed: ${f instanceof Error?f.message:String(f)}`,{exit:p.platform,cause:f})}const w="dir"in n?j(n.dir,$(n.name??i)):S(n.file)?n.file:`${n.file}${S(i)}`;return await D(k(w),{recursive:!0}),await A(w,r),w}const v=t=>t?AbortSignal.any([t,AbortSignal.timeout(READ_SECONDS*1e3)]):AbortSignal.timeout(READ_SECONDS*1e3),z=(t,e)=>new Promise((i,n)=>{const o=setTimeout(i,t*1e3);e?.addEventListener("abort",()=>{clearTimeout(o),n(e.reason instanceof Error?e.reason:new Error("Stopped."))},{once:!0})});export async function callTool(t,e,i,n){const o=n.file,s=await st(t,i,n.base),r=nt(e,s);let w=n.jobId,f=!1;if(o!==void 0&&w===void 0){w=await ht(t,o,r);const u=w===void 0?await it(o):void 0,l=u?await at(u):void 0;if(n.force===!0)f=l!==void 0;else{if(u&&!l)throw new d("file-exists",`${u} is there, without a record (${$(U(u))}) saying a tool call made it.`,{exit:p.conflict,hint:"Choose another --file, or pass --force to replace it."});if(u&&l){if(l.tool===e&&l.inputHash===r)return{tool:e,output:typeof l.output?.allyFilePath=="string"?l.output:JSON.parse(await E(u,"utf8")),file:u,gen:U(u),kept:{at:l.at}};throw new d("file-exists",`${u} was made by ${l.tool??"another tool"} from another input on ${l.at}.`,{exit:p.conflict,hint:"Choose another --file to keep it, or pass --force to make it again over it (charged again)."})}}}const m=Date.now()+(n.timeoutSeconds??WAIT_SECONDS)*1e3,g=n.signal;let a=w===void 0?_.parse(await t.json(et(e),{method:"POST",body:{input:i},idempotencyKey:X(),...g?{signal:g}:{}})):await G(t,w,m,n);a.status==="working"&&w===void 0&&await wt(t,a.id,{jobId:a.id,tool:e,input:{...i},inputHash:r,outDir:n.outDir,...o===void 0?{}:{file:o}});const K=()=>({tool:e,jobId:a.id,status:"running",elapsedSeconds:(Date.now()-Date.parse(a.createdAt))/1e3,...o===void 0?{}:{file:o}});for(;a.status==="working";){if(n.wait===!1||Date.now()>m)return K();n.onRunning?.(a),await z(Math.min(Math.max((a.pollAfterMs??0)/1e3,POLL_SECONDS.least),POLL_SECONDS.most),g),a=await G(t,a.id,m,n)}if(a.status==="failed")throw await P(t,a.id),new d(`tool-${(a.error?.kind??"failed").replaceAll("_","-")}`,a.error?.message??"The tool failed.",{exit:a.error?.kind==="input"?p.usage:p.platform,hint:a.error?.kind==="input"||a.error?.kind==="not_found"?"A failed call is not charged. Change the input and call again.":a.error?.kind==="unavailable"?"A failed call is not charged. Calling it again will not help until AllyHub sets it up or fixes it.":"A failed call is not charged. Call it again; a supplier's failure often passes."});if(a.status!=="completed")throw new d("tool-state",`The call ${a.id} is ${a.status}, a state this version of allyhub does not know.`,{exit:p.platform,hint:"Update allyhub in the project (npm install allyhub@latest) and call it again."});const h=typeof a.output=="object"&&a.output!==null?a.output:{value:a.output},R=h.allyFilePath,y=typeof R=="string"?I(R):void 0,b=!y&&o!==void 0?await dt(o,h):void 0,c={tool:e,output:h,outputFile:b??await ct(n.outputDir??n.outDir,e,i,a.id,h),...a.credits===void 0?{}:{credits:a.credits}};if(y){const u=a.id,l=await J(u,()=>B(t,y.id,y.name,o!==void 0?{file:o}:{dir:n.outDir,name:W(y.name,u)},g),m,n);c.file=l,c.gen=await M(l,await H(l,{tool:e,input:s,output:h,credits:a.credits}));const x=ot(h),N=h.durationSeconds;x&&(c.words=await rt(l,x,typeof N=="number"&&N>=0?N:void 0)),f&&(c.replaced=!0)}else b!==void 0&&(c.file=b,c.gen=await M(b,await H(b,{tool:e,input:s,output:h,credits:a.credits})),f&&(c.replaced=!0));const O={},Z=c.file===void 0?n.outDir:k(c.file),F=c.file;for(const u of mt(h)){const l=I(u);if(!l)continue;const x=F===void 0?W(l.name,a.id):`${$(F,S(F))}.${$(l.name)}`;O[u]=await J(a.id,()=>B(t,l.id,l.name,{dir:Z,name:x},g),m,n)}return Object.keys(O).length>0&&(c.more=O),await P(t,a.id),c}function mt(t){const e=[],i=(n,o)=>{if(Array.isArray(n))for(const s of n)i(s,!1);else if(typeof n=="object"&&n!==null)for(const[s,r]of Object.entries(n))s==="allyFilePath"&&!o&&typeof r=="string"?e.push(r):i(r,!1)};return i(t,!0),e}async function G(t,e,i,n){try{return await J(e,async()=>_.parse(await t.json(V(e),{signal:v(n.signal)})),i,n)}catch(o){throw o instanceof d&&o.status===404&&await P(t,e),o}}async function J(t,e,i,n){const o=n.retrySeconds??RETRY_SECONDS;for(let s=o.least;;)try{return await e()}catch(r){if(!ut(r)||n.signal?.aborted===!0)throw r;if(Date.now()+s*1e3>i)throw new d(r.code,r.message,{exit:r.exit,...r.status===void 0?{}:{status:r.status},hint:`Call ${t} goes on at AllyHub, charged once when it works: --resume ${t} waits for it again (so does the same call to the same --file).`,cause:r});n.onRetry?.(t,r,s),await z(s,n.signal),s=Math.min(s*2,o.most)}}export async function resumeJob(t,e,i){const n=await pt(t,e);if(i.tool!==void 0&&i.tool!==n.tool)throw new d("wrong-job",`Job ${e} is ${n.tool}'s, not ${i.tool}'s.`,{exit:p.usage,hint:`Resume it with ${n.tool}.`});return await callTool(t,n.tool,n.input,{...i,outDir:n.outDir,...n.file===void 0?{}:{file:n.file},jobId:e})}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{createHash as w}from"node:crypto";import{mkdir as h,readFile as d,writeFile as g}from"node:fs/promises";import{dirname as p,join as m}from"node:path";import{CATALOG_PATH as i,CatalogSchema as s,EXIT as c}from"@allyhub/protocol";import{CloudError as f,unreachable as k}from"./errors.js";export const CATALOG_CACHE_SECONDS=3600;const y=a=>m(a.config.cacheDir,`catalog-${w("sha256").update(a.url).digest("hex").slice(0,12)}.json`);async function $(a){try{const r=JSON.parse(await d(a,"utf8")),o=s.safeParse(r.catalog);return o.success&&typeof r.at=="number"?{at:r.at,catalog:o.data}:void 0}catch{return}}async function l(a,r){await h(p(a),{recursive:!0}),await g(a,JSON.stringify({at:Date.now(),catalog:r}))}export async function loadCatalog(a,r={}){const o=y(a),t=await $(o);if(t&&r.refresh!==!0&&Date.now()-t.at<CATALOG_CACHE_SECONDS*1e3)return t.catalog;let e;try{e=await a.config.fetch(`${a.url}${i}`,{redirect:"error",signal:AbortSignal.timeout(3e4),headers:{accept:"application/json",...t?{"if-none-match":`"${t.catalog.version}"`}:{}}})}catch(u){if(t)return t.catalog;throw k(a.url,u)}if(e.status===304&&t)return await l(o,t.catalog),t.catalog;const n=e.ok?s.safeParse(await e.json().catch(()=>{})):void 0;if(!n?.success){if(t)return t.catalog;throw new f("api-error",`${a.url}${i} answered ${e.ok?"something that is not a catalog":String(e.status)}.`,{exit:c.platform})}return await l(o,n.data),n.data}export async function findTool(a,r){let o=await loadCatalog(a),t=o.tools.find(e=>e.name===r);if(t||(o=await loadCatalog(a,{refresh:!0}),t=o.tools.find(e=>e.name===r)),t)return t;throw new f("unknown-tool",`No tool ${r}.`,{exit:c.notFound,hint:`allyhub <work> lists a work's tools; the works are ${o.works.map(e=>e.id).join(", ")}.`})}
2
+ import{createHash as w}from"node:crypto";import{mkdir as h,readFile as d,writeFile as g}from"node:fs/promises";import{dirname as p,join as m}from"node:path";import{CATALOG_PATH as i,CatalogSchema as s}from"@allyhub/protocol/cloud";import{EXIT as c}from"@allyhub/protocol/cli";import{CloudError as f,unreachable as k}from"./errors.js";export const CATALOG_CACHE_SECONDS=3600;const y=a=>m(a.config.cacheDir,`catalog-${w("sha256").update(a.url).digest("hex").slice(0,12)}.json`);async function $(a){try{const e=JSON.parse(await d(a,"utf8")),o=s.safeParse(e.catalog);return o.success&&typeof e.at=="number"?{at:e.at,catalog:o.data}:void 0}catch{return}}async function l(a,e){await h(p(a),{recursive:!0}),await g(a,JSON.stringify({at:Date.now(),catalog:e}))}export async function loadCatalog(a,e={}){const o=y(a),t=await $(o);if(t&&e.refresh!==!0&&Date.now()-t.at<CATALOG_CACHE_SECONDS*1e3)return t.catalog;let r;try{r=await a.config.fetch(`${a.url}${i}`,{redirect:"error",signal:AbortSignal.timeout(3e4),headers:{accept:"application/json",...t?{"if-none-match":`"${t.catalog.version}"`}:{}}})}catch(u){if(t)return t.catalog;throw k(a.url,u)}if(r.status===304&&t)return await l(o,t.catalog),t.catalog;const n=r.ok?s.safeParse(await r.json().catch(()=>{})):void 0;if(!n?.success){if(t)return t.catalog;throw new f("api-error",`${a.url}${i} answered ${r.ok?"something that is not a catalog":String(r.status)}.`,{exit:c.platform})}return await l(o,n.data),n.data}export async function findTool(a,e){let o=await loadCatalog(a),t=o.tools.find(r=>r.name===e);if(t||(o=await loadCatalog(a,{refresh:!0}),t=o.tools.find(r=>r.name===e)),t)return t;throw new f("unknown-tool",`No tool ${e}.`,{exit:c.notFound,hint:`allyhub <work> lists a work's tools; the works are ${o.works.map(r=>r.id).join(", ")}.`})}