allyhub 0.16.0 → 0.17.1

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 (277) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/commands/inspect/index.js +1 -1
  3. package/dist/commands/inspect/uses.js +3 -0
  4. package/dist/node_modules/@allyhub/3d-extension/package.json +1 -1
  5. package/dist/node_modules/@allyhub/audio/dist/index.js +1 -1
  6. package/dist/node_modules/@allyhub/audio/dist/place.js +2 -0
  7. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  8. package/dist/node_modules/@allyhub/browser/package.json +1 -1
  9. package/dist/node_modules/@allyhub/build/dist/content.d.ts +7 -0
  10. package/dist/node_modules/@allyhub/build/dist/imports.d.ts +17 -0
  11. package/dist/node_modules/@allyhub/build/dist/imports.js +2 -0
  12. package/dist/node_modules/@allyhub/build/dist/index.d.ts +2 -1
  13. package/dist/node_modules/@allyhub/build/dist/index.js +1 -1
  14. package/dist/node_modules/@allyhub/build/dist/kind-build.d.ts +19 -3
  15. package/dist/node_modules/@allyhub/build/dist/prepare.js +3 -3
  16. package/dist/node_modules/@allyhub/build/dist/uses.d.ts +27 -6
  17. package/dist/node_modules/@allyhub/build/dist/uses.js +1 -1
  18. package/dist/node_modules/@allyhub/build/package.json +1 -1
  19. package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
  20. package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
  21. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  22. package/dist/node_modules/@allyhub/check/package.json +1 -1
  23. package/dist/node_modules/@allyhub/cloud/package.json +1 -1
  24. package/dist/node_modules/@allyhub/components/package.json +1 -1
  25. package/dist/node_modules/@allyhub/dev-server/dist/live.js +1 -1
  26. package/dist/node_modules/@allyhub/dev-server/dist/record.js +1 -1
  27. package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
  28. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  29. package/dist/node_modules/@allyhub/doc/dist/docx.js +4 -4
  30. package/dist/node_modules/@allyhub/doc/dist/html.js +40 -40
  31. package/dist/node_modules/@allyhub/doc/dist/index.js +1 -1
  32. package/dist/node_modules/@allyhub/doc/dist/markdown.js +1 -1
  33. package/dist/node_modules/@allyhub/doc/dist/parse.js +4 -4
  34. package/dist/node_modules/@allyhub/doc/dist/table.js +1 -1
  35. package/dist/node_modules/@allyhub/doc/dist/write.js +26 -26
  36. package/dist/node_modules/@allyhub/doc/package.json +1 -1
  37. package/dist/node_modules/@allyhub/doc-extension/dist/build.js +2 -2
  38. package/dist/node_modules/@allyhub/doc-extension/package.json +1 -1
  39. package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
  40. package/dist/node_modules/@allyhub/export/dist/export.js +1 -1
  41. package/dist/node_modules/@allyhub/export/package.json +1 -1
  42. package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
  43. package/dist/node_modules/@allyhub/extension-host/dist/points.js +1 -1
  44. package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
  45. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +15 -3
  46. package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
  47. package/dist/node_modules/@allyhub/formats/dist/items.d.ts +40 -7
  48. package/dist/node_modules/@allyhub/formats/dist/items.js +1 -1
  49. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +4 -0
  50. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  51. package/dist/node_modules/@allyhub/i18n/package.json +1 -1
  52. package/dist/node_modules/@allyhub/image-draw/dist/stage.js +1 -1
  53. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  54. package/dist/node_modules/@allyhub/image-extension/package.json +1 -1
  55. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  56. package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
  57. package/dist/node_modules/@allyhub/image-render/package.json +1 -1
  58. package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
  59. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  60. package/dist/node_modules/@allyhub/jobs/package.json +1 -1
  61. package/dist/node_modules/@allyhub/linkedin-extension/package.json +3 -1
  62. package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
  63. package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
  64. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  65. package/dist/node_modules/@allyhub/media/package.json +1 -1
  66. package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
  67. package/dist/node_modules/@allyhub/model/package.json +1 -1
  68. package/dist/node_modules/@allyhub/office-extension/package.json +1 -1
  69. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  70. package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +15 -0
  71. package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +1 -0
  72. package/dist/node_modules/@allyhub/piece/dist/page/index.js +1 -1
  73. package/dist/node_modules/@allyhub/piece/dist/page/runtimes.d.ts +9 -0
  74. package/dist/node_modules/@allyhub/piece/dist/page/runtimes.js +2 -0
  75. package/dist/node_modules/@allyhub/piece/dist/source.d.ts +51 -10
  76. package/dist/node_modules/@allyhub/piece/dist/source.js +1 -1
  77. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  78. package/dist/node_modules/@allyhub/project/dist/digest.js +1 -1
  79. package/dist/node_modules/@allyhub/project/dist/part-keys.js +1 -1
  80. package/dist/node_modules/@allyhub/project/package.json +1 -1
  81. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +0 -6
  82. package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
  83. package/dist/node_modules/@allyhub/protocol/dist/events.d.ts +39 -0
  84. package/dist/node_modules/@allyhub/protocol/dist/events.js +1 -1
  85. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +3 -0
  86. package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
  87. package/dist/node_modules/@allyhub/protocol/dist/kinds.d.ts +30 -0
  88. package/dist/node_modules/@allyhub/protocol/dist/kinds.js +1 -1
  89. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +6 -0
  90. package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
  91. package/dist/node_modules/@allyhub/protocol/package.json +1 -1
  92. package/dist/node_modules/@allyhub/registry/package.json +1 -1
  93. package/dist/node_modules/@allyhub/render/package.json +1 -1
  94. package/dist/node_modules/@allyhub/runtime/dist/compose.js +1 -1
  95. package/dist/node_modules/@allyhub/runtime/dist/embed.js +1 -1
  96. package/dist/node_modules/@allyhub/runtime/dist/film.js +1 -1
  97. package/dist/node_modules/@allyhub/runtime/dist/piece.js +2 -2
  98. package/dist/node_modules/@allyhub/runtime/dist/player/player.js +1 -1
  99. package/dist/node_modules/@allyhub/runtime/package.json +1 -1
  100. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  101. package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
  102. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  103. package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
  104. package/dist/node_modules/@allyhub/sheet/dist/calc/coerce.js +1 -1
  105. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
  106. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.js +1 -1
  107. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/date.js +1 -1
  108. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/dynamic.js +1 -1
  109. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/info.js +1 -1
  110. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/logical.js +1 -1
  111. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/lookup.js +1 -1
  112. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
  113. package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
  114. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  115. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
  116. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
  117. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  118. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  119. package/dist/node_modules/@allyhub/sheet-extension/dist/build.js +1 -1
  120. package/dist/node_modules/@allyhub/sheet-extension/package.json +1 -1
  121. package/dist/node_modules/@allyhub/slides-core/dist/animation.js +1 -1
  122. package/dist/node_modules/@allyhub/slides-core/dist/api.js +1 -1
  123. package/dist/node_modules/@allyhub/slides-core/dist/components.js +1 -1
  124. package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
  125. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  126. package/dist/node_modules/@allyhub/slides-extension/dist/build.js +2 -1
  127. package/dist/node_modules/@allyhub/slides-extension/dist/deck-pptx.js +1 -1
  128. package/dist/node_modules/@allyhub/slides-extension/dist/evaluate.js +2 -2
  129. package/dist/node_modules/@allyhub/slides-extension/dist/export.js +1 -1
  130. package/dist/node_modules/@allyhub/slides-extension/package.json +1 -1
  131. package/dist/node_modules/@allyhub/slides-pptx/dist/write.js +2 -2
  132. package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
  133. package/dist/node_modules/@allyhub/slides-runtime/dist/component.js +1 -1
  134. package/dist/node_modules/@allyhub/slides-runtime/dist/draw.js +2 -2
  135. package/dist/node_modules/@allyhub/slides-runtime/dist/item.js +2 -0
  136. package/dist/node_modules/@allyhub/slides-runtime/dist/load.js +5 -5
  137. package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
  138. package/dist/node_modules/@allyhub/stage/package.json +1 -1
  139. package/dist/node_modules/@allyhub/stage-page/dist/install.js +1 -1
  140. package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
  141. package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +19 -19
  142. package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
  143. package/dist/node_modules/@allyhub/telemetry/package.json +1 -1
  144. package/dist/node_modules/@allyhub/text-extension/package.json +1 -1
  145. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  146. package/dist/node_modules/@allyhub/video-extension/dist/build.js +1 -1
  147. package/dist/node_modules/@allyhub/video-extension/package.json +1 -1
  148. package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
  149. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  150. package/dist/node_modules/@allyhub/website/package.json +1 -1
  151. package/dist/node_modules/@allyhub/website-extension/package.json +1 -1
  152. package/dist/node_modules/@allyhub/x-extension/package.json +3 -1
  153. package/dist/node_modules/@allyhub/x-model/package.json +1 -1
  154. package/dist/node_modules/@allyhub/x-view/package.json +1 -1
  155. package/dist/package.json +13 -13
  156. package/dist/works.js +1 -1
  157. package/editor-web/assets/{abnfDiagram-WEYOIA3C-B1AxOB-Y.js → abnfDiagram-WEYOIA3C-CHNpVSPv.js} +1 -1
  158. package/editor-web/assets/{architecture-WOLXFQ4H-C-7xKJ2Z.js → architecture-WOLXFQ4H-gPsJqQwV.js} +1 -1
  159. package/editor-web/assets/{architectureDiagram-ZHVYKT53-CyWb8_iD.js → architectureDiagram-ZHVYKT53-CEIDcC6r.js} +1 -1
  160. package/editor-web/assets/{article-qt4W_BKH.js → article-BHTjq0_Y.js} +1 -1
  161. package/editor-web/assets/{article-CTKW7Eo0.js → article-DfELjJ2o.js} +1 -1
  162. package/editor-web/assets/{blockDiagram-RJAE7QA3-uii4-7Ix.js → blockDiagram-RJAE7QA3-CUzEGVet.js} +1 -1
  163. package/editor-web/assets/{c4Diagram-XDPPPE54-BtL5Z-wF.js → c4Diagram-XDPPPE54-CB94NR9s.js} +1 -1
  164. package/editor-web/assets/calc-worker-BdHh5LXM.js +45 -0
  165. package/editor-web/assets/channel-DCDCx5Es.js +1 -0
  166. package/editor-web/assets/{chart-file-HE-uXGmJ.js → chart-file-CfbWK9l1.js} +1 -1
  167. package/editor-web/assets/{chunk-2E7WHVMD-BJjuZYBs.js → chunk-2E7WHVMD-DFYo_Boi.js} +1 -1
  168. package/editor-web/assets/{chunk-4EMNKR2T-nzPdUHaI.js → chunk-4EMNKR2T-CLLjmweX.js} +1 -1
  169. package/editor-web/assets/{chunk-55XCU76K-CH52E3Nl.js → chunk-55XCU76K-CkwQ_3m1.js} +1 -1
  170. package/editor-web/assets/{chunk-7S6XSTFO-Ba4LNKCV.js → chunk-7S6XSTFO-V-AvHpAB.js} +1 -1
  171. package/editor-web/assets/{chunk-AQDTSKZB-Co9SmoqD.js → chunk-AQDTSKZB-PjHyYpb8.js} +1 -1
  172. package/editor-web/assets/{chunk-DSNLSHJZ-BHRvxRGi.js → chunk-DSNLSHJZ-QaczBS3J.js} +1 -1
  173. package/editor-web/assets/{chunk-HAGFOTED-F5Wd8ETY.js → chunk-HAGFOTED-aLaQB5Xu.js} +1 -1
  174. package/editor-web/assets/{chunk-HNE4Q36P-C_E0__p9.js → chunk-HNE4Q36P-De3ftDQR.js} +1 -1
  175. package/editor-web/assets/{chunk-NQOKRVIF-BvrtbbWm.js → chunk-NQOKRVIF-CrhVQyvP.js} +1 -1
  176. package/editor-web/assets/{chunk-UHW7PFBP-D0HTPXRF.js → chunk-UHW7PFBP-BFmZ5ZLn.js} +1 -1
  177. package/editor-web/assets/{chunk-VQ5W62QI-B9hF2YMk.js → chunk-VQ5W62QI-CzppUHLA.js} +1 -1
  178. package/editor-web/assets/{chunk-WQQL4CDK-D7N3o-Ub.js → chunk-WQQL4CDK-BrAU7V6v.js} +1 -1
  179. package/editor-web/assets/{chunk-YZO67HFG-XaLSrI_W.js → chunk-YZO67HFG-BSiF71qj.js} +1 -1
  180. package/editor-web/assets/{chunk-ZAUX2LTX-sXc6qmw-.js → chunk-ZAUX2LTX-BJc4r5b1.js} +1 -1
  181. package/editor-web/assets/{chunk-ZCHMQSOR-B0X6sNMX.js → chunk-ZCHMQSOR-CkGTuehB.js} +1 -1
  182. package/editor-web/assets/{classDiagram-v2-4MYWR3UA-CjXVvOUp.js → classDiagram-v2-4MYWR3UA-Byxc7J88.js} +1 -1
  183. package/editor-web/assets/{cynefin-EF2NZ3EQ-PQ9VyM9v.js → cynefin-EF2NZ3EQ-BSxkVbdf.js} +1 -1
  184. package/editor-web/assets/{cynefinDiagram-WF24UDRP-KXuXFAhX.js → cynefinDiagram-WF24UDRP-IkCgARNs.js} +1 -1
  185. package/editor-web/assets/{dagre-NK4GIZVX-CBTyfYD5.js → dagre-NK4GIZVX-9PgeH6nY.js} +1 -1
  186. package/editor-web/assets/deck-tTzKONci.js +1 -0
  187. package/editor-web/assets/{diagram-CBK3MWTC-CsVO64Bf.js → diagram-CBK3MWTC-DRzeg3Ds.js} +1 -1
  188. package/editor-web/assets/{diagram-I5XIIV2D-fzbUm1St.js → diagram-I5XIIV2D-B_zeKMN6.js} +1 -1
  189. package/editor-web/assets/{diagram-ODIL2UCW-up6ihgN5.js → diagram-ODIL2UCW-FFm0O8SN.js} +1 -1
  190. package/editor-web/assets/{diagram-PFBEJUXE-T6hVBoCD.js → diagram-PFBEJUXE-DrtCT8OA.js} +1 -1
  191. package/editor-web/assets/{diagram-RJA3I4VV-BDntFeuR.js → diagram-RJA3I4VV-DtxJ3V0q.js} +1 -1
  192. package/editor-web/assets/{diagram-TYUNFSNR-Dv1-mqbf.js → diagram-TYUNFSNR-DmxF_8H_.js} +1 -1
  193. package/editor-web/assets/dist-BEpzsYn_.js +6 -0
  194. package/editor-web/assets/dist-BUD4ywMB.js +18 -0
  195. package/editor-web/assets/{dist-aTV6Rwon.js → dist-C21CkR7Z.js} +132 -131
  196. package/editor-web/assets/{dist-DhMagA-B.js → dist-C56mWAec.js} +1 -1
  197. package/editor-web/assets/{dist-B-lYrbqX.js → dist-CAb3W9_P.js} +1 -1
  198. package/editor-web/assets/{dist-Bfs4cZI_.js → dist-CEknsRDd.js} +1 -1
  199. package/editor-web/assets/{dist-C66KgS8g.js → dist-CbZAznNW.js} +2 -2
  200. package/editor-web/assets/{dist-Ba5Kv4A-.js → dist-DDzjbKIg.js} +1 -1
  201. package/editor-web/assets/{dist-CWXGbcPB.js → dist-DaEbElXI.js} +1 -1
  202. package/editor-web/assets/{dist-_ooK0TT9.js → dist-Dr3o4vee.js} +1 -1
  203. package/editor-web/assets/{dist-mrWPE-br.js → dist-JLyDtl9X.js} +1 -1
  204. package/editor-web/assets/{dist-BW8IR8bR.js → dist-PBbWAsrV.js} +3 -3
  205. package/editor-web/assets/{dist-CBeeIAlh.js → dist-ZZlQa66J.js} +1 -1
  206. package/editor-web/assets/{dist-CHKVUdcE.js → dist-bQKpw3Zz.js} +5 -5
  207. package/editor-web/assets/dist-d4dayaWE.js +17 -0
  208. package/editor-web/assets/{docx-draw-CeiLkccT.js → docx-draw-9Q_fArBC.js} +1 -1
  209. package/editor-web/assets/{ebnfDiagram-V4P3TTPT-CZzljBYN.js → ebnfDiagram-V4P3TTPT-DSX1Aoty.js} +1 -1
  210. package/editor-web/assets/{elk-QONTBCTQ-6vNb82av.js → elk-QONTBCTQ-C7gy9q56.js} +1 -1
  211. package/editor-web/assets/{erDiagram-KYQIGQAA-B8smxURG.js → erDiagram-KYQIGQAA-CKx_HoY4.js} +1 -1
  212. package/editor-web/assets/esm-BZb5QMQf.js +21 -0
  213. package/editor-web/assets/{eventmodeling-K75KTNOO-CngIhoUF.js → eventmodeling-K75KTNOO-DL4HvSrd.js} +1 -1
  214. package/editor-web/assets/flowDiagram-IUGLLWBU-BUnRtJ8q.js +1 -0
  215. package/editor-web/assets/{ganttDiagram-R7GPNTJY-BtzqHUiP.js → ganttDiagram-R7GPNTJY-N-AP4slN.js} +1 -1
  216. package/editor-web/assets/{gitGraph-VSP46ZUC-DOOpoQDh.js → gitGraph-VSP46ZUC-BKRGJKWm.js} +1 -1
  217. package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-Cu4T8UUo.js → gitGraphDiagram-PDYL7XHY-ClwL7w2_.js} +1 -1
  218. package/editor-web/assets/index-BedbINE5.css +2 -0
  219. package/editor-web/assets/index-DG2nHq4D.js +28 -0
  220. package/editor-web/assets/{info-OHQRW6UA-CiNozx0c.js → info-OHQRW6UA-DpcY8t23.js} +1 -1
  221. package/editor-web/assets/{infoDiagram-MVDRKAX5-A3mxzTmc.js → infoDiagram-MVDRKAX5-ChtmtWni.js} +1 -1
  222. package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-CIbVgY0Z.js → ishikawaDiagram-HPEHV2GE-BZNTuG_F.js} +1 -1
  223. package/editor-web/assets/{journeyDiagram-BOSHW7O7-BwPXFmyS.js → journeyDiagram-BOSHW7O7-C3uVmZbL.js} +1 -1
  224. package/editor-web/assets/{kanban-definition-FNSA4HC5-biRlEeb1.js → kanban-definition-FNSA4HC5-puEhftGG.js} +1 -1
  225. package/editor-web/assets/{mermaid-parser.core-ikwPmNne.js → mermaid-parser.core-Bw8re-WE.js} +3 -3
  226. package/editor-web/assets/{mermaid.core-B4GR7QVa.js → mermaid.core-Cc2GIqBr.js} +4 -4
  227. package/editor-web/assets/{mindmap-definition-6OY57UG3-BN8aiUmO.js → mindmap-definition-6OY57UG3-C6MUl_S_.js} +1 -1
  228. package/editor-web/assets/{packet-JDAUHWVQ-DWesZv6p.js → packet-JDAUHWVQ-C75RnvC5.js} +1 -1
  229. package/editor-web/assets/{pegDiagram-ECIUJNBX-Bh3QEAL_.js → pegDiagram-ECIUJNBX-ChjmsdV4.js} +1 -1
  230. package/editor-web/assets/{pie-XZMESJXO-DT1ANL51.js → pie-XZMESJXO-BaKxJQpj.js} +1 -1
  231. package/editor-web/assets/{pieDiagram-GNMPY74T-xXxgiv6O.js → pieDiagram-GNMPY74T-CT2ez8pr.js} +1 -1
  232. package/editor-web/assets/{props-form-BwZY8ZWd.js → props-form-D5oKHfpk.js} +1 -1
  233. package/editor-web/assets/{quadrantDiagram-D57K4MC3-BGzRd8iZ.js → quadrantDiagram-D57K4MC3-BJItlTfk.js} +1 -1
  234. package/editor-web/assets/{radar-ABXABTNO-C-rmMB0D.js → radar-ABXABTNO-DnLzBlTo.js} +1 -1
  235. package/editor-web/assets/{railroad-I3PHUGI6-CvLOq2i8.js → railroad-I3PHUGI6-D5hj6Yv3.js} +1 -1
  236. package/editor-web/assets/{railroad-abnf-LNEFI6M7-DMsb025s.js → railroad-abnf-LNEFI6M7-DUZlZoPu.js} +1 -1
  237. package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-5bvVcIvh.js → railroad-ebnf-DWYD2UWJ-CDyyDC6d.js} +1 -1
  238. package/editor-web/assets/{railroad-peg-JR7BVNR7-LKZ9-9ja.js → railroad-peg-JR7BVNR7-CC3ImNnT.js} +1 -1
  239. package/editor-web/assets/{railroadDiagram-Y72NRBL7-DVBhzkmC.js → railroadDiagram-Y72NRBL7-Bjw-8Se5.js} +1 -1
  240. package/editor-web/assets/{requirementDiagram-EQYSW5RA-B5RyzWna.js → requirementDiagram-EQYSW5RA-CDFnuEIO.js} +1 -1
  241. package/editor-web/assets/{sankeyDiagram-SY24JHO5-BvOJG-gB.js → sankeyDiagram-SY24JHO5-CQPVLY1w.js} +1 -1
  242. package/editor-web/assets/{schemas-BmdNnDyt.js → schemas-moE_A7Nj.js} +1 -1
  243. package/editor-web/assets/{sequenceDiagram-BLEHNHQU-BI7-Daqy.js → sequenceDiagram-BLEHNHQU-BQzuLmBX.js} +1 -1
  244. package/editor-web/assets/{session-D8E3nUwU.js → session-s1I85rox.js} +1 -1
  245. package/editor-web/assets/{slides-bj0WJT_G.js → slides-oQ_C0SVJ.js} +1 -1
  246. package/editor-web/assets/snapshots-BPJKywuN.js +1 -0
  247. package/editor-web/assets/{split-BrF9ECYb.js → split-7CVjIkSU.js} +1 -1
  248. package/editor-web/assets/square-arrow-out-up-right-DF5dvsSp.js +1 -0
  249. package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-C01p8WHX.js → stateDiagram-v2-A6IESKWZ-DOuageUf.js} +1 -1
  250. package/editor-web/assets/{swimlanes-B3ENRKFQ-B00P2SqG.js → swimlanes-B3ENRKFQ-CXKkok7X.js} +1 -1
  251. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-C3Car2M0.js +8 -0
  252. package/editor-web/assets/{tabs-CloHB5Z4.js → tabs-CiF1N-pL.js} +1 -1
  253. package/editor-web/assets/{timeline-definition-JXYKGLGB-BIBoOYJY.js → timeline-definition-JXYKGLGB-DgAjAeZp.js} +1 -1
  254. package/editor-web/assets/{treeView-D4JQ5SDB-CL6DL8V0.js → treeView-D4JQ5SDB-C0Xvnhck.js} +1 -1
  255. package/editor-web/assets/{treemap-SAJKECNS-CPLGr0WY.js → treemap-SAJKECNS-aXfKAeSX.js} +1 -1
  256. package/editor-web/assets/{usecaseDiagram-WPOLBNNX-L03lK2bO.js → usecaseDiagram-WPOLBNNX-CvUlBa-L.js} +1 -1
  257. package/editor-web/assets/{vennDiagram-Q3Y3IDCW-B5tKKP_-.js → vennDiagram-Q3Y3IDCW-qMJ1iCxs.js} +1 -1
  258. package/editor-web/assets/{video-BWUznyLR.js → video-DQrjo1TI.js} +1 -1
  259. package/editor-web/assets/{wardley-7MLQ67FV-vsBpXT56.js → wardley-7MLQ67FV-DEdnH0by.js} +1 -1
  260. package/editor-web/assets/{wardleyDiagram-IVAIDKWA-CMCnVUgh.js → wardleyDiagram-IVAIDKWA-Bt-B2hQ5.js} +1 -1
  261. package/editor-web/assets/workbook-FSSUiIp9.js +45 -0
  262. package/editor-web/assets/{xychartDiagram-4URNHDU4-C9XkBiEO.js → xychartDiagram-4URNHDU4-DV4bSzTb.js} +1 -1
  263. package/editor-web/index.html +3 -3
  264. package/package.json +2 -2
  265. package/editor-web/assets/calc-worker-jImBXoeb.js +0 -45
  266. package/editor-web/assets/channel-dEO-yacZ.js +0 -1
  267. package/editor-web/assets/deck-C-p17098.js +0 -1
  268. package/editor-web/assets/dist-B94TkgAP.js +0 -18
  269. package/editor-web/assets/dist-DxcrMrCR.js +0 -6
  270. package/editor-web/assets/dist-DzjSp2i2.js +0 -17
  271. package/editor-web/assets/esm-CNi9O1ya.js +0 -21
  272. package/editor-web/assets/flowDiagram-IUGLLWBU-CL0AVU4Y.js +0 -1
  273. package/editor-web/assets/index-BCjGdcPh.js +0 -28
  274. package/editor-web/assets/index-D9ng69En.css +0 -2
  275. package/editor-web/assets/snapshots-CuflsO8Q.js +0 -1
  276. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-ChmNuO4G.js +0 -8
  277. package/editor-web/assets/workbook-C1QR6Cts.js +0 -45
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{createHash as m}from"node:crypto";import{readFile as p}from"node:fs/promises";import{join as A}from"node:path";import{fontsDigest as B}from"@allyhub/build";import{comboKey as H,messagePrefix as J}from"@allyhub/piece";import{mediaByStem as N}from"@allyhub/piece";const b="allyhub-digest-v4",h=s=>s.digest("hex");async function W(s,o){const n=s.bundle,u=n?.chunks.entries[o.id.replaceAll("/","__")];if(!n||!u)return null;const a=new Set,d=i=>{if(a.has(i))return;a.add(i);const c=n.chunks.chunks[i];if(c){for(const l of c.css)a.add(l);for(const l of c.imports)d(l)}};d(u.file);const r=m("sha256");for(const i of[...a].sort())r.update(`${i}\0`),r.update(await p(A(n.dir,i)).catch(()=>Buffer.alloc(0))),r.update("\0");return h(r)}export async function baseDigest(s,o,n){const u=await B(s.root,s.files,s.fonts),a=m("sha256");return a.update(`${b}\0piece\0`),a.update(JSON.stringify([n,o.id,o.file,o.dims,o.matrix?{space:o.matrix.space,rules:o.matrix.rules}:null,o.format,await W(s,o),...u===void 0?[]:[u]])),`sha256:${h(a)}`}function w(s,o){return s?Object.keys(s).filter(n=>n.startsWith(`${o}.`)).sort().map(n=>[n,s[n]]):[]}export function outputDigest(s,o,n,u,a){const d=s.messages.locales,r=d[0],i=u.lang,c=i===void 0?void 0:s.messages.messages[i],l=r===void 0?void 0:s.messages.messages[r],g=(t,e)=>t&&Object.hasOwn(t,e)?t[e]:null,y=(t,e)=>(t===void 0?void 0:s.messages.anchors[t]?.[e])??[],k=t=>{const e=g(c,t);return e!==null?[e,...y(i,t)]:[null,g(l,t),...y(r,t)]},S=t=>{const e=w(c,t);return e.length>0?[e]:[[],w(l,t)]},$=[...a.messages].sort((t,e)=>t.key===e.key?t.kind<e.kind?-1:1:t.key<e.key?-1:1).map(t=>t.kind==="list"?[t.key,"list",...S(t.key)]:[t.key,"text",...k(t.key)]),O=`${J(n.id)}.`,j=n.counts!==void 0?[n.counts.value??null,...[...new Set([...Object.keys(c??{}),...Object.keys(l??{})])].filter(t=>t.startsWith(O)).sort().map(t=>[t,...k(t)])]:[],v=[...new Set(a.media.map(t=>t.path))].sort().map(t=>{const e=s.media[t]??N(s.media,t);if(!e)return[t,null];const x={...e};return delete x.url,[t,x]}),D=[...new Set(a.data.map(t=>t.path))].sort().map(t=>[t,s.data[t]?.sha256??null]),f=m("sha256");return f.update(`${b}\0output\0${o}\0`),f.update(JSON.stringify([n.kind,n.options,H(u),d,$,j,v,D])),`sha256:${h(f)}`}
2
+ import{createHash as h}from"node:crypto";import{readFile as x}from"node:fs/promises";import{join as S}from"node:path";import{fontsDigest as M}from"@allyhub/build";import{USE_FORMS as _,listsFile as A}from"@allyhub/formats";import{comboKey as E,messagePrefix as H}from"@allyhub/piece";import{mediaByStem as J}from"@allyhub/piece";const $="allyhub-digest-v4",g=s=>s.digest("hex");async function b(s,e){const n=s.bundle,f=n?.chunks.entries[e.id.replaceAll("/","__")];if(!n||!f)return null;const c=new Set,u=i=>{if(c.has(i))return;c.add(i);const l=n.chunks.chunks[i];if(l){for(const r of l.css)c.add(r);for(const r of l.imports)u(r)}};u(f.file);const o=h("sha256");for(const i of[...c].sort())o.update(`${i}\0`),o.update(await x(S(n.dir,i)).catch(()=>Buffer.alloc(0))),o.update("\0");return g(o)}export async function liveDigest(s,e){const n=new Map(s.items.map(o=>[o.id,o])),f=new Set,c=o=>{for(const i of n.get(o)?.uses??[])i.type!==_.live||f.has(i.item)||(f.add(i.item),c(i.item))};if(c(e),f.size===0)return;const u=h("sha256");for(const o of[...f].sort()){const i=n.get(o),l=s.pieces.find(d=>d.place===o);u.update(`${o}\0${l?await b(s,l)??"":""}\0`);const r=i?.files??[];for(const d of s.files.filter(m=>A(r,m)).sort())u.update(`${d}\0`),u.update(await x(S(s.root,d)).catch(()=>Buffer.alloc(0))),u.update("\0")}return g(u)}export async function baseDigest(s,e,n){const f=await M(s.root,s.files,s.fonts),c=await liveDigest(s,e.place),u=h("sha256");return u.update(`${$}\0piece\0`),u.update(JSON.stringify([n,e.id,e.file,e.dims,e.matrix?{space:e.matrix.space,rules:e.matrix.rules}:null,e.format,await b(s,e),...f===void 0?[]:[f],...c===void 0?[]:[{live:c}]])),`sha256:${g(u)}`}function v(s,e){return s?Object.keys(s).filter(n=>n.startsWith(`${e}.`)).sort().map(n=>[n,s[n]]):[]}export function outputDigest(s,e,n,f,c){const u=s.messages.locales,o=u[0],i=f.lang,l=i===void 0?void 0:s.messages.messages[i],r=o===void 0?void 0:s.messages.messages[o],d=(t,a)=>t&&Object.hasOwn(t,a)?t[a]:null,m=(t,a)=>(t===void 0?void 0:s.messages.anchors[t]?.[a])??[],w=t=>{const a=d(l,t);return a!==null?[a,...m(i,t)]:[null,d(r,t),...m(o,t)]},O=t=>{const a=v(l,t);return a.length>0?[a]:[[],v(r,t)]},j=[...c.messages].sort((t,a)=>t.key===a.key?t.kind<a.kind?-1:1:t.key<a.key?-1:1).map(t=>t.kind==="list"?[t.key,"list",...O(t.key)]:[t.key,"text",...w(t.key)]),D=`${H(n.id)}.`,p=n.counts!==void 0?[n.counts.value??null,...[...new Set([...Object.keys(l??{}),...Object.keys(r??{})])].filter(t=>t.startsWith(D)).sort().map(t=>[t,...w(t)])]:[],B=[...new Set(c.media.map(t=>t.path))].sort().map(t=>{const a=s.media[t]??J(s.media,t);if(!a)return[t,null];const k={...a};return delete k.url,[t,k]}),F=[...new Set(c.data.map(t=>t.path))].sort().map(t=>[t,s.data[t]?.sha256??null]),y=h("sha256");return y.update(`${$}\0output\0${e}\0`),y.update(JSON.stringify([n.kind,n.options,E(f),u,j,p,B,F])),`sha256:${g(y)}`}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{createHash as g}from"node:crypto";import{codeOf as l,fontsDigest as m,stageId as y}from"@allyhub/build";import{stageIdentity as h}from"@allyhub/stage";const p="allyhub-deck-key-v1",d=t=>g("sha256").update(t).digest("hex"),u=new WeakMap;export function itemDigests(t,e){let s=u.get(t);s||(s=new Map,u.set(t,s));const c=y(e);let n=s.get(c);return n||(n=(async()=>{const o=await m(t.root,t.files,t.fonts),r=h(o),i=await l(t,e,r);return{code:d(JSON.stringify([i.bundle,i.vendor])),renderer:d(JSON.stringify(r))}})(),s.set(c,n)),n}function b(t){const e=new Set;let s=!1;const c=n=>{if(Array.isArray(n))for(const o of n)c(o);else if(typeof n=="object"&&n!==null){const o=n;("component"in o&&typeof o.component=="object"||o.code===!0)&&(s=!0);const r=o.background_picture;typeof r=="string"&&e.add(r);const i=o.picture_fill;if(typeof i=="object"&&i!==null&&"path"in i){const f=i.path;typeof f=="string"&&e.add(f)}const a=o.media;if(typeof a=="object"&&a!==null&&"path"in a){const f=a.path;typeof f=="string"&&e.add(f)}for(const f of Object.values(o))c(f)}};return c(JSON.parse(t)),{media:[...e].sort(),component:s}}export function partKeys(t,e){const s={};for(const[c,n]of Object.entries(t)){const{media:o,component:r}=b(n);s[c]=d(JSON.stringify([p,e.digests.renderer,e.gpu?"gpu":"cpu",r?e.digests.code:null,o.map(i=>[i,e.prepared.media[i]?.sha256??null]),n]))}return s}export function componentKey(t,e){return d(JSON.stringify([p,"component",e.digests.renderer,e.digests.code,e.gpu?"gpu":"cpu",t.name,t.props,t.width,t.height,t.t]))}
2
+ import{createHash as g}from"node:crypto";import{codeOf as l,fontsDigest as m,stageId as y}from"@allyhub/build";import{stageIdentity as h}from"@allyhub/stage";import{liveDigest as b}from"./digest.js";const p="allyhub-deck-key-v1",d=t=>g("sha256").update(t).digest("hex"),u=new WeakMap;export function itemDigests(t,e){let i=u.get(t);i||(i=new Map,u.set(t,i));const c=y(e);let o=i.get(c);return o||(o=(async()=>{const n=await m(t.root,t.files,t.fonts),r=h(n),s=await l(t,e,r),f=await b(t,e.place);return{code:d(JSON.stringify([s.bundle,s.vendor,...f===void 0?[]:[f]])),renderer:d(JSON.stringify(r))}})(),i.set(c,o)),o}function w(t){const e=new Set;let i=!1;const c=o=>{if(Array.isArray(o))for(const n of o)c(n);else if(typeof o=="object"&&o!==null){const n=o;("component"in n&&typeof n.component=="object"||"item"in n&&typeof n.item=="object"||n.code===!0)&&(i=!0);const r=n.background_picture;typeof r=="string"&&e.add(r);const s=n.picture_fill;if(typeof s=="object"&&s!==null&&"path"in s){const a=s.path;typeof a=="string"&&e.add(a)}const f=n.media;if(typeof f=="object"&&f!==null&&"path"in f){const a=f.path;typeof a=="string"&&e.add(a)}for(const a of Object.values(n))c(a)}};return c(JSON.parse(t)),{media:[...e].sort(),component:i}}export function partKeys(t,e){const i={};for(const[c,o]of Object.entries(t)){const{media:n,component:r}=w(o);i[c]=d(JSON.stringify([p,e.digests.renderer,e.gpu?"gpu":"cpu",r?e.digests.code:null,n.map(s=>[s,e.prepared.media[s]?.sha256??null]),o]))}return i}export function componentKey(t,e){return d(JSON.stringify([p,"component",e.digests.renderer,e.digests.code,e.gpu?"gpu":"cpu",t.name,t.props,t.width,t.height,t.t]))}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/project",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -628,12 +628,6 @@ export declare const ACCOUNT_CALLS: {
628
628
  total: z.ZodNumber;
629
629
  }, z.core.$strip>>;
630
630
  readonly "storage/clear": AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{}, z.core.$strip>>;
631
- readonly "files/delete": AccountCall<z.ZodObject<{
632
- id: z.ZodString;
633
- }, z.core.$strict>, z.ZodObject<{}, z.core.$strip>>;
634
- readonly "projects/delete": AccountCall<z.ZodObject<{
635
- id: z.ZodString;
636
- }, z.core.$strict>, z.ZodObject<{}, z.core.$strip>>;
637
631
  readonly devices: AccountCall<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
638
632
  devices: z.ZodArray<z.ZodObject<{
639
633
  id: z.ZodString;
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{z as e}from"zod";import{ACCOUNT_DELETE_PATH as G,ACCOUNT_EXPORT_PATH as j,DEVICES_PATH as b,DevicesSchema as v}from"./auth.js";import{FILES_PATH as H,AUTO_TOP_UP_PATH as A,AutoTopUpRequestSchema as k,BILLING_CHECKOUT_PATH as R,BILLING_PAYMENT_PATH as C,BILLING_PLANS_PATH as U,BILLING_PORTAL_PATH as N,BILLING_REQUEST_PATH as x,BILLING_RESUME_PATH as M,BILLING_SUMMARY_PATH as D,BILLING_TOP_UP_PATH as B,BILLING_USAGE_PATH as $,BillingPaymentSchema as z,BillingPlansSchema as q,BillingSummarySchema as S,BillingUsageSchema as Y,CheckoutRequestSchema as F,PortalRequestSchema as K,TopUpRequestSchema as V,BILLING_INVOICES_PATH as Z,BILLING_SPENDS_PATH as J,BillingInvoicesSchema as Q,IDEMPOTENCY_KEY_HEADER as W,CAPABILITIES_PATH as P,CATALOG_PATH as X,EDITORS_PATH as ee,EditorsSchema as te,CapabilitiesSchema as O,CapabilityRequestSchema as se,CatalogSchema as oe,BillingSpendsSchema as ie}from"./cloud.js";import{PROJECTS_PATH as ne,STORAGE_CLEARING_PATH as ae,STORAGE_FILES_PATH as re,STORAGE_PATH as ce,STORAGE_PROJECTS_PATH as me,StoragePageSchema as w,StorageSchema as le,StoredFilesSchema as he,StoredProjectsSchema as de}from"./snapshots.js";import{MAIL_MESSAGES_PATH as f,MAIL_PATH as pe,MAIL_PERSON_QUERY as Te,MAIL_SETTINGS_PATH as ue,MailMessageSchema as Ee,MailSearchResponseSchema as be,MailSearchSchema as ge,MailSettingsSchema as Ae,MailboxSchema as I}from"./mail.js";import{MEMBERS_PATH as d,MemberLimitSchema as Se,MembersSchema as Pe,ORGANIZATIONS_PATH as _,ORGANIZATION_PATH as y}from"./teams.js";export const INVITATIONS_PATH="/api/organization/invitations",InvitationsSchema=e.object({invitations:e.array(e.object({id:e.string(),email:e.string(),role:e.string(),expiresAt:e.iso.datetime()}))}),LEAVE_PATH="/api/organization/leave",KEYS_PATH="/api/keys",KeysSchema=e.object({keys:e.array(e.object({id:e.string(),name:e.string().nullable(),start:e.string().nullable(),enabled:e.boolean(),createdAt:e.iso.datetime(),lastUsedAt:e.iso.datetime().nullable()}))}),PROFILE_PATH="/api/account/profile",ProfileSchema=e.object({name:e.string(),email:e.string(),google:e.boolean(),v1:e.object({url:e.url(),closesAt:e.iso.datetime({offset:!0}),bonusCredits:e.number().int().nonnegative().default(0)}).optional()}),ROLES=["member","admin","owner"];const s=e.strictObject({}),o=e.object({}),L=e.object({url:e.url()}),p=e.string().trim().min(1).max(100),t=(i,T,c,l,r,m)=>({http:i,route:T,params:c,result:l,about:r,...m===void 0?{}:{headers:m}});export const ACCOUNT_CALLS={balance:t("GET",D,s,S,"The organization's credits, this month's plan credits, its plan and its auto top-up."),plans:t("GET",U,s,q,"The plans, their prices, and what a top-up buys."),usage:t("GET",$,e.strictObject({days:e.int().min(1).max(400),timeZone:e.string().min(1)}),Y,"Credits spent each day by what they were spent on, the days with none left out."),catalog:t("GET",X,s,oe,"The cloud tools' catalog: its works and every tool, with what it costs."),editors:t("GET",ee,s,te,"The editors the console lists, free in every product, in their order."),capabilities:t("GET",P,s,O,"The cloud tools the team turned off: works and tools."),"capabilities/set":t("PUT",P,se,O,"A work or a tool switched on or off for the team, an owner's or an admin's; what is off now."),spends:t("GET",J,e.strictObject({days:e.int().min(1).max(400),limit:e.int().min(1).max(5e3).optional()}),ie,"Each spend of the last days, the latest first: when, by whom, on what and how many credits; a member reads their own."),checkout:t("POST",R,F,L,"Stripe Checkout for a plan or a top-up, to open in a browser."),portal:t("POST",N,K,L,"Stripe's Customer Portal at its home (the card, billing details, invoices) or at a flow (a new card, a change of plan, the plan's cancellation), to open in a browser."),resume:t("POST",M,s,S,"A plan cancelled at its period's end taken up again."),payment:t("GET",C,s,z,"The card charged without the person there, and where Stripe's emails go."),invoices:t("GET",Z,s,Q,"The organization's invoices, the latest first, each with its PDF."),topUp:t("POST",B,V.extend({key:e.uuid()}),e.object({credits:e.number()}),"Credits bought with the saved card at once, once by the purchase's key; answers what was added. A browser's session alone.",{key:W}),"autoTopUp/set":t("PUT",A,k,e.union([e.object({on:e.literal(!0)}),e.object({saveCard:e.url()})]),"Auto top-up on, or Stripe Checkout that saves a card first (or another), to open in a browser. A browser's session alone."),"autoTopUp/off":t("DELETE",A,s,o,"Auto top-up off."),"credits/request":t("POST",x,s,e.object({asked:e.literal(!0)}),"The organization's owners and admins asked by email to add credits, at most once a day for each member."),members:t("GET",d,s,Pe,"The members with their limits and spend; a member sees their own row."),"members/limit":t("PUT",`${d}/:userId/limit`,e.strictObject({userId:e.string().min(1)}).extend(Se.shape),o,"A member's limit in credits a month, null for none."),"members/role":t("PUT",`${d}/:userId/role`,e.strictObject({userId:e.string().min(1),role:e.enum(ROLES)}),o,"A member's role; only an owner makes or unmakes an owner."),"members/remove":t("DELETE",`${d}/:userId`,e.strictObject({userId:e.string().min(1)}),o,"A member removed from the team."),invitations:t("GET",INVITATIONS_PATH,s,InvitationsSchema,"The invitations waiting to be accepted."),"invitations/send":t("POST",INVITATIONS_PATH,e.strictObject({email:e.email(),role:e.enum(["member","admin"])}),o,"Invites a person by email; one invited already is sent a new invitation."),"invitations/cancel":t("DELETE",`${INVITATIONS_PATH}/:id`,e.strictObject({id:e.string().min(1)}),o,"An invitation cancelled."),"team/create":t("POST",_,e.strictObject({name:p}),e.object({id:e.string()}),"A new team, the person its owner."),"team/rename":t("PUT",y,e.strictObject({name:p}),o,"The team renamed."),"team/leave":t("POST",LEAVE_PATH,s,o,"The person leaves the team; its last owner cannot."),"team/dissolve":t("DELETE",y,s,o,"The team dissolved by its owner; it can be restored for 30 days."),"team/restore":t("POST",`${_}/:id/restore`,e.strictObject({id:e.string().min(1)}),o,"A dissolved team restored by its owner."),keys:t("GET",KEYS_PATH,s,KeysSchema,"The person's API keys for the organization."),"keys/create":t("POST",KEYS_PATH,e.strictObject({name:p}),e.object({id:e.string(),key:e.string()}),"A new API key; its secret is in this answer alone."),"keys/enable":t("PUT",`${KEYS_PATH}/:id`,e.strictObject({id:e.string().min(1),enabled:e.boolean()}),o,"An API key turned off or on again."),"keys/remove":t("DELETE",`${KEYS_PATH}/:id`,e.strictObject({id:e.string().min(1)}),o,"An API key deleted."),mail:t("GET",pe,s,I,"The person's mailbox in the organization: its addresses and settings."),"mail/settings":t("PUT",`${ue}?${Te}`,Ae,I,"The mailbox's display name, whom its agents may write to, and how long it keeps mail."),"mail/messages":t("GET",f,ge,be,"The mailbox's messages, newest first."),"mail/message":t("GET",`${f}/:id`,e.strictObject({id:e.string().min(1)}),Ee,"One message, read whole."),profile:t("GET",PROFILE_PATH,s,ProfileSchema,"The person's name and email, whether Google signs them in, and AllyHub's previous version while it is open to them."),"profile/set":t("PUT",PROFILE_PATH,e.strictObject({name:p}),o,"The person's name."),storage:t("GET",ce,s,le,"What the organization keeps in the cloud of what it may."),"storage/projects":t("GET",me,w,de,"A page of the person's projects in the cloud and their cloud Studio's home, the largest first, each with what it alone holds."),"storage/files":t("GET",re,w,he,"A page of the person's tools' inputs and outputs kept in the cloud, the largest first."),"storage/clear":t("DELETE",ae,s,o,"What the organization keeps that no longer is in use, deleted from the cloud now rather than at the daily sweep."),"files/delete":t("DELETE",`${H}/:id`,e.strictObject({id:e.string().min(1)}),o,"One of the person's tools' inputs or outputs deleted from the cloud; its bytes stay while a project names them."),"projects/delete":t("DELETE",`${ne}/:id`,e.strictObject({id:e.string().min(1)}),o,"One of the person's projects deleted from the cloud, with its snapshots; a copy on a computer stays."),devices:t("GET",b,s,v,"The computers signed in as the person."),"devices/signOut":t("DELETE",`${b}/:id`,e.strictObject({id:e.string().min(1)}),o,"A computer signed out."),"devices/signOutOthers":t("DELETE",b,s,o,"Every computer signed out but the one that asks."),export:t("GET",j,s,e.record(e.string(),e.unknown()),"Everything kept about the person."),close:t("POST",G,s,o,"Mails the link that deletes the person's account: a browser's session alone, so a computer opens the page in the browser.")};export function accountRequest(i,T){const c=T,l=new Set,r=i.route.replace(/:([A-Za-z]+)/gu,(n,a)=>(l.add(a),encodeURIComponent(String(c[a])))),m=i.headers??{},g=Object.entries(m).flatMap(([n,a])=>{const h=c[n];return typeof h=="string"?[[a,h]]:[]}),u=g.length===0?{}:{headers:Object.fromEntries(g)},E=Object.entries(c).filter(([n,a])=>!l.has(n)&&!(n in m)&&a!==void 0);if(i.http==="GET"||i.http==="DELETE"){const n=E.map(([a,h])=>`${encodeURIComponent(a)}=${encodeURIComponent(String(h))}`).join("&");return{method:i.http,path:n===""?r:`${r}?${n}`,...u}}return E.length===0?{method:i.http,path:r,...u}:{method:i.http,path:r,body:Object.fromEntries(E),...u}}
2
+ import{z as e}from"zod";import{ACCOUNT_DELETE_PATH as G,ACCOUNT_EXPORT_PATH as v,DEVICES_PATH as b,DevicesSchema as j}from"./auth.js";import{AUTO_TOP_UP_PATH as A,AutoTopUpRequestSchema as H,BILLING_CHECKOUT_PATH as k,BILLING_PAYMENT_PATH as R,BILLING_PLANS_PATH as U,BILLING_PORTAL_PATH as C,BILLING_REQUEST_PATH as N,BILLING_RESUME_PATH as x,BILLING_SUMMARY_PATH as M,BILLING_TOP_UP_PATH as B,BILLING_USAGE_PATH as D,BillingPaymentSchema as $,BillingPlansSchema as z,BillingSummarySchema as S,BillingUsageSchema as q,CheckoutRequestSchema as Y,PortalRequestSchema as F,TopUpRequestSchema as K,BILLING_INVOICES_PATH as V,BILLING_SPENDS_PATH as Z,BillingInvoicesSchema as Q,IDEMPOTENCY_KEY_HEADER as W,CAPABILITIES_PATH as P,CATALOG_PATH as J,EDITORS_PATH as X,EditorsSchema as ee,CapabilitiesSchema as w,CapabilityRequestSchema as te,CatalogSchema as oe,BillingSpendsSchema as se}from"./cloud.js";import{STORAGE_CLEARING_PATH as ie,STORAGE_FILES_PATH as ne,STORAGE_PATH as ae,STORAGE_PROJECTS_PATH as re,StoragePageSchema as O,StorageSchema as ce,StoredFilesSchema as me,StoredProjectsSchema as le}from"./snapshots.js";import{MAIL_MESSAGES_PATH as I,MAIL_PATH as he,MAIL_PERSON_QUERY as de,MAIL_SETTINGS_PATH as Te,MailMessageSchema as pe,MailSearchResponseSchema as ue,MailSearchSchema as Ee,MailSettingsSchema as be,MailboxSchema as _}from"./mail.js";import{MEMBERS_PATH as d,MemberLimitSchema as ge,MembersSchema as Ae,ORGANIZATIONS_PATH as f,ORGANIZATION_PATH as y}from"./teams.js";export const INVITATIONS_PATH="/api/organization/invitations",InvitationsSchema=e.object({invitations:e.array(e.object({id:e.string(),email:e.string(),role:e.string(),expiresAt:e.iso.datetime()}))}),LEAVE_PATH="/api/organization/leave",KEYS_PATH="/api/keys",KeysSchema=e.object({keys:e.array(e.object({id:e.string(),name:e.string().nullable(),start:e.string().nullable(),enabled:e.boolean(),createdAt:e.iso.datetime(),lastUsedAt:e.iso.datetime().nullable()}))}),PROFILE_PATH="/api/account/profile",ProfileSchema=e.object({name:e.string(),email:e.string(),google:e.boolean(),v1:e.object({url:e.url(),closesAt:e.iso.datetime({offset:!0}),bonusCredits:e.number().int().nonnegative().default(0)}).optional()}),ROLES=["member","admin","owner"];const o=e.strictObject({}),s=e.object({}),L=e.object({url:e.url()}),T=e.string().trim().min(1).max(100),t=(i,p,c,l,r,m)=>({http:i,route:p,params:c,result:l,about:r,...m===void 0?{}:{headers:m}});export const ACCOUNT_CALLS={balance:t("GET",M,o,S,"The organization's credits, this month's plan credits, its plan and its auto top-up."),plans:t("GET",U,o,z,"The plans, their prices, and what a top-up buys."),usage:t("GET",D,e.strictObject({days:e.int().min(1).max(400),timeZone:e.string().min(1)}),q,"Credits spent each day by what they were spent on, the days with none left out."),catalog:t("GET",J,o,oe,"The cloud tools' catalog: its works and every tool, with what it costs."),editors:t("GET",X,o,ee,"The editors the console lists, free in every product, in their order."),capabilities:t("GET",P,o,w,"The cloud tools the team turned off: works and tools."),"capabilities/set":t("PUT",P,te,w,"A work or a tool switched on or off for the team, an owner's or an admin's; what is off now."),spends:t("GET",Z,e.strictObject({days:e.int().min(1).max(400),limit:e.int().min(1).max(5e3).optional()}),se,"Each spend of the last days, the latest first: when, by whom, on what and how many credits; a member reads their own."),checkout:t("POST",k,Y,L,"Stripe Checkout for a plan or a top-up, to open in a browser."),portal:t("POST",C,F,L,"Stripe's Customer Portal at its home (the card, billing details, invoices) or at a flow (a new card, a change of plan, the plan's cancellation), to open in a browser."),resume:t("POST",x,o,S,"A plan cancelled at its period's end taken up again."),payment:t("GET",R,o,$,"The card charged without the person there, and where Stripe's emails go."),invoices:t("GET",V,o,Q,"The organization's invoices, the latest first, each with its PDF."),topUp:t("POST",B,K.extend({key:e.uuid()}),e.object({credits:e.number()}),"Credits bought with the saved card at once, once by the purchase's key; answers what was added. A browser's session alone.",{key:W}),"autoTopUp/set":t("PUT",A,H,e.union([e.object({on:e.literal(!0)}),e.object({saveCard:e.url()})]),"Auto top-up on, or Stripe Checkout that saves a card first (or another), to open in a browser. A browser's session alone."),"autoTopUp/off":t("DELETE",A,o,s,"Auto top-up off."),"credits/request":t("POST",N,o,e.object({asked:e.literal(!0)}),"The organization's owners and admins asked by email to add credits, at most once a day for each member."),members:t("GET",d,o,Ae,"The members with their limits and spend; a member sees their own row."),"members/limit":t("PUT",`${d}/:userId/limit`,e.strictObject({userId:e.string().min(1)}).extend(ge.shape),s,"A member's limit in credits a month, null for none."),"members/role":t("PUT",`${d}/:userId/role`,e.strictObject({userId:e.string().min(1),role:e.enum(ROLES)}),s,"A member's role; only an owner makes or unmakes an owner."),"members/remove":t("DELETE",`${d}/:userId`,e.strictObject({userId:e.string().min(1)}),s,"A member removed from the team."),invitations:t("GET",INVITATIONS_PATH,o,InvitationsSchema,"The invitations waiting to be accepted."),"invitations/send":t("POST",INVITATIONS_PATH,e.strictObject({email:e.email(),role:e.enum(["member","admin"])}),s,"Invites a person by email; one invited already is sent a new invitation."),"invitations/cancel":t("DELETE",`${INVITATIONS_PATH}/:id`,e.strictObject({id:e.string().min(1)}),s,"An invitation cancelled."),"team/create":t("POST",f,e.strictObject({name:T}),e.object({id:e.string()}),"A new team, the person its owner."),"team/rename":t("PUT",y,e.strictObject({name:T}),s,"The team renamed."),"team/leave":t("POST",LEAVE_PATH,o,s,"The person leaves the team; its last owner cannot."),"team/dissolve":t("DELETE",y,o,s,"The team dissolved by its owner; it can be restored for 30 days."),"team/restore":t("POST",`${f}/:id/restore`,e.strictObject({id:e.string().min(1)}),s,"A dissolved team restored by its owner."),keys:t("GET",KEYS_PATH,o,KeysSchema,"The person's API keys for the organization."),"keys/create":t("POST",KEYS_PATH,e.strictObject({name:T}),e.object({id:e.string(),key:e.string()}),"A new API key; its secret is in this answer alone."),"keys/enable":t("PUT",`${KEYS_PATH}/:id`,e.strictObject({id:e.string().min(1),enabled:e.boolean()}),s,"An API key turned off or on again."),"keys/remove":t("DELETE",`${KEYS_PATH}/:id`,e.strictObject({id:e.string().min(1)}),s,"An API key deleted."),mail:t("GET",he,o,_,"The person's mailbox in the organization: its addresses and settings."),"mail/settings":t("PUT",`${Te}?${de}`,be,_,"The mailbox's display name, whom its agents may write to, and how long it keeps mail."),"mail/messages":t("GET",I,Ee,ue,"The mailbox's messages, newest first."),"mail/message":t("GET",`${I}/:id`,e.strictObject({id:e.string().min(1)}),pe,"One message, read whole."),profile:t("GET",PROFILE_PATH,o,ProfileSchema,"The person's name and email, whether Google signs them in, and AllyHub's previous version while it is open to them."),"profile/set":t("PUT",PROFILE_PATH,e.strictObject({name:T}),s,"The person's name."),storage:t("GET",ae,o,ce,"What the organization keeps in the cloud of what it may."),"storage/projects":t("GET",re,O,le,"A page of the person's projects in the cloud and their cloud Studio's home, the largest first, each with what it alone holds."),"storage/files":t("GET",ne,O,me,"A page of the person's tools' inputs and outputs kept in the cloud, the largest first."),"storage/clear":t("DELETE",ie,o,s,"What the organization keeps that no longer is in use, deleted from the cloud now rather than at the daily sweep."),devices:t("GET",b,o,j,"The computers signed in as the person."),"devices/signOut":t("DELETE",`${b}/:id`,e.strictObject({id:e.string().min(1)}),s,"A computer signed out."),"devices/signOutOthers":t("DELETE",b,o,s,"Every computer signed out but the one that asks."),export:t("GET",v,o,e.record(e.string(),e.unknown()),"Everything kept about the person."),close:t("POST",G,o,s,"Mails the link that deletes the person's account: a browser's session alone, so a computer opens the page in the browser.")};export function accountRequest(i,p){const c=p,l=new Set,r=i.route.replace(/:([A-Za-z]+)/gu,(n,a)=>(l.add(a),encodeURIComponent(String(c[a])))),m=i.headers??{},g=Object.entries(m).flatMap(([n,a])=>{const h=c[n];return typeof h=="string"?[[a,h]]:[]}),u=g.length===0?{}:{headers:Object.fromEntries(g)},E=Object.entries(c).filter(([n,a])=>!l.has(n)&&!(n in m)&&a!==void 0);if(i.http==="GET"||i.http==="DELETE"){const n=E.map(([a,h])=>`${encodeURIComponent(a)}=${encodeURIComponent(String(h))}`).join("&");return{method:i.http,path:n===""?r:`${r}?${n}`,...u}}return E.length===0?{method:i.http,path:r,...u}:{method:i.http,path:r,body:Object.fromEntries(E),...u}}
@@ -41,6 +41,14 @@ export type WindowPage = (typeof WINDOW_PAGES)[number];
41
41
  /** What a person goes to Stripe's Checkout for: a plan, credits, or a card saved for auto top-up. */
42
42
  export declare const CHECKOUT_WHATS: readonly ["plan", "top_up", "card"];
43
43
  export type CheckoutWhat = (typeof CHECKOUT_WHATS)[number];
44
+ /**
45
+ * Why a plan was cancelled (`subscription_canceled`): the reason the
46
+ * person chose in Stripe's billing portal (its `cancellation_details.feedback`
47
+ * words), or `dispute` where a payment's dispute ended it. An open list: a
48
+ * reader leaves a word it does not know as it is.
49
+ */
50
+ export declare const CANCEL_REASONS: readonly ["too_expensive", "missing_features", "switched_service", "unused", "customer_service", "too_complex", "low_quality", "other", "dispute"];
51
+ export type CancelReason = (typeof CANCEL_REASONS)[number];
44
52
  /**
45
53
  * What stopped a person who came back from Stripe's Checkout without
46
54
  * paying, as they answered (`checkout_abandoned`): the price, no payment
@@ -213,6 +221,37 @@ export declare const EVENT_PROPS: {
213
221
  currency: z.ZodOptional<z.ZodString>;
214
222
  country: z.ZodOptional<z.ZodString>;
215
223
  }, z.core.$strict>;
224
+ /** A plan moved to another plan or interval (an upgrade, a downgrade at the period's end, monthly to yearly). Once a change. */
225
+ readonly subscription_changed: z.ZodObject<{
226
+ plan: z.ZodString;
227
+ interval: z.ZodString;
228
+ from_plan: z.ZodString;
229
+ from_interval: z.ZodString;
230
+ }, z.core.$strict>;
231
+ /** A plan was set to end (at its period's end, as the billing portal cancels), with why where the person said. Once a cancellation; one undone and made again is another. */
232
+ readonly subscription_canceled: z.ZodObject<{
233
+ plan: z.ZodString;
234
+ interval: z.ZodString;
235
+ reason: z.ZodOptional<z.ZodString>;
236
+ }, z.core.$strict>;
237
+ /** A plan ended: the organization has it no more. Once a subscription. */
238
+ readonly subscription_ended: z.ZodObject<{
239
+ plan: z.ZodString;
240
+ interval: z.ZodString;
241
+ }, z.core.$strict>;
242
+ /** A plan's new period was paid (Stripe's `subscription_cycle` invoice). Once an invoice. */
243
+ readonly subscription_renewed: z.ZodObject<{
244
+ plan: z.ZodString;
245
+ interval: z.ZodString;
246
+ amount_cents: z.ZodNumber;
247
+ currency: z.ZodString;
248
+ }, z.core.$strict>;
249
+ /** A plan's invoice could not be charged (the card declined, expired): Stripe tries again. Once an attempt. */
250
+ readonly payment_failed: z.ZodObject<{
251
+ plan: z.ZodString;
252
+ interval: z.ZodString;
253
+ attempt: z.ZodNumber;
254
+ }, z.core.$strict>;
216
255
  /** A share was made. */
217
256
  readonly share_made: z.ZodObject<{
218
257
  kind: z.ZodString;
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{z as e}from"zod";import{TURN_MOODS as i,TURN_PURPOSES as d,TURN_TROUBLES as c}from"./purposes.js";export const EVENTS_PATH="/api/events",EVENTS_AT_MOST=100,EventWordSchema=e.string().regex(/^[a-z0-9][a-z0-9_.:-]{0,63}$/u),EventIdSchema=e.string().regex(/^[A-Za-z0-9_-]{1,128}$/u),EventLanguageSchema=e.string().regex(/^[a-z]{2}$/u),EventCountrySchema=e.string().regex(/^[A-Z]{2}$/u),EventTraceIdSchema=e.string().regex(/^[0-9a-f]{32}$/u),EventRouteSchema=e.string().regex(/^(?:\/[A-Za-z0-9_.:*-]{1,64}){1,12}$|^unmatched$/u);const a=e.record(EventWordSchema,e.number().int().min(0).max(1e6)).refine(n=>Object.keys(n).length<=32,"At most 32 words.");export const WINDOW_PRODUCTS=["agents","desktop","cloud"],UPGRADE_PLACES=["sidebar_offer","plan_settings","refusal_card","read_only_chip","paywall"],PAYWALL_TRIGGERS=["refused","reminder","locked"],WINDOW_PAGES=["console_home","cloud_studio","plan_settings"],CHECKOUT_WHATS=["plan","top_up","card"],CHECKOUT_LEFT_REASONS=["price","payment_method","just_looking","other"];const s=e.number().int().min(0).max(10080*60*1e3);export const EVENT_PROPS={program_opened:e.strictObject({os:EventWordSchema,arch:EventWordSchema,where:e.enum(["computer","cloud"])}),project_opened:e.strictObject({fresh:e.boolean(),items:a}),item_opened:e.strictObject({kind:EventWordSchema}),session_started:e.strictObject({agent:EventWordSchema}),turn_started:e.strictObject({agent:EventWordSchema}),turn_finished:e.strictObject({agent:EventWordSchema,durationMs:s,ended:EventWordSchema,changed:a,made:a.optional()}),job_finished:e.strictObject({what:EventWordSchema,about:EventWordSchema,kind:EventWordSchema.optional(),durationMs:s,outcome:e.enum(["done","failed","cancelled"])}),command_ran:e.strictObject({command:EventWordSchema,durationMs:s,exit:e.number().int().min(0).max(255),code:EventWordSchema.optional()}),refusal_shown:e.strictObject({code:EventWordSchema,where:EventWordSchema}),home_product_chosen:e.strictObject({product:e.enum(WINDOW_PRODUCTS)}),item_opened_from_sidebar:e.strictObject({kind:EventWordSchema,extension:EventWordSchema.optional()}),file_downloaded:e.strictObject({kind:EventWordSchema,format:EventWordSchema,paused:e.boolean()}),share_opened:e.strictObject({kind:EventWordSchema}),upgrade_clicked:e.strictObject({where:e.enum(UPGRADE_PLACES)}),page_viewed:e.strictObject({page:e.enum(WINDOW_PAGES)}),paywall_shown:e.strictObject({reason:EventWordSchema,what:EventWordSchema,trigger:e.enum(PAYWALL_TRIGGERS)}),checkout_abandoned:e.strictObject({what:e.enum(CHECKOUT_WHATS),reason:e.enum(CHECKOUT_LEFT_REASONS).optional()}),account_created:e.strictObject({}),refusal_met:e.strictObject({code:EventWordSchema,route:EventRouteSchema,background:e.boolean().optional()}),checkout_started:e.strictObject({what:e.enum(CHECKOUT_WHATS),plan:EventWordSchema.optional(),interval:EventWordSchema.optional()}),checkout_completed:e.strictObject({what:e.enum(["plan","top_up"]),plan:EventWordSchema.optional(),amount_cents:e.number().int().nonnegative().optional(),currency:EventWordSchema.optional()}),checkout_expired:e.strictObject({what:e.enum(CHECKOUT_WHATS),plan:EventWordSchema.optional(),interval:EventWordSchema.optional(),currency:EventWordSchema.optional(),country:EventCountrySchema.optional()}),share_made:e.strictObject({kind:EventWordSchema,audience:EventWordSchema}),studio_opened:e.strictObject({where:e.enum(["computer","cloud"]),first:e.boolean()}),activated:e.strictObject({turns_before:e.number().int().min(0),hours_since_sign_up:e.number().min(0)}),turn_classified:e.strictObject({purpose:e.enum(d),language:EventLanguageSchema.optional(),mood:e.enum(i).optional(),trouble:e.enum(c).optional()})},EVENT_ABOUT={program_opened:"Studio started.",project_opened:"A project was opened in Studio.",item_opened:"A piece was put on show in Studio: its kind (a video, a deck, a doc), never which one.",session_started:"A conversation with an agent began.",turn_started:"A message was sent to an agent: which agent, never what the message says.",turn_finished:"An agent finished answering a message: how long it took, how it ended, how many files it changed of each kind of work and how many pieces of each kind it made.",job_finished:"Work Studio did ended: an export, a publish, an install, a download.",command_ran:"A command of the allyhub CLI ran: its name, how long it took, its exit code and, where it did not succeed, its failure's code.",refusal_shown:"Studio showed that a call needs credits or a plan.",home_product_chosen:"On the console's Home, the action of one of the three ways to use AllyHub was pressed: which way.",item_opened_from_sidebar:"A piece or a file was opened from the sidebar by hand: its kind, and a plain file's extension, never which one.",file_downloaded:"A file was downloaded from Studio's Download: the piece's kind, the file's format, and whether the computer in the cloud was paused.",share_opened:"Studio's Share panel was opened: the piece's kind.",upgrade_clicked:"An upgrade or buy-credits button was pressed: which of a few places it was in.",page_viewed:"One of a few pages was arrived at: the console's Home, AllyHub in the Cloud, or the plan's settings.",paywall_shown:"The dialog that offers plans and credits opened: why AllyHub refused (credits, a plan, storage), what kind of thing it refused, and whether a refusal or its reminder opened it.",checkout_abandoned:"Someone came back from Stripe's payment page without paying: what it was for (a plan, credits, a card) and, when they answered, which of a few reasons stopped them.",account_created:"A person signed up.",refusal_met:"AllyHub's service refused a call for credits, a plan, a limit, a tool turned off or storage, and whether background work made the call.",checkout_started:"A person went to pay.",checkout_completed:"A payment arrived.",checkout_expired:"A payment page was left unpaid until Stripe closed it.",share_made:"A share link was made.",studio_opened:"A person opened AllyHub Studio: the first time, then once a day at most.",activated:"A person's first message an agent answered to its end with something changed or made.",turn_classified:"A message's labels, read by AllyHub's own model: which of a few kinds of work it asked for (research, a document, media, writing…), its language, how the person sounded (pleased, neutral, confused, frustrated) and, when confused or frustrated, about what. Never a word of the message."},CLIENT_EVENTS=["program_opened","project_opened","item_opened","session_started","turn_started","turn_finished","job_finished","command_ran","refusal_shown"],WINDOW_EVENTS=["home_product_chosen","item_opened_from_sidebar","file_downloaded","share_opened","upgrade_clicked","page_viewed","paywall_shown","checkout_abandoned"];const r={id:e.uuid(),at:e.iso.datetime(),projectId:EventIdSchema.optional(),sessionId:EventIdSchema.optional(),traceId:EventTraceIdSchema.optional()},t=n=>e.strictObject({...r,name:e.literal(n),props:EVENT_PROPS[n]});export const ClientEventSchema=e.discriminatedUnion("name",[t("program_opened"),t("project_opened"),t("item_opened"),t("session_started"),t("turn_started"),t("turn_finished"),t("job_finished"),t("command_ran"),t("refusal_shown")]),EventsRequestSchema=e.strictObject({events:e.array(ClientEventSchema).min(1).max(EVENTS_AT_MOST)});const o=n=>e.strictObject({...r,name:e.literal(n),props:EVENT_PROPS[n]});export const WindowEventSchema=e.discriminatedUnion("name",[o("home_product_chosen"),o("item_opened_from_sidebar"),o("file_downloaded"),o("share_opened"),o("upgrade_clicked"),o("page_viewed"),o("paywall_shown"),o("checkout_abandoned")]),WindowEventsRequestSchema=e.strictObject({events:e.array(WindowEventSchema).min(1).max(EVENTS_AT_MOST)}),EventsAnswerSchema=e.object({kept:e.number().int().min(0)});
2
+ import{z as e}from"zod";import{TURN_MOODS as i,TURN_PURPOSES as d,TURN_TROUBLES as c}from"./purposes.js";export const EVENTS_PATH="/api/events",EVENTS_AT_MOST=100,EventWordSchema=e.string().regex(/^[a-z0-9][a-z0-9_.:-]{0,63}$/u),EventIdSchema=e.string().regex(/^[A-Za-z0-9_-]{1,128}$/u),EventLanguageSchema=e.string().regex(/^[a-z]{2}$/u),EventCountrySchema=e.string().regex(/^[A-Z]{2}$/u),EventTraceIdSchema=e.string().regex(/^[0-9a-f]{32}$/u),EventRouteSchema=e.string().regex(/^(?:\/[A-Za-z0-9_.:*-]{1,64}){1,12}$|^unmatched$/u);const a=e.record(EventWordSchema,e.number().int().min(0).max(1e6)).refine(o=>Object.keys(o).length<=32,"At most 32 words.");export const WINDOW_PRODUCTS=["agents","desktop","cloud"],UPGRADE_PLACES=["sidebar_offer","plan_settings","refusal_card","read_only_chip","paywall"],PAYWALL_TRIGGERS=["refused","reminder","locked"],WINDOW_PAGES=["console_home","cloud_studio","plan_settings"],CHECKOUT_WHATS=["plan","top_up","card"],CANCEL_REASONS=["too_expensive","missing_features","switched_service","unused","customer_service","too_complex","low_quality","other","dispute"],CHECKOUT_LEFT_REASONS=["price","payment_method","just_looking","other"];const s=e.number().int().min(0).max(10080*60*1e3);export const EVENT_PROPS={program_opened:e.strictObject({os:EventWordSchema,arch:EventWordSchema,where:e.enum(["computer","cloud"])}),project_opened:e.strictObject({fresh:e.boolean(),items:a}),item_opened:e.strictObject({kind:EventWordSchema}),session_started:e.strictObject({agent:EventWordSchema}),turn_started:e.strictObject({agent:EventWordSchema}),turn_finished:e.strictObject({agent:EventWordSchema,durationMs:s,ended:EventWordSchema,changed:a,made:a.optional()}),job_finished:e.strictObject({what:EventWordSchema,about:EventWordSchema,kind:EventWordSchema.optional(),durationMs:s,outcome:e.enum(["done","failed","cancelled"])}),command_ran:e.strictObject({command:EventWordSchema,durationMs:s,exit:e.number().int().min(0).max(255),code:EventWordSchema.optional()}),refusal_shown:e.strictObject({code:EventWordSchema,where:EventWordSchema}),home_product_chosen:e.strictObject({product:e.enum(WINDOW_PRODUCTS)}),item_opened_from_sidebar:e.strictObject({kind:EventWordSchema,extension:EventWordSchema.optional()}),file_downloaded:e.strictObject({kind:EventWordSchema,format:EventWordSchema,paused:e.boolean()}),share_opened:e.strictObject({kind:EventWordSchema}),upgrade_clicked:e.strictObject({where:e.enum(UPGRADE_PLACES)}),page_viewed:e.strictObject({page:e.enum(WINDOW_PAGES)}),paywall_shown:e.strictObject({reason:EventWordSchema,what:EventWordSchema,trigger:e.enum(PAYWALL_TRIGGERS)}),checkout_abandoned:e.strictObject({what:e.enum(CHECKOUT_WHATS),reason:e.enum(CHECKOUT_LEFT_REASONS).optional()}),account_created:e.strictObject({}),refusal_met:e.strictObject({code:EventWordSchema,route:EventRouteSchema,background:e.boolean().optional()}),checkout_started:e.strictObject({what:e.enum(CHECKOUT_WHATS),plan:EventWordSchema.optional(),interval:EventWordSchema.optional()}),checkout_completed:e.strictObject({what:e.enum(["plan","top_up"]),plan:EventWordSchema.optional(),amount_cents:e.number().int().nonnegative().optional(),currency:EventWordSchema.optional()}),checkout_expired:e.strictObject({what:e.enum(CHECKOUT_WHATS),plan:EventWordSchema.optional(),interval:EventWordSchema.optional(),currency:EventWordSchema.optional(),country:EventCountrySchema.optional()}),subscription_changed:e.strictObject({plan:EventWordSchema,interval:EventWordSchema,from_plan:EventWordSchema,from_interval:EventWordSchema}),subscription_canceled:e.strictObject({plan:EventWordSchema,interval:EventWordSchema,reason:EventWordSchema.optional()}),subscription_ended:e.strictObject({plan:EventWordSchema,interval:EventWordSchema}),subscription_renewed:e.strictObject({plan:EventWordSchema,interval:EventWordSchema,amount_cents:e.number().int().nonnegative(),currency:EventWordSchema}),payment_failed:e.strictObject({plan:EventWordSchema,interval:EventWordSchema,attempt:e.number().int().min(1)}),share_made:e.strictObject({kind:EventWordSchema,audience:EventWordSchema}),studio_opened:e.strictObject({where:e.enum(["computer","cloud"]),first:e.boolean()}),activated:e.strictObject({turns_before:e.number().int().min(0),hours_since_sign_up:e.number().min(0)}),turn_classified:e.strictObject({purpose:e.enum(d),language:EventLanguageSchema.optional(),mood:e.enum(i).optional(),trouble:e.enum(c).optional()})},EVENT_ABOUT={program_opened:"Studio started.",project_opened:"A project was opened in Studio.",item_opened:"A piece was put on show in Studio: its kind (a video, a deck, a doc), never which one.",session_started:"A conversation with an agent began.",turn_started:"A message was sent to an agent: which agent, never what the message says.",turn_finished:"An agent finished answering a message: how long it took, how it ended, how many files it changed of each kind of work and how many pieces of each kind it made.",job_finished:"Work Studio did ended: an export, a publish, an install, a download.",command_ran:"A command of the allyhub CLI ran: its name, how long it took, its exit code and, where it did not succeed, its failure's code.",refusal_shown:"Studio showed that a call needs credits or a plan.",home_product_chosen:"On the console's Home, the action of one of the three ways to use AllyHub was pressed: which way.",item_opened_from_sidebar:"A piece or a file was opened from the sidebar by hand: its kind, and a plain file's extension, never which one.",file_downloaded:"A file was downloaded from Studio's Download: the piece's kind, the file's format, and whether the computer in the cloud was paused.",share_opened:"Studio's Share panel was opened: the piece's kind.",upgrade_clicked:"An upgrade or buy-credits button was pressed: which of a few places it was in.",page_viewed:"One of a few pages was arrived at: the console's Home, AllyHub in the Cloud, or the plan's settings.",paywall_shown:"The dialog that offers plans and credits opened: why AllyHub refused (credits, a plan, storage), what kind of thing it refused, and whether a refusal or its reminder opened it.",checkout_abandoned:"Someone came back from Stripe's payment page without paying: what it was for (a plan, credits, a card) and, when they answered, which of a few reasons stopped them.",account_created:"A person signed up.",refusal_met:"AllyHub's service refused a call for credits, a plan, a limit, a tool turned off or storage, and whether background work made the call.",checkout_started:"A person went to pay.",checkout_completed:"A payment arrived.",checkout_expired:"A payment page was left unpaid until Stripe closed it.",subscription_changed:"A plan moved to another plan or between monthly and yearly.",subscription_canceled:"A plan was set to end, and the reason the person chose for it, when they chose one.",subscription_ended:"A plan ended.",subscription_renewed:"A plan's new period was paid.",payment_failed:"A plan's payment could not be charged.",share_made:"A share link was made.",studio_opened:"A person opened AllyHub Studio: the first time, then once a day at most.",activated:"A person's first message an agent answered to its end with something changed or made.",turn_classified:"A message's labels, read by AllyHub's own model: which of a few kinds of work it asked for (research, a document, media, writing…), its language, how the person sounded (pleased, neutral, confused, frustrated) and, when confused or frustrated, about what. Never a word of the message."},CLIENT_EVENTS=["program_opened","project_opened","item_opened","session_started","turn_started","turn_finished","job_finished","command_ran","refusal_shown"],WINDOW_EVENTS=["home_product_chosen","item_opened_from_sidebar","file_downloaded","share_opened","upgrade_clicked","page_viewed","paywall_shown","checkout_abandoned"];const r={id:e.uuid(),at:e.iso.datetime(),projectId:EventIdSchema.optional(),sessionId:EventIdSchema.optional(),traceId:EventTraceIdSchema.optional()},t=o=>e.strictObject({...r,name:e.literal(o),props:EVENT_PROPS[o]});export const ClientEventSchema=e.discriminatedUnion("name",[t("program_opened"),t("project_opened"),t("item_opened"),t("session_started"),t("turn_started"),t("turn_finished"),t("job_finished"),t("command_ran"),t("refusal_shown")]),EventsRequestSchema=e.strictObject({events:e.array(ClientEventSchema).min(1).max(EVENTS_AT_MOST)});const n=o=>e.strictObject({...r,name:e.literal(o),props:EVENT_PROPS[o]});export const WindowEventSchema=e.discriminatedUnion("name",[n("home_product_chosen"),n("item_opened_from_sidebar"),n("file_downloaded"),n("share_opened"),n("upgrade_clicked"),n("page_viewed"),n("paywall_shown"),n("checkout_abandoned")]),WindowEventsRequestSchema=e.strictObject({events:e.array(WindowEventSchema).min(1).max(EVENTS_AT_MOST)}),EventsAnswerSchema=e.object({kept:e.number().int().min(0)});
@@ -210,6 +210,9 @@ export declare const FRAME_NOTIFICATIONS: {
210
210
  item: z.ZodString;
211
211
  place: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
212
212
  }, z.core.$strict>>;
213
+ readonly "item/open": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{
214
+ item: z.ZodString;
215
+ }, z.core.$strict>>;
213
216
  readonly "export/state": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{
214
217
  at: z.ZodEnum<{
215
218
  done: "done";
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{z as e}from"zod";import{EDITOR_STATES as a,EditorModeSchema as n,ExportStateSchema as h,PlaceSchema as c,ThemeSchema as d}from"./editor.js";import{AgentHereSchema as m}from"./presence.js";import{PathSchema as p}from"./files.js";import{method as o,notification as t}from"./jsonrpc.js";import{HeldSchema as w,NoteFoundSchema as l,NotePickSchema as s,NotePictureSchema as g,NotePointSchema as f,NoteRectSchema as r,NoteShapeSchema as b}from"./notes.js";const i=e.strictObject({connection:e.string().min(1),message:e.unknown()});export const FRAME_METHODS={"note/hold":o(e.strictObject({selection:e.boolean().optional()}),w.extend({selected:e.array(s).optional()}),"Holds what moves by itself while the person marks a picture of it; says what is on show, and with `selection` what is selected in it."),"note/locate":o(e.strictObject({shape:b}),l,"What a mark is on: the editor's answer and every inset's under it, innermost first. Empty is an answer: the mark's place still goes."),"note/pick":o(e.strictObject({at:f}),e.strictObject({pick:s.optional()}),"The one thing in front at a point, with its edge: the innermost inset's under it that answers, else the editor's. None is an answer."),"note/pictures":o(e.strictObject({}),e.strictObject({pictures:e.array(g),uncovered:e.array(e.strictObject({name:e.string(),rect:r}))}),"The page as it shows now, drawn without the window's marks, then its insets' pictures, each at its rect, outermost first."),"note/release":o(e.strictObject({}),e.strictObject({}),"The person is done marking. Nothing starts by itself.")},WINDOW_NOTIFICATIONS={"editor/command":t(e.strictObject({command:e.string().min(1),open:e.boolean().optional()}),"A shortcut the window took, its header's Export or its agent's name, or a command of the editor's extension, for the editor to do as its own."),"editor/upstream":t(e.discriminatedUnion("from",[e.strictObject({from:e.literal("snapshot"),root:e.url()}),e.strictObject({from:e.literal("window"),connection:e.string().min(1)})]),"Where the page reads and writes from now: a read view, or the project's server through the window. Each is a new upstream: the page makes its watches again there and its editor takes what differs as a change on disk."),"editor/context":t(e.strictObject({mode:n,theme:d}),"The editor's mode and the theme the window draws in, as they are now: the page's editor hears them as its host's context and changes where it stands."),"editor/message":t(i,"A message of the project's server for the page.")},FRAME_NOTIFICATIONS={"editor/ready":t(e.strictObject({}),"The page is loaded: the window tells it its upstream and its context."),"editor/send":t(i,"A message of the page for the project's server."),"note/ready":t(e.strictObject({}),"The page's editor has given its surface: the page answers notes."),"note/gone":t(e.strictObject({}),"The page no longer answers notes: its editor went, or the page goes."),"window/key":t(e.strictObject({key:e.string(),code:e.string(),meta:e.boolean(),ctrl:e.boolean(),shift:e.boolean(),alt:e.boolean()}),"A key with ⌘ or Ctrl pressed in the page that its editor did not take: the window's shortcut (⌘⇧M, ⌘K), heard where the keys are in the page. A desktop shell's menu hears them itself, so a page framed there tells none."),"agent/ask":t(e.strictObject({text:e.string().min(1)}),"Words the editor puts before the person's agent, for them to go on and send."),"note/begin":t(e.strictObject({from:r.optional(),selection:e.boolean().optional()}),"The person asked for Mark up from the editor: the window shows its tools, or with `selection` begins with what is selected marked; `from` is what they pressed, in the page's viewport."),"share/begin":t(e.strictObject({}),"The person asked to share the item on show."),"edit/request":t(e.strictObject({}),"The person pressed an Edit of the page's own on a read-only page, or the page needs the machine for what they asked: the window wakes it. Never for a key pressed in the item."),"editor/place":t(e.strictObject({item:p,place:c}),"Where the person is in an item, as its editor says it, so the window opens it there again; the window keeps it unread."),"export/state":t(h,"How the item's exports go, for its Export button in the window's header."),"editor/state":t(e.strictObject({state:e.enum(a),message:e.string().optional()}),"Whether what the person typed is saved, for the window's header."),"agent/here":t(m,"The project's agent in the item on show and whether its editor follows it, for the window's header; its button asks back with `editor/command`'s `follow` or `unfollow`.")};
2
+ import{z as e}from"zod";import{EDITOR_STATES as a,EditorModeSchema as h,ExportStateSchema as c,PlaceSchema as d,ThemeSchema as m}from"./editor.js";import{AgentHereSchema as p}from"./presence.js";import{PathSchema as s}from"./files.js";import{method as o,notification as t}from"./jsonrpc.js";import{HeldSchema as w,NoteFoundSchema as l,NotePickSchema as i,NotePictureSchema as g,NotePointSchema as f,NoteRectSchema as r,NoteShapeSchema as b}from"./notes.js";const n=e.strictObject({connection:e.string().min(1),message:e.unknown()});export const FRAME_METHODS={"note/hold":o(e.strictObject({selection:e.boolean().optional()}),w.extend({selected:e.array(i).optional()}),"Holds what moves by itself while the person marks a picture of it; says what is on show, and with `selection` what is selected in it."),"note/locate":o(e.strictObject({shape:b}),l,"What a mark is on: the editor's answer and every inset's under it, innermost first. Empty is an answer: the mark's place still goes."),"note/pick":o(e.strictObject({at:f}),e.strictObject({pick:i.optional()}),"The one thing in front at a point, with its edge: the innermost inset's under it that answers, else the editor's. None is an answer."),"note/pictures":o(e.strictObject({}),e.strictObject({pictures:e.array(g),uncovered:e.array(e.strictObject({name:e.string(),rect:r}))}),"The page as it shows now, drawn without the window's marks, then its insets' pictures, each at its rect, outermost first."),"note/release":o(e.strictObject({}),e.strictObject({}),"The person is done marking. Nothing starts by itself.")},WINDOW_NOTIFICATIONS={"editor/command":t(e.strictObject({command:e.string().min(1),open:e.boolean().optional()}),"A shortcut the window took, its header's Export or its agent's name, or a command of the editor's extension, for the editor to do as its own."),"editor/upstream":t(e.discriminatedUnion("from",[e.strictObject({from:e.literal("snapshot"),root:e.url()}),e.strictObject({from:e.literal("window"),connection:e.string().min(1)})]),"Where the page reads and writes from now: a read view, or the project's server through the window. Each is a new upstream: the page makes its watches again there and its editor takes what differs as a change on disk."),"editor/context":t(e.strictObject({mode:h,theme:m}),"The editor's mode and the theme the window draws in, as they are now: the page's editor hears them as its host's context and changes where it stands."),"editor/message":t(n,"A message of the project's server for the page.")},FRAME_NOTIFICATIONS={"editor/ready":t(e.strictObject({}),"The page is loaded: the window tells it its upstream and its context."),"editor/send":t(n,"A message of the page for the project's server."),"note/ready":t(e.strictObject({}),"The page's editor has given its surface: the page answers notes."),"note/gone":t(e.strictObject({}),"The page no longer answers notes: its editor went, or the page goes."),"window/key":t(e.strictObject({key:e.string(),code:e.string(),meta:e.boolean(),ctrl:e.boolean(),shift:e.boolean(),alt:e.boolean()}),"A key with ⌘ or Ctrl pressed in the page that its editor did not take: the window's shortcut (⌘⇧M, ⌘K), heard where the keys are in the page. A desktop shell's menu hears them itself, so a page framed there tells none."),"agent/ask":t(e.strictObject({text:e.string().min(1)}),"Words the editor puts before the person's agent, for them to go on and send."),"note/begin":t(e.strictObject({from:r.optional(),selection:e.boolean().optional()}),"The person asked for Mark up from the editor: the window shows its tools, or with `selection` begins with what is selected marked; `from` is what they pressed, in the page's viewport."),"share/begin":t(e.strictObject({}),"The person asked to share the item on show."),"edit/request":t(e.strictObject({}),"The person pressed an Edit of the page's own on a read-only page, or the page needs the machine for what they asked: the window wakes it. Never for a key pressed in the item."),"editor/place":t(e.strictObject({item:s,place:d}),"Where the person is in an item, as its editor says it, so the window opens it there again; the window keeps it unread."),"item/open":t(e.strictObject({item:s}),"The person opened another item of the project from the editor (an embed's Open, a link to an item): the window opens it as its list would, so its header and list follow."),"export/state":t(c,"How the item's exports go, for its Export button in the window's header."),"editor/state":t(e.strictObject({state:e.enum(a),message:e.string().optional()}),"Whether what the person typed is saved, for the window's header."),"agent/here":t(p,"The project's agent in the item on show and whether its editor follows it, for the window's header; its button asks back with `editor/command`'s `follow` or `unfollow`.")};
@@ -60,8 +60,38 @@ export declare const ListedKindSchema: z.ZodObject<{
60
60
  files: z.ZodRecord<z.ZodString, z.ZodString>;
61
61
  entry: z.ZodString;
62
62
  }, z.core.$strip>>;
63
+ order: z.ZodOptional<z.ZodNumber>;
64
+ turnInto: z.ZodOptional<z.ZodBoolean>;
63
65
  }, z.core.$strip>;
64
66
  export type ListedKind = z.infer<typeof ListedKindSchema>;
67
+ /** A kind the project's extensions contribute, by its id, as a listing of its items gives it (`project/items`' `kinds`). */
68
+ export declare const ProjectKindSchema: z.ZodObject<{
69
+ noun: z.ZodString;
70
+ icon: z.ZodOptional<z.ZodString>;
71
+ color: z.ZodOptional<z.ZodString>;
72
+ editor: z.ZodOptional<z.ZodString>;
73
+ exports: z.ZodOptional<z.ZodObject<{
74
+ types: z.ZodArray<z.ZodString>;
75
+ extras: z.ZodArray<z.ZodString>;
76
+ options: z.ZodArray<z.ZodObject<{
77
+ name: z.ZodString;
78
+ only: z.ZodArray<z.ZodString>;
79
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
80
+ }, z.core.$strip>>;
81
+ names: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
82
+ }, z.core.$strip>>;
83
+ share: z.ZodOptional<z.ZodBoolean>;
84
+ name: z.ZodRecord<z.ZodString, z.ZodString>;
85
+ plural: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
86
+ starter: z.ZodOptional<z.ZodObject<{
87
+ files: z.ZodRecord<z.ZodString, z.ZodString>;
88
+ entry: z.ZodString;
89
+ }, z.core.$strip>>;
90
+ order: z.ZodOptional<z.ZodNumber>;
91
+ turnInto: z.ZodOptional<z.ZodBoolean>;
92
+ id: z.ZodString;
93
+ }, z.core.$strip>;
94
+ export type ProjectKind = z.infer<typeof ProjectKindSchema>;
65
95
  /** A kind of the kind table as a listing gives it to page code. */
66
96
  export declare function listedKind(spec: KindSpec): ListedKind;
67
97
  /**
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{z as r}from"zod";const m=r.object({name:r.string().min(1),only:r.array(r.string().min(1)),values:r.array(r.string().min(1)).optional()});export const ExportOfferSchema=r.object({types:r.array(r.string().min(1)),extras:r.array(r.string().min(1)),options:r.array(m),names:r.record(r.string(),r.record(r.string(),r.string())).optional()});const u={noun:r.string().min(1),icon:r.string().min(1).optional(),color:r.string().min(1).optional(),editor:r.string().min(1).optional(),exports:ExportOfferSchema.optional(),share:r.boolean().optional()};export const KindInfoSchema=r.object({name:r.string().min(1),...u}),ListedKindSchema=r.object({name:r.record(r.string(),r.string().min(1)),plural:r.record(r.string(),r.string().min(1)).optional(),starter:r.object({files:r.record(r.string().min(1),r.string()),entry:r.string().min(1)}).optional(),...u});export function listedKind(n){return{name:n.name??{en:n.noun},...n.plural===void 0?{}:{plural:{...n.plural}},...n.starter===void 0?{}:{starter:{files:{...n.starter.files},entry:n.starter.entry}},noun:n.noun,...n.icon===void 0?{}:{icon:n.icon},...n.color===void 0?{}:{color:n.color},...n.editor===void 0?{}:{editor:n.editor},...n.exports===void 0?{}:{exports:{types:[...n.exports.types],extras:[...n.exports.extras],options:n.exports.options.map(o=>({name:o.name,only:[...o.only],...o.values===void 0?{}:{values:[...o.values]}})),...n.exports.names===void 0?{}:{names:Object.fromEntries(Object.entries(n.exports.names).map(([o,e])=>[o,{...e}]))}}},...n.share===void 0?{}:{share:n.share}}}export function listedFileEditor(n){return{name:{...n.name},...n.plural===void 0?{}:{plural:{...n.plural}},noun:n.noun,...n.icon===void 0?{}:{icon:n.icon},...n.color===void 0?{}:{color:n.color},editor:n.id}}export const kindNameIn=(n,o)=>n.name[o]??n.name.en??n.noun,kindPluralIn=(n,o)=>n.plural?.[o]??n.plural?.en??kindNameIn(n,o);const s=/\.(ya?ml|json)$/u;export function starterFiles(n,o,e,i){const a=t=>t.replaceAll("{{locale}}",e).replaceAll("{{name}}",i);return{files:Object.entries(n.files).map(([t,d])=>{const l=a(t),f=s.test(l)?JSON.stringify(o):o;return{path:l,text:d.replaceAll("{{locale}}",e).replaceAll("{{name}}",i).replaceAll("{{title}}",()=>f)}}),entry:a(n.entry)}}export function kindInfoIn(n,o,e){return o===void 0?{name:n??"file",noun:n??"file"}:{name:kindNameIn(o,e),noun:o.noun,...o.icon===void 0?{}:{icon:o.icon},...o.color===void 0?{}:{color:o.color},...o.editor===void 0?{}:{editor:o.editor},...o.exports===void 0?{}:{exports:o.exports},...o.share===void 0?{}:{share:o.share}}}export function downloadOffered(n){return n.kindInfo?.exports!==void 0?"formats":n.kind===void 0?"file as it is":"nothing"}
2
+ import{z as r}from"zod";const m=r.object({name:r.string().min(1),only:r.array(r.string().min(1)),values:r.array(r.string().min(1)).optional()});export const ExportOfferSchema=r.object({types:r.array(r.string().min(1)),extras:r.array(r.string().min(1)),options:r.array(m),names:r.record(r.string(),r.record(r.string(),r.string())).optional()});const d={noun:r.string().min(1),icon:r.string().min(1).optional(),color:r.string().min(1).optional(),editor:r.string().min(1).optional(),exports:ExportOfferSchema.optional(),share:r.boolean().optional()};export const KindInfoSchema=r.object({name:r.string().min(1),...d}),ListedKindSchema=r.object({name:r.record(r.string(),r.string().min(1)),plural:r.record(r.string(),r.string().min(1)).optional(),starter:r.object({files:r.record(r.string().min(1),r.string()),entry:r.string().min(1)}).optional(),order:r.number().optional(),turnInto:r.boolean().optional(),...d}),ProjectKindSchema=ListedKindSchema.extend({id:r.string().min(1)});export function listedKind(n){return{name:n.name??{en:n.noun},...n.plural===void 0?{}:{plural:{...n.plural}},...n.starter===void 0?{}:{starter:{files:{...n.starter.files},entry:n.starter.entry}},...n.order===void 0?{}:{order:n.order},...n.turnInto===!1?{turnInto:!1}:{},noun:n.noun,...n.icon===void 0?{}:{icon:n.icon},...n.color===void 0?{}:{color:n.color},...n.editor===void 0?{}:{editor:n.editor},...n.exports===void 0?{}:{exports:{types:[...n.exports.types],extras:[...n.exports.extras],options:n.exports.options.map(o=>({name:o.name,only:[...o.only],...o.values===void 0?{}:{values:[...o.values]}})),...n.exports.names===void 0?{}:{names:Object.fromEntries(Object.entries(n.exports.names).map(([o,e])=>[o,{...e}]))}}},...n.share===void 0?{}:{share:n.share}}}export function listedFileEditor(n){return{name:{...n.name},...n.plural===void 0?{}:{plural:{...n.plural}},noun:n.noun,...n.icon===void 0?{}:{icon:n.icon},...n.color===void 0?{}:{color:n.color},editor:n.id}}export const kindNameIn=(n,o)=>n.name[o]??n.name.en??n.noun,kindPluralIn=(n,o)=>n.plural?.[o]??n.plural?.en??kindNameIn(n,o);const s=/\.(ya?ml|json)$/u;export function starterFiles(n,o,e,i){const a=t=>t.replaceAll("{{locale}}",e).replaceAll("{{name}}",i);return{files:Object.entries(n.files).map(([t,u])=>{const l=a(t),f=s.test(l)?JSON.stringify(o):o;return{path:l,text:u.replaceAll("{{locale}}",e).replaceAll("{{name}}",i).replaceAll("{{title}}",()=>f)}}),entry:a(n.entry)}}export function kindInfoIn(n,o,e){return o===void 0?{name:n??"file",noun:n??"file"}:{name:kindNameIn(o,e),noun:o.noun,...o.icon===void 0?{}:{icon:o.icon},...o.color===void 0?{}:{color:o.color},...o.editor===void 0?{}:{editor:o.editor},...o.exports===void 0?{}:{exports:o.exports},...o.share===void 0?{}:{share:o.share}}}export function downloadOffered(n){return n.kindInfo?.exports!==void 0?"formats":n.kind===void 0?"file as it is":"nothing"}
@@ -141,6 +141,8 @@ export declare const PROJECT_TOOLS: {
141
141
  files: z.ZodRecord<z.ZodString, z.ZodString>;
142
142
  entry: z.ZodString;
143
143
  }, z.core.$strip>>;
144
+ order: z.ZodOptional<z.ZodNumber>;
145
+ turnInto: z.ZodOptional<z.ZodBoolean>;
144
146
  }, z.core.$strip>>;
145
147
  }, z.core.$strict>>;
146
148
  kinds: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -165,6 +167,8 @@ export declare const PROJECT_TOOLS: {
165
167
  files: z.ZodRecord<z.ZodString, z.ZodString>;
166
168
  entry: z.ZodString;
167
169
  }, z.core.$strip>>;
170
+ order: z.ZodOptional<z.ZodNumber>;
171
+ turnInto: z.ZodOptional<z.ZodBoolean>;
168
172
  id: z.ZodString;
169
173
  }, z.core.$strip>>>;
170
174
  name: z.ZodString;
@@ -203,6 +207,8 @@ export declare const PROJECT_TOOLS: {
203
207
  files: z.ZodRecord<z.ZodString, z.ZodString>;
204
208
  entry: z.ZodString;
205
209
  }, z.core.$strip>>;
210
+ order: z.ZodOptional<z.ZodNumber>;
211
+ turnInto: z.ZodOptional<z.ZodBoolean>;
206
212
  }, z.core.$strip>>;
207
213
  }, z.core.$strict>;
208
214
  }, z.core.$strict>>;
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{z as e}from"zod";import{FolderSchema as n,PathSchema as t}from"./files.js";import{JobSchema as d}from"./jobs.js";import{PreviewSchema as h}from"./app.js";import{ListedKindSchema as a}from"./kinds.js";import{RPC_ERROR as g,RpcError as b,method as s,notification as o}from"./jsonrpc.js";export const VersionRef={item:t,version:e.string().optional()};export{ImageSchema}from"./image.js";export const ProblemSchema=e.looseObject({code:e.string(),level:e.enum(["error","warn"]),message:e.string(),piece:e.string().optional(),part:e.string().optional(),t:e.number().optional()}),FactSchema=e.looseObject({kind:e.string(),data:e.unknown()}),CHECK_STATES=["off","waiting","running","done","failed"],CheckStateSchema=e.strictObject({status:e.enum(CHECK_STATES),revision:e.int().nonnegative(),problems:e.array(ProblemSchema),facts:e.array(FactSchema),versions:e.strictObject({total:e.int(),loaded:e.int(),reused:e.int()}).optional(),error:e.string().optional()}),EXPORT_STATES=["queued","running","done","failed","cancelled"],ExportOptionsSchema=e.record(e.string(),e.union([e.string(),e.boolean()])),ExportJobSchema=e.strictObject({id:e.string(),item:t,versions:e.array(e.string()),types:e.array(e.string()),options:ExportOptionsSchema.optional(),state:e.enum(EXPORT_STATES),progress:e.number().min(0).max(1),files:e.array(t),error:e.string().optional()}),IndexJobSchema=e.strictObject({file:t,status:e.enum(["running","done","failed"]),message:e.string(),share:e.number().min(0).max(1).optional()}),FramedPageSchema=e.strictObject({url:e.string(),probe:e.string()}),COMPONENT_STILLS_MAX=64,PROJECT_TOOLS={"project/items":s(e.strictObject({}),e.strictObject({items:e.array(e.strictObject({id:t,kind:e.string().min(1).optional(),dir:n,entry:t,title:e.string().optional(),groups:e.array(e.string()),files:e.array(e.object({path:e.string().min(1),role:e.string().min(1).optional()})).optional(),kindInfo:a.optional()})),kinds:e.array(a.extend({id:e.string().min(1)})).optional(),name:e.string(),scope:e.string(),revision:e.int().nonnegative()}),"The project's items, as its list (allyhub.yaml) names them, in its order: each a file of a kind, or a file an editor opens by its name."),"project/file":s(e.strictObject({path:t}),e.strictObject({item:e.strictObject({id:t,kind:e.string().min(1).optional(),dir:n,entry:t,title:e.string().optional(),groups:e.array(e.string()),kindInfo:a.optional()})}),"A file of the project as it opens in an editor, whether the list names it or not: the item it is, else the file in the editor that opens it by its name (an `editors` contribution's `files`); not found for a file that is not there or that no editor opens."),"items/preview":s(e.strictObject({item:t}),e.strictObject({preview:h.optional()}),"What an item looks like (named by its id or its file), as its kind's provider makes it from its files now (a video's still, an image's boards, a deck's slide, a doc's first paragraphs, a sheet's first rows); none where its kind gives none."),"items/page":s(e.strictObject({item:t,folder:n.optional(),file:t.optional()}),e.strictObject({url:e.string()}),"The address of an item's page, for a frame (a report's page, a website built as files): `folder` served as the root of an origin of its own, the project's files alone (no other address loads), every file the page loads recorded as the item's input, so the item's editors hear `items/changed` when one changes."),"work/add":s(e.strictObject({kind:e.string().min(1),file:t,title:e.string().min(1).optional()}),e.strictObject({}),"Adds a piece to the end of the project's list (allyhub.yaml), the rest of it as it was; nothing when its file is listed already."),"components/list":s(e.strictObject({item:t}),e.strictObject({components:e.array(e.strictObject({of:e.string(),name:e.string(),label:e.union([e.string(),e.record(e.string(),e.string())]).optional()}))}),"The components an item may place: every one the project's files define, by the reference it would write."),"components/stage":s(e.strictObject(VersionRef),FramedPageSchema,"The address of a page that draws an item's components one at a time, for a sandboxed frame (docs/design/components-everywhere.md): a deck's by the name its module gives it, a doc's by the reference its block writes. Its parent posts `{ type: \"component\", name, props, width, height, t }` and hears `component-ready`, or `error` with what went wrong."),"components/stills":s(e.strictObject({...VersionRef,components:e.array(e.strictObject({name:e.string(),props:e.record(e.string(),e.unknown()),width:e.number().positive(),height:e.number().positive(),t:e.number().nonnegative()})).min(1).max(COMPONENT_STILLS_MAX)}),e.strictObject({stills:e.array(e.strictObject({key:e.string(),url:e.url()}).nullable())}),"An item's components (a deck's, a doc's) drawn alone, transparent, as the render draws them: pictures kept by what they show, given as addresses."),"check/results":s(e.strictObject({}),CheckStateSchema,"The check run after edits, as it stands."),"check/run":s(e.strictObject({}),e.strictObject({}),"Runs the check again now."),"export/start":s(e.strictObject({item:t,versions:e.array(e.string()).optional(),types:e.array(e.string().min(1)).max(10).optional(),options:ExportOptionsSchema.optional()}),e.strictObject({job:ExportJobSchema}),"Exports an item (its versions, as file types) into .allyhub/out/; `export/changed` says how it goes."),"export/cancel":s(e.strictObject({job:e.string()}),e.strictObject({}),"Stops an export."),"export/list":s(e.strictObject({}),e.strictObject({jobs:e.array(ExportJobSchema),reveal:e.boolean()}),"The exports asked for since the server started."),"export/reveal":s(e.strictObject({path:t}),e.strictObject({}),"Shows an exported file in the person's file manager, where the server runs on their computer (`export/list`'s `reveal`).")},PROJECT_TOOL_SOURCES={"project/items":"project","project/file":"asleep","items/preview":"asleep","items/page":"asleep","work/add":"machine","components/list":"asleep","components/stage":"asleep","components/stills":"project","check/results":"project","check/run":"machine","export/start":"machine","export/cancel":"machine","export/list":"asleep","export/reveal":"machine"},AGENT_DOES={"project/items":{files:"allyhub.yaml"},"project/file":{files:"the project's files"},"items/preview":{command:"frames"},"items/page":{command:"frames"},"work/add":{files:"allyhub.yaml"},"components/list":{files:"the project's components (defineComponent)"},"components/stage":{command:"frames"},"components/stills":{command:"frames"},"check/results":{command:"inspect"},"check/run":{command:"check"},"export/start":{command:"render"},"export/cancel":{command:"render"},"export/list":{files:".allyhub/out/"},"export/reveal":{files:".allyhub/out/"}};export function toolSpec(r){return Object.hasOwn(PROJECT_TOOLS,r)?PROJECT_TOOLS[r]:void 0}export function toolCaller(r){return async(p,i,l)=>{const{result:m}=await p["tools/call"]({name:i,arguments:l}),c=r[i]?.result.safeParse(m);if(!c?.success)throw new b(g.internal,`The answer to the tool ${i} is not what the protocol says.`);return c.data}}export const TOOL_NOTIFICATIONS={"project/changed":o(e.strictObject({revision:e.int().nonnegative()}),"The build saw a change: a stage or a timeline asked for now is the new one's."),"items/changed":o(e.strictObject({item:t,paths:e.array(e.string())}),`One of an item's inputs changed (docs/design/item-files.md, "An item's inputs"): a file its build lists, or one its pages loaded.`),"check/changed":o(CheckStateSchema,"The check started, ended or failed."),"export/changed":o(e.strictObject({job:ExportJobSchema}),"An export moved on."),"index/changed":o(e.strictObject({jobs:e.array(IndexJobSchema)}),"Making what the media index lacks moved on."),"jobs/changed":o(e.strictObject({job:d,item:t}),"A job of the process the server runs in (docs/design/jobs.md: a website starting, an export) moved on, about a thing in this project: what the window lists, for the editor of that thing to show where the person waits on it.")};
2
+ import{z as e}from"zod";import{FolderSchema as n,PathSchema as t}from"./files.js";import{JobSchema as d}from"./jobs.js";import{PreviewSchema as h}from"./app.js";import{ListedKindSchema as c,ProjectKindSchema as g}from"./kinds.js";import{RPC_ERROR as b,RpcError as f,method as s,notification as o}from"./jsonrpc.js";export const VersionRef={item:t,version:e.string().optional()};export{ImageSchema}from"./image.js";export const ProblemSchema=e.looseObject({code:e.string(),level:e.enum(["error","warn"]),message:e.string(),piece:e.string().optional(),part:e.string().optional(),t:e.number().optional()}),FactSchema=e.looseObject({kind:e.string(),data:e.unknown()}),CHECK_STATES=["off","waiting","running","done","failed"],CheckStateSchema=e.strictObject({status:e.enum(CHECK_STATES),revision:e.int().nonnegative(),problems:e.array(ProblemSchema),facts:e.array(FactSchema),versions:e.strictObject({total:e.int(),loaded:e.int(),reused:e.int()}).optional(),error:e.string().optional()}),EXPORT_STATES=["queued","running","done","failed","cancelled"],ExportOptionsSchema=e.record(e.string(),e.union([e.string(),e.boolean()])),ExportJobSchema=e.strictObject({id:e.string(),item:t,versions:e.array(e.string()),types:e.array(e.string()),options:ExportOptionsSchema.optional(),state:e.enum(EXPORT_STATES),progress:e.number().min(0).max(1),files:e.array(t),error:e.string().optional()}),IndexJobSchema=e.strictObject({file:t,status:e.enum(["running","done","failed"]),message:e.string(),share:e.number().min(0).max(1).optional()}),FramedPageSchema=e.strictObject({url:e.string(),probe:e.string()}),COMPONENT_STILLS_MAX=64,PROJECT_TOOLS={"project/items":s(e.strictObject({}),e.strictObject({items:e.array(e.strictObject({id:t,kind:e.string().min(1).optional(),dir:n,entry:t,title:e.string().optional(),groups:e.array(e.string()),files:e.array(e.object({path:e.string().min(1),role:e.string().min(1).optional()})).optional(),kindInfo:c.optional()})),kinds:e.array(g).optional(),name:e.string(),scope:e.string(),revision:e.int().nonnegative()}),"The project's items, as its list (allyhub.yaml) names them, in its order: each a file of a kind, or a file an editor opens by its name."),"project/file":s(e.strictObject({path:t}),e.strictObject({item:e.strictObject({id:t,kind:e.string().min(1).optional(),dir:n,entry:t,title:e.string().optional(),groups:e.array(e.string()),kindInfo:c.optional()})}),"A file of the project as it opens in an editor, whether the list names it or not: the item it is, else the file in the editor that opens it by its name (an `editors` contribution's `files`); not found for a file that is not there or that no editor opens."),"items/preview":s(e.strictObject({item:t}),e.strictObject({preview:h.optional()}),"What an item looks like (named by its id or its file), as its kind's provider makes it from its files now (a video's still, an image's boards, a deck's slide, a doc's first paragraphs, a sheet's first rows); none where its kind gives none."),"items/page":s(e.strictObject({item:t,folder:n.optional(),file:t.optional()}),e.strictObject({url:e.string()}),"The address of an item's page, for a frame (a report's page, a website built as files): `folder` served as the root of an origin of its own, the project's files alone (no other address loads), every file the page loads recorded as the item's input, so the item's editors hear `items/changed` when one changes."),"work/add":s(e.strictObject({kind:e.string().min(1),file:t,title:e.string().min(1).optional()}),e.strictObject({}),"Adds a piece to the end of the project's list (allyhub.yaml), the rest of it as it was; nothing when its file is listed already."),"components/list":s(e.strictObject({item:t}),e.strictObject({components:e.array(e.strictObject({of:e.string(),name:e.string(),label:e.union([e.string(),e.record(e.string(),e.string())]).optional()}))}),"The components an item may place: every one the project's files define, by the reference it would write."),"components/stage":s(e.strictObject(VersionRef),FramedPageSchema,"The address of a page that draws an item's components one at a time, for a sandboxed frame (docs/design/components-everywhere.md): a deck's by the name its module gives it, a doc's by the reference its block writes. Its parent posts `{ type: \"component\", name, props, width, height, t }` and hears `component-ready`, or `error` with what went wrong."),"components/stills":s(e.strictObject({...VersionRef,components:e.array(e.strictObject({name:e.string(),props:e.record(e.string(),e.unknown()),width:e.number().positive(),height:e.number().positive(),t:e.number().nonnegative()})).min(1).max(COMPONENT_STILLS_MAX)}),e.strictObject({stills:e.array(e.strictObject({key:e.string(),url:e.url()}).nullable())}),"An item's components (a deck's, a doc's) drawn alone, transparent, as the render draws them: pictures kept by what they show, given as addresses."),"check/results":s(e.strictObject({}),CheckStateSchema,"The check run after edits, as it stands."),"check/run":s(e.strictObject({}),e.strictObject({}),"Runs the check again now."),"export/start":s(e.strictObject({item:t,versions:e.array(e.string()).optional(),types:e.array(e.string().min(1)).max(10).optional(),options:ExportOptionsSchema.optional()}),e.strictObject({job:ExportJobSchema}),"Exports an item (its versions, as file types) into .allyhub/out/; `export/changed` says how it goes."),"export/cancel":s(e.strictObject({job:e.string()}),e.strictObject({}),"Stops an export."),"export/list":s(e.strictObject({}),e.strictObject({jobs:e.array(ExportJobSchema),reveal:e.boolean()}),"The exports asked for since the server started."),"export/reveal":s(e.strictObject({path:t}),e.strictObject({}),"Shows an exported file in the person's file manager, where the server runs on their computer (`export/list`'s `reveal`).")},PROJECT_TOOL_SOURCES={"project/items":"project","project/file":"asleep","items/preview":"asleep","items/page":"asleep","work/add":"machine","components/list":"asleep","components/stage":"asleep","components/stills":"project","check/results":"project","check/run":"machine","export/start":"machine","export/cancel":"machine","export/list":"asleep","export/reveal":"machine"},AGENT_DOES={"project/items":{files:"allyhub.yaml"},"project/file":{files:"the project's files"},"items/preview":{command:"frames"},"items/page":{command:"frames"},"work/add":{files:"allyhub.yaml"},"components/list":{files:"the project's components (defineComponent)"},"components/stage":{command:"frames"},"components/stills":{command:"frames"},"check/results":{command:"inspect"},"check/run":{command:"check"},"export/start":{command:"render"},"export/cancel":{command:"render"},"export/list":{files:".allyhub/out/"},"export/reveal":{files:".allyhub/out/"}};export function toolSpec(r){return Object.hasOwn(PROJECT_TOOLS,r)?PROJECT_TOOLS[r]:void 0}export function toolCaller(r){return async(p,i,l)=>{const{result:m}=await p["tools/call"]({name:i,arguments:l}),a=r[i]?.result.safeParse(m);if(!a?.success)throw new f(b.internal,`The answer to the tool ${i} is not what the protocol says.`);return a.data}}export const TOOL_NOTIFICATIONS={"project/changed":o(e.strictObject({revision:e.int().nonnegative()}),"The build saw a change: a stage or a timeline asked for now is the new one's."),"items/changed":o(e.strictObject({item:t,paths:e.array(e.string())}),`One of an item's inputs changed (docs/design/item-files.md, "An item's inputs"): a file its build lists, or one its pages loaded.`),"check/changed":o(CheckStateSchema,"The check started, ended or failed."),"export/changed":o(e.strictObject({job:ExportJobSchema}),"An export moved on."),"index/changed":o(e.strictObject({jobs:e.array(IndexJobSchema)}),"Making what the media index lacks moved on."),"jobs/changed":o(e.strictObject({job:d,item:t}),"A job of the process the server runs in (docs/design/jobs.md: a website starting, an export) moved on, about a thing in this project: what the window lists, for the editor of that thing to show where the person waits on it.")};
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/protocol",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/registry",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/render",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
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{isRule as Ge,problem as ve}from"@allyhub/diagnostics";import{contentEdges as Le,STRUCTURE as xe,toFrame as Ue,LAYER_NAME as Be,showLayer as Ae}from"@allyhub/piece";import{fact as Ee,intersect as He}from"@allyhub/video-core";import{backdropRoot as Ke,contentOf as We,holdsAdjustment as Ie}from"@allyhub/image-draw/layer-style";import{isFootage as ie,layerNames as Oe,planStack as Me,resolveTimes as $e,windowOf as je,zOf as Se}from"@allyhub/image-draw/plan";import{realTimers as Xe}from"@allyhub/image-draw/guards";const Ye={captions:()=>[],face:()=>{},faces:()=>[],texts:()=>[]};export{ie as isFootage,Oe as layerNames,Me as planStack,$e as resolveTimes,je as windowOf,Se as zOf};export function layerContexts(g,Q,V,Z,k){const{log:K,ledger:N,embed:m,combo:R}=g,{look:D,format:ee,dims:c}=Q,F=[[0,0,c.width,c.safe.top],[0,c.height-c.safe.bottom,c.width,c.safe.bottom],[0,0,c.safe.left,c.height],[c.width-c.safe.right,0,c.safe.right,c.height]].filter(n=>n[2]>0&&n[3]>0),w=Le(c),v=[w.left,w.top,w.right-w.left,w.bottom-w.top],te=n=>{if(!k)throw new Error(`"${n}": a page has no film to find it in.`);return k.filmAt(n)};return n=>{const C=n.reads??Ye,G=n.record??(()=>{}),x=n.place,L=n.answers,U={look:D,format:ee,dims:c,combo:n.combo??R,dur:n.dur,asset:o=>K.asset(o),optionalAsset:o=>K.optionalAsset(o),words:n.words,at:n.at,layer:{start:n.start,end:n.end},...n.enter?{enter:n.enter}:{},...n.exit?{exit:n.exit}:{},wait:o=>{N.wait(o)},report:o=>{const u=N.running,W=Ge(o.code)?o.code:"AK-R001",I=u?.part??x?.part;N.ran(ve(W,o.message,{...o.level?{level:o.level}:{},...o.ofPage?{ofPage:!0}:{},...I?{part:I}:{},...u?.t===void 0?{}:{t:u.t}}))},captions:o=>C.captions(o),face:(o,u)=>C.face(o,u),faces:o=>C.faces(o),texts:o=>C.texts(o),covered:F,content:v,video:(o,u)=>V.video(o,u,G),cameraFor:o=>m?.cameras?.[o]??m?.cameras?.["*"],...m?.sceneryScale===void 0?{}:{sceneryScale:m.sceneryScale},embedded:m!==void 0,get layoutOnly(){return Z.mode==="layout"},realTimers:Xe,...L?{answer:(o,u)=>{L.set(o,u)}}:{}};return x&&Object.defineProperty(U,"film",{enumerable:!0,get:()=>(G("film",String(x.start)),{start:x.start,part:x.part,at:te,...m?.shown?{outer:m.shown}:{}})}),U}}const _e=g=>Math.max(0,g-.4),de=g=>Math.round(g*1e3)/1e3,Ne=g=>Math.round(g*1e6)/1e6;export function compose(g){const{env:Q,piece:V,stage:Z,takes:k,film:K,captions:N,footage:m,sound:R}=g,{source:D,options:ee,combo:c,picked:F,ledger:w}=Q,{fps:v,format:te,dims:n}=V,{specs:C}=k,{timing:G,windows:x}=K,L=[],U=[],o=[],u=ee.purpose==="play",W=new Set,I=(l,s)=>{const a={};for(const[i,b]of Object.entries(c)){if(!F.has(i)||i===s){a[i]=b;continue}Object.defineProperty(a,i,{enumerable:!0,get:()=>(W.has(`${l}:${i}`)||(W.add(`${l}:${i}`),w.problems.push(ve("AK-X005",`A layer of part ${l} reads ctx.combo.${i}, ${i===xe?"the combo's structure":`the pick of the slot ${i}`}. A part is rendered once and reused in every combo that has it, so it may read only the dimensions${s===void 0?"":` and its own slot (${s})`}. Choose in the output's function instead, and pass the result as a prop.`,{part:l,where:{file:D.file}}))),b)})}return a};for(const[l,s]of C.entries()){const a=G.parts[l];if(!a)continue;const i=a.end-a.start,b=e=>G.at(l,e),Re=N.partWords(s.key),Ce=k.results[l]?.speech,fe=k.inputs[l],le=fe?.placed??[],pe=[...le,...(fe?.anchors??[]).filter(e=>!le.some(t=>t.name===e.name))],X=k.speechFor(l,a),M=x.get(l),$=x.get(l+1),Pe={...M&&M.before+M.after>0?{enter:{start:-M.before/v,end:M.after/v}}:{},...$&&$.before+$.after>0?{exit:{start:i-$.before/v,end:i+$.after/v}}:{}};let P;if(typeof s.still=="function")P=s.still(i);else if(s.still===void 0){if(P=_e(i),M||$){const e=(M?.after??0)/v,t=i-(($?.before??0)+1)/v;P=Math.max(e,Math.min(P,t))}}else P=b(s.still);let Y=Ue(a.start+P,v);(Y<a.start||Y>=a.end)&&(Y=a.start);const se=s.slot??(F.has(s.key)&&s.key!==xe?s.key:void 0),Te=F.size>0?I(s.key,se):c,oe={reads:new Map,captioned:!1},ne=Me(s.layers),{takeAt:ae,planes:B,planeOf:re,overOf:me,order:ue}=ne,ce=s.layers,he=s.post,A=k.videoTakes[l],d={key:s.key,...s.title===void 0?{}:{title:s.title},...se===void 0?{}:{slot:se},layers:Oe(ce),start:a.start,end:a.end,planes:B,still:Y,...X.speech?{speech:X.speech}:{},...pe.length>0?{anchors:pe.map(e=>({name:e.name,at:de(a.start+b(`@${e.name}`)),...e.end===void 0?{}:{end:de(a.start+b(`@/${e.name}`))}}))}:{},...s.tags?.length?{tags:[...s.tags]}:{},...he?{post:{filter:he.filter}}:{},...s.speechGainDb!==void 0&&s.speechGainDb!==0?{speechGainDb:s.speechGainDb}:{},...A?{plays:{video:A.id,from:A.from,to:A.to}}:{}};L.push(d),R.addSpeech(X.clips,X.room);const h=document.createElement("section");h.className="ak-part",h.dataset.key=s.key,h.dataset.format=te,Object.assign(h.style,{position:"absolute",inset:"0",overflow:"hidden"}),Ae(h,!1),Z.el.append(h);const _=new Map;u&&ce.forEach((e,t)=>{if(!ie(e))return;const f=document.createElement("div");f.className="ak-footage-plane",Object.assign(f.style,{position:"absolute",inset:"0",...(me.get(t)??0)>0?{pointerEvents:"none"}:{}}),_.set(t,f)});let E;_.size>0&&ae>=0&&(E=document.createElement("div"),E.className="ak-cutout-plane",Object.assign(E.style,{position:"absolute",inset:"0",pointerEvents:"none"}));const ze={captions:e=>(oe.captioned=!0,N.partCues(a.start,a.end,e)),face:(e,t)=>m.faceAt(s.key,a.start+e,t),faces:e=>m.facesAt(s.key,a.start+e)},H=[],ye=new Map;for(const[e,t]of ce.entries()){const[f,y]=je(t,i,b);if(ie(t)){const z=e===ae,J=m.plan(t,d,Ce,a.speechAt,f,y,{at:b,cutout:z,over:me.get(e)??0,person:z&&E!==void 0});if(J&&u){const we=_.get(e)??h,{matteUrl:ke,personOver:De,...Fe}=J;o.push({...Fe,host:we,...ke===void 0?{}:{cutoutIn:{host:De&&E?E:we,matte:ke}}})}continue}if(t.visible===!1)continue;const r=Se(t),O=re.get(e)??0;B[O]?.layers.push({component:t.component,start:Ne(d.start+f),end:Ne(d.start+Math.max(f,y))});const p=document.createElement("div");p.className="ak-layer",p.dataset.component=t.component,t.key!==void 0&&p.setAttribute(Be,t.key),Object.assign(p.style,{position:"absolute",inset:"0"}),Ae(p,!1),ye.set(e,p);const S=t.times?$e(t.props,t.times,b):t.props,q=H.slice(),ge=new Map,be=g.contexts({dur:i,words:()=>Re,at:b,start:f,end:y,combo:Te,reads:{...ze,texts:z=>g.texts({part:d,el:h},q,z)},record:(z,J)=>oe.reads.set(z,J),place:{start:d.start,part:s.key},answers:ge,...Pe});H.push({spec:t,index:e,props:S,el:p,content:We(p,t,be.dims),ctx:be,start:f,end:y,z:r,plane:O,answers:ge})}H.some(e=>Ie(e.spec))&&Ke(h);let T=h,j;if(B.some(e=>e.overlay===!0)){T=document.createElement("div"),j=document.createElement("div"),T.className="ak-picture",j.className="ak-overlays";for(const e of[T,j])Object.assign(e.style,{position:"absolute",inset:"0",overflow:"hidden"}),h.append(e)}ue.forEach((e,t)=>{const f=_.get(e)??ye.get(e);f&&(j&&ne.overlaid(e)?j:T).append(f);const y=re.get(e),r=ue[t+1];E&&y!==void 0&&B[y]?.behindPerson===!0&&(r===void 0||re.get(r)!==y)&&T.append(E)}),R.sfx(s,d,b),A&&R.carry(A.inner,A.from,A.to,d.start,d.key,0);for(const e of H){const t=k.shownBy.get(e.spec);t&&(t.shown.start=d.start+e.start,t.shown.partStart=d.start,t.shown.from=t.from,t.shown.to=t.from+(e.end-e.start)*t.speed,t.shown.speed=t.speed,t.audio!==void 0&&t.speed===1&&R.carry(t.inner,t.from,t.shown.to,d.start+e.start,d.key,t.audio))}B.forEach((e,t)=>{const f=e.layers.filter(r=>r.end>r.start),y=m.placed.flatMap(r=>{if(r.part!==d.key||(r.over??0)<=t)return[];if(!f.some(p=>p.end>r.start&&p.start<r.end))return[];let O;for(const p of r.boxes?r.boxes.map(S=>S.box):[r.box]){const S=He(p,[0,0,n.width,n.height]),q=S?de(S[2]*S[3]/(n.width*n.height)):0;(!O||q>O.frame)&&(O={box:p,frame:q})}return O?[{file:r.file,start:r.start,end:r.end,...O}]:[]});y.length!==0&&w.facts.push(Ee("graphics-under-footage",{piece:D.piece,part:s.key,t:d.start},{layers:f,footage:y,covered:Math.max(...y.map(r=>r.frame))}))}),ne.hasBehind&&ae<0&&w.facts.push(Ee("fallback",{piece:D.piece,part:s.key},{missing:"own-footage",for:"behind-person",fallback:"in-front"})),U.push({part:d,spec:s,n:l,el:h,picture:T,...j?{overlays:j}:{},layers:H,record:oe})}return{parts:L,mounted:U,clips:o}}
2
+ import{isRule as Ge,problem as ke}from"@allyhub/diagnostics";import{contentEdges as Le,STRUCTURE as xe,toFrame as Ue,LAYER_NAME as Be,showLayer as Ae}from"@allyhub/piece";import{fact as Ee,intersect as He}from"@allyhub/video-core";import{backdropRoot as Ke,contentOf as We,holdsAdjustment as Ie}from"@allyhub/image-draw/layer-style";import{isFootage as ie,layerNames as Oe,planStack as Me,resolveTimes as $e,windowOf as je,zOf as Se}from"@allyhub/image-draw/plan";import{realTimers as Xe}from"@allyhub/image-draw/guards";const Ye={captions:()=>[],face:()=>{},faces:()=>[],texts:()=>[]};export{ie as isFootage,Oe as layerNames,Me as planStack,$e as resolveTimes,je as windowOf,Se as zOf};export function layerContexts(g,V,K,Z,v){const{log:W,ledger:N,embed:u,combo:R}=g,{look:F,format:ee,dims:c}=V,G=[[0,0,c.width,c.safe.top],[0,c.height-c.safe.bottom,c.width,c.safe.bottom],[0,0,c.safe.left,c.height],[c.width-c.safe.right,0,c.safe.right,c.height]].filter(n=>n[2]>0&&n[3]>0),w=Le(c),k=[w.left,w.top,w.right-w.left,w.bottom-w.top],te=n=>{if(!v)throw new Error(`"${n}": a page has no film to find it in.`);return v.filmAt(n)};return n=>{const C=n.reads??Ye,P=n.record??(()=>{}),x=n.place,L=n.answers,U={look:F,format:ee,dims:c,combo:n.combo??R,dur:n.dur,asset:o=>W.asset(o),optionalAsset:o=>W.optionalAsset(o),words:n.words,at:n.at,layer:{start:n.start,end:n.end},...n.enter?{enter:n.enter}:{},...n.exit?{exit:n.exit}:{},wait:o=>{N.wait(o)},report:o=>{const l=N.running,I=Ge(o.code)?o.code:"AK-R001",X=l?.part??x?.part;N.ran(ke(I,o.message,{...o.level?{level:o.level}:{},...o.ofPage?{ofPage:!0}:{},...X?{part:X}:{},...l?.t===void 0?{}:{t:l.t}}))},captions:o=>C.captions(o),face:(o,l)=>C.face(o,l),faces:o=>C.faces(o),texts:o=>C.texts(o),covered:G,content:k,video:(o,l)=>K.video(o,l,P),item:(o,l)=>K.video(o,l,P),cameraFor:o=>u?.cameras?.[o]??u?.cameras?.["*"],...u?.sceneryScale===void 0?{}:{sceneryScale:u.sceneryScale},embedded:u!==void 0,get layoutOnly(){return Z.mode==="layout"},realTimers:Xe,...L?{answer:(o,l)=>{L.set(o,l)}}:{}};return x&&Object.defineProperty(U,"film",{enumerable:!0,get:()=>(P("film",String(x.start)),{start:x.start,part:x.part,at:te,...u?.shown?{outer:u.shown}:{}})}),U}}const _e=g=>Math.max(0,g-.4),de=g=>Math.round(g*1e3)/1e3,Ne=g=>Math.round(g*1e6)/1e6;export function compose(g){const{env:V,piece:K,stage:Z,takes:v,film:W,captions:N,footage:u,sound:R}=g,{source:F,options:ee,combo:c,picked:G,ledger:w}=V,{fps:k,format:te,dims:n}=K,{specs:C}=v,{timing:P,windows:x}=W,L=[],U=[],o=[],l=ee.purpose==="play",I=new Set,X=(p,s)=>{const a={};for(const[i,b]of Object.entries(c)){if(!G.has(i)||i===s){a[i]=b;continue}Object.defineProperty(a,i,{enumerable:!0,get:()=>(I.has(`${p}:${i}`)||(I.add(`${p}:${i}`),w.problems.push(ke("AK-X005",`A layer of part ${p} reads ctx.combo.${i}, ${i===xe?"the combo's structure":`the pick of the slot ${i}`}. A part is rendered once and reused in every combo that has it, so it may read only the dimensions${s===void 0?"":` and its own slot (${s})`}. Choose in the output's function instead, and pass the result as a prop.`,{part:p,where:{file:F.file}}))),b)})}return a};for(const[p,s]of C.entries()){const a=P.parts[p];if(!a)continue;const i=a.end-a.start,b=e=>P.at(p,e),Re=N.partWords(s.key),Ce=v.results[p]?.speech,fe=v.inputs[p],le=fe?.placed??[],pe=[...le,...(fe?.anchors??[]).filter(e=>!le.some(t=>t.name===e.name))],Y=v.speechFor(p,a),M=x.get(p),$=x.get(p+1),Pe={...M&&M.before+M.after>0?{enter:{start:-M.before/k,end:M.after/k}}:{},...$&&$.before+$.after>0?{exit:{start:i-$.before/k,end:i+$.after/k}}:{}};let T;if(typeof s.still=="function")T=s.still(i);else if(s.still===void 0){if(T=_e(i),M||$){const e=(M?.after??0)/k,t=i-(($?.before??0)+1)/k;T=Math.max(e,Math.min(T,t))}}else T=b(s.still);let _=Ue(a.start+T,k);(_<a.start||_>=a.end)&&(_=a.start);const se=s.slot??(G.has(s.key)&&s.key!==xe?s.key:void 0),Te=G.size>0?X(s.key,se):c,oe={reads:new Map,captioned:!1},ne=Me(s.layers),{takeAt:ae,planes:B,planeOf:re,overOf:me,order:ue}=ne,ce=s.layers,he=s.post,A=v.videoTakes[p],d={key:s.key,...s.title===void 0?{}:{title:s.title},...se===void 0?{}:{slot:se},layers:Oe(ce),start:a.start,end:a.end,planes:B,still:_,...Y.speech?{speech:Y.speech}:{},...pe.length>0?{anchors:pe.map(e=>({name:e.name,at:de(a.start+b(`@${e.name}`)),...e.end===void 0?{}:{end:de(a.start+b(`@/${e.name}`))}}))}:{},...s.tags?.length?{tags:[...s.tags]}:{},...he?{post:{filter:he.filter}}:{},...s.speechGainDb!==void 0&&s.speechGainDb!==0?{speechGainDb:s.speechGainDb}:{},...A?{plays:{video:A.id,from:A.from,to:A.to}}:{}};L.push(d),R.addSpeech(Y.clips,Y.room);const h=document.createElement("section");h.className="ak-part",h.dataset.key=s.key,h.dataset.format=te,Object.assign(h.style,{position:"absolute",inset:"0",overflow:"hidden"}),Ae(h,!1),Z.el.append(h);const q=new Map;l&&ce.forEach((e,t)=>{if(!ie(e))return;const f=document.createElement("div");f.className="ak-footage-plane",Object.assign(f.style,{position:"absolute",inset:"0",...(me.get(t)??0)>0?{pointerEvents:"none"}:{}}),q.set(t,f)});let E;q.size>0&&ae>=0&&(E=document.createElement("div"),E.className="ak-cutout-plane",Object.assign(E.style,{position:"absolute",inset:"0",pointerEvents:"none"}));const ze={captions:e=>(oe.captioned=!0,N.partCues(a.start,a.end,e)),face:(e,t)=>u.faceAt(s.key,a.start+e,t),faces:e=>u.facesAt(s.key,a.start+e)},H=[],ye=new Map;for(const[e,t]of ce.entries()){const[f,y]=je(t,i,b);if(ie(t)){const D=e===ae,Q=u.plan(t,d,Ce,a.speechAt,f,y,{at:b,cutout:D,over:me.get(e)??0,person:D&&E!==void 0});if(Q&&l){const we=q.get(e)??h,{matteUrl:ve,personOver:De,...Fe}=Q;o.push({...Fe,host:we,...ve===void 0?{}:{cutoutIn:{host:De&&E?E:we,matte:ve}}})}continue}if(t.visible===!1)continue;const r=Se(t),O=re.get(e)??0;B[O]?.layers.push({component:t.component,start:Ne(d.start+f),end:Ne(d.start+Math.max(f,y))});const m=document.createElement("div");m.className="ak-layer",m.dataset.component=t.component,t.key!==void 0&&m.setAttribute(Be,t.key),Object.assign(m.style,{position:"absolute",inset:"0"}),Ae(m,!1),ye.set(e,m);const S=t.times?$e(t.props,t.times,b):t.props,J=H.slice(),ge=new Map,be=g.contexts({dur:i,words:()=>Re,at:b,start:f,end:y,combo:Te,reads:{...ze,texts:D=>g.texts({part:d,el:h},J,D)},record:(D,Q)=>oe.reads.set(D,Q),place:{start:d.start,part:s.key},answers:ge,...Pe});H.push({spec:t,index:e,props:S,el:m,content:We(m,t,be.dims),ctx:be,start:f,end:y,z:r,plane:O,answers:ge})}H.some(e=>Ie(e.spec))&&Ke(h);let z=h,j;if(B.some(e=>e.overlay===!0)){z=document.createElement("div"),j=document.createElement("div"),z.className="ak-picture",j.className="ak-overlays";for(const e of[z,j])Object.assign(e.style,{position:"absolute",inset:"0",overflow:"hidden"}),h.append(e)}ue.forEach((e,t)=>{const f=q.get(e)??ye.get(e);f&&(j&&ne.overlaid(e)?j:z).append(f);const y=re.get(e),r=ue[t+1];E&&y!==void 0&&B[y]?.behindPerson===!0&&(r===void 0||re.get(r)!==y)&&z.append(E)}),R.sfx(s,d,b),A&&R.carry(A.inner,A.from,A.to,d.start,d.key,0);for(const e of H){const t=v.shownBy.get(e.spec);t&&(t.shown.start=d.start+e.start,t.shown.partStart=d.start,t.shown.from=t.from,t.shown.to=t.from+(e.end-e.start)*t.speed,t.shown.speed=t.speed,t.audio!==void 0&&t.speed===1&&R.carry(t.inner,t.from,t.shown.to,d.start+e.start,d.key,t.audio))}B.forEach((e,t)=>{const f=e.layers.filter(r=>r.end>r.start),y=u.placed.flatMap(r=>{if(r.part!==d.key||(r.over??0)<=t)return[];if(!f.some(m=>m.end>r.start&&m.start<r.end))return[];let O;for(const m of r.boxes?r.boxes.map(S=>S.box):[r.box]){const S=He(m,[0,0,n.width,n.height]),J=S?de(S[2]*S[3]/(n.width*n.height)):0;(!O||J>O.frame)&&(O={box:m,frame:J})}return O?[{file:r.file,start:r.start,end:r.end,...O}]:[]});y.length!==0&&w.facts.push(Ee("graphics-under-footage",{piece:F.piece,part:s.key,t:d.start},{layers:f,footage:y,covered:Math.max(...y.map(r=>r.frame))}))}),ne.hasBehind&&ae<0&&w.facts.push(Ee("fallback",{piece:F.piece,part:s.key},{missing:"own-footage",for:"behind-person",fallback:"in-front"})),U.push({part:d,spec:s,n:p,el:h,picture:z,...j?{overlays:j}:{},layers:H,record:oe})}return{parts:L,mounted:U,clips:o}}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{LAYER_BRAND as _}from"@allyhub/piece";import{forOrient as N,isPieceDefinition as E,momentOf as M,outputName as q}from"@allyhub/video-core";import{LoadFailure as $}from"@allyhub/image-draw/errors";export const momentIn=(t,e)=>typeof e=="number"?e:M(t.timeline,e),camerasOf=t=>t?.cameras??(t?.camera===void 0?void 0:{"*":t.camera});function B(t,e){const l=e.written?.file;if(!(l===void 0||l===""))return Object.entries(t.pieces??{}).find(([,m])=>m.file===l)}export function createEmbedder(t,e,l){const{source:m,options:v,embed:h,combo:g}=t,y=[],u=[...h?.chain??[],m.piece],w={loaded:y,async load(s,i,o={}){const f=E(s)?B(m,s):void 0;if(!E(s)||!f)throw new $("bad_video",'A video item of the project is shown by its piece, imported (import demo from "../demo/video") and passed as it is.');const[c,r]=f;if(u.includes(c))throw new $("video_cycle",`${[...u,c].join(" → ")}: a video item that shows itself, through the videos it shows (AK-M010). A source cannot reach itself.`);const a=q(s.kind),n=o.frame===!0?m.format:r.format,p=Object.fromEntries(Object.entries(r.dims).map(([j,A])=>{const S=g[j];return[j,S!==void 0&&A.includes(S)?S:A[0]??""]})),d=i.parentNode,b=i.nextSibling,x=document.createElement("div");x.dataset.akHolder="",Object.assign(x.style,{position:"absolute",left:"0px",top:"0px",visibility:"hidden",pointerEvents:"none"}),e.el.append(x),x.append(i),i.dataset.akPiece=r.file;let O;try{O=await l({...m,piece:c,file:r.file,module:"",styles:[],dims:r.dims,format:n,...r.matrix?{matrix:r.matrix}:{}},{combo:p,purpose:v.purpose},i,{def:s,chain:u,...o.cameras?{cameras:o.cameras}:{},...o.shown?{shown:o.shown}:{},...o.sceneryScale===void 0?{}:{sceneryScale:o.sceneryScale}}),await O.ready()}finally{e.takeOutside(),d?d.insertBefore(i,b):i.remove(),e.takeOutside(),x.remove()}const k={id:c,output:a,format:n,inner:O};return y.push(k),k},async video(s,i,o){const{id:f,output:c,format:r,inner:a}=await w.load(s,i);return o(`video:${f}:${c}:${r}`,JSON.stringify(a.signs())),{id:f,duration:a.timeline.duration,width:a.timeline.width,height:a.timeline.height,seek:(n,p)=>a.seek(n,{mode:p===!0?"layout":"picture"}),at:n=>M(a.timeline,n)}}};return w}export const isBoxKeys=t=>Array.isArray(t)&&t.length>0&&typeof t[0]=="object";export function videoLayer(t,e,l,m,v){const{inner:h,host:g}=l,y=h.timeline.width,u=h.timeline.height,w=N(e.box,t.orient);if(isBoxKeys(w))throw new $("bad_footage",'footage() of a video item takes one box (or "full"), not keyframes.');const[s,i,o,f]=w===void 0||w==="full"?[0,0,1,1]:w,c=e.fit??"cover",r=e.cameras??(e.camera===void 0?void 0:e.camera);return{[_]:"graphic",component:"video",...e.at===void 0?{}:{at:e.at},...e.until===void 0?{}:{until:e.until},...e.dur===void 0?{}:{dur:e.dur},props:{...v,box:[s,i,o,f],fit:c,...r===void 0?{}:{camera:r},...e.quality?{quality:e.quality}:{},parts:h.signs()},mount(a){const n={x:s*t.width,y:i*t.height,w:o*t.width,h:f*t.height},p=c==="contain"?Math.min(n.w/y,n.h/u):Math.max(n.w/y,n.h/u),d=document.createElement("div");Object.assign(d.style,{position:"absolute",left:`${String(n.x)}px`,top:`${String(n.y)}px`,width:`${String(n.w)}px`,height:`${String(n.h)}px`,overflow:"hidden"}),Object.assign(g.style,{position:"absolute",left:`${String((n.w-y*p)/2)}px`,top:`${String((n.h-u*p)/2)}px`,width:`${String(y)}px`,height:`${String(u)}px`,transformOrigin:"0 0",transform:`scale(${String(p)})`}),d.appendChild(g),a.appendChild(d)},render(a,n,p,d){const b=Math.min(Math.max(m(n,d),0),Math.max(0,h.timeline.duration-.001)),x=d.layoutOnly===!0?"layout":"picture";d.wait(Promise.resolve().then(()=>h.seek(b,{mode:x})))}}}
2
+ import{LAYER_BRAND as _,itemSource as q,pieceOfValue as A}from"@allyhub/piece";import{runtimeOf as M}from"@allyhub/piece/page";import{forOrient as N,isPieceDefinition as B,momentOf as S,outputName as L}from"@allyhub/video-core";import{LoadFailure as k}from"@allyhub/image-draw/errors";export const momentIn=(n,e)=>typeof e=="number"?e:S(n.timeline,e);export function momentOfItem(n,e){const u=/^(.+)\/(\d+)$/u.exec(e),c=u===null?void 0:n.timeline.parts.find(f=>f.key===u[1]);if(u===null||c===void 0)return S(n.timeline,e);const y=Number(u[2]),m=c.steps??[c.start],h=m[y];if(h===void 0)throw new Error(`${e}: ${c.key} has ${String(m.length-1)} builds after it comes on.`);return h}export const camerasOf=n=>n?.cameras??(n?.camera===void 0?void 0:{"*":n.camera});const P=n=>typeof n.timeline=="object";function C(n,e){const u=e.written?.file;if(!(u===void 0||u===""))return Object.entries(n.pieces??{}).find(([,c])=>c.file===u)}export function createEmbedder(n,e,u){const{source:c,options:y,embed:m,combo:h}=n,f=[],l=[...m?.chain??[],c.piece],w=o=>Object.fromEntries(Object.entries(o).map(([r,a])=>{const d=h[r];return[r,d!==void 0&&a.includes(d)?d:a[0]??""]})),g=async(o,r,a)=>{const d=o.parentNode,s=o.nextSibling,i=document.createElement("div");i.dataset.akHolder="",Object.assign(i.style,{position:"absolute",left:"0px",top:"0px",visibility:"hidden",pointerEvents:"none"}),e.el.append(i),i.append(o),o.dataset.akPiece=r;try{return await a()}finally{e.takeOutside(),d?d.insertBefore(o,s):o.remove(),e.takeOutside(),i.remove()}},v=async(o,r,a)=>{const d=q(c,o),s=r.kind===void 0?void 0:M(r.kind);if(!d||!s)throw new k("bad_video",d?`${r.file} is a ${r.kind??"kind"} the stage has no runtime for.`:`${r.file} is not drawn in ${c.piece}: the build finds an item a video draws by its import in the video's module or a module of the project it imports (import q3 from "../decks/q3").`);const i=await g(a,r.file,async()=>{const p=await s(d,{combo:w(r.dims),purpose:y.purpose,inside:c.piece},a);return await p.ready(),p});if(!P(i))throw new k("bad_video",`${r.file} is a ${i.kind}, which is not drawn on a clock a video can seek.`);const t={id:o,output:i.kind,format:d.format,inner:i};return f.push(t),t},b={loaded:f,async load(o,r,a={}){const d=B(o),s=d?C(c,o):A(c,o);if(!s)throw new k("bad_video",'An item of the project is shown by what its module exports, imported (import demo from "../demo/video", import q3 from "../decks/q3") and passed as it is.');const[i,t]=s;if(l.includes(i))throw new k("video_cycle",`${[...l,i].join(" → ")}: a video item that shows itself, through the videos it shows (AK-M010). A source cannot reach itself.`);if(!d)return v(i,t,r);const p=L(o.kind),x=a.frame===!0?c.format:t.format,j=w(t.dims),E=await g(r,t.file,async()=>{const O=await u({...c,piece:i,file:t.file,module:"",styles:[],dims:t.dims,format:x,...t.matrix?{matrix:t.matrix}:{}},{combo:j,purpose:y.purpose},r,{def:o,chain:l,...a.cameras?{cameras:a.cameras}:{},...a.shown?{shown:a.shown}:{},...a.sceneryScale===void 0?{}:{sceneryScale:a.sceneryScale}});return await O.ready(),O}),$={id:i,output:p,format:x,inner:E};return f.push($),$},async video(o,r,a){const{id:d,output:s,format:i,inner:t}=await b.load(o,r);return a(`video:${d}:${s}:${i}`,JSON.stringify(t.signs())),{id:d,kind:t.kind,duration:t.timeline.duration,width:t.timeline.width,height:t.timeline.height,seek:(p,x)=>t.seek(p,{mode:x===!0?"layout":"picture"}),at:p=>momentOfItem(t,p)}}};return b}export const isBoxKeys=n=>Array.isArray(n)&&n.length>0&&typeof n[0]=="object";export function videoLayer(n,e,u,c,y){const{inner:m,host:h}=u,f=m.timeline.width,l=m.timeline.height,w=N(e.box,n.orient);if(isBoxKeys(w))throw new k("bad_footage",'footage() of a video item takes one box (or "full"), not keyframes.');const[g,v,b,o]=w===void 0||w==="full"?[0,0,1,1]:w,r=e.fit??"cover",a=e.cameras??(e.camera===void 0?void 0:e.camera);return{[_]:"graphic",component:"video",...e.at===void 0?{}:{at:e.at},...e.until===void 0?{}:{until:e.until},...e.dur===void 0?{}:{dur:e.dur},props:{...y,box:[g,v,b,o],fit:r,...a===void 0?{}:{camera:a},...e.quality?{quality:e.quality}:{},parts:m.signs()},mount(d){const s={x:g*n.width,y:v*n.height,w:b*n.width,h:o*n.height},i=r==="contain"?Math.min(s.w/f,s.h/l):Math.max(s.w/f,s.h/l),t=document.createElement("div");Object.assign(t.style,{position:"absolute",left:`${String(s.x)}px`,top:`${String(s.y)}px`,width:`${String(s.w)}px`,height:`${String(s.h)}px`,overflow:"hidden"}),Object.assign(h.style,{position:"absolute",left:`${String((s.w-f*i)/2)}px`,top:`${String((s.h-l*i)/2)}px`,width:`${String(f)}px`,height:`${String(l)}px`,transformOrigin:"0 0",transform:`scale(${String(i)})`}),t.appendChild(h),d.appendChild(t)},render(d,s,i,t){const p=Math.min(Math.max(c(s,t),0),Math.max(0,m.timeline.duration-.001)),x=t.layoutOnly===!0?"layout":"picture";t.wait(Promise.resolve().then(()=>m.seek(p,{mode:x})))}}}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{startPlayer as c}from"./player/player.js";export function startAt(t,n){let e=n?.t;const r=n?.part===void 0?void 0:t.parts.find(d=>d.key===n.part);if(r){const d=r.end-r.start,s=n?.offset??0,a=n?.dur,m=a===void 0||Math.abs(d-a)<1e-6;e=r.start+(m?s:s/Math.max(a,1e-6)*d),e=Math.min(e,r.end-1/t.fps)}return e}export async function playFilm(t,n,e){const r=t.timeline;e.post?.({type:"loaded",kind:t.kind,timeline:r,text:t.text(),reads:t.reads(),problems:t.problems(),mix:t.mixPlan()});const d=startAt(r,e.at),s=await c({output:t,stage:n,...e.media?{media:e.media}:{},...e.seed===void 0?{}:{seed:e.seed},...d===void 0?{}:{start:d},...e.post?{post:e.post}:{},...e.chrome===void 0?{}:{chrome:e.chrome}});return{command(a){s.command(a)}}}export function answerFilm(t,n){if(n.type==="objects")return t.objects(Number(n.t)).then(e=>({type:"objects",...e}))}
2
+ import{mergePlans as i}from"@allyhub/audio";import{startPlayer as c}from"./player/player.js";export function startAt(n,t){let e=t?.t;const r=t?.part===void 0?void 0:n.parts.find(d=>d.key===t.part);if(r){const d=r.end-r.start,a=t?.offset??0,m=t?.dur,f=m===void 0||Math.abs(d-m)<1e-6;e=r.start+(f?a:a/Math.max(m,1e-6)*d),e=Math.min(e,r.end-1/n.fps)}return e}export async function playFilm(n,t,e,r){const d=n.timeline;e.post?.({type:"loaded",kind:n.kind,timeline:d,text:n.text(),reads:n.reads(),problems:n.problems(),mix:r===void 0||r.length===0?n.mixPlan():i(n.mixPlan(),r)});const a=startAt(d,e.at),m=await c({output:n,stage:t,...e.media?{media:e.media}:{},...e.seed===void 0?{}:{seed:e.seed},...a===void 0?{}:{start:a},...e.post?{post:e.post}:{},...e.chrome===void 0?{}:{chrome:e.chrome},...r===void 0||r.length===0?{}:{sounds:r}});return{command(f){m.command(f)}}}export function answerFilm(n,t){if(t.type==="objects")return n.objects(Number(t.t)).then(e=>({type:"objects",...e}))}
@@ -1,3 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{problem as $}from"@allyhub/diagnostics";import{CLEAN_LOOK as b,FPS as L,formatEntry as g,formatInfo as S,isVideoFormat as _,LOAD_LIMIT as x,messagePrefix as I,parseFps as P,presetInfo as A,SEEK_LIMIT as E}from"@allyhub/piece";import{isLayerSpec as T,isPartSpec as K,isPieceDefinition as F,isSpeechSpec as D,outputOf as y,partDefaults as M}from"@allyhub/video-core";import{consoleAtAsync as h}from"@allyhub/piece/page";import{buildContext as O}from"@allyhub/image-draw/context";import{LoadFailure as d}from"@allyhub/image-draw/errors";function v(i){return Promise.all(i.map(e=>new Promise(s=>{const t=document.createElement("link");t.rel="stylesheet",t.href=e,t.onload=()=>{s()},t.onerror=()=>{s()},document.head.append(t)})))}async function C(i){const{source:e,embed:s,ledger:t}=i;let c=s?.def;if(!s){let n;try{await v(e.styles??[]),n=await t.timed("importing the piece's module",()=>h({phase:"module"},()=>import(e.module)))}catch(r){const a=r instanceof Error?r:new Error(String(r));throw new d("load_failed",`Failed to load the piece module: ${a.message}
3
- ${a.stack??""}`)}c=n.default}if(!F(c))throw new d("no_content",`The default export of ${e.file} is not a video({ … }).`);return{def:c}}export async function resolvePiece(i){const{source:e,log:s}=i,{def:t}=await C(i),c=y(t),n=t.written?.file,r=n!==void 0&&n!==""?n:e.file;r!==e.file&&s.relativeTo(r);const a=c.kind;if(a!=="video")throw new d("bad_output",`${e.piece} is ${a}; load() loads a video (a deck is the deck's runtime's).`);const f=c.options,l=P(f.fps)??L,p=i.embed?.frame;if(p===void 0&&!_(e.format))throw new d("bad_format",`${e.piece} is not rendered in ${e.format}: it is not a format.`);const o=e.format,m=g(t.format===void 0?[]:[t.format],o)??o,u=p??S(m)??A("16x9"),w=I(e.piece),k=f.look??"clean";return{def:t,options:f,fps:l,format:o,dims:u,prefix:w,look:e.looks?.[k]??b,defaults:M(e.partDefaults,f.defaults?.part),writtenIn:r,musicBase:t.written?.paths?.music?.[1]??r.split("/").slice(0,-1).join("/"),seekLimitMs:(f.seekLimit??E)*1e3,loadLimitMs:(f.loadLimit??x)*1e3}}export function pieceContext(i,e){return{...O(i),look:e.look}}export async function buildParts(i,e,s){const{source:t,ledger:c}=i,n="part",r=y(e.def),a=await h({phase:"build"},()=>Promise.resolve(r.build(s)));if(!Array.isArray(a)||a.length===0)throw new d("no_parts",`The function of output ${i.output} returned no ${n}s (AK-K003).`);const f=[],l=new Set;for(const[p,o]of a.entries()){if(!K(o))throw new d("bad_part",`Item ${String(p+1)} is not a ${n} made by part({ key, layers }).`);const m=o.layers.findIndex(u=>!T(u));if(m>=0)throw new d("bad_part",`Layer ${String(m+1)} of ${n} ${o.key} is not a layer made by footage(), a component or custom().`);if(o.speech!==void 0&&!D(o.speech))throw new d("bad_part",`The speech of ${n} ${o.key} is not made by take() or say().`);if(l.has(o.key)){c.problems.push($("AK-K001",`The ${n} key "${o.key}" is used twice. Every ${n} in an output needs its own key.`,{part:o.key,where:{file:t.file}}));continue}l.add(o.key),f.push(o)}return f}
2
+ import{problem as b}from"@allyhub/diagnostics";import{CLEAN_LOOK as $,FPS as L,formatEntry as S,formatInfo as g,isVideoFormat as _,LOAD_LIMIT as x,messagePrefix as I,parseFps as A,presetInfo as P,SEEK_LIMIT as E}from"@allyhub/piece";import{isLayerSpec as T,isPartSpec as K,isPieceDefinition as F,isSpeechSpec as D,outputOf as h,partDefaults as M}from"@allyhub/video-core";import{consoleAtAsync as y}from"@allyhub/piece/page";import{buildContext as O}from"@allyhub/image-draw/context";import{LoadFailure as d}from"@allyhub/image-draw/errors";function v(i){const e=new Set([...document.querySelectorAll("link[rel=stylesheet]")].map(s=>s.href));return Promise.all(i.filter(s=>!e.has(new URL(s,document.baseURI).href)).map(s=>new Promise(n=>{const o=document.createElement("link");o.rel="stylesheet",o.href=s,o.onload=()=>{n()},o.onerror=()=>{n()},document.head.append(o)})))}async function C(i){const{source:e,embed:s,ledger:n}=i;let o=s?.def;if(!s){let r;try{await v(e.styles??[]),r=await n.timed("importing the piece's module",()=>y({phase:"module"},()=>import(e.module)))}catch(a){const c=a instanceof Error?a:new Error(String(a));throw new d("load_failed",`Failed to load the piece module: ${c.message}
3
+ ${c.stack??""}`)}o=r.default}if(!F(o))throw new d("no_content",`The default export of ${e.file} is not a video({ … }).`);return{def:o}}export async function resolvePiece(i){const{source:e,log:s}=i,{def:n}=await C(i),o=h(n),r=n.written?.file,a=r!==void 0&&r!==""?r:e.file;a!==e.file&&s.relativeTo(a);const c=o.kind;if(c!=="video")throw new d("bad_output",`${e.piece} is ${c}; load() loads a video (a deck is the deck's runtime's).`);const f=o.options,l=A(f.fps)??L,p=i.embed?.frame;if(p===void 0&&!_(e.format))throw new d("bad_format",`${e.piece} is not rendered in ${e.format}: it is not a format.`);const t=e.format,m=S(n.format===void 0?[]:[n.format],t)??t,u=p??g(m)??P("16x9"),w=I(e.piece),k=f.look??"clean";return{def:n,options:f,fps:l,format:t,dims:u,prefix:w,look:e.looks?.[k]??$,defaults:M(e.partDefaults,f.defaults?.part),writtenIn:a,musicBase:n.written?.paths?.music?.[1]??a.split("/").slice(0,-1).join("/"),seekLimitMs:(f.seekLimit??E)*1e3,loadLimitMs:(f.loadLimit??x)*1e3}}export function pieceContext(i,e){return{...O(i),look:e.look}}export async function buildParts(i,e,s){const{source:n,ledger:o}=i,r="part",a=h(e.def),c=await y({phase:"build"},()=>Promise.resolve(a.build(s)));if(!Array.isArray(c)||c.length===0)throw new d("no_parts",`The function of output ${i.output} returned no ${r}s (AK-K003).`);const f=[],l=new Set;for(const[p,t]of c.entries()){if(!K(t))throw new d("bad_part",`Item ${String(p+1)} is not a ${r} made by part({ key, layers }).`);const m=t.layers.findIndex(u=>!T(u));if(m>=0)throw new d("bad_part",`Layer ${String(m+1)} of ${r} ${t.key} is not a layer made by footage(), a component or custom().`);if(t.speech!==void 0&&!D(t.speech))throw new d("bad_part",`The speech of ${r} ${t.key} is not made by take() or say().`);if(l.has(t.key)){o.problems.push(b("AK-K001",`The ${r} key "${t.key}" is used twice. Every ${r} in an output needs its own key.`,{part:t.key,where:{file:n.file}}));continue}l.add(t.key),f.push(t)}return f}