allyhub 0.21.0 → 0.22.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 (222) hide show
  1. package/dist/commands/export.js +1 -1
  2. package/dist/commands/index.js +1 -1
  3. package/dist/commands/run.js +2 -0
  4. package/dist/commands.json +1 -1
  5. package/dist/main.js +4 -4
  6. package/dist/node_modules/@allyhub/3d-extension/package.json +1 -1
  7. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  8. package/dist/node_modules/@allyhub/blocks/package.json +1 -1
  9. package/dist/node_modules/@allyhub/browser/package.json +1 -1
  10. package/dist/node_modules/@allyhub/build/dist/migrate.js +1 -1
  11. package/dist/node_modules/@allyhub/build/dist/prepare.js +3 -3
  12. package/dist/node_modules/@allyhub/build/dist/project-root.js +1 -1
  13. package/dist/node_modules/@allyhub/build/dist/work.js +3 -3
  14. package/dist/node_modules/@allyhub/build/package.json +1 -1
  15. package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
  16. package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
  17. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  18. package/dist/node_modules/@allyhub/check/package.json +1 -1
  19. package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
  20. package/dist/node_modules/@allyhub/cloud/package.json +1 -1
  21. package/dist/node_modules/@allyhub/components/package.json +1 -1
  22. package/dist/node_modules/@allyhub/dev-server/dist/index.js +1 -1
  23. package/dist/node_modules/@allyhub/dev-server/dist/record.js +2 -1
  24. package/dist/node_modules/@allyhub/dev-server/dist/validate.js +2 -2
  25. package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
  26. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  27. package/dist/node_modules/@allyhub/doc/package.json +1 -1
  28. package/dist/node_modules/@allyhub/doc-extension/package.json +1 -1
  29. package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
  30. package/dist/node_modules/@allyhub/export/package.json +1 -1
  31. package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
  32. package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
  33. package/dist/node_modules/@allyhub/formats/dist/data/deck-code.d.ts +3 -3
  34. package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +151 -151
  35. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +173 -173
  36. package/dist/node_modules/@allyhub/formats/dist/data/work.d.ts +1 -2
  37. package/dist/node_modules/@allyhub/formats/dist/data/work.js +1 -1
  38. package/dist/node_modules/@allyhub/formats/dist/index.d.ts +1 -1
  39. package/dist/node_modules/@allyhub/formats/dist/index.js +1 -1
  40. package/dist/node_modules/@allyhub/formats/dist/layout.d.ts +2 -0
  41. package/dist/node_modules/@allyhub/formats/dist/layout.js +1 -1
  42. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +106 -101
  43. package/dist/node_modules/@allyhub/formats/dist/schemas.js +1 -1
  44. package/dist/node_modules/@allyhub/formats/dist/tolerant.d.ts +26 -1
  45. package/dist/node_modules/@allyhub/formats/dist/tolerant.js +1 -1
  46. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  47. package/dist/node_modules/@allyhub/html-extension/package.json +1 -1
  48. package/dist/node_modules/@allyhub/i18n/package.json +1 -1
  49. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  50. package/dist/node_modules/@allyhub/image-extension/package.json +1 -1
  51. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  52. package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
  53. package/dist/node_modules/@allyhub/image-render/package.json +1 -1
  54. package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
  55. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  56. package/dist/node_modules/@allyhub/jobs/package.json +1 -1
  57. package/dist/node_modules/@allyhub/linkedin-extension/package.json +1 -1
  58. package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
  59. package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
  60. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  61. package/dist/node_modules/@allyhub/media/package.json +1 -1
  62. package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
  63. package/dist/node_modules/@allyhub/model/package.json +1 -1
  64. package/dist/node_modules/@allyhub/office-extension/package.json +1 -1
  65. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  66. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  67. package/dist/node_modules/@allyhub/project/package.json +1 -1
  68. package/dist/node_modules/@allyhub/protocol/package.json +1 -1
  69. package/dist/node_modules/@allyhub/registry/package.json +1 -1
  70. package/dist/node_modules/@allyhub/render/package.json +1 -1
  71. package/dist/node_modules/@allyhub/report-extension/package.json +1 -1
  72. package/dist/node_modules/@allyhub/runtime/package.json +1 -1
  73. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  74. package/dist/node_modules/@allyhub/scaffold/dist/index.js +6 -6
  75. package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
  76. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  77. package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
  78. package/dist/node_modules/@allyhub/sheet/dist/file.js +2 -2
  79. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  80. package/dist/node_modules/@allyhub/sheet-extension/dist/build.js +1 -1
  81. package/dist/node_modules/@allyhub/sheet-extension/package.json +1 -1
  82. package/dist/node_modules/@allyhub/slides-core/dist/file.js +3 -3
  83. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  84. package/dist/node_modules/@allyhub/slides-extension/dist/build.js +2 -2
  85. package/dist/node_modules/@allyhub/slides-extension/package.json +1 -1
  86. package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
  87. package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
  88. package/dist/node_modules/@allyhub/stage/package.json +1 -1
  89. package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
  90. package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
  91. package/dist/node_modules/@allyhub/telemetry/package.json +1 -1
  92. package/dist/node_modules/@allyhub/text-extension/package.json +1 -1
  93. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  94. package/dist/node_modules/@allyhub/video-extension/package.json +1 -1
  95. package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
  96. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  97. package/dist/node_modules/@allyhub/website/package.json +1 -1
  98. package/dist/node_modules/@allyhub/website-extension/package.json +1 -1
  99. package/dist/node_modules/@allyhub/x-extension/package.json +1 -1
  100. package/dist/node_modules/@allyhub/x-model/package.json +1 -1
  101. package/dist/node_modules/@allyhub/x-view/package.json +1 -1
  102. package/dist/package.json +15 -15
  103. package/dist/run-register.js +2 -0
  104. package/dist/works.js +1 -1
  105. package/editor-web/assets/{abnfDiagram-WEYOIA3C-B4tvwU6C.js → abnfDiagram-WEYOIA3C-D6qI3rai.js} +1 -1
  106. package/editor-web/assets/{architecture-WOLXFQ4H-V2fA0vY2.js → architecture-WOLXFQ4H-B3V6ggq8.js} +1 -1
  107. package/editor-web/assets/{architectureDiagram-ZHVYKT53-B6B7XN0M.js → architectureDiagram-ZHVYKT53-IauNyxXn.js} +1 -1
  108. package/editor-web/assets/{article-DW4eD_8K.js → article-BHjKp5We.js} +1 -1
  109. package/editor-web/assets/{article-Dm2dIEwc.js → article-BlNKv1Cn.js} +1 -1
  110. package/editor-web/assets/{blockDiagram-RJAE7QA3-BizcUGOM.js → blockDiagram-RJAE7QA3-yXhlfxbH.js} +1 -1
  111. package/editor-web/assets/{c4Diagram-XDPPPE54-CBHS0dQ0.js → c4Diagram-XDPPPE54-B-anrhvt.js} +1 -1
  112. package/editor-web/assets/{calc-worker-Cr4a0xmt.js → calc-worker-BpAgQE9E.js} +3 -3
  113. package/editor-web/assets/channel-Bhb-_8v6.js +1 -0
  114. package/editor-web/assets/{chip-BdQRH3FL.js → chip-pNQlYa2W.js} +1 -1
  115. package/editor-web/assets/{chunk-2E7WHVMD-CMPBck_Q.js → chunk-2E7WHVMD-QPOni4XB.js} +1 -1
  116. package/editor-web/assets/{chunk-4EMNKR2T-Df22Adpt.js → chunk-4EMNKR2T-DG1FCRRI.js} +1 -1
  117. package/editor-web/assets/{chunk-55XCU76K-CYrZ6_Q7.js → chunk-55XCU76K-mKuMXpnC.js} +1 -1
  118. package/editor-web/assets/{chunk-7S6XSTFO-BfdG9NNW.js → chunk-7S6XSTFO-CgZAazgt.js} +1 -1
  119. package/editor-web/assets/{chunk-AQDTSKZB-BCzZMoTJ.js → chunk-AQDTSKZB-BRU84phF.js} +1 -1
  120. package/editor-web/assets/{chunk-DSNLSHJZ-DT0xT8Wf.js → chunk-DSNLSHJZ-zku9oeG3.js} +1 -1
  121. package/editor-web/assets/{chunk-HAGFOTED-Bg3-EotU.js → chunk-HAGFOTED-CaUkBv_0.js} +1 -1
  122. package/editor-web/assets/{chunk-HNE4Q36P-BrSym24V.js → chunk-HNE4Q36P-BQz4ZCJf.js} +1 -1
  123. package/editor-web/assets/{chunk-NQOKRVIF-CMxgkJWF.js → chunk-NQOKRVIF-CHVBEDkg.js} +1 -1
  124. package/editor-web/assets/{chunk-UHW7PFBP-DWEwoyPy.js → chunk-UHW7PFBP-DrYeJo1e.js} +1 -1
  125. package/editor-web/assets/{chunk-VQ5W62QI-eTFh5_T9.js → chunk-VQ5W62QI-D8ToVCUe.js} +1 -1
  126. package/editor-web/assets/{chunk-WQQL4CDK-4PTupr9T.js → chunk-WQQL4CDK-DZ0tyi9F.js} +1 -1
  127. package/editor-web/assets/{chunk-YZO67HFG-D5XAAFWm.js → chunk-YZO67HFG-BLe7PXER.js} +1 -1
  128. package/editor-web/assets/{chunk-ZAUX2LTX-CPsdaisO.js → chunk-ZAUX2LTX-ByaeSIre.js} +1 -1
  129. package/editor-web/assets/{chunk-ZCHMQSOR-ClnuUyfy.js → chunk-ZCHMQSOR-DdMJr_t5.js} +1 -1
  130. package/editor-web/assets/{classDiagram-v2-4MYWR3UA-CM21waNF.js → classDiagram-v2-4MYWR3UA-DDpq7fFC.js} +1 -1
  131. package/editor-web/assets/{color-picker-BmKFn2ww.js → color-picker-CDeICDN5.js} +1 -1
  132. package/editor-web/assets/{cynefin-EF2NZ3EQ-CJUHTgee.js → cynefin-EF2NZ3EQ-CMivy2fr.js} +1 -1
  133. package/editor-web/assets/{cynefinDiagram-WF24UDRP-C9RIfuIV.js → cynefinDiagram-WF24UDRP-GtxT_9wW.js} +1 -1
  134. package/editor-web/assets/{dagre-NK4GIZVX-g-01KdpO.js → dagre-NK4GIZVX-Bn1O2Hjl.js} +1 -1
  135. package/editor-web/assets/deck-Cohd-G5m.js +1 -0
  136. package/editor-web/assets/{diagram-CBK3MWTC-CbOjWUu-.js → diagram-CBK3MWTC-W715PWZw.js} +1 -1
  137. package/editor-web/assets/{diagram-I5XIIV2D-C6psNS8J.js → diagram-I5XIIV2D-BKObZPn2.js} +1 -1
  138. package/editor-web/assets/{diagram-ODIL2UCW-C9PUE46P.js → diagram-ODIL2UCW-UtQxEPoW.js} +1 -1
  139. package/editor-web/assets/{diagram-PFBEJUXE-vJ_pnB33.js → diagram-PFBEJUXE-CpLGEK-k.js} +1 -1
  140. package/editor-web/assets/{diagram-RJA3I4VV-FwYlEfJ-.js → diagram-RJA3I4VV-DGyMXoHb.js} +1 -1
  141. package/editor-web/assets/{diagram-TYUNFSNR-FKpIxeUc.js → diagram-TYUNFSNR-Dy_Ewr8V.js} +1 -1
  142. package/editor-web/assets/{dist-H0z_DXDz.js → dist-0I0Obj60.js} +14 -14
  143. package/editor-web/assets/{dist-DCI21ljp.js → dist-6ugUm4dS.js} +1 -1
  144. package/editor-web/assets/{dist-D2rGVz9C.js → dist-B0rUvCi2.js} +1 -1
  145. package/editor-web/assets/{dist-D07Kj8GR.js → dist-CKD_paj_.js} +1 -1
  146. package/editor-web/assets/{dist-BgKyM9U6.js → dist-CKUW5NzS.js} +1 -1
  147. package/editor-web/assets/{dist-DJvfQvM7.js → dist-Ca9Gsuu0.js} +1 -1
  148. package/editor-web/assets/{dist-BqijryYd.js → dist-Cc8v9lfc.js} +1 -1
  149. package/editor-web/assets/{dist-BaWFMuvr.js → dist-CynBNzYv.js} +1 -1
  150. package/editor-web/assets/{dist-CB-_0-X4.js → dist-D7M5YTq2.js} +1 -1
  151. package/editor-web/assets/{dist-ByguWp3a.js → dist-D9tsFc2N.js} +1 -1
  152. package/editor-web/assets/{dist-DH8oJJw9.js → dist-DNMKDcLg.js} +3 -3
  153. package/editor-web/assets/{dist-D3DwRF1k.js → dist-Doj7_HUI.js} +17 -17
  154. package/editor-web/assets/{dist-CtYjYJdv.js → dist-DptBQzJR.js} +1 -1
  155. package/editor-web/assets/{dist-BdmMT8fP.js → dist-DzKB210A.js} +1 -1
  156. package/editor-web/assets/{dist-Cg0Z26Kv.js → dist-H9rTuNhb.js} +4 -4
  157. package/editor-web/assets/{dist-DmCDcb2_.js → dist-RyGsFHE0.js} +1 -1
  158. package/editor-web/assets/{dist-BI_BaYhO.js → dist-oeSWr2LE.js} +4 -4
  159. package/editor-web/assets/dist-wD_hHJ8_.js +19 -0
  160. package/editor-web/assets/{docx-draw-Dxb67W2d.js → docx-draw-B5cM77hc.js} +1 -1
  161. package/editor-web/assets/{ebnfDiagram-V4P3TTPT-DBymUM-F.js → ebnfDiagram-V4P3TTPT-GPYcx6dU.js} +1 -1
  162. package/editor-web/assets/{elk-QONTBCTQ-BNYR3OlS.js → elk-QONTBCTQ-Bi0r4UFM.js} +1 -1
  163. package/editor-web/assets/{erDiagram-KYQIGQAA-cTNyOqW6.js → erDiagram-KYQIGQAA-DrOSrnci.js} +1 -1
  164. package/editor-web/assets/esm-jIPnpbBD.js +21 -0
  165. package/editor-web/assets/{eventmodeling-K75KTNOO-C6FUZeXP.js → eventmodeling-K75KTNOO-Dw-MjgUb.js} +1 -1
  166. package/editor-web/assets/flowDiagram-IUGLLWBU-DbZTfPEP.js +1 -0
  167. package/editor-web/assets/{ganttDiagram-R7GPNTJY-LD9mqQ1x.js → ganttDiagram-R7GPNTJY-Bwe8cQqi.js} +1 -1
  168. package/editor-web/assets/{gitGraph-VSP46ZUC-CtCBcQFl.js → gitGraph-VSP46ZUC-DsAcAKP0.js} +1 -1
  169. package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-DYQpOozz.js → gitGraphDiagram-PDYL7XHY-aObRwdru.js} +1 -1
  170. package/editor-web/assets/index-D-MNVykg.js +28 -0
  171. package/editor-web/assets/{info-OHQRW6UA-IXInKPRO.js → info-OHQRW6UA-DBPN8JFr.js} +1 -1
  172. package/editor-web/assets/{infoDiagram-MVDRKAX5-Ds7Cei7T.js → infoDiagram-MVDRKAX5-Bx26Hq7M.js} +1 -1
  173. package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-DWs3qtAX.js → ishikawaDiagram-HPEHV2GE-BJ_MCDwA.js} +1 -1
  174. package/editor-web/assets/{journeyDiagram-BOSHW7O7-BkNKVYBA.js → journeyDiagram-BOSHW7O7-B5g4W2Dx.js} +1 -1
  175. package/editor-web/assets/{kanban-definition-FNSA4HC5-D3dMswnI.js → kanban-definition-FNSA4HC5-U8YNlxN7.js} +1 -1
  176. package/editor-web/assets/layout-CuWN7_3k.js +1 -0
  177. package/editor-web/assets/{mermaid-parser.core-D_W_0X0N.js → mermaid-parser.core-DYLQlYDo.js} +3 -3
  178. package/editor-web/assets/{mermaid.core-Bkirj-s5.js → mermaid.core-qNJmZ0b4.js} +4 -4
  179. package/editor-web/assets/{mindmap-definition-6OY57UG3-CMKkAAvI.js → mindmap-definition-6OY57UG3-CI5aBWbK.js} +1 -1
  180. package/editor-web/assets/{packet-JDAUHWVQ-CzCkgCfg.js → packet-JDAUHWVQ-BBclMGlJ.js} +1 -1
  181. package/editor-web/assets/{panes-BexRuZd2.js → panes-BShVq38A.js} +1 -1
  182. package/editor-web/assets/{pegDiagram-ECIUJNBX-C8qHkx7M.js → pegDiagram-ECIUJNBX-B3pljPTu.js} +1 -1
  183. package/editor-web/assets/{pie-XZMESJXO-BJqgxMrD.js → pie-XZMESJXO-B7WzimHm.js} +1 -1
  184. package/editor-web/assets/{pieDiagram-GNMPY74T-DyNntV5y.js → pieDiagram-GNMPY74T-tM1Da50-.js} +1 -1
  185. package/editor-web/assets/{quadrantDiagram-D57K4MC3-BHa-69ir.js → quadrantDiagram-D57K4MC3-BEq_Shj9.js} +1 -1
  186. package/editor-web/assets/{radar-ABXABTNO-BeRPjBBR.js → radar-ABXABTNO-v2jJSW5T.js} +1 -1
  187. package/editor-web/assets/{railroad-I3PHUGI6-BaRQqRsK.js → railroad-I3PHUGI6-6W3Z4F8Y.js} +1 -1
  188. package/editor-web/assets/{railroad-abnf-LNEFI6M7-BZfwomxZ.js → railroad-abnf-LNEFI6M7-DxIN7Zrt.js} +1 -1
  189. package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-DbgqpEF5.js → railroad-ebnf-DWYD2UWJ-Bb5O7tAx.js} +1 -1
  190. package/editor-web/assets/{railroad-peg-JR7BVNR7-BYOf3PsQ.js → railroad-peg-JR7BVNR7-i2LjEP5t.js} +1 -1
  191. package/editor-web/assets/{railroadDiagram-Y72NRBL7-B5OAzOsD.js → railroadDiagram-Y72NRBL7-DhsyVKbG.js} +1 -1
  192. package/editor-web/assets/{requirementDiagram-EQYSW5RA-wqYNoqO0.js → requirementDiagram-EQYSW5RA-Du2k7i1E.js} +1 -1
  193. package/editor-web/assets/{ribbon-tabs-B3IC9WOt.js → ribbon-tabs-Bxuj_hct.js} +1 -1
  194. package/editor-web/assets/{sankeyDiagram-SY24JHO5-Crf6GRsa.js → sankeyDiagram-SY24JHO5-CDnRMu7J.js} +1 -1
  195. package/editor-web/assets/schemas-CnlOL0u4.js +1 -0
  196. package/editor-web/assets/{sequenceDiagram-BLEHNHQU-DUcHz4_d.js → sequenceDiagram-BLEHNHQU-BUXBhWYW.js} +1 -1
  197. package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-DbeLdnpS.js → stateDiagram-v2-A6IESKWZ-Enb8LZUA.js} +1 -1
  198. package/editor-web/assets/{swimlanes-B3ENRKFQ-BDi6AeJI.js → swimlanes-B3ENRKFQ-pnpjgTrl.js} +1 -1
  199. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-B-B2Eoc8.js +8 -0
  200. package/editor-web/assets/themes-D_ISkWVz.js +1 -0
  201. package/editor-web/assets/{timeline-definition-JXYKGLGB-B0awa2hh.js → timeline-definition-JXYKGLGB-C4pR18kd.js} +1 -1
  202. package/editor-web/assets/{treeView-D4JQ5SDB-C91G0IGm.js → treeView-D4JQ5SDB-kzNGeAv6.js} +1 -1
  203. package/editor-web/assets/{treemap-SAJKECNS-CiOWiwl2.js → treemap-SAJKECNS-Buhb5wzt.js} +1 -1
  204. package/editor-web/assets/{updating-D0GEtwnJ.js → updating-Cbxw83_O.js} +1 -1
  205. package/editor-web/assets/{usecaseDiagram-WPOLBNNX-DMYM1MRe.js → usecaseDiagram-WPOLBNNX-CL-xLQWl.js} +1 -1
  206. package/editor-web/assets/{vennDiagram-Q3Y3IDCW-DQIJ5vvN.js → vennDiagram-Q3Y3IDCW-bwsyCcdK.js} +1 -1
  207. package/editor-web/assets/{video-mMOFXHYK.js → video-8MxWX9f5.js} +1 -1
  208. package/editor-web/assets/{wardley-7MLQ67FV-C3H9HG8r.js → wardley-7MLQ67FV-DXsLgedI.js} +1 -1
  209. package/editor-web/assets/{wardleyDiagram-IVAIDKWA-DgsjqY1Y.js → wardleyDiagram-IVAIDKWA-Cn0ph953.js} +1 -1
  210. package/editor-web/assets/{workbook-NtMEyLgf.js → workbook-BDWkQ149.js} +1 -1
  211. package/editor-web/assets/{xychartDiagram-4URNHDU4-DzsGI527.js → xychartDiagram-4URNHDU4-CfXnqGWZ.js} +1 -1
  212. package/editor-web/index.html +2 -1
  213. package/package.json +2 -2
  214. package/editor-web/assets/channel-dyUtlVPg.js +0 -1
  215. package/editor-web/assets/deck-C0VxrlzX.js +0 -1
  216. package/editor-web/assets/dist-CCP24Lel.js +0 -19
  217. package/editor-web/assets/esm-Cl3GKSDd.js +0 -21
  218. package/editor-web/assets/flowDiagram-IUGLLWBU-ukTovy07.js +0 -1
  219. package/editor-web/assets/index-omhSywJb.js +0 -28
  220. package/editor-web/assets/schemas-C21MyseF.js +0 -1
  221. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-2wwOmxbv.js +0 -8
  222. package/editor-web/assets/tolerant-DM9s0Mt1.js +0 -1
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 F,writeFile as G}from"node:fs/promises";import{tmpdir as J}from"node:os";import{dirname as K,join as R}from"node:path";import"@allyhub/stage-runtime/use";import{CLI_PROGRAM as H,EXIT as l,PROBLEMS_FOUND as Y}from"@allyhub/protocol/cli";import{WORK_DIR as V}from"@allyhub/formats/layout";import{projectAt as X}from"./project.js";import{cutLong as q}from"./text/long-text.js";import{readArgs as z}from"./args.js";import{CLI_VERSION as b}from"./cli-version.js";import{CommandError as E}from"./command.js";import{COMMAND_SOURCES as A}from"./commands/index.js";import{commandEntries as Q,commandEntry as Z,entriesOf as tt,joinedCommands as nt}from"./commands/list.js";import{contributedSpecs as et}from"./commands/contributed.js";import{groupHelp as ot,listHelp as rt,workHelp as it}from"./help.js";import{sdkDocs as at}from"./sdk-docs.js";import{cliTelemetry as st}from"./telemetry.js";import{turnOf as ct}from"./turn.js";import{endUpdateCheck as dt}from"./update-notice.js";import{WORKS as mt,cloudNouns as ut,withJoined as U,workNamed as lt,workTitle as W}from"./works.js";const j={stdout:o=>process.stdout.write(o),stderr:o=>process.stderr.write(o),cwd:process.cwd(),env:process.env};export const FORMER_NAMES={render:"export"};export function namedNow(o){const i=o[0]==="help"?1:0,a=FORMER_NAMES[o[i]??""];return o.map((s,p)=>p===i&&a!==void 0?a:s)}export function findCommand(o,i){let a;for(const s of i){const p=s.name.split(" ");p.every((h,e)=>o[e]===h)&&p.length>(a?.length??0)&&(a={command:s,length:p.length})}return a?{command:a.command,rest:o.slice(a.length)}:{rest:[...o]}}export async function resolveCommand(o,i,a,s=A){const p=async e=>{const c=await e.resolve(o,i);return c&&{...c,command:Z(c.command,a)}},h=findCommand(o,a);if(h.command){const e=h.command.name;if(h.rest.length>0)for(const c of s.filter(y=>y.under===e)){const y=await p(c);if(y)return y}return h}for(const e of s){const c=await p(e);if(c)return c}return h}export async function main(o,i=j,a,s=A,p){const h=o.includes("--json"),e=namedNow(o.filter(t=>t!=="--json")),c=async(t,n,$)=>{if(h){i.stdout(`${JSON.stringify(t,null,2)}
3
- `);return}const v=await X(i.cwd),m=R(v===void 0?R(J(),"allyhub"):R(v,V),"out",`${$.replaceAll(" ","-")}.txt`),w=q(n,m);w!==void 0&&(await F(K(m),{recursive:!0}),await G(m,`${n}
4
- `)),i.stdout(`${w??n}
2
+ import{mkdir as F,writeFile as G}from"node:fs/promises";import{tmpdir as J}from"node:os";import{dirname as K,join as R}from"node:path";import"@allyhub/stage-runtime/use";import{CLI_PROGRAM as H,EXIT as l,PROBLEMS_FOUND as Y}from"@allyhub/protocol/cli";import{WORK_DIR as V}from"@allyhub/formats/layout";import{projectAt as X}from"./project.js";import{cutLong as q}from"./text/long-text.js";import{readArgs as z}from"./args.js";import{CLI_VERSION as b}from"./cli-version.js";import{CommandError as E}from"./command.js";import{COMMAND_SOURCES as A}from"./commands/index.js";import{commandEntries as Q,commandEntry as Z,entriesOf as tt,joinedCommands as nt}from"./commands/list.js";import{contributedSpecs as et}from"./commands/contributed.js";import{groupHelp as ot,listHelp as rt,workHelp as it}from"./help.js";import{sdkDocs as at}from"./sdk-docs.js";import{cliTelemetry as st}from"./telemetry.js";import{turnOf as ct}from"./turn.js";import{endUpdateCheck as dt}from"./update-notice.js";import{WORKS as mt,cloudNouns as ut,withJoined as U,workNamed as lt,workTitle as W}from"./works.js";const j={stdout:o=>process.stdout.write(o),stderr:o=>process.stderr.write(o),cwd:process.cwd(),env:process.env};export const FORMER_NAMES={render:"export"};export function namedNow(o){const i=o[0]==="help"?1:0,a=FORMER_NAMES[o[i]??""];return o.map((s,h)=>h===i&&a!==void 0?a:s)}export function findCommand(o,i){let a;for(const s of i){const h=s.name.split(" ");h.every((w,e)=>o[e]===w)&&h.length>(a?.length??0)&&(a={command:s,length:h.length})}return a?{command:a.command,rest:o.slice(a.length)}:{rest:[...o]}}export async function resolveCommand(o,i,a,s=A){const h=async e=>{const c=await e.resolve(o,i);return c&&{...c,command:Z(c.command,a)}},w=findCommand(o,a);if(w.command){const e=w.command.name;if(w.rest.length>0)for(const c of s.filter(y=>y.under===e)){const y=await h(c);if(y)return y}return w}for(const e of s){const c=await h(e);if(c)return c}return w}export async function main(o,i=j,a,s=A,h){const w=o.includes("--json"),e=namedNow(o.filter(t=>t!=="--json")),c=async(t,n,$)=>{if(w){i.stdout(`${JSON.stringify(t,null,2)}
3
+ `);return}const v=await X(i.cwd),m=R(v===void 0?R(J(),"allyhub"):R(v,V),"out",`${$.replaceAll(" ","-")}.txt`),p=q(n,m);p!==void 0&&(await F(K(m),{recursive:!0}),await G(m,`${n}
4
+ `)),(p??n)!==""&&i.stdout(`${p??n}
5
5
  `)},y=new AbortController,g={cwd:i.cwd,env:{ALLYHUB_CLIENT:`${H}/${b}`,...i.env},progress:t=>{i.stderr(`${t}
6
- `)},signal:y.signal};if(e[0]==="--version"||e[0]==="-v")return await c({version:b},b,"version"),l.ok;const N=a===void 0?await Q():tt(a),L=t=>N.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(r=>r.startsWith("-")),n=(t<0?e.slice(1):e.slice(1,t+1)).flatMap(r=>r.split(" ").filter(d=>d!=="")),$=await at(i.cwd).catch(()=>{}),v=async()=>{const r=await Promise.all(s.map(d=>d.nouns(g).then(P=>P.map(B=>({...B,work:d.works!==!1}))).catch(()=>{})));return r.some(d=>d===void 0)?void 0:r.flatMap(d=>d??[])},m=await et(g,await nt());if(n.length===0){const r=await v();return await c({version:b,docs:$?.dir,works:mt.map(d=>({...U(d,m),title:W(d,r)})),commands:N.map(d=>d.spec),made:[...s.flatMap(d=>d.entries),...r??[]]},rt(N,s,r,$?.dir),"help"),l.ok}const w=n.length===1?lt(n[0]??""):void 0,f=w&&U(w,m);if(f){const r=f.cloud===void 0?[]:await v();return await c({...f,title:W(f,r),...f.cloud===void 0?{}:{cloudWorks:r&&ut(f,r)},docsDir:$?.dir},it(f,N,s,$?.dir,r,m),`help ${n.join(" ")}`),l.ok}let S;try{S=await resolveCommand(n,g,N,s)}catch(r){return C(r)}const{command:u,rest:x}=S;if(u&&S.list===!0)return await T(u,x);const k=L(n);return!u&&k.length>0?(await c({commands:k.map(r=>r.spec)},ot(n.join(" "),k),`help ${n.join(" ")}`),l.ok):!u||x.length>0?C(new E("unknown-command",`allyhub has no command "${n.join(" ")}".`,{exit:l.usage,hint:"allyhub help lists them and the works."})):(await c(u.described,u.help,`help ${u.name}`),l.ok)}let M;try{M=await resolveCommand(e,g,N,s)}catch(t){return C(t)}const{command:O,rest:I}=M;if(!O){const t=L(e.slice(0,1));return C(new E("unknown-command",`allyhub has no command "${e.join(" ")}".`,{exit:l.usage,hint:t.length>0?`${e[0]??""} has these: ${t.map(n=>n.name).join(", ")}.`:"allyhub help lists them."}))}if(I.includes("--help")||I.includes("-h"))return await c(O.described,O.help,`${O.name} help`),l.ok;return await T(O,I);async function T(t,n){const $=()=>{y.abort(new E("interrupted","Stopped.",{exit:l.interrupted}))};process.once("SIGINT",$);const v=Date.now();let m=l.failed,w;const f=await ct(g.env,g.cwd),S=f===void 0?g:{...g,env:{...g.env,TRACEPARENT:f}};try{const u=await t.command(),x=z(u.spec,n),k=await u.run(x,S);await c(k.value,k.text,u.spec.name),m=k.exit??l.ok,m!==l.ok&&(w=k.code??Y)}catch(u){const x=_(u);m=x.exit,w=x.code,D(x)}finally{process.off("SIGINT",$)}return await p?.({command:t.name,ms:Date.now()-v,exit:m,...w===void 0?{}:{code:w},...f===void 0?{}:{traceparent:f}}),m}function C(t){const n=_(t);return D(n),n.exit}function _(t){return t instanceof E?t:y.signal.aborted?new E("interrupted","Stopped.",{exit:l.interrupted}):new E("failed",t instanceof Error?t.message:String(t))}function D(t){if(h){const n={error:{code:t.code,message:t.message,...t.hint?{hint:t.hint}:{}}};i.stdout(`${JSON.stringify(n,null,2)}
6
+ `)},signal:y.signal};if(e[0]==="--version"||e[0]==="-v")return await c({version:b},b,"version"),l.ok;const N=a===void 0?await Q():tt(a),L=t=>N.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(r=>r.startsWith("-")),n=(t<0?e.slice(1):e.slice(1,t+1)).flatMap(r=>r.split(" ").filter(d=>d!=="")),$=await at(i.cwd).catch(()=>{}),v=async()=>{const r=await Promise.all(s.map(d=>d.nouns(g).then(P=>P.map(B=>({...B,work:d.works!==!1}))).catch(()=>{})));return r.some(d=>d===void 0)?void 0:r.flatMap(d=>d??[])},m=await et(g,await nt());if(n.length===0){const r=await v();return await c({version:b,docs:$?.dir,works:mt.map(d=>({...U(d,m),title:W(d,r)})),commands:N.map(d=>d.spec),made:[...s.flatMap(d=>d.entries),...r??[]]},rt(N,s,r,$?.dir),"help"),l.ok}const p=n.length===1?lt(n[0]??""):void 0,f=p&&U(p,m);if(f){const r=f.cloud===void 0?[]:await v();return await c({...f,title:W(f,r),...f.cloud===void 0?{}:{cloudWorks:r&&ut(f,r)},docsDir:$?.dir},it(f,N,s,$?.dir,r,m),`help ${n.join(" ")}`),l.ok}let S;try{S=await resolveCommand(n,g,N,s)}catch(r){return C(r)}const{command:u,rest:k}=S;if(u&&S.list===!0)return await T(u,k);const x=L(n);return!u&&x.length>0?(await c({commands:x.map(r=>r.spec)},ot(n.join(" "),x),`help ${n.join(" ")}`),l.ok):!u||k.length>0?C(new E("unknown-command",`allyhub has no command "${n.join(" ")}".`,{exit:l.usage,hint:"allyhub help lists them and the works."})):(await c(u.described,u.help,`help ${u.name}`),l.ok)}let M;try{M=await resolveCommand(e,g,N,s)}catch(t){return C(t)}const{command:O,rest:I}=M;if(!O){const t=L(e.slice(0,1));return C(new E("unknown-command",`allyhub has no command "${e.join(" ")}".`,{exit:l.usage,hint:t.length>0?`${e[0]??""} has these: ${t.map(n=>n.name).join(", ")}.`:"allyhub help lists them."}))}if(I.includes("--help")||I.includes("-h"))return await c(O.described,O.help,`${O.name} help`),l.ok;return await T(O,I);async function T(t,n){const $=()=>{y.abort(new E("interrupted","Stopped.",{exit:l.interrupted}))};process.once("SIGINT",$);const v=Date.now();let m=l.failed,p;const f=await ct(g.env,g.cwd),S=f===void 0?g:{...g,env:{...g.env,TRACEPARENT:f}};try{const u=await t.command(),k=z(u.spec,n),x=await u.run(k,S);await c(x.value,x.text,u.spec.name),m=x.exit??l.ok,m!==l.ok&&(p=x.code??Y)}catch(u){const k=_(u);m=k.exit,p=k.code,D(k)}finally{process.off("SIGINT",$)}return await h?.({command:t.name,ms:Date.now()-v,exit:m,...p===void 0?{}:{code:p},...f===void 0?{}:{traceparent:f}}),m}function C(t){const n=_(t);return D(n),n.exit}function _(t){return t instanceof E?t:y.signal.aborted?new E("interrupted","Stopped.",{exit:l.interrupted}):new E("failed",t instanceof Error?t.message:String(t))}function D(t){if(w){const n={error:{code:t.code,message:t.message,...t.hint?{hint:t.hint}:{}}};i.stdout(`${JSON.stringify(n,null,2)}
7
7
  `)}else i.stderr(`${t.message}${t.hint?`
8
8
  ${t.hint}`:""}
9
9
  `)}}export async function run(o){const i=await main(o,j,void 0,A,st({ALLYHUB_CLIENT:`${H}/${b}`,...j.env},s=>{j.stderr(s)})),a=await dt();return a!==void 0&&j.stderr(`${a}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/3d-extension",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./tools": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/audio",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/blocks",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/browser",
3
- "version": "0.21.0",
3
+ "version": "0.22.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{readFile as y,writeFile as F}from"node:fs/promises";import{join as v}from"node:path";import{pathToFileURL as x}from"node:url";import{listedWork as b,WORK_FILE as j}from"@allyhub/formats";import{parseDocument as M}from"yaml";import{currentFormats as O,readWork as g}from"./work.js";export const defineMigrations=n=>n;export async function projectFormats(n,t){const{work:r}=await g(n),i=r.versions,o={};for(const e of t)e.migrations!==void 0&&(o[e.id]=i?.[e.id]??1);return{formats:o,recorded:i!==void 0}}export async function behindIn(n,t){const{formats:r}=await projectFormats(n,t);return t.flatMap(i=>{const o=r[i.id];return i.migrations===void 0||o===void 0||o>=i.migrations.format?[]:[{kind:i.id,at:o,now:i.migrations.format}]})}const p=new Map;function S(n){const t=n.migrations?.module;if(t===void 0)return;let r=p.get(t);return r||(r=import(t.includes("://")?t:x(t).href).then(o=>{const e=o.default;if(!e||!Array.isArray(e.migrations))throw new Error(`${n.extension}'s migrations module for ${n.id} (${t}) has no migrations.`);return e}),p.set(t,r)),r}export async function migrateProject(n,t){const{formats:r,recorded:i}=await projectFormats(n,t),{work:o}=await g(n),e=b(o),c=[];for(const s of t){const f=r[s.id];if(s.migrations===void 0||f===void 0||f>=s.migrations.format)continue;const w=await S(s),l=e.filter(a=>a.kind===s.id).map(a=>a.file.replace(/^\.\//u,"")),m=new Set,u=[];for(const a of w?.migrations??[])if(!(a.to<=f||a.to>s.migrations.format)){for(const h of await a.run({root:n,files:l}))m.add(h);u.push(a.about)}c.push({kind:s.id,at:f,now:s.migrations.format,changed:[...m],about:u})}const d=O(t);return i&&Object.entries(d).every(([s,f])=>o.versions?.[s]===f)||await W(n,d),c}async function W(n,t){const r=v(n,j),i=await y(r,"utf8").catch(()=>{});if(i===void 0)return;const o=M(i),e=o.toJS()?.versions;o.set("versions",{...e,...t}),await F(r,o.toString())}
2
+ import{readFile as y,writeFile as F}from"node:fs/promises";import{join as v}from"node:path";import{pathToFileURL as b}from"node:url";import{listedWork as j,WORK_FILE as M}from"@allyhub/formats";import{parseDocument as O}from"yaml";import{currentFormats as S,readWork as p}from"./work.js";export const defineMigrations=n=>n;export async function projectFormats(n,t){const{work:r}=await p(n),i=r.versions,o={};for(const e of t)e.migrations!==void 0&&(o[e.id]=i?.[e.id]??1);return{formats:o,recorded:i!==void 0}}export async function behindIn(n,t){const{formats:r}=await projectFormats(n,t);return t.flatMap(i=>{const o=r[i.id];return i.migrations===void 0||o===void 0||o>=i.migrations.format?[]:[{kind:i.id,at:o,now:i.migrations.format}]})}const w=new Map;function W(n){const t=n.migrations?.module;if(t===void 0)return;let r=w.get(t);return r||(r=import(t.includes("://")?t:b(t).href).then(o=>{const e=o.default;if(!e||!Array.isArray(e.migrations))throw new Error(`${n.extension}'s migrations module for ${n.id} (${t}) has no migrations.`);return e}),w.set(t,r)),r}export async function migrateProject(n,t){const{formats:r,recorded:i}=await projectFormats(n,t),{work:o}=await p(n),e=j(o),c=[];for(const s of t){const f=r[s.id];if(s.migrations===void 0||f===void 0||f>=s.migrations.format)continue;const l=await W(s),h=e.filter(a=>a.kind===s.id).map(a=>a.file.replace(/^\.\//u,"")),u=new Set,g=[];for(const a of l?.migrations??[])if(!(a.to<=f||a.to>s.migrations.format)){for(const x of await a.run({root:n,files:h}))u.add(x);g.push(a.about)}c.push({kind:s.id,at:f,now:s.migrations.format,changed:[...u],about:g})}const d=S(t);return i&&Object.entries(d).every(([s,f])=>(o.versions?.[s]??0)>=f)||await $(n,d),c}async function $(n,t){const r=v(n,M),i=await y(r,"utf8").catch(()=>{});if(i===void 0)return;const o=O(i),e=o.toJS()?.versions,c={...e};for(const[d,m]of Object.entries(t))c[d]=Math.max(e?.[d]??0,m);o.set("versions",c),await F(r,o.toString())}
@@ -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 oe,readFile as ae,readdir as re,writeFile as ce}from"node:fs/promises";import{join as y}from"node:path";import{BAKE_DIR as q,CACHE_DIR as le,CONFIG_FILES as fe,ConfigSchema as F,TEXT_DIR as j,USE_FORMS as de,itemsOf as me,kindsUsed as ue,pointEntriesIn as he,WORK_FILE as h}from"@allyhub/formats";import{problem as p}from"@allyhub/diagnostics";import{looksOf as G,resolveDims as pe}from"@allyhub/piece";import{readData as ge}from"./data.js";import{dependenciesOf as we,listFiles as be}from"./files.js";import{projectTheme as V,readWork as ke}from"./work.js";import{behindIn as $e}from"./migrate.js";import{fontStyles as ye}from"./fonts.js";import{kindBuildOf as X}from"./kind-build.js";import{readMedia as xe}from"./media.js";import{readMessages as Se}from"./messages.js";import{MetaLoader as Oe}from"./meta.js";import{allyhubPlugin as je,mediaHref as z}from"./plugin.js";import{buildPluginModules as Me,stageAdditions as Ae}from"./build-plugins.js";import{checkImports as Ee,discover as ve,parse as Te}from"./scan.js";import{writeMessageTypes as De}from"./types.js";import{resolveUses as Fe}from"./uses.js";import{bundleForStage as Ke,loadUserVite as Ie}from"./vite.js";import{nodeStackPlace as Re}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",`${h} lists ${e.file} as a ${e.kind}, a kind no extension here contributes.`,{where:{file:h}});case"no-editor":return p("AK-M002",`${h} 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:h}});case"missing":return p("AK-M002",`${h} lists ${e.file}, which is not in the project. Write it, or take it out of the list.`,{where:{file:h}});case"same-id":return p("AK-M003",`${h} 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:h}})}}export function loadFailure(e,n,s){const a=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 (${a}). 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}: ${a}`,{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 _e(e){return(await re(y(e,q)).catch(()=>[])).filter(s=>/^[0-9a-f]+\.[\w-]+\.bin$/u.test(s)).map(s=>`${q}/${s}`)}async function Pe(e,n,s){const a=o=>typeof s=="object"&&s!==null&&Object.hasOwn(s,o),f=[],i=new Set,l=new Set(ue(e,n));for(const o of e){if(!l.has(o)&&!(o.config??[]).some(a))continue;const r=await X(o)?.catch(()=>{});!r?.config||i.has(r)||(i.add(r),f.push(r.config))}return f}export async function prepare(e,n){const s=[],a=await be(e),f=await ke(e);for(const m of f.problems)s.push(p("AK-M002",m,{where:{file:h}}));if(a.includes(h)&&f.problems.length===0&&f.work.versions===void 0)s.push(p("AK-M002",`${h} records no versions (the format each kind's files are in), so its files are taken as each kind's first: allyhub migrate brings them to AllyHub's formats and records them, as Studio does when it opens the project.`,{where:{file:h}}));else for(const m of await $e(e,n.kinds))s.push(p("AK-M002",`The project's ${m.kind} files are in format ${String(m.at)}, and AllyHub's are in ${String(m.now)}: allyhub migrate brings them to it, as Studio does when it opens the project.`,{where:{file:h}}));const i=me(f.work,n.kinds,new Set(a));for(const m of i.problems)s.push(itemProblem(m));const l=await we(e),o=await xe(e,[...a,...await _e(e)]),r=await Ae(n.kinds,e,(m,w)=>{s.push(p("AK-R001",`The build plugins module ${m} did not load, so the stage's bundles go without it: ${w instanceof Error?w.message:String(w)}`,{}))}),b=new Oe({root:e,media:o,dependencies:[...l],user:!0,lent:{...r.lent},sdk:{...r.sdk},bound:{...r.bound},parts:{...r.parts},buildPlugins:Me(n.kinds)},n.metaTimeout);try{let m=F.parse({});const w=fe.find(t=>a.includes(t));if(w){const t=await b.request({type:"config",file:w});if(s.push(...t.problems),!t.ok)s.push(loadFailure(w,t.error??"",Re(t.stack,e)));else{const c=t.value??{},d=await Pe(n.kinds,i.items,c),u=new Set(d.flatMap(g=>Object.keys(g.shape??{}))),$=F.safeParse(Object.fromEntries(Object.entries(c).filter(([g])=>!u.has(g)||Object.hasOwn(F.shape,g)))),J=d.map(g=>g.safeParse(c)),W=[...$.success?[]:[issuesText($.error)],...J.flatMap(g=>g.success?[]:[issuesText(g.error)])];if($.success&&W.length===0){m=$.data;for(const g of J)g.success&&(m={...m,...g.data})}else s.push(p("AK-M001",`${w} is not valid: ${W.join("; ")}.`,{where:{file:w}}))}}const I=m.defaults?.format,R=typeof I=="string"?I:"16x9",M=ye(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:w??"allyhub.config.ts"}}));const x=await Se(e,a,{...m.locales?{locales:m.locales}:{},text:m.text??j});s.push(...x.problems);const Y=a.filter(t=>/\.(ts|tsx|js|jsx|mts|mjs)$/u.test(t)&&!t.endsWith(".d.ts")),A=new Map;for(const t of Y){const c=Te(t,await ae(y(e,t),"utf8"));A.set(t,c),s.push(...Ee(t,c,l,new Set(Object.keys(r.lent)),new Set(Object.keys(r.sdk))))}const _=[];for(const[t,c]of A){if(!ve(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 E=await Le(i.items,n.kinds,s),P=new Map,N=(t,c)=>({root:e,files:a,meta:b,media:o,messages:x,defaultFormat:R,config:m,lent:t,data:c,parsed:d=>A.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=>he(n.kinds,c.kind,d)}),k=[];let S={};const Z=N({},{}),v=new Map,T=new Map,B=(t,c)=>{v.set(t,[...v.get(t)??[],...c.files??[]]),c.uses&&c.uses.length>0&&T.set(t,[...T.get(t)??[],...c.uses])};for(const t of i.items){const c=await E.get(t)?.lend?.(t,L(Z,t));c&&(k.push(c),B(t,c),S={...S,...c.data})}const C={...await ge(e,a.filter(t=>!i.items.some(c=>c.entry===t)),m.text??j),...S},ee=N(S,C);for(const t of i.items){const c=await E.get(t)?.read?.(t,L(ee,t));c&&(k.push(c),B(t,c));const d=new Set([t.entry]);t.files=[{path:t.entry,role:"entry"},...(v.get(t)??[]).filter(u=>!d.has(u.path)&&!!d.add(u.path))]}for(const t of k)s.push(...t.problems??[]);const te=new Set(i.items.flatMap(t=>E.get(t)?.onStage?[t.kind]:[]));s.push(...Fe(i.items,n.kinds,T,{live:t=>te.has(t),lent:new Set(Object.keys(S))}));const se=k.flatMap(t=>t.piece?[t.piece]:[]),ne=k.flatMap(t=>t.doc?[t.doc]:[]),ie=k.flatMap(t=>t.sheet?[t.sheet]:[]),H=[...k.filter(t=>t.piece),...k.filter(t=>!t.piece)].flatMap(t=>t.stage?[t.stage]:[]),O=x.locales[0];await De(e,O===void 0?{}:x.messages[O]??{},O===void 0?void 0:x.files[O]);let D;if(n.buildDir&&H.length>0){const t=Object.fromEntries(await Promise.all(H.map(async d=>[d.name,await Ne(e,d)]))),c=await Ie(e);try{const d=await Ke({root:e,entries:t,outDir:n.buildDir,plugins:[je({root:e,media:o,dependencies:l,fonts:()=>M.styles,stageEntries:new Set(Object.values(t)),lent:r.lent,sdk:r.sdk,bound:r.bound,parts:r.parts}),...r.plugins],...c?{user:c}:{}}),u=await r.written(n.buildDir);D={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 U=new Set;return{root:e,kinds:n.kinds,files:a,items:i.items,config:m,defaultFormat:R,dependencies:[...l].sort(),messages:x,media:o,data:C,docs:ne,sheets:ie,pieces:se,components:_,fonts:M.styles,...D?{bundle:D}:{},problems:s.filter(t=>{const c=`${t.code}|${t.message}|${t.where?.file??""}|${String(t.where?.line??"")}`;return U.has(c)?!1:(U.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 Ne(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 a=y(e,le,"stage-entries");await oe(a,{recursive:!0});const f=y(a,`${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,r)=>`import * as m${String(r)} 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 Le(e,n,s){const a=new Map,f=new Map;for(const i of e){if(!a.has(i.kind)){const o=n.find(r=>r.id===i.kind);a.set(i.kind,await X(o)?.catch(r=>{s.push(p("AK-R001",`The ${o?.extension??i.kind} extension's build module did not load, so its items are not read: ${r instanceof Error?r.message:String(r)}`,{}))}))}const l=a.get(i.kind);l&&f.set(i,l)}return f}function K(e,n){const s=[],a=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 r of o.css)a.add(`${BUILD_FOLDER}${r}`);for(const r of o.imports)i(r)}};return i(n),{imports:s,styles:[...a]}}export function sourceOf(e,n){if("components"in n)return Ce(e,n);const s=n,a=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:`${a}${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(([r,b])=>[r,{...b,url:z(r)}])),data:e.data,kind:s.kind,...s.loads,...G(e.config,V(e.root)),pieces:Q(e,s.place)}}function Q(e,n){const s=new Map(e.items.map(i=>[i.id,i])),a=new Set,f=i=>{for(const l of s.get(i)?.uses??[])l.type!==de.live||a.has(l.item)||(a.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(!a.has(i.place)||i.place===n||!o)return[i.id,l];const{imports:r,styles:b}=K(e,o.file);return[i.id,{...l,kind:i.kind,module:`${BUILD_FOLDER}${o.file}`,imports:r,styles:b,...i.script===void 0?{}:{script:i.script},...i.loads?.kindData===void 0?{}:{kindData:i.loads.kindData}}]}))}const Be="1920x1080";function Ce(e,n){const s=stageName(n.place),a=e.bundle?.chunks.entries[s];if(!a)throw new Error(`${n.place} shows no component: it has no stage bundle.`);const{imports:f,styles:i}=K(e,a.file);return{kind:"doc",piece:n.place,file:n.file,module:`${BUILD_FOLDER}${a.file}`,imports:f,styles:i,dims:pe(void 0,{locales:e.messages.locales}),format:Be,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:z(l)}])),data:e.data,...G(e.config,V(e.root)),pieces:Q(e,n.place)}}
2
+ import{mkdir as ce,readFile as G,readdir as le,writeFile as fe}from"node:fs/promises";import{join as $}from"node:path";import{BAKE_DIR as V,CACHE_DIR as de,CONFIG_FILES as me,ConfigSchema as F,PACKAGE_FILE as X,TEXT_DIR as j,USE_FORMS as ue,itemsOf as he,kindsUsed as pe,pointEntriesIn as ge,WORK_FILE as p}from"@allyhub/formats";import{problem as h}from"@allyhub/diagnostics";import{looksOf as z,resolveDims as we}from"@allyhub/piece";import{readData as be}from"./data.js";import{dependenciesOf as ke,listFiles as $e}from"./files.js";import{projectTheme as Q,readWork as ye}from"./work.js";import{behindIn as Se}from"./migrate.js";import{fontStyles as xe}from"./fonts.js";import{kindBuildOf as Y}from"./kind-build.js";import{readMedia as Oe}from"./media.js";import{readMessages as je}from"./messages.js";import{MetaLoader as Me}from"./meta.js";import{allyhubPlugin as Ee,mediaHref as Z}from"./plugin.js";import{buildPluginModules as Ae,stageAdditions as ve}from"./build-plugins.js";import{SDK as M}from"./project-root.js";import{checkImports as Ke,discover as Te,parse as De}from"./scan.js";import{writeMessageTypes as Fe}from"./types.js";import{resolveUses as Ie}from"./uses.js";import{bundleForStage as Re,loadUserVite as _e}from"./vite.js";import{nodeStackPlace as Ne}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 h("AK-M002",`${p} lists ${e.file} as a ${e.kind}, a kind no extension here contributes.`,{where:{file:p}});case"no-editor":return h("AK-M002",`${p} 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:p}});case"missing":return h("AK-M002",`${p} lists ${e.file}, which is not in the project. Write it, or take it out of the list.`,{where:{file:p}});case"same-id":return h("AK-M003",`${p} 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:p}})}}export function loadFailure(e,n,s){const a=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 h("AK-R001",f?`${e} uses something at its top level that only exists in the browser (${a}). 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}: ${a}`,{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 Pe(e){return(await le($(e,V)).catch(()=>[])).filter(s=>/^[0-9a-f]+\.[\w-]+\.bin$/u.test(s)).map(s=>`${V}/${s}`)}async function Le(e,n,s){const a=o=>typeof s=="object"&&s!==null&&Object.hasOwn(s,o),f=[],i=new Set,l=new Set(pe(e,n));for(const o of e){if(!l.has(o)&&!(o.config??[]).some(a))continue;const r=await Y(o)?.catch(()=>{});!r?.config||i.has(r)||(i.add(r),f.push(r.config))}return f}const Be=(e,n)=>G($(e,"node_modules",n,X),"utf8").then(()=>!0,s=>{if(s instanceof Error&&"code"in s&&(s.code==="ENOENT"||s.code==="ENOTDIR"))return!1;throw s});export async function prepare(e,n){const s=[],a=await $e(e),f=await ye(e);for(const m of f.problems)s.push(h("AK-M002",m,{where:{file:p}}));if(a.includes(p)&&f.problems.length===0&&f.work.versions===void 0)s.push(h("AK-M002",`${p} records no versions (the format each kind's files are in), so its files are taken as each kind's first: allyhub migrate brings them to AllyHub's formats and records them, as Studio does when it opens the project.`,{where:{file:p}}));else for(const m of await Se(e,n.kinds))s.push(h("AK-M002",`The project's ${m.kind} files are in format ${String(m.at)}, and AllyHub's are in ${String(m.now)}: allyhub migrate brings them to it, as Studio does when it opens the project.`,{where:{file:p}}));const i=he(f.work,n.kinds,new Set(a));for(const m of i.problems)s.push(itemProblem(m));const l=await ke(e);l.has(M)&&!await Be(e,M)&&s.push(h("AK-B009",`package.json declares ${M}, which is not installed, so its imports are refused: npm install installs it. A project that declares no ${M} is lent the one allyhub brings.`,{where:{file:X}}));const o=await Oe(e,[...a,...await Pe(e)]),r=await ve(n.kinds,e,(m,w)=>{s.push(h("AK-R001",`The build plugins module ${m} did not load, so the stage's bundles go without it: ${w instanceof Error?w.message:String(w)}`,{}))}),b=new Me({root:e,media:o,dependencies:[...l],user:!0,lent:{...r.lent},sdk:{...r.sdk},bound:{...r.bound},parts:{...r.parts},buildPlugins:Ae(n.kinds)},n.metaTimeout);try{let m=F.parse({});const w=me.find(t=>a.includes(t));if(w){const t=await b.request({type:"config",file:w});if(s.push(...t.problems),!t.ok)s.push(loadFailure(w,t.error??"",Ne(t.stack,e)));else{const c=t.value??{},d=await Le(n.kinds,i.items,c),u=new Set(d.flatMap(g=>Object.keys(g.shape??{}))),y=F.safeParse(Object.fromEntries(Object.entries(c).filter(([g])=>!u.has(g)||Object.hasOwn(F.shape,g)))),W=d.map(g=>g.safeParse(c)),q=[...y.success?[]:[issuesText(y.error)],...W.flatMap(g=>g.success?[]:[issuesText(g.error)])];if(y.success&&q.length===0){m=y.data;for(const g of W)g.success&&(m={...m,...g.data})}else s.push(h("AK-M001",`${w} is not valid: ${q.join("; ")}.`,{where:{file:w}}))}}const R=m.defaults?.format,_=typeof R=="string"?R:"16x9",E=xe(e,m);for(const t of E.missing)s.push(h("AK-A001",`allyhub.config's fonts name ${t}, which is not in the project or its packages.`,{where:{file:w??"allyhub.config.ts"}}));const S=await je(e,a,{...m.locales?{locales:m.locales}:{},text:m.text??j});s.push(...S.problems);const te=a.filter(t=>/\.(ts|tsx|js|jsx|mts|mjs)$/u.test(t)&&!t.endsWith(".d.ts")),A=new Map;for(const t of te){const c=De(t,await G($(e,t),"utf8"));A.set(t,c),s.push(...Ke(t,c,l,new Set(Object.keys(r.lent)),new Set(Object.keys(r.sdk))))}const N=[];for(const[t,c]of A){if(!Te(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"&&N.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 He(i.items,n.kinds,s),P=new Map,L=(t,c)=>({root:e,files:a,meta:b,media:o,messages:S,defaultFormat:_,config:m,lent:t,data:c,parsed:d=>A.get(d),items:i.items,claim:(d,u)=>{const y=P.get(d);return y===void 0&&P.set(d,u),y},contributionsTo:()=>[]}),B=(t,c)=>({...t,contributionsTo:d=>ge(n.kinds,c.kind,d)}),k=[];let x={};const se=L({},{}),K=new Map,T=new Map,C=(t,c)=>{K.set(t,[...K.get(t)??[],...c.files??[]]),c.uses&&c.uses.length>0&&T.set(t,[...T.get(t)??[],...c.uses])};for(const t of i.items){const c=await v.get(t)?.lend?.(t,B(se,t));c&&(k.push(c),C(t,c),x={...x,...c.data})}const H={...await be(e,a.filter(t=>!i.items.some(c=>c.entry===t)),m.text??j),...x},ne=L(x,H);for(const t of i.items){const c=await v.get(t)?.read?.(t,B(ne,t));c&&(k.push(c),C(t,c));const d=new Set([t.entry]);t.files=[{path:t.entry,role:"entry"},...(K.get(t)??[]).filter(u=>!d.has(u.path)&&!!d.add(u.path))]}for(const t of k)s.push(...t.problems??[]);const ie=new Set(i.items.flatMap(t=>v.get(t)?.onStage?[t.kind]:[]));s.push(...Ie(i.items,n.kinds,T,{live:t=>ie.has(t),lent:new Set(Object.keys(x))}));const oe=k.flatMap(t=>t.piece?[t.piece]:[]),ae=k.flatMap(t=>t.doc?[t.doc]:[]),re=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=S.locales[0];await Fe(e,O===void 0?{}:S.messages[O]??{},O===void 0?void 0:S.files[O]);let D;if(n.buildDir&&U.length>0){const t=Object.fromEntries(await Promise.all(U.map(async d=>[d.name,await Ce(e,d)]))),c=await _e(e);try{const d=await Re({root:e,entries:t,outDir:n.buildDir,plugins:[Ee({root:e,media:o,dependencies:l,fonts:()=>E.styles,stageEntries:new Set(Object.values(t)),lent:r.lent,sdk:r.sdk,bound:r.bound,parts:r.parts}),...r.plugins],...c?{user:c}:{}}),u=await r.written(n.buildDir);D={dir:n.buildDir,chunks:d,beside:u}}catch(d){s.push(h("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:a,items:i.items,config:m,defaultFormat:_,dependencies:[...l].sort(),messages:S,media:o,data:H,docs:ae,sheets:re,pieces:oe,components:N,fonts:E.styles,...D?{bundle:D}:{},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 Ce(e,n){const s=(n.components??[]).filter(o=>o.item!==!0);if(s.length===0&&n.module!==void 0)return $(e,n.module);const a=$(e,de,"stage-entries");await ce(a,{recursive:!0});const f=$(a,`${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($(e,n.module))};`],...i.map((o,r)=>`import * as m${String(r)} from ${JSON.stringify($(e,o))};`),"export const components = {",...s.map(o=>` ${JSON.stringify(o.of)}: m${String(i.indexOf(o.module))}[${JSON.stringify(o.name)}],`),"};",""];return await fe(f,l.join(`
4
+ `)),f}async function He(e,n,s){const a=new Map,f=new Map;for(const i of e){if(!a.has(i.kind)){const o=n.find(r=>r.id===i.kind);a.set(i.kind,await Y(o)?.catch(r=>{s.push(h("AK-R001",`The ${o?.extension??i.kind} extension's build module did not load, so its items are not read: ${r instanceof Error?r.message:String(r)}`,{}))}))}const l=a.get(i.kind);l&&f.set(i,l)}return f}function I(e,n){const s=[],a=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 r of o.css)a.add(`${BUILD_FOLDER}${r}`);for(const r of o.imports)i(r)}};return i(n),{imports:s,styles:[...a]}}export function sourceOf(e,n){if("components"in n)return Je(e,n);const s=n,a=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}=I(e,i.file);return{piece:s.id,file:s.file,module:`${a}${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(([r,b])=>[r,{...b,url:Z(r)}])),data:e.data,kind:s.kind,...s.loads,...z(e.config,Q(e.root)),pieces:ee(e,s.place)}}function ee(e,n){const s=new Map(e.items.map(i=>[i.id,i])),a=new Set,f=i=>{for(const l of s.get(i)?.uses??[])l.type!==ue.live||a.has(l.item)||(a.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(!a.has(i.place)||i.place===n||!o)return[i.id,l];const{imports:r,styles:b}=I(e,o.file);return[i.id,{...l,kind:i.kind,module:`${BUILD_FOLDER}${o.file}`,imports:r,styles:b,...i.script===void 0?{}:{script:i.script},...i.loads?.kindData===void 0?{}:{kindData:i.loads.kindData}}]}))}const Ue="1920x1080";function Je(e,n){const s=stageName(n.place),a=e.bundle?.chunks.entries[s];if(!a)throw new Error(`${n.place} shows no component: it has no stage bundle.`);const{imports:f,styles:i}=I(e,a.file);return{kind:"doc",piece:n.place,file:n.file,module:`${BUILD_FOLDER}${a.file}`,imports:f,styles:i,dims:we(void 0,{locales:e.messages.locales}),format:Ue,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:Z(l)}])),data:e.data,...z(e.config,Q(e.root)),pieces:ee(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 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)}.`}}
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,WORK_FILE as h}from"@allyhub/formats/layout";export const SDK="@allyhub/sdk";const y=["allyhub",SDK];async function m(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&&y.some(f=>f in n))return!0}}catch{}for(const r of[h,...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 m(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,4 +1,4 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{readFileSync as O,statSync as W}from"node:fs";import{readFile as k,writeFile as F}from"node:fs/promises";import{join as f}from"node:path";import{itemsOf as $,parseWork as h,WORK_FILE as c,WorkItemSchema as j}from"@allyhub/formats";import{isMap as g,isScalar as y,isSeq as E,parseDocument as S,parse as x,visit as v}from"yaml";import{listFiles as I}from"./files.js";export async function readWork(r){const t=await k(f(r,c),"utf8").catch(()=>{});if(t===void 0)return{work:{work:[]},problems:[]};let o;try{o=x(t)}catch(e){return{work:{work:[]},problems:[`${c} is not valid YAML: ${e.message.split(`
3
- `)[0]??""}`]}}const n=h(o);return n.ok?{work:n.value,problems:[]}:{work:{work:[]},problems:n.problems.map(e=>`${c}: ${e}`)}}const M=new Map;export function projectTheme(r){const t=f(r,c);let o;try{o=W(t).mtimeMs}catch{return}const n=M.get(r);if(n?.at===o)return n.theme;let e;try{const s=h(x(O(t,"utf8")));e=s.ok?s.value.theme:void 0}catch{e=void 0}return M.set(r,{at:o,theme:e}),e}export async function projectItems(r,t,o,n){const{work:e,problems:s}=await readWork(r);return{...$(e,t,new Set(o??await I(r)),n),listProblems:s}}export function currentFormats(r){return Object.fromEntries(r.flatMap(t=>t.migrations===void 0?[]:[[t.id,t.migrations.format]]))}export async function listWork(r,t,o){const n=f(r,c),e=await k(n,"utf8").catch(()=>{}),s=S(e??`work: []
4
- `);e===void 0&&s.set("versions",currentFormats(o));const i=s.toJS()?.work;if(JSON.stringify(i??[]).includes(JSON.stringify(t.file)))return;Array.isArray(i)||s.set("work",s.createNode([]));const a=s.get("work",!0);E(a)&&(a.flow=!1),s.addIn(["work"],t),await F(n,s.toString())}export function unlistedWork(r,t){const o=S(r),n=[],e=[];return v(o,{Map(s,i,p){if(!g(i))return;const a=i.get("file",!0);if(!y(a)||typeof a.value!="string")return;const d=a.value.replace(/^\.\//u,"");if(d!==t&&!d.startsWith(`${t}/`))return;const l=i.toJSON(),m=j.safeParse(l);m.success&&n.push(m.data);const b=p.flatMap(w=>{if(!g(w))return[];const u=w.get("group",!0);return y(u)&&typeof u.value=="string"?[u.value]:[]});return e.push({entry:l,groups:b}),v.REMOVE}}),e.length>0?{text:o.toString(),items:n,entries:e}:void 0}
2
+ import{readFileSync as b,statSync as F}from"node:fs";import{readFile as k,writeFile as W}from"node:fs/promises";import{join as f}from"node:path";import{itemsOf as $,parseWork as g,readLeavingOutUnknownFields as j,WORK_FILE as c,WorkItemSchema as E}from"@allyhub/formats";import{isMap as h,isScalar as y,isSeq as I,parseDocument as S,parse as v,visit as x}from"yaml";import{listFiles as J}from"./files.js";export async function readWork(r){const t=await k(f(r,c),"utf8").catch(()=>{});if(t===void 0)return{work:{work:[]},problems:[]};let o;try{o=v(t)}catch(e){return{work:{work:[]},problems:[`${c} is not valid YAML: ${e.message.split(`
3
+ `)[0]??""}`]}}const n=g(o);return n.ok?{work:n.value,problems:[]}:{work:{work:[]},problems:n.problems.map(e=>`${c}: ${e}`)}}const M=new Map;export function projectTheme(r){const t=f(r,c);let o;try{o=F(t).mtimeMs}catch{return}const n=M.get(r);if(n?.at===o)return n.theme;let e;try{const i=g(v(b(t,"utf8")));e=i.ok?i.value.theme:void 0}catch{e=void 0}return M.set(r,{at:o,theme:e}),e}export async function projectItems(r,t,o,n){const{work:e,problems:i}=await readWork(r);return{...$(e,t,new Set(o??await J(r)),n),listProblems:i}}export function currentFormats(r){return Object.fromEntries(r.flatMap(t=>t.migrations===void 0?[]:[[t.id,t.migrations.format]]))}export async function listWork(r,t,o){const n=f(r,c),e=await k(n,"utf8").catch(()=>{}),i=S(e??`work: []
4
+ `);e===void 0&&i.set("versions",currentFormats(o));const s=i.toJS()?.work;if(JSON.stringify(s??[]).includes(JSON.stringify(t.file)))return;Array.isArray(s)||i.set("work",i.createNode([]));const a=i.get("work",!0);I(a)&&(a.flow=!1),i.addIn(["work"],t),await W(n,i.toString())}export function unlistedWork(r,t){const o=S(r),n=[],e=[];return x(o,{Map(i,s,d){if(!h(s))return;const a=s.get("file",!0);if(!y(a)||typeof a.value!="string")return;const p=a.value.replace(/^\.\//u,"");if(p!==t&&!p.startsWith(`${t}/`))return;const l=s.toJSON(),m=j(E,l);m.success&&n.push(m.data);const O=d.flatMap(w=>{if(!h(w))return[];const u=w.get("group",!0);return y(u)&&typeof u.value=="string"?[u.value]:[]});return e.push({entry:l,groups:O}),x.REMOVE}}),e.length>0?{text:o.toString(),items:n,entries:e}:void 0}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/build",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/canvas-extension",
3
- "version": "0.21.0",
3
+ "version": "0.22.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.21.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/chart",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/check",
3
- "version": "0.21.0",
3
+ "version": "0.22.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{AsyncLocalStorage as _}from"node:async_hooks";import{createHash as b}from"node:crypto";import{BACKGROUND_HEADER as A,DEVICE_HEADER as E,ORGANIZATION_HEADER as g}from"@allyhub/protocol/auth";import{COMMAND_LINE_PAYWALL_MET as O,paywallNumbersOfData as k,paywallReasonOfCode as S}from"@allyhub/protocol/paywall";import{EXIT as r}from"@allyhub/protocol/cli";import{IDEMPOTENCY_KEY_HEADER as $,planPageAddress as p}from"@allyhub/protocol/cloud";import{accessOf as N,SignedOut as x}from"./credentials.js";import{userAgent as z}from"./device.js";import{CloudError as l,notSignedIn as y,unreachable as m}from"./errors.js";export function scrub(u,n){let t=u.replace(/(authorization)\s*[:=]\s*[^\r\n]+/giu,"$1: <redacted>");return t=t.replace(/\bahk_[A-Za-z0-9_-]+/gu,"<api-key>"),t=t.replace(/\beyJ[\w-]+\.[\w-]+\.[\w-]+/gu,"<token>"),n&&(t=t.split(n).join("<key>")),t}const I="/api/tools",w=new _;export function callsMadeInBackground(u){return w.run(!0,u)}export class Cloud{config;constructor(n){this.config=n}async tellStudio(n,t,i){const s=this.config.studioHost;if(s===void 0)return;const c={reason:n,what:t.startsWith(I)?"tool":"command",numbers:k(i)},e=(d,o)=>fetch(`${s}/${d}`,{method:"POST",signal:AbortSignal.timeout(1e3),...o===void 0?{}:{headers:{"content-type":"application/json"},body:o}}).then(async f=>(await f.body?.cancel(),f.status),()=>{});await e(O,JSON.stringify(c))===404&&n==="insufficient_credits"&&await e("out-of-credits")}get url(){return this.config.url}async key(n={}){const t=this.config.apiKey;if(t)return{key:t,source:"env",account:b("sha256").update(t).digest("hex")};try{const i=await N(this.config,n);if(!i)return;const s=i.credentials.account.organization?.id,c=i.credentials.device;return{key:i.token,source:"oauth",account:i.credentials.account.id,expiresAt:i.expiresAt,...s===void 0?{}:{organization:s},...c===void 0?{}:{device:c}}}catch(i){if(i instanceof x)return;throw m(this.url,i)}}async requireKey(){const n=await this.key();if(!n)throw y();return n}keyedFetch=async(n,t)=>{const i=this.config.client===void 0?void 0:await z(this.config.client),s=d=>{const o=new Headers(t?.headers);return o.set("authorization",`Bearer ${d.key}`),i!==void 0&&!o.has("user-agent")&&o.set("user-agent",i),this.config.traceparent!==void 0&&!o.has("traceparent")&&o.set("traceparent",this.config.traceparent),d.organization!==void 0&&!o.has(g)&&o.set(g,d.organization),d.device!==void 0&&o.set(E,d.device),w.getStore()===!0&&o.set(A,"1"),this.config.fetch(n,{...t,headers:o})},c=await this.requireKey(),e=await s(c);if(e.status!==401||c.source!=="oauth"||t?.body instanceof ReadableStream||n instanceof Request)return e;const a=await this.key({refused:c.key});return a===void 0?e:(await e.body?.cancel(),s(a))};async json(n,t={}){const i=t.auth!==!1,s=i?await this.requireKey():void 0,c=s?.key,e=t.organization??s?.organization;let a;try{a=await(i?this.keyedFetch:this.config.fetch)(`${this.url}${n}`,{redirect:"error",signal:t.signal??AbortSignal.timeout(3e4),method:t.method??"GET",headers:{accept:"application/json",...t.body===void 0?{}:{"content-type":"application/json"},...t.organization===void 0?{}:{[g]:t.organization},...t.idempotencyKey===void 0?{}:{[$]:t.idempotencyKey}},...t.body===void 0?{}:{body:JSON.stringify(t.body)}})}catch(h){throw h instanceof l?h:m(this.url,h)}const d=await a.text(),o=a.ok?void 0:T(d,a.status,c,this.url,e),f=S(o?.code);if(f!==void 0&&await this.tellStudio(f,n,o?.data),o&&a.status!==401)throw o;if(a.status===403)throw new l("forbidden","This AllyHub account does not have access to this operation.",{exit:r.auth,status:403});if(a.status===401)throw y(i?"This computer's AllyHub sign-in is not valid any more.":void 0);if(!a.ok)throw new l("api-error",`${this.url}${n} answered ${String(a.status)}: ${scrub(d.slice(0,300),c)}`,{exit:a.status>=500?r.platform:r.usage,status:a.status});if(a.status!==204)try{return JSON.parse(d)}catch{throw new l("api-error",`${this.url}${n} did not answer JSON.`,{exit:r.platform,status:a.status})}}}const R={bad_input:r.usage,insufficient_credits:r.auth,plan_required:r.auth,tool_off:r.auth,storage_full:r.auth,limit_reached:r.auth,forbidden:r.auth,not_found:r.notFound,conflict:r.conflict,cli_outdated:r.platform};function T(u,n,t,i,s){let c;try{c=JSON.parse(u)}catch{return}const e=c?.error;if(typeof e?.code!="string"||typeof e.message!="string")return;const a=e.code==="insufficient_credits"?`Buy credits at ${p(i,{organization:s,open:"credits"})}, or ask an owner or admin of the team to.`:e.code==="plan_required"?`Subscribe at ${p(i,{organization:s,open:"plans"})}, or ask an owner or admin of the team to.`:e.code==="tool_off"?`Turn it on in Capabilities at ${i}/, or ask an owner or admin of the team to.`:typeof e.hint=="string"?e.hint:void 0;return new l(e.code.replaceAll("_","-"),scrub(e.message,t),{exit:R[e.code]??r.platform,status:n,...a===void 0?{}:{hint:a},...typeof e.data=="object"&&e.data!==null?{data:e.data}:{}})}
2
+ import{AsyncLocalStorage as _}from"node:async_hooks";import{createHash as b}from"node:crypto";import{BACKGROUND_HEADER as A,DEVICE_HEADER as E,ORGANIZATION_HEADER as g}from"@allyhub/protocol/auth";import{COMMAND_LINE_PAYWALL_MET as O,paywallNumbersOfData as k,paywallReasonOfCode as S}from"@allyhub/protocol/paywall";import{EXIT as r}from"@allyhub/protocol/cli";import{IDEMPOTENCY_KEY_HEADER as $,planPageAddress as p}from"@allyhub/protocol/cloud";import{accessOf as N,SignedOut as x}from"./credentials.js";import{userAgent as z}from"./device.js";import{CloudError as l,notSignedIn as y,unreachable as m}from"./errors.js";export function scrub(d,i){let t=d.replace(/(authorization)\s*[:=]\s*[^\r\n]+/giu,"$1: <redacted>");return t=t.replace(/\bahk_[A-Za-z0-9_-]+/gu,"<api-key>"),t=t.replace(/\beyJ[\w-]+\.[\w-]+\.[\w-]+/gu,"<token>"),i&&(t=t.split(i).join("<key>")),t}const I="/api/tools",w=new _;export function callsMadeInBackground(d){return w.run(!0,d)}export class Cloud{config;constructor(i){this.config=i}async tellStudio(i,t,n){const s=this.config.studioHost;if(s===void 0)return;const c={reason:i,what:t.startsWith(I)?"tool":"command",numbers:k(n)},e=(u,o)=>fetch(`${s}/${u}`,{method:"POST",signal:AbortSignal.timeout(1e3),...o===void 0?{}:{headers:{"content-type":"application/json"},body:o}}).then(async f=>(await f.body?.cancel(),f.status),()=>{});await e(O,JSON.stringify(c))===404&&i==="insufficient_credits"&&await e("out-of-credits")}get url(){return this.config.url}async key(i={}){const t=this.config.apiKey;if(t)return{key:t,source:"env",account:b("sha256").update(t).digest("hex")};try{const n=await N(this.config,i);if(!n)return;const s=n.credentials.account.organization?.id,c=n.credentials.device;return{key:n.token,source:"oauth",account:n.credentials.account.id,expiresAt:n.expiresAt,...s===void 0?{}:{organization:s},...c===void 0?{}:{device:c}}}catch(n){if(n instanceof x)return;throw m(this.url,n)}}async requireKey(){const i=await this.key();if(!i)throw y();return i}keyedFetch=async(i,t)=>{const n=this.config.client===void 0?void 0:await z(this.config.client),s=u=>{const o=new Headers(t?.headers);return o.set("authorization",`Bearer ${u.key}`),n!==void 0&&!o.has("user-agent")&&o.set("user-agent",n),this.config.traceparent!==void 0&&!o.has("traceparent")&&o.set("traceparent",this.config.traceparent),u.organization!==void 0&&!o.has(g)&&o.set(g,u.organization),u.device!==void 0&&o.set(E,u.device),w.getStore()===!0&&o.set(A,"1"),this.config.fetch(i,{...t,headers:o})},c=await this.requireKey(),e=await s(c);if(e.status!==401||c.source!=="oauth"||t?.body instanceof ReadableStream||i instanceof Request)return e;const a=await this.key({refused:c.key});return a===void 0?e:(await e.body?.cancel(),s(a))};async json(i,t={}){const n=t.auth!==!1,s=n?await this.requireKey():void 0,c=s?.key,e=t.organization??s?.organization;let a;try{a=await(n?this.keyedFetch:this.config.fetch)(`${this.url}${i}`,{redirect:"error",signal:t.signal??AbortSignal.timeout(3e4),method:t.method??"GET",headers:{accept:"application/json",...t.body===void 0?{}:{"content-type":"application/json"},...t.organization===void 0?{}:{[g]:t.organization},...t.idempotencyKey===void 0?{}:{[$]:t.idempotencyKey}},...t.body===void 0?{}:{body:JSON.stringify(t.body)}})}catch(h){throw h instanceof l?h:m(this.url,h)}const u=await a.text(),o=a.ok?void 0:D(u,a.status,c,this.url,e),f=S(o?.code);if(f!==void 0&&await this.tellStudio(f,i,o?.data),o&&a.status!==401)throw o;if(a.status===403)throw new l("forbidden","This AllyHub account does not have access to this operation.",{exit:r.auth,status:403});if(a.status===401)throw y(n?"This computer's AllyHub sign-in is not valid any more.":void 0);if(!a.ok)throw new l("api-error",`${this.url}${i} answered ${String(a.status)}: ${scrub(u.slice(0,300),c)}`,{exit:a.status>=500?r.platform:r.usage,status:a.status});if(a.status!==204)try{return JSON.parse(u)}catch{throw new l("api-error",`${this.url}${i} did not answer JSON.`,{exit:r.platform,status:a.status})}}}const R={bad_input:r.usage,insufficient_credits:r.auth,plan_required:r.auth,tool_off:r.auth,storage_full:r.auth,limit_reached:r.auth,forbidden:r.auth,not_found:r.notFound,conflict:r.conflict,cli_outdated:r.platform},T=d=>d.code==="limit_reached"&&typeof d.data=="object"&&d.data!==null&&d.data.reason==="calls_an_hour";function D(d,i,t,n,s){let c;try{c=JSON.parse(d)}catch{return}const e=c?.error;if(typeof e?.code!="string"||typeof e.message!="string")return;const a=e.code==="insufficient_credits"?`Buy credits at ${p(n,{organization:s,open:"credits"})}, or ask an owner or admin of the team to.`:e.code==="plan_required"?`Subscribe at ${p(n,{organization:s,open:"plans"})}, or ask an owner or admin of the team to.`:e.code==="tool_off"?`Turn it on in Capabilities at ${n}/, or ask an owner or admin of the team to.`:typeof e.hint=="string"?T(e)?`${e.hint.replace(/\.$/u,"")} (${n}/).`:e.hint:void 0;return new l(e.code.replaceAll("_","-"),scrub(e.message,t),{exit:R[e.code]??r.platform,status:i,...a===void 0?{}:{hint:a},...typeof e.data=="object"&&e.data!==null?{data:e.data}:{}})}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/cloud",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/components",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.ts",
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- export{PING_MS,RAW_PATH,RPC_PATH,forwardedHost,startDevServer}from"./server.js";export{ProjectServer,SERVER_METHODS}from"./project.js";export{Writer,LIST_LIMIT,UPLOAD_MAX_BYTES}from"./writer.js";export{DELETED_FILE,TRASH_KEPT_DAYS,movesOfDeletion}from"./deletion.js";export{Watcher}from"./watcher.js";export{Presence}from"./presence.js";export{changedLines}from"./texts.js";export{writeProblems,dataFileOf}from"./validate.js";export{pathProblem,versionOf}from"./paths.js";export{SETTLE_MS}from"./background.js";export{recordTree}from"./record.js";export{itemPreview,projectName}from"./card.js";export{downloadsFolder,hasFileManager,revealFile}from"./reveal.js";
2
+ export{PING_MS,RAW_PATH,RPC_PATH,forwardedHost,startDevServer}from"./server.js";export{ProjectServer,SERVER_METHODS}from"./project.js";export{Writer,LIST_LIMIT,UPLOAD_MAX_BYTES}from"./writer.js";export{DELETED_FILE,TRASH_KEPT_DAYS,emptyTrashOlderThan,movesOfDeletion,utcStampOf}from"./deletion.js";export{Watcher}from"./watcher.js";export{Presence}from"./presence.js";export{changedLines}from"./texts.js";export{writeProblems,dataFileOf}from"./validate.js";export{pathProblem,versionOf}from"./paths.js";export{SETTLE_MS}from"./background.js";export{PageNotRecordedWholeError,recordTree}from"./record.js";export{itemPreview,projectName}from"./card.js";export{downloadsFolder,hasFileManager,revealFile}from"./reveal.js";
@@ -1,2 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{readFile as ie,readdir as re,realpath as ae,stat as ce}from"node:fs/promises";import{setTimeout as de}from"node:timers/promises";import{join as P,relative as fe,sep as le}from"node:path";import{openPage as ue}from"@allyhub/browser";import{KeyedStore as pe}from"@allyhub/project";import{NEVER_CANCELLED as me}from"@allyhub/extension-api";import{COMPONENT_STILLS_MAX as X,KindSnapshotSchema as he,RpcError as Q,SNAPSHOT_TREE as b,pieceSourcePath as we,snapshotAnswerPath as N,snapshotPreviewPath as ge,stillPath as Y,stillsIndexKey as ye,stillsIndexPath as be}from"@allyhub/protocol";import{runtimeFiles as ke}from"@allyhub/stage-page";import{itemPreview as $e}from"./card.js";import{offlinePage as Se}from"./offline-page.js";import{kindContext as Ee,kindItem as Pe}from"./kinds.js";import{USE_FORMS as ve,mediaTypeOf as W,servedPage as Me}from"@allyhub/formats";import{Reach as je,pieceBundle as Te,pieceNames as xe,reachedCheck as Ie,reachedSource as Oe}from"./reach.js";import{matteFile as Ne}from"./tree.js";const Re="assets/";export const PAGE_RECORDING={width:1440,height:900,timeout:3e4,settle:1500};const R="https://tree.invalid/";function B(i){return typeof i=="string"?i.startsWith(R)?i.slice(R.length):i:Array.isArray(i)?i.map(B):i!==null&&typeof i=="object"?Object.fromEntries(Object.entries(i).map(([S,c])=>[S,B(c)])):i}const T=i=>new TextEncoder().encode(JSON.stringify(i));async function Z(i){return(await re(i,{recursive:!0,withFileTypes:!0}).catch(()=>[])).filter(c=>c.isFile()).map(c=>fe(i,P(c.parentPath,c.name)).split(le).join("/"))}const Ae=i=>ce(i).then(S=>S.isFile(),()=>!1);export async function recordTree(i,S={}){const{project:c}=i,{live:p,root:y}=c;await c.watcher.settled();const k=new Map,g=(e,t,o=W(e))=>{k.set(e,{path:e,type:o,file:t})},C=(e,t)=>{k.set(e,{path:e,type:W(e),file:t,immutable:!0})},v=(e,t,o=W(e))=>{k.set(e,{path:e,type:o,bytes:t})},D=async(e,t)=>{for(const o of await Z(t))g(`${e}${o}`,P(t,o))},ee=p.revision,d=await p.prepared(),A=new Map;if(i.ui!==void 0)for(const e of await Z(i.ui))(e.startsWith(Re)?C:g)(`${b.editor}${e}`,P(i.ui,e));for(const[e,t]of await ke())g(`${b.runtime}${e}`,t);const I=async(e,t)=>{let o;try{o={result:B(await c.tool(e,t,{tree:R}))}}catch(n){o={error:n instanceof Q?{code:n.code,message:n.message}:{code:-32603,message:n instanceof Error?n.message:""}}}const r=N(e,t);v(r,T(o));const f=t.item;return typeof f=="string"&&A.set(f,[...A.get(f)??[],r]),o},te=Ee(y,e=>c.hasTool(e),async(e,t)=>{const o=await I(e,t);if(o.error)throw new Q(o.error.code,o.error.message);return o.result}),oe=async(e,t,o)=>{const r=new Map;for(const s of o)r.set(ye(s),s);if(r.size===0)return;const f=pe.of(y,"stills"),n={stills:{}},E=h.of(e),m=[...r];for(let s=0;s<m.length;s+=X){const w=m.slice(s,s+X);(await c.tool("components/stills",{item:e,...t===""?{}:{version:t},components:w.map(([,u])=>u)},{tree:R}).catch(()=>{}))?.stills.forEach((u,$)=>{const x=w[$]?.[0];!u||x===void 0||(n.stills[x]=u.key,g(Y(u.key),f.path(`${u.key}.webp`),"image/webp"),E?.tree.add(Y(u.key)))})}const a=be(e,t);v(a,T(n),"application/json"),E?.tree.add(a)},q=(await I("project/items",{})).result,O=q?.items??[],F=O.filter(e=>e.kind!==void 0),G=O.filter(e=>e.kind===void 0&&e.kindInfo?.share===!0),se=new Map(d.items.map(e=>[e.id,e.files])),h=new je([...F.map(e=>({...e,files:se.get(e.id)??e.files})),...G],d.files,(d.bundle?.beside??[]).map(e=>`${b.build}${e}`)),M=c.checker?.state,J=M===void 0||M.status==="waiting"||M.status==="running"?{status:"off",revision:p.revision,problems:M?.problems??[],facts:M?.facts??[]}:M;v(N("check/results",{}),T({result:J}));for(const e of h.items){const t=h.of(e),o=new Set(d.pieces.filter(n=>n.place===e).map(n=>n.id)),r=O.find(n=>n.id===e)?.entry,f=n=>n===r||h.itemsOf(n).includes(e);t?.own.push({path:N("project/items",{}),type:"application/json",bytes:T({result:{...q,items:O.filter(n=>n.id===e)}})},{path:N("check/results",{}),type:"application/json",bytes:T({result:Ie(J,o,f)})})}for(const e of d.bundle?.chunks.files??[])C(`${b.build}${e}`,P(p.pieceDir,e));for(const e of d.bundle?.beside??[])await D(`${b.build}${e}`,P(p.pieceDir,e));const K=new Set(Object.keys(d.media));for(const e of Object.keys(d.media)){const t=Ne(y,d.media[e]);t!==void 0&&await Ae(t)&&g(`${b.matte}${e}`,t,"video/mp4")}const _=new Map,L=new Map,ne=c.extensions?.fileEditors()??[];for(const e of G)ne.some(t=>t.id===e.kindInfo?.editor&&t.page)&&(_.set(e.id,{}),L.set(e.id,e.entry));const U=new Map,z=e=>({file:(t,o,r)=>{g(`${e}${t}`,o,r)},folder:(t,o)=>D(`${e}${t}`,o),bytes:(t,o,r)=>{v(`${e}${t}`,o,r)},media:t=>{K.add(t)}});for(const e of F){const t=await c.extensions?.kindProvider(e.kind);if(!t?.snapshot)continue;const o=await Promise.resolve(t.snapshot(Pe(e),te,me)).catch(()=>{}),r=he.safeParse(o??{});if(!r.success)continue;const{stills:f,shows:n,routes:E,page:m}=r.data;m&&(_.set(e.id,{...m.folder===void 0?{}:{folder:m.folder},...m.file===void 0?{}:{file:m.file}}),p.kinds.some(a=>a.id===e.kind&&a.network===!0)&&L.set(e.id,m.file??e.entry)),n&&U.set(e.id,{media:new Set(n.media),data:new Set(n.data)});for(const a of f??[])await I("components/stage",{item:e.id,version:a.version}),a.version===""&&await I("components/stage",{item:e.id}),await oe(e.id,a.version,a.components);for(const[a,s]of Object.entries(E??{})){const w=await p.routes.route(a).catch(()=>{});if(w?.route.recordItem)for(const l of s)await w.route.recordItem(l,z(a),w.context).catch(()=>{})}}for(const e of K)g(`${b.media}${e}`,P(y,e));for(const[e,t]of _){const o=await c.tool("items/page",{item:e,...t}).catch(()=>{});if(!o)continue;const r=new URL(o.url).origin,f=L.get(e),n=await ue(await p.browser(),{width:PAGE_RECORDING.width,height:PAGE_RECORDING.height,allow:l=>l===r||l.startsWith(`${r}/`)||f!==void 0&&l.startsWith("https://")}).catch(()=>{});if(!n)continue;const E=[],m=[];try{if(f!==void 0){const l=n.session,u=new Map;l.on("Network.responseReceived",$=>{$.response.url.startsWith("https://")&&$.response.status===200&&u.set($.requestId,{url:$.response.url,mime:$.response.mimeType})}),l.on("Network.loadingFinished",$=>{const x=u.get($.requestId);x&&m.push(l.send("Network.getResponseBody",{requestId:$.requestId}).then(j=>{E.push({...x,body:j.base64Encoded?Buffer.from(j.body,"base64"):new TextEncoder().encode(j.body)})},j=>{if(!(j instanceof Error))throw j}))}),await l.send("Network.enable",{})}await n.goto(o.url,{timeoutMs:PAGE_RECORDING.timeout}),await n.evaluate("document.fonts.ready.then(() => true)",{timeoutMs:PAGE_RECORDING.timeout}),await de(PAGE_RECORDING.settle)}catch{}finally{await Promise.allSettled(m),await n.close()}if(f===void 0)continue;const a=await ie(P(y,f),"utf8").catch(()=>{});if(a===void 0)continue;const s=Me(a,f,d.data).html;let w=Se(f,s,E);w.length===0&&s!==a&&(w=[{path:f,type:"text/html; charset=utf-8",bytes:new TextEncoder().encode(s)}]);for(const l of w){const u=`${b.pages}${l.path}`;v(u,l.bytes,l.type),h.of(e)?.tree.add(u)}}for(const e of h.items){const t=h.of(e);if(t)for(const o of c.inputs.of(e))if(o===""||o.endsWith("/"))for(const r of d.files)r.startsWith(o)&&t.files.add(r);else d.files.includes(o)&&t.files.add(o)}for(const e of p.routes.specs.keys()){const t=await p.routes.route(e).catch(()=>{});t?.route.record&&await t.route.record(z(e),t.context).catch(()=>{})}const H=[y,await ae(y).catch(()=>y)];for(const e of d.pieces){const t=await p.source(e.id).catch(()=>{});if(!t)continue;const o=[e,...d.pieces.filter(s=>Fe(d.items,e.place).has(s.place))],r=o.map(s=>({p:s,bundle:Te(d.bundle?.chunks,s.id)})),f={files:new Set(r.flatMap(s=>[...s.bundle.files])),modules:new Set(r.flatMap(s=>[...s.bundle.modules]))},n={media:new Set,data:new Set};for(const{p:s,bundle:w}of r){const l=xe({prepared:d,piece:s,reach:h,modules:w.modules,roots:H,reads:c.checker?.reads.get(s.id),shows:U.get(s.place)});for(const u of l.media)n.media.add(u);for(const u of l.data)n.data.add(u)}const E=d.pieces.filter(s=>!o.includes(s)&&!H.some(w=>f.modules.has(P(w,s.file)))).map(s=>s.id),m=we(e.id);v(m,T(Oe(t,n,E)));const a=h.of(e.place);if(a){a.tree.add(m);for(const s of f.files)a.tree.add(`${b.build}${s}`);for(const s of n.media)a.tree.add(`${b.media}${s}`),a.tree.add(`${b.matte}${s}`),a.files.add(s)}}for(const[e,t]of A)for(const o of t)h.of(e)?.tree.add(o);for(const e of d.docs)for(const t of e.shows)h.of(e.place)?.files.add(t);for(const e of d.sheets)for(const t of e.files)h.of(e.place)?.files.add(t);const V=S.preview===!1?void 0:S.preview??(e=>$e(i,e));if(V)for(const e of F){const t=await V(e).catch(()=>{});if(t===void 0)continue;const o=ge(e.id);v(o,Buffer.from(JSON.stringify(t)),"application/json"),h.of(e.id)?.tree.add(o)}return{revision:ee,files:[...k.values()],reach:h.done(new Set(k.keys())),routes:p.routes.loads()}}function Fe(i,S){const c=new Map(i.map(k=>[k.id,k])),p=new Set,y=k=>{for(const g of c.get(k)?.uses??[])g.type===ve.live&&!p.has(g.item)&&(p.add(g.item),y(g.item))};return y(S),p}
2
+ import{readFile as le,readdir as ue,realpath as pe,stat as me}from"node:fs/promises";import{setTimeout as he}from"node:timers/promises";import{join as N,relative as we,sep as ge}from"node:path";import{openPage as ye}from"@allyhub/browser";import{KeyedStore as be}from"@allyhub/project";import{NEVER_CANCELLED as $e}from"@allyhub/extension-api";import{COMPONENT_STILLS_MAX as te,KindSnapshotSchema as ke,RpcError as oe,SNAPSHOT_TREE as E,pieceSourcePath as Se,snapshotAnswerPath as F,snapshotPreviewPath as Ee,stillPath as se,stillsIndexKey as Pe,stillsIndexPath as ve}from"@allyhub/protocol";import{runtimeFiles as xe}from"@allyhub/stage-page";import{itemPreview as Me}from"./card.js";import{offlinePage as Ne}from"./offline-page.js";import{kindContext as Te,kindItem as je}from"./kinds.js";import{USE_FORMS as Ie,mediaTypeOf as L,servedPage as Oe}from"@allyhub/formats";import{Reach as Re,pieceBundle as Ae,pieceNames as Fe,reachedCheck as We,reachedSource as _e}from"./reach.js";import{matteFile as qe}from"./tree.js";const De="assets/";export class PageNotRecordedWholeError extends Error{name="PageNotRecordedWholeError"}const C=i=>i.replace(/[?#].*$/su,""),Be=(i,u)=>{process.stderr.write(`${i} failed: ${u instanceof Error?u.stack??u.message:String(u)}
3
+ `)};export const PAGE_RECORDING={width:1440,height:900,timeout:3e4,settle:1500};const W="https://tree.invalid/";function G(i){return typeof i=="string"?i.startsWith(W)?i.slice(W.length):i:Array.isArray(i)?i.map(G):i!==null&&typeof i=="object"?Object.fromEntries(Object.entries(i).map(([u,d])=>[u,G(d)])):i}const I=i=>new TextEncoder().encode(JSON.stringify(i));async function ne(i){return(await ue(i,{recursive:!0,withFileTypes:!0}).catch(()=>[])).filter(d=>d.isFile()).map(d=>we(i,N(d.parentPath,d.name)).split(ge).join("/"))}const Le=i=>me(i).then(u=>u.isFile(),()=>!1);export async function recordTree(i,u={}){const{project:d}=i,{live:l,root:k}=d;await d.watcher.settled();const P=new Map,b=(e,t,o=L(e))=>{P.set(e,{path:e,type:o,file:t})},J=(e,t)=>{P.set(e,{path:e,type:L(e),file:t,immutable:!0})},T=(e,t,o=L(e))=>{P.set(e,{path:e,type:o,bytes:t})},K=async(e,t)=>{for(const o of await ne(t))b(`${e}${o}`,N(t,o))},ie=l.revision,f=await l.prepared(),_=new Map;if(i.ui!==void 0)for(const e of await ne(i.ui))(e.startsWith(De)?J:b)(`${E.editor}${e}`,N(i.ui,e));for(const[e,t]of await xe())b(`${E.runtime}${e}`,t);const O=async(e,t)=>{let o;try{o={result:G(await d.tool(e,t,{tree:W}))}}catch(n){o={error:n instanceof oe?{code:n.code,message:n.message}:{code:-32603,message:n instanceof Error?n.message:""}}}const r=F(e,t);T(r,I(o));const p=t.item;return typeof p=="string"&&_.set(p,[..._.get(p)??[],r]),o},re=Te(k,e=>d.hasTool(e),async(e,t)=>{const o=await O(e,t);if(o.error)throw new oe(o.error.code,o.error.message);return o.result}),ae=async(e,t,o)=>{const r=new Map;for(const s of o)r.set(Pe(s),s);if(r.size===0)return;const p=be.of(k,"stills"),n={stills:{}},$=w.of(e),m=[...r];for(let s=0;s<m.length;s+=te){const g=m.slice(s,s+te);(await d.tool("components/stills",{item:e,...t===""?{}:{version:t},components:g.map(([,h])=>h)},{tree:W}).catch(()=>{}))?.stills.forEach((h,a)=>{const M=g[a]?.[0];!h||M===void 0||(n.stills[M]=h.key,b(se(h.key),p.path(`${h.key}.webp`),"image/webp"),$?.tree.add(se(h.key)))})}const c=ve(e,t);T(c,I(n),"application/json"),$?.tree.add(c)},U=(await O("project/items",{})).result,R=U?.items??[],q=R.filter(e=>e.kind!==void 0),z=R.filter(e=>e.kind===void 0&&e.kindInfo?.share===!0),ce=new Map(f.items.map(e=>[e.id,e.files])),w=new Re([...q.map(e=>({...e,files:ce.get(e.id)??e.files})),...z],f.files,(f.bundle?.beside??[]).map(e=>`${E.build}${e}`)),j=d.checker?.state,H=j===void 0||j.status==="waiting"||j.status==="running"?{status:"off",revision:l.revision,problems:j?.problems??[],facts:j?.facts??[]}:j;T(F("check/results",{}),I({result:H}));for(const e of w.items){const t=w.of(e),o=new Set(f.pieces.filter(n=>n.place===e).map(n=>n.id)),r=R.find(n=>n.id===e)?.entry,p=n=>n===r||w.itemsOf(n).includes(e);t?.own.push({path:F("project/items",{}),type:"application/json",bytes:I({result:{...U,items:R.filter(n=>n.id===e)}})},{path:F("check/results",{}),type:"application/json",bytes:I({result:We(H,o,p)})})}for(const e of f.bundle?.chunks.files??[])J(`${E.build}${e}`,N(l.pieceDir,e));for(const e of f.bundle?.beside??[])await K(`${E.build}${e}`,N(l.pieceDir,e));const V=new Set(Object.keys(f.media));for(const e of Object.keys(f.media)){const t=qe(k,f.media[e]);t!==void 0&&await Le(t)&&b(`${E.matte}${e}`,t,"video/mp4")}const D=new Map,B=new Map,de=d.extensions?.fileEditors()??[];for(const e of z)de.some(t=>t.id===e.kindInfo?.editor&&t.page)&&(D.set(e.id,{}),B.set(e.id,e.entry));const X=new Map,Q=e=>({file:(t,o,r)=>{b(`${e}${t}`,o,r)},folder:(t,o)=>K(`${e}${t}`,o),bytes:(t,o,r)=>{T(`${e}${t}`,o,r)},media:t=>{V.add(t)}});for(const e of q){const t=await d.extensions?.kindProvider(e.kind);if(!t?.snapshot)continue;const o=await Promise.resolve(t.snapshot(je(e),re,$e)).catch(()=>{}),r=ke.safeParse(o??{});if(!r.success)continue;const{stills:p,shows:n,routes:$,page:m}=r.data;m&&(D.set(e.id,{...m.folder===void 0?{}:{folder:m.folder},...m.file===void 0?{}:{file:m.file}}),l.kinds.some(c=>c.id===e.kind&&c.network===!0)&&B.set(e.id,m.file??e.entry)),n&&X.set(e.id,{media:new Set(n.media),data:new Set(n.data)});for(const c of p??[])await O("components/stage",{item:e.id,version:c.version}),c.version===""&&await O("components/stage",{item:e.id}),await ae(e.id,c.version,c.components);for(const[c,s]of Object.entries($??{})){const g=await l.routes.route(c).catch(()=>{});if(g?.route.recordItem)for(const x of s)await g.route.recordItem(x,Q(c),g.context).catch(()=>{})}}for(const e of V)b(`${E.media}${e}`,N(k,e));const A=u.report??Be;for(const[e,t]of D){const o=`Recording the page of ${e}`,r=await d.tool("items/page",{item:e,...t}).then(a=>a,a=>{A(o,a)});if(!r)continue;const p=new URL(r.url).origin,n=B.get(e),$=await ye(await l.browser(),{width:PAGE_RECORDING.width,height:PAGE_RECORDING.height,allow:a=>a===p||a.startsWith(`${p}/`)||n!==void 0&&a.startsWith("https://")}).then(a=>a,a=>{A(o,a)});if(!$)continue;const m=[],c=[],s=[];try{if(n!==void 0){const a=$.session,M=new Map,ee=new Map;a.on("Network.requestWillBeSent",y=>{M.set(y.requestId,y.request.url)}),a.on("Network.responseReceived",y=>{const{url:v,status:S,mimeType:fe}=y.response;S===200&&v.startsWith("https://")?ee.set(y.requestId,{url:v,mime:fe}):S>=400&&s.push(`${y.type==="Document"?"the page":C(v)} answered ${String(S)}`)}),a.on("Network.loadingFailed",y=>{const v=M.get(y.requestId);s.push(`${y.type==="Document"||v===void 0?"the page":C(v)}: ${y.errorText}`)}),a.on("Network.loadingFinished",y=>{const v=ee.get(y.requestId);v&&c.push(a.send("Network.getResponseBody",{requestId:y.requestId}).then(S=>{m.push({...v,body:S.base64Encoded?Buffer.from(S.body,"base64"):new TextEncoder().encode(S.body)})},S=>{if(!(S instanceof Error))throw S;s.push(`${C(v.url)}: ${S.message}`)}))}),await a.send("Network.enable",{})}await $.goto(r.url,{timeoutMs:PAGE_RECORDING.timeout}),await $.evaluate("document.fonts.ready.then(() => true)",{timeoutMs:PAGE_RECORDING.timeout}),await he(PAGE_RECORDING.settle)}catch(a){A(o,a)}finally{await Promise.allSettled(c),await $.close()}if(s.length>0&&A(o,new PageNotRecordedWholeError(`The page of ${e} did not load whole, so what failed is kept online: ${s.join("; ")}.`)),n===void 0)continue;const g=await le(N(k,n),"utf8").catch(()=>{});if(g===void 0)continue;const x=Oe(g,n,f.data).html;let h=Ne(n,x,m);h.length===0&&x!==g&&(h=[{path:n,type:"text/html; charset=utf-8",bytes:new TextEncoder().encode(x)}]);for(const a of h){const M=`${E.pages}${a.path}`;T(M,a.bytes,a.type),w.of(e)?.tree.add(M)}}for(const e of w.items){const t=w.of(e);if(t)for(const o of d.inputs.of(e))if(o===""||o.endsWith("/"))for(const r of f.files)r.startsWith(o)&&t.files.add(r);else f.files.includes(o)&&t.files.add(o)}for(const e of l.routes.specs.keys()){const t=await l.routes.route(e).catch(()=>{});t?.route.record&&await t.route.record(Q(e),t.context).catch(()=>{})}const Y=[k,await pe(k).catch(()=>k)];for(const e of f.pieces){const t=await l.source(e.id).catch(()=>{});if(!t)continue;const o=[e,...f.pieces.filter(s=>Ce(f.items,e.place).has(s.place))],r=o.map(s=>({p:s,bundle:Ae(f.bundle?.chunks,s.id)})),p={files:new Set(r.flatMap(s=>[...s.bundle.files])),modules:new Set(r.flatMap(s=>[...s.bundle.modules]))},n={media:new Set,data:new Set};for(const{p:s,bundle:g}of r){const x=Fe({prepared:f,piece:s,reach:w,modules:g.modules,roots:Y,reads:d.checker?.reads.get(s.id),shows:X.get(s.place)});for(const h of x.media)n.media.add(h);for(const h of x.data)n.data.add(h)}const $=f.pieces.filter(s=>!o.includes(s)&&!Y.some(g=>p.modules.has(N(g,s.file)))).map(s=>s.id),m=Se(e.id);T(m,I(_e(t,n,$)));const c=w.of(e.place);if(c){c.tree.add(m);for(const s of p.files)c.tree.add(`${E.build}${s}`);for(const s of n.media)c.tree.add(`${E.media}${s}`),c.tree.add(`${E.matte}${s}`),c.files.add(s)}}for(const[e,t]of _)for(const o of t)w.of(e)?.tree.add(o);for(const e of f.docs)for(const t of e.shows)w.of(e.place)?.files.add(t);for(const e of f.sheets)for(const t of e.files)w.of(e.place)?.files.add(t);const Z=u.preview===!1?void 0:u.preview??(e=>Me(i,e));if(Z)for(const e of q){const t=await Z(e).catch(()=>{});if(t===void 0)continue;const o=Ee(e.id);T(o,Buffer.from(JSON.stringify(t)),"application/json"),w.of(e.id)?.tree.add(o)}return{revision:ie,files:[...P.values()],reach:w.done(new Set(P.keys())),routes:l.routes.loads()}}function Ce(i,u){const d=new Map(i.map(P=>[P.id,P])),l=new Set,k=P=>{for(const b of d.get(P)?.uses??[])b.type===Ie.live&&!l.has(b.item)&&(l.add(b.item),k(b.item))};return k(u),l}
@@ -1,3 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{parse as m}from"yaml";import{kindBuildOf as p,readWork as $}from"@allyhub/build";import{DATA_FILES as f,baseOf as b,listedWork as g}from"@allyhub/formats";const k=r=>new RegExp(`^${r.split("**/").map(a=>a.replace(/[.+?^${}()|[\]\\]/gu,"\\$&").replaceAll("*","[^/]*")).join("(?:.*/)?")}$`,"u"),w=Object.entries(f).flatMap(([r,a])=>a.files.map(n=>({name:r,re:k(n)})));export function dataFileOf(r){return w.find(a=>a.re.test(r))?.name}export async function writeProblems(r,a,n,u,s){const i=b(r),t=g((await $(u)).work).find(e=>e.file.replace(/^\.\//u,"")===r)?.kind;if(t!==void 0&&s){const e=await s(t,a);if(e)return[...e]}else{const e=await p(n.find(d=>d.id===t))?.catch(()=>{});if(e?.unreadable)return[...e.unreadable(a)]}const o=dataFileOf(r);if(o===void 0)return[];let l;try{l=/\.ya?ml$/u.test(i)?m(a):JSON.parse(a)}catch(e){return[`not ${/\.ya?ml$/u.test(i)?"YAML":"JSON"}: ${e.message.split(`
3
- `)[0]??""}`]}const c=f[o].schema.safeParse(l);return c.success?[]:c.error.issues.map(e=>`${e.path.length?`${e.path.join(".")}: `:""}${e.message}`)}
2
+ import{parse as m}from"yaml";import{kindBuildOf as p,readWork as $}from"@allyhub/build";import{DATA_FILES as u,baseOf as g,listedWork as k,readLeavingOutUnknownFields as w}from"@allyhub/formats";const O=a=>new RegExp(`^${a.split("**/").map(n=>n.replace(/[.+?^${}()|[\]\\]/gu,"\\$&").replaceAll("*","[^/]*")).join("(?:.*/)?")}$`,"u"),b=Object.entries(u).flatMap(([a,n])=>n.files.map(r=>({name:a,re:O(r)})));export function dataFileOf(a){return b.find(n=>n.re.test(a))?.name}export async function writeProblems(a,n,r,c,s){const i=g(a),t=k((await $(c)).work).find(e=>e.file.replace(/^\.\//u,"")===a)?.kind;if(t!==void 0&&s){const e=await s(t,n);if(e)return[...e]}else{const e=await p(r.find(f=>f.id===t))?.catch(()=>{});if(e?.unreadable)return[...e.unreadable(n)]}const o=dataFileOf(a);if(o===void 0)return[];let l;try{l=/\.ya?ml$/u.test(i)?m(n):JSON.parse(n)}catch(e){return[`not ${/\.ya?ml$/u.test(i)?"YAML":"JSON"}: ${e.message.split(`
3
+ `)[0]??""}`]}const d=w(u[o].schema,l);return d.success?[]:d.error.issues.map(e=>`${e.path.length?`${e.path.join(".")}: `:""}${e.message}`)}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/dev-server",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/diagnostics",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/doc",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/doc-extension",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./cli": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/doc-print",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/export",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/extension-api",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/extension-host",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -165,10 +165,10 @@ export declare const DeckCodeSchema: z.ZodObject<{
165
165
  shapes: z.ZodArray<z.ZodObject<{
166
166
  name: z.ZodString;
167
167
  kind: z.ZodEnum<{
168
+ textbox: "textbox";
168
169
  chart: "chart";
169
170
  picture: "picture";
170
171
  table: "table";
171
- textbox: "textbox";
172
172
  movie: "movie";
173
173
  component: "component";
174
174
  placeholder: "placeholder";
@@ -240,10 +240,10 @@ export declare const DeckCodeSchema: z.ZodObject<{
240
240
  shapes: z.ZodArray<z.ZodObject<{
241
241
  name: z.ZodString;
242
242
  kind: z.ZodEnum<{
243
+ textbox: "textbox";
243
244
  chart: "chart";
244
245
  picture: "picture";
245
246
  table: "table";
246
- textbox: "textbox";
247
247
  movie: "movie";
248
248
  component: "component";
249
249
  placeholder: "placeholder";
@@ -289,10 +289,10 @@ export declare const DeckCodeSchema: z.ZodObject<{
289
289
  shapes: z.ZodArray<z.ZodObject<{
290
290
  name: z.ZodString;
291
291
  kind: z.ZodEnum<{
292
+ textbox: "textbox";
292
293
  chart: "chart";
293
294
  picture: "picture";
294
295
  table: "table";
295
- textbox: "textbox";
296
296
  movie: "movie";
297
297
  component: "component";
298
298
  placeholder: "placeholder";