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,3 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{accentOf as j,CHART_DEFAULTS as d,chartDrawing as D,groupingOf as z,hasLines as E,hasMarkers as N,isArea as R,isBar as v,isHorizontal as T,isLine as k,isRound as h,isScatter as P,labelPositionOf as O,variesOf as w}from"./chart.js";const U="http://schemas.openxmlformats.org/drawingml/2006/chart",V="http://schemas.openxmlformats.org/drawingml/2006/main",B="http://schemas.openxmlformats.org/officeDocument/2006/relationships",W=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
3
- `,x="2118791784",y="2140495176",H={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},Z=e=>{const n=e.charCodeAt(0);return n<32&&n!==9&&n!==10&&n!==13||n===65534||n===65535},l=e=>Array.from(e,n=>Z(n)?"":H[n]??n).join("");function o(e,n={},...c){const r=Object.entries(n).filter(([,s])=>s!==void 0).map(([s,i])=>` ${s}="${l(typeof i=="boolean"?i?"1":"0":String(i))}"`).join(""),a=c.join("");return a===""?`<${e}${r}/>`:`<${e}${r}>${a}</${e}>`}const q=e=>typeof e=="string"?o("a:schemeClr",{val:e}):o("a:srgbClr",{val:e.rgb.replace("#","").toUpperCase()}),f=e=>e===null?o("a:noFill"):o("a:solidFill",{},q(e)),t=(e,n)=>o(e,{val:typeof n=="boolean"?n?1:0:n}),m=(e,n)=>o("a:ln",n===void 0?{}:{w:Math.round(n*12700)},f(e)),F=(e,n)=>o("c:txPr",{},o("a:bodyPr"),o("a:lstStyle"),o("a:p",{},o("a:pPr",{},o("a:defRPr",e===void 0?{}:{sz:Math.round(e*100)},n===void 0?"":f(n))),o("a:endParaRPr",{lang:"en-US"}))),S=e=>o("c:strCache",{},t("c:ptCount",e.length),...e.map((n,c)=>o("c:pt",{idx:c},`<c:v>${l(n)}</c:v>`))),A=(e,n)=>o("c:numCache",{},`<c:formatCode>${l(e??"General")}</c:formatCode>`,t("c:ptCount",n.length),...n.flatMap((c,r)=>c===null?[]:[o("c:pt",{idx:r},`<c:v>${String(c)}</c:v>`)])),K=(e,n)=>o("c:tx",{},n===void 0?`<c:v>${l(e.name)}</c:v>`:o("c:strRef",{},`<c:f>${l(n)}</c:f>`,S([e.name]))),Y=(e,n)=>n===void 0?"":o("c:xVal",{},o("c:numRef",{},`<c:f>${l(n)}</c:f>`,A("General",e.x??[])));function J(e,n,c,r){const a=n.color??j(c),s=h(e.type),i=P(e.type),u=k(e.type)||i,g=N(e.type),X=u?o("c:spPr",{},E(e.type)?m(a,n.line_width??d.lineWidth):o("a:ln",{w:19050},f(null))):o("c:spPr",{},f(a),s?m("lt1",1):""),_=r.categories;return o("c:ser",{},t("c:idx",c),t("c:order",c),K(n,r.name(c)),X,v(e.type)?t("c:invertIfNegative",!1):"",u?o("c:marker",{},t("c:symbol",g?"circle":"none"),g?t("c:size",n.marker_size??d.marker):"",g?o("c:spPr",{},f(a),m(a)):""):"",...w(e)&&!u&&!R(e.type)?e.categories.map((C,p)=>o("c:dPt",{},t("c:idx",p),v(e.type)?t("c:invertIfNegative",!1):"",t("c:bubble3D",!1),o("c:spPr",{},f(j(p)),s?m("lt1",1):""))):[],i?Y(n,r.x?.(c)):_===void 0?"":o("c:cat",{},r.numeric===!0?o("c:numRef",{},`<c:f>${l(_)}</c:f>`,A("General",e.categories.map(C=>{const p=Number(C);return C===""||!Number.isFinite(p)?null:p}))):o("c:strRef",{},`<c:f>${l(_)}</c:f>`,S(e.categories))),o(i?"c:yVal":"c:val",{},o("c:numRef",{},`<c:f>${l(r.values(c))}</c:f>`,A(n.number_format,n.values))),u?t("c:smooth",n.smooth===!0||e.type==="scatter-smooth"):"")}function b(e){const n=e.labels;if(!n)return"";const c=n.show_percentage===!0,r=O(e);return o("c:dLbls",{},n.number_format===void 0?"":o("c:numFmt",{formatCode:n.number_format,sourceLinked:0}),n.size===void 0&&n.color===void 0&&!h(e.type)?"":F(n.size,n.color??(h(e.type)?"lt1":void 0)),r===void 0?"":t("c:dLblPos",r),t("c:showLegendKey",!1),t("c:showVal",n.show_value??!c),t("c:showCatName",n.show_category_name===!0),t("c:showSerName",n.show_series_name===!0),t("c:showPercent",c),t("c:showBubbleSize",!1))}function Q(e,n){const c=e.series.map((s,i)=>J(e,s,i,n)).join(""),r=z(e.type),a=t("c:axId",x)+t("c:axId",y);if(h(e.type)){const s=e.type==="pie";return o(s?"c:pieChart":"c:doughnutChart",{},t("c:varyColors",w(e)),c,b(e),t("c:firstSliceAng",0),s?"":t("c:holeSize",e.hole_size??50))}if(P(e.type))return o("c:scatterChart",{},t("c:scatterStyle","lineMarker"),t("c:varyColors",!1),c,b(e),a);if(v(e.type)){const s=r!=="clustered";return o("c:barChart",{},t("c:barDir",T(e.type)?"bar":"col"),t("c:grouping",r),t("c:varyColors",w(e)),c,b(e),t("c:gapWidth",e.gap_width??150),e.overlap!==void 0||s?t("c:overlap",e.overlap??100):"",a)}return o(k(e.type)?"c:lineChart":"c:areaChart",{},t("c:grouping",r),t("c:varyColors",!1),c,b(e),k(e.type)?t("c:marker",!0):"",a)}const L=e=>o("c:scaling",{},t("c:orientation",e.reverse_order===!0?"maxMin":"minMax"),e.maximum_scale===void 0?"":t("c:max",e.maximum_scale),e.minimum_scale===void 0?"":t("c:min",e.minimum_scale)),G=e=>o("c:spPr",{},m(e.line_color??{rgb:d.axisLine},d.gridWidth)),$=e=>e.has_major_gridlines===!0?o("c:majorGridlines",{},o("c:spPr",{},m(e.gridline_color??{rgb:d.gridline},d.gridWidth))):"",I=(e,n)=>o("c:rich",{},o("a:bodyPr"),o("a:lstStyle"),o("a:p",{},o("a:pPr",{},o("a:defRPr",{sz:n,b:0})),o("a:r",{},o("a:rPr",{lang:"en-US",sz:n,b:0}),`<a:t>${l(e)}</a:t>`))),M=(e,n)=>e===void 0||e===""?"":o("c:title",{},o("c:tx",{},I(e,n)),t("c:overlay",!1));function ee(e){if(h(e.type))return"";const n=P(e.type),c=T(e.type),r=e.category_axis??{},a={has_major_gridlines:!0,...e.value_axis},s=z(e.type)==="percentStacked",i=a.number_format??(s?"0%":e.series[0]?.number_format??"General"),u=Math.round((e.font_size??d.fontSize)*100);return(n?o("c:valAx",{},t("c:axId",x),L(r),t("c:delete",r.visible===!1),t("c:axPos","b"),$(r),M(r.title,u),o("c:numFmt",{formatCode:r.number_format??"General",sourceLinked:r.number_format===void 0?1:0}),t("c:majorTickMark","none"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),G(r),t("c:crossAx",y),t("c:crosses","autoZero"),t("c:crossBetween","midCat"),r.major_unit===void 0?"":t("c:majorUnit",r.major_unit)):o("c:catAx",{},t("c:axId",x),L(r),t("c:delete",r.visible===!1),t("c:axPos",c?"l":"b"),$(r),M(r.title,u),o("c:numFmt",{formatCode:"General",sourceLinked:0}),t("c:majorTickMark","none"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),G(r),t("c:crossAx",y),t("c:crosses","autoZero"),t("c:auto",!0),t("c:lblAlgn","ctr"),t("c:lblOffset",100),t("c:noMultiLvlLbl",!1)))+o("c:valAx",{},t("c:axId",y),L(a),t("c:delete",a.visible===!1),t("c:axPos",c?"b":"l"),$(a),M(a.title,u),o("c:numFmt",{formatCode:i,sourceLinked:a.number_format===void 0&&!s?1:0}),t("c:majorTickMark","none"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),o("c:spPr",{},m(null)),t("c:crossAx",x),t("c:crosses","autoZero"),t("c:crossBetween",R(e.type)||n?"midCat":"between"),a.major_unit===void 0?"":t("c:majorUnit",a.major_unit))}const te={bottom:"b",top:"t",left:"l",right:"r"};function ne(e,n){const c=n.width,r=n.height,{plot:a}=D(e,c,r),s=i=>Number(i.toFixed(5));return o("c:layout",{},o("c:manualLayout",{},t("c:layoutTarget","inner"),t("c:xMode","edge"),t("c:yMode","edge"),t("c:x",s(a.x/c)),t("c:y",s(a.y/r)),t("c:w",s(a.width/c)),t("c:h",s(a.height/r))))}export function chartSpaceXml(e,n){const c=e.title!==void 0&&e.title!==""?e.title:void 0,r=e.font_size??d.fontSize,a=Math.round((e.title_size??r*d.titleScale)*100);return W+o("c:chartSpace",{"xmlns:c":U,"xmlns:a":V,"xmlns:r":B},t("c:date1904",!1),t("c:roundedCorners",!1),o("c:chart",{},c===void 0?"":o("c:title",{},o("c:tx",{},n.titleRef===void 0?I(c,a):o("c:strRef",{},`<c:f>${l(n.titleRef)}</c:f>`,S([c]))),t("c:overlay",!1)),t("c:autoTitleDeleted",c===void 0),o("c:plotArea",{},n.frame?ne(e,n.frame):o("c:layout"),Q(e,n.refs),ee(e)),e.legend===void 0?"":o("c:legend",{},t("c:legendPos",te[e.legend]),t("c:overlay",!1)),t("c:plotVisOnly",n.plotVisible??!0),t("c:dispBlanksAs","gap")),F(r,e.font_color??"dk1"),n.tail??"")}
2
+ import{lumOf as X}from"@allyhub-next/ooxml/brightness";import{accentOf as j,CHART_DEFAULTS as d,chartDrawing as D,groupingOf as z,hasLines as E,hasMarkers as N,isArea as R,isBar as C,isHorizontal as T,isLine as k,isRound as h,isScatter as P,labelPositionOf as U,variesOf as w}from"./chart.js";const V="http://schemas.openxmlformats.org/drawingml/2006/chart",B="http://schemas.openxmlformats.org/drawingml/2006/main",W="http://schemas.openxmlformats.org/officeDocument/2006/relationships",H=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
3
+ `,y="2118791784",x="2140495176",Z={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},q=e=>{const n=e.charCodeAt(0);return n<32&&n!==9&&n!==10&&n!==13||n===65534||n===65535},l=e=>Array.from(e,n=>q(n)?"":Z[n]??n).join("");function r(e,n={},...c){const o=Object.entries(n).filter(([,s])=>s!==void 0).map(([s,i])=>` ${s}="${l(typeof i=="boolean"?i?"1":"0":String(i))}"`).join(""),a=c.join("");return a===""?`<${e}${o}/>`:`<${e}${o}>${a}</${e}>`}const K=e=>{if(typeof e=="string")return r("a:schemeClr",{val:e});if("rgb"in e)return r("a:srgbClr",{val:e.rgb.replace("#","").toUpperCase()});const{lumMod:n,lumOff:c}=X(e.brightness);return r("a:schemeClr",{val:e.theme_color},t("a:lumMod",n),...c===void 0?[]:[t("a:lumOff",c)])},f=e=>e===null?r("a:noFill"):r("a:solidFill",{},K(e)),t=(e,n)=>r(e,{val:typeof n=="boolean"?n?1:0:n}),m=(e,n)=>r("a:ln",n===void 0?{}:{w:Math.round(n*12700)},f(e)),O=(e,n)=>r("c:txPr",{},r("a:bodyPr"),r("a:lstStyle"),r("a:p",{},r("a:pPr",{},r("a:defRPr",e===void 0?{}:{sz:Math.round(e*100)},n===void 0?"":f(n))),r("a:endParaRPr",{lang:"en-US"}))),S=e=>r("c:strCache",{},t("c:ptCount",e.length),...e.map((n,c)=>r("c:pt",{idx:c},`<c:v>${l(n)}</c:v>`))),A=(e,n)=>r("c:numCache",{},`<c:formatCode>${l(e??"General")}</c:formatCode>`,t("c:ptCount",n.length),...n.flatMap((c,o)=>c===null?[]:[r("c:pt",{idx:o},`<c:v>${String(c)}</c:v>`)])),Y=(e,n)=>r("c:tx",{},n===void 0?`<c:v>${l(e.name)}</c:v>`:r("c:strRef",{},`<c:f>${l(n)}</c:f>`,S([e.name]))),J=(e,n)=>n===void 0?"":r("c:xVal",{},r("c:numRef",{},`<c:f>${l(n)}</c:f>`,A("General",e.x??[])));function Q(e,n,c,o){const a=n.color??j(c),s=h(e.type),i=P(e.type),u=k(e.type)||i,g=N(e.type),I=u?r("c:spPr",{},E(e.type)?m(a,n.line_width??d.lineWidth):r("a:ln",{w:19050},f(null))):r("c:spPr",{},f(a),s?m("lt1",1):""),_=o.categories;return r("c:ser",{},t("c:idx",c),t("c:order",c),Y(n,o.name(c)),I,C(e.type)?t("c:invertIfNegative",!1):"",u?r("c:marker",{},t("c:symbol",g?"circle":"none"),g?t("c:size",n.marker_size??d.marker):"",g?r("c:spPr",{},f(a),m(a)):""):"",...w(e)&&!u&&!R(e.type)?e.categories.map((v,p)=>r("c:dPt",{},t("c:idx",p),C(e.type)?t("c:invertIfNegative",!1):"",t("c:bubble3D",!1),r("c:spPr",{},f(j(p)),s?m("lt1",1):""))):[],i?J(n,o.x?.(c)):_===void 0?"":r("c:cat",{},o.numeric===!0?r("c:numRef",{},`<c:f>${l(_)}</c:f>`,A("General",e.categories.map(v=>{const p=Number(v);return v===""||!Number.isFinite(p)?null:p}))):r("c:strRef",{},`<c:f>${l(_)}</c:f>`,S(e.categories))),r(i?"c:yVal":"c:val",{},r("c:numRef",{},`<c:f>${l(o.values(c))}</c:f>`,A(n.number_format,n.values))),u?t("c:smooth",n.smooth===!0||e.type==="scatter-smooth"):"")}function b(e){const n=e.labels;if(!n)return"";const c=n.show_percentage===!0,o=U(e);return r("c:dLbls",{},n.number_format===void 0?"":r("c:numFmt",{formatCode:n.number_format,sourceLinked:0}),n.size===void 0&&n.color===void 0&&!h(e.type)?"":O(n.size,n.color??(h(e.type)?"lt1":void 0)),o===void 0?"":t("c:dLblPos",o),t("c:showLegendKey",!1),t("c:showVal",n.show_value??!c),t("c:showCatName",n.show_category_name===!0),t("c:showSerName",n.show_series_name===!0),t("c:showPercent",c),t("c:showBubbleSize",!1))}function ee(e,n){const c=e.series.map((s,i)=>Q(e,s,i,n)).join(""),o=z(e.type),a=t("c:axId",y)+t("c:axId",x);if(h(e.type)){const s=e.type==="pie";return r(s?"c:pieChart":"c:doughnutChart",{},t("c:varyColors",w(e)),c,b(e),t("c:firstSliceAng",0),s?"":t("c:holeSize",e.hole_size??50))}if(P(e.type))return r("c:scatterChart",{},t("c:scatterStyle","lineMarker"),t("c:varyColors",!1),c,b(e),a);if(C(e.type)){const s=o!=="clustered";return r("c:barChart",{},t("c:barDir",T(e.type)?"bar":"col"),t("c:grouping",o),t("c:varyColors",w(e)),c,b(e),t("c:gapWidth",e.gap_width??150),e.overlap!==void 0||s?t("c:overlap",e.overlap??100):"",a)}return r(k(e.type)?"c:lineChart":"c:areaChart",{},t("c:grouping",o),t("c:varyColors",!1),c,b(e),k(e.type)?t("c:marker",!0):"",a)}const L=e=>r("c:scaling",{},t("c:orientation",e.reverse_order===!0?"maxMin":"minMax"),e.maximum_scale===void 0?"":t("c:max",e.maximum_scale),e.minimum_scale===void 0?"":t("c:min",e.minimum_scale)),F=e=>r("c:spPr",{},m(e.line_color??{rgb:d.axisLine},d.gridWidth)),M=e=>e.has_major_gridlines===!0?r("c:majorGridlines",{},r("c:spPr",{},m(e.gridline_color??{rgb:d.gridline},d.gridWidth))):"",G=(e,n)=>r("c:rich",{},r("a:bodyPr"),r("a:lstStyle"),r("a:p",{},r("a:pPr",{},r("a:defRPr",{sz:n,b:0})),r("a:r",{},r("a:rPr",{lang:"en-US",sz:n,b:0}),`<a:t>${l(e)}</a:t>`))),$=(e,n)=>e===void 0||e===""?"":r("c:title",{},r("c:tx",{},G(e,n)),t("c:overlay",!1));function te(e){if(h(e.type))return"";const n=P(e.type),c=T(e.type),o=e.category_axis??{},a={has_major_gridlines:!0,...e.value_axis},s=z(e.type)==="percentStacked",i=a.number_format??(s?"0%":e.series[0]?.number_format??"General"),u=Math.round((e.font_size??d.fontSize)*100);return(n?r("c:valAx",{},t("c:axId",y),L(o),t("c:delete",o.visible===!1),t("c:axPos","b"),M(o),$(o.title,u),r("c:numFmt",{formatCode:o.number_format??"General",sourceLinked:o.number_format===void 0?1:0}),t("c:majorTickMark","none"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),F(o),t("c:crossAx",x),t("c:crosses","autoZero"),t("c:crossBetween","midCat"),o.major_unit===void 0?"":t("c:majorUnit",o.major_unit)):r("c:catAx",{},t("c:axId",y),L(o),t("c:delete",o.visible===!1),t("c:axPos",c?"l":"b"),M(o),$(o.title,u),r("c:numFmt",{formatCode:"General",sourceLinked:0}),t("c:majorTickMark","none"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),F(o),t("c:crossAx",x),t("c:crosses","autoZero"),t("c:auto",!0),t("c:lblAlgn","ctr"),t("c:lblOffset",100),t("c:noMultiLvlLbl",!1)))+r("c:valAx",{},t("c:axId",x),L(a),t("c:delete",a.visible===!1),t("c:axPos",c?"b":"l"),M(a),$(a.title,u),r("c:numFmt",{formatCode:i,sourceLinked:a.number_format===void 0&&!s?1:0}),t("c:majorTickMark","none"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),r("c:spPr",{},m(null)),t("c:crossAx",y),t("c:crosses","autoZero"),t("c:crossBetween",R(e.type)||n?"midCat":"between"),a.major_unit===void 0?"":t("c:majorUnit",a.major_unit))}const ne={bottom:"b",top:"t",left:"l",right:"r"};function re(e,n){const c=n.width,o=n.height,{plot:a}=D(e,c,o),s=i=>Number(i.toFixed(5));return r("c:layout",{},r("c:manualLayout",{},t("c:layoutTarget","inner"),t("c:xMode","edge"),t("c:yMode","edge"),t("c:x",s(a.x/c)),t("c:y",s(a.y/o)),t("c:w",s(a.width/c)),t("c:h",s(a.height/o))))}export function chartSpaceXml(e,n){const c=e.title!==void 0&&e.title!==""?e.title:void 0,o=e.font_size??d.fontSize,a=Math.round((e.title_size??o*d.titleScale)*100);return H+r("c:chartSpace",{"xmlns:c":V,"xmlns:a":B,"xmlns:r":W},t("c:date1904",!1),t("c:roundedCorners",!1),r("c:chart",{},c===void 0?"":r("c:title",{},r("c:tx",{},n.titleRef===void 0?G(c,a):r("c:strRef",{},`<c:f>${l(n.titleRef)}</c:f>`,S([c]))),t("c:overlay",!1)),t("c:autoTitleDeleted",c===void 0),r("c:plotArea",{},n.frame?re(e,n.frame):r("c:layout"),ee(e,n.refs),te(e)),e.legend===void 0?"":r("c:legend",{},t("c:legendPos",ne[e.legend]),t("c:overlay",e.legend_overlay===!0)),t("c:plotVisOnly",n.plotVisible??!0),t("c:dispBlanksAs","gap")),O(o,e.font_color??"dk1"),n.tail??"")}
@@ -1,8 +1,15 @@
1
- import type { ChartLegendPosition, SheetChartType, ThemeColor } from "@allyhub-next/formats";
2
- /** A colour: the theme's, or `#RRGGBB`. */
3
- export type Color = ThemeColor | {
4
- rgb: string;
5
- };
1
+ import type { ChartLegendPosition, Color, SheetChartType, ThemeColor } from "@allyhub-next/formats";
2
+ export type { Color };
3
+ /** A theme colour at a brightness: its name alone at 0. */
4
+ export declare const themeColor: (theme_color: ThemeColor, brightness?: number) => Color;
5
+ /** The theme colour a colour is, at any brightness. */
6
+ export declare const themeColorOf: (c: Color) => ThemeColor | undefined;
7
+ /**
8
+ * A colour as it is drawn, against the theme in force: a theme colour's
9
+ * value, lighter or darker by its brightness as PowerPoint makes it, or its
10
+ * own. Every colour drawn or measured comes through here.
11
+ */
12
+ export declare function colorRgb(c: Color, colors: Readonly<Record<ThemeColor, string>>): string;
6
13
  /** The kinds a chart is drawn as: a slide's and a sheet's (which adds scatter). */
7
14
  export type ChartKind = SheetChartType;
8
15
  /** Where a data label sits (`c:dLblPos`). */
@@ -60,6 +67,8 @@ export interface ChartDef {
60
67
  title?: string;
61
68
  /** Where its legend is; absent: it has none. */
62
69
  legend?: ChartLegendPosition;
70
+ /** Its legend drawn over the plot, the plot not made smaller for it (python-pptx's include_in_layout false, `c:overlay`). */
71
+ legend_overlay?: boolean;
63
72
  /** Its data labels; absent: it has none. */
64
73
  labels?: ChartLabelsDef;
65
74
  /** Between bars' groups, as a share of a bar's width, in %. */
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{format as Lt,isValidFormat as jt}from"numfmt";export const CHART_DEFAULTS={fontSize:12,titleScale:1.2,gapWidth:150,holeSize:50,margin:6,gridline:"#D9D9D9",axisLine:"#BFBFBF",letter:.55,lineWidth:2.25,gridWidth:.75,marker:5};const bt=["accent1","accent2","accent3","accent4","accent5","accent6"];export const accentOf=t=>bt[t%bt.length]??"accent1",isBar=t=>t.startsWith("column")||t.startsWith("bar"),isHorizontal=t=>t.startsWith("bar"),isLine=t=>t.startsWith("line"),isArea=t=>t.startsWith("area"),isRound=t=>t==="pie"||t==="doughnut",isScatter=t=>t.startsWith("scatter"),hasLines=t=>!isScatter(t)||t!=="scatter",hasMarkers=t=>t==="line-markers"||t==="scatter"||t==="scatter-lines",groupingOf=t=>t.endsWith("-100")?"percentStacked":t.endsWith("-stacked")?"stacked":isBar(t)?"clustered":"standard";export function labelPositionsOf(t){return isArea(t)||t==="doughnut"?[]:t==="pie"?["bestFit","outEnd","inEnd","ctr"]:isLine(t)||isScatter(t)?["t","b","l","r","ctr"]:groupingOf(t)==="clustered"?["outEnd","inEnd","ctr","inBase"]:["inEnd","ctr","inBase"]}export function labelPositionOf(t){const a=labelPositionsOf(t.type),l=t.labels?.position;if(l!==void 0&&a.includes(l))return l;if(a.length!==0)return t.type==="pie"?"ctr":isLine(t.type)||isScatter(t.type)?"t":groupingOf(t.type)==="clustered"?"outEnd":"ctr"}export const variesOf=t=>t.vary_by_categories??isRound(t.type);export function formatValue(t,a="General"){return a==="General"||!jt(a)?String(Number(t.toPrecision(10))):Lt(a,t)}const Ct=[1,2,5,10];export function chartScale(t,a,l,s,e={}){const h=t>0&&(a-t)/a<.16666666666666666?t:Math.min(t,0),i=a<=0&&t<0?0:a,o=e.minimum_scale??h,C=e.maximum_scale??i,_=C>o?C-o:1,F=Math.max(1,Math.floor(l/s)),b=_/F,P=10**Math.floor(Math.log10(b)),B=e.major_unit??(Ct.find(E=>E*P>=b)??10)*P,N=(E,L)=>Number((L(Number((E/B).toFixed(9)))*B).toPrecision(12)),Z=i>0?i+_*.05:i===h?_:i,g=e.maximum_scale??N(Z,Math.ceil),R=h<0?h-_*.05:h,W=e.minimum_scale??N(R,Math.floor),O=[],x=Math.round((g-W)/B);for(let E=0;E<=x;E++)O.push(Number((W+E*B).toPrecision(12)));return{min:W,max:g,major:B,ticks:O}}const it=(t,a)=>{let l=0;for(const s of t)l+=(s.codePointAt(0)??0)>11903?1:CHART_DEFAULTS.letter;return l*a},d=t=>String(Number(t.toFixed(3)));function $t(t){const a=l=>t[Math.max(0,Math.min(t.length-1,l))]??[0,0];return t.map(([l,s],e)=>{if(e===0)return`M${d(l)} ${d(s)}`;const[h,i]=a(e-2),[o,C]=a(e-1),[_,F]=a(e+1),b=`${d(o+(l-h)/6)} ${d(C+(s-i)/6)}`,P=`${d(l-(_-o)/6)} ${d(s-(F-C)/6)}`;return`C${b} ${P} ${d(l)} ${d(s)}`}).join(" ")}const lt=t=>t.map(([a,l],s)=>`${s===0?"M":"L"}${d(a)} ${d(l)}`).join(" ");function Ft(t,a,l,s,e,h){const i=(F,b)=>`${d(t+F*Math.sin(b))} ${d(a-F*Math.cos(b))}`,o=h-e>=Math.PI*2?e+Math.PI*2-1e-4:h,C=o-e>Math.PI?1:0,_=`M${i(l,e)} A${d(l)} ${d(l)} 0 ${String(C)} 1 ${i(l,o)}`;return s<=0?`${_} L${d(t)} ${d(a)} Z`:`${_} L${i(s,o)} A${d(s)} ${d(s)} 0 ${String(C)} 0 ${i(s,e)} Z`}function vt(t,a,l,s){const e=s*1.5;return a!==void 0&&a!==""&&(t.bottom-=e),l!==void 0&&l!==""&&(t.left+=e),{x:t.left-e/2,y:t.bottom+e/2}}function kt(t,a,l,s,e,h,i){s!==void 0&&s!==""&&t.words.push({x:a.x+a.width/2,y:l.y,text:s,size:h,anchor:"middle",color:i}),e!==void 0&&e!==""&&t.words.push({x:l.x,y:a.y+a.height/2,text:e,size:h,anchor:"middle",color:i,rotate:-90})}const ht=(t,a,l,s,e)=>{const h=t.labels;if(!h)return"";const i=isRound(t.type),o=[];return h.show_series_name&&o.push(s.name),h.show_category_name&&o.push(e),(h.show_value??!(h.show_percentage??!1))&&o.push(formatValue(a,h.number_format??s.number_format)),h.show_percentage&&i&&o.push(formatValue(l,h.number_format??"0%")),o.join(", ")};function Bt(t,a,l,s,e){const h=CHART_DEFAULTS,i=t.category_axis??{},o=t.value_axis??{},C=vt(l,i.title,o.title,s),_=t.series.map(c=>c.values.flatMap(($,H)=>{const I=c.x?.[H]??(c.x?null:H+1);return I===null||$===null?[]:[[I,$]]})),F=_.flat().map(c=>c[0]),b=_.flat().map(c=>c[1]),P=c=>c.length>0?Math.min(...c):0,B=c=>c.length>0?Math.max(...c):1,N=o.number_format??t.series[0]?.number_format??"General",Z=i.number_format??"General",g=s*.5,R=chartScale(P(b),B(b),l.bottom-l.top,s*2.4,o),W=o.visible===!1?0:Math.max(0,...R.ticks.map(c=>it(formatValue(c,N),s)))+g,O=i.visible===!1?0:s*1.2+g,x={x:l.left+W,y:l.top,width:l.right-l.left-W,height:l.bottom-l.top-O};a.plot=x,kt(a,x,C,i.title,o.title,s,e);const E=chartScale(P(F),B(F),x.width,s*5,i),L=chartScale(P(b),B(b),x.height,s*2.4,o),z=c=>x.x+(Math.min(E.max,Math.max(E.min,c))-E.min)/(E.max-E.min)*x.width,D=c=>x.y+x.height-(Math.min(L.max,Math.max(L.min,c))-L.min)/(L.max-L.min)*x.height;for(const c of L.ticks){const $=D(c);(o.has_major_gridlines??!0)&&a.grid.push({d:`M${d(x.x)} ${d($)} H${d(x.x+x.width)}`,color:o.gridline_color??{rgb:h.gridline},width:h.gridWidth}),o.visible!==!1&&a.words.push({x:x.x-g,y:$,text:formatValue(c,N),size:s,anchor:"end",color:e})}for(const c of E.ticks){const $=z(c);i.has_major_gridlines===!0&&a.grid.push({d:`M${d($)} ${d(x.y)} V${d(x.y+x.height)}`,color:i.gridline_color??{rgb:h.gridline},width:h.gridWidth}),i.visible!==!1&&a.words.push({x:$,y:x.y+x.height+g+s*.6,text:formatValue(c,Z),size:s,anchor:"middle",color:e})}a.axes.push({d:`M${d(x.x)} ${d(D(Math.max(L.min,Math.min(L.max,0))))} H${d(x.x+x.width)}`,color:i.line_color??{rgb:h.axisLine},width:h.gridWidth}),t.series.forEach((c,$)=>{const H=c.color??accentOf($),I=(_[$]??[]).map(([U,Y])=>[z(U),D(Y)]);if(I.length!==0&&(hasLines(t.type)&&a.lines.push({d:t.type==="scatter-smooth"||c.smooth===!0?$t(I):lt(I),color:H,width:c.line_width??h.lineWidth,series:$}),hasMarkers(t.type)))for(const[U,Y]of I)a.dots.push({x:U,y:Y,r:(c.marker_size??h.marker)/2,color:H})})}export function chartDrawing(t,a,l){const s=CHART_DEFAULTS,e=t.font_size??s.fontSize,h=t.font_color??"dk1",i={grid:[],shapes:[],boxes:[],lines:[],axes:[],dots:[],keys:[],words:[],plot:{x:0,y:0,width:0,height:0}},o={left:s.margin,top:s.margin,right:a-s.margin,bottom:l-s.margin};if(t.title!==void 0&&t.title!==""){const n=t.title_size??e*s.titleScale;i.words.push({x:a/2,y:o.top+n*.7,text:t.title,size:n,anchor:"middle",color:h}),o.top+=n*1.6}const C=isRound(t.type),_=variesOf(t),F=(n,m)=>_?accentOf(m):t.series[n]?.color??accentOf(n);if(t.legend!==void 0){const n=_?t.categories:t.series.map(p=>p.name),m=e*.6,f=e*.4,r=e*1.5,y=n.map(p=>m+f+it(p,e)),S=(p,M,w)=>{i.keys.push({x:M,y:w-m/2,width:m,height:m,color:_?accentOf(p):t.series[p]?.color??accentOf(p),series:_?0:p,category:_?p:0}),i.words.push({x:M+m+f,y:w,text:n[p]??"",size:e,anchor:"start",color:h})};if(t.legend==="top"||t.legend==="bottom"){const p=y.reduce((A,v)=>A+v,0)+e*(n.length-1),M=t.legend==="top"?o.top+r/2:o.bottom-r/2;let w=(a-p)/2;n.forEach((A,v)=>{S(v,w,M),w+=(y[v]??0)+e}),t.legend==="top"?o.top+=r:o.bottom-=r}else{const p=Math.max(0,...y),M=t.legend==="left"?o.left:o.right-p,w=(o.top+o.bottom-r*n.length)/2+r/2;n.forEach((A,v)=>{S(v,M,w+v*r)}),t.legend==="left"?o.left+=p+e:o.right-=p+e}}const b=t.labels,P=b?.size??e,B=b?.color??h,N=(n,m,f,r,y=B)=>{f!==""&&i.words.push({x:n,y:m,text:f,size:P,anchor:r,color:y})};if(C){const n=t.series[0],m=(n?.values??[]).map(w=>Math.max(0,w??0)),f=m.reduce((w,A)=>w+A,0),r=Math.max(0,Math.min(o.right-o.left,o.bottom-o.top)/2),y=(o.left+o.right)/2,S=(o.top+o.bottom)/2,p=t.type==="doughnut"?r*((t.hole_size??s.holeSize)/100):0;i.plot={x:y-r,y:S-r,width:r*2,height:r*2};let M=0;return m.forEach((w,A)=>{const v=f>0?w/f:0,V=M+v*Math.PI*2;if(v>0){i.shapes.push({d:Ft(y,S,r,p,M,V),color:"lt1",width:1,fill:F(0,A),series:0,category:A});const j=(M+V)/2,k=p>0?(r+p)/2:labelPositionOf(t)==="inEnd"?r*.85:r*.6;n&&N(y+k*Math.sin(j),S-k*Math.cos(j),ht(t,w,v,n,t.categories[A]??""),"middle",b?.color??"lt1")}M=V}),i}if(isScatter(t.type))return Bt(t,i,o,e,h),i;const Z=Math.max(1,t.categories.length),g=isHorizontal(t.type),R=groupingOf(t.type),W=R!=="clustered"&&R!=="standard",O=R==="percentStacked",x=t.series.map(n=>t.categories.map((m,f)=>n.values[f]??null)),E=t.categories.map((n,m)=>x.reduce((f,r)=>f+Math.abs(r[m]??0),0)),L=(n,m)=>{const f=x[n]?.[m];if(f==null)return null;const r=E[m]??0;return O?r>0?f/r:0:f};let z=0,D=0;if(t.categories.forEach((n,m)=>{let f=0,r=0;t.series.forEach((y,S)=>{const p=L(S,m)??0;W?p>=0?f+=p:r+=p:(f=Math.max(f,p),r=Math.min(r,p))}),D=Math.max(D,f),z=Math.min(z,r)}),!W){const n=x.flat().filter(m=>m!==null);n.length>0&&Math.min(...n)>0&&(z=Math.min(...n))}O&&(D=1,z=Math.min(z,0));const c=t.value_axis??{},$=t.category_axis??{},H=c.number_format??(O?"0%":t.series[0]?.number_format??"General"),I=g?o.right-o.left:o.bottom-o.top,U=g?e*5:e*2.4,Y=chartScale(z,D,I,U,{...c,...O?{maximum_scale:c.maximum_scale??1}:{}}),Wt=c.visible===!1?[]:Y.ticks.map(n=>formatValue(n,H)),Et=Math.max(0,...Wt.map(n=>it(n,e))),ot=$.visible!==!1,dt=ot?Math.max(0,...t.categories.map(n=>it(n,e))):0,T=e*.5,mt=g?c.title:$.title,ft=g?$.title:c.title,St=vt(o,mt,ft,e),u=g?{x:o.left+(ot?dt+T:0),y:o.top,width:0,height:o.bottom-o.top-(c.visible===!1?0:e*1.2+T)}:{x:o.left+(c.visible===!1?0:Et+T),y:o.top,width:0,height:o.bottom-o.top-(ot?e*1.2+T:0)};u.width=o.right-u.x,i.plot=u,kt(i,u,St,mt,ft,e,h);const G=chartScale(z,D,g?u.width:u.height,U,{...c,...O?{maximum_scale:c.maximum_scale??1}:{}}),ut=n=>(Math.min(G.max,Math.max(G.min,n))-G.min)/(G.max-G.min)*(g?u.width:u.height),q=n=>g?u.x+ut(n):u.y+u.height-ut(n),pt=isArea(t.type),gt=$.reverse_order===!0,xt=g?!gt:gt,at=(g?u.height:u.width)/Z,yt=pt?(g?u.height:u.width)/Math.max(1,Z-1):at,ct=n=>{const m=pt?n*yt:(n+.5)*at,f=g?u.height:u.width,r=xt?f-m:m;return(g?u.y:u.x)+r},Mt=q(Math.max(G.min,Math.min(G.max,0)));for(const n of G.ticks){const m=q(n);(c.has_major_gridlines??!0)&&i.grid.push({d:g?`M${d(m)} ${d(u.y)} V${d(u.y+u.height)}`:`M${d(u.x)} ${d(m)} H${d(u.x+u.width)}`,color:c.gridline_color??{rgb:s.gridline},width:s.gridWidth}),c.visible!==!1&&i.words.push(g?{x:m,y:u.y+u.height+T+e*.6,text:formatValue(n,H),size:e,anchor:"middle",color:h}:{x:u.x-T,y:m,text:formatValue(n,H),size:e,anchor:"end",color:h})}if(i.axes.push({d:g?`M${d(Mt)} ${d(u.y)} V${d(u.y+u.height)}`:`M${d(u.x)} ${d(Mt)} H${d(u.x+u.width)}`,color:$.line_color??{rgb:s.axisLine},width:s.gridWidth}),ot){const n=g?e*1.3:dt+e,m=Math.max(1,Math.ceil(n/Math.max(1,yt)));t.categories.forEach((f,r)=>{if(r%m!==0)return;const y=ct(r);i.words.push(g?{x:u.x-T,y,text:f,size:e,anchor:"end",color:h}:{x:y,y:u.y+u.height+T+e*.6,text:f,size:e,anchor:"middle",color:h})})}if(isBar(t.type)){const n=(t.gap_width??s.gapWidth)/100,m=W?1:t.series.length,f=W?1:(t.overlap??0)/100,r=at/(Math.max(1,m-(m-1)*f)+n),y=r*(1-f),S=r+y*(m-1);t.categories.forEach((p,M)=>{const w=ct(M);let A=0,v=0;t.series.forEach((V,j)=>{const k=L(j,M);if(k===null)return;const nt=W?k>=0?A:v:0,tt=nt+k;W&&(k>=0?A=tt:v=tt);const J=q(nt),K=q(tt),st=(W?w-r/2:w-S/2+j*y)+(g&&xt&&!W?S-r-2*j*y:0),Pt=g?{x:Math.min(J,K),y:st,width:Math.abs(K-J),height:r}:{x:st,y:Math.min(J,K),width:r,height:Math.abs(K-J)};if(i.boxes.push({...Pt,color:F(j,M),series:j,category:M}),!b)return;const wt=ht(t,x[j]?.[M]??0,0,V,t.categories[M]??""),rt=labelPositionOf(t),Q=P*.8,At=k>=0?1:-1,_t=(et,X)=>rt==="ctr"?(et+X)/2:rt==="inBase"?et+(X>et?Q:-Q):rt==="inEnd"?X-(X>et?Q:-Q):X+(X>=et?Q:-Q);g?N(_t(J,K),st+r/2,wt,rt==="outEnd"?At>0?"start":"end":"middle"):N(st+r/2,_t(J,K),wt,"middle")})})}else{const n=t.categories.map(()=>0),m=t.series.map((f,r)=>{const y=[],S=[];return t.categories.forEach((p,M)=>{const w=L(r,M);if(w===null)return;const A=W?n[M]??0:0,v=A+w;W&&(n[M]=v);const V=ct(M),j=k=>g?[q(k),V]:[V,q(k)];if(y.push(j(v)),S.push(j(A)),isLine(t.type)&&b){const k=labelPositionOf(t),[nt,tt]=j(v);N(nt+(k==="r"?P:k==="l"?-P:0),tt+(k==="t"?-P:k==="b"?P:0),ht(t,x[r]?.[M]??0,0,f,t.categories[M]??""),k==="r"?"start":k==="l"?"end":"middle")}}),{series:f,s:r,points:y,base:S}});for(const{series:f,s:r,points:y,base:S}of m){const p=f.color??accentOf(r);if(isArea(t.type)&&y.length>0)i.shapes.push({d:`${lt([...y,...[...S].reverse()])} Z`,color:p,width:0,fill:p,series:r});else if(y.length>0&&(i.lines.push({d:f.smooth===!0?$t(y):lt(y),color:p,width:f.line_width??s.lineWidth,series:r}),hasMarkers(t.type)))for(const[M,w]of y)i.dots.push({x:M,y:w,r:(f.marker_size??s.marker)/2,color:p})}i.shapes.reverse()}return i}
2
+ import{format as Ct,isValidFormat as Lt}from"numfmt";import{brightened as jt}from"@allyhub-next/ooxml/brightness";export const themeColor=(t,s=0)=>s===0?t:{theme_color:t,brightness:s},themeColorOf=t=>typeof t=="string"?t:"theme_color"in t?t.theme_color:void 0;export function colorRgb(t,s){return typeof t=="string"?s[t]:"rgb"in t?t.rgb:jt(s[t.theme_color],t.brightness)}export const CHART_DEFAULTS={fontSize:12,titleScale:1.2,gapWidth:150,holeSize:50,margin:6,gridline:"#D9D9D9",axisLine:"#BFBFBF",letter:.55,lineWidth:2.25,gridWidth:.75,marker:5};const wt=["accent1","accent2","accent3","accent4","accent5","accent6"];export const accentOf=t=>wt[t%wt.length]??"accent1",isBar=t=>t.startsWith("column")||t.startsWith("bar"),isHorizontal=t=>t.startsWith("bar"),isLine=t=>t.startsWith("line"),isArea=t=>t.startsWith("area"),isRound=t=>t==="pie"||t==="doughnut",isScatter=t=>t.startsWith("scatter"),hasLines=t=>!isScatter(t)||t!=="scatter",hasMarkers=t=>t==="line-markers"||t==="scatter"||t==="scatter-lines",groupingOf=t=>t.endsWith("-100")?"percentStacked":t.endsWith("-stacked")?"stacked":isBar(t)?"clustered":"standard";export function labelPositionsOf(t){return isArea(t)||t==="doughnut"?[]:t==="pie"?["bestFit","outEnd","inEnd","ctr"]:isLine(t)||isScatter(t)?["t","b","l","r","ctr"]:groupingOf(t)==="clustered"?["outEnd","inEnd","ctr","inBase"]:["inEnd","ctr","inBase"]}export function labelPositionOf(t){const s=labelPositionsOf(t.type),l=t.labels?.position;if(l!==void 0&&s.includes(l))return l;if(s.length!==0)return t.type==="pie"?"ctr":isLine(t.type)||isScatter(t.type)?"t":groupingOf(t.type)==="clustered"?"outEnd":"ctr"}export const variesOf=t=>t.vary_by_categories??isRound(t.type);export function formatValue(t,s="General"){return s==="General"||!Lt(s)?String(Number(t.toPrecision(10))):Ct(s,t)}const Ft=[1,2,5,10];export function chartScale(t,s,l,r,e={}){const h=t>0&&(s-t)/s<.16666666666666666?t:Math.min(t,0),a=s<=0&&t<0?0:s,o=e.minimum_scale??h,j=e.maximum_scale??a,b=j>o?j-o:1,F=Math.max(1,Math.floor(l/r)),w=b/F,P=10**Math.floor(Math.log10(w)),O=e.major_unit??(Ft.find(E=>E*P>=w)??10)*P,B=(E,C)=>Number((C(Number((E/O).toFixed(9)))*O).toPrecision(12)),Z=a>0?a+b*.05:a===h?b:a,g=e.maximum_scale??B(Z,Math.ceil),R=h<0?h-b*.05:h,W=e.minimum_scale??B(R,Math.floor),N=[],x=Math.round((g-W)/O);for(let E=0;E<=x;E++)N.push(Number((W+E*O).toPrecision(12)));return{min:W,max:g,major:O,ticks:N}}const it=(t,s)=>{let l=0;for(const r of t)l+=(r.codePointAt(0)??0)>11903?1:CHART_DEFAULTS.letter;return l*s},d=t=>String(Number(t.toFixed(3)));function $t(t){const s=l=>t[Math.max(0,Math.min(t.length-1,l))]??[0,0];return t.map(([l,r],e)=>{if(e===0)return`M${d(l)} ${d(r)}`;const[h,a]=s(e-2),[o,j]=s(e-1),[b,F]=s(e+1),w=`${d(o+(l-h)/6)} ${d(j+(r-a)/6)}`,P=`${d(l-(b-o)/6)} ${d(r-(F-j)/6)}`;return`C${w} ${P} ${d(l)} ${d(r)}`}).join(" ")}const lt=t=>t.map(([s,l],r)=>`${r===0?"M":"L"}${d(s)} ${d(l)}`).join(" ");function Ot(t,s,l,r,e,h){const a=(F,w)=>`${d(t+F*Math.sin(w))} ${d(s-F*Math.cos(w))}`,o=h-e>=Math.PI*2?e+Math.PI*2-1e-4:h,j=o-e>Math.PI?1:0,b=`M${a(l,e)} A${d(l)} ${d(l)} 0 ${String(j)} 1 ${a(l,o)}`;return r<=0?`${b} L${d(t)} ${d(s)} Z`:`${b} L${a(r,o)} A${d(r)} ${d(r)} 0 ${String(j)} 0 ${a(r,e)} Z`}function vt(t,s,l,r){const e=r*1.5;return s!==void 0&&s!==""&&(t.bottom-=e),l!==void 0&&l!==""&&(t.left+=e),{x:t.left-e/2,y:t.bottom+e/2}}function kt(t,s,l,r,e,h,a){r!==void 0&&r!==""&&t.words.push({x:s.x+s.width/2,y:l.y,text:r,size:h,anchor:"middle",color:a}),e!==void 0&&e!==""&&t.words.push({x:l.x,y:s.y+s.height/2,text:e,size:h,anchor:"middle",color:a,rotate:-90})}const ht=(t,s,l,r,e)=>{const h=t.labels;if(!h)return"";const a=isRound(t.type),o=[];return h.show_series_name&&o.push(r.name),h.show_category_name&&o.push(e),(h.show_value??!(h.show_percentage??!1))&&o.push(formatValue(s,h.number_format??r.number_format)),h.show_percentage&&a&&o.push(formatValue(l,h.number_format??"0%")),o.join(", ")};function Bt(t,s,l,r,e){const h=CHART_DEFAULTS,a=t.category_axis??{},o=t.value_axis??{},j=vt(l,a.title,o.title,r),b=t.series.map(c=>c.values.flatMap(($,H)=>{const I=c.x?.[H]??(c.x?null:H+1);return I===null||$===null?[]:[[I,$]]})),F=b.flat().map(c=>c[0]),w=b.flat().map(c=>c[1]),P=c=>c.length>0?Math.min(...c):0,O=c=>c.length>0?Math.max(...c):1,B=o.number_format??t.series[0]?.number_format??"General",Z=a.number_format??"General",g=r*.5,R=chartScale(P(w),O(w),l.bottom-l.top,r*2.4,o),W=o.visible===!1?0:Math.max(0,...R.ticks.map(c=>it(formatValue(c,B),r)))+g,N=a.visible===!1?0:r*1.2+g,x={x:l.left+W,y:l.top,width:l.right-l.left-W,height:l.bottom-l.top-N};s.plot=x,kt(s,x,j,a.title,o.title,r,e);const E=chartScale(P(F),O(F),x.width,r*5,a),C=chartScale(P(w),O(w),x.height,r*2.4,o),z=c=>x.x+(Math.min(E.max,Math.max(E.min,c))-E.min)/(E.max-E.min)*x.width,D=c=>x.y+x.height-(Math.min(C.max,Math.max(C.min,c))-C.min)/(C.max-C.min)*x.height;for(const c of C.ticks){const $=D(c);(o.has_major_gridlines??!0)&&s.grid.push({d:`M${d(x.x)} ${d($)} H${d(x.x+x.width)}`,color:o.gridline_color??{rgb:h.gridline},width:h.gridWidth}),o.visible!==!1&&s.words.push({x:x.x-g,y:$,text:formatValue(c,B),size:r,anchor:"end",color:e})}for(const c of E.ticks){const $=z(c);a.has_major_gridlines===!0&&s.grid.push({d:`M${d($)} ${d(x.y)} V${d(x.y+x.height)}`,color:a.gridline_color??{rgb:h.gridline},width:h.gridWidth}),a.visible!==!1&&s.words.push({x:$,y:x.y+x.height+g+r*.6,text:formatValue(c,Z),size:r,anchor:"middle",color:e})}s.axes.push({d:`M${d(x.x)} ${d(D(Math.max(C.min,Math.min(C.max,0))))} H${d(x.x+x.width)}`,color:a.line_color??{rgb:h.axisLine},width:h.gridWidth}),t.series.forEach((c,$)=>{const H=c.color??accentOf($),I=(b[$]??[]).map(([U,Y])=>[z(U),D(Y)]);if(I.length!==0&&(hasLines(t.type)&&s.lines.push({d:t.type==="scatter-smooth"||c.smooth===!0?$t(I):lt(I),color:H,width:c.line_width??h.lineWidth,series:$}),hasMarkers(t.type)))for(const[U,Y]of I)s.dots.push({x:U,y:Y,r:(c.marker_size??h.marker)/2,color:H})})}export function chartDrawing(t,s,l){const r=CHART_DEFAULTS,e=t.font_size??r.fontSize,h=t.font_color??"dk1",a={grid:[],shapes:[],boxes:[],lines:[],axes:[],dots:[],keys:[],words:[],plot:{x:0,y:0,width:0,height:0}},o={left:r.margin,top:r.margin,right:s-r.margin,bottom:l-r.margin};if(t.title!==void 0&&t.title!==""){const n=t.title_size??e*r.titleScale;a.words.push({x:s/2,y:o.top+n*.7,text:t.title,size:n,anchor:"middle",color:h}),o.top+=n*1.6}const j=isRound(t.type),b=variesOf(t),F=(n,m)=>b?accentOf(m):t.series[n]?.color??accentOf(n);if(t.legend!==void 0){const n=b?t.categories:t.series.map(p=>p.name),m=e*.6,f=e*.4,i=e*1.5,y=n.map(p=>m+f+it(p,e)),S=(p,M,_)=>{a.keys.push({x:M,y:_-m/2,width:m,height:m,color:b?accentOf(p):t.series[p]?.color??accentOf(p),series:b?0:p,category:b?p:0}),a.words.push({x:M+m+f,y:_,text:n[p]??"",size:e,anchor:"start",color:h})};if(t.legend==="top"||t.legend==="bottom"){const p=y.reduce((A,v)=>A+v,0)+e*(n.length-1),M=t.legend==="top"?o.top+i/2:o.bottom-i/2;let _=(s-p)/2;n.forEach((A,v)=>{S(v,_,M),_+=(y[v]??0)+e}),t.legend_overlay!==!0&&(t.legend==="top"?o.top+=i:o.bottom-=i)}else{const p=Math.max(0,...y),M=t.legend==="left"?o.left:o.right-p,_=(o.top+o.bottom-i*n.length)/2+i/2;n.forEach((A,v)=>{S(v,M,_+v*i)}),t.legend_overlay!==!0&&(t.legend==="left"?o.left+=p+e:o.right-=p+e)}}const w=t.labels,P=w?.size??e,O=w?.color??h,B=(n,m,f,i,y=O)=>{f!==""&&a.words.push({x:n,y:m,text:f,size:P,anchor:i,color:y})};if(j){const n=t.series[0],m=(n?.values??[]).map(_=>Math.max(0,_??0)),f=m.reduce((_,A)=>_+A,0),i=Math.max(0,Math.min(o.right-o.left,o.bottom-o.top)/2),y=(o.left+o.right)/2,S=(o.top+o.bottom)/2,p=t.type==="doughnut"?i*((t.hole_size??r.holeSize)/100):0;a.plot={x:y-i,y:S-i,width:i*2,height:i*2};let M=0;return m.forEach((_,A)=>{const v=f>0?_/f:0,V=M+v*Math.PI*2;if(v>0){a.shapes.push({d:Ot(y,S,i,p,M,V),color:"lt1",width:1,fill:F(0,A),series:0,category:A});const L=(M+V)/2,k=p>0?(i+p)/2:labelPositionOf(t)==="inEnd"?i*.85:i*.6;n&&B(y+k*Math.sin(L),S-k*Math.cos(L),ht(t,_,v,n,t.categories[A]??""),"middle",w?.color??"lt1")}M=V}),a}if(isScatter(t.type))return Bt(t,a,o,e,h),a;const Z=Math.max(1,t.categories.length),g=isHorizontal(t.type),R=groupingOf(t.type),W=R!=="clustered"&&R!=="standard",N=R==="percentStacked",x=t.series.map(n=>t.categories.map((m,f)=>n.values[f]??null)),E=t.categories.map((n,m)=>x.reduce((f,i)=>f+Math.abs(i[m]??0),0)),C=(n,m)=>{const f=x[n]?.[m];if(f==null)return null;const i=E[m]??0;return N?i>0?f/i:0:f};let z=0,D=0;if(t.categories.forEach((n,m)=>{let f=0,i=0;t.series.forEach((y,S)=>{const p=C(S,m)??0;W?p>=0?f+=p:i+=p:(f=Math.max(f,p),i=Math.min(i,p))}),D=Math.max(D,f),z=Math.min(z,i)}),!W){const n=x.flat().filter(m=>m!==null);n.length>0&&Math.min(...n)>0&&(z=Math.min(...n))}N&&(D=1,z=Math.min(z,0));const c=t.value_axis??{},$=t.category_axis??{},H=c.number_format??(N?"0%":t.series[0]?.number_format??"General"),I=g?o.right-o.left:o.bottom-o.top,U=g?e*5:e*2.4,Y=chartScale(z,D,I,U,{...c,...N?{maximum_scale:c.maximum_scale??1}:{}}),Wt=c.visible===!1?[]:Y.ticks.map(n=>formatValue(n,H)),Et=Math.max(0,...Wt.map(n=>it(n,e))),ot=$.visible!==!1,dt=ot?Math.max(0,...t.categories.map(n=>it(n,e))):0,T=e*.5,mt=g?c.title:$.title,ft=g?$.title:c.title,St=vt(o,mt,ft,e),u=g?{x:o.left+(ot?dt+T:0),y:o.top,width:0,height:o.bottom-o.top-(c.visible===!1?0:e*1.2+T)}:{x:o.left+(c.visible===!1?0:Et+T),y:o.top,width:0,height:o.bottom-o.top-(ot?e*1.2+T:0)};u.width=o.right-u.x,a.plot=u,kt(a,u,St,mt,ft,e,h);const G=chartScale(z,D,g?u.width:u.height,U,{...c,...N?{maximum_scale:c.maximum_scale??1}:{}}),ut=n=>(Math.min(G.max,Math.max(G.min,n))-G.min)/(G.max-G.min)*(g?u.width:u.height),q=n=>g?u.x+ut(n):u.y+u.height-ut(n),pt=isArea(t.type),gt=$.reverse_order===!0,xt=g?!gt:gt,at=(g?u.height:u.width)/Z,yt=pt?(g?u.height:u.width)/Math.max(1,Z-1):at,ct=n=>{const m=pt?n*yt:(n+.5)*at,f=g?u.height:u.width,i=xt?f-m:m;return(g?u.y:u.x)+i},Mt=q(Math.max(G.min,Math.min(G.max,0)));for(const n of G.ticks){const m=q(n);(c.has_major_gridlines??!0)&&a.grid.push({d:g?`M${d(m)} ${d(u.y)} V${d(u.y+u.height)}`:`M${d(u.x)} ${d(m)} H${d(u.x+u.width)}`,color:c.gridline_color??{rgb:r.gridline},width:r.gridWidth}),c.visible!==!1&&a.words.push(g?{x:m,y:u.y+u.height+T+e*.6,text:formatValue(n,H),size:e,anchor:"middle",color:h}:{x:u.x-T,y:m,text:formatValue(n,H),size:e,anchor:"end",color:h})}if(a.axes.push({d:g?`M${d(Mt)} ${d(u.y)} V${d(u.y+u.height)}`:`M${d(u.x)} ${d(Mt)} H${d(u.x+u.width)}`,color:$.line_color??{rgb:r.axisLine},width:r.gridWidth}),ot){const n=g?e*1.3:dt+e,m=Math.max(1,Math.ceil(n/Math.max(1,yt)));t.categories.forEach((f,i)=>{if(i%m!==0)return;const y=ct(i);a.words.push(g?{x:u.x-T,y,text:f,size:e,anchor:"end",color:h}:{x:y,y:u.y+u.height+T+e*.6,text:f,size:e,anchor:"middle",color:h})})}if(isBar(t.type)){const n=(t.gap_width??r.gapWidth)/100,m=W?1:t.series.length,f=W?1:(t.overlap??0)/100,i=at/(Math.max(1,m-(m-1)*f)+n),y=i*(1-f),S=i+y*(m-1);t.categories.forEach((p,M)=>{const _=ct(M);let A=0,v=0;t.series.forEach((V,L)=>{const k=C(L,M);if(k===null)return;const nt=W?k>=0?A:v:0,tt=nt+k;W&&(k>=0?A=tt:v=tt);const J=q(nt),K=q(tt),st=(W?_-i/2:_-S/2+L*y)+(g&&xt&&!W?S-i-2*L*y:0),Pt=g?{x:Math.min(J,K),y:st,width:Math.abs(K-J),height:i}:{x:st,y:Math.min(J,K),width:i,height:Math.abs(K-J)};if(a.boxes.push({...Pt,color:F(L,M),series:L,category:M}),!w)return;const _t=ht(t,x[L]?.[M]??0,0,V,t.categories[M]??""),rt=labelPositionOf(t),Q=P*.8,At=k>=0?1:-1,bt=(et,X)=>rt==="ctr"?(et+X)/2:rt==="inBase"?et+(X>et?Q:-Q):rt==="inEnd"?X-(X>et?Q:-Q):X+(X>=et?Q:-Q);g?B(bt(J,K),st+i/2,_t,rt==="outEnd"?At>0?"start":"end":"middle"):B(st+i/2,bt(J,K),_t,"middle")})})}else{const n=t.categories.map(()=>0),m=t.series.map((f,i)=>{const y=[],S=[];return t.categories.forEach((p,M)=>{const _=C(i,M);if(_===null)return;const A=W?n[M]??0:0,v=A+_;W&&(n[M]=v);const V=ct(M),L=k=>g?[q(k),V]:[V,q(k)];if(y.push(L(v)),S.push(L(A)),isLine(t.type)&&w){const k=labelPositionOf(t),[nt,tt]=L(v);B(nt+(k==="r"?P:k==="l"?-P:0),tt+(k==="t"?-P:k==="b"?P:0),ht(t,x[i]?.[M]??0,0,f,t.categories[M]??""),k==="r"?"start":k==="l"?"end":"middle")}}),{series:f,s:i,points:y,base:S}});for(const{series:f,s:i,points:y,base:S}of m){const p=f.color??accentOf(i);if(isArea(t.type)&&y.length>0)a.shapes.push({d:`${lt([...y,...[...S].reverse()])} Z`,color:p,width:0,fill:p,series:i});else if(y.length>0&&(a.lines.push({d:f.smooth===!0?$t(y):lt(y),color:p,width:f.line_width??r.lineWidth,series:i}),hasMarkers(t.type)))for(const[M,_]of y)a.dots.push({x:M,y:_,r:(f.marker_size??r.marker)/2,color:p})}a.shapes.reverse()}return a}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/chart",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,4 +1,4 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{deckFacts as ge}from"@allyhub-next/slides-core";import{createHash as te}from"node:crypto";import{join as se}from"node:path";import{uniformInt as oe}from"pure-rand/distribution/uniformInt";import{xoroshiro128plus as we}from"pure-rand/generator/xoroshiro128plus";import{CACHE_DIR as xe}from"@allyhub-next/formats";import{buildModule as be}from"@allyhub-next/model/build";import{ffmpegOf as ye,ffmpegRuns as $e,postPlaces as ke,postProblems as Se,readPng as ne}from"@allyhub-next/render";import{comboIdOf as U,comboKey as B,comboMatches as Me,countLevels as ve,coverCombos as Fe,cutThroughout as ie,pieceNamed as ae,problem as z,CONSOLE_LIMIT as Ce}from"@allyhub-next/video-core";import{OutputCache as Le,cacheKey as De,checkerId as Ee}from"./cache.js";import{consoleOf as Ae,baseDigest as Pe,outputDigest as re,dedupe as ce,StuckError as me,CheckSession as _e,runtimeDigest as Ie,extraCombos as Te}from"@allyhub-next/project";import{matrixFacts as Ke,measuredFacts as Oe,screenFidelity as Re,flatFrames as je,cutSeams as He,flashFrames as Be,stillPicture as ze}from"@allyhub-next/measure";import{generatedFact as Ne,generatedPagedFact as Ue,mismatchFacts as Ge}from"./generated.js";import{StretchLoudness as fe,estimatePlan as Ye,loadedPlan as qe,planProblems as Je}from"./plans.js";import{sceneryLayerFacts as Qe,withBakes as Ve}from"./scenery.js";export function checkStats(s,t,o,e=0){const i=t.length;return{loaded:t,reused:o,outputs:{total:s,checked:i,reused:Math.max(0,s-i-e),covered:e}}}const We=new Set(["text-time","words-on-screen","speech-on-screen","text-covered","flat-frames","still-picture"]);export const plural=(s,t)=>`${String(s)} ${t}${s===1?"":"s"}`;const de=s=>we(te("sha256").update(s).digest().readInt32BE(0));export function samplesFor(s,t,o,e){const i=new Set(s.slice(0,e)),r=de(o),c=Math.floor(t*30);for(let f=0;i.size<Math.min(e,c)&&f<e*20;f++)i.add(oe(r,0,c-1)/30);return[...i]}export function shuffled(s,t){const o=[...s],e=de(t);for(let i=o.length-1;i>0;i--){const r=oe(e,0,i),c=o[i],f=o[r];c===void 0||f===void 0||(o[i]=f,o[r]=c)}return o}export const RASTER_NOISE=3,RASTER_SPECKS=8;export function frameDifference(s,t){const o=ne(s),e=ne(t);if(o.width!==e.width||o.height!==e.height)return{max:255,pixels:Math.max(o.width*o.height,1)};let i=0,r=0;for(let c=0;c<o.data.length;c+=4){let f=0;for(let d=0;d<4;d++)f=Math.max(f,Math.abs((o.data[c+d]??0)-(e.data[c+d]??0)));f>RASTER_NOISE&&r++,f>i&&(i=f)}return{max:i,pixels:r}}export const CUT_RECHECK={most:48,every:2};export async function recheckCuts(s,t,o,e){const i=ie(t);if(i.length===0)return t;const r=CUT_RECHECK.every/o,c=new Set;for(const d of i){const a=e.find(h=>h.key===d.part);if(!a)continue;const l=t.moments.filter(h=>h.part===d.part).map(h=>h.t).sort((h,C)=>h-C),x=d.moments[0]??d.t,b=d.moments.at(-1)??d.t,F=Math.max(a.start,l.filter(h=>h<x).at(-1)??a.start),T=Math.min(a.end-1/o,l.find(h=>h>b)??a.end),A=Math.min(CUT_RECHECK.most,Math.floor((T-F)/r)+1),R=A>1?(T-F)/(A-1):0;for(let h=0;h<A;h++){const C=Math.round((F+R*h)*o)/o;l.includes(C)||c.add(C)}}if(c.size===0)return t;const f=await s.measure([...c].sort((d,a)=>d-a));return{...t,moments:[...t.moments,...f.moments].sort((d,a)=>d.t-a.t)}}export function offFrameProblems(s,t){const o=e=>`${e.toFixed(2)} s`;return ie(s).map(e=>{const i=e.moments[0]??0,r=e.moments.at(-1)??i,c=e.moments.length===1?`at ${o(i)}, the one moment measured that shows it`:`at all ${String(e.moments.length)} moments measured that show it (${i.toFixed(2)}–${o(r)})`,f=e.worst.edges.map(l=>`${String(l.px)} pixels past the ${l.side} edge`).join(" and "),d=`"${e.text.text.length>40?`${e.text.text.slice(0,40)}…`:e.text.text}"`,a=s.deck?`Text goes off the slide: the slide's edge cuts ${d} of ${e.text.layer} on slide ${e.part}; its letters reach ${f} at ${t.format} (${String(Math.round(e.worst.share*100))}% of them outside). Move or size its shape inside the slide, or give it less text. allyhub inspect --kind text-off-frame has it.`:void 0;return z("AK-L002",a??`Text goes off the frame: the frame cuts "${e.text.text.length>40?`${e.text.text.slice(0,40)}…`:e.text.text}" ${c}; its letters reach ${f} at ${t.format} (${String(Math.round(e.worst.share*100))}% of them outside). Move it inside the frame or make it smaller (fitText in a component); text that is part of a picture the frame crops on purpose (a mocked interface) goes inside an element with data-ak-picture. allyhub inspect --kind text-off-frame has each moment.`,{piece:t.piece,output:t.output,combo:t.combo,format:t.format,part:e.part,t:e.t,where:{bbox:e.worst.glyphs}})})}const le=s=>te("sha256").update(s).digest("hex");export async function determinism(s,t,o){const e=s.timeline,i=samplesFor(e.parts.map(a=>a.still),e.duration,t,o),r=new Map;for(const a of[...i].sort((l,x)=>l-x))r.set(a,await s.shot(a));const c=[];let f=0;for(const a of shuffled(i,`${t}:shuffle`)){const l=r.get(a),x=await s.shot(a);if(!l||le(x)===le(l))continue;const b=frameDifference(l,x);b.pixels>RASTER_SPECKS&&(c.push(a),f=Math.max(f,b.max))}if(c.length===0)return[];c.sort((a,l)=>a-l);const d=[...new Set(c.flatMap(a=>e.parts.filter(l=>a>=l.start&&a<l.end).map(l=>l.key)))];return[z("AK-D002",`${plural(c.length,"moment")} drew differently in order and out of order (${c.map(a=>`${a.toFixed(2)}s`).join(", ")}; pixels differ by up to ${String(f)} levels). render must depend only on t, not on state left by an earlier frame.`,{piece:s.target.piece,output:s.target.output,combo:s.target.combo,format:s.target.format,t:c[0]??0,...d.length===1&&d[0]?{part:d[0]}:{}})]}export function summarize(s){const t=ve(s);return{status:t.errors>0?"failed":t.warnings>0?"warnings":"passed",...t}}function Xe(s,t){const o=r=>[r.piece??"",r.output??"",r.combo?B(r.combo):"",r.format??"",r.part??"",r.where?.file??"",String(r.where?.line??0).padStart(6,"0"),r.code].join("\0"),e=o(s),i=o(t);return e<i?-1:e>i?1:0}class Ze{spent=new Map;on=process.env.ALLYHUB_CHECK_TIMINGS==="1";async time(t,o){if(!this.on)return o();const e=performance.now();try{return await o()}finally{this.spent.set(t,(this.spent.get(t)??0)+(performance.now()-e)/1e3)}}report(){if(!this.on)return;const t=[...this.spent].sort((o,e)=>e[1]-o[1]);process.stderr.write(`Check timings (s): ${t.map(([o,e])=>`${o} ${e.toFixed(2)}`).join(", ")}
3
- `)}}function et(s){const t=s.options,o=t.post,e=typeof o=="object"&&o!==null?o.filter:void 0;return{transparent:t.transparent===!0,deliverable:t.deliverable!==!1,...typeof t.maxDuration=="number"?{maxDuration:t.maxDuration}:{},...typeof e=="string"?{post:e}:{}}}async function tt(s){let t;try{t=await ye(s===void 0?{}:{ffmpeg:s})}catch(o){return{missing:`the pinned ffmpeg could not be had: ${(o instanceof Error?o.message:String(o)).split(`
4
- `)[0]??""}`}}return await $e(t)?{ffmpeg:t}:{missing:`${t} does not run`}}export async function runCheck(s){const t=new Ze,o=s.session??await t.time("prepare (discover, metadata, bundle)",()=>_e.open({root:s.dir,...s.buildDir===void 0?{}:{buildDir:s.buildDir},...s.gpu===void 0?{}:{gpu:s.gpu},...s.consoleLimit===void 0?{}:{consoleLimit:s.consoleLimit}}));try{const e=o.prepared,i=s.samples??12,r=o.consoleLimit,c=await Ie(),f=await Le.open(e.root,await Ee({runtimeSha:c,samples:i,gpu:o.gpu,...r===Ce?{}:{consoleLimit:r}}));let d;const a=()=>d??=tt(s.ffmpeg),l=[],x=[...e.problems],b=[],F=[],T=[],A=[];let R=0,h=0;const C=[];let L;const ue=e.pieces.filter(n=>s.piece===void 0||ae({id:n.id,path:n.place},s.piece));for(const n of ue){if(!e.bundle?.chunks.entries[n.id.replaceAll("/","__")])continue;const M=et(n),P=n.kind,K=n.format,Y=await Pe(e,n,c);b.push(...Ke(n));const q=new Set,j=[...n.combos.filter(p=>!s.combos?.length||s.combos.some(u=>Me(p,u,U(n.matrix,p)))),...Te(n,s.combos)],pe=new Set(n.matrix?Fe(n.matrix.space,n.dims,j):j.keys()),_=[],J=p=>{T.push(p);for(const u of p.reads?.media??[])q.add(u.path);p.timeline&&_.push({...p,timeline:p.timeline})};let N=!1;const he=(p,u,I)=>{if(s.fresh===!0)return;const m=f.get(p),y=m?.result.reads,D=m?.result.timeline;return!m||!y||!D||I&&!m.sampled||m.factless===!0&&s.facts!==!1?void 0:re(e,Y,n,u,y)===m.digest?m:void 0};for(const[p,u]of j.entries()){const I=U(n.matrix,u),m={piece:n.id,output:P,combo:u,format:K},y=B(u);if(F.push({...m,...I?{id:I}:{},key:y}),!pe.has(p)){h++;continue}const D=n.kind==="video"&&!N,E=De(n.id,P,y,K),g=he(E,u,D);if(g){R++,g.sampled&&(N=!0),x.push(...g.problems),b.push(...g.facts),l.push({version:m,log:g.console}),J({...g.result,digest:g.digest}),f.set(E,g);continue}A.push(`${n.id}/${P}/${y}/${K}`);const w=await t.time("load (mount, stills)",()=>o.open(n,m));try{const $=w.summary,O=[],v=[...$?.facts??[]];let Q=!1;try{if($){const k=$.timeline;try{const S=await t.time("layout measure",()=>w.measure());O.push(...offFrameProblems(S.deck?S:await t.time("recheck cut text",()=>recheckCuts(w,S,k.fps,k.parts)),m));const ee=await a();v.push(...await t.time("layout facts",()=>Oe(S,k,m,{root:e.root,media:e.media,ffmpeg:"ffmpeg"in ee?ee.ffmpeg:"ffmpeg"},k.profile?.label))),S.deck&&v.push(...ge(S.deck,{width:S.width,height:S.height},{piece:m.piece,output:m.output,combo:m.combo,format:m.format}))}catch(S){if(S instanceof me)throw S}s.facts!==!1&&v.push(...await t.time("scenery facts",()=>Qe(w)))}$&&D&&(N=!0,Q=!0,O.push(...await t.time("determinism",()=>determinism(w,`${n.id}:${P}:${K}`,i))),s.facts!==!1&&!M.transparent&&v.push(...await t.time("flat frames",()=>je(w))),s.facts!==!1&&v.push(...await t.time("still picture",()=>ze(w))),s.facts!==!1&&(v.push(...await t.time("cut seams",()=>He(w))),M.transparent||v.push(...await t.time("flash",()=>Be(w))))),$&&s.facts!==!1&&v.push(...(await t.time("scenery screen fidelity",()=>Re(w))).facts)}catch(k){if(!(k instanceof me))throw k;k.kept||O.push(z("AK-P003",k.message,{piece:m.piece,output:m.output,combo:m.combo,format:m.format}))}O.push(...await w.problems());const V=ce(O);x.push(...V);const W=M.deliverable?v:v.filter(k=>!We.has(k.kind));b.push(...W);const X=await w.console();l.push({version:m,log:X});const H=$?re(e,Y,n,u,$.reads):void 0,Z={...m,...$?{timeline:$.timeline,reads:$.reads,text:$.text}:{}};J({...Z,...H?{digest:H}:{}}),H&&f.set(E,{digest:H,result:Z,problems:V,facts:W,sampled:Q,...s.facts===!1?{factless:!0}:{},console:X})}finally{await w.close()}}if(n.kind==="video"){const p=ke(M.post,_.map(u=>u.timeline));if(p.length>0){const u=await a();"ffmpeg"in u&&x.push(...await t.time("post chains",()=>Se(p,{piece:n.id,output:P},u.ffmpeg)))}}if(n.kind!=="video")for(const p of _){const u=Ue(p,e.media);u&&b.push(u)}else for(const p of j){const u=U(n.matrix,p),I=B(p),m=_.find(g=>B(g.combo)===I),y=m?qe(m,u):Ye(n,p,u,P,K,_);if(!y)continue;if(C.push(y),n.matrix&&L===void 0){const g=await a();if("ffmpeg"in g){const w=new fe(e.root,g.ffmpeg);await w.open(),L=w}else L={missing:"ffmpeg",why:`${g.missing} (set ALLYHUB_FFMPEG to an ffmpeg, or let the runtime manager fetch its pinned one)`}}const D=await t.time("plans (loudness, music)",()=>Je(y,{...M.maxDuration===void 0?{}:{maxDuration:M.maxDuration},fps:m?.timeline.fps??_[0]?.timeline.fps??30,media:e.media,local:g=>o.mediaPath(g),...n.matrix&&L?{loudness:L}:{}}));x.push(...D.problems),b.push(...D.facts);const E=Ne(y,e.media);E&&b.push(E)}b.push(...Ge({piece:n.id},q,e.media))}for(const n of e.items)if(n.kind==="model"&&!(s.piece!==void 0&&!ae({id:n.dir,path:n.dir},s.piece)))try{await t.time("models",()=>be(se(e.root,n.entry),{root:e.root,cache:se(e.root,xe,"model"),log:()=>{}}))}catch(M){x.push(z("AK-B010",`${n.entry} does not build: ${M instanceof Error?M.message:String(M)}`,{piece:n.dir,where:{file:n.entry}}))}L instanceof fe&&await L.save(),await f.save(new Set(e.pieces.map(n=>n.id)));const G=ce(x).sort(Xe);return t.report(),{targets:F,check:summarize(G),problems:G,facts:await Ve(b,e.root),results:T,plans:C,stats:checkStats(F.length,A,R,h),console:Ae(r,l)}}finally{s.session||await o.close()}}
2
+ import{deckFacts as ge}from"@allyhub-next/slides-core";import{createHash as te}from"node:crypto";import{join as se}from"node:path";import{uniformInt as oe}from"pure-rand/distribution/uniformInt";import{xoroshiro128plus as we}from"pure-rand/generator/xoroshiro128plus";import{CACHE_DIR as xe}from"@allyhub-next/formats";import{buildModule as be}from"@allyhub-next/model/build";import{ffmpegOf as ye,ffmpegRuns as $e,postPlaces as ke,postProblems as Se,readPng as ne}from"@allyhub-next/render";import{comboIdOf as U,comboKey as z,comboMatches as Me,countLevels as ve,coverCombos as Fe,cutThroughout as ie,pieceNamed as re,problem as j,CONSOLE_LIMIT as Le}from"@allyhub-next/video-core";import{OutputCache as Ce,cacheKey as De,checkerId as Pe}from"./cache.js";import{consoleOf as Ae,baseDigest as Ee,outputDigest as ae,dedupe as ce,StuckError as me,CheckSession as _e,runtimeDigest as Ie,extraCombos as Ke,measureDeck as Te}from"@allyhub-next/project";import{matrixFacts as Oe,measuredFacts as je,screenFidelity as Re,flatFrames as He,cutSeams as Be,flashFrames as ze,stillPicture as Ne}from"@allyhub-next/measure";import{generatedFact as Ue,generatedPagedFact as Ge,mismatchFacts as Ye}from"./generated.js";import{StretchLoudness as fe,estimatePlan as qe,loadedPlan as Je,planProblems as Qe}from"./plans.js";import{sceneryLayerFacts as Ve,withBakes as We}from"./scenery.js";export function checkStats(t,s,o,e=0){const i=s.length;return{loaded:s,reused:o,outputs:{total:t,checked:i,reused:Math.max(0,t-i-e),covered:e}}}const Xe=new Set(["text-time","words-on-screen","speech-on-screen","text-covered","flat-frames","still-picture"]);export const plural=(t,s)=>`${String(t)} ${s}${t===1?"":"s"}`;const de=t=>we(te("sha256").update(t).digest().readInt32BE(0));export function samplesFor(t,s,o,e){const i=new Set(t.slice(0,e)),a=de(o),c=Math.floor(s*30);for(let f=0;i.size<Math.min(e,c)&&f<e*20;f++)i.add(oe(a,0,c-1)/30);return[...i]}export function shuffled(t,s){const o=[...t],e=de(s);for(let i=o.length-1;i>0;i--){const a=oe(e,0,i),c=o[i],f=o[a];c===void 0||f===void 0||(o[i]=f,o[a]=c)}return o}export const RASTER_NOISE=3,RASTER_SPECKS=8;export function frameDifference(t,s){const o=ne(t),e=ne(s);if(o.width!==e.width||o.height!==e.height)return{max:255,pixels:Math.max(o.width*o.height,1)};let i=0,a=0;for(let c=0;c<o.data.length;c+=4){let f=0;for(let d=0;d<4;d++)f=Math.max(f,Math.abs((o.data[c+d]??0)-(e.data[c+d]??0)));f>RASTER_NOISE&&a++,f>i&&(i=f)}return{max:i,pixels:a}}export const CUT_RECHECK={most:48,every:2};export async function recheckCuts(t,s,o,e){const i=ie(s);if(i.length===0)return s;const a=CUT_RECHECK.every/o,c=new Set;for(const d of i){const r=e.find(w=>w.key===d.part);if(!r)continue;const l=s.moments.filter(w=>w.part===d.part).map(w=>w.t).sort((w,L)=>w-L),h=d.moments[0]??d.t,g=d.moments.at(-1)??d.t,F=Math.max(r.start,l.filter(w=>w<h).at(-1)??r.start),K=Math.min(r.end-1/o,l.find(w=>w>g)??r.end),A=Math.min(CUT_RECHECK.most,Math.floor((K-F)/a)+1),R=A>1?(K-F)/(A-1):0;for(let w=0;w<A;w++){const L=Math.round((F+R*w)*o)/o;l.includes(L)||c.add(L)}}if(c.size===0)return s;const f=await t.measure([...c].sort((d,r)=>d-r));return{...s,moments:[...s.moments,...f.moments].sort((d,r)=>d.t-r.t)}}export function offFrameProblems(t,s){const o=e=>`${e.toFixed(2)} s`;return ie(t).map(e=>{const i=e.moments[0]??0,a=e.moments.at(-1)??i,c=e.moments.length===1?`at ${o(i)}, the one moment measured that shows it`:`at all ${String(e.moments.length)} moments measured that show it (${i.toFixed(2)}–${o(a)})`,f=e.worst.edges.map(h=>`${String(h.px)} pixels past the ${h.side} edge`).join(" and "),d=`"${e.text.text.length>40?`${e.text.text.slice(0,40)}…`:e.text.text}"`,r={piece:s.piece,output:s.output,combo:s.combo,format:s.format,part:e.part},l=t.deck;if(l){const h=g=>Math.round(g/l.pxPerPt*10)/10;return j("AK-L002",`Text goes off the slide: the slide's edge cuts ${d} of ${e.text.layer} on slide ${e.part} at every build that shows it; its letters reach ${e.worst.edges.map(g=>`${String(h(g.px))} pt past the ${g.side} edge`).join(" and ")} (${String(Math.round(e.worst.share*100))}% of them outside). Move or size its shape inside the slide, or give it less text. allyhub inspect --kind text-off-slide has it.`,{...r,level:"error"})}return j("AK-L002",`Text goes off the frame: the frame cuts ${d} ${c}; its letters reach ${f} at ${s.format} (${String(Math.round(e.worst.share*100))}% of them outside). Move it inside the frame or make it smaller (fitText in a component); text that is part of a picture the frame crops on purpose (a mocked interface) goes inside an element with data-ak-picture. allyhub inspect --kind text-off-frame has each moment.`,{...r,t:e.t,where:{bbox:e.worst.glyphs}})})}const le=t=>te("sha256").update(t).digest("hex");export async function determinism(t,s,o){const e=t.timeline,i=samplesFor(e.parts.map(r=>r.still),e.duration,s,o),a=new Map;for(const r of[...i].sort((l,h)=>l-h))a.set(r,await t.shot(r));const c=[];let f=0;for(const r of shuffled(i,`${s}:shuffle`)){const l=a.get(r),h=await t.shot(r);if(!l||le(h)===le(l))continue;const g=frameDifference(l,h);g.pixels>RASTER_SPECKS&&(c.push(r),f=Math.max(f,g.max))}if(c.length===0)return[];c.sort((r,l)=>r-l);const d=[...new Set(c.flatMap(r=>e.parts.filter(l=>r>=l.start&&r<l.end).map(l=>l.key)))];return[j("AK-D002",`${plural(c.length,"moment")} drew differently in order and out of order (${c.map(r=>`${r.toFixed(2)}s`).join(", ")}; pixels differ by up to ${String(f)} levels). render must depend only on t, not on state left by an earlier frame.`,{piece:t.target.piece,output:t.target.output,combo:t.target.combo,format:t.target.format,t:c[0]??0,...d.length===1&&d[0]?{part:d[0]}:{}})]}export function summarize(t){const s=ve(t);return{status:s.errors>0?"failed":s.warnings>0?"warnings":"passed",...s}}function Ze(t,s){const o=a=>[a.piece??"",a.output??"",a.combo?z(a.combo):"",a.format??"",a.part??"",a.where?.file??"",String(a.where?.line??0).padStart(6,"0"),a.code].join("\0"),e=o(t),i=o(s);return e<i?-1:e>i?1:0}class et{spent=new Map;on=process.env.ALLYHUB_CHECK_TIMINGS==="1";async time(s,o){if(!this.on)return o();const e=performance.now();try{return await o()}finally{this.spent.set(s,(this.spent.get(s)??0)+(performance.now()-e)/1e3)}}report(){if(!this.on)return;const s=[...this.spent].sort((o,e)=>e[1]-o[1]);process.stderr.write(`Check timings (s): ${s.map(([o,e])=>`${o} ${e.toFixed(2)}`).join(", ")}
3
+ `)}}function tt(t){const s=t.options,o=s.post,e=typeof o=="object"&&o!==null?o.filter:void 0;return{transparent:s.transparent===!0,deliverable:s.deliverable!==!1,...typeof s.maxDuration=="number"?{maxDuration:s.maxDuration}:{},...typeof e=="string"?{post:e}:{}}}async function st(t){let s;try{s=await ye(t===void 0?{}:{ffmpeg:t})}catch(o){return{missing:`the pinned ffmpeg could not be had: ${(o instanceof Error?o.message:String(o)).split(`
4
+ `)[0]??""}`}}return await $e(s)?{ffmpeg:s}:{missing:`${s} does not run`}}export async function runCheck(t){const s=new et,o=t.session??await s.time("prepare (discover, metadata, bundle)",()=>_e.open({root:t.dir,...t.buildDir===void 0?{}:{buildDir:t.buildDir},...t.gpu===void 0?{}:{gpu:t.gpu},...t.consoleLimit===void 0?{}:{consoleLimit:t.consoleLimit}}));try{const e=o.prepared,i=t.samples??12,a=o.consoleLimit,c=await Ie(),f=await Ce.open(e.root,await Pe({runtimeSha:c,samples:i,gpu:o.gpu,...a===Le?{}:{consoleLimit:a}}));let d;const r=()=>d??=st(t.ffmpeg),l=[],h=[...e.problems],g=[],F=[],K=[],A=[];let R=0,w=0;const L=[];let C;const ue=e.pieces.filter(n=>t.piece===void 0||re({id:n.id,path:n.place},t.piece));for(const n of ue){if(!e.bundle?.chunks.entries[n.id.replaceAll("/","__")])continue;const M=tt(n),E=n.kind,T=n.format,Y=await Ee(e,n,c);g.push(...Oe(n));const q=new Set,H=[...n.combos.filter(p=>!t.combos?.length||t.combos.some(u=>Me(p,u,U(n.matrix,p)))),...Ke(n,t.combos)],pe=new Set(n.matrix?Fe(n.matrix.space,n.dims,H):H.keys()),_=[],J=p=>{K.push(p);for(const u of p.reads?.media??[])q.add(u.path);p.timeline&&_.push({...p,timeline:p.timeline})};let N=!1;const he=(p,u,I)=>{if(t.fresh===!0)return;const m=f.get(p),y=m?.result.reads,D=m?.result.timeline;return!m||!y||!D||I&&!m.sampled||m.factless===!0&&t.facts!==!1?void 0:ae(e,Y,n,u,y)===m.digest?m:void 0};for(const[p,u]of H.entries()){const I=U(n.matrix,u),m={piece:n.id,output:E,combo:u,format:T},y=z(u);if(F.push({...m,...I?{id:I}:{},key:y}),!pe.has(p)){w++;continue}const D=n.kind==="video"&&!N,P=De(n.id,E,y,T),b=he(P,u,D);if(b){R++,b.sampled&&(N=!0),h.push(...b.problems),g.push(...b.facts),l.push({version:m,log:b.console}),J({...b.result,digest:b.digest}),f.set(P,b);continue}A.push(`${n.id}/${E}/${y}/${T}`);const x=await s.time("load (mount, stills)",()=>o.open(n,m));try{const $=x.summary,O=[],v=[...$?.facts??[]];let Q=!1;try{if($){const k=$.timeline;try{const S=await s.time("layout measure",()=>n.kind==="slides"?Te(o,n,x,{fresh:t.fresh===!0}):x.measure());if(O.push(...offFrameProblems(S.deck?S:await s.time("recheck cut text",()=>recheckCuts(x,S,k.fps,k.parts)),m)),S.deck)v.push(...ge(S.deck,{width:S.width,height:S.height},{piece:m.piece,output:m.output,combo:m.combo,format:m.format}));else{const ee=await r();v.push(...await s.time("layout facts",()=>je(S,k,m,{root:e.root,media:e.media,ffmpeg:"ffmpeg"in ee?ee.ffmpeg:"ffmpeg"},k.profile?.label)))}}catch(S){if(S instanceof me)throw S}t.facts!==!1&&v.push(...await s.time("scenery facts",()=>Ve(x)))}$&&D&&(N=!0,Q=!0,O.push(...await s.time("determinism",()=>determinism(x,`${n.id}:${E}:${T}`,i))),t.facts!==!1&&!M.transparent&&v.push(...await s.time("flat frames",()=>He(x))),t.facts!==!1&&v.push(...await s.time("still picture",()=>Ne(x))),t.facts!==!1&&(v.push(...await s.time("cut seams",()=>Be(x))),M.transparent||v.push(...await s.time("flash",()=>ze(x))))),$&&t.facts!==!1&&v.push(...(await s.time("scenery screen fidelity",()=>Re(x))).facts)}catch(k){if(!(k instanceof me))throw k;k.kept||O.push(j("AK-P003",k.message,{piece:m.piece,output:m.output,combo:m.combo,format:m.format}))}O.push(...await x.problems());const V=ce(O);h.push(...V);const W=M.deliverable?v:v.filter(k=>!Xe.has(k.kind));g.push(...W);const X=await x.console();l.push({version:m,log:X});const B=$?ae(e,Y,n,u,$.reads):void 0,Z={...m,...$?{timeline:$.timeline,reads:$.reads,text:$.text}:{}};J({...Z,...B?{digest:B}:{}}),B&&f.set(P,{digest:B,result:Z,problems:V,facts:W,sampled:Q,...t.facts===!1?{factless:!0}:{},console:X})}finally{await x.close()}}if(n.kind==="video"){const p=ke(M.post,_.map(u=>u.timeline));if(p.length>0){const u=await r();"ffmpeg"in u&&h.push(...await s.time("post chains",()=>Se(p,{piece:n.id,output:E},u.ffmpeg)))}}if(n.kind!=="video")for(const p of _){const u=Ge(p,e.media);u&&g.push(u)}else for(const p of H){const u=U(n.matrix,p),I=z(p),m=_.find(b=>z(b.combo)===I),y=m?Je(m,u):qe(n,p,u,E,T,_);if(!y)continue;if(L.push(y),n.matrix&&C===void 0){const b=await r();if("ffmpeg"in b){const x=new fe(e.root,b.ffmpeg);await x.open(),C=x}else C={missing:"ffmpeg",why:`${b.missing} (set ALLYHUB_FFMPEG to an ffmpeg, or let the runtime manager fetch its pinned one)`}}const D=await s.time("plans (loudness, music)",()=>Qe(y,{...M.maxDuration===void 0?{}:{maxDuration:M.maxDuration},fps:m?.timeline.fps??_[0]?.timeline.fps??30,media:e.media,local:b=>o.mediaPath(b),...n.matrix&&C?{loudness:C}:{}}));h.push(...D.problems),g.push(...D.facts);const P=Ue(y,e.media);P&&g.push(P)}g.push(...Ye({piece:n.id},q,e.media))}for(const n of e.items)if(n.kind==="model"&&!(t.piece!==void 0&&!re({id:n.dir,path:n.dir},t.piece)))try{await s.time("models",()=>be(se(e.root,n.entry),{root:e.root,cache:se(e.root,xe,"model"),log:()=>{}}))}catch(M){h.push(j("AK-B010",`${n.entry} does not build: ${M instanceof Error?M.message:String(M)}`,{piece:n.dir,where:{file:n.entry}}))}C instanceof fe&&await C.save(),await f.save(new Set(e.pieces.map(n=>n.id)));const G=ce(h).sort(Ze);return s.report(),{targets:F,check:summarize(G),problems:G,facts:await We(g,e.root),results:K,plans:L,stats:checkStats(F.length,A,R,w),console:Ae(a,l)}}finally{t.session||await o.close()}}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/check",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{mkdir as p,readFile as w,writeFile as b}from"node:fs/promises";import{dirname as y}from"node:path";import{BLOBS_MAX as d,BlobsResponseSchema as S}from"@allyhub-next/protocol";import{CloudError as k}from"./errors.js";const g=4,v=30*6e4;export class BlobStore{cloud;path;file;known;constructor(i,s){this.cloud=i,this.path=s.path,this.file=s.file}async load(){if(this.known)return this.known;if(this.file===void 0)return this.known=new Set;try{this.known=new Set(JSON.parse(await w(this.file,"utf8")))}catch{this.known=new Set}return this.known}async save(){this.file!==void 0&&(await p(y(this.file),{recursive:!0}),await b(this.file,JSON.stringify([...this.known??[]])))}async forget(i){const s=await this.load();for(const n of i)s.delete(n);await this.save()}async put(i){let s=0;const n=await this.load(),o=new Map;for(const e of i)n.has(e.sha256)||o.set(e.sha256,e);const l=[...o.values()];for(let e=0;e<l.length;e+=d){const c=l.slice(e,e+d),{uploads:a}=S.parse(await this.cloud.json(this.path,{method:"POST",body:{blobs:c.map(t=>({sha256:t.sha256,size:t.size,contentType:t.type}))}}));let f=0;const u=async()=>{for(;f<a.length;){const t=a[f++],r=t&&o.get(t.sha256);if(!t||!r)continue;const m=r.bytes??await w(r.file??""),h=await this.cloud.config.fetch(t.url,{method:"PUT",headers:t.headers,body:new Uint8Array(m),signal:AbortSignal.timeout(v)});if(!h.ok)throw new k("blob-refused",`Storage refused a blob: ${String(h.status)} ${(await h.text()).slice(0,200)}`);s+=1}};await Promise.all(Array.from({length:Math.min(g,a.length)},u));for(const t of c)n.add(t.sha256);await this.save()}return s}}
@@ -1,3 +1,5 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{mkdir as k,readdir as I,readFile as A,rm as M,writeFile as E}from"node:fs/promises";import{basename as T,dirname as F,extname as N,join as b}from"node:path";import{EXIT as w,FileContentResponseSchema as W,ToolCallSchema as O,callPath as L,fileContentPath as B,parseAllyFilePath as G,toolCallsPath as z}from"@allyhub-next/protocol";import{genFileFor as P}from"@allyhub-next/formats";import{CloudError as d}from"./errors.js";import{genRecord as K,inputHash as U,namedFile as X,readGen as Y,toolWords as Z,writeGen as q,writeWords as Q}from"./records.js";import{withKnownUploads as V}from"./uploads.js";export const WAIT_SECONDS=900,POLL_SECONDS={least:1,most:60},RETRY_SECONDS={least:1,most:30},READ_SECONDS=120;const tt=new Set([408,429,500,502,503,504]),et=t=>t instanceof d&&(t.code==="network"||t.status!==void 0&&tt.has(t.status)),x=t=>b(t.config.cacheDir,"jobs"),y=(t,n)=>b(x(t),`${n.replace(/[^A-Za-z0-9_-]/gu,"_")}.json`);async function nt(t,n,i){await k(F(y(t,n)),{recursive:!0}),await E(y(t,n),`${JSON.stringify(i,null,2)}
3
- `)}const D=(t,n)=>M(y(t,n),{force:!0});async function at(t,n,i){const e=await I(x(t)).catch(()=>[]);for(const o of e.filter(s=>s.endsWith(".json")).sort()){const s=await A(b(x(t),o),"utf8").then(r=>JSON.parse(r)).catch(()=>{});if(s?.jobId!==void 0&&s.file===n&&s.inputHash===i)return s.jobId}}async function ot(t,n){try{return JSON.parse(await A(y(t,n),"utf8"))}catch{throw new d("unknown-job",`No job ${n} was started on this computer.`,{exit:w.notFound,hint:"Call the tool again: that is a new call."})}}async function it(t,n,i,e,o){const{url:s}=W.parse(await t.json(B(n,"attachment"),{signal:R(o)}));let r;try{const l=await t.config.fetch(s,o?{signal:o}:{});if(!l.ok)throw new d("download-failed",`Downloading ${i} answered ${String(l.status)}.`,{exit:w.platform,status:l.status});r=Buffer.from(await l.arrayBuffer())}catch(l){throw l instanceof d||o?.aborted===!0?l:new d("network",`Downloading ${i} failed: ${l instanceof Error?l.message:String(l)}`,{exit:w.platform,cause:l})}const u="dir"in e?b(e.dir,T(i)):N(e.file)?e.file:`${e.file}${N(i)}`;return await k(F(u),{recursive:!0}),await E(u,r),u}const R=t=>t?AbortSignal.any([t,AbortSignal.timeout(READ_SECONDS*1e3)]):AbortSignal.timeout(READ_SECONDS*1e3),J=(t,n)=>new Promise((i,e)=>{const o=setTimeout(i,t*1e3);n?.addEventListener("abort",()=>{clearTimeout(o),e(n.reason instanceof Error?n.reason:new Error("Stopped."))},{once:!0})});export async function callTool(t,n,i,e){const o=e.file,s=await V(t,i,e.base),r=U(n,s);let u=e.jobId,l=!1;if(o!==void 0&&u===void 0){u=await at(t,o,r);const c=u===void 0?await X(o):void 0,f=c?await Y(c):void 0;if(e.force===!0)l=f!==void 0;else{if(c&&!f)throw new d("file-exists",`${c} is there, without a record (${T(P(c))}) saying a tool call made it.`,{exit:w.conflict,hint:"Choose another --file, or pass --force to replace it."});if(c&&f){if(f.tool===n&&f.inputHash===r)return{tool:n,output:f.output??{},file:c,gen:P(c),kept:{at:f.at}};throw new d("file-exists",`${c} was made by ${f.tool??"another tool"} from another input on ${f.at}.`,{exit:w.conflict,hint:"Choose another --file to keep it, or pass --force to make it again over it (charged again)."})}}}const p=Date.now()+(e.timeoutSeconds??WAIT_SECONDS)*1e3,g=e.signal;let a=u===void 0?O.parse(await t.json(z(n),{method:"POST",body:{input:i},...g?{signal:g}:{}})):await _(t,u,p,e);a.status==="working"&&u===void 0&&await nt(t,a.id,{jobId:a.id,tool:n,input:{...i},inputHash:r,outDir:e.outDir,...o===void 0?{}:{file:o}});const H=()=>({tool:n,jobId:a.id,status:"running",elapsedSeconds:(Date.now()-Date.parse(a.createdAt))/1e3,...o===void 0?{}:{file:o}});for(;a.status==="working";){if(e.wait===!1||Date.now()>p)return H();e.onRunning?.(a),await J(Math.min(Math.max((a.pollAfterMs??0)/1e3,POLL_SECONDS.least),POLL_SECONDS.most),g),a=await _(t,a.id,p,e)}if(a.status==="failed")throw await D(t,a.id),new d(`tool-${(a.error?.kind??"failed").replaceAll("_","-")}`,a.error?.message??"The tool failed.",{exit:a.error?.kind==="input"?w.usage:w.platform,hint:a.error?.kind==="input"||a.error?.kind==="not_found"?"A failed call is not charged. Change the input and call again.":"A failed call is not charged. Call it again; a supplier's failure often passes."});const h=typeof a.output=="object"&&a.output!==null?a.output:{value:a.output},j=h.allyFilePath,S=typeof j=="string"?G(j):void 0,m={tool:n,output:h,...a.credits===void 0?{}:{credits:a.credits}};if(S){const c=a.id,f=await v(c,()=>it(t,S.id,S.name,o!==void 0?{file:o}:{dir:e.outDir},g),p,e);m.file=f,m.gen=await q(f,await K(f,{tool:n,input:s,output:h,credits:a.credits}));const C=Z(h),$=h.durationSeconds;C&&(m.words=await Q(f,C,typeof $=="number"&&$>=0?$:void 0)),l&&(m.replaced=!0)}return await D(t,a.id),m}async function _(t,n,i,e){try{return await v(n,async()=>O.parse(await t.json(L(n),{signal:R(e.signal)})),i,e)}catch(o){throw o instanceof d&&o.status===404&&await D(t,n),o}}async function v(t,n,i,e){const o=e.retrySeconds??RETRY_SECONDS;for(let s=o.least;;)try{return await n()}catch(r){if(!et(r)||e.signal?.aborted===!0)throw r;if(Date.now()+s*1e3>i)throw new d(r.code,r.message,{exit:r.exit,...r.status===void 0?{}:{status:r.status},hint:`Call ${t} goes on at AllyHub, charged once when it works: --resume ${t} waits for it again (so does the same call to the same --file).`,cause:r});e.onRetry?.(t,r,s),await J(s,e.signal),s=Math.min(s*2,o.most)}}export async function resumeJob(t,n,i){const e=await ot(t,n);if(i.tool!==void 0&&i.tool!==e.tool)throw new d("wrong-job",`Job ${n} is ${e.tool}'s, not ${i.tool}'s.`,{exit:w.usage,hint:`Resume it with ${e.tool}.`});return await callTool(t,e.tool,e.input,{...i,outDir:e.outDir,...e.file===void 0?{}:{file:e.file},jobId:n})}
2
+ import{mkdir as $,readdir as W,readFile as A,rm as B,writeFile as j}from"node:fs/promises";import{basename as T,dirname as k,extname as C,join as m}from"node:path";import{EXIT as w,FileContentResponseSchema as z,ToolCallSchema as J,callPath as G,fileContentPath as U,parseAllyFilePath as Z,toolCallsPath as K}from"@allyhub-next/protocol";import{genFileFor as _}from"@allyhub-next/formats";import{CloudError as d}from"./errors.js";import{genRecord as P,inputHash as X,namedFile as Y,readGen as q,toolWords as Q,writeGen as R,writeWords as V}from"./records.js";import{withKnownUploads as tt}from"./uploads.js";export const WAIT_SECONDS=900,POLL_SECONDS={least:1,most:60},RETRY_SECONDS={least:1,most:30},READ_SECONDS=120;const et=new Set([408,429,500,502,503,504]),at=t=>t instanceof d&&(t.code==="network"||t.status!==void 0&&et.has(t.status));function nt(t){return Object.values(t).flatMap(e=>Array.isArray(e)?e:[e]).filter(e=>typeof e=="string").join("-").replace(/^https?:\/\//u,"").replace(/[^\p{L}\p{N}._]+/gu,"-").replace(/^-+|-+$/gu,"").slice(0,40).replace(/-+$/u,"")}async function it(t,e,i,a,o){await $(t,{recursive:!0});const r=a.replace(/[^A-Za-z0-9_-]/gu,"_").slice(0,8),s=[e,nt(i),r].filter(Boolean).join("-"),c=m(t,`${s}.output.json`);return await j(c,`${JSON.stringify(o,null,2)}
3
+ `),c}async function ot(t,e){const i=C(t)===""?`${t}.json`:t;return await $(k(i),{recursive:!0}),await j(i,`${JSON.stringify(e,null,2)}
4
+ `),i}const N=t=>m(t.config.cacheDir,"jobs"),D=(t,e)=>m(N(t),`${e.replace(/[^A-Za-z0-9_-]/gu,"_")}.json`);async function rt(t,e,i){await $(k(D(t,e)),{recursive:!0}),await j(D(t,e),`${JSON.stringify(i,null,2)}
5
+ `)}const O=(t,e)=>B(D(t,e),{force:!0});async function st(t,e,i){const a=await W(N(t)).catch(()=>[]);for(const o of a.filter(r=>r.endsWith(".json")).sort()){const r=await A(m(N(t),o),"utf8").then(s=>JSON.parse(s)).catch(()=>{});if(r?.jobId!==void 0&&r.file===e&&r.inputHash===i)return r.jobId}}async function lt(t,e){try{return JSON.parse(await A(D(t,e),"utf8"))}catch{throw new d("unknown-job",`No job ${e} was started on this computer.`,{exit:w.notFound,hint:"Call the tool again: that is a new call."})}}async function ut(t,e,i,a,o){const{url:r}=z.parse(await t.json(U(e,"attachment"),{signal:v(o)}));let s;try{const l=await t.config.fetch(r,o?{signal:o}:{});if(!l.ok)throw new d("download-failed",`Downloading ${i} answered ${String(l.status)}.`,{exit:w.platform,status:l.status});s=Buffer.from(await l.arrayBuffer())}catch(l){throw l instanceof d||o?.aborted===!0?l:new d("network",`Downloading ${i} failed: ${l instanceof Error?l.message:String(l)}`,{exit:w.platform,cause:l})}const c="dir"in a?m(a.dir,T(i)):C(a.file)?a.file:`${a.file}${C(i)}`;return await $(k(c),{recursive:!0}),await j(c,s),c}const v=t=>t?AbortSignal.any([t,AbortSignal.timeout(READ_SECONDS*1e3)]):AbortSignal.timeout(READ_SECONDS*1e3),H=(t,e)=>new Promise((i,a)=>{const o=setTimeout(i,t*1e3);e?.addEventListener("abort",()=>{clearTimeout(o),a(e.reason instanceof Error?e.reason:new Error("Stopped."))},{once:!0})});export async function callTool(t,e,i,a){const o=a.file,r=await tt(t,i,a.base),s=X(e,r);let c=a.jobId,l=!1;if(o!==void 0&&c===void 0){c=await st(t,o,s);const f=c===void 0?await Y(o):void 0,u=f?await q(f):void 0;if(a.force===!0)l=u!==void 0;else{if(f&&!u)throw new d("file-exists",`${f} is there, without a record (${T(_(f))}) saying a tool call made it.`,{exit:w.conflict,hint:"Choose another --file, or pass --force to replace it."});if(f&&u){if(u.tool===e&&u.inputHash===s)return{tool:e,output:typeof u.output?.allyFilePath=="string"?u.output:JSON.parse(await A(f,"utf8")),file:f,gen:_(f),kept:{at:u.at}};throw new d("file-exists",`${f} was made by ${u.tool??"another tool"} from another input on ${u.at}.`,{exit:w.conflict,hint:"Choose another --file to keep it, or pass --force to make it again over it (charged again)."})}}}const y=Date.now()+(a.timeoutSeconds??WAIT_SECONDS)*1e3,b=a.signal;let n=c===void 0?J.parse(await t.json(K(e),{method:"POST",body:{input:i},...b?{signal:b}:{}})):await I(t,c,y,a);n.status==="working"&&c===void 0&&await rt(t,n.id,{jobId:n.id,tool:e,input:{...i},inputHash:s,outDir:a.outDir,...o===void 0?{}:{file:o}});const L=()=>({tool:e,jobId:n.id,status:"running",elapsedSeconds:(Date.now()-Date.parse(n.createdAt))/1e3,...o===void 0?{}:{file:o}});for(;n.status==="working";){if(a.wait===!1||Date.now()>y)return L();a.onRunning?.(n),await H(Math.min(Math.max((n.pollAfterMs??0)/1e3,POLL_SECONDS.least),POLL_SECONDS.most),b),n=await I(t,n.id,y,a)}if(n.status==="failed")throw await O(t,n.id),new d(`tool-${(n.error?.kind??"failed").replaceAll("_","-")}`,n.error?.message??"The tool failed.",{exit:n.error?.kind==="input"?w.usage:w.platform,hint:n.error?.kind==="input"||n.error?.kind==="not_found"?"A failed call is not charged. Change the input and call again.":"A failed call is not charged. Call it again; a supplier's failure often passes."});if(n.status!=="completed")throw new d("tool-state",`The call ${n.id} is ${n.status}, a state this version of allyhub does not know.`,{exit:w.platform,hint:"Update allyhub in the project (npm install allyhub@latest) and call it again."});const h=typeof n.output=="object"&&n.output!==null?n.output:{value:n.output},E=h.allyFilePath,S=typeof E=="string"?Z(E):void 0,g=!S&&o!==void 0?await ot(o,h):void 0,p={tool:e,output:h,outputFile:g??await it(a.outputDir??a.outDir,e,i,n.id,h),...n.credits===void 0?{}:{credits:n.credits}};if(S){const f=n.id,u=await M(f,()=>ut(t,S.id,S.name,o!==void 0?{file:o}:{dir:a.outDir},b),y,a);p.file=u,p.gen=await R(u,await P(u,{tool:e,input:r,output:h,credits:n.credits}));const F=Q(h),x=h.durationSeconds;F&&(p.words=await V(u,F,typeof x=="number"&&x>=0?x:void 0)),l&&(p.replaced=!0)}else g!==void 0&&(p.file=g,p.gen=await R(g,await P(g,{tool:e,input:r,output:h,credits:n.credits})),l&&(p.replaced=!0));return await O(t,n.id),p}async function I(t,e,i,a){try{return await M(e,async()=>J.parse(await t.json(G(e),{signal:v(a.signal)})),i,a)}catch(o){throw o instanceof d&&o.status===404&&await O(t,e),o}}async function M(t,e,i,a){const o=a.retrySeconds??RETRY_SECONDS;for(let r=o.least;;)try{return await e()}catch(s){if(!at(s)||a.signal?.aborted===!0)throw s;if(Date.now()+r*1e3>i)throw new d(s.code,s.message,{exit:s.exit,...s.status===void 0?{}:{status:s.status},hint:`Call ${t} goes on at AllyHub, charged once when it works: --resume ${t} waits for it again (so does the same call to the same --file).`,cause:s});a.onRetry?.(t,s,r),await H(r,a.signal),r=Math.min(r*2,o.most)}}export async function resumeJob(t,e,i){const a=await lt(t,e);if(i.tool!==void 0&&i.tool!==a.tool)throw new d("wrong-job",`Job ${e} is ${a.tool}'s, not ${i.tool}'s.`,{exit:w.usage,hint:`Resume it with ${a.tool}.`});return await callTool(t,a.tool,a.input,{...i,outDir:a.outDir,...a.file===void 0?{}:{file:a.file},jobId:e})}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{createHash as l}from"node:crypto";import{EXIT as o,ORGANIZATION_HEADER as y}from"@allyhub-next/protocol";import{accessOf as g,SignedOut as p}from"./credentials.js";import{CloudError as a,notSignedIn as f,unreachable as h}from"./errors.js";export function scrub(c,e){let t=c.replace(/(authorization)\s*[:=]\s*[^\r\n]+/giu,"$1: <redacted>");return t=t.replace(/\bahk_[A-Za-z0-9_-]+/gu,"<api-key>"),t=t.replace(/\beyJ[\w-]+\.[\w-]+\.[\w-]+/gu,"<token>"),e&&(t=t.split(e).join("<key>")),t}export class Cloud{config;constructor(e){this.config=e}get url(){return this.config.url}async key(){const e=this.config.apiKey;if(e)return{key:e,source:"env",account:l("sha256").update(e).digest("hex")};try{const t=await g(this.config);if(!t)return;const r=t.credentials.account.organization?.id;return{key:t.token,source:"oauth",account:t.credentials.account.id,expiresAt:t.expiresAt,...r===void 0?{}:{organization:r}}}catch(t){if(t instanceof p)return;throw h(this.url,t)}}async requireKey(){const e=await this.key();if(!e)throw f();return e}keyedFetch=async(e,t)=>{const r=n=>{const s=new Headers(t?.headers);return s.set("authorization",`Bearer ${n.key}`),n.organization!==void 0&&s.set(y,n.organization),this.config.fetch(e,{...t,headers:s})},i=await this.requireKey();return r(i)};async json(e,t={}){const r=t.auth!==!1,i=r?(await this.requireKey()).key:void 0;let n;try{n=await(r?this.keyedFetch:this.config.fetch)(`${this.url}${e}`,{redirect:"error",signal:t.signal??AbortSignal.timeout(3e4),method:t.method??"GET",headers:{accept:"application/json",...t.body===void 0?{}:{"content-type":"application/json"}},...t.body===void 0?{}:{body:JSON.stringify(t.body)}})}catch(u){throw u instanceof a?u:h(this.url,u)}const s=await n.text(),d=n.ok?void 0:m(s,n.status,i);if(d&&n.status!==401)throw d;if(n.status===403)throw new a("forbidden","This AllyHub account does not have access to this operation.",{exit:o.auth,status:403});if(n.status===401)throw f(r?"This computer's AllyHub sign-in is not valid any more.":void 0);if(!n.ok)throw new a("api-error",`${this.url}${e} answered ${String(n.status)}: ${scrub(s.slice(0,300),i)}`,{exit:n.status>=500?o.platform:o.usage,status:n.status});try{return JSON.parse(s)}catch{throw new a("api-error",`${this.url}${e} did not answer JSON.`,{exit:o.platform,status:n.status})}}}const w={bad_input:o.usage,insufficient_credits:o.auth,limit_reached:o.auth,forbidden:o.auth,not_found:o.notFound,conflict:o.conflict};function m(c,e,t){let r;try{r=JSON.parse(c)}catch{return}const i=r?.error;if(typeof i?.code!="string"||typeof i.message!="string")return;const n=typeof i.hint=="string"?i.hint:i.code==="insufficient_credits"?"Add credits to the AllyHub account.":void 0;return new a(i.code.replaceAll("_","-"),scrub(i.message,t),{exit:w[i.code]??o.platform,status:e,...n===void 0?{}:{hint:n}})}
2
+ import{createHash as l}from"node:crypto";import{EXIT as r,ORGANIZATION_HEADER as y}from"@allyhub-next/protocol";import{accessOf as g,SignedOut as p}from"./credentials.js";import{CloudError as s,notSignedIn as f,unreachable as h}from"./errors.js";export function scrub(c,e){let t=c.replace(/(authorization)\s*[:=]\s*[^\r\n]+/giu,"$1: <redacted>");return t=t.replace(/\bahk_[A-Za-z0-9_-]+/gu,"<api-key>"),t=t.replace(/\beyJ[\w-]+\.[\w-]+\.[\w-]+/gu,"<token>"),e&&(t=t.split(e).join("<key>")),t}export class Cloud{config;constructor(e){this.config=e}get url(){return this.config.url}async key(){const e=this.config.apiKey;if(e)return{key:e,source:"env",account:l("sha256").update(e).digest("hex")};try{const t=await g(this.config);if(!t)return;const o=t.credentials.account.organization?.id;return{key:t.token,source:"oauth",account:t.credentials.account.id,expiresAt:t.expiresAt,...o===void 0?{}:{organization:o}}}catch(t){if(t instanceof p)return;throw h(this.url,t)}}async requireKey(){const e=await this.key();if(!e)throw f();return e}keyedFetch=async(e,t)=>{const o=n=>{const a=new Headers(t?.headers);return a.set("authorization",`Bearer ${n.key}`),n.organization!==void 0&&a.set(y,n.organization),this.config.fetch(e,{...t,headers:a})},i=await this.requireKey();return o(i)};async json(e,t={}){const o=t.auth!==!1,i=o?(await this.requireKey()).key:void 0;let n;try{n=await(o?this.keyedFetch:this.config.fetch)(`${this.url}${e}`,{redirect:"error",signal:t.signal??AbortSignal.timeout(3e4),method:t.method??"GET",headers:{accept:"application/json",...t.body===void 0?{}:{"content-type":"application/json"}},...t.body===void 0?{}:{body:JSON.stringify(t.body)}})}catch(u){throw u instanceof s?u:h(this.url,u)}const a=await n.text(),d=n.ok?void 0:m(a,n.status,i);if(d&&n.status!==401)throw d;if(n.status===403)throw new s("forbidden","This AllyHub account does not have access to this operation.",{exit:r.auth,status:403});if(n.status===401)throw f(o?"This computer's AllyHub sign-in is not valid any more.":void 0);if(!n.ok)throw new s("api-error",`${this.url}${e} answered ${String(n.status)}: ${scrub(a.slice(0,300),i)}`,{exit:n.status>=500?r.platform:r.usage,status:n.status});try{return JSON.parse(a)}catch{throw new s("api-error",`${this.url}${e} did not answer JSON.`,{exit:r.platform,status:n.status})}}}const w={bad_input:r.usage,insufficient_credits:r.auth,limit_reached:r.auth,forbidden:r.auth,not_found:r.notFound,conflict:r.conflict,worked_elsewhere:r.conflict};function m(c,e,t){let o;try{o=JSON.parse(c)}catch{return}const i=o?.error;if(typeof i?.code!="string"||typeof i.message!="string")return;const n=typeof i.hint=="string"?i.hint:i.code==="insufficient_credits"?"Add credits to the AllyHub account.":void 0;return new s(i.code.replaceAll("_","-"),scrub(i.message,t),{exit:w[i.code]??r.platform,status:e,...n===void 0?{}:{hint:n},...typeof i.data=="object"&&i.data!==null?{data:i.data}:{}})}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{EXIT as r}from"@allyhub-next/protocol";export class CloudError extends Error{code;hint;exit;status;constructor(t,s,e={}){super(s,e.cause===void 0?void 0:{cause:e.cause}),this.name="CloudError",this.code=t,this.hint=e.hint,this.exit=e.exit??r.failed,this.status=e.status}}export const SIGN_IN="Run allyhub auth login (or set ALLYHUB_API_KEY).",notSignedIn=(n,t)=>new CloudError("not-signed-in",n??"This computer is not signed in to AllyHub.",{exit:r.auth,hint:t??SIGN_IN}),unreachable=(n,t)=>new CloudError("network",`Cannot reach ${n}: ${t instanceof Error?t.message:String(t)}`,{exit:r.platform,hint:"Check the connection; ALLYHUB_URL sets another address.",cause:t});
2
+ import{EXIT as r}from"@allyhub-next/protocol";export class CloudError extends Error{code;hint;exit;status;data;constructor(t,s,e={}){super(s,e.cause===void 0?void 0:{cause:e.cause}),this.name="CloudError",this.code=t,this.hint=e.hint,this.exit=e.exit??r.failed,this.status=e.status,this.data=e.data}}export const SIGN_IN="Run allyhub auth login (or set ALLYHUB_API_KEY).",notSignedIn=(n,t)=>new CloudError("not-signed-in",n??"This computer is not signed in to AllyHub.",{exit:r.auth,hint:t??SIGN_IN}),unreachable=(n,t)=>new CloudError("network",`Cannot reach ${n}: ${t instanceof Error?t.message:String(t)}`,{exit:r.platform,hint:"Check the connection; ALLYHUB_URL sets another address.",cause:t});
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{createHash as l}from"node:crypto";import{createReadStream as u}from"node:fs";import{mkdir as y,readdir as w,readFile as k,stat as z,writeFile as O}from"node:fs/promises";import{dirname as F,join as x,relative as M,sep as p}from"node:path";const v=n=>new Promise((s,t)=>{const e=l("sha256");u(n).on("data",i=>e.update(i)).on("error",t).on("end",()=>{s(e.digest("hex"))})});export const sha256Of=n=>l("sha256").update(n).digest("hex");export class Hashes{file;stamps;dirty=!1;constructor(s){this.file=s}async load(){if(this.stamps)return this.stamps;try{const s=JSON.parse(await k(this.file,"utf8"));this.stamps=new Map(Object.entries(s))}catch{this.stamps=new Map}return this.stamps}async of(s){const t=await z(s).catch(()=>{});if(!t?.isFile())return;const e=await this.load(),i=e.get(s);if(i?.size===t.size&&i.mtimeMs===t.mtimeMs)return{sha256:i.sha256,size:t.size};const a=await v(s);return e.set(s,{size:t.size,mtimeMs:t.mtimeMs,sha256:a}),this.dirty=!0,{sha256:a,size:t.size}}async keepOnly(s,t){const e=await this.load(),i=s.endsWith(p)?s:s+p;for(const a of e.keys())a.startsWith(i)&&!t.has(a)&&(e.delete(a),this.dirty=!0)}async save(){!this.dirty||!this.stamps||(this.dirty=!1,await y(F(this.file),{recursive:!0}),await O(this.file,JSON.stringify(Object.fromEntries(this.stamps))))}}export async function hashFolder(n,s,t){const e=r=>t.skip.some(o=>r===o||r.endsWith(`/${o}`)),i=[],a=new Set,m=async r=>{const o=await w(r,{withFileTypes:!0}).catch(()=>[]);for(const f of o){const c=x(r,f.name),h=M(n,c).split(p).join("/");if(f.isSymbolicLink())t.onLink?.(h);else if(f.isDirectory())!e(h)&&t.enter?.(h)!==!1&&await m(c);else if(f.isFile()){if(t.only&&!t.only(h))continue;const d=await s.of(c);if(!d)continue;a.add(c),i.push({path:h,file:c,...d})}}};return await m(n),t.prune!==!1&&await s.keepOnly(n,a),i.sort((r,o)=>r.path<o.path?-1:r.path>o.path?1:0)}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- export{cloudConfig,hostsText}from"./config.js";export{CloudError,notSignedIn,SIGN_IN}from"./errors.js";export{Cloud,scrub}from"./client.js";export{SignedOut,accessOf,accountOf,authServer,chooseOrganization,forgetCredentials,readCredentials,signInWithCode,signInWithDevice,signOut,writeCredentials}from"./credentials.js";export{SIGN_IN_WAIT_MS,openBrowser,signIn,signInByEmail,signInDevice,signInInBackground,signedInAs}from"./signin.js";export{LoopbackError,startLoopback}from"./loopback.js";export{pkcePair,randomState}from"./pkce.js";export{billingSummary,browserLink,organizations}from"./token.js";export{CATALOG_CACHE_SECONDS,findTool,loadCatalog}from"./catalog.js";export{POLL_SECONDS,READ_SECONDS,RETRY_SECONDS,WAIT_SECONDS,callTool,resumeJob}from"./call.js";export{REUSE_LEFT_MS,UPLOAD_CONCURRENCY,UPLOAD_TYPES,uploadFiles,urlExpiry,withKnownUploads}from"./uploads.js";export{BASE64_FROM,LARGE_FROM,canonical,genRecord,inputHash,isSecretName,namedFile,readGen,recordInput,recordOutput,toolWords,withoutSignature,writeGen,writeWords}from"./records.js";export{makeSay,sayInput}from"./voice.js";
2
+ export{cloudConfig,hostsText}from"./config.js";export{CloudError,notSignedIn,SIGN_IN}from"./errors.js";export{Cloud,scrub}from"./client.js";export{SignedOut,accessOf,accountOf,authServer,chooseOrganization,forgetCredentials,readCredentials,signInWithCode,signInWithDevice,signOut,writeCredentials}from"./credentials.js";export{SIGN_IN_WAIT_MS,openBrowser,signIn,signInByEmail,signInDevice,signInInBackground,signedInAs}from"./signin.js";export{LoopbackError,startLoopback}from"./loopback.js";export{pkcePair,randomState}from"./pkce.js";export{billingSummary,browserLink,organizations}from"./token.js";export{BlobStore}from"./blobs.js";export{Hashes,hashFolder,sha256Of}from"./hashes.js";export{addDeployment,changeSite,createSite,goLive,listSites,removeSite,siteDetail,unpublishSite}from"./sites.js";export{CATALOG_CACHE_SECONDS,findTool,loadCatalog}from"./catalog.js";export{POLL_SECONDS,READ_SECONDS,RETRY_SECONDS,WAIT_SECONDS,callTool,resumeJob}from"./call.js";export{REUSE_LEFT_MS,UPLOAD_CONCURRENCY,UPLOAD_TYPES,uploadFiles,urlExpiry,withKnownUploads}from"./uploads.js";export{BASE64_FROM,LARGE_FROM,canonical,genRecord,inputHash,isSecretName,namedFile,readGen,recordInput,recordOutput,toolWords,withoutSignature,writeGen,writeWords}from"./records.js";export{makeSay,sayInput}from"./voice.js";
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{DeploymentMadeSchema as S,SITES_PATH as n,SITE_PERSON_QUERY as p,SiteDetailSchema as m,SiteLiveAnswerSchema as h,SiteSchema as o,SitesResponseSchema as y,siteDeploymentsPath as d,siteLivePath as i,sitePath as r,siteSettingsPath as P}from"@allyhub-next/protocol";export const listSites=async e=>y.parse(await e.json(n)),createSite=async(e,t)=>o.parse(await e.json(n,{method:"POST",body:t})),addDeployment=async(e,t,s)=>S.parse(await e.json(d(t),{method:"POST",body:s,signal:AbortSignal.timeout(12e4)})),siteDetail=async(e,t)=>m.parse(await e.json(r(t)));const a=(e,t)=>t?`${e}?${p}`:e;export const goLive=async(e,t,s,c={})=>h.parse(await e.json(a(i(t),c.person===!0),{method:"PUT",body:{deployment:s}})),unpublishSite=async(e,t)=>o.parse(await e.json(a(i(t),!0),{method:"DELETE"})),removeSite=async(e,t)=>{await e.json(a(r(t),!0),{method:"DELETE"})},changeSite=async(e,t,s)=>o.parse(await e.json(a(P(t),!0),{method:"PUT",body:s}));
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{copyFile as c,mkdir as p,mkdtemp as s,rm as w}from"node:fs/promises";import{tmpdir as v}from"node:os";import{dirname as x,extname as g,join as i}from"node:path";import{genFileFor as k}from"@allyhub-next/formats";import{EXIT as F}from"@allyhub-next/protocol";import{callTool as I}from"./call.js";import{CloudError as b}from"./errors.js";import{toolWords as h,writeWords as $}from"./records.js";export function sayInput(t){return{...t.params??{},text:t.text,...t.voice===void 0?{}:{voiceId:t.voice}}}export async function makeSay(t,e,n,f){const d=await s(i(v(),"allyhub-voice-"));try{const o=await I(t,n.tool,sayInput(n),{...f,outDir:d,wait:!0});if("jobId"in o||o.file===void 0)throw new b("no-audio",`${n.tool} returned no audio file.`,{exit:F.platform});const a=h(o.output)??[],u=o.output.durationSeconds,m=typeof u=="number"?u:a.at(-1)?.end??0,r=`${n.stem}${g(o.file).toLowerCase()||".mp3"}`;await p(x(i(e,r)),{recursive:!0}),await c(o.file,i(e,r)),o.gen&&await c(o.gen,i(e,k(r)));const l=await $(i(e,r),a,m>=0?m:void 0);return{file:r,words:l.slice(e.length+1),seconds:m,credits:o.credits??0}}finally{await w(d,{recursive:!0,force:!0})}}
2
+ import{copyFile as c,mkdir as p,mkdtemp as s,rm as w}from"node:fs/promises";import{tmpdir as v}from"node:os";import{dirname as x,extname as I,join as r}from"node:path";import{WORK_DIR as g,genFileFor as k}from"@allyhub-next/formats";import{EXIT as F}from"@allyhub-next/protocol";import{callTool as b}from"./call.js";import{CloudError as h}from"./errors.js";import{toolWords as D,writeWords as W}from"./records.js";export function sayInput(o){return{...o.params??{},text:o.text,...o.voice===void 0?{}:{voiceId:o.voice}}}export async function makeSay(o,e,n,f){const u=await s(r(v(),"allyhub-voice-"));try{const t=await b(o,n.tool,sayInput(n),{...f,outDir:u,outputDir:r(e,g,"voice"),wait:!0});if("jobId"in t||t.file===void 0)throw new h("no-audio",`${n.tool} returned no audio file.`,{exit:F.platform});const d=D(t.output)??[],a=t.output.durationSeconds,m=typeof a=="number"?a:d.at(-1)?.end??0,i=`${n.stem}${I(t.file).toLowerCase()||".mp3"}`;await p(x(r(e,i)),{recursive:!0}),await c(t.file,r(e,i)),t.gen&&await c(t.gen,r(e,k(i)));const l=await W(r(e,i),d,m>=0?m:void 0);return{file:i,words:l.slice(e.length+1),seconds:m,credits:t.credits??0}}finally{await w(u,{recursive:!0,force:!0})}}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/cloud",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/components",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.ts",
@@ -14,7 +14,7 @@
14
14
  {
15
15
  "path": "src/caption-subtitle.ts",
16
16
  "target": "{dir}/caption-subtitle.ts",
17
- "sha256": "9bc0293f57c400eeae1659dd570bca6e10007cee35deb733ae74b6e2fcf87b1b"
17
+ "sha256": "307620d5b2fc6751dd109ef1c64d650981c7cfce9af7682d7cf2d8ce18a382a0"
18
18
  }
19
19
  ],
20
20
  "categories": []
@@ -8,14 +8,33 @@ export interface CaptionSubtitleProps {
8
8
  * freeAreas (@allyhub/sdk/dom) to keep it clear of a face or text.
9
9
  */
10
10
  y?: number;
11
+ /** Most characters in a cue; default 40 in portrait, 60 otherwise. */
12
+ maxChars?: number;
13
+ /** Most words in a cue; default no limit. */
14
+ maxWords?: number;
15
+ /** Phrases a cue never breaks inside (["work harder"]), as said. */
16
+ keep?: readonly string[];
17
+ /** Seconds: a gap between two cues under this closes; default 0.4. */
18
+ close?: number;
19
+ /** The font size at 1080p, px; default 50 in portrait, 46 square, 42 wide. */
20
+ size?: number;
21
+ /** The smallest font size fitting may reach at 1080p, px; default 28. */
22
+ minSize?: number;
23
+ /** The line's width at 1080p, px; default 860 in portrait, 1320 otherwise. */
24
+ width?: number;
25
+ /** Seconds a cue fades in after a pause; default 0.18. */
26
+ fadeIn?: number;
27
+ /** Seconds a cue fades out before a pause; default 0.12. */
28
+ fadeOut?: number;
11
29
  }
12
30
 
13
31
  /** Sentences cut into readable lines. */
14
- const optsFor = (portrait: boolean) => ({ maxChars: portrait ? 40 : 60 });
15
-
16
- /** Each line dissolves into the next. */
17
- const IN = 0.18;
18
- const OUT = 0.12;
32
+ const optsFor = (p: CaptionSubtitleProps, portrait: boolean) => ({
33
+ maxChars: p.maxChars ?? (portrait ? 40 : 60),
34
+ ...(p.maxWords === undefined ? {} : { maxWords: p.maxWords }),
35
+ ...(p.keep === undefined ? {} : { keep: p.keep }),
36
+ ...(p.close === undefined ? {} : { close: p.close }),
37
+ });
19
38
 
20
39
  export const captionSubtitle = defineComponent<CaptionSubtitleProps>({
21
40
  name: "captionSubtitle",
@@ -29,10 +48,14 @@ export const captionSubtitle = defineComponent<CaptionSubtitleProps>({
29
48
  const L = layout(ctx);
30
49
  const { light, dark } = lightDark(el);
31
50
  const portrait = L.orient === "portrait";
32
- const size = (portrait ? 50 : L.orient === "square" ? 46 : 42) * L.k;
51
+ const size =
52
+ (p.size ?? (portrait ? 50 : L.orient === "square" ? 46 : 42)) * L.k;
33
53
  // A comfortable measure, not the full width.
34
- const width = Math.min(L.right - L.left, (portrait ? 860 : 1320) * L.k);
35
- for (const cue of ctx.captions(optsFor(portrait))) {
54
+ const width = Math.min(
55
+ L.right - L.left,
56
+ (p.width ?? (portrait ? 860 : 1320)) * L.k,
57
+ );
58
+ for (const cue of ctx.captions(optsFor(p, portrait))) {
36
59
  const line = tag(
37
60
  h(
38
61
  "div",
@@ -54,7 +77,7 @@ export const captionSubtitle = defineComponent<CaptionSubtitleProps>({
54
77
  );
55
78
  el.append(line);
56
79
  const fs = fitTo(line, {
57
- min: 28 * L.k,
80
+ min: (p.minSize ?? 28) * L.k,
58
81
  max: size,
59
82
  maxHeight: size * 1.3 * 2 + 1,
60
83
  });
@@ -64,15 +87,30 @@ export const captionSubtitle = defineComponent<CaptionSubtitleProps>({
64
87
  line.style.display = "none";
65
88
  }
66
89
  },
67
- render(el, t, _p, ctx) {
68
- const cues = ctx.captions(optsFor(ctx.dims.orient === "portrait"));
90
+ render(el, t, p, ctx) {
91
+ const cues = ctx.captions(optsFor(p, ctx.dims.orient === "portrait"));
69
92
  all(el, "cue").forEach((line, i) => {
70
93
  const cue = cues[i];
71
- const fadeIn = cue ? ease.out(progress(t, cue.start - 0.05, IN)) : 0;
72
- const fadeOut = cue ? ease.inOut(progress(t, cue.end - 0.05, OUT)) : 1;
73
- const o = fadeIn * (1 - fadeOut);
74
- line.style.display = o > 0.001 ? "block" : "none";
75
- line.style.opacity = o.toFixed(4);
94
+ if (!cue || t < cue.start || t >= cue.end) {
95
+ line.style.display = "none";
96
+ return;
97
+ }
98
+ // One line replaces the next at once: two never show over each other.
99
+ // Only a pause has a fade.
100
+ const before = cues[i - 1];
101
+ const after = cues[i + 1];
102
+ const fadeIn =
103
+ before && before.end >= cue.start
104
+ ? 1
105
+ : ease.out(progress(t, cue.start, p.fadeIn ?? 0.18));
106
+ const fadeOut =
107
+ after && after.start <= cue.end
108
+ ? 0
109
+ : ease.inOut(
110
+ progress(t, cue.end - (p.fadeOut ?? 0.12), p.fadeOut ?? 0.12),
111
+ );
112
+ line.style.display = "block";
113
+ line.style.opacity = (fadeIn * (1 - fadeOut)).toFixed(4);
76
114
  });
77
115
  },
78
116
  });
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{runCheck as n}from"@allyhub-next/check";import{indexNeeds as h,makeIndex as o}from"@allyhub-next/project";import{loose as a}from"./paths.js";export const SETTLE_MS=1500;export class Checker{state;timer;active;again=!1;closed=!1;live;emit;needs;settle;constructor(s){this.live=s.live,this.emit=s.emit,this.needs=s.needs,this.settle=s.settle??SETTLE_MS,this.state={status:"waiting",revision:0,problems:[],facts:[]}}schedule(s=!1){this.closed||(clearTimeout(this.timer),this.state.status!=="running"&&this.publish({...this.state,status:"waiting"}),this.timer=setTimeout(()=>{if(!this.closed){if(this.active){this.again=!0;return}this.active=this.run().finally(()=>{this.active=void 0})}},s?0:this.settle))}async run(){const s=this.live.revision;this.publish({...this.state,status:"running",revision:s});let e;try{const t=await this.live.withSession(i=>n({dir:this.live.root,session:i}));e={status:"done",revision:s,problems:t.problems.map(a),facts:t.facts.map(a),versions:{total:t.targets.length,loaded:t.stats.loaded.length,reused:t.stats.reused}},this.needs?.(h(t.results))}catch(t){e={status:"failed",revision:s,problems:[],facts:[],error:t instanceof Error?t.message:String(t)}}this.closed||(s===this.live.revision&&!this.again?this.publish(e):(this.again=!1,this.schedule(!0)))}publish(s){this.state=s,this.emit(s)}async close(){this.closed=!0,clearTimeout(this.timer),await this.active}}export class Indexer{jobs=[];root;emit;made;wanted=[];tried=new Set;running;abort=new AbortController;constructor(s){this.root=s.root,this.emit=s.emit,this.made=s.made}want(s){const e=s.filter(t=>!this.tried.has(`${t.file}:${String(t.faces)}:${String(t.matte)}`));if(e.length!==0){for(const t of e)this.tried.add(`${t.file}:${String(t.faces)}:${String(t.matte)}`);this.wanted.push(...e),this.running??=this.loop().finally(()=>{this.running=void 0})}}async loop(){for(;this.wanted.length>0&&!this.abort.signal.aborted;){const s=this.wanted.splice(0),{done:e}=await o(this.root,s,t=>{this.jobs=[...this.jobs.filter(i=>i.file!==t.file),{file:t.file,status:t.status,message:t.message,...t.share===void 0?{}:{share:t.share}}],this.emit(this.jobs)},this.abort.signal);e.length>0&&this.made()}}async close(){this.abort.abort(),await this.running}}
2
+ import{runCheck as l}from"@allyhub-next/check";import{indexNeeds as d,makeIndex as c}from"@allyhub-next/project";import{loose as o}from"./paths.js";export const SETTLE_MS=1500;export class Checker{state;reads=new Map;timer;active;again=!1;closed=!1;live;emit;needs;settle;constructor(e){this.live=e.live,this.emit=e.emit,this.needs=e.needs,this.settle=e.settle??SETTLE_MS,this.state={status:"waiting",revision:0,problems:[],facts:[]}}schedule(e=!1){this.closed||(clearTimeout(this.timer),this.state.status!=="running"&&this.publish({...this.state,status:"waiting"}),this.timer=setTimeout(()=>{if(!this.closed){if(this.active){this.again=!0;return}this.active=this.run().finally(()=>{this.active=void 0})}},e?0:this.settle))}async run(){const e=this.live.revision;this.publish({...this.state,status:"running",revision:e});let s;try{const t=await this.live.withSession(i=>l({dir:this.live.root,session:i}));s={status:"done",revision:e,problems:t.problems.map(o),facts:t.facts.map(o),versions:{total:t.targets.length,loaded:t.stats.loaded.length,reused:t.stats.reused}},this.needs?.(d(t.results));const a=new Map;for(const i of t.results){const r=a.get(i.piece)??{media:new Set,data:new Set};a.set(i.piece,r);for(const n of i.reads?.media??[])r.media.add(n.path);for(const n of i.reads?.data??[])r.data.add(n.path)}this.reads=new Map([...a].map(([i,{media:r,data:n}])=>[i,{media:[...r],data:[...n]}]))}catch(t){s={status:"failed",revision:e,problems:[],facts:[],error:t instanceof Error?t.message:String(t)}}this.closed||(e===this.live.revision&&!this.again?this.publish(s):(this.again=!1,this.schedule(!0)))}publish(e){this.state=e,this.emit(e)}async close(){this.closed=!0,clearTimeout(this.timer),await this.active}}export class Indexer{jobs=[];root;emit;made;wanted=[];tried=new Set;running;abort=new AbortController;constructor(e){this.root=e.root,this.emit=e.emit,this.made=e.made}want(e){const s=e.filter(t=>!this.tried.has(`${t.file}:${String(t.faces)}:${String(t.matte)}`));if(s.length!==0){for(const t of s)this.tried.add(`${t.file}:${String(t.faces)}:${String(t.matte)}`);this.wanted.push(...s),this.running??=this.loop().finally(()=>{this.running=void 0})}}async loop(){for(;this.wanted.length>0&&!this.abort.signal.aborted;){const e=this.wanted.splice(0),{done:s}=await c(this.root,e,t=>{this.jobs=[...this.jobs.filter(a=>a.file!==t.file),{file:t.file,status:t.status,message:t.message,...t.share===void 0?{}:{share:t.share}}],this.emit(this.jobs)},this.abort.signal);s.length>0&&this.made()}}async close(){this.abort.abort(),await this.running}}
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{readFile as m}from"node:fs/promises";import w from"postcss";const p=t=>t.trim().replace(/^(['"])(.*)\1$/su,"$2");export async function fontFaces(t){const n=await m(t.file,"utf8").catch(()=>{});if(n===void 0)return[];let r;try{r=w.parse(n)}catch{return[]}const o=[];return r.walkAtRules(/^font-face$/iu,h=>{const e=new Map;h.walkDecls(g=>{e.set(g.prop.toLowerCase(),g.value)});const s=e.get("font-family"),c=e.get("src"),u=c===void 0?void 0:/url\(\s*([^)]*?)\s*\)/u.exec(c);if(s===void 0||u?.[1]===void 0)return;let f;try{f=new URL(p(u[1]),t.url).href}catch{return}const i=e.get("font-weight"),d=e.get("font-style"),a=e.get("font-stretch"),l=e.get("unicode-range");o.push({family:p(s),url:f,...i===void 0?{}:{weight:i},...d===void 0?{}:{style:d},...a===void 0?{}:{stretch:a},...l===void 0?{}:{unicodeRange:l}})}),o}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- export{RAW_PATH,RPC_PATH,forwardedHost,startDevServer}from"./server.js";export{ProjectServer,SERVER_METHODS}from"./project.js";export{Writer,LIST_LIMIT,UPLOAD_MAX_BYTES}from"./writer.js";export{Watcher}from"./watcher.js";export{writeProblems,dataFileOf}from"./validate.js";export{pathProblem,versionOf}from"./paths.js";export{SETTLE_MS}from"./background.js";export{stageCsp}from"./stage.js";export{CARD_DEFAULTS,itemPreview,projectName}from"./card.js";export{typeOf}from"./mime.js";
2
+ export{RAW_PATH,RPC_PATH,forwardedHost,startDevServer}from"./server.js";export{ProjectServer,SERVER_METHODS}from"./project.js";export{Writer,LIST_LIMIT,UPLOAD_MAX_BYTES}from"./writer.js";export{Watcher}from"./watcher.js";export{writeProblems,dataFileOf}from"./validate.js";export{pathProblem,versionOf}from"./paths.js";export{SETTLE_MS}from"./background.js";export{recordTree}from"./record.js";export{CARD_DEFAULTS,itemPreview,projectName}from"./card.js";
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{readFile as b,rm as m}from"node:fs/promises";import{join as c}from"node:path";import{fileLoudness as v}from"@allyhub-next/audio/node";import{startBrowser as g}from"@allyhub-next/browser";import{allyhubPlugin as y,hasSheetCode as S,listFiles as $,loadUserVite as D,prepare as C,readMedia as k,readSheetSource as j,sourceOf as B}from"@allyhub-next/build";import{CACHE_DIR as O,entryKind as R}from"@allyhub-next/formats";import{CheckSession as U,ProjectError as P,pickTarget as E,parseCombo as M}from"@allyhub-next/project";import{RPC_ERROR as p,RpcError as f}from"@allyhub-next/protocol";import{bundleScenery as F,writeModelStage as x}from"@allyhub-next/scenery-host/bundle";import{sceneryHost as w,serveDecoders as H}from"@allyhub-next/stage";export const stageMedia=(o,e)=>`${o}media/${e.split("/").map(encodeURIComponent).join("/")}`;export function rpcErrorOf(o){return o instanceof P?new f(o.kind==="not-found"?p.notFound:p.invalid,o.hint?`${o.message} ${o.hint}`:o.message):o}export class Live{root;stageBase;buildDir;revision=0;prep;last;lease;old=new Set;browserStarted;gpu;sceneries=new Map;building=Promise.resolve();closed=!1;sheetCodes=new Map;constructor(e,t,s={}){this.root=e,this.stageBase=t,this.buildDir=c(e,O,"build",`dev-${String(process.pid)}`),this.gpu=s.gpu}moved(e){this.revision=e,this.lease&&this.lease.revision!==e&&this.retire(this.lease)}prepared(){const e=this.revision;if(this.prep?.revision===e)return this.prep.promise;const t=this.building.then(()=>e===this.revision?this.build():void 0);this.building=t.catch(()=>{});const s=t.then(i=>i??this.prepared());return this.prep={revision:e,promise:s},s.catch(()=>{this.prep?.promise===s&&(this.prep=void 0)}),s}async build(){const e=await C(this.root,{buildDir:c(this.buildDir,"stage"),mediaUrl:t=>stageMedia(this.stageBase,t),host:w(this.root)});return e.bundle&&await H(e.bundle.dir),this.last=e,e}async sheetCode(e){if(!S(this.root,e))return{failed:!1};const t=this.sheetCodes.get(e),s=t?.revision===this.revision?t.promise:j(this.root,e).catch(()=>{});this.sheetCodes.set(e,{revision:this.revision,promise:s});const i=await s;return{failed:i?.failed??!0,...i?.generated?{generated:i.generated}:{}}}latest(){return this.last}async target(e,t){const s=await this.prepared();try{const{piece:i,target:r}=E(s,e,t===void 0?void 0:[M(t)]);return{prepared:s,piece:i,combo:r.combo}}catch(i){throw rpcErrorOf(i)}}async source(e,t){const s=await this.prepared(),i=s.pieces.find(n=>n.id===e);if(!i)throw new f(p.notFound,`No piece ${e}.`);const r=B(s,i,`${t}${this.stageBase}build/`,n=>`${t}${stageMedia(this.stageBase,n)}`),h={...r.media},u=(n,a)=>`${t}${this.stageBase}${n}/${a.split("/").map(encodeURIComponent).join("/")}`;return await Promise.all(Object.entries(h).map(async([n,a])=>{let d=a;if(a.kind==="video"&&a.matte===!0&&(d={...d,matteUrl:u("matte",n)}),a.kind==="audio"||a.kind==="video"&&a.audio===!0){d={...d,denoisedUrl:u("sound",n)};const l=await v(c(this.root,n)).catch(()=>{});l!==void 0&&(d={...d,loudness:l.lufs,...l.by==="level"?{loudnessBy:"level"}:{}})}h[n]=d})),{...r,media:h}}browser(){return this.browserStarted??=g(this.gpu===void 0?{}:{gpu:this.gpu}),this.browserStarted}async withSession(e){this.refuseStopped();let t=this.lease;if(t?.revision!==this.revision){t&&this.retire(t);const s=await this.browser();if(this.refuseStopped(),t=this.lease,t?.revision!==this.revision){t&&this.retire(t);const i=c(this.buildDir,`session-${String(this.revision)}`),r={revision:this.revision,session:U.open({root:this.root,browser:s,buildDir:i}),users:0,retired:!1,dir:i};t=r,this.lease=r,r.session.catch(()=>{this.lease===r&&(this.lease=void 0)})}}t.users++;try{return await e(await t.session)}finally{t.users--,t.retired&&t.users===0&&this.end(t)}}refuseStopped(){if(this.closed)throw new f(p.unavailable,"allyhub dev is stopping.")}retire(e){e.retired=!0,this.lease===e&&(this.lease=void 0),this.old.add(e),e.users===0&&this.end(e)}end(e){return e.ended??=(async()=>{this.old.delete(e),await e.session.then(t=>t.close()).catch(()=>{}),await m(e.dir,{recursive:!0,force:!0})})(),e.ended}scenery(e){const t=this.sceneries.get(e);if(t?.revision===this.revision)return t.promise;const s=this.bundleScenery(e);return this.sceneries.set(e,{revision:this.revision,promise:s}),s.catch(()=>{this.sceneries.get(e)?.promise===s&&this.sceneries.delete(e)}),s}async bundleScenery(e){const t=await $(this.root),s=await k(this.root,t),i=await I(this.root),r=w(this.root),h=await D(this.root),u=c(this.buildDir,"scenery"),n=R(e)==="model"?await x({root:this.root,model:e,outDir:u}):e;return{...await F({root:this.root,file:n,outDir:u,dependencies:i,plugins:[y({root:this.root,media:s,dependencies:i,lent:r.lent,mediaUrl:d=>stageMedia(this.stageBase,d)})],...h?{user:h}:{}}),media:Object.keys(s)}}async close(){this.closed=!0;const e=[...this.old,...this.lease?[this.lease]:[]];this.lease&&this.retire(this.lease),await Promise.all(e.map(t=>this.end(t))),await this.browserStarted?.then(t=>t.close()).catch(()=>{}),await m(this.buildDir,{recursive:!0,force:!0})}}async function I(o){try{const e=JSON.parse(await b(c(o,"package.json"),"utf8")),t=new Set;for(const s of["dependencies","devDependencies","peerDependencies","optionalDependencies"]){const i=e[s];if(i&&typeof i=="object")for(const r of Object.keys(i))t.add(r)}return t}catch{return new Set}}
2
+ import{readFile as v,rm as w}from"node:fs/promises";import{join as c}from"node:path";import{fileLoudness as y}from"@allyhub-next/audio/node";import{startBrowser as g}from"@allyhub-next/browser";import{allyhubPlugin as S,hasSheetCode as D,listFiles as k,loadUserVite as O,mediaHref as C,prepare as E,readMedia as R,readSheetSource as $,sourceOf as j}from"@allyhub-next/build";import{CACHE_DIR as P,entryKind as F}from"@allyhub-next/formats";import{CheckSession as H,ProjectError as N,pickTarget as _,parseCombo as M}from"@allyhub-next/project";import{RPC_ERROR as u,RpcError as f,SNAPSHOT_TREE as m,SOUND_FOLDER as T}from"@allyhub-next/protocol";import{SCENERY_STAGE as U,bundleScenery as W,sceneryHref as l,writeModelStage as A}from"@allyhub-next/scenery-host/bundle";import{bakesOnDisk as L,sceneryHost as b,serveDecoders as x}from"@allyhub-next/stage";export function rpcErrorOf(d){return d instanceof N?new f(d.kind==="not-found"?u.notFound:u.invalid,d.hint?`${d.message} ${d.hint}`:d.message):d}export class Live{root;buildDir;revision=0;prep;last;lease;old=new Set;browserStarted;gpu;sceneries=new Map;building=Promise.resolve();closed=!1;sheetCodes=new Map;constructor(e,i={}){this.root=e,this.buildDir=c(e,P,"build",`dev-${String(process.pid)}`),this.gpu=i.gpu}moved(e){this.revision=e,this.lease&&this.lease.revision!==e&&this.retire(this.lease)}prepared(){const e=this.revision;if(this.prep?.revision===e)return this.prep.promise;const i=this.building.then(()=>e===this.revision?this.build():void 0);this.building=i.catch(()=>{});const t=i.then(s=>s??this.prepared());return this.prep={revision:e,promise:t},t.catch(()=>{this.prep?.promise===t&&(this.prep=void 0)}),t}async build(){const e=await E(this.root,{buildDir:this.pieceDir,host:b(this.root)});return e.bundle&&await x(e.bundle.dir),this.last=e,e}async sheetCode(e){if(!D(this.root,e))return{failed:!1};const i=this.sheetCodes.get(e),t=i?.revision===this.revision?i.promise:$(this.root,e).catch(()=>{});this.sheetCodes.set(e,{revision:this.revision,promise:t});const s=await t;return{failed:s?.failed??!0,...s?.generated?{generated:s.generated}:{}}}get pieceDir(){return c(this.buildDir,"stage")}get sceneryDir(){return c(this.buildDir,"scenery",U)}latest(){return this.last}async target(e,i){const t=await this.prepared();try{const{piece:s,target:r}=_(t,e,i===void 0?void 0:[M(i)]);return{prepared:t,piece:s,combo:r.combo}}catch(s){throw rpcErrorOf(s)}}async source(e){const i=await this.prepared(),t=i.pieces.find(n=>n.id===e);if(!t)throw new f(u.notFound,`No piece ${e}.`);const s=j(i,t),r={...s.media},h=(n,a)=>`${n}${C(a).slice(m.media.length)}`;return await Promise.all(Object.entries(r).map(async([n,a])=>{let o=a;if(a.kind==="video"&&a.matte===!0&&(o={...o,matteUrl:h(m.matte,n)}),a.kind==="audio"||a.kind==="video"&&a.audio===!0){o={...o,denoisedUrl:h(T,n)};const p=await y(c(this.root,n)).catch(()=>{});p!==void 0&&(o={...o,loudness:p.lufs,...p.by==="level"?{loudnessBy:"level"}:{}})}r[n]=o})),{...s,media:r}}browser(){return this.browserStarted??=g(this.gpu===void 0?{}:{gpu:this.gpu}),this.browserStarted}async withSession(e){this.refuseStopped();let i=this.lease;if(i?.revision!==this.revision){i&&this.retire(i);const t=await this.browser();if(this.refuseStopped(),i=this.lease,i?.revision!==this.revision){i&&this.retire(i);const s=c(this.buildDir,`session-${String(this.revision)}`),r={revision:this.revision,session:H.open({root:this.root,browser:t,buildDir:s}),users:0,retired:!1,dir:s};i=r,this.lease=r,r.session.catch(()=>{this.lease===r&&(this.lease=void 0)})}}i.users++;try{return await e(await i.session)}finally{i.users--,i.retired&&i.users===0&&this.end(i)}}refuseStopped(){if(this.closed)throw new f(u.unavailable,"allyhub dev is stopping.")}retire(e){e.retired=!0,this.lease===e&&(this.lease=void 0),this.old.add(e),e.users===0&&this.end(e)}end(e){return e.ended??=(async()=>{this.old.delete(e),await e.session.then(i=>i.close()).catch(()=>{}),await w(e.dir,{recursive:!0,force:!0})})(),e.ended}scenery(e){const i=this.sceneries.get(e);if(i?.revision===this.revision)return i.promise;const t=this.bundleScenery(e);return this.sceneries.set(e,{revision:this.revision,promise:t}),t.catch(()=>{this.sceneries.get(e)?.promise===t&&this.sceneries.delete(e)}),t}async scenerySource(e){const i=await this.scenery(e),t=s=>`${m.scenery}${s}`;return{module:t(i.module),decoders:t(i.decoders),manifoldWasm:t(i.manifoldWasm),bakes:[...await L(this.root)]}}async bundleScenery(e){const i=await k(this.root),t=await R(this.root,i),s=await B(this.root),r=b(this.root),h=await O(this.root),n=c(this.buildDir,"scenery"),a=F(e)==="model"?await A({root:this.root,model:e,outDir:n}):e,o=await W({root:this.root,file:a,outDir:n,dependencies:s,plugins:[S({root:this.root,media:t,dependencies:s,lent:r.lent})],...h?{user:h}:{}});return{module:l(o.module),decoders:l(o.decoders),manifoldWasm:l(o.manifoldWasm),output:o.output.map(l),media:Object.keys(t)}}async close(){this.closed=!0;const e=[...this.old,...this.lease?[this.lease]:[]];this.lease&&this.retire(this.lease),await Promise.all(e.map(i=>this.end(i))),await this.browserStarted?.then(i=>i.close()).catch(()=>{}),await w(this.buildDir,{recursive:!0,force:!0})}}async function B(d){try{const e=JSON.parse(await v(c(d,"package.json"),"utf8")),i=new Set;for(const t of["dependencies","devDependencies","peerDependencies","optionalDependencies"]){const s=e[t];if(s&&typeof s=="object")for(const r of Object.keys(s))i.add(r)}return i}catch{return new Set}}