allyhub 0.6.0 → 0.7.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 (632) hide show
  1. package/dist/audio-text.js +1 -1
  2. package/dist/commands/add.js +2 -2
  3. package/dist/commands/cloud-tools.js +5 -5
  4. package/dist/commands/dev.js +1 -1
  5. package/dist/commands/frames/piece.js +1 -1
  6. package/dist/commands/frames/sheet.js +1 -1
  7. package/dist/commands/frames.js +8 -8
  8. package/dist/commands/index.js +1 -1
  9. package/dist/commands/inspect/common.js +1 -1
  10. package/dist/commands/inspect/layout.js +1 -1
  11. package/dist/commands/render.js +1 -1
  12. package/dist/commands/sheet.js +5 -5
  13. package/dist/commands/site.js +3 -2
  14. package/dist/commands/skills.js +3 -3
  15. package/dist/commands/slides.js +2 -2
  16. package/dist/node_modules/@allyhub-next/audio/dist/node/index.js +1 -1
  17. package/dist/node_modules/@allyhub-next/audio/dist/node/master.js +1 -1
  18. package/dist/node_modules/@allyhub-next/audio/package.json +1 -1
  19. package/dist/node_modules/@allyhub-next/browser/dist/html.js +1 -1
  20. package/dist/node_modules/@allyhub-next/browser/package.json +1 -1
  21. package/dist/node_modules/@allyhub-next/build/dist/content.d.ts +4 -0
  22. package/dist/node_modules/@allyhub-next/build/dist/content.js +1 -1
  23. package/dist/node_modules/@allyhub-next/build/dist/index.d.ts +2 -2
  24. package/dist/node_modules/@allyhub-next/build/dist/index.js +1 -1
  25. package/dist/node_modules/@allyhub-next/build/dist/meta-worker.d.ts +2 -2
  26. package/dist/node_modules/@allyhub-next/build/dist/meta-worker.js +3 -3
  27. package/dist/node_modules/@allyhub-next/build/dist/move-refs.d.ts +1 -1
  28. package/dist/node_modules/@allyhub-next/build/dist/move-refs.js +1 -1
  29. package/dist/node_modules/@allyhub-next/build/dist/plugin.d.ts +12 -3
  30. package/dist/node_modules/@allyhub-next/build/dist/plugin.js +7 -6
  31. package/dist/node_modules/@allyhub-next/build/dist/prepare.d.ts +9 -5
  32. package/dist/node_modules/@allyhub-next/build/dist/prepare.js +2 -2
  33. package/dist/node_modules/@allyhub-next/build/dist/vite.d.ts +10 -0
  34. package/dist/node_modules/@allyhub-next/build/dist/vite.js +2 -2
  35. package/dist/node_modules/@allyhub-next/build/package.json +1 -1
  36. package/dist/node_modules/@allyhub-next/chart/dist/chart-xml.js +2 -2
  37. package/dist/node_modules/@allyhub-next/chart/dist/chart.d.ts +14 -5
  38. package/dist/node_modules/@allyhub-next/chart/dist/chart.js +1 -1
  39. package/dist/node_modules/@allyhub-next/chart/package.json +1 -1
  40. package/dist/node_modules/@allyhub-next/check/dist/check.js +3 -3
  41. package/dist/node_modules/@allyhub-next/check/package.json +1 -1
  42. package/dist/node_modules/@allyhub-next/cloud/dist/blobs.js +2 -0
  43. package/dist/node_modules/@allyhub-next/cloud/dist/call.js +4 -2
  44. package/dist/node_modules/@allyhub-next/cloud/dist/client.js +1 -1
  45. package/dist/node_modules/@allyhub-next/cloud/dist/errors.js +1 -1
  46. package/dist/node_modules/@allyhub-next/cloud/dist/hashes.js +2 -0
  47. package/dist/node_modules/@allyhub-next/cloud/dist/index.js +1 -1
  48. package/dist/node_modules/@allyhub-next/cloud/dist/sites.js +2 -0
  49. package/dist/node_modules/@allyhub-next/cloud/dist/voice.js +1 -1
  50. package/dist/node_modules/@allyhub-next/cloud/package.json +1 -1
  51. package/dist/node_modules/@allyhub-next/components/package.json +1 -1
  52. package/dist/node_modules/@allyhub-next/components/r/caption-subtitle.json +1 -1
  53. package/dist/node_modules/@allyhub-next/components/src/caption-subtitle.ts +54 -16
  54. package/dist/node_modules/@allyhub-next/dev-server/dist/background.js +1 -1
  55. package/dist/node_modules/@allyhub-next/dev-server/dist/fonts.js +2 -0
  56. package/dist/node_modules/@allyhub-next/dev-server/dist/index.js +1 -1
  57. package/dist/node_modules/@allyhub-next/dev-server/dist/live.js +1 -1
  58. package/dist/node_modules/@allyhub-next/dev-server/dist/project.js +1 -1
  59. package/dist/node_modules/@allyhub-next/dev-server/dist/reach.js +2 -0
  60. package/dist/node_modules/@allyhub-next/dev-server/dist/record.js +2 -0
  61. package/dist/node_modules/@allyhub-next/dev-server/dist/server.js +2 -2
  62. package/dist/node_modules/@allyhub-next/dev-server/dist/tools.js +1 -1
  63. package/dist/node_modules/@allyhub-next/dev-server/dist/tree.js +2 -0
  64. package/dist/node_modules/@allyhub-next/dev-server/dist/writer.js +2 -2
  65. package/dist/node_modules/@allyhub-next/dev-server/package.json +1 -1
  66. package/dist/node_modules/@allyhub-next/doc/package.json +1 -1
  67. package/dist/node_modules/@allyhub-next/export/dist/deck-pptx.js +1 -1
  68. package/dist/node_modules/@allyhub-next/export/dist/export.js +5 -5
  69. package/dist/node_modules/@allyhub-next/export/dist/index.js +1 -1
  70. package/dist/node_modules/@allyhub-next/export/package.json +1 -1
  71. package/dist/node_modules/@allyhub-next/formats/dist/data/deck-code.d.ts +205 -0
  72. package/dist/node_modules/@allyhub-next/formats/dist/data/deck-code.js +2 -0
  73. package/dist/node_modules/@allyhub-next/formats/dist/data/script.d.ts +4 -1
  74. package/dist/node_modules/@allyhub-next/formats/dist/data/script.js +1 -1
  75. package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.d.ts +69 -18
  76. package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.js +1 -1
  77. package/dist/node_modules/@allyhub-next/formats/dist/data/slides.d.ts +847 -116
  78. package/dist/node_modules/@allyhub-next/formats/dist/data/slides.js +1 -1
  79. package/dist/node_modules/@allyhub-next/formats/dist/data/website.d.ts +20 -0
  80. package/dist/node_modules/@allyhub-next/formats/dist/data/website.js +2 -0
  81. package/dist/node_modules/@allyhub-next/formats/dist/index.d.ts +3 -0
  82. package/dist/node_modules/@allyhub-next/formats/dist/index.js +1 -1
  83. package/dist/node_modules/@allyhub-next/formats/dist/items.d.ts +1 -1
  84. package/dist/node_modules/@allyhub-next/formats/dist/items.js +1 -1
  85. package/dist/node_modules/@allyhub-next/formats/dist/media-type.d.ts +3 -0
  86. package/dist/node_modules/@allyhub-next/formats/dist/media-type.js +2 -0
  87. package/dist/node_modules/@allyhub-next/formats/dist/schemas.d.ts +501 -38
  88. package/dist/node_modules/@allyhub-next/formats/dist/schemas.js +1 -1
  89. package/dist/node_modules/@allyhub-next/formats/dist/strict.d.ts +2 -0
  90. package/dist/node_modules/@allyhub-next/formats/dist/strict.js +1 -1
  91. package/dist/node_modules/@allyhub-next/formats/package.json +2 -1
  92. package/dist/node_modules/@allyhub-next/measure/package.json +1 -1
  93. package/dist/node_modules/@allyhub-next/media/dist/index.d.ts +1 -1
  94. package/dist/node_modules/@allyhub-next/media/dist/index.js +1 -1
  95. package/dist/node_modules/@allyhub-next/media/dist/sheet.d.ts +2 -0
  96. package/dist/node_modules/@allyhub-next/media/dist/sheet.js +7 -7
  97. package/dist/node_modules/@allyhub-next/media/package.json +1 -1
  98. package/dist/node_modules/@allyhub-next/model/package.json +1 -1
  99. package/dist/node_modules/@allyhub-next/ooxml/dist/brightness.d.ts +31 -0
  100. package/dist/node_modules/@allyhub-next/ooxml/dist/brightness.js +2 -0
  101. package/dist/node_modules/@allyhub-next/ooxml/dist/color.d.ts +33 -0
  102. package/dist/node_modules/@allyhub-next/ooxml/dist/color.js +2 -0
  103. package/dist/node_modules/@allyhub-next/ooxml/dist/enums.d.ts +13 -0
  104. package/dist/node_modules/@allyhub-next/ooxml/dist/enums.js +2 -0
  105. package/dist/node_modules/@allyhub-next/ooxml/dist/ext.d.ts +79 -0
  106. package/dist/node_modules/@allyhub-next/ooxml/dist/ext.js +2 -0
  107. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/enums.d.ts +132 -0
  108. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/enums.js +2 -0
  109. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/presets.d.ts +28 -0
  110. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/presets.js +2 -0
  111. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/spec.d.ts +4708 -0
  112. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/spec.js +2 -0
  113. package/dist/node_modules/@allyhub-next/ooxml/dist/geometry/index.d.ts +57 -0
  114. package/dist/node_modules/@allyhub-next/ooxml/dist/geometry/index.js +2 -0
  115. package/dist/node_modules/@allyhub-next/ooxml/dist/index.d.ts +10 -0
  116. package/dist/node_modules/@allyhub-next/ooxml/dist/index.js +2 -0
  117. package/dist/node_modules/@allyhub-next/ooxml/dist/mce.d.ts +12 -0
  118. package/dist/node_modules/@allyhub-next/ooxml/dist/mce.js +2 -0
  119. package/dist/node_modules/@allyhub-next/ooxml/dist/node.d.ts +111 -0
  120. package/dist/node_modules/@allyhub-next/ooxml/dist/node.js +2 -0
  121. package/dist/node_modules/@allyhub-next/ooxml/dist/ns.d.ts +45 -0
  122. package/dist/node_modules/@allyhub-next/ooxml/dist/ns.js +2 -0
  123. package/dist/node_modules/@allyhub-next/ooxml/dist/opc.d.ts +48 -0
  124. package/dist/node_modules/@allyhub-next/ooxml/dist/opc.js +2 -0
  125. package/dist/node_modules/@allyhub-next/ooxml/dist/report.d.ts +45 -0
  126. package/dist/node_modules/@allyhub-next/ooxml/dist/report.js +2 -0
  127. package/dist/node_modules/@allyhub-next/ooxml/dist/xml.d.ts +28 -0
  128. package/dist/node_modules/@allyhub-next/ooxml/dist/xml.js +2 -0
  129. package/dist/node_modules/@allyhub-next/ooxml/package.json +26 -0
  130. package/dist/node_modules/@allyhub-next/project/dist/deck-keys.js +2 -0
  131. package/dist/node_modules/@allyhub-next/project/dist/deck-measure.js +2 -0
  132. package/dist/node_modules/@allyhub-next/project/dist/deck-pool.js +2 -0
  133. package/dist/node_modules/@allyhub-next/project/dist/index.js +1 -1
  134. package/dist/node_modules/@allyhub-next/project/dist/session.js +1 -1
  135. package/dist/node_modules/@allyhub-next/project/dist/stills.js +2 -0
  136. package/dist/node_modules/@allyhub-next/project/package.json +1 -1
  137. package/dist/node_modules/@allyhub-next/protocol/dist/account.d.ts +338 -0
  138. package/dist/node_modules/@allyhub-next/protocol/dist/account.js +2 -0
  139. package/dist/node_modules/@allyhub-next/protocol/dist/auth.d.ts +12 -13
  140. package/dist/node_modules/@allyhub-next/protocol/dist/auth.js +1 -1
  141. package/dist/node_modules/@allyhub-next/protocol/dist/blobs.d.ts +35 -0
  142. package/dist/node_modules/@allyhub-next/protocol/dist/blobs.js +2 -0
  143. package/dist/node_modules/@allyhub-next/protocol/dist/cloud.d.ts +101 -32
  144. package/dist/node_modules/@allyhub-next/protocol/dist/cloud.js +1 -1
  145. package/dist/node_modules/@allyhub-next/protocol/dist/editor.d.ts +79 -5
  146. package/dist/node_modules/@allyhub-next/protocol/dist/editor.js +1 -1
  147. package/dist/node_modules/@allyhub-next/protocol/dist/files.d.ts +2 -2
  148. package/dist/node_modules/@allyhub-next/protocol/dist/index.d.ts +6 -0
  149. package/dist/node_modules/@allyhub-next/protocol/dist/index.js +1 -1
  150. package/dist/node_modules/@allyhub-next/protocol/dist/notes.d.ts +21 -0
  151. package/dist/node_modules/@allyhub-next/protocol/dist/notes.js +1 -1
  152. package/dist/node_modules/@allyhub-next/protocol/dist/open.d.ts +13 -0
  153. package/dist/node_modules/@allyhub-next/protocol/dist/open.js +2 -0
  154. package/dist/node_modules/@allyhub-next/protocol/dist/registry.d.ts +73 -59
  155. package/dist/node_modules/@allyhub-next/protocol/dist/registry.js +1 -1
  156. package/dist/node_modules/@allyhub-next/protocol/dist/routes.d.ts +1 -1
  157. package/dist/node_modules/@allyhub-next/protocol/dist/routes.js +1 -1
  158. package/dist/node_modules/@allyhub-next/protocol/dist/shares.d.ts +115 -0
  159. package/dist/node_modules/@allyhub-next/protocol/dist/shares.js +2 -0
  160. package/dist/node_modules/@allyhub-next/protocol/dist/sites.d.ts +293 -0
  161. package/dist/node_modules/@allyhub-next/protocol/dist/sites.js +2 -0
  162. package/dist/node_modules/@allyhub-next/protocol/dist/snapshots.d.ts +396 -0
  163. package/dist/node_modules/@allyhub-next/protocol/dist/snapshots.js +2 -0
  164. package/dist/node_modules/@allyhub-next/protocol/dist/teams.d.ts +27 -9
  165. package/dist/node_modules/@allyhub-next/protocol/dist/teams.js +1 -1
  166. package/dist/node_modules/@allyhub-next/protocol/dist/tools.d.ts +53 -14
  167. package/dist/node_modules/@allyhub-next/protocol/dist/tools.js +1 -1
  168. package/dist/node_modules/@allyhub-next/protocol/package.json +2 -1
  169. package/dist/node_modules/@allyhub-next/registry/package.json +1 -1
  170. package/dist/node_modules/@allyhub-next/render/dist/doc/fonts.js +3 -2
  171. package/dist/node_modules/@allyhub-next/render/dist/doc/index.js +1 -1
  172. package/dist/node_modules/@allyhub-next/render/dist/doc/pdf.js +34 -0
  173. package/dist/node_modules/@allyhub-next/render/dist/doc/print.js +4 -4
  174. package/dist/node_modules/@allyhub-next/render/dist/exports.js +2 -2
  175. package/dist/node_modules/@allyhub-next/render/dist/pdf.js +2 -0
  176. package/dist/node_modules/@allyhub-next/render/package.json +1 -1
  177. package/dist/node_modules/@allyhub-next/runtime/dist/fonts.js +1 -1
  178. package/dist/node_modules/@allyhub-next/runtime/dist/music.js +1 -1
  179. package/dist/node_modules/@allyhub-next/runtime/package.json +1 -1
  180. package/dist/node_modules/@allyhub-next/runtimes/dist/download.d.ts +19 -1
  181. package/dist/node_modules/@allyhub-next/runtimes/dist/download.js +1 -1
  182. package/dist/node_modules/@allyhub-next/runtimes/dist/index.d.ts +2 -2
  183. package/dist/node_modules/@allyhub-next/runtimes/dist/index.js +1 -1
  184. package/dist/node_modules/@allyhub-next/runtimes/dist/lock.d.ts +6 -0
  185. package/dist/node_modules/@allyhub-next/runtimes/dist/lock.js +1 -1
  186. package/dist/node_modules/@allyhub-next/runtimes/dist/packages.d.ts +19 -2
  187. package/dist/node_modules/@allyhub-next/runtimes/dist/packages.js +3 -3
  188. package/dist/node_modules/@allyhub-next/runtimes/dist/runtimes.d.ts +3 -0
  189. package/dist/node_modules/@allyhub-next/runtimes/dist/runtimes.js +3 -3
  190. package/dist/node_modules/@allyhub-next/runtimes/package.json +1 -1
  191. package/dist/node_modules/@allyhub-next/runtimes/schemas/runtimes.schema.json +25 -5
  192. package/dist/node_modules/@allyhub-next/scaffold/dist/index.js +4 -4
  193. package/dist/node_modules/@allyhub-next/scaffold/package.json +1 -1
  194. package/dist/node_modules/@allyhub-next/scenery/package.json +1 -1
  195. package/dist/node_modules/@allyhub-next/scenery-host/dist/bundle.d.ts +10 -0
  196. package/dist/node_modules/@allyhub-next/scenery-host/dist/bundle.js +3 -3
  197. package/dist/node_modules/@allyhub-next/scenery-host/package.json +1 -1
  198. package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.d.ts +9 -3
  199. package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.js +1 -1
  200. package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.d.ts +5 -1
  201. package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.js +1 -1
  202. package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.d.ts +60 -13
  203. package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.js +1 -1
  204. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/aggregate.js +1 -1
  205. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/convert.d.ts +4 -0
  206. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/convert.js +2 -0
  207. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/criteria.js +1 -1
  208. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/database.js +1 -1
  209. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/date.js +1 -1
  210. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.d.ts +27 -1
  211. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.js +1 -1
  212. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/delimiters.d.ts +16 -0
  213. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/delimiters.js +2 -0
  214. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.d.ts +18 -1
  215. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.js +1 -1
  216. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/finance.js +1 -1
  217. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.d.ts +2 -0
  218. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.js +1 -1
  219. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/info.js +1 -1
  220. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/kernels.js +1 -1
  221. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/logical.js +1 -1
  222. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/lookup.js +1 -1
  223. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/maths.js +1 -1
  224. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/modern.d.ts +2 -0
  225. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/modern.js +2 -0
  226. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/text.js +1 -1
  227. package/dist/node_modules/@allyhub-next/sheet/dist/calc/graph.d.ts +38 -0
  228. package/dist/node_modules/@allyhub-next/sheet/dist/calc/graph.js +2 -0
  229. package/dist/node_modules/@allyhub-next/sheet/dist/calc/indexes.d.ts +19 -0
  230. package/dist/node_modules/@allyhub-next/sheet/dist/calc/indexes.js +2 -0
  231. package/dist/node_modules/@allyhub-next/sheet/dist/calc/remote.d.ts +49 -0
  232. package/dist/node_modules/@allyhub-next/sheet/dist/calc/remote.js +2 -0
  233. package/dist/node_modules/@allyhub-next/sheet/dist/calc/server.d.ts +82 -0
  234. package/dist/node_modules/@allyhub-next/sheet/dist/calc/server.js +2 -0
  235. package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.d.ts +6 -1
  236. package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.js +1 -1
  237. package/dist/node_modules/@allyhub-next/sheet/dist/chart.js +1 -1
  238. package/dist/node_modules/@allyhub-next/sheet/dist/check.js +1 -1
  239. package/dist/node_modules/@allyhub-next/sheet/dist/diff.d.ts +15 -0
  240. package/dist/node_modules/@allyhub-next/sheet/dist/diff.js +1 -1
  241. package/dist/node_modules/@allyhub-next/sheet/dist/export.d.ts +29 -8
  242. package/dist/node_modules/@allyhub-next/sheet/dist/export.js +3 -4
  243. package/dist/node_modules/@allyhub-next/sheet/dist/file.js +2 -2
  244. package/dist/node_modules/@allyhub-next/sheet/dist/format.d.ts +8 -2
  245. package/dist/node_modules/@allyhub-next/sheet/dist/format.js +1 -1
  246. package/dist/node_modules/@allyhub-next/sheet/dist/html.d.ts +52 -4
  247. package/dist/node_modules/@allyhub-next/sheet/dist/html.js +43 -11
  248. package/dist/node_modules/@allyhub-next/sheet/dist/index.d.ts +7 -3
  249. package/dist/node_modules/@allyhub-next/sheet/dist/index.js +1 -1
  250. package/dist/node_modules/@allyhub-next/sheet/dist/inspect.js +1 -1
  251. package/dist/node_modules/@allyhub-next/sheet/dist/paginate.d.ts +98 -0
  252. package/dist/node_modules/@allyhub-next/sheet/dist/paginate.js +2 -0
  253. package/dist/node_modules/@allyhub-next/sheet/dist/structure.js +1 -1
  254. package/dist/node_modules/@allyhub-next/sheet/dist/table-style.d.ts +32 -0
  255. package/dist/node_modules/@allyhub-next/sheet/dist/table-style.js +2 -0
  256. package/dist/node_modules/@allyhub-next/sheet/dist/table-styles.d.ts +3 -0
  257. package/dist/node_modules/@allyhub-next/sheet/dist/table-styles.js +2 -0
  258. package/dist/node_modules/@allyhub-next/sheet/dist/values.js +1 -1
  259. package/dist/node_modules/@allyhub-next/sheet/dist/workbook.d.ts +10 -1
  260. package/dist/node_modules/@allyhub-next/sheet/dist/workbook.js +1 -1
  261. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.d.ts +10 -1
  262. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.js +1 -1
  263. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.d.ts +14 -4
  264. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.js +2 -2
  265. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.d.ts +11 -1
  266. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.js +36 -16
  267. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.d.ts +3 -1
  268. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.js +1 -1
  269. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.d.ts +42 -1
  270. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.js +2 -1
  271. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/sax.d.ts +23 -0
  272. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/sax.js +2 -0
  273. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.d.ts +2 -0
  274. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.js +1 -1
  275. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.d.ts +6 -0
  276. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.js +1 -1
  277. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/zip.d.ts +40 -0
  278. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/zip.js +2 -0
  279. package/dist/node_modules/@allyhub-next/sheet/package.json +1 -1
  280. package/dist/node_modules/@allyhub-next/slides-core/dist/animation.js +1 -1
  281. package/dist/node_modules/@allyhub-next/slides-core/dist/api.d.ts +59 -39
  282. package/dist/node_modules/@allyhub-next/slides-core/dist/api.js +2 -2
  283. package/dist/node_modules/@allyhub-next/slides-core/dist/capabilities.js +1 -1
  284. package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.d.ts +27 -13
  285. package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.js +1 -1
  286. package/dist/node_modules/@allyhub-next/slides-core/dist/check.js +1 -1
  287. package/dist/node_modules/@allyhub-next/slides-core/dist/code.d.ts +33 -0
  288. package/dist/node_modules/@allyhub-next/slides-core/dist/code.js +2 -0
  289. package/dist/node_modules/@allyhub-next/slides-core/dist/components.d.ts +31 -0
  290. package/dist/node_modules/@allyhub-next/slides-core/dist/components.js +2 -0
  291. package/dist/node_modules/@allyhub-next/slides-core/dist/enums.d.ts +179 -16
  292. package/dist/node_modules/@allyhub-next/slides-core/dist/enums.js +1 -1
  293. package/dist/node_modules/@allyhub-next/slides-core/dist/file.d.ts +43 -21
  294. package/dist/node_modules/@allyhub-next/slides-core/dist/file.js +3 -3
  295. package/dist/node_modules/@allyhub-next/slides-core/dist/identity.d.ts +17 -0
  296. package/dist/node_modules/@allyhub-next/slides-core/dist/identity.js +2 -0
  297. package/dist/node_modules/@allyhub-next/slides-core/dist/index.d.ts +5 -1
  298. package/dist/node_modules/@allyhub-next/slides-core/dist/index.js +1 -1
  299. package/dist/node_modules/@allyhub-next/slides-core/dist/lang.d.ts +6 -0
  300. package/dist/node_modules/@allyhub-next/slides-core/dist/lang.js +2 -0
  301. package/dist/node_modules/@allyhub-next/slides-core/dist/measure.js +1 -1
  302. package/dist/node_modules/@allyhub-next/slides-core/dist/merge.d.ts +58 -0
  303. package/dist/node_modules/@allyhub-next/slides-core/dist/merge.js +2 -0
  304. package/dist/node_modules/@allyhub-next/slides-core/dist/model.d.ts +2 -4
  305. package/dist/node_modules/@allyhub-next/slides-core/dist/office.d.ts +17 -1
  306. package/dist/node_modules/@allyhub-next/slides-core/dist/office.js +1 -1
  307. package/dist/node_modules/@allyhub-next/slides-core/dist/resolve.d.ts +21 -5
  308. package/dist/node_modules/@allyhub-next/slides-core/dist/resolve.js +1 -1
  309. package/dist/node_modules/@allyhub-next/slides-core/dist/script.d.ts +18 -16
  310. package/dist/node_modules/@allyhub-next/slides-core/dist/script.js +2 -2
  311. package/dist/node_modules/@allyhub-next/slides-core/dist/stage.d.ts +51 -53
  312. package/dist/node_modules/@allyhub-next/slides-core/dist/strict.js +1 -1
  313. package/dist/node_modules/@allyhub-next/slides-core/dist/units.d.ts +27 -0
  314. package/dist/node_modules/@allyhub-next/slides-core/dist/units.js +1 -1
  315. package/dist/node_modules/@allyhub-next/slides-core/dist/values.d.ts +7 -0
  316. package/dist/node_modules/@allyhub-next/slides-core/dist/values.js +2 -0
  317. package/dist/node_modules/@allyhub-next/slides-core/package.json +1 -1
  318. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/code.js +4 -0
  319. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/index.js +3 -0
  320. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/names.js +2 -0
  321. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/script.js +2 -0
  322. package/dist/node_modules/@allyhub-next/slides-pptx/dist/index.js +1 -1
  323. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/chart.js +2 -0
  324. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/common.js +2 -0
  325. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/index.js +4 -0
  326. package/dist/{site.js → node_modules/@allyhub-next/slides-pptx/dist/read/model.js} +1 -1
  327. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/shapes.js +2 -0
  328. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/table.js +2 -0
  329. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/text.js +2 -0
  330. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/timing.js +2 -0
  331. package/dist/node_modules/@allyhub-next/slides-pptx/dist/shapes.js +1 -1
  332. package/dist/node_modules/@allyhub-next/slides-pptx/dist/text.js +1 -1
  333. package/dist/node_modules/@allyhub-next/slides-pptx/dist/theme.js +1 -1
  334. package/dist/node_modules/@allyhub-next/slides-pptx/dist/timing.js +1 -1
  335. package/dist/node_modules/@allyhub-next/slides-pptx/dist/write.js +2 -2
  336. package/dist/node_modules/@allyhub-next/slides-pptx/dist/xml.js +2 -2
  337. package/dist/node_modules/@allyhub-next/slides-pptx/package.json +1 -1
  338. package/dist/node_modules/@allyhub-next/slides-runtime/dist/component.js +2 -0
  339. package/dist/node_modules/@allyhub-next/slides-runtime/dist/draw.js +2 -2
  340. package/dist/node_modules/@allyhub-next/slides-runtime/dist/index.js +1 -1
  341. package/dist/node_modules/@allyhub-next/slides-runtime/dist/load.js +5 -5
  342. package/dist/node_modules/@allyhub-next/slides-runtime/package.json +5 -1
  343. package/dist/node_modules/@allyhub-next/stage/dist/index.js +1 -1
  344. package/dist/node_modules/@allyhub-next/stage/dist/page.js +22 -12
  345. package/dist/node_modules/@allyhub-next/stage/dist/scenery-page.js +5 -5
  346. package/dist/node_modules/@allyhub-next/stage/dist/server.js +1 -1
  347. package/dist/node_modules/@allyhub-next/stage/package.json +1 -1
  348. package/dist/node_modules/@allyhub-next/stage-page/dist/host.js +1 -20
  349. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/probe.html +8 -0
  350. package/dist/{astro.js → node_modules/@allyhub-next/stage-page/dist/runtime/probe.js} +1 -1
  351. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/runtime.js +79 -0
  352. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/stage.html +21 -0
  353. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/stage.js +3 -0
  354. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/viewer.html +9 -0
  355. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/viewer.js +3 -0
  356. package/dist/node_modules/@allyhub-next/stage-page/package.json +2 -3
  357. package/dist/node_modules/@allyhub-next/video-core/dist/captions.js +6 -6
  358. package/dist/node_modules/@allyhub-next/video-core/dist/fact.d.ts +47 -8
  359. package/dist/node_modules/@allyhub-next/video-core/dist/fact.js +1 -1
  360. package/dist/node_modules/@allyhub-next/video-core/dist/index.d.ts +1 -0
  361. package/dist/node_modules/@allyhub-next/video-core/dist/index.js +1 -1
  362. package/dist/node_modules/@allyhub-next/video-core/dist/marks.d.ts +14 -0
  363. package/dist/node_modules/@allyhub-next/video-core/dist/marks.js +1 -1
  364. package/dist/node_modules/@allyhub-next/video-core/dist/music.d.ts +2 -1
  365. package/dist/node_modules/@allyhub-next/video-core/dist/piece.d.ts +11 -2
  366. package/dist/node_modules/@allyhub-next/video-core/dist/problem.d.ts +4 -0
  367. package/dist/node_modules/@allyhub-next/video-core/dist/problem.js +1 -1
  368. package/dist/node_modules/@allyhub-next/video-core/dist/schema.d.ts +2 -2
  369. package/dist/node_modules/@allyhub-next/video-core/dist/schema.js +1 -1
  370. package/dist/node_modules/@allyhub-next/video-core/dist/script.d.ts +2 -1
  371. package/dist/node_modules/@allyhub-next/video-core/dist/script.js +1 -1
  372. package/dist/node_modules/@allyhub-next/video-core/dist/source.d.ts +7 -0
  373. package/dist/node_modules/@allyhub-next/video-core/dist/source.js +2 -0
  374. package/dist/node_modules/@allyhub-next/video-core/dist/timeline.d.ts +10 -33
  375. package/dist/node_modules/@allyhub-next/video-core/package.json +1 -1
  376. package/dist/node_modules/@allyhub-next/website/LICENSE +241 -0
  377. package/dist/node_modules/@allyhub-next/website/dist/index.js +2 -0
  378. package/dist/node_modules/@allyhub-next/website/dist/publish.js +3 -0
  379. package/dist/node_modules/@allyhub-next/website/dist/rules.js +2 -0
  380. package/dist/node_modules/@allyhub-next/website/dist/website.js +4 -0
  381. package/dist/node_modules/@allyhub-next/website/package.json +13 -0
  382. package/dist/text/facts-text.js +4 -4
  383. package/dist/works.js +1 -1
  384. package/editor-web/assets/calc-worker-Bz9r26p1.js +158 -0
  385. package/editor-web/assets/dist-B-BI8jma.js +37 -0
  386. package/editor-web/assets/dist-CS-Z5JSF.js +224 -0
  387. package/editor-web/assets/dist-ClE1xUdI.js +10 -0
  388. package/editor-web/assets/dist-Cqu9f1N5.js +1 -0
  389. package/editor-web/assets/dist-CsDICOqP.js +36 -0
  390. package/editor-web/assets/dist-DegNYCaB.js +10 -0
  391. package/editor-web/assets/dist-EotuIcA_.js +2 -0
  392. package/editor-web/assets/index-CwDs3z43.js +69 -0
  393. package/editor-web/assets/index-ujKjdu_s.css +2 -0
  394. package/editor-web/assets/minus-DLhpe7h_.js +1 -0
  395. package/editor-web/assets/react-CT8OUeCe.js +101 -0
  396. package/editor-web/assets/tabs-BEPTOFm5.js +105 -0
  397. package/editor-web/assets/text-align-start-CfqIQSWH.js +1 -0
  398. package/editor-web/index.html +5 -5
  399. package/package.json +8 -14
  400. package/dist/astro.d.ts +0 -2
  401. package/dist/node_modules/@allyhub-next/audio/dist/at-cut.d.ts +0 -52
  402. package/dist/node_modules/@allyhub-next/audio/dist/decode.d.ts +0 -33
  403. package/dist/node_modules/@allyhub-next/audio/dist/envelope.d.ts +0 -37
  404. package/dist/node_modules/@allyhub-next/audio/dist/index.d.ts +0 -17
  405. package/dist/node_modules/@allyhub-next/audio/dist/levels.d.ts +0 -97
  406. package/dist/node_modules/@allyhub-next/audio/dist/master.d.ts +0 -29
  407. package/dist/node_modules/@allyhub-next/audio/dist/music.d.ts +0 -11
  408. package/dist/node_modules/@allyhub-next/audio/dist/node/decode.d.ts +0 -39
  409. package/dist/node_modules/@allyhub-next/audio/dist/node/ebur128.d.ts +0 -25
  410. package/dist/node_modules/@allyhub-next/audio/dist/node/ffmpeg.d.ts +0 -31
  411. package/dist/node_modules/@allyhub-next/audio/dist/node/index.d.ts +0 -8
  412. package/dist/node_modules/@allyhub-next/audio/dist/node/loudness.d.ts +0 -18
  413. package/dist/node_modules/@allyhub-next/audio/dist/node/master.d.ts +0 -42
  414. package/dist/node_modules/@allyhub-next/audio/dist/node/measure.d.ts +0 -60
  415. package/dist/node_modules/@allyhub-next/audio/dist/node/mix.d.ts +0 -31
  416. package/dist/node_modules/@allyhub-next/audio/dist/plan.d.ts +0 -143
  417. package/dist/node_modules/@allyhub-next/audio/dist/recorded.d.ts +0 -26
  418. package/dist/node_modules/@allyhub-next/audio/dist/recording/bandwidth.d.ts +0 -47
  419. package/dist/node_modules/@allyhub-next/audio/dist/recording/chain.d.ts +0 -89
  420. package/dist/node_modules/@allyhub-next/audio/dist/recording/dynamics.d.ts +0 -64
  421. package/dist/node_modules/@allyhub-next/audio/dist/recording/fft.d.ts +0 -26
  422. package/dist/node_modules/@allyhub-next/audio/dist/recording/filters.d.ts +0 -42
  423. package/dist/node_modules/@allyhub-next/audio/dist/recording/fit.d.ts +0 -56
  424. package/dist/node_modules/@allyhub-next/audio/dist/recording/index.d.ts +0 -10
  425. package/dist/node_modules/@allyhub-next/audio/dist/recording/loudness.d.ts +0 -12
  426. package/dist/node_modules/@allyhub-next/audio/dist/recording/measure.d.ts +0 -67
  427. package/dist/node_modules/@allyhub-next/audio/dist/recording/mic.d.ts +0 -32
  428. package/dist/node_modules/@allyhub-next/audio/dist/recording/noise.d.ts +0 -27
  429. package/dist/node_modules/@allyhub-next/audio/dist/recording/presets.d.ts +0 -64
  430. package/dist/node_modules/@allyhub-next/audio/dist/recording/room.d.ts +0 -78
  431. package/dist/node_modules/@allyhub-next/audio/dist/recording/setup.d.ts +0 -111
  432. package/dist/node_modules/@allyhub-next/audio/dist/recording/vec.d.ts +0 -3
  433. package/dist/node_modules/@allyhub-next/audio/dist/render.d.ts +0 -26
  434. package/dist/node_modules/@allyhub-next/audio/dist/sfx.d.ts +0 -10
  435. package/dist/node_modules/@allyhub-next/audio/dist/shape.d.ts +0 -118
  436. package/dist/node_modules/@allyhub-next/audio/dist/voice.d.ts +0 -45
  437. package/dist/node_modules/@allyhub-next/browser/dist/browser.d.ts +0 -24
  438. package/dist/node_modules/@allyhub-next/browser/dist/capture.d.ts +0 -61
  439. package/dist/node_modules/@allyhub-next/browser/dist/cdp.d.ts +0 -51
  440. package/dist/node_modules/@allyhub-next/browser/dist/flags.d.ts +0 -13
  441. package/dist/node_modules/@allyhub-next/browser/dist/frames.d.ts +0 -35
  442. package/dist/node_modules/@allyhub-next/browser/dist/html.d.ts +0 -19
  443. package/dist/node_modules/@allyhub-next/browser/dist/index.d.ts +0 -10
  444. package/dist/node_modules/@allyhub-next/browser/dist/launch.d.ts +0 -35
  445. package/dist/node_modules/@allyhub-next/browser/dist/page.d.ts +0 -67
  446. package/dist/node_modules/@allyhub-next/browser/dist/server.d.ts +0 -26
  447. package/dist/node_modules/@allyhub-next/check/dist/cache.d.ts +0 -46
  448. package/dist/node_modules/@allyhub-next/check/dist/check.d.ts +0 -142
  449. package/dist/node_modules/@allyhub-next/check/dist/generated.d.ts +0 -22
  450. package/dist/node_modules/@allyhub-next/check/dist/index.d.ts +0 -7
  451. package/dist/node_modules/@allyhub-next/check/dist/plans.d.ts +0 -111
  452. package/dist/node_modules/@allyhub-next/check/dist/result.d.ts +0 -12
  453. package/dist/node_modules/@allyhub-next/check/dist/scenery.d.ts +0 -23
  454. package/dist/node_modules/@allyhub-next/dev-server/dist/background.d.ts +0 -50
  455. package/dist/node_modules/@allyhub-next/dev-server/dist/card.d.ts +0 -17
  456. package/dist/node_modules/@allyhub-next/dev-server/dist/exports.d.ts +0 -18
  457. package/dist/node_modules/@allyhub-next/dev-server/dist/index.d.ts +0 -11
  458. package/dist/node_modules/@allyhub-next/dev-server/dist/live.d.ts +0 -77
  459. package/dist/node_modules/@allyhub-next/dev-server/dist/mime.d.ts +0 -2
  460. package/dist/node_modules/@allyhub-next/dev-server/dist/mime.js +0 -2
  461. package/dist/node_modules/@allyhub-next/dev-server/dist/paths.d.ts +0 -27
  462. package/dist/node_modules/@allyhub-next/dev-server/dist/project.d.ts +0 -153
  463. package/dist/node_modules/@allyhub-next/dev-server/dist/reveal.d.ts +0 -6
  464. package/dist/node_modules/@allyhub-next/dev-server/dist/server.d.ts +0 -47
  465. package/dist/node_modules/@allyhub-next/dev-server/dist/sound.d.ts +0 -21
  466. package/dist/node_modules/@allyhub-next/dev-server/dist/stage.d.ts +0 -82
  467. package/dist/node_modules/@allyhub-next/dev-server/dist/stage.js +0 -121
  468. package/dist/node_modules/@allyhub-next/dev-server/dist/tools.d.ts +0 -24
  469. package/dist/node_modules/@allyhub-next/dev-server/dist/validate.d.ts +0 -6
  470. package/dist/node_modules/@allyhub-next/dev-server/dist/watcher.d.ts +0 -47
  471. package/dist/node_modules/@allyhub-next/dev-server/dist/writer.d.ts +0 -51
  472. package/dist/node_modules/@allyhub-next/export/dist/batch.d.ts +0 -70
  473. package/dist/node_modules/@allyhub-next/export/dist/deck-fonts.d.ts +0 -24
  474. package/dist/node_modules/@allyhub-next/export/dist/deck-pptx.d.ts +0 -12
  475. package/dist/node_modules/@allyhub-next/export/dist/export.d.ts +0 -123
  476. package/dist/node_modules/@allyhub-next/export/dist/index.d.ts +0 -5
  477. package/dist/node_modules/@allyhub-next/export/dist/names.d.ts +0 -36
  478. package/dist/node_modules/@allyhub-next/measure/dist/compare.d.ts +0 -195
  479. package/dist/node_modules/@allyhub-next/measure/dist/contrast.d.ts +0 -14
  480. package/dist/node_modules/@allyhub-next/measure/dist/cut-sheet.d.ts +0 -90
  481. package/dist/node_modules/@allyhub-next/measure/dist/cuts.d.ts +0 -108
  482. package/dist/node_modules/@allyhub-next/measure/dist/facts.d.ts +0 -60
  483. package/dist/node_modules/@allyhub-next/measure/dist/fidelity.d.ts +0 -40
  484. package/dist/node_modules/@allyhub-next/measure/dist/flat.d.ts +0 -42
  485. package/dist/node_modules/@allyhub-next/measure/dist/index.d.ts +0 -24
  486. package/dist/node_modules/@allyhub-next/measure/dist/loop.d.ts +0 -22
  487. package/dist/node_modules/@allyhub-next/measure/dist/overlay.d.ts +0 -57
  488. package/dist/node_modules/@allyhub-next/measure/dist/recording-report.d.ts +0 -66
  489. package/dist/node_modules/@allyhub-next/measure/dist/reference/compare.d.ts +0 -118
  490. package/dist/node_modules/@allyhub-next/measure/dist/reference/folder.d.ts +0 -75
  491. package/dist/node_modules/@allyhub-next/measure/dist/reference/interpret.d.ts +0 -39
  492. package/dist/node_modules/@allyhub-next/measure/dist/reference/piece.d.ts +0 -53
  493. package/dist/node_modules/@allyhub-next/measure/dist/reference/sections.d.ts +0 -53
  494. package/dist/node_modules/@allyhub-next/measure/dist/reference/sets.d.ts +0 -84
  495. package/dist/node_modules/@allyhub-next/measure/dist/reference/text.d.ts +0 -27
  496. package/dist/node_modules/@allyhub-next/measure/dist/reference/video.d.ts +0 -55
  497. package/dist/node_modules/@allyhub-next/measure/dist/seams.d.ts +0 -46
  498. package/dist/node_modules/@allyhub-next/measure/dist/sound-measures.d.ts +0 -74
  499. package/dist/node_modules/@allyhub-next/measure/dist/sound-report.d.ts +0 -156
  500. package/dist/node_modules/@allyhub-next/measure/dist/still.d.ts +0 -58
  501. package/dist/node_modules/@allyhub-next/measure/dist/version-voice.d.ts +0 -12
  502. package/dist/node_modules/@allyhub-next/project/dist/console.d.ts +0 -34
  503. package/dist/node_modules/@allyhub-next/project/dist/digest.d.ts +0 -9
  504. package/dist/node_modules/@allyhub-next/project/dist/index.d.ts +0 -11
  505. package/dist/node_modules/@allyhub-next/project/dist/ledger.d.ts +0 -17
  506. package/dist/node_modules/@allyhub-next/project/dist/media-index.d.ts +0 -27
  507. package/dist/node_modules/@allyhub-next/project/dist/page.d.ts +0 -119
  508. package/dist/node_modules/@allyhub-next/project/dist/says.d.ts +0 -15
  509. package/dist/node_modules/@allyhub-next/project/dist/scenery.d.ts +0 -35
  510. package/dist/node_modules/@allyhub-next/project/dist/session.d.ts +0 -37
  511. package/dist/node_modules/@allyhub-next/project/dist/stretch.d.ts +0 -38
  512. package/dist/node_modules/@allyhub-next/project/dist/version.d.ts +0 -114
  513. package/dist/node_modules/@allyhub-next/render/dist/cap.d.ts +0 -41
  514. package/dist/node_modules/@allyhub-next/render/dist/capture.d.ts +0 -78
  515. package/dist/node_modules/@allyhub-next/render/dist/clip.d.ts +0 -27
  516. package/dist/node_modules/@allyhub-next/render/dist/composite.d.ts +0 -106
  517. package/dist/node_modules/@allyhub-next/render/dist/delivery.d.ts +0 -18
  518. package/dist/node_modules/@allyhub-next/render/dist/doc/fonts.d.ts +0 -3
  519. package/dist/node_modules/@allyhub-next/render/dist/doc/index.d.ts +0 -3
  520. package/dist/node_modules/@allyhub-next/render/dist/doc/print.d.ts +0 -51
  521. package/dist/node_modules/@allyhub-next/render/dist/encode.d.ts +0 -111
  522. package/dist/node_modules/@allyhub-next/render/dist/errors.d.ts +0 -15
  523. package/dist/node_modules/@allyhub-next/render/dist/exports.d.ts +0 -67
  524. package/dist/node_modules/@allyhub-next/render/dist/ffmpeg.d.ts +0 -75
  525. package/dist/node_modules/@allyhub-next/render/dist/footage.d.ts +0 -169
  526. package/dist/node_modules/@allyhub-next/render/dist/image.d.ts +0 -16
  527. package/dist/node_modules/@allyhub-next/render/dist/index.d.ts +0 -26
  528. package/dist/node_modules/@allyhub-next/render/dist/junction.d.ts +0 -70
  529. package/dist/node_modules/@allyhub-next/render/dist/look.d.ts +0 -21
  530. package/dist/node_modules/@allyhub-next/render/dist/page.d.ts +0 -178
  531. package/dist/node_modules/@allyhub-next/render/dist/parts.d.ts +0 -140
  532. package/dist/node_modules/@allyhub-next/render/dist/png.d.ts +0 -37
  533. package/dist/node_modules/@allyhub-next/render/dist/pool.d.ts +0 -54
  534. package/dist/node_modules/@allyhub-next/render/dist/post-probe.d.ts +0 -27
  535. package/dist/node_modules/@allyhub-next/render/dist/post.d.ts +0 -27
  536. package/dist/node_modules/@allyhub-next/render/dist/render.d.ts +0 -151
  537. package/dist/node_modules/@allyhub-next/render/dist/segments.d.ts +0 -40
  538. package/dist/node_modules/@allyhub-next/render/dist/sound.d.ts +0 -24
  539. package/dist/node_modules/@allyhub-next/render/dist/stills.d.ts +0 -41
  540. package/dist/node_modules/@allyhub-next/render/dist/tools.d.ts +0 -25
  541. package/dist/node_modules/@allyhub-next/render/dist/webp.d.ts +0 -17
  542. package/dist/node_modules/@allyhub-next/runtime/dist/bridge.d.ts +0 -211
  543. package/dist/node_modules/@allyhub-next/runtime/dist/captions.d.ts +0 -24
  544. package/dist/node_modules/@allyhub-next/runtime/dist/clock.d.ts +0 -32
  545. package/dist/node_modules/@allyhub-next/runtime/dist/compose.d.ts +0 -149
  546. package/dist/node_modules/@allyhub-next/runtime/dist/console.d.ts +0 -21
  547. package/dist/node_modules/@allyhub-next/runtime/dist/contrast.d.ts +0 -13
  548. package/dist/node_modules/@allyhub-next/runtime/dist/embed.d.ts +0 -50
  549. package/dist/node_modules/@allyhub-next/runtime/dist/env.d.ts +0 -101
  550. package/dist/node_modules/@allyhub-next/runtime/dist/errors.d.ts +0 -21
  551. package/dist/node_modules/@allyhub-next/runtime/dist/facade.d.ts +0 -42
  552. package/dist/node_modules/@allyhub-next/runtime/dist/fonts.d.ts +0 -110
  553. package/dist/node_modules/@allyhub-next/runtime/dist/footage.d.ts +0 -52
  554. package/dist/node_modules/@allyhub-next/runtime/dist/frame.d.ts +0 -61
  555. package/dist/node_modules/@allyhub-next/runtime/dist/guards.d.ts +0 -32
  556. package/dist/node_modules/@allyhub-next/runtime/dist/index.d.ts +0 -14
  557. package/dist/node_modules/@allyhub-next/runtime/dist/inspect.d.ts +0 -112
  558. package/dist/node_modules/@allyhub-next/runtime/dist/locate.d.ts +0 -11
  559. package/dist/node_modules/@allyhub-next/runtime/dist/measure.d.ts +0 -41
  560. package/dist/node_modules/@allyhub-next/runtime/dist/mix-plan.d.ts +0 -42
  561. package/dist/node_modules/@allyhub-next/runtime/dist/music.d.ts +0 -29
  562. package/dist/node_modules/@allyhub-next/runtime/dist/output.d.ts +0 -5
  563. package/dist/node_modules/@allyhub-next/runtime/dist/pictures.d.ts +0 -39
  564. package/dist/node_modules/@allyhub-next/runtime/dist/piece.d.ts +0 -34
  565. package/dist/node_modules/@allyhub-next/runtime/dist/player/clips.d.ts +0 -41
  566. package/dist/node_modules/@allyhub-next/runtime/dist/player/cutout.d.ts +0 -57
  567. package/dist/node_modules/@allyhub-next/runtime/dist/player/player.d.ts +0 -78
  568. package/dist/node_modules/@allyhub-next/runtime/dist/reads.d.ts +0 -132
  569. package/dist/node_modules/@allyhub-next/runtime/dist/sound.d.ts +0 -22
  570. package/dist/node_modules/@allyhub-next/runtime/dist/speech.d.ts +0 -107
  571. package/dist/node_modules/@allyhub-next/runtime/dist/stage-kit.d.ts +0 -12
  572. package/dist/node_modules/@allyhub-next/runtime/dist/stage.d.ts +0 -34
  573. package/dist/node_modules/@allyhub-next/runtime/dist/styles.d.ts +0 -35
  574. package/dist/node_modules/@allyhub-next/runtime/dist/takes.d.ts +0 -72
  575. package/dist/node_modules/@allyhub-next/runtime/dist/titles.d.ts +0 -10
  576. package/dist/node_modules/@allyhub-next/runtime/dist/transitions.d.ts +0 -26
  577. package/dist/node_modules/@allyhub-next/site/dist/assets.d.ts +0 -59
  578. package/dist/node_modules/@allyhub-next/site/dist/assets.js +0 -2
  579. package/dist/node_modules/@allyhub-next/site/dist/astro.d.ts +0 -22
  580. package/dist/node_modules/@allyhub-next/site/dist/astro.js +0 -3
  581. package/dist/node_modules/@allyhub-next/site/dist/lockfile.d.ts +0 -40
  582. package/dist/node_modules/@allyhub-next/site/dist/lockfile.js +0 -3
  583. package/dist/node_modules/@allyhub-next/site/dist/media.d.ts +0 -24
  584. package/dist/node_modules/@allyhub-next/site/dist/media.js +0 -4
  585. package/dist/node_modules/@allyhub-next/site/package.json +0 -25
  586. package/dist/node_modules/@allyhub-next/slides-core/dist/preset.d.ts +0 -5
  587. package/dist/node_modules/@allyhub-next/slides-core/dist/preset.js +0 -2
  588. package/dist/node_modules/@allyhub-next/slides-pptx/dist/charts.d.ts +0 -6
  589. package/dist/node_modules/@allyhub-next/slides-pptx/dist/fonts.d.ts +0 -45
  590. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import.d.ts +0 -18
  591. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import.js +0 -3
  592. package/dist/node_modules/@allyhub-next/slides-pptx/dist/index.d.ts +0 -5
  593. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read.d.ts +0 -56
  594. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read.js +0 -4
  595. package/dist/node_modules/@allyhub-next/slides-pptx/dist/shapes.d.ts +0 -72
  596. package/dist/node_modules/@allyhub-next/slides-pptx/dist/text.d.ts +0 -32
  597. package/dist/node_modules/@allyhub-next/slides-pptx/dist/theme.d.ts +0 -4
  598. package/dist/node_modules/@allyhub-next/slides-pptx/dist/timing.d.ts +0 -32
  599. package/dist/node_modules/@allyhub-next/slides-pptx/dist/write.d.ts +0 -32
  600. package/dist/node_modules/@allyhub-next/slides-pptx/dist/xml.d.ts +0 -32
  601. package/dist/node_modules/@allyhub-next/slides-runtime/dist/draw.d.ts +0 -43
  602. package/dist/node_modules/@allyhub-next/slides-runtime/dist/edit.d.ts +0 -4
  603. package/dist/node_modules/@allyhub-next/slides-runtime/dist/edit.js +0 -2
  604. package/dist/node_modules/@allyhub-next/slides-runtime/dist/index.d.ts +0 -4
  605. package/dist/node_modules/@allyhub-next/slides-runtime/dist/ink.d.ts +0 -10
  606. package/dist/node_modules/@allyhub-next/slides-runtime/dist/load.d.ts +0 -6
  607. package/dist/node_modules/@allyhub-next/stage/dist/bakes.d.ts +0 -42
  608. package/dist/node_modules/@allyhub-next/stage/dist/graphics.d.ts +0 -7
  609. package/dist/node_modules/@allyhub-next/stage/dist/identity.d.ts +0 -2
  610. package/dist/node_modules/@allyhub-next/stage/dist/index.d.ts +0 -9
  611. package/dist/node_modules/@allyhub-next/stage/dist/page.d.ts +0 -87
  612. package/dist/node_modules/@allyhub-next/stage/dist/scenery-page.d.ts +0 -69
  613. package/dist/node_modules/@allyhub-next/stage/dist/scenery-solve.d.ts +0 -49
  614. package/dist/node_modules/@allyhub-next/stage/dist/scenery.d.ts +0 -8
  615. package/dist/node_modules/@allyhub-next/stage/dist/server.d.ts +0 -21
  616. package/dist/node_modules/@allyhub-next/stage-page/dist/host.d.ts +0 -22
  617. package/dist/node_modules/@allyhub-next/stage-page/dist/page.js +0 -79
  618. package/dist/site.d.ts +0 -2
  619. package/editor-web/assets/dist-BW2s9FMO.js +0 -4
  620. package/editor-web/assets/dist-C-6JmebI.js +0 -233
  621. package/editor-web/assets/dist-CCYMLMKN.js +0 -6
  622. package/editor-web/assets/dist-CHzurjMx.js +0 -33
  623. package/editor-web/assets/dist-DF7H1dxw.js +0 -1
  624. package/editor-web/assets/dist-Da5AUSKX.js +0 -2
  625. package/editor-web/assets/index-B7S9RZhL.css +0 -2
  626. package/editor-web/assets/index-CovQYWvD.js +0 -69
  627. package/editor-web/assets/minus-BrvjaJyO.js +0 -1
  628. package/editor-web/assets/react-DV5fPdiH.js +0 -101
  629. package/editor-web/assets/textarea-B0vCGdZI.js +0 -105
  630. package/editor-web/assets/trash-2-B0dvc1cZ.js +0 -1
  631. package/editor-web/assets/undo-2-A1EPubPO.js +0 -1
  632. /package/dist/node_modules/@allyhub-next/{site → ooxml}/LICENSE +0 -0
@@ -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{KINDS as c}from"@allyhub-next/formats";import{PathSchema as r}from"./files.js";import{method as t,notification as s}from"./jsonrpc.js";const i={item:r,version:e.string().optional()};export const ImageSchema=e.strictObject({mime:e.string().regex(/^image\//u),data:e.base64()}),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()}),TimelineSchema=e.looseObject({fps:e.number(),width:e.number(),height:e.number(),duration:e.number(),parts:e.array(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:r,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(r),error:e.string().optional()}),IndexJobSchema=e.strictObject({file:r,status:e.enum(["running","done","failed"]),message:e.string(),share:e.number().min(0).max(1).optional()});const o=e.tuple([e.number(),e.number(),e.number()]),a=e.strictObject({url:e.string(),probe:e.string()});export const PROJECT_TOOLS={"project/items":t(e.strictObject({}),e.strictObject({items:e.array(e.strictObject({kind:e.enum(c),dir:r,entry:r,title:e.string().optional()})),folder:e.string(),name:e.string(),revision:e.int().nonnegative()}),"The project's items, as the build finds them."),"sheet/generated":t(e.strictObject({item:r}),e.strictObject({generated:e.unknown().optional(),failed:e.boolean()}),"What a sheet's sheet.ts makes now: sheets as sheet.yaml would hold them. Never written to a file."),"video/versions":t(e.strictObject({item:r}),e.strictObject({piece:e.string(),kind:e.enum(["video","slides"]),title:e.string().optional(),width:e.number(),height:e.number(),versions:e.array(e.strictObject({key:e.string(),lang:e.string().optional()}))}),"A video's or a deck's versions, one per language: what its stage, its timeline and its exports are asked for."),"slides/deck":t(e.strictObject({item:r}),e.strictObject({piece:e.string(),file:r,prefix:e.string(),layouts:e.array(e.string()),components:e.record(e.string(),e.unknown()),generators:e.array(e.string()),scripts:e.record(e.string(),r)}),"A deck's layouts, components and generators, and its files: slides.yaml (its slides) and its script in each language (their words and notes), which the deck's editor edits."),"video/stage":t(e.strictObject({...i,start:e.strictObject({t:e.number().nonnegative().optional(),part:e.string().optional(),offset:e.number().nonnegative().optional(),dur:e.number().positive().optional()}).optional(),play:e.boolean().optional(),chrome:e.boolean().optional(),edit:e.boolean().optional()}),a,"The address of a version's stage page, for a sandboxed frame: it plays the piece and talks to its parent by postMessage."),"video/timeline":t(e.strictObject(i),e.strictObject({timeline:TimelineSchema,text:e.array(e.unknown())}),"A version's timeline, drawn nowhere."),"video/still":t(e.strictObject({...i,t:e.number().nonnegative().optional()}),e.strictObject({t:e.number(),image:ImageSchema,width:e.int().positive(),height:e.int().positive(),duration:e.number().nonnegative()}),"A moment of a version as the render draws it, as a picture."),"video/stills":t(e.strictObject({...i,moments:e.array(e.number().nonnegative()).min(1).max(32)}),e.strictObject({stills:e.array(e.strictObject({t:e.number(),image:ImageSchema}))}),"Several moments of a version as the render draws them: what `video/still` gives, on one page."),"check/results":t(e.strictObject({}),CheckStateSchema,"The check run after edits, as it stands."),"check/run":t(e.strictObject({}),e.strictObject({}),"Runs the check again now."),"export/start":t(e.strictObject({item:r,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":t(e.strictObject({job:e.string()}),e.strictObject({}),"Stops an export."),"export/list":t(e.strictObject({}),e.strictObject({jobs:e.array(ExportJobSchema),reveal:e.boolean()}),"The exports asked for since the server started."),"export/reveal":t(e.strictObject({path:r}),e.strictObject({}),"Shows an exported file in the person's file manager, where the server runs on their computer (`export/list`'s `reveal`)."),"scenery/viewer":t(e.strictObject({item:r,camera:e.strictObject({position:o,target:o}).optional()}),a,"The address of a scenery's viewer page, for a sandboxed frame: it tells what the person does by postMessage.")},AGENT_DOES={"project/items":{files:"the project's folder"},"sheet/generated":{files:"the item's sheet.ts and sheet.yaml"},"video/versions":{command:"inspect combos"},"slides/deck":{files:"slides.ts, slides.yaml and the item's script.<locale>.yaml"},"video/stage":{command:"frames"},"video/timeline":{command:"inspect timeline"},"video/still":{command:"frames"},"video/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/"},"scenery/viewer":{command:"scenery view"}};export function toolSpec(n){return Object.hasOwn(PROJECT_TOOLS,n)?PROJECT_TOOLS[n]:void 0}export const TOOL_NOTIFICATIONS={"project/changed":s(e.strictObject({revision:e.int().nonnegative()}),"The build saw a change: a stage or a timeline asked for now is the new one's."),"check/changed":s(CheckStateSchema,"The check started, ended or failed."),"export/changed":s(e.strictObject({job:ExportJobSchema}),"An export moved on."),"index/changed":s(e.strictObject({jobs:e.array(IndexJobSchema)}),"Making what the media index lacks moved on.")};
2
+ import{z as e}from"zod";import{KINDS as c}from"@allyhub-next/formats";import{PathSchema as s}from"./files.js";import{method as t,notification as r}from"./jsonrpc.js";const n={item:s,version:e.string().optional()};export const ImageSchema=e.strictObject({mime:e.string().regex(/^image\//u),data:e.base64()}),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()}),TimelineSchema=e.looseObject({fps:e.number(),width:e.number(),height:e.number(),duration:e.number(),parts:e.array(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:s,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(s),error:e.string().optional()}),IndexJobSchema=e.strictObject({file:s,status:e.enum(["running","done","failed"]),message:e.string(),share:e.number().min(0).max(1).optional()});const o=e.tuple([e.number(),e.number(),e.number()]),a=e.strictObject({url:e.string(),probe:e.string()});export const COMPONENT_STILLS_MAX=64,PROJECT_TOOLS={"project/items":t(e.strictObject({}),e.strictObject({items:e.array(e.strictObject({kind:e.enum(c),dir:s,entry:s,title:e.string().optional()})),name:e.string(),scope:e.string(),revision:e.int().nonnegative()}),"The project's items, as the build finds them."),"sheet/generated":t(e.strictObject({item:s}),e.strictObject({generated:e.unknown().optional(),failed:e.boolean()}),"What a sheet's sheet.ts makes now: sheets as sheet.yaml would hold them. Never written to a file."),"video/versions":t(e.strictObject({item:s}),e.strictObject({piece:e.string(),kind:e.enum(["video","slides"]),title:e.string().optional(),width:e.number(),height:e.number(),versions:e.array(e.strictObject({key:e.string(),lang:e.string().optional()}))}),"A video's or a deck's versions, one per language: what its stage, its timeline and its exports are asked for."),"slides/deck":t(e.strictObject({item:s}),e.strictObject({piece:e.string(),file:s,prefix:e.string(),layouts:e.array(e.string()),components:e.record(e.string(),e.unknown()),generators:e.array(e.string()),scripts:e.record(e.string(),s),code:e.unknown(),theme:e.strictObject({name:e.string(),colors:e.record(e.string(),e.string()),fonts:e.record(e.string(),e.string())})}),"A deck's layouts, components and generators, and its files: slides.yaml (its slides) and its script in each language (their words and notes), which the deck's editor edits."),"video/stage":t(e.strictObject({...n,start:e.strictObject({t:e.number().nonnegative().optional(),part:e.string().optional(),offset:e.number().nonnegative().optional(),dur:e.number().positive().optional()}).optional(),play:e.boolean().optional(),chrome:e.boolean().optional(),mode:e.enum(["code","component"]).optional()}),a,"The address of a version's stage page, for a sandboxed frame: it plays the piece and talks to its parent by postMessage."),"video/timeline":t(e.strictObject(n),e.strictObject({timeline:TimelineSchema,text:e.array(e.unknown())}),"A version's timeline, drawn nowhere."),"video/still":t(e.strictObject({...n,t:e.number().nonnegative().optional()}),e.strictObject({t:e.number(),image:ImageSchema,width:e.int().positive(),height:e.int().positive(),duration:e.number().nonnegative()}),"A moment of a version as the render draws it, as a picture."),"video/stills":t(e.strictObject({...n,moments:e.array(e.number().nonnegative()).min(1).max(32)}),e.strictObject({stills:e.array(e.strictObject({t:e.number(),image:ImageSchema}))}),"Several moments of a version as the render draws them: what `video/still` gives, on one page."),"slides/fonts":t(e.strictObject({item:s}),e.strictObject({faces:e.array(e.strictObject({family:e.string(),url:e.url(),weight:e.string().optional(),style:e.string().optional(),stretch:e.string().optional(),unicodeRange:e.string().optional()}))}),"The font faces a deck's slides draw with: the stage's own (the theme's standard fonts), allyhub.config.ts's fonts and what the deck's code imports, for a document that draws its slides without the project's stylesheets."),"slides/component-stills":t(e.strictObject({...n,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())}),"Components of a deck drawn alone, transparent, as the render draws them: pictures kept by what they show, given as addresses."),"check/results":t(e.strictObject({}),CheckStateSchema,"The check run after edits, as it stands."),"check/run":t(e.strictObject({}),e.strictObject({}),"Runs the check again now."),"export/start":t(e.strictObject({item:s,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":t(e.strictObject({job:e.string()}),e.strictObject({}),"Stops an export."),"export/list":t(e.strictObject({}),e.strictObject({jobs:e.array(ExportJobSchema),reveal:e.boolean()}),"The exports asked for since the server started."),"export/reveal":t(e.strictObject({path:s}),e.strictObject({}),"Shows an exported file in the person's file manager, where the server runs on their computer (`export/list`'s `reveal`)."),"scenery/viewer":t(e.strictObject({item:s,camera:e.strictObject({position:o,target:o}).optional()}),a,"The address of a scenery's viewer page, for a sandboxed frame: it tells what the person does by postMessage.")},AGENT_DOES={"project/items":{files:"the project's folder"},"sheet/generated":{files:"the item's sheet.ts and sheet.yaml"},"video/versions":{command:"inspect combos"},"slides/deck":{files:"slides.ts, slides.yaml and the item's script.<locale>.yaml"},"video/stage":{command:"frames"},"video/timeline":{command:"inspect timeline"},"video/still":{command:"frames"},"video/stills":{command:"frames"},"slides/fonts":{files:"allyhub.config.ts's fonts and the stylesheets slides.ts imports"},"slides/component-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/"},"scenery/viewer":{command:"scenery view"}};export function toolSpec(i){return Object.hasOwn(PROJECT_TOOLS,i)?PROJECT_TOOLS[i]:void 0}export const TOOL_NOTIFICATIONS={"project/changed":r(e.strictObject({revision:e.int().nonnegative()}),"The build saw a change: a stage or a timeline asked for now is the new one's."),"check/changed":r(CheckStateSchema,"The check started, ended or failed."),"export/changed":r(e.strictObject({job:ExportJobSchema}),"An export moved on."),"index/changed":r(e.strictObject({jobs:e.array(IndexJobSchema)}),"Making what the media index lacks moved on.")};
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/protocol",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -8,6 +8,7 @@
8
8
  "default": "./dist/index.js"
9
9
  }
10
10
  },
11
+ "sideEffects": false,
11
12
  "private": true,
12
13
  "license": "SEE LICENSE IN LICENSE.md"
13
14
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/registry",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,3 +1,4 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{readFile as n}from"node:fs/promises";import{createRequire as f}from"node:module";import{dirname as u,join as m}from"node:path";const p=f(import.meta.url),b=["@fontsource-variable/commissioner/full.css","@fontsource-variable/jetbrains-mono/wght.css","@fontsource-variable/piazzolla/opsz.css","@fontsource-variable/piazzolla/opsz-italic.css"];let i;export function docFontsCss(){return i??=Promise.all(b.map(d)).then(o=>o.join(`
3
- `)),i}async function d(o){const e=p.resolve(o),s=await n(e,"utf8"),a=[...s.matchAll(/url\(\.\/(files\/[^)]+\.woff2)\)/gu)];let t=s;for(const[l,r]of a){if(r===void 0)continue;const c=await n(m(u(e),r));t=t.replace(l,`url(data:font/woff2;base64,${c.toString("base64")})`)}return t}
2
+ import{readFile as i}from"node:fs/promises";import{createRequire as S}from"node:module";import{dirname as f,join as u}from"node:path";const m=S(import.meta.url),E=["@fontsource-variable/commissioner/full.css","@fontsource-variable/jetbrains-mono/wght.css","@fontsource-variable/piazzolla/opsz.css","@fontsource-variable/piazzolla/opsz-italic.css"];let d;export function docFontsCss(){return d??=Promise.all(E.map(v)).then(t=>t.join(`
3
+ `)),d}async function v(t){const c=m.resolve(t),e=await i(c,"utf8"),o=[...e.matchAll(/url\(\.\/(files\/[^)]+\.woff2)\)/gu)];let n=e;for(const[s,r]of o){if(r===void 0)continue;const a=await i(u(f(c),r));n=n.replace(s,`url(data:font/woff2;base64,${a.toString("base64")})`)}return n}const z=["@fontsource/carlito/400.css","@fontsource/carlito/400-italic.css","@fontsource/carlito/700.css","@fontsource/carlito/700-italic.css","@fontsource/noto-sans-sc/400.css","@fontsource/noto-sans-sc/700.css"];export const SHEET_FONT="Carlito";let w;async function x(){const t=[];for(const c of z){const e=m.resolve(c),o=await i(e,"utf8");for(const[n]of o.matchAll(/@font-face\s*\{[^}]*\}/gu)){const s=/url\(\.\/(files\/[^)]+\.woff2)\)/u.exec(n)?.[1];if(s===void 0)continue;const a=(/unicode-range:\s*([^;}]+)/u.exec(n)?.[1]??"U+0-10FFFF").split(",").map(l=>{const[p="0",g]=l.trim().replace(/^U\+/iu,"").split("-"),h=Number.parseInt(p.replaceAll("?","0"),16),F=Number.parseInt((g??p).replaceAll("?","F"),16);return[h,F]});t.push({css:n.replace(/src:[^;]+;/u,`src: url(${u(f(e),s)}) format('woff2');`),file:u(f(e),s),ranges:a})}}return t}export async function sheetFontsCss(t){w??=x();const c=new Set;for(const o of t)c.add(o.codePointAt(0)??0);const e=[];for(const o of await w){if(![...c].some(r=>o.ranges.some(([a,l])=>r>=a&&r<=l)))continue;let s=b.get(o.file);s===void 0&&(s=`url(data:font/woff2;base64,${(await i(o.file)).toString("base64")})`,b.set(o.file,s)),e.push(o.css.replace(`url(${o.file})`,s))}return e.join(`
4
+ `)}const b=new Map;
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- export{docPage,printPage,renderDoc,renderWord}from"./print.js";export{docFontsCss}from"./fonts.js";
2
+ export{docPage,printPage,printPdf,renderDoc,renderWord}from"./print.js";export{docFontsCss,SHEET_FONT,sheetFontsCss}from"./fonts.js";export{PdfJoiner}from"./pdf.js";
@@ -0,0 +1,34 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{open as D}from"node:fs/promises";const v=new Set([0,9,10,12,13,32]),F=new Set(Buffer.from("()<>[]{}/%","latin1"));class B{bytes;text;at=0;offsets=new Map;trailer;constructor(t){this.bytes=t,this.text=t.toString("latin1");const e=/startxref\s+(\d+)\s+%%EOF\s*$/u.exec(this.text);if(!e)throw new Error("Not a PDF: no startxref.");if(this.at=Number(e[1]),!this.text.startsWith("xref",this.at))throw new Error("This PDF keeps its cross-references in a stream, which this reader does not read.");for(this.at+=4;this.skip(),!this.text.startsWith("trailer",this.at);){const s=this.number(),i=this.number();this.skip();for(let d=0;d<i;d++){const g=this.text.slice(this.at,this.at+20);g[17]==="n"&&this.offsets.set(s+d,Number(g.slice(0,10))),this.at+=20}}this.at+=7;const r=this.value();if(r.t!=="dict")throw new Error("Not a PDF: its trailer is no dictionary.");this.trailer=r.v}numbers(){return[...this.offsets.keys()].sort((t,e)=>t-e)}skip(){const{bytes:t}=this;for(;;){const e=t[this.at];if(e===void 0)return;if(v.has(e))this.at++;else if(e===37)for(;this.at<t.length&&t[this.at]!==10&&t[this.at]!==13;)this.at++;else return}}regular(){const t=this.at;for(;this.at<this.bytes.length;){const e=this.bytes[this.at]??0;if(v.has(e)||F.has(e))break;this.at++}return this.text.slice(t,this.at)}number(){this.skip();const t=this.regular(),e=Number(t);if(t===""||Number.isNaN(e))throw new Error(`Not a number at ${String(this.at)}: ${t}`);return e}value(){this.skip();const{text:t}=this,e=t[this.at];if(t.startsWith("<<",this.at)){this.at+=2;const s=new Map;for(;;){if(this.skip(),t.startsWith(">>",this.at))return this.at+=2,{t:"dict",v:s};const i=this.value();if(i.t!=="raw"||!i.s.startsWith("/"))throw new Error(`A dictionary's key is no name at ${String(this.at)}.`);s.set(i.s,this.value())}}if(e==="["){this.at++;const s=[];for(;;){if(this.skip(),t[this.at]==="]")return this.at++,{t:"arr",v:s};s.push(this.value())}}if(e==="("){const s=this.at;let i=0;for(;this.at<t.length;this.at++){const d=t[this.at];if(d==="\\")this.at++;else if(d==="(")i++;else if(d===")"&&--i===0)break}return this.at++,{t:"raw",s:t.slice(s,this.at)}}if(e==="<"){const s=t.indexOf(">",this.at),i=t.slice(this.at,s+1);return this.at=s+1,{t:"raw",s:i}}if(e==="/")return this.at++,{t:"raw",s:`/${this.regular()}`};const r=this.regular();if(r==="")throw new Error(`Unexpected ${String(e)} at ${String(this.at)}.`);if(/^\d+$/u.test(r)){const s=this.at;this.skip();const i=this.regular();if(/^\d+$/u.test(i)&&(this.skip(),t[this.at]==="R"&&(v.has(this.bytes[this.at+1]??32)||F.has(this.bytes[this.at+1]??32))))return this.at++,{t:"ref",n:Number(r)};this.at=s}return{t:"raw",s:r}}object(t){const e=this.offsets.get(t);if(e===void 0)throw new Error(`No object ${String(t)}.`);if(this.at=e,this.number(),this.number(),this.skip(),!this.text.startsWith("obj",this.at))throw new Error(`Object ${String(t)} is not where its entry says.`);this.at+=3;const r=this.value();if(this.skip(),!this.text.startsWith("stream",this.at))return{value:r};this.at+=6,this.text[this.at]==="\r"&&this.at++,this.text[this.at]===`
3
+ `&&this.at++;const s=r.t==="dict"?r.v.get("/Length"):void 0,i=s?.t==="raw"?Number(s.s):s?.t==="ref"?Number(this.object(s.n).value.s):Number.NaN;if(!Number.isFinite(i))throw new Error(`Object ${String(t)}'s stream has no length.`);return{value:r,stream:this.bytes.subarray(this.at,this.at+i)}}}const $=a=>a?.t==="dict"?a.v:void 0,y=a=>a?.t==="raw"?a.s:void 0,p=a=>a?.t==="ref"?a.n:void 0;function m(a,t){switch(a.t){case"raw":return a.s;case"ref":return`${String(t(a.n))} 0 R`;case"arr":return`[${a.v.map(e=>m(e,t)).join(" ")}]`;case"dict":return`<<${[...a.v].map(([e,r])=>`${e} ${m(r,t)}`).join(`
4
+ `)}>>`}}function I(a){if(/^[\x20-\x7e]*$/u.test(a))return`(${a.replace(/[\\()]/gu,"\\$&")})`;let t="FEFF";for(let e=0;e<a.length;e++)t+=a.charCodeAt(e).toString(16).padStart(4,"0").toUpperCase();return`<${t}>`}const K=["/Resources","/MediaBox","/CropBox","/Rotate"];export class PdfJoiner{file;offset=0;next=1;offsets=[];pages=[];structure=[];parents=[];keys=0;lang;root;tree;constructor(t){this.file=t,this.tree=this.next++,this.root=this.next++}static async create(t){const e=new PdfJoiner(await D(t,"w"));return await e.put(Buffer.from(`%PDF-1.4
5
+ %âãÏÓ
6
+ `,"latin1")),e}async put(t){await this.file.write(t,0,t.length,this.offset),this.offset+=t.length}async object(t,e,r){if(this.offsets[t]=this.offset,r===void 0){await this.put(Buffer.from(`${String(t)} 0 obj
7
+ ${e}
8
+ endobj
9
+ `,"latin1"));return}await this.put(Buffer.from(`${String(t)} 0 obj
10
+ ${e}
11
+ stream
12
+ `,"latin1")),await this.put(r),await this.put(Buffer.from(`
13
+ endstream
14
+ endobj
15
+ `,"latin1"))}async add(t){const e=new B(t),r=p(e.trailer.get("/Root"));if(r===void 0)throw new Error("A PDF without a catalog.");const s=$(e.object(r).value)??new Map;this.lang??=s.get("/Lang");const i=new Set([r]),d=p(e.trailer.get("/Info"));d!==void 0&&i.add(d);const g=[],f=(n,u)=>{const c=$(e.object(n).value);if(c)if(y(c.get("/Type"))==="/Pages"){i.add(n);const l=new Map(u);for(const h of K){const o=c.get(h);o!==void 0&&l.set(h,o)}for(const h of c.get("/Kids")?.t==="arr"?c.get("/Kids").v:[]){const o=p(h);o!==void 0&&f(o,l)}}else g.push({n,inherits:u})},w=p(s.get("/Pages"));w!==void 0&&f(w,new Map);const b=p(s.get("/StructTreeRoot")),S=b===void 0?void 0:$(e.object(b).value),k=this.keys,E=[],R=[];if(b!==void 0&&S){i.add(b);const n=S.get("/K");for(const h of n?.t==="arr"?n.v:n?[n]:[]){const o=p(h);o!==void 0&&E.push(o)}const u=p(S.get("/ParentTree")),c=[],l=h=>{i.add(h);const o=$(e.object(h).value),x=o?.get("/Nums");x?.t==="arr"&&c.push(...x.v);const T=o?.get("/Kids");for(const A of T?.t==="arr"?T.v:[]){const P=p(A);P!==void 0&&l(P)}};u!==void 0&&l(u);for(let h=0;h+1<c.length;h+=2){const o=c[h+1];o&&R.push([k+Number(y(c[h])),o])}this.keys=k+Number(y(S.get("/ParentTreeNextKey"))??"0")}const j=new Map;for(const n of e.numbers())i.has(n)||j.set(n,this.next++);const N=n=>{if(n===b)return this.root;if(i.has(n))return this.tree;const u=j.get(n);if(u===void 0)throw new Error(`A reference to object ${String(n)}, which is not there.`);return u};this.structure.push(...E.map(N));for(const[n,u]of R)this.parents.push([n,{t:"raw",s:m(u,N)}]);const M=new Map(g.map(n=>[n.n,n.inherits]));for(const[n,u]of j){const c=e.object(n),l=$(c.value);if(l){const h=M.get(n);if(h){this.pages.push(u);for(const[o,x]of h)l.has(o)||l.set(o,x)}for(const o of["/StructParents","/StructParent"]){const x=y(l.get(o));x!==void 0&&l.set(o,{t:"raw",s:String(k+Number(x))})}}await this.object(u,m(c.value,N),c.stream)}}async close(t={}){try{await this.object(this.tree,`<</Type /Pages
16
+ /Count ${String(this.pages.length)}
17
+ /Kids [${this.pages.map(f=>`${String(f)} 0 R`).join(" ")}]>>`);const e=this.structure.length>0,r=this.next++;e&&(await this.object(this.root,`<</Type /StructTreeRoot
18
+ /K [${this.structure.map(f=>`${String(f)} 0 R`).join(" ")}]
19
+ /ParentTree ${String(r)} 0 R
20
+ /ParentTreeNextKey ${String(this.keys)}>>`),await this.object(r,`<</Nums [${this.parents.map(([f,w])=>`${String(f)} ${m(w,b=>b)}`).join(" ")}]>>`));const s=this.next++;await this.object(s,["<</Type /Catalog",`/Pages ${String(this.tree)} 0 R`,...e?["/MarkInfo <</Marked true>>",`/StructTreeRoot ${String(this.root)} 0 R`]:[],...this.lang?[`/Lang ${m(this.lang,f=>f)}`]:[],...t.title===void 0?[]:["/ViewerPreferences <</DisplayDocTitle true>>"],">>"].join(`
21
+ `));const i=this.next++;await this.object(i,`<<${t.title===void 0?"":`/Title ${I(t.title)}
22
+ `}/Producer (AllyHub)>>`);const d=this.offset,g=[`xref
23
+ 0 ${String(this.next)}
24
+ `,`0000000000 65535 f
25
+ `];for(let f=1;f<this.next;f++){const w=this.offsets[f];g.push(w===void 0?`0000000000 65535 f
26
+ `:`${String(w).padStart(10,"0")} 00000 n
27
+ `)}g.push(`trailer
28
+ <</Size ${String(this.next)}
29
+ /Root ${String(s)} 0 R
30
+ /Info ${String(i)} 0 R>>
31
+ startxref
32
+ ${String(d)}
33
+ %%EOF
34
+ `),await this.put(Buffer.from(g.join(""),"latin1"))}finally{await this.file.close()}}get pageCount(){return this.pages.length}}
@@ -1,12 +1,12 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{mkdir as m,readFile as g,writeFile as u}from"node:fs/promises";import{dirname as w,extname as P,join as d,posix as h}from"node:path";import{openPage as p,startBrowser as y}from"@allyhub-next/browser";import{docHtml as S,parseDoc as v}from"@allyhub-next/doc";import{docxOf as j}from"@allyhub-next/doc/docx";import{docFontsCss as $}from"./fonts.js";const E={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml"},I=/^([a-z][a-z0-9+.-]*:|\/\/)/i;async function x(e,t,a){const n=new Map,i=async s=>{for(const r of s){if("children"in r&&await i(r.children??[]),r.type!=="image"||I.test(r.src))continue;const c=h.normalize(h.join(t.dir,decodeURIComponent(r.src))),o=E[P(c).toLowerCase()];if(o===void 0||c.startsWith(".."))continue;const f=await g(d(e,c)).catch(()=>{});f&&n.set(r.src,{type:o,bytes:f})}};return await i(a),n}const b=({type:e,bytes:t})=>`data:${e};base64,${t.toString("base64")}`;export async function docPage(e,t){const a=v(await g(d(e,t.file),"utf8")),n=await x(e,t,a.blocks);return S(a.blocks,{title:t.title??t.path,image:i=>{const s=n.get(i);return s&&b(s)},fonts:await $()})}const O={"image/png":"png","image/jpeg":"jpg","image/gif":"gif"},k=2,z=.92;async function M(e,t){const a=O[t.type],n=await e.evaluate(`(async () => {
2
+ import{mkdir as u,readFile as g,writeFile as y}from"node:fs/promises";import{cpus as S}from"node:os";import{dirname as w,extname as I,join as d,posix as v}from"node:path";import{openPage as m,startBrowser as h}from"@allyhub-next/browser";import{docHtml as O,parseDoc as b}from"@allyhub-next/doc";import{docxOf as j}from"@allyhub-next/doc/docx";import{docFontsCss as E}from"./fonts.js";import{PdfJoiner as M}from"./pdf.js";const $={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml"},k=/^([a-z][a-z0-9+.-]*:|\/\/)/i;async function P(t,e,a){const n=new Map,r=async s=>{for(const i of s){if("children"in i&&await r(i.children??[]),i.type!=="image"||k.test(i.src))continue;const o=v.normalize(v.join(e.dir,decodeURIComponent(i.src))),c=$[I(o).toLowerCase()];if(c===void 0||o.startsWith(".."))continue;const f=await g(d(t,o)).catch(()=>{});f&&n.set(i.src,{type:c,bytes:f})}};return await r(a),n}const x=({type:t,bytes:e})=>`data:${t};base64,${e.toString("base64")}`;export async function docPage(t,e){const a=b(await g(d(t,e.file),"utf8")),n=await P(t,e,a.blocks);return O(a.blocks,{title:e.title??e.path,image:r=>{const s=n.get(r);return s&&x(s)},fonts:await E()})}const R={"image/png":"png","image/jpeg":"jpg","image/gif":"gif"},T=2,z=.92;async function D(t,e){const a=R[e.type],n=await t.evaluate(`(async () => {
3
3
  const image = new Image();
4
- image.src = ${JSON.stringify(b(t))};
4
+ image.src = ${JSON.stringify(x(e))};
5
5
  try { await image.decode(); } catch { return null; }
6
6
  const width = image.naturalWidth || 1024;
7
7
  const height = image.naturalHeight || 768;
8
8
  if (${JSON.stringify(a!==void 0)}) return { width, height };
9
- const scale = ${JSON.stringify(t.type==="image/svg+xml"?k:1)};
9
+ const scale = ${JSON.stringify(e.type==="image/svg+xml"?T:1)};
10
10
  const canvas = document.createElement("canvas");
11
11
  canvas.width = width * scale;
12
12
  canvas.height = height * scale;
@@ -15,4 +15,4 @@ import{mkdir as m,readFile as g,writeFile as u}from"node:fs/promises";import{dir
15
15
  context.fillRect(0, 0, canvas.width, canvas.height);
16
16
  context.drawImage(image, 0, 0, canvas.width, canvas.height);
17
17
  return { width, height, jpeg: canvas.toDataURL("image/jpeg", ${String(z)}) };
18
- })()`);if(!n)return;const{width:i,height:s,jpeg:r}=n;if(a!==void 0)return{data:t.bytes,type:a,width:i,height:s};if(r!==void 0)return{data:Buffer.from(r.slice(r.indexOf(",")+1),"base64"),type:"jpg",width:i,height:s}}export async function renderWord(e){const{root:t,doc:a}=e,{blocks:n}=v(await g(d(t,a.file),"utf8")),i=await x(t,a,n),s=new Map;if(i.size>0){const c=await y({gpu:!1,htmlInCanvas:!1});try{const o=await p(c,{width:900,height:1200,allow:()=>!1});for(const[f,C]of i){const l=await M(o,C);l&&s.set(f,l)}}finally{await c.close()}}const r=await j(e.docx,e.zip,n,{title:a.title??a.path,picture:c=>s.get(c)});await m(w(e.out),{recursive:!0}),await u(e.out,r)}async function R(e,t){const{frameTree:a}=await e.session.send("Page.getFrameTree");await e.session.send("Page.setDocumentContent",{frameId:a.frame.id,html:t}),await e.evaluate("new Promise((r) => (document.readyState === 'complete' ? r() : addEventListener('load', () => r(), { once: true }))).then(() => document.fonts.ready).then(() => true)")}async function T(e){const{cssContentSize:t}=await e.session.send("Page.getLayoutMetrics"),a=await e.session.send("Page.captureScreenshot",{format:"png",clip:{x:0,y:0,width:Math.ceil(t.width),height:Math.ceil(t.height),scale:1},captureBeyondViewport:!0});return Buffer.from(a.data,"base64")}export async function printPage(e){const t=[],a=await y({gpu:!1,htmlInCanvas:!1});try{const n=await p(a,{width:e.width??900,height:1200,scale:2,allow:()=>!1});await R(n,e.html);for(const i of e.types){const s=d(e.out,`${e.name}.${i}`);if(await m(w(s),{recursive:!0}),i==="pdf"){const{data:r}=await n.session.send("Page.printToPDF",{preferCSSPageSize:!0,printBackground:!0});await u(s,Buffer.from(r,"base64"))}else e.pictureCss!==void 0&&await n.evaluate(`(() => { const s = document.createElement('style'); s.textContent = ${JSON.stringify(e.pictureCss)}; document.head.append(s); return true; })()`),await u(s,await T(n));t.push(`${e.name}.${i}`)}}finally{await a.close()}return t}export async function renderDoc(e){return printPage({html:await docPage(e.root,e.doc),out:e.out,name:e.name??"doc",types:e.types?.length?e.types:["pdf"],pictureCss:"body{padding:48px 0;background:#fff}"})}
18
+ })()`);if(!n)return;const{width:r,height:s,jpeg:i}=n;if(a!==void 0)return{data:e.bytes,type:a,width:r,height:s};if(i!==void 0)return{data:Buffer.from(i.slice(i.indexOf(",")+1),"base64"),type:"jpg",width:r,height:s}}export async function renderWord(t){const{root:e,doc:a}=t,{blocks:n}=b(await g(d(e,a.file),"utf8")),r=await P(e,a,n),s=new Map;if(r.size>0){const o=await h({gpu:!1,htmlInCanvas:!1});try{const c=await m(o,{width:900,height:1200,allow:()=>!1});for(const[f,l]of r){const p=await D(c,l);p&&s.set(f,p)}}finally{await o.close()}}const i=await j(t.docx,t.zip,n,{title:a.title??a.path,picture:o=>s.get(o)});await u(w(t.out),{recursive:!0}),await y(t.out,i)}async function C(t,e){const{frameTree:a}=await t.session.send("Page.getFrameTree");await t.session.send("Page.setDocumentContent",{frameId:a.frame.id,html:e}),await t.evaluate("new Promise((r) => (document.readyState === 'complete' ? r() : addEventListener('load', () => r(), { once: true }))).then(() => document.fonts.ready).then(() => window.allyhubReady).then(() => true)")}async function B(t){const{cssContentSize:e}=await t.session.send("Page.getLayoutMetrics"),a=await t.session.send("Page.captureScreenshot",{format:"png",clip:{x:0,y:0,width:Math.ceil(e.width),height:Math.ceil(e.height),scale:1},captureBeyondViewport:!0});return Buffer.from(a.data,"base64")}const F=Math.max(1,Math.min(4,Math.floor(S().length/2)));async function J(t,e){const{stream:a}=await t.session.send("Page.printToPDF",{preferCSSPageSize:!0,printBackground:!0,generateTaggedPDF:e,generateDocumentOutline:!1,transferMode:"ReturnAsStream"});if(a===void 0)throw new Error("Chrome gave no PDF.");const n=[];for(;;){const r=await t.session.send("IO.read",{handle:a,size:1048576});if(n.push(Buffer.from(r.data,r.base64Encoded?"base64":"latin1")),r.eof)break}return await t.session.send("IO.close",{handle:a}),Buffer.concat(n)}export async function printPdf(t){await u(w(t.file),{recursive:!0});const e=await h({gpu:!1,htmlInCanvas:!1}),a=await M.create(t.file),n=t.tagged??!0,r=async s=>{t.signal?.throwIfAborted();const i=await m(e,{width:900,height:1200,allow:()=>!1});try{return await C(i,await t.parts.html(s)),await J(i,n)}finally{await i.close()}};try{const s=[];let i=0;const o=()=>{i<t.parts.count&&s.push(r(i++))};for(let c=0;c<F;c++)o();for(let c=0;c<t.parts.count;c++){const f=s.shift();if(!f)break;const l=await f;o(),await a.add(l)}await Promise.allSettled(s)}finally{await a.close(t.title===void 0?{}:{title:t.title}),await e.close()}}export async function printPage(t){const e=[];for(const a of t.types){const n=d(t.out,`${t.name}.${a}`);await u(w(n),{recursive:!0}),a==="pdf"?await printPdf({parts:{count:1,html:()=>t.html},file:n,...t.title===void 0?{}:{title:t.title}}):await y(n,await L(t)),e.push(`${t.name}.${a}`)}return e}async function L(t){const e=await h({gpu:!1,htmlInCanvas:!1});try{const a=await m(e,{width:t.width??900,height:1200,scale:2,allow:()=>!1});return await C(a,t.html),t.pictureCss!==void 0&&await a.evaluate(`(() => { const s = document.createElement('style'); s.textContent = ${JSON.stringify(t.pictureCss)}; document.head.append(s); return true; })()`),await B(a)}finally{await e.close()}}export async function renderDoc(t){return printPage({html:await docPage(t.root,t.doc),out:t.out,name:t.name??"doc",types:t.types?.length?t.types:["pdf"],pictureCss:"body{padding:48px 0;background:#fff}",title:t.doc.title??t.doc.path})}
@@ -1,3 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{writeFile as b}from"node:fs/promises";import{createRequire as k}from"node:module";import{captionCues as $,paperOf as j,subtitleCues as L,toSrt as v,toVtt as C}from"@allyhub-next/video-core";import{RenderError as O}from"./errors.js";import{backgroundStill as P,finalStill as p,footageStill as E}from"./stills.js";export function stillsOf(t,e=!1){const i=[];for(const[o,n]of t.parts.entries()){if(n.hidden===!0)continue;const a=n.title??String(o+1),r=e&&n.steps!==void 0?n.steps:[n.still];r.forEach((c,s)=>{i.push({part:n,at:c,title:r.length>1?`${a} (${String(s+1)})`:a})})}return i}async function g(t,e,i){return await b(t,e),{out:t,units:i,bytes:e.byteLength}}const u=t=>({target:t.target,look:t.look,media:t.media,...t.ffmpeg===void 0?{}:{ffmpeg:t.ffmpeg},...t.ffprobe===void 0?{}:{ffprobe:t.ffprobe}});export async function renderCaptions(t){const{timeline:e}=t.page,i=await t.page.lines();if(i.length===0)throw new O("no-speech",`${t.target.output} of ${t.target.piece} (${t.target.combo.lang??"this combo"}) says nothing with word times, so there are no subtitles to export.`,{hint:'Give parts speech: speech: take("./take.mp4") with its .words.json beside it, or say(s("…")) and allyhub voice.'});const o={lines:i,fps:e.fps},n=t.captions?$(o,t.captions):L(o,await t.page.captionOptions()),a=t.type==="srt"?v(n):C(n);return g(t.out,new TextEncoder().encode(a),n.length)}export async function renderCover(t){const{page:e}=t,i=await e.covers()>0?await P(e.timeline,await e.cover(0),"jpeg",t):await p(e,e.timeline.parts[0]?.still??0,{...u(t),format:"jpeg"});return g(t.out,i,1)}export async function renderPdf(t){const{timeline:e}=t.page,i=e.background,o=[];for(const a of stillsOf(e,t.steps)){const r=await E(t.media,e,a.at,"jpeg",t);o.push({still:a.at,title:a.title,background:r?`url(data:image/jpeg;base64,${r.toString("base64")}) 0 0 / 100% 100% no-repeat`:i})}const n=await t.page.print(o,e.paper??j(t.target.format));return g(t.out,n,o.length)}export async function renderPng(t){const e=stillsOf(t.page.timeline,t.steps),i=Math.max(2,String(e.length).length),o=t.out.replace(/\.png$/i,""),n=[];let a=0;for(const[r,c]of e.entries()){const s=e.length===1?t.out:`${o}.${String(r+1).padStart(i,"0")}.png`,l=await p(t.page,c.at,u(t));await b(s,l),n.push(s),a+=l.byteLength}return{out:n[0]??t.out,units:n.length,bytes:a,files:n}}const N=k(import.meta.url)("pptxgenjs");export async function renderPptx(t){const{timeline:e}=t.page,{width:i,height:o}=e,n=/^([\d.]+)in ([\d.]+)in$/u.exec(e.paper??""),a=13.333/Math.max(i,o),r=n?Number(n[1]):i*a,c=n?Number(n[2]):o*a,s=new N;s.defineLayout({name:"ALLYHUB",width:r,height:c}),s.layout="ALLYHUB";const l=await t.page.text(),d=stillsOf(e,t.steps);for(const m of d){const x=await p(t.page,m.at,u(t)),h=s.addSlide();h.addImage({data:`image/png;base64,${x.toString("base64")}`,x:0,y:0,w:r,h:c});const f=l.find(S=>S.key===m.part.key),w=f?.notes??f?.spoken??f?.onScreen.join(`
3
- `)??"";w&&h.addNotes(w)}const y=await s.write({outputType:"nodebuffer"});return g(t.out,y,d.length)}
2
+ import{writeFile as b}from"node:fs/promises";import{createRequire as j}from"node:module";import{captionCues as L,paperOf as v,subtitleCues as P,toSrt as C,toVtt as O}from"@allyhub-next/video-core";import{RenderError as E}from"./errors.js";import{finishPdf as N}from"./pdf.js";import{backgroundStill as A,finalStill as u,footageStill as B}from"./stills.js";export function stillsOf(t,e=!1){const i=[];for(const[a,n]of t.parts.entries()){if(n.hidden===!0)continue;const r=n.title??String(a+1),o=e&&n.steps!==void 0?n.steps:[n.still],s=o.length===1?(n.steps?.length??1)-1:0;o.forEach((c,l)=>{i.push({part:n,step:s+l,at:c,title:o.length>1?`${r} (${String(l+1)})`:r})})}return i}async function f(t,e,i){return await b(t,e),{out:t,units:i,bytes:e.byteLength}}const d=t=>({target:t.target,look:t.look,media:t.media,...t.ffmpeg===void 0?{}:{ffmpeg:t.ffmpeg},...t.ffprobe===void 0?{}:{ffprobe:t.ffprobe}});export async function renderCaptions(t){const{timeline:e}=t.page,i=await t.page.lines();if(i.length===0)throw new E("no-speech",`${t.target.output} of ${t.target.piece} (${t.target.combo.lang??"this combo"}) says nothing with word times, so there are no subtitles to export.`,{hint:'Give parts speech: speech: take("./take.mp4") with its .words.json beside it, or say(s("…")) and allyhub voice.'});const a={lines:i,fps:e.fps},n=t.captions?L(a,t.captions):P(a,await t.page.captionOptions()),r=t.type==="srt"?C(n):O(n);return f(t.out,new TextEncoder().encode(r),n.length)}export async function renderCover(t){const{page:e}=t,i=await e.covers()>0?await A(e.timeline,await e.cover(0),"jpeg",t):await u(e,e.timeline.parts[0]?.still??0,{...d(t),format:"jpeg"});return f(t.out,i,1)}export async function renderPdf(t){const{timeline:e}=t.page,i=e.background,a=[];for(const o of stillsOf(e,t.steps)){const s=await B(t.media,e,o.at,"jpeg",t);a.push({still:o.at,title:o.title,background:s?`url(data:image/jpeg;base64,${s.toString("base64")}) 0 0 / 100% 100% no-repeat`:i})}const n=await t.page.print(a,e.paper??v(t.target.format)),r=await N(n,{...t.title===void 0?{}:{title:t.title},outline:a.map(o=>o.title)});return f(t.out,r,a.length)}export async function renderPng(t){const e=stillsOf(t.page.timeline,t.steps),i=Math.max(2,String(e.length).length),a=t.out.replace(/\.png$/i,""),n=[];let r=0;const o=await t.stills?.(e);for(const[s,c]of e.entries()){const l=e.length===1?t.out:`${a}.${String(s+1).padStart(i,"0")}.png`,g=o?.[s]??await u(t.page,c.at,d(t));await b(l,g),n.push(l),r+=g.byteLength}return{out:n[0]??t.out,units:n.length,bytes:r,files:n}}const G=j(import.meta.url)("pptxgenjs");export async function renderPptx(t){const{timeline:e}=t.page,{width:i,height:a}=e,n=/^([\d.]+)in ([\d.]+)in$/u.exec(e.paper??""),r=13.333/Math.max(i,a),o=n?Number(n[1]):i*r,s=n?Number(n[2]):a*r,c=new G;c.defineLayout({name:"ALLYHUB",width:o,height:s}),c.layout="ALLYHUB";const l=await t.page.text(),g=stillsOf(e,t.steps),y=await t.stills?.(g);for(const[S,m]of g.entries()){const k=y?.[S]??await u(t.page,m.at,d(t)),h=c.addSlide();h.addImage({data:`image/png;base64,${k.toString("base64")}`,x:0,y:0,w:o,h:s});const p=l.find($=>$.key===m.part.key),w=p?.notes??p?.spoken??p?.onScreen.join(`
3
+ `)??"";w&&h.addNotes(w)}const x=await c.write({outputType:"nodebuffer"});return f(t.out,x,g.length)}
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{PDFDict as b,PDFDocument as w,PDFHexString as h,PDFName as e,PDFNull as P,PDFNumber as C,PDFString as N}from"pdf-lib";const O=o=>/^[\x20-\x7e]*$/u.test(o)&&!/[()\\]/u.test(o)?N.of(o):h.fromText(o);function j(){const o=process.env.SOURCE_DATE_EPOCH;if(!(o===void 0||!/^\d+$/u.test(o)))return new Date(Number(o)*1e3)}export async function finishPdf(o,c){const t=await w.load(o,{updateMetadata:!1}),i=t.context.lookup(t.context.trailerInfo.Info),r=j();r?(t.setCreationDate(r),t.setModificationDate(r)):i instanceof b&&(i.delete(e.of("CreationDate")),i.delete(e.of("ModDate"))),c.title!==void 0&&c.title!==""&&t.setTitle(c.title,{showInWindowTitleBar:!0});const d=t.getPages(),l=(c.outline??[]).slice(0,d.length);if(l.length>0){const u=t.context.nextRef(),n=l.map(()=>t.context.nextRef());l.forEach((T,a)=>{const D=d[a],x=n[a];if(!D||!x)return;const s=t.context.obj({});s.set(e.of("Title"),O(T)),s.set(e.of("Parent"),u),s.set(e.of("Dest"),t.context.obj([D.ref,e.of("Fit")]));const g=n[a-1],p=n[a+1];g&&s.set(e.of("Prev"),g),p&&s.set(e.of("Next"),p),t.context.assign(x,s)});const f=t.context.obj({});f.set(e.of("Type"),e.of("Outlines"));const m=n[0],F=n.at(-1);f.set(e.of("First"),m??P),f.set(e.of("Last"),F??P),f.set(e.of("Count"),C.of(n.length)),t.context.assign(u,f),t.catalog.set(e.of("Outlines"),u)}return Buffer.from(await t.save({useObjectStreams:!1}))}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/render",
3
- "version": "0.6.0",
3
+ "version": "0.7.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
- const y=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","math","emoji","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","-apple-system","blinkmacsystemfont","inherit","initial"]);export const isGeneric=t=>y.has(t.toLowerCase());export function families(t){const n=[];let i="",o="";for(const e of t)o?e===o?o="":i+=e:e==='"'||e==="'"?o=e:e===","?(n.push(i.trim()),i=""):i+=e;return n.push(i.trim()),n.filter(Boolean)}export function unicodeRanges(t){const n=[];for(const i of t.split(",")){const o=/^\s*u\+([0-9a-f?]+)(?:-([0-9a-f]+))?\s*$/i.exec(i),e=o?.[1];if(e)if(e.includes("?"))n.push([parseInt(e.replace(/\?/g,"0"),16),parseInt(e.replace(/\?/g,"f"),16)]);else{const r=parseInt(e,16);n.push([r,o[2]?parseInt(o[2],16):r])}}return n}export function weightRange(t){const n=s=>s==="bold"?700:s==="normal"?400:Number(s),[i="400",o]=t.trim().split(/\s+/),e=n(i),r=o===void 0?e:n(o);return Number.isFinite(e)&&Number.isFinite(r)?[e,r]:[400,400]}export function matchWeight(t,n){if(n.length===0)return;if(n.some(([s,a])=>t>=s&&t<=a))return t;const i=n.filter(([s])=>s>t).map(([s])=>s),o=n.filter(([,s])=>s<t).map(([,s])=>s),e=i.length?Math.min(...i):void 0,r=o.length?Math.max(...o):void 0;return t>500?e??r:t<400?r??e:e!==void 0&&e<=500?e:r??e}export const BOLD=600;const d=(t,n)=>t.ranges.length===0||n.some(i=>t.ranges.some(([o,e])=>i>=o&&i<=e));export function fontIssue(t,n,i,o){const e=t.families[0];if(e===void 0||isGeneric(e))return;let r;for(const s of t.families){if(isGeneric(s))return r&&{kind:"fallback",...r,usedFamily:s};const a=i.filter(l=>l.family.toLowerCase()===s.toLowerCase());if(a.length===0){if(o(s))return r&&{kind:"fallback",...r,usedFamily:s};r??={family:s,failed:!1};continue}const c=a.filter(l=>d(l,n));if(c.length===0)continue;const f=c.filter(l=>l.status==="loaded");if(f.length===0){if(c.every(l=>l.status==="error")){r??={family:s,failed:!0};continue}return}if(r)return{kind:"fallback",...r,usedFamily:s};const g=matchWeight(t.weight,f.map(l=>l.weight)),u=Math.max(...f.map(l=>l.weight[1]));return t.weight>=BOLD&&u<BOLD?{kind:"bold",family:s,weight:t.weight,drawn:g??u,faked:t.synthBold}:t.italic&&!f.some(l=>l.slanted)?{kind:"italic",family:s,faked:t.synthItalic}:void 0}return r&&{kind:"fallback",...r,usedFamily:"the browser's default font"}}export function drawnFamilies(t,n,i,o){const e=[];for(const r of new Set(n)){let s="the browser's default font";for(const a of t.families){if(isGeneric(a)){s=a;break}const c=i.filter(f=>f.family.toLowerCase()===a.toLowerCase());if(c.length===0?o(a):c.some(f=>f.status==="loaded"&&d(f,[r]))){s=a;break}}e.includes(s)||e.push(s)}return e}export function fontIssueText(t){switch(t.kind){case"fallback":return t.failed?`the font "${t.family}" failed to load, so it is drawn in ${m(t.usedFamily)}. Check the @font-face url and that the file is in the workspace.`:`the font "${t.family}" is not loaded, so it is drawn in ${m(t.usedFamily)}. Import its stylesheet in the piece (import "@fontsource/<id>/400.css" after npm install @fontsource/<id>, or a .css of @font-face rules), or list it in allyhub.config.ts's fonts for every stage, or use a font the look has (var(--ak-font-display), var(--ak-font-body)).`;case"bold":return t.faked?`"${t.family}" has no face for weight ${String(t.weight)} (the loaded faces stop below ${String(BOLD)}), so Chrome fakes the bold by thickening weight ${String(t.drawn)}. Load a bold face of the font, or use a weight it has.`:`"${t.family}" has no face for weight ${String(t.weight)}, so it is drawn at weight ${String(t.drawn)}. Load a bold face of the font, or use a weight it has.`;case"italic":return t.faked?`"${t.family}" has no italic face, so Chrome fakes the italic by slanting the upright letters. Load an italic face of the font, or drop font-style: italic.`:`"${t.family}" has no italic face, so it is drawn upright. Load an italic face of the font, or drop font-style: italic.`}}const m=t=>isGeneric(t)?`the browser's ${t} font`:t.startsWith("the ")?t:`"${t}"`;export function stringsOf(t,n=2e3){const i=[],o=new Set,e=r=>{if(!(i.length>=n)){if(typeof r=="string")i.push(r);else if(typeof r=="object"&&r!==null&&!o.has(r)){o.add(r);for(const s of Array.isArray(r)?r:Object.values(r))e(s)}}};return e(t),i}export function emojiOf(t){const n=/\p{Extended_Pictographic}|\p{Regional_Indicator}|[\u{1F3FB}-\u{1F3FF}\u{E0020}-\u{E007F}]|\u200d|\ufe0f|\u20e3/gu,i=new Set;for(const o of t)for(const e of o.matchAll(n))i.add(e[0]);return[...i].join("")}const h=new Map;let p;export function pageFaces(){const t=[];return document.fonts.forEach(n=>{t.push({family:families(n.family)[0]??n.family,weight:weightRange(n.weight),slanted:n.style!=="normal",status:n.status,ranges:unicodeRanges(n.unicodeRange)})}),t}export function localFamily(t){const n=h.get(t);if(n!==void 0)return n;p??=document.createElement("canvas").getContext("2d");const i=p;if(!i)return!0;const o="mmmmmmmmmmlli10WQ@#ƌ",e=a=>(i.font=a,i.measureText(o).width),r=JSON.stringify(t),s=["monospace","serif","sans-serif"].some(a=>e(`40px ${r}, ${a}`)!==e(`40px ${a}`));return h.set(t,s),s}export function fontWant(t){const n=Number(t.fontWeight);return{families:families(t.fontFamily),weight:Number.isFinite(n)?n:400,italic:t.fontStyle!=="normal",synthBold:t.getPropertyValue("font-synthesis-weight")!=="none",synthItalic:t.getPropertyValue("font-synthesis-style")!=="none"}}export function codePoints(t){const n=new Set;for(const i of t)for(const o of i)n.add(o.codePointAt(0)??0);return n}export function coversAny(t,n){if(t.length===0)return!0;for(const i of n)if(t.some(([o,e])=>i>=o&&i<=e))return!0;return!1}export function namedFamilies(t){return families(t).filter(n=>!isGeneric(n)&&!n.startsWith("var(")).map(n=>n.toLowerCase())}export function styleSheetFamilies(){const t=new Set,n=i=>{for(const o of Array.from(i))if(o instanceof CSSStyleRule){const e=o.style.getPropertyValue("font-family");if(e)for(const r of namedFamilies(e))t.add(r)}else o instanceof CSSGroupingRule&&n(o.cssRules)};for(const i of Array.from(document.styleSheets))try{n(i.cssRules)}catch{}return t}export function propFamilies(t){const n=new Set;document.fonts.forEach(e=>{n.add((families(e.family)[0]??e.family).toLowerCase())});const i=t.map(e=>e.toLowerCase()),o=new Set;for(const e of n)e&&i.some(r=>r.includes(e))&&o.add(e);return o}export async function loadFaces(t,n){const i=[];document.fonts.forEach(o=>{if(o.status!=="unloaded")return;const e=(families(o.family)[0]??o.family).toLowerCase();t.has(e)&&coversAny(unicodeRanges(o.unicodeRange),n)&&i.push(o.load().catch(()=>{}))}),await Promise.all(i)}export async function loadTextFonts(t){const n=new Map,i=new Map,o=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(let e=o.nextNode();e;e=o.nextNode()){const r=e.nodeValue??"",s=e.parentElement;if(!s||!r.trim())continue;let a=i.get(s);if(a===void 0){const f=getComputedStyle(s);a=`${f.fontStyle==="normal"?"":"italic "}${f.fontWeight} 40px ${f.fontFamily}`,i.set(s,a)}let c=n.get(a);c||(c=new Set,n.set(a,c));for(const f of r)f.trim()&&c.add(f)}await Promise.all([...n].map(([e,r])=>document.fonts.load(e,[...r].join("")).catch(()=>[])))}
2
+ const y=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","math","emoji","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","-apple-system","blinkmacsystemfont","inherit","initial"]);export const isGeneric=t=>y.has(t.toLowerCase());export function families(t){const e=[];let r="",i="";for(const n of t)i?n===i?i="":r+=n:n==='"'||n==="'"?i=n:n===","?(e.push(r.trim()),r=""):r+=n;return e.push(r.trim()),e.filter(Boolean)}export function unicodeRanges(t){const e=[];for(const r of t.split(",")){const i=/^\s*u\+([0-9a-f?]+)(?:-([0-9a-f]+))?\s*$/i.exec(r),n=i?.[1];if(n)if(n.includes("?"))e.push([parseInt(n.replace(/\?/g,"0"),16),parseInt(n.replace(/\?/g,"f"),16)]);else{const o=parseInt(n,16);e.push([o,i[2]?parseInt(i[2],16):o])}}return e}export function weightRange(t){const e=s=>s==="bold"?700:s==="normal"?400:Number(s),[r="400",i]=t.trim().split(/\s+/),n=e(r),o=i===void 0?n:e(i);return Number.isFinite(n)&&Number.isFinite(o)?[n,o]:[400,400]}export function matchWeight(t,e){if(e.length===0)return;if(e.some(([s,a])=>t>=s&&t<=a))return t;const r=e.filter(([s])=>s>t).map(([s])=>s),i=e.filter(([,s])=>s<t).map(([,s])=>s),n=r.length?Math.min(...r):void 0,o=i.length?Math.max(...i):void 0;return t>500?n??o:t<400?o??n:n!==void 0&&n<=500?n:o??n}export const BOLD=600;const m=(t,e)=>t.ranges.length===0||e.some(r=>t.ranges.some(([i,n])=>r>=i&&r<=n));export function fontIssue(t,e,r,i){const n=t.families[0];if(n===void 0||isGeneric(n))return;let o;for(const s of t.families){if(isGeneric(s))return o&&{kind:"fallback",...o,usedFamily:s};const a=r.filter(l=>l.family.toLowerCase()===s.toLowerCase());if(a.length===0){if(i(s))return o&&{kind:"fallback",...o,usedFamily:s};o??={family:s,failed:!1};continue}const c=a.filter(l=>m(l,e));if(c.length===0)continue;const f=c.filter(l=>l.status==="loaded");if(f.length===0){if(c.every(l=>l.status==="error")){o??={family:s,failed:!0};continue}return}if(o)return{kind:"fallback",...o,usedFamily:s};const u=matchWeight(t.weight,f.map(l=>l.weight)),d=Math.max(...f.map(l=>l.weight[1]));return t.weight>=BOLD&&d<BOLD?{kind:"bold",family:s,weight:t.weight,drawn:u??d,faked:t.synthBold}:t.italic&&!f.some(l=>l.slanted)?{kind:"italic",family:s,faked:t.synthItalic}:void 0}return o&&{kind:"fallback",...o,usedFamily:"the browser's default font"}}export function drawnFamilies(t,e,r,i){const n=[];for(const o of new Set(e)){let s="the browser's default font";for(const a of t.families){if(isGeneric(a)){s=a;break}const c=r.filter(f=>f.family.toLowerCase()===a.toLowerCase());if(c.length===0?i(a):c.some(f=>f.status==="loaded"&&m(f,[o]))){s=a;break}}n.includes(s)||n.push(s)}return n}export function fontIssueText(t){switch(t.kind){case"fallback":return t.failed?`the font "${t.family}" failed to load, so it is drawn in ${h(t.usedFamily)}. Check the @font-face url and that the file is in the workspace.`:`the font "${t.family}" is not loaded, so it is drawn in ${h(t.usedFamily)}. Import its stylesheet in the piece (import "@fontsource/<id>/400.css" after npm install @fontsource/<id>, or a .css of @font-face rules), or list it in allyhub.config.ts's fonts for every stage, or use a font the look has (var(--ak-font-display), var(--ak-font-body)).`;case"bold":return t.faked?`"${t.family}" has no face for weight ${String(t.weight)} (the loaded faces stop below ${String(BOLD)}), so Chrome fakes the bold by thickening weight ${String(t.drawn)}. Load a bold face of the font, or use a weight it has.`:`"${t.family}" has no face for weight ${String(t.weight)}, so it is drawn at weight ${String(t.drawn)}. Load a bold face of the font, or use a weight it has.`;case"italic":return t.faked?`"${t.family}" has no italic face, so Chrome fakes the italic by slanting the upright letters. Load an italic face of the font, or drop font-style: italic.`:`"${t.family}" has no italic face, so it is drawn upright. Load an italic face of the font, or drop font-style: italic.`}}const h=t=>isGeneric(t)?`the browser's ${t} font`:t.startsWith("the ")?t:`"${t}"`;export function stringsOf(t,e=2e3){const r=[],i=new Set,n=o=>{if(!(r.length>=e)){if(typeof o=="string")r.push(o);else if(typeof o=="object"&&o!==null&&!i.has(o)){i.add(o);for(const s of Array.isArray(o)?o:Object.values(o))n(s)}}};return n(t),r}export function emojiOf(t){const e=/\p{Extended_Pictographic}|\p{Regional_Indicator}|[\u{1F3FB}-\u{1F3FF}\u{E0020}-\u{E007F}]|\u200d|\ufe0f|\u20e3/gu,r=new Set;for(const i of t)for(const n of i.matchAll(e))r.add(n[0]);return[...r].join("")}const p=new Map;let g;export function pageFaces(){const t=[];return document.fonts.forEach(e=>{t.push({family:families(e.family)[0]??e.family,weight:weightRange(e.weight),slanted:e.style!=="normal",status:e.status,ranges:unicodeRanges(e.unicodeRange)})}),t}export function localFamily(t){const e=p.get(t);if(e!==void 0)return e;g??=document.createElement("canvas").getContext("2d");const r=g;if(!r)return!0;const i="mmmmmmmmmmlli10WQ@#ƌ",n=a=>(r.font=a,r.measureText(i).width),o=JSON.stringify(t),s=["monospace","serif","sans-serif"].some(a=>n(`40px ${o}, ${a}`)!==n(`40px ${a}`));return p.set(t,s),s}export function fontWant(t){const e=Number(t.fontWeight);return{families:families(t.fontFamily),weight:Number.isFinite(e)?e:400,italic:t.fontStyle!=="normal",synthBold:t.getPropertyValue("font-synthesis-weight")!=="none",synthItalic:t.getPropertyValue("font-synthesis-style")!=="none"}}export function codePoints(t){const e=new Set;for(const r of t)for(const i of r)e.add(i.codePointAt(0)??0);return e}export function coversAny(t,e){if(t.length===0)return!0;for(const r of e)if(t.some(([i,n])=>r>=i&&r<=n))return!0;return!1}export function namedFamilies(t){return families(t).filter(e=>!isGeneric(e)&&!e.startsWith("var(")).map(e=>e.toLowerCase())}export function styleSheetFamilies(){const t=new Set,e=r=>{for(const i of Array.from(r))if(i instanceof CSSStyleRule){const n=i.style.getPropertyValue("font-family");if(n)for(const o of namedFamilies(n))t.add(o)}else i instanceof CSSGroupingRule&&e(i.cssRules)};for(const r of Array.from(document.styleSheets))try{e(r.cssRules)}catch{}return t}export function propFamilies(t){const e=new Set;document.fonts.forEach(n=>{e.add((families(n.family)[0]??n.family).toLowerCase())});const r=t.map(n=>n.toLowerCase()),i=new Set;for(const n of e)n&&r.some(o=>o.includes(n))&&i.add(n);return i}export async function loadFaces(t,e){const r=[];document.fonts.forEach(i=>{if(i.status!=="unloaded")return;const n=(families(i.family)[0]??i.family).toLowerCase();t.has(n)&&coversAny(unicodeRanges(i.unicodeRange),e)&&r.push(i.load().catch(()=>{}))}),await Promise.all(r)}export async function loadTextFonts(t){const e=new Map,r=new Map,i=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(let o=i.nextNode();o;o=i.nextNode()){const s=o.nodeValue??"",a=o.parentElement;if(!a||!s.trim())continue;let c=r.get(a);if(c===void 0){const u=getComputedStyle(a);c=`${u.fontStyle==="normal"?"":"italic "}${u.fontWeight} 40px ${u.fontFamily}`,r.set(a,c)}let f=e.get(c);f||(f=new Set,e.set(c,f));for(const u of s)u.trim()&&f.add(u)}const n=[...e].map(([o,s])=>[o,[...s].join("")]).filter(([o,s])=>!document.fonts.check(o,s));n.length!==0&&await Promise.all(n.map(([o,s])=>document.fonts.load(o,s).catch(()=>[])))}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{beatNear as X,fact as _,filmBeats as H,MUSIC_DEFAULTS as Y,musicGrid as Z,musicSeconds as J,onGrid as K,placeStretches as G,wholeLoop as x}from"@allyhub-next/video-core";const l=b=>Math.round(b*1e6)/1e6;export function musicClock(b,q){const{source:L,lang:O,ledger:P}=b,{options:k}=q,s=k.music===void 0?void 0:typeof k.music=="string"||"path"in k.music?{file:k.music}:k.music,T=s?.file===void 0?void 0:typeof s.file=="string"||"path"in s.file?s.file:O===void 0?void 0:s.file[O],c=T===void 0?void 0:b.mediaOf(T,q.musicBase),e=s??{},h=Math.max(0,e.from??0),w=c?.tempo,u=e.bpm!==void 0?{bpm:e.bpm,source:"given"}:w?{bpm:w.bpm,source:"measured",confidence:w.confidence,beat:w.beat}:void 0,U=()=>c&&c.sha256!==""?{file:c.path}:{},j=s!==void 0&&e.snap===!0&&!!u,$=j?60/u.bpm:0,Q=u?.beat??0,R=$>0?(Q-h)%$:0;s!==void 0&&e.snap===!0&&!u&&P.facts.push(_("fallback",{piece:L.piece},{...U(),missing:"tempo",for:"snap",fallback:"not-snapped"}));const t=Z(u,{meter:e.meter,downbeat:e.downbeat}),r=c?.duration,M=e.loop,V=[...e.play??[],...typeof M=="object"?[M]:[]],v=n=>{P.facts.push(_("fallback",{piece:L.piece},{...U(),missing:"tempo",for:n,fallback:n==="music-play"?"played-once":"film-end"}))};s!==void 0&&!t&&(V.some(n=>K(n.from)||K(n.to))&&v("music-play"),(e.end==="bar"||e.end==="beat")&&v("music-end"));const E=n=>{const a=J(n.from,t),d=J(n.to,t);return a===void 0||d===void 0?void 0:{from:a,to:d}},g=typeof M=="object"?E(M):void 0,z=e.play?.map(E),F=(z?.some(n=>n===void 0)??!1)||typeof M=="object"&&g===void 0,I=!F&&(z!==void 0||g!==void 0),C=n=>{if(!(r===void 0||r<=0)){if(F)return G([{from:h,to:r}],void 0,r,n);if(I){const a=z?.flatMap(d=>d?[d]:[])??(g?[{from:h,to:g.to}]:[]);return G(a,g,r,n)}return e.loop===!0?x(h,r,n,e.seam):G([{from:h,to:r}],void 0,r,n)}},W=n=>{if(s===void 0)return;const a=n.duration,d=(e.gain??[]).flatMap((o,y)=>{const f=n.momentAt(o.at,`music.gain[${String(y)}].at`);return f===void 0?[]:[{t:l(f),db:o.db}]}),A=e.filter!==void 0||e.eq!==void 0||e.compress!==void 0?{...e.filter===void 0?{}:{filter:e.filter},...e.eq===void 0?{}:{eq:e.eq.map((o,y)=>{const{keys:f,...S}=o,p=(f??[]).flatMap((B,D)=>{const N=n.momentAt(B.at,`music.eq[${String(y)}].keys[${String(D)}].at`);return N===void 0?[]:[{...B,at:l(N)}]});return p.length>0?{...S,keys:p}:S})},...e.compress===void 0?{}:{compress:e.compress}}:void 0,m=I?C(a):void 0;let i;if(t&&(e.end==="bar"||e.end==="beat")){const o=C(a),y=o?H(o,t,e.end):[],f=o?.at(-1);if(f&&!e.loop){const p=e.end==="bar"?t.beat*t.meter:t.beat,B=e.end==="bar"?t.downbeat:t.first,D=(f.to-B)/p;Math.abs(D-Math.round(D))<1e-6&&y.push(f.at+f.to-f.from)}const S=[...y].reverse().find(p=>p>1e-6&&p<=a+1e-6);S!==void 0&&(i=l(S))}return{...c&&c.sha256!==""?{file:c.path}:{},from:m?.[0]?.from??h,loop:e.loop===!0||g!==void 0,...u?{tempo:u}:{},snapped:j,...m?{play:m.map(o=>({at:l(o.at),from:l(o.from),to:l(o.to)})),seam:e.seam??Y.seam}:e.seam===void 0?{}:{seam:e.seam},...t?{meter:t.meter,downbeat:l(t.downbeat)}:{},...i===void 0?{}:{until:i},...d.length>0?{gain:d}:{},...A?{shape:A}:{}}};return{music:s,media:c,snapped:j,beat:$,beatPhase:R,grid:t,snapTo(n){if(!j||!t)return;const a=n.reduce((m,i)=>m+(i.speechDur!==void 0?i.lead+i.speechDur+i.tail:i.dur)+2*t.beat,0)+10,d=C(a);if(!d)return;const A=H(d,t);return(m,i)=>X(A,t.beat,m,i)},plan:n=>W(n)}}export const musicPlan=(b,q)=>b.plan(q);
2
+ import{beatNear as X,fact as _,filmBeats as H,MUSIC_DEFAULTS as Y,musicGrid as Z,musicSeconds as J,onGrid as K,placeStretches as G,wholeLoop as x}from"@allyhub-next/video-core";const l=b=>Math.round(b*1e6)/1e6;export function musicClock(b,q){const{source:L,lang:O,ledger:P}=b,{options:k}=q,s=k.music===void 0?void 0:typeof k.music=="string"||"path"in k.music?{file:k.music}:k.music,T=s?.file===void 0?void 0:typeof s.file=="string"||"path"in s.file?s.file:O===void 0?void 0:s.file[O],c=T===void 0?void 0:b.mediaOf(T,q.musicBase),e=s??{},h=Math.max(0,e.from??0),w=c?.tempo,u=e.bpm!==void 0?{bpm:e.bpm,source:"given"}:w?{bpm:w.bpm,source:"measured",confidence:w.confidence,beat:w.beat}:void 0,U=()=>c&&c.sha256!==""?{file:c.path}:{},j=s!==void 0&&e.snap===!0&&!!u,$=j?60/u.bpm:0,Q=u?.beat??0,R=$>0?(Q-h)%$:0;s!==void 0&&e.snap===!0&&!u&&P.facts.push(_("fallback",{piece:L.piece},{...U(),missing:"tempo",for:"snap",fallback:"not-snapped"}));const t=Z(u,{meter:e.meter,downbeat:e.downbeat}),r=c?.duration,M=e.loop,V=[...e.play??[],...typeof M=="object"?[M]:[]],v=n=>{P.facts.push(_("fallback",{piece:L.piece},{...U(),missing:"tempo",for:n,fallback:n==="music-play"?"played-once":"film-end"}))};s!==void 0&&!t&&(V.some(n=>K(n.from)||n.to!==void 0&&K(n.to))&&v("music-play"),(e.end==="bar"||e.end==="beat")&&v("music-end"));const E=n=>{const a=J(n.from,t),d=n.to===void 0?r:J(n.to,t);return a===void 0||d===void 0?void 0:{from:a,to:d}},g=typeof M=="object"?E(M):void 0,z=e.play?.map(E),F=(z?.some(n=>n===void 0)??!1)||typeof M=="object"&&g===void 0,I=!F&&(z!==void 0||g!==void 0),C=n=>{if(!(r===void 0||r<=0)){if(F)return G([{from:h,to:r}],void 0,r,n);if(I){const a=z?.flatMap(d=>d?[d]:[])??(g?[{from:h,to:g.to}]:[]);return G(a,g,r,n)}return e.loop===!0?x(h,r,n,e.seam):G([{from:h,to:r}],void 0,r,n)}},W=n=>{if(s===void 0)return;const a=n.duration,d=(e.gain??[]).flatMap((o,y)=>{const f=n.momentAt(o.at,`music.gain[${String(y)}].at`);return f===void 0?[]:[{t:l(f),db:o.db}]}),A=e.filter!==void 0||e.eq!==void 0||e.compress!==void 0?{...e.filter===void 0?{}:{filter:e.filter},...e.eq===void 0?{}:{eq:e.eq.map((o,y)=>{const{keys:f,...S}=o,p=(f??[]).flatMap((B,D)=>{const N=n.momentAt(B.at,`music.eq[${String(y)}].keys[${String(D)}].at`);return N===void 0?[]:[{...B,at:l(N)}]});return p.length>0?{...S,keys:p}:S})},...e.compress===void 0?{}:{compress:e.compress}}:void 0,m=I?C(a):void 0;let i;if(t&&(e.end==="bar"||e.end==="beat")){const o=C(a),y=o?H(o,t,e.end):[],f=o?.at(-1);if(f&&!e.loop){const p=e.end==="bar"?t.beat*t.meter:t.beat,B=e.end==="bar"?t.downbeat:t.first,D=(f.to-B)/p;Math.abs(D-Math.round(D))<1e-6&&y.push(f.at+f.to-f.from)}const S=[...y].reverse().find(p=>p>1e-6&&p<=a+1e-6);S!==void 0&&(i=l(S))}return{...c&&c.sha256!==""?{file:c.path}:{},from:m?.[0]?.from??h,loop:e.loop===!0||g!==void 0,...u?{tempo:u}:{},snapped:j,...m?{play:m.map(o=>({at:l(o.at),from:l(o.from),to:l(o.to)})),seam:e.seam??Y.seam}:e.seam===void 0?{}:{seam:e.seam},...t?{meter:t.meter,downbeat:l(t.downbeat)}:{},...i===void 0?{}:{until:i},...d.length>0?{gain:d}:{},...A?{shape:A}:{}}};return{music:s,media:c,snapped:j,beat:$,beatPhase:R,grid:t,snapTo(n){if(!j||!t)return;const a=n.reduce((m,i)=>m+(i.speechDur!==void 0?i.lead+i.speechDur+i.tail:i.dur)+2*t.beat,0)+10,d=C(a);if(!d)return;const A=H(d,t);return(m,i)=>X(A,t.beat,m,i)},plan:n=>W(n)}}export const musicPlan=(b,q)=>b.plan(q);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/runtime",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,9 +1,27 @@
1
- export interface DownloadOptions {
1
+ import { RuntimeError } from "./errors.js";
2
+ /** How long a download may go without a byte before that try is given up (ms). */
3
+ export declare const DOWNLOAD_STALL_MS = 30000;
4
+ /** How many times a download that failed on the way is tried again. */
5
+ export declare const DOWNLOAD_RETRIES = 3;
6
+ /** The wait before the first try again, doubled before each next one (ms). */
7
+ export declare const DOWNLOAD_RETRY_DELAY_MS = 1000;
8
+ /** How a download waits and tries again; each default is its constant above. */
9
+ export interface DownloadTimings {
10
+ /** No byte for this long gives up a try (default: DOWNLOAD_STALL_MS). */
11
+ stallMs?: number | undefined;
12
+ /** Tries again after the first (default: DOWNLOAD_RETRIES). */
13
+ retries?: number | undefined;
14
+ /** The first wait before trying again (default: DOWNLOAD_RETRY_DELAY_MS). */
15
+ retryDelayMs?: number | undefined;
16
+ }
17
+ export interface DownloadOptions extends DownloadTimings {
2
18
  size: number;
3
19
  sha256: string;
4
20
  fetch: typeof globalThis.fetch;
5
21
  signal?: AbortSignal | undefined;
6
22
  onProgress?: ((received: number, total: number) => void) | undefined;
23
+ /** Before each try again: what went wrong, the try that failed and how many there are. */
24
+ onRetry?: ((error: RuntimeError, attempt: number, attempts: number) => void) | undefined;
7
25
  }
8
26
  /**
9
27
  * Downloads `url` to `dest`, hashing as it comes; a file of another size or
@@ -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{createWriteStream as u}from"node:fs";import{rm as g}from"node:fs/promises";import{Readable as y,Transform as S}from"node:stream";import{pipeline as p}from"node:stream/promises";import{RuntimeError as o}from"./errors.js";export async function download(e,r,n){const{size:i,sha256:w,signal:a,onProgress:$}=n;let s;try{s=await n.fetch(e,{redirect:"follow",...a?{signal:a}:{}})}catch(t){throw a?.aborted?new o("cancelled",`Stopped downloading ${e}.`,{cause:t}):new o("download",`Could not reach ${e}: ${l(t)}`,{cause:t})}if(!s.ok||!s.body)throw new o("download",`${e} answered ${String(s.status)}.`);const d=m("sha256");let c=0;const b=new S({transform(t,x,h){if(c+=t.length,c>i){h(new o("checksum",`${e} is larger than its pin (${String(i)} bytes).`));return}d.update(t),$?.(c,i),h(null,t)}});try{await p(y.fromWeb(s.body),b,u(r),...a?[{signal:a}]:[])}catch(t){throw await g(r,{force:!0}),t instanceof o?t:a?.aborted?new o("cancelled",`Stopped downloading ${e}.`,{cause:t}):new o("download",`Downloading ${e} failed: ${l(t)}`,{cause:t})}const f=d.digest("hex");if(c!==i||f!==w)throw await g(r,{force:!0}),new o("checksum",`${e} came as ${String(c)} bytes with sha256 ${f}; its pin is ${String(i)} bytes, ${w}.`)}export async function sha256Of(e){const{createReadStream:r}=await import("node:fs"),n=m("sha256");return await p(r(e),n),n.digest("hex")}const l=e=>e instanceof Error?e.message:String(e);
2
+ import{createHash as T}from"node:crypto";import{createReadStream as _,createWriteStream as z}from"node:fs";import{rm as f,stat as k}from"node:fs/promises";import{Readable as C,Transform as Y}from"node:stream";import{pipeline as x}from"node:stream/promises";import{setTimeout as H}from"node:timers/promises";import{RuntimeError as i}from"./errors.js";export const DOWNLOAD_STALL_MS=3e4,DOWNLOAD_RETRIES=3,DOWNLOAD_RETRY_DELAY_MS=1e3;const I=e=>e===408||e===425||e===429||e>=500,p=(e,r)=>new i("cancelled",`Stopped downloading ${e}.`,{cause:r}),P=async e=>k(e).then(r=>r.size,()=>0),j=e=>{const r=/^bytes (\d+)-/u.exec(e??"")?.[1];return r===void 0?void 0:Number(r)};export async function download(e,r,$){const{size:s,sha256:b,signal:c,onProgress:A,onRetry:W,stallMs:S=DOWNLOAD_STALL_MS,retries:E=DOWNLOAD_RETRIES,retryDelayMs:L=DOWNLOAD_RETRY_DELAY_MS}=$,g=E+1;let h;const v=async()=>{const o=await P(r);if(o>=s)return{received:o,digest:await sha256Of(r)};const a=new AbortController,d=c?AbortSignal.any([c,a.signal]):a.signal;let m;const u=()=>{clearTimeout(m),m=setTimeout(()=>{a.abort()},S)},D=()=>new i("download",`${e} sent nothing for ${String(S/1e3)} s.`);u();try{const M=o>0?{range:`bytes=${String(o)}-`,...h?{"if-range":h}:{}}:{};let n;try{n=await $.fetch(e,{redirect:"follow",headers:M,signal:d})}catch(t){if(c?.aborted)throw p(e,t);return a.signal.aborted?D():new i("download",`Could not reach ${e}: ${R(t)}`,{cause:t})}if(!n.ok||!n.body){await n.body?.cancel().catch(()=>{});const t=new i("download",`${e} answered ${String(n.status)}.`);if(I(n.status))return t;throw t}const l=n.status===206&&j(n.headers.get("content-range"))===o;if(n.status===206&&!l)return await n.body.cancel().catch(()=>{}),await f(r,{force:!0}),new i("download",`${e} answered another range than bytes=${String(o)}-.`);if(!l){const t=n.headers.get("etag");h=t&&!t.startsWith("W/")?t:n.headers.get("last-modified")??void 0}const y=T("sha256");let w=0;if(l)for await(const t of _(r))y.update(t),w+=t.length;const N=new Y({transform(t,q,O){if(u(),w+=t.length,w>s){O(new i("checksum",`${e} is larger than its pin (${String(s)} bytes).`));return}y.update(t),A?.(w,s),O(null,t)}});u();try{await x(C.fromWeb(n.body),N,z(r,{flags:l?"a":"w"}),{signal:d})}catch(t){if(t instanceof i)throw t;if(c?.aborted)throw p(e,t);return a.signal.aborted?D():new i("download",`Downloading ${e} failed: ${R(t)}`,{cause:t})}return{received:w,digest:y.digest("hex")}}finally{clearTimeout(m)}};await f(r,{force:!0});for(let o=1;;o++){let a;try{a=await v()}catch(d){throw await f(r,{force:!0}),d}if(!(a instanceof i)){if(a.received!==s||a.digest!==b)throw await f(r,{force:!0}),new i("checksum",`${e} came as ${String(a.received)} bytes with sha256 ${a.digest}; its pin is ${String(s)} bytes, ${b}.`);return}if(o>=g)throw await f(r,{force:!0}),new i("download",g>1?`${a.message} Tried ${String(g)} times.`:a.message,{cause:a});W?.(a,o,g);try{await H(L*2**(o-1),void 0,c?{signal:c}:{})}catch(d){throw await f(r,{force:!0}),p(e,d)}}}export async function sha256Of(e){const r=T("sha256");return await x(_(e),r),r.digest("hex")}const R=e=>e instanceof Error?e.message:String(e);
@@ -1,10 +1,10 @@
1
1
  export { binVariable, createRuntimes, type EnsureOptions, type Located, type Progress, type Runtimes, type RuntimesOptions, type Status, } from "./runtimes.js";
2
- export { createPackages, npmCi, type EnsurePackageOptions, type LoadOptions, type Install, type LocatedPackage, type Packages, type PackagesOptions, } from "./packages.js";
2
+ export { createPackages, npmCi, NPM_FETCH_TIMEOUT_MS, NPM_STALL_MS, type EnsurePackageOptions, type InstallOptions, type LoadOptions, type Install, type LocatedPackage, type Packages, type PackagesOptions, } from "./packages.js";
3
3
  export { bundledEnv, type BundledOptions } from "./bundled.js";
4
4
  export { RuntimeError, type RuntimeErrorCode } from "./errors.js";
5
5
  export { cacheHome } from "./home.js";
6
6
  export { shippedManifest } from "./manifest.js";
7
- export { download, sha256Of } from "./download.js";
7
+ export { download, sha256Of, DOWNLOAD_RETRIES, DOWNLOAD_RETRY_DELAY_MS, DOWNLOAD_STALL_MS, type DownloadOptions, type DownloadTimings, } from "./download.js";
8
8
  export { withLock } from "./lock.js";
9
9
  export { unzip, untgz } from "./unpack.js";
10
10
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- export{binVariable,createRuntimes}from"./runtimes.js";export{createPackages,npmCi}from"./packages.js";export{bundledEnv}from"./bundled.js";export{RuntimeError}from"./errors.js";export{cacheHome}from"./home.js";export{shippedManifest}from"./manifest.js";export{download,sha256Of}from"./download.js";export{withLock}from"./lock.js";export{unzip,untgz}from"./unpack.js";
2
+ export{binVariable,createRuntimes}from"./runtimes.js";export{createPackages,npmCi,NPM_FETCH_TIMEOUT_MS,NPM_STALL_MS}from"./packages.js";export{bundledEnv}from"./bundled.js";export{RuntimeError}from"./errors.js";export{cacheHome}from"./home.js";export{shippedManifest}from"./manifest.js";export{download,sha256Of,DOWNLOAD_RETRIES,DOWNLOAD_RETRY_DELAY_MS,DOWNLOAD_STALL_MS}from"./download.js";export{withLock}from"./lock.js";export{unzip,untgz}from"./unpack.js";
@@ -5,4 +5,10 @@ export interface LockOptions {
5
5
  onWait?: () => void;
6
6
  }
7
7
  export declare function withLock<T>(path: string, run: () => Promise<T>, options?: LockOptions): Promise<T>;
8
+ /** A new staging folder's path for `dir`, owned by this process. */
9
+ export declare const partialOf: (dir: string) => string;
10
+ /** Whether a process of this computer runs by that pid (one of another user's counts). */
11
+ export declare function running(pid: number): boolean;
12
+ /** Removes the staging folders in `root` of any version of `name` whose process has ended. */
13
+ export declare function sweepPartials(root: string, name: string): Promise<void>;
8
14
  //# sourceMappingURL=lock.d.ts.map
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{setTimeout as c}from"node:timers/promises";import{lock as m}from"proper-lockfile";export async function withLock(r,l,f={}){const{signal:o,pollMs:n=150,onWait:s}=f;let e,a,i=!1;for(;;){o?.throwIfAborted();try{a=await m(r,{lockfilePath:r,realpath:!1,onCompromised:t=>{e=t}});break}catch(t){if(t.code!=="ELOCKED")throw t;i||s?.(),i=!0,await c(n,void 0,o?{signal:o}:{})}}try{const t=await l();if(e)throw e;return t}finally{e||await a()}}
2
+ import{randomBytes as l}from"node:crypto";import{readdir as p,rm as u}from"node:fs/promises";import{join as m}from"node:path";import{setTimeout as d}from"node:timers/promises";import{lock as w}from"proper-lockfile";export async function withLock(r,o,i={}){const{signal:t,pollMs:a=150,onWait:f}=i;let n,c,s=!1;for(;;){t?.throwIfAborted();try{c=await w(r,{lockfilePath:r,realpath:!1,onCompromised:e=>{n=e}});break}catch(e){if(e.code!=="ELOCKED")throw e;s||f?.(),s=!0,await d(a,void 0,t?{signal:t}:{})}}try{const e=await o();if(n)throw n;return e}finally{n||await c()}}const h=/\.partial-(\d+)-[0-9a-f]+$/u;export const partialOf=r=>`${r}.partial-${String(process.pid)}-${l(4).toString("hex")}`;export function running(r){try{return process.kill(r,0),!0}catch(o){return o.code==="EPERM"}}export async function sweepPartials(r,o){let i;try{i=await p(r)}catch{return}for(const t of i){if(!t.startsWith(`${o}@`))continue;const a=h.exec(t)?.[1];a!==void 0&&!running(Number(a))&&await u(m(r,t),{recursive:!0,force:!0})}}
@@ -6,11 +6,28 @@ export interface PackagesOptions {
6
6
  env?: Readonly<Record<string, string | undefined>>;
7
7
  /** What fills a folder from its package-lock.json (default: `npm ci`). */
8
8
  install?: Install;
9
+ /** How long npm waits on a quiet connection (default: NPM_FETCH_TIMEOUT_MS). */
10
+ fetchTimeoutMs?: number | undefined;
11
+ /** How long an install may go without progress before it is stopped (default: NPM_STALL_MS). */
12
+ stallMs?: number | undefined;
9
13
  }
10
- export type Install = (dir: string, options: {
14
+ export interface InstallOptions {
11
15
  home: string;
12
16
  signal?: AbortSignal | undefined;
13
- }) => Promise<void>;
17
+ /** npm's `--fetch-timeout`, its socket's idle limit (default: NPM_FETCH_TIMEOUT_MS). */
18
+ fetchTimeoutMs?: number | undefined;
19
+ /** No output and no change in its folders for this long stops it (default: NPM_STALL_MS). */
20
+ stallMs?: number | undefined;
21
+ }
22
+ export type Install = (dir: string, options: InstallOptions) => Promise<void>;
23
+ /** npm's `--fetch-timeout`: a connection quiet this long is dropped and tried again by npm (ms). */
24
+ export declare const NPM_FETCH_TIMEOUT_MS = 30000;
25
+ /**
26
+ * An install with no output and no change in its folder or npm's download
27
+ * folder for this long is stopped (ms): longer than npm's own timeout and
28
+ * retry, so npm says what went wrong first when it can.
29
+ */
30
+ export declare const NPM_STALL_MS = 120000;
14
31
  export interface LocatedPackage {
15
32
  name: string;
16
33
  version: string;
@@ -1,4 +1,4 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{spawn as _}from"node:child_process";import{createHash as T,randomBytes as H}from"node:crypto";import{existsSync as A,readFileSync as b}from"node:fs";import{copyFile as R,mkdir as E,readdir as y,readFile as C,rename as F,rm as g,writeFile as L}from"node:fs/promises";import{createRequire as I}from"node:module";import{delimiter as z,join as o}from"node:path";import{fileURLToPath as J,pathToFileURL as U}from"node:url";import{RuntimeError as k}from"./errors.js";import{cacheHome as W}from"./home.js";import{withLock as B}from"./lock.js";import{nodeCommand as D}from"./node-program.js";import{createRuntimes as M}from"./runtimes.js";const N=".allyhub-package.json",q=J(new URL("../pins/",import.meta.url));async function G(s){const c=o(s,"node_modules","onnxruntime-node","bin","napi-v6");for(const n of await y(c)){if(n!==process.platform){await g(o(c,n),{recursive:!0,force:!0});continue}for(const p of await y(o(c,n)))p!==process.arch&&await g(o(c,n,p),{recursive:!0,force:!0})}if(process.platform!=="darwin")return;const i=o(c,"darwin",process.arch);for(const n of await y(i))/^libonnxruntime\.\d+\.\d+\.\d+\.dylib$/u.test(n)&&await g(o(i,n),{force:!0})}const V={"onnxruntime-node":G};export const NPX_SETTING=/^npm_config_(global|prefix|location|cache|.*_prefix)/iu;export function npmProblem(s,c){return s.split(`
3
- `).map(n=>n.replace(/^npm (error|ERR!)\s*/u,"").trim()).find(n=>n!==""&&!/^(code|errno|syscall|path|type|A complete log|Exit handler|This is an error with npm|<https)/u.test(n))??`npm ended with code ${String(c)}`}const X=(s,c)=>(c.PATH??"").split(z).some(i=>i!==""&&A(o(i,s)));export async function findNpm(s,c){const i=s.ALLYHUB_NPM??s.npm_execpath;if(i?.endsWith(".js"))return{command:D(s),script:[i]};if(X("npm",s))return{command:"npm",script:[]};const n=await c(),{node:p,npm:l}=n;if(!p||!l)throw new Error("AllyHub's Node has no npm");return{command:p,script:[l]}}export const npmCi=async(s,{home:c,signal:i})=>{const n=await findNpm(process.env,async()=>(await M({home:c}).ensure("node",{signal:i})).bins),p=Object.fromEntries(Object.entries(process.env).filter(([f])=>!NPX_SETTING.test(f))),l=["ci","--ignore-scripts","--omit=dev","--no-audit","--no-fund","--omit=peer","--loglevel=error","--fetch-retries=1"];await new Promise((f,m)=>{const w=_(n.command,[...n.script,...l],{cwd:s,env:{...p,npm_config_cache:o(c,"packages",".npm")},stdio:["ignore","ignore","pipe"],...i?{signal:i}:{}});let h="";w.stderr.on("data",v=>{h=`${h}${v.toString()}`.slice(-1e3)}),w.on("error",m),w.on("close",v=>{v===0?f():m(new Error(npmProblem(h,v)))})})};export function createPackages(s={}){const c=s.env??process.env,i=s.home??W(c),n=s.pins??q,p=s.install??npmCi,l=o(i,"packages"),f=e=>{const r=o(n,e);let t,a;try{t=JSON.parse(b(o(r,"package.json"),"utf8")),a=b(o(r,"package-lock.json"),"utf8")}catch{throw new k("unknown-package",`AllyHub has no package "${e}".`)}const u=t.dependencies??{},d=u[e]??t.version;if(!d)throw new k("unknown-package",`The pin of "${e}" does not name it.`);return{version:d,holds:u,lock:T("sha256").update(a).digest("hex"),dir:r,size:t.allyhubSize??0}},m=(e,r)=>o(l,`${e}@${r.version}`),w=(e,r)=>{try{const t=JSON.parse(b(o(m(e,r),N),"utf8"));return t.version===r.version&&t.lock===r.lock}catch{return!1}},h=(e,r)=>({name:e,version:r.version,dir:m(e,r)}),v=async(e,r,t)=>{const a=m(e,r),u=`${a}.partial-${String(process.pid)}-${H(4).toString("hex")}`;await E(u,{recursive:!0});try{await R(o(r.dir,"package.json"),o(u,"package.json")),await R(o(r.dir,"package-lock.json"),o(u,"package-lock.json")),await p(u,{home:i,signal:t});for(const[d,j]of Object.entries(r.holds)){const O=JSON.parse(await C(o(u,"node_modules",d,"package.json"),"utf8"));if(O.version!==j)throw new Error(`it holds ${d} ${String(O.version)}, not ${j}`)}await V[e]?.(u),await L(o(u,N),`${JSON.stringify({version:r.version,lock:r.lock,at:new Date().toISOString()})}
4
- `),await g(a,{recursive:!0,force:!0}),await F(u,a),await P(e,r)}catch(d){throw await g(u,{recursive:!0,force:!0}),t?.aborted?new k("cancelled",`Stopped getting ${e}.`,{cause:d}):new k("install",`Could not get ${e} ${r.version} (${d instanceof Error?d.message:String(d)}). Check the connection and run it again.`,{cause:d})}},P=async(e,r)=>{const t=`${e}@${r.version}`;for(const a of await y(l))a.startsWith(`${e}@`)&&a!==t&&!a.startsWith(`${t}.`)&&await g(o(l,a),{recursive:!0,force:!0})},$=e=>{const r=f(e);return w(e,r)?h(e,r):void 0},S=(e,r)=>I(o(e,"package.json")).resolve(r),x=async(e,r={})=>{const t=f(e);return w(e,t)||(await E(l,{recursive:!0}).catch(a=>{throw new k("install",`Could not get ${e} ${t.version}: AllyHub cannot write to ${l}.`,{cause:a})}),await B(`${m(e,t)}.lock`,async()=>{w(e,t)||(r.onFetch?.(e),await v(e,t,r.signal))},{signal:r.signal})),h(e,t)};return{home:i,locate:$,ensure:x,size:e=>f(e).size,entry(e){const r=$(e);return r?S(r.dir,e):void 0},resolve(e,r){const t=$(e);return t?S(t.dir,r):void 0},async load(e,r){const{dir:t}=await x(e,r),a=S(t,r?.module??e);return await import(U(a).href)},async remove(e){await g(m(e,f(e)),{recursive:!0,force:!0})}}}
2
+ import{spawn as R}from"node:child_process";import{createHash as I}from"node:crypto";import{existsSync as M,readFileSync as T}from"node:fs";import{copyFile as P,mkdir as j,readdir as _,readFile as A,rename as D,rm as k,stat as H,writeFile as C}from"node:fs/promises";import{createRequire as F}from"node:module";import{delimiter as z,join as o}from"node:path";import{fileURLToPath as U,pathToFileURL as J}from"node:url";import{DOWNLOAD_STALL_MS as W}from"./download.js";import{RuntimeError as b}from"./errors.js";import{cacheHome as G}from"./home.js";import{partialOf as q,sweepPartials as B,withLock as K}from"./lock.js";import{nodeCommand as V}from"./node-program.js";import{createRuntimes as X}from"./runtimes.js";const E=".allyhub-package.json",Y=U(new URL("../pins/",import.meta.url));export const NPM_FETCH_TIMEOUT_MS=W,NPM_STALL_MS=12e4;async function Q(n){const i=o(n,"node_modules","onnxruntime-node","bin","napi-v6");for(const s of await _(i)){if(s!==process.platform){await k(o(i,s),{recursive:!0,force:!0});continue}for(const l of await _(o(i,s)))l!==process.arch&&await k(o(i,s,l),{recursive:!0,force:!0})}if(process.platform!=="darwin")return;const a=o(i,"darwin",process.arch);for(const s of await _(a))/^libonnxruntime\.\d+\.\d+\.\d+\.dylib$/u.test(s)&&await k(o(a,s),{force:!0})}const Z={"onnxruntime-node":Q};export const NPX_SETTING=/^npm_config_(global|prefix|location|cache|.*_prefix)/iu;export function npmProblem(n,i){return n.split(`
3
+ `).map(s=>s.replace(/^npm (error|ERR!)\s*/u,"").trim()).find(s=>s!==""&&!/^(code|errno|syscall|path|type|A complete log|Exit handler|This is an error with npm|<https)/u.test(s))??`npm ended with code ${String(i)}`}const tt=(n,i)=>(i.PATH??"").split(z).some(a=>a!==""&&M(o(a,n)));export async function findNpm(n,i){const a=n.ALLYHUB_NPM??n.npm_execpath;if(a?.endsWith(".js"))return{command:V(n),script:[a]};if(tt("npm",n))return{command:"npm",script:[]};const s=await i(),{node:l,npm:d}=s;if(!l||!d)throw new Error("AllyHub's Node has no npm");return{command:l,script:[d]}}async function et(n,i){const a=await _(n,{recursive:!0}).catch(()=>[]);let s=0;for(const l of await _(i).catch(()=>[]))s+=await H(o(i,l)).then(d=>d.size,()=>0);return`${String(a.length)}:${String(s)}`}export const npmCi=async(n,{home:i,signal:a,fetchTimeoutMs:s=NPM_FETCH_TIMEOUT_MS,stallMs:l=NPM_STALL_MS})=>{const d=await findNpm(process.env,async()=>(await X({home:i}).ensure("node",{signal:a})).bins),O=Object.fromEntries(Object.entries(process.env).filter(([p])=>!NPX_SETTING.test(p))),m=o(i,"packages",".npm"),y=["ci","--ignore-scripts","--omit=dev","--no-audit","--no-fund","--omit=peer","--loglevel=error","--fetch-retries=1",`--fetch-timeout=${String(s)}`];await new Promise((p,h)=>{const w=R(d.command,[...d.script,...y],{cwd:n,env:{...O,npm_config_cache:m},stdio:["ignore","ignore","pipe"],...a?{signal:a}:{}});let g="",x=Date.now(),$="",v=!1,S=!1;const t=setInterval(()=>{v||S||(v=!0,et(n,o(m,"_cacache","tmp")).then(e=>{e!==$?($=e,x=Date.now()):Date.now()-x>=l&&(S=!0,w.kill(),setTimeout(()=>w.kill("SIGKILL"),5e3).unref())}).finally(()=>{v=!1}))},Math.max(20,Math.min(5e3,l/4)));w.stderr.on("data",e=>{x=Date.now(),g=`${g}${e.toString()}`.slice(-1e3)}),w.on("error",e=>{clearInterval(t),h(e)}),w.on("close",e=>{clearInterval(t),S?h(new b("install",`npm made no progress for ${String(l/1e3)} s and was stopped${g.trim()?`; it said: ${npmProblem(g,e)}`:""}`)):e===0?p():h(new Error(npmProblem(g,e)))})})};export function createPackages(n={}){const i=n.env??process.env,a=n.home??G(i),s=n.pins??Y,l=n.install??npmCi,{fetchTimeoutMs:d,stallMs:O}=n,m=o(a,"packages"),y=t=>{const e=o(s,t);let r,c;try{r=JSON.parse(T(o(e,"package.json"),"utf8")),c=T(o(e,"package-lock.json"),"utf8")}catch{throw new b("unknown-package",`AllyHub has no package "${t}".`)}const u=r.dependencies??{},f=u[t]??r.version;if(!f)throw new b("unknown-package",`The pin of "${t}" does not name it.`);return{version:f,holds:u,lock:I("sha256").update(c).digest("hex"),dir:e,size:r.allyhubSize??0}},p=(t,e)=>o(m,`${t}@${e.version}`),h=(t,e)=>{try{const r=JSON.parse(T(o(p(t,e),E),"utf8"));return r.version===e.version&&r.lock===e.lock}catch{return!1}},w=(t,e)=>({name:t,version:e.version,dir:p(t,e)}),g=async(t,e,r)=>{const c=p(t,e),u=q(c);await j(u,{recursive:!0});try{await P(o(e.dir,"package.json"),o(u,"package.json")),await P(o(e.dir,"package-lock.json"),o(u,"package-lock.json")),await l(u,{home:a,signal:r,fetchTimeoutMs:d,stallMs:O});for(const[f,L]of Object.entries(e.holds)){const N=JSON.parse(await A(o(u,"node_modules",f,"package.json"),"utf8"));if(N.version!==L)throw new Error(`it holds ${f} ${String(N.version)}, not ${L}`)}await Z[t]?.(u),await C(o(u,E),`${JSON.stringify({version:e.version,lock:e.lock,at:new Date().toISOString()})}
4
+ `),await k(c,{recursive:!0,force:!0}),await D(u,c),await x(t,e)}catch(f){throw await k(u,{recursive:!0,force:!0}),r?.aborted?new b("cancelled",`Stopped getting ${t}.`,{cause:f}):new b("install",`Could not get ${t} ${e.version} (${f instanceof Error?f.message:String(f)}). Check the connection and run it again.`,{cause:f})}},x=async(t,e)=>{const r=`${t}@${e.version}`;for(const c of await _(m))c.startsWith(`${t}@`)&&c!==r&&!c.startsWith(`${r}.`)&&await k(o(m,c),{recursive:!0,force:!0})},$=t=>{const e=y(t);return h(t,e)?w(t,e):void 0},v=(t,e)=>F(o(t,"package.json")).resolve(e),S=async(t,e={})=>{const r=y(t);return h(t,r)||(await j(m,{recursive:!0}).catch(c=>{throw new b("install",`Could not get ${t} ${r.version}: AllyHub cannot write to ${m}.`,{cause:c})}),await K(`${p(t,r)}.lock`,async()=>{h(t,r)||(await B(m,t),e.onFetch?.(t),await g(t,r,e.signal))},{signal:e.signal})),w(t,r)};return{home:a,locate:$,ensure:S,size:t=>y(t).size,entry(t){const e=$(t);return e?v(e.dir,t):void 0},resolve(t,e){const r=$(t);return r?v(r.dir,e):void 0},async load(t,e){const{dir:r}=await S(t,e),c=v(r,e?.module??t);return await import(J(c).href)},async remove(t){await k(p(t,y(t)),{recursive:!0,force:!0})}}}
@@ -1,4 +1,5 @@
1
1
  import { type Platform, type RuntimeManifest } from "@allyhub-next/protocol";
2
+ import { type DownloadTimings } from "./download.js";
2
3
  export interface RuntimesOptions {
3
4
  /** The cache folder (default: the system's, `cacheHome`). */
4
5
  home?: string;
@@ -13,6 +14,8 @@ export interface RuntimesOptions {
13
14
  * read as a hang to whoever runs them.
14
15
  */
15
16
  log?: (line: string) => void;
17
+ /** How a download waits and tries again (defaults: download.ts's constants). */
18
+ downloads?: DownloadTimings;
16
19
  }
17
20
  export interface Located {
18
21
  name: string;
@@ -1,4 +1,4 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{randomBytes as W}from"node:crypto";import{chmod as _,mkdir as R,readFile as T,rename as P,rm as k,writeFile as V}from"node:fs/promises";import{dirname as U,join as d}from"node:path";import{binsOf as A,filesFor as B,platformOf as Y}from"@allyhub-next/protocol";import{download as q,sha256Of as G}from"./download.js";import{RuntimeError as m}from"./errors.js";import{cacheHome as K}from"./home.js";import{withLock as Q}from"./lock.js";import{shippedManifest as X}from"./manifest.js";import{inside as C,native as Z,undmg as tt,untgz as et,unzip as rt}from"./unpack.js";const D=".allyhub-runtime.json";export const binVariable=i=>`ALLYHUB_${i.toUpperCase().replaceAll("-","_")}`;const x=i=>`${String(Math.max(1,Math.round(i/1e6)))} MB`;function nt(i,b,w,g){g(`Downloading ${i} ${b} (${x(w)}), once…`);let h=0;return u=>{const $=Math.floor(u/w*10)*10;$!==h&&(h=$,g(` ${String($)}% (${x(u)} of ${x(w)})`))}}export function createRuntimes(i={}){const b=i.log??(t=>{process.stderr.write(`${t}
3
- `)}),w=i.env??process.env,g=i.home??K(w),h=i.manifest??X(),u="platform"in i?i.platform:Y(process.platform,process.arch),$=i.fetch??globalThis.fetch,S=d(g,"runtimes"),z=t=>{const e=Object.hasOwn(h.runtimes,t)?h.runtimes[t]:void 0;if(!e)throw new m("unknown-runtime",`AllyHub has no runtime "${t}".`);return e},p=(t,e)=>d(S,`${t}@${e.version}`),O=(t,e)=>{const r=u?B(e,u):void 0;if(!r)throw new m("unsupported",`${t} ${e.version} has no build for ${u??`${process.platform}-${process.arch}`}.`);return r},F=(t,e,r)=>Object.fromEntries(Object.entries(A(O(t,e))).map(([n,s])=>[n,d(r,Z(s))])),E=(t,e)=>{const r=[...new Set(Object.values(e.platforms).flatMap(c=>Object.keys(A(c))))];if(r.length===0)return;const n=r.map(c=>[c,w[binVariable(c)]]);if(n.some(([,c])=>!c))return;const s=Object.fromEntries(n),a=n[0]?.[1]??"";return{name:t,version:void 0,dir:U(a),bins:s,from:"env"}},j=async(t,e)=>{try{const r=JSON.parse(await T(d(p(t,e),D),"utf8")),n=O(t,e).map(s=>s.sha256);return r.version===e.version&&JSON.stringify(r.files)===JSON.stringify(n)}catch{return!1}},M=async t=>{const e=z(t),r=E(t,e);if(r)return r;if(!await j(t,e))return;const n=p(t,e);return{name:t,version:e.version,dir:n,bins:F(t,e,n),from:"cache"}},H=async(t,e,r)=>{const n=O(t,e),s=p(t,e),a=`${s}.partial-${String(process.pid)}-${W(4).toString("hex")}`,c=d(a,".downloads");await R(c,{recursive:!0});const I=r.onProgress?void 0:nt(t,e.version,n.reduce((l,o)=>l+o.size,0),b);let N=0;try{for(const[l,o]of n.entries()){const v=d(c,String(l));if(await q(o.url,v,{size:o.size,sha256:o.sha256,fetch:$,signal:r.signal,onProgress:(f,y)=>{I?.(N+f),r.onProgress?.({runtime:t,url:o.url,received:f,total:y})}}),N+=o.size,o.unpack==="zip")await rt(v,a);else if(o.unpack==="tgz")await et(v,a);else if(o.unpack==="dmg")await tt(v,a);else{const f=C(a,o.name??st(o.url));if(!f)throw new m("unpack",`${o.url} would be kept outside its folder.`);await R(U(f),{recursive:!0}),await P(v,f),o.executable&&await _(f,493)}for(const f of o.check){const y=C(a,f.path),J=y?await G(y).catch(()=>"missing"):"missing";if(J!==f.sha256)throw new m("checksum",`${f.path} from ${o.url} has sha256 ${J}; its pin is ${f.sha256}.`)}}await k(c,{recursive:!0,force:!0}),await V(d(a,D),`${JSON.stringify({version:e.version,files:n.map(l=>l.sha256),at:new Date().toISOString()})}
4
- `),await k(s,{recursive:!0,force:!0}),await P(a,s)}catch(l){throw await k(a,{recursive:!0,force:!0}),l}},L=async(t,e={})=>{const r=z(t),n=await M(t);if(n)return n;O(t,r),await R(S,{recursive:!0}),await Q(`${p(t,r)}.lock`,async()=>{await j(t,r)||await H(t,r,e)},{signal:e.signal,onWait:()=>{b(`Waiting for ${t}, which another command is getting…`)}});const s=await M(t);if(!s)throw new m("download",`${t} was installed but cannot be found in ${S}.`);return s};return{home:g,platform:u,locate:M,ensure:L,async bin(t,e,r){const s=(await L(t,r)).bins[e];if(!s)throw new m("unknown-runtime",`${t} holds no program "${e}".`);return s},async remove(t){const e=z(t);await k(p(t,e),{recursive:!0,force:!0})},async status(){return Promise.all(Object.entries(h.runtimes).map(async([t,e])=>{const r=u?B(e,u):void 0,n=p(t,e),s=E(t,e)!==void 0?"env":r!==void 0&&await j(t,e)?"cache":void 0;return{name:t,about:e.about,version:e.version,license:e.license,available:r!==void 0,installed:s!==void 0,...s?{from:s}:{},size:(r??[]).reduce((a,c)=>a+c.size,0),dir:n}}))}}}const st=i=>decodeURIComponent(new URL(i).pathname.split("/").pop()??"file");
2
+ import{chmod as T,mkdir as E,readFile as W,rename as J,rm as z,writeFile as _}from"node:fs/promises";import{dirname as U,join as d}from"node:path";import{binsOf as A,filesFor as C,platformOf as V}from"@allyhub-next/protocol";import{download as Y,sha256Of as q}from"./download.js";import{RuntimeError as g}from"./errors.js";import{cacheHome as G}from"./home.js";import{partialOf as K,sweepPartials as Q,withLock as X}from"./lock.js";import{shippedManifest as Z}from"./manifest.js";import{inside as D,native as tt,undmg as et,untgz as rt,unzip as nt}from"./unpack.js";const F=".allyhub-runtime.json";export const binVariable=o=>`ALLYHUB_${o.toUpperCase().replaceAll("-","_")}`;const L=o=>`${String(Math.max(1,Math.round(o/1e6)))} MB`;function st(o,$,w,v){v(`Downloading ${o} ${$} (${L(w)}), once…`);let h=0;return u=>{const b=Math.floor(u/w*10)*10;b!==h&&(h=b,v(` ${String(b)}% (${L(u)} of ${L(w)})`))}}export function createRuntimes(o={}){const $=o.log??(t=>{process.stderr.write(`${t}
3
+ `)}),w=o.env??process.env,v=o.home??G(w),h=o.manifest??Z(),u="platform"in o?o.platform:V(process.platform,process.arch),b=o.fetch??globalThis.fetch,y=d(v,"runtimes"),j=t=>{const e=Object.hasOwn(h.runtimes,t)?h.runtimes[t]:void 0;if(!e)throw new g("unknown-runtime",`AllyHub has no runtime "${t}".`);return e},p=(t,e)=>d(y,`${t}@${e.version}`),k=(t,e)=>{const r=u?C(e,u):void 0;if(!r)throw new g("unsupported",`${t} ${e.version} has no build for ${u??`${process.platform}-${process.arch}`}.`);return r},H=(t,e,r)=>Object.fromEntries(Object.entries(A(k(t,e))).map(([n,s])=>[n,d(r,tt(s))])),N=(t,e)=>{const r=[...new Set(Object.values(e.platforms).flatMap(f=>Object.keys(A(f))))];if(r.length===0)return;const n=r.map(f=>[f,w[binVariable(f)]]);if(n.some(([,f])=>!f))return;const s=Object.fromEntries(n),c=n[0]?.[1]??"";return{name:t,version:void 0,dir:U(c),bins:s,from:"env"}},R=async(t,e)=>{try{const r=JSON.parse(await W(d(p(t,e),F),"utf8")),n=k(t,e).map(s=>s.sha256);return r.version===e.version&&JSON.stringify(r.files)===JSON.stringify(n)}catch{return!1}},M=async t=>{const e=j(t),r=N(t,e);if(r)return r;if(!await R(t,e))return;const n=p(t,e);return{name:t,version:e.version,dir:n,bins:H(t,e,n),from:"cache"}},I=async(t,e,r)=>{const n=k(t,e),s=p(t,e),c=K(s),f=d(c,".downloads");await E(f,{recursive:!0});const B=r.onProgress?void 0:st(t,e.version,n.reduce((l,i)=>l+i.size,0),$);let x=0;try{for(const[l,i]of n.entries()){const O=d(f,String(l));if(await Y(i.url,O,{size:i.size,sha256:i.sha256,fetch:b,signal:r.signal,...o.downloads,onRetry:(a,m,S)=>{$(` ${a.message} Trying again (${String(m+1)} of ${String(S)})…`)},onProgress:(a,m)=>{B?.(x+a),r.onProgress?.({runtime:t,url:i.url,received:a,total:m})}}),x+=i.size,i.unpack==="zip")await nt(O,c);else if(i.unpack==="tgz")await rt(O,c);else if(i.unpack==="dmg")await et(O,c);else{const a=D(c,i.name??ot(i.url));if(!a)throw new g("unpack",`${i.url} would be kept outside its folder.`);await E(U(a),{recursive:!0}),await J(O,a),i.executable&&await T(a,493)}for(const a of i.check){const m=D(c,a.path),S=m?await q(m).catch(()=>"missing"):"missing";if(S!==a.sha256)throw new g("checksum",`${a.path} from ${i.url} has sha256 ${S}; its pin is ${a.sha256}.`)}}await z(f,{recursive:!0,force:!0}),await _(d(c,F),`${JSON.stringify({version:e.version,files:n.map(l=>l.sha256),at:new Date().toISOString()})}
4
+ `),await z(s,{recursive:!0,force:!0}),await J(c,s)}catch(l){throw await z(c,{recursive:!0,force:!0}),l}},P=async(t,e={})=>{const r=j(t),n=await M(t);if(n)return n;k(t,r),await E(y,{recursive:!0}),await X(`${p(t,r)}.lock`,async()=>{await R(t,r)||(await Q(y,t),await I(t,r,e))},{signal:e.signal,onWait:()=>{$(`Waiting for ${t}, which another command is getting…`)}});const s=await M(t);if(!s)throw new g("download",`${t} was installed but cannot be found in ${y}.`);return s};return{home:v,platform:u,locate:M,ensure:P,async bin(t,e,r){const s=(await P(t,r)).bins[e];if(!s)throw new g("unknown-runtime",`${t} holds no program "${e}".`);return s},async remove(t){const e=j(t);await z(p(t,e),{recursive:!0,force:!0})},async status(){return Promise.all(Object.entries(h.runtimes).map(async([t,e])=>{const r=u?C(e,u):void 0,n=p(t,e),s=N(t,e)!==void 0?"env":r!==void 0&&await R(t,e)?"cache":void 0;return{name:t,about:e.about,version:e.version,license:e.license,available:r!==void 0,installed:s!==void 0,...s?{from:s}:{},size:(r??[]).reduce((c,f)=>c+f.size,0),dir:n}}))}}}const ot=o=>decodeURIComponent(new URL(o).pathname.split("/").pop()??"file");
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/runtimes",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {