allyhub 0.19.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (717) hide show
  1. package/dist/commands/align.js +1 -1
  2. package/dist/commands/check.js +1 -1
  3. package/dist/commands/cloud-tools.js +5 -5
  4. package/dist/commands/cloud.js +1 -1
  5. package/dist/commands/dev.js +5 -5
  6. package/dist/commands/export.js +3 -0
  7. package/dist/commands/frames/doc.js +1 -1
  8. package/dist/commands/frames/piece.js +1 -1
  9. package/dist/commands/frames/sheet.js +1 -1
  10. package/dist/commands/frames.js +9 -9
  11. package/dist/commands/index.js +1 -1
  12. package/dist/commands/inspect/combos.js +1 -1
  13. package/dist/commands/inspect/common.js +2 -2
  14. package/dist/commands/inspect/facts.js +2 -2
  15. package/dist/commands/migrate.js +3 -0
  16. package/dist/commands/skills.js +3 -3
  17. package/dist/commands/upgrade.js +5 -0
  18. package/dist/commands.json +1 -1
  19. package/dist/help.js +3 -3
  20. package/dist/main.js +8 -7
  21. package/dist/node_modules/@allyhub/3d-extension/package.json +2 -2
  22. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  23. package/dist/node_modules/@allyhub/blocks/LICENSE +241 -0
  24. package/dist/node_modules/@allyhub/blocks/dist/alt.js +2 -0
  25. package/dist/node_modules/@allyhub/blocks/dist/elements.js +2 -0
  26. package/dist/node_modules/@allyhub/blocks/dist/flow-resolve.js +2 -0
  27. package/dist/node_modules/@allyhub/blocks/dist/flow-table.js +2 -0
  28. package/dist/node_modules/@allyhub/blocks/dist/format.js +2 -0
  29. package/dist/node_modules/@allyhub/blocks/dist/gantt.js +2 -0
  30. package/dist/node_modules/@allyhub/blocks/dist/grids.js +2 -0
  31. package/dist/node_modules/@allyhub/blocks/dist/html.js +75 -0
  32. package/dist/node_modules/@allyhub/blocks/dist/icons.generated.js +2 -0
  33. package/dist/node_modules/@allyhub/blocks/dist/icons.js +2 -0
  34. package/dist/node_modules/@allyhub/blocks/dist/index.js +2 -0
  35. package/dist/node_modules/@allyhub/blocks/dist/layout.js +2 -0
  36. package/dist/node_modules/@allyhub/blocks/dist/look.js +2 -0
  37. package/dist/node_modules/@allyhub/blocks/dist/measure.js +3 -0
  38. package/dist/node_modules/@allyhub/blocks/dist/model.js +2 -0
  39. package/dist/node_modules/@allyhub/blocks/dist/page.js +2 -0
  40. package/dist/node_modules/@allyhub/blocks/dist/palette.js +2 -0
  41. package/dist/node_modules/@allyhub/blocks/dist/path.js +2 -0
  42. package/dist/node_modules/@allyhub/blocks/dist/resolve.js +2 -0
  43. package/dist/node_modules/@allyhub/blocks/dist/samples.js +2 -0
  44. package/dist/node_modules/@allyhub/blocks/dist/sankey.js +2 -0
  45. package/dist/node_modules/@allyhub/blocks/dist/svg.js +2 -0
  46. package/dist/node_modules/@allyhub/blocks/dist/tidy.js +2 -0
  47. package/dist/node_modules/@allyhub/blocks/dist/trees.js +2 -0
  48. package/dist/node_modules/@allyhub/blocks/package.json +19 -0
  49. package/dist/node_modules/@allyhub/browser/dist/html.js +1 -1
  50. package/dist/node_modules/@allyhub/browser/package.json +1 -1
  51. package/dist/node_modules/@allyhub/build/dist/fonts.js +9 -3
  52. package/dist/node_modules/@allyhub/build/dist/index.js +1 -1
  53. package/dist/node_modules/@allyhub/build/dist/inspect-view.js +1 -1
  54. package/dist/node_modules/@allyhub/build/dist/migrate.js +2 -0
  55. package/dist/node_modules/@allyhub/build/dist/prepare.js +3 -3
  56. package/dist/node_modules/@allyhub/build/dist/work.js +3 -3
  57. package/dist/node_modules/@allyhub/build/package.json +5 -1
  58. package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
  59. package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
  60. package/dist/node_modules/@allyhub/chart/dist/chart-file.js +2 -1
  61. package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +4 -3
  62. package/dist/node_modules/@allyhub/chart/dist/chart.js +4 -2
  63. package/dist/node_modules/@allyhub/chart/dist/chartex-xml.js +4 -0
  64. package/dist/node_modules/@allyhub/chart/dist/classic.js +2 -0
  65. package/dist/node_modules/@allyhub/chart/dist/embedded.js +2 -2
  66. package/dist/node_modules/@allyhub/chart/dist/extended.js +2 -0
  67. package/dist/node_modules/@allyhub/chart/dist/index.js +1 -1
  68. package/dist/node_modules/@allyhub/chart/dist/svg.js +1 -1
  69. package/dist/node_modules/@allyhub/chart/dist/tree.js +2 -0
  70. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  71. package/dist/node_modules/@allyhub/check/dist/check.js +1 -1
  72. package/dist/node_modules/@allyhub/check/package.json +1 -1
  73. package/dist/node_modules/@allyhub/cloud/dist/blobs.js +1 -1
  74. package/dist/node_modules/@allyhub/cloud/dist/call.js +4 -4
  75. package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
  76. package/dist/node_modules/@allyhub/cloud/dist/storage.js +2 -0
  77. package/dist/node_modules/@allyhub/cloud/dist/uploads.js +2 -2
  78. package/dist/node_modules/@allyhub/cloud/package.json +1 -1
  79. package/dist/node_modules/@allyhub/components/package.json +1 -1
  80. package/dist/node_modules/@allyhub/dev-server/dist/background.js +1 -1
  81. package/dist/node_modules/@allyhub/dev-server/dist/item-process.js +2 -0
  82. package/dist/node_modules/@allyhub/dev-server/dist/item-worker.js +2 -0
  83. package/dist/node_modules/@allyhub/dev-server/dist/live.js +1 -1
  84. package/dist/node_modules/@allyhub/dev-server/dist/pages.js +20 -1
  85. package/dist/node_modules/@allyhub/dev-server/dist/project.js +1 -1
  86. package/dist/node_modules/@allyhub/dev-server/dist/record.js +1 -1
  87. package/dist/node_modules/@allyhub/dev-server/dist/server.js +2 -2
  88. package/dist/node_modules/@allyhub/dev-server/dist/tools.js +1 -1
  89. package/dist/node_modules/@allyhub/dev-server/dist/validate.js +2 -2
  90. package/dist/node_modules/@allyhub/dev-server/dist/writer.js +3 -3
  91. package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
  92. package/dist/node_modules/@allyhub/diagnostics/dist/rules.js +1 -1
  93. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  94. package/dist/node_modules/@allyhub/doc/dist/block-shapes.js +2 -0
  95. package/dist/node_modules/@allyhub/doc/dist/blocks.js +2 -0
  96. package/dist/node_modules/@allyhub/doc/dist/chart.js +1 -1
  97. package/dist/node_modules/@allyhub/doc/dist/color.js +1 -1
  98. package/dist/node_modules/@allyhub/doc/dist/docx-read.js +12 -0
  99. package/dist/node_modules/@allyhub/doc/dist/docx.js +5 -4
  100. package/dist/node_modules/@allyhub/doc/dist/html.js +83 -48
  101. package/dist/node_modules/@allyhub/doc/dist/index.js +1 -1
  102. package/dist/node_modules/@allyhub/doc/dist/markdown.js +1 -1
  103. package/dist/node_modules/@allyhub/doc/dist/merges.js +2 -0
  104. package/dist/node_modules/@allyhub/doc/dist/model.js +1 -1
  105. package/dist/node_modules/@allyhub/doc/dist/numbering.js +2 -0
  106. package/dist/node_modules/@allyhub/doc/dist/omml.js +3 -0
  107. package/dist/node_modules/@allyhub/doc/dist/page.js +2 -1
  108. package/dist/node_modules/@allyhub/doc/dist/paper.js +1 -1
  109. package/dist/node_modules/@allyhub/doc/dist/parse.js +5 -4
  110. package/dist/node_modules/@allyhub/doc/dist/redline.js +2 -0
  111. package/dist/node_modules/@allyhub/doc/dist/revisions.js +2 -0
  112. package/dist/node_modules/@allyhub/doc/dist/shapes.js +4 -0
  113. package/dist/node_modules/@allyhub/doc/dist/styles.js +2 -0
  114. package/dist/node_modules/@allyhub/doc/dist/table.js +1 -1
  115. package/dist/node_modules/@allyhub/doc/dist/write.js +65 -39
  116. package/dist/node_modules/@allyhub/doc/package.json +5 -1
  117. package/dist/node_modules/@allyhub/doc-extension/dist/build.js +2 -2
  118. package/dist/node_modules/@allyhub/doc-extension/dist/cli/find.js +1 -1
  119. package/dist/node_modules/@allyhub/doc-extension/dist/cli/import.js +3 -0
  120. package/dist/node_modules/@allyhub/doc-extension/dist/cli/index.js +1 -1
  121. package/dist/node_modules/@allyhub/doc-extension/dist/cli/styles.js +4 -0
  122. package/dist/node_modules/@allyhub/doc-extension/dist/export.js +1 -1
  123. package/dist/node_modules/@allyhub/doc-extension/dist/inspect.js +1 -1
  124. package/dist/node_modules/@allyhub/doc-extension/dist/project-tools.js +1 -1
  125. package/dist/node_modules/@allyhub/doc-extension/dist/tools.js +1 -1
  126. package/dist/node_modules/@allyhub/doc-extension/package.json +22 -2
  127. package/dist/node_modules/@allyhub/doc-print/dist/drawn.js +4 -4
  128. package/dist/node_modules/@allyhub/doc-print/dist/index.js +1 -1
  129. package/dist/node_modules/@allyhub/doc-print/dist/layout.js +8 -7
  130. package/dist/node_modules/@allyhub/doc-print/dist/print.js +22 -16
  131. package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
  132. package/dist/node_modules/@allyhub/export/dist/export.js +1 -1
  133. package/dist/node_modules/@allyhub/export/package.json +1 -1
  134. package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
  135. package/dist/node_modules/@allyhub/extension-host/dist/points.js +1 -1
  136. package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
  137. package/dist/node_modules/@allyhub/formats/dist/data/blocks-flow.js +2 -0
  138. package/dist/node_modules/@allyhub/formats/dist/data/blocks.d.ts +146 -0
  139. package/dist/node_modules/@allyhub/formats/dist/data/blocks.js +2 -0
  140. package/dist/node_modules/@allyhub/formats/dist/data/cell-styles.d.ts +9 -0
  141. package/dist/node_modules/@allyhub/formats/dist/data/cell-styles.js +2 -0
  142. package/dist/node_modules/@allyhub/formats/dist/data/deck-code.d.ts +47 -40
  143. package/dist/node_modules/@allyhub/formats/dist/data/deck-code.js +1 -1
  144. package/dist/node_modules/@allyhub/formats/dist/data/diagram-kinds.d.ts +6 -0
  145. package/dist/node_modules/@allyhub/formats/dist/data/diagram-kinds.js +2 -0
  146. package/dist/node_modules/@allyhub/formats/dist/data/diagrams.d.ts +29 -0
  147. package/dist/node_modules/@allyhub/formats/dist/data/diagrams.js +2 -0
  148. package/dist/node_modules/@allyhub/formats/dist/data/faces.d.ts +18 -0
  149. package/dist/node_modules/@allyhub/formats/dist/data/faces.js +1 -1
  150. package/dist/node_modules/@allyhub/formats/dist/data/page-data.d.ts +67 -0
  151. package/dist/node_modules/@allyhub/formats/dist/data/page-data.js +2 -0
  152. package/dist/node_modules/@allyhub/formats/dist/data/reference.d.ts +1 -1
  153. package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +698 -258
  154. package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
  155. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +14104 -2167
  156. package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
  157. package/dist/node_modules/@allyhub/formats/dist/data/themes.d.ts +82 -0
  158. package/dist/node_modules/@allyhub/formats/dist/data/themes.js +2 -0
  159. package/dist/node_modules/@allyhub/formats/dist/data/tokens.d.ts +67 -0
  160. package/dist/node_modules/@allyhub/formats/dist/data/tokens.js +2 -0
  161. package/dist/node_modules/@allyhub/formats/dist/data/work.d.ts +42 -0
  162. package/dist/node_modules/@allyhub/formats/dist/data/work.js +1 -1
  163. package/dist/node_modules/@allyhub/formats/dist/index.d.ts +7 -0
  164. package/dist/node_modules/@allyhub/formats/dist/index.js +1 -1
  165. package/dist/node_modules/@allyhub/formats/dist/items.d.ts +12 -3
  166. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +3260 -290
  167. package/dist/node_modules/@allyhub/formats/dist/schemas.js +1 -1
  168. package/dist/node_modules/@allyhub/formats/dist/tolerant.d.ts +45 -0
  169. package/dist/node_modules/@allyhub/formats/dist/tolerant.js +2 -0
  170. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  171. package/dist/node_modules/@allyhub/html-extension/dist/project-tools.js +21 -9
  172. package/dist/node_modules/@allyhub/html-extension/dist/tools.js +1 -1
  173. package/dist/node_modules/@allyhub/html-extension/markup/allyhub.yaml +2 -0
  174. package/dist/node_modules/@allyhub/html-extension/markup/markup.json +14 -4
  175. package/dist/node_modules/@allyhub/html-extension/markup/pages/budget.html +22 -1
  176. package/dist/node_modules/@allyhub/html-extension/package.json +9 -1
  177. package/dist/node_modules/@allyhub/i18n/package.json +1 -1
  178. package/dist/node_modules/@allyhub/image-draw/dist/fonts.js +1 -1
  179. package/dist/node_modules/@allyhub/image-draw/dist/inspect.js +2 -2
  180. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  181. package/dist/node_modules/@allyhub/image-extension/dist/build-plugins.js +1 -1
  182. package/dist/node_modules/@allyhub/image-extension/dist/cli.js +1 -1
  183. package/dist/node_modules/@allyhub/image-extension/package.json +2 -2
  184. package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +2 -2
  185. package/dist/node_modules/@allyhub/image-measure/dist/layout.js +2 -2
  186. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  187. package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
  188. package/dist/node_modules/@allyhub/image-render/package.json +1 -1
  189. package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
  190. package/dist/node_modules/@allyhub/image-sdk/dist/block.js +2 -0
  191. package/dist/node_modules/@allyhub/image-sdk/dist/blocks.js +2 -0
  192. package/dist/node_modules/@allyhub/image-sdk/dist/index.js +1 -1
  193. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  194. package/dist/node_modules/@allyhub/jobs/package.json +1 -1
  195. package/dist/node_modules/@allyhub/linkedin-extension/package.json +1 -3
  196. package/dist/node_modules/@allyhub/linkedin-extension/skills/allyhub/references/linkedin.md +3 -3
  197. package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
  198. package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
  199. package/dist/node_modules/@allyhub/linkedin-view/src/style.css +1 -1
  200. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  201. package/dist/node_modules/@allyhub/media/package.json +1 -1
  202. package/dist/node_modules/@allyhub/media-extension/dist/analyses/faces.js +1 -1
  203. package/dist/node_modules/@allyhub/media-extension/dist/asr/transcribe.js +1 -1
  204. package/dist/node_modules/@allyhub/media-extension/dist/ocr/text.js +1 -1
  205. package/dist/node_modules/@allyhub/media-extension/dist/vision/faces.js +1 -1
  206. package/dist/node_modules/@allyhub/media-extension/dist/vision/index-media.js +3 -2
  207. package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
  208. package/dist/node_modules/@allyhub/model/package.json +1 -1
  209. package/dist/node_modules/@allyhub/office-extension/markup/csv/allyhub.yaml +2 -0
  210. package/dist/node_modules/@allyhub/office-extension/markup/csv/markup.json +1 -1
  211. package/dist/node_modules/@allyhub/office-extension/markup/document/allyhub.yaml +2 -0
  212. package/dist/node_modules/@allyhub/office-extension/markup/presentation/allyhub.yaml +2 -0
  213. package/dist/node_modules/@allyhub/office-extension/markup/workbook/allyhub.yaml +2 -0
  214. package/dist/node_modules/@allyhub/office-extension/markup/workbook/markup.json +1 -1
  215. package/dist/node_modules/@allyhub/office-extension/package.json +1 -1
  216. package/dist/node_modules/@allyhub/ooxml/dist/ext.js +1 -1
  217. package/dist/node_modules/@allyhub/ooxml/dist/mce.js +1 -1
  218. package/dist/node_modules/@allyhub/ooxml/dist/node.js +1 -1
  219. package/dist/node_modules/@allyhub/ooxml/dist/ns.js +1 -1
  220. package/dist/node_modules/@allyhub/ooxml/dist/opc.js +1 -1
  221. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  222. package/dist/node_modules/@allyhub/piece/dist/export.d.ts +1 -1
  223. package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +2 -0
  224. package/dist/node_modules/@allyhub/piece/dist/look.d.ts +10 -2
  225. package/dist/node_modules/@allyhub/piece/dist/look.js +1 -1
  226. package/dist/node_modules/@allyhub/piece/dist/media.d.ts +8 -2
  227. package/dist/node_modules/@allyhub/piece/dist/script.js +1 -1
  228. package/dist/node_modules/@allyhub/piece/dist/source.d.ts +3 -0
  229. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  230. package/dist/node_modules/@allyhub/project/dist/media-index.js +1 -1
  231. package/dist/node_modules/@allyhub/project/package.json +1 -1
  232. package/dist/node_modules/@allyhub/protocol/dist/cli.js +1 -1
  233. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  234. package/dist/node_modules/@allyhub/protocol/dist/events.js +1 -1
  235. package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
  236. package/dist/node_modules/@allyhub/protocol/dist/kinds.js +1 -1
  237. package/dist/node_modules/@allyhub/protocol/dist/page-frame.js +2 -0
  238. package/dist/node_modules/@allyhub/protocol/package.json +1 -1
  239. package/dist/node_modules/@allyhub/registry/package.json +1 -1
  240. package/dist/node_modules/@allyhub/render/package.json +1 -1
  241. package/dist/node_modules/@allyhub/report-extension/LICENSE +241 -0
  242. package/dist/node_modules/@allyhub/report-extension/dist/build.js +3 -0
  243. package/dist/node_modules/@allyhub/report-extension/dist/check.js +37 -0
  244. package/dist/node_modules/@allyhub/report-extension/dist/cli/index.js +4 -0
  245. package/dist/node_modules/@allyhub/report-extension/dist/export.js +2 -0
  246. package/dist/node_modules/@allyhub/report-extension/dist/inline.js +58 -0
  247. package/dist/node_modules/@allyhub/report-extension/dist/page.js +23 -0
  248. package/dist/node_modules/@allyhub/report-extension/dist/project-tools.js +33 -0
  249. package/dist/node_modules/@allyhub/report-extension/dist/styles.js +2 -0
  250. package/dist/node_modules/@allyhub/report-extension/dist/theme.js +2 -0
  251. package/dist/node_modules/@allyhub/report-extension/dist/tools.js +2 -0
  252. package/dist/node_modules/@allyhub/report-extension/dist/workspace.js +2 -0
  253. package/dist/node_modules/@allyhub/report-extension/package.json +185 -0
  254. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/STYLE.md +180 -0
  255. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/style.json +15 -0
  256. package/dist/node_modules/@allyhub/runtime/dist/footage.js +1 -1
  257. package/dist/node_modules/@allyhub/runtime/package.json +1 -1
  258. package/dist/node_modules/@allyhub/runtimes/dist/packages.js +2 -2
  259. package/dist/node_modules/@allyhub/runtimes/dist/runtimes.js +3 -3
  260. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  261. package/dist/node_modules/@allyhub/scaffold/dist/index.js +12 -8
  262. package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
  263. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  264. package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
  265. package/dist/node_modules/@allyhub/sheet/dist/api/capabilities.js +1 -1
  266. package/dist/node_modules/@allyhub/sheet/dist/api/charts.js +1 -1
  267. package/dist/node_modules/@allyhub/sheet/dist/api/index.js +1 -1
  268. package/dist/node_modules/@allyhub/sheet/dist/api/styles.js +1 -1
  269. package/dist/node_modules/@allyhub/sheet/dist/api/workbook.js +1 -1
  270. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
  271. package/dist/node_modules/@allyhub/sheet/dist/calc/server.js +1 -1
  272. package/dist/node_modules/@allyhub/sheet/dist/cell-styles.js +2 -0
  273. package/dist/node_modules/@allyhub/sheet/dist/chart.js +1 -1
  274. package/dist/node_modules/@allyhub/sheet/dist/check.js +1 -1
  275. package/dist/node_modules/@allyhub/sheet/dist/file.js +2 -2
  276. package/dist/node_modules/@allyhub/sheet/dist/heatmap.js +2 -0
  277. package/dist/node_modules/@allyhub/sheet/dist/html.js +8 -8
  278. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  279. package/dist/node_modules/@allyhub/sheet/dist/inspect.js +1 -1
  280. package/dist/node_modules/@allyhub/sheet/dist/paginate.js +1 -1
  281. package/dist/node_modules/@allyhub/sheet/dist/printed.js +1 -1
  282. package/dist/node_modules/@allyhub/sheet/dist/sdk.js +1 -1
  283. package/dist/node_modules/@allyhub/sheet/dist/sparklines.js +2 -0
  284. package/dist/node_modules/@allyhub/sheet/dist/table-style.js +1 -1
  285. package/dist/node_modules/@allyhub/sheet/dist/table-styles.js +1 -1
  286. package/dist/node_modules/@allyhub/sheet/dist/theme.js +2 -0
  287. package/dist/node_modules/@allyhub/sheet/dist/tiles.js +2 -0
  288. package/dist/node_modules/@allyhub/sheet/dist/units.js +2 -0
  289. package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
  290. package/dist/node_modules/@allyhub/sheet/dist/write.js +14 -14
  291. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  292. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
  293. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
  294. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
  295. package/dist/node_modules/@allyhub/sheet/dist/xlsx/theme.js +1 -1
  296. package/dist/node_modules/@allyhub/sheet/dist/xlsx/tile-shapes.js +2 -0
  297. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  298. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  299. package/dist/node_modules/@allyhub/sheet-extension/dist/build.js +1 -1
  300. package/dist/node_modules/@allyhub/sheet-extension/dist/cli/sheet.js +7 -7
  301. package/dist/node_modules/@allyhub/sheet-extension/dist/code.js +1 -1
  302. package/dist/node_modules/@allyhub/sheet-extension/dist/evaluate.js +2 -2
  303. package/dist/node_modules/@allyhub/sheet-extension/dist/export.js +2 -2
  304. package/dist/node_modules/@allyhub/sheet-extension/dist/inspect.js +2 -2
  305. package/dist/node_modules/@allyhub/sheet-extension/dist/migrations.js +4 -0
  306. package/dist/node_modules/@allyhub/sheet-extension/dist/project-tools.js +1 -1
  307. package/dist/node_modules/@allyhub/sheet-extension/dist/tools.js +1 -1
  308. package/dist/node_modules/@allyhub/sheet-extension/package.json +7 -3
  309. package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
  310. package/dist/node_modules/@allyhub/slides-core/dist/blocks.js +2 -0
  311. package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
  312. package/dist/node_modules/@allyhub/slides-core/dist/chart-api.js +1 -1
  313. package/dist/node_modules/@allyhub/slides-core/dist/code.js +1 -1
  314. package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
  315. package/dist/node_modules/@allyhub/slides-core/dist/file.js +3 -3
  316. package/dist/node_modules/@allyhub/slides-core/dist/index.js +1 -1
  317. package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
  318. package/dist/node_modules/@allyhub/slides-core/dist/model.js +1 -1
  319. package/dist/node_modules/@allyhub/slides-core/dist/office-layouts.js +2 -0
  320. package/dist/node_modules/@allyhub/slides-core/dist/office.js +1 -1
  321. package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
  322. package/dist/node_modules/@allyhub/slides-core/dist/script.js +2 -2
  323. package/dist/node_modules/@allyhub/slides-core/dist/styles/brief.js +2 -0
  324. package/dist/node_modules/@allyhub/slides-core/dist/styles/editorial.js +2 -0
  325. package/dist/node_modules/@allyhub/slides-core/dist/styles/index.js +2 -0
  326. package/dist/node_modules/@allyhub/slides-core/dist/styles/kit.js +2 -0
  327. package/dist/node_modules/@allyhub/slides-core/dist/styles/layouts.js +2 -0
  328. package/dist/node_modules/@allyhub/slides-core/dist/styles/pitch.js +2 -0
  329. package/dist/node_modules/@allyhub/slides-core/dist/styles/stage.js +2 -0
  330. package/dist/node_modules/@allyhub/slides-core/dist/styles/tiles.js +2 -0
  331. package/dist/node_modules/@allyhub/slides-core/dist/theme.js +1 -1
  332. package/dist/node_modules/@allyhub/slides-core/dist/units.js +1 -1
  333. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  334. package/dist/node_modules/@allyhub/slides-extension/dist/check.js +1 -1
  335. package/dist/node_modules/@allyhub/slides-extension/dist/cli/slides.js +2 -2
  336. package/dist/node_modules/@allyhub/slides-extension/dist/deck-fonts.js +1 -1
  337. package/dist/node_modules/@allyhub/slides-extension/dist/project-tools.js +1 -1
  338. package/dist/node_modules/@allyhub/slides-extension/package.json +24 -1
  339. package/dist/node_modules/@allyhub/slides-pptx/dist/charts.js +1 -1
  340. package/dist/node_modules/@allyhub/slides-pptx/dist/fonts.js +1 -1
  341. package/dist/node_modules/@allyhub/slides-pptx/dist/image-size.js +2 -0
  342. package/dist/node_modules/@allyhub/slides-pptx/dist/import/code.js +3 -3
  343. package/dist/node_modules/@allyhub/slides-pptx/dist/import/index.js +7 -2
  344. package/dist/node_modules/@allyhub/slides-pptx/dist/import/names.js +1 -1
  345. package/dist/node_modules/@allyhub/slides-pptx/dist/import/script.js +1 -1
  346. package/dist/node_modules/@allyhub/slides-pptx/dist/index.js +1 -1
  347. package/dist/node_modules/@allyhub/slides-pptx/dist/mtx.js +2 -0
  348. package/dist/node_modules/@allyhub/slides-pptx/dist/read/chart.js +3 -2
  349. package/dist/node_modules/@allyhub/slides-pptx/dist/read/chartex.js +3 -0
  350. package/dist/node_modules/@allyhub/slides-pptx/dist/read/common.js +1 -1
  351. package/dist/node_modules/@allyhub/slides-pptx/dist/read/index.js +2 -2
  352. package/dist/node_modules/@allyhub/slides-pptx/dist/read/shapes.js +1 -1
  353. package/dist/node_modules/@allyhub/slides-pptx/dist/read/table.js +1 -1
  354. package/dist/node_modules/@allyhub/slides-pptx/dist/read/text.js +1 -1
  355. package/dist/node_modules/@allyhub/slides-pptx/dist/read/timing.js +1 -1
  356. package/dist/node_modules/@allyhub/slides-pptx/dist/shapes.js +1 -1
  357. package/dist/node_modules/@allyhub/slides-pptx/dist/text.js +1 -1
  358. package/dist/node_modules/@allyhub/slides-pptx/dist/write.js +2 -2
  359. package/dist/node_modules/@allyhub/slides-pptx/dist/xml.js +3 -2
  360. package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
  361. package/dist/node_modules/@allyhub/slides-runtime/dist/draw.js +2 -2
  362. package/dist/node_modules/@allyhub/slides-runtime/dist/load.js +1 -1
  363. package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
  364. package/dist/node_modules/@allyhub/stage/package.json +1 -1
  365. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/LICENSE +93 -0
  366. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-400-italic.woff2 +0 -0
  367. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-400-normal.woff2 +0 -0
  368. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-700-italic.woff2 +0 -0
  369. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-700-normal.woff2 +0 -0
  370. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-ext-400-italic.woff2 +0 -0
  371. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-ext-400-normal.woff2 +0 -0
  372. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-ext-700-italic.woff2 +0 -0
  373. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-ext-700-normal.woff2 +0 -0
  374. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-400-italic.css +1 -0
  375. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-400.css +1 -0
  376. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-700-italic.css +1 -0
  377. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-700.css +1 -0
  378. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-ext-400-italic.css +1 -0
  379. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-ext-400.css +1 -0
  380. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-ext-700-italic.css +1 -0
  381. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-ext-700.css +1 -0
  382. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/LICENSE +93 -0
  383. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/files/archivo-black-latin-400-normal.woff2 +0 -0
  384. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/files/archivo-black-latin-ext-400-normal.woff2 +0 -0
  385. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/latin-400.css +1 -0
  386. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/latin-ext-400.css +1 -0
  387. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/LICENSE +93 -0
  388. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-400-italic.woff2 +0 -0
  389. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-400-normal.woff2 +0 -0
  390. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-700-italic.woff2 +0 -0
  391. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-700-normal.woff2 +0 -0
  392. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-ext-400-italic.woff2 +0 -0
  393. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-ext-400-normal.woff2 +0 -0
  394. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-ext-700-italic.woff2 +0 -0
  395. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-ext-700-normal.woff2 +0 -0
  396. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-400-italic.css +1 -0
  397. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-400.css +1 -0
  398. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-700-italic.css +1 -0
  399. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-700.css +1 -0
  400. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-ext-400-italic.css +1 -0
  401. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-ext-400.css +1 -0
  402. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-ext-700-italic.css +1 -0
  403. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-ext-700.css +1 -0
  404. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/LICENSE +93 -0
  405. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-400-italic.woff2 +0 -0
  406. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-400-normal.woff2 +0 -0
  407. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-700-italic.woff2 +0 -0
  408. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-700-normal.woff2 +0 -0
  409. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-ext-400-italic.woff2 +0 -0
  410. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-ext-400-normal.woff2 +0 -0
  411. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-ext-700-italic.woff2 +0 -0
  412. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-ext-700-normal.woff2 +0 -0
  413. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-400-italic.css +1 -0
  414. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-400.css +1 -0
  415. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-700-italic.css +1 -0
  416. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-700.css +1 -0
  417. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-ext-400-italic.css +1 -0
  418. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-ext-400.css +1 -0
  419. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-ext-700-italic.css +1 -0
  420. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-ext-700.css +1 -0
  421. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/LICENSE +93 -0
  422. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-400-italic.woff2 +0 -0
  423. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-400-normal.woff2 +0 -0
  424. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-700-italic.woff2 +0 -0
  425. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-700-normal.woff2 +0 -0
  426. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-ext-400-italic.woff2 +0 -0
  427. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-ext-400-normal.woff2 +0 -0
  428. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-ext-700-italic.woff2 +0 -0
  429. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-ext-700-normal.woff2 +0 -0
  430. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-400-italic.css +1 -0
  431. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-400.css +1 -0
  432. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-700-italic.css +1 -0
  433. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-700.css +1 -0
  434. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-ext-400-italic.css +1 -0
  435. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-ext-400.css +1 -0
  436. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-ext-700-italic.css +1 -0
  437. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-ext-700.css +1 -0
  438. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/LICENSE +93 -0
  439. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-400-italic.woff2 +0 -0
  440. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-400-normal.woff2 +0 -0
  441. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-700-italic.woff2 +0 -0
  442. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-700-normal.woff2 +0 -0
  443. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-ext-400-italic.woff2 +0 -0
  444. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-ext-400-normal.woff2 +0 -0
  445. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-ext-700-italic.woff2 +0 -0
  446. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-ext-700-normal.woff2 +0 -0
  447. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-400-italic.css +1 -0
  448. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-400.css +1 -0
  449. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-700-italic.css +1 -0
  450. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-700.css +1 -0
  451. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-ext-400-italic.css +1 -0
  452. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-ext-400.css +1 -0
  453. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-ext-700-italic.css +1 -0
  454. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-ext-700.css +1 -0
  455. package/dist/node_modules/@allyhub/stage-page/dist/host.js +1 -1
  456. package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.html +42 -0
  457. package/dist/node_modules/@allyhub/stage-page/dist/style-faces.js +2 -0
  458. package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
  459. package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +96 -92
  460. package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
  461. package/dist/node_modules/@allyhub/telemetry/dist/limit.js +2 -0
  462. package/dist/node_modules/@allyhub/telemetry/package.json +5 -1
  463. package/dist/node_modules/@allyhub/text-extension/markup/allyhub.yaml +2 -0
  464. package/dist/node_modules/@allyhub/text-extension/markup-file/allyhub.yaml +2 -0
  465. package/dist/node_modules/@allyhub/text-extension/package.json +1 -1
  466. package/dist/node_modules/@allyhub/video-core/dist/footage-motion.js +1 -1
  467. package/dist/node_modules/@allyhub/video-core/dist/measure.js +1 -1
  468. package/dist/node_modules/@allyhub/video-core/dist/seams.js +1 -1
  469. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  470. package/dist/node_modules/@allyhub/video-extension/dist/cli/reference-text.js +1 -1
  471. package/dist/node_modules/@allyhub/video-extension/dist/inspect/index.js +1 -1
  472. package/dist/node_modules/@allyhub/video-extension/dist/inspect/joins.js +1 -1
  473. package/dist/node_modules/@allyhub/video-extension/dist/inspect/loop.js +3 -0
  474. package/dist/node_modules/@allyhub/video-extension/package.json +2 -25
  475. package/dist/node_modules/@allyhub/video-measure/dist/check.js +2 -2
  476. package/dist/node_modules/@allyhub/video-measure/dist/index.js +1 -1
  477. package/dist/node_modules/@allyhub/video-measure/dist/seams.js +1 -1
  478. package/dist/node_modules/@allyhub/video-measure/dist/version.js +1 -1
  479. package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
  480. package/dist/node_modules/@allyhub/video-sdk/dist/free.js +1 -1
  481. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  482. package/dist/node_modules/@allyhub/website/dist/index.js +1 -1
  483. package/dist/node_modules/@allyhub/website/dist/website.js +2 -2
  484. package/dist/node_modules/@allyhub/website/package.json +1 -1
  485. package/dist/node_modules/@allyhub/website-extension/package.json +3 -3
  486. package/dist/node_modules/@allyhub/x-extension/package.json +1 -3
  487. package/dist/node_modules/@allyhub/x-extension/skills/allyhub/references/x.md +3 -3
  488. package/dist/node_modules/@allyhub/x-model/package.json +1 -1
  489. package/dist/node_modules/@allyhub/x-view/package.json +1 -1
  490. package/dist/package.json +15 -14
  491. package/dist/self-upgrade.js +2 -0
  492. package/dist/text/batch-text.js +1 -1
  493. package/dist/text/facts-text.js +5 -5
  494. package/dist/text/format.js +2 -2
  495. package/dist/update-notice.js +3 -0
  496. package/dist/version.js +1 -1
  497. package/dist/works.js +1 -1
  498. package/editor-web/assets/{abnfDiagram-WEYOIA3C-DYaMS_BB.js → abnfDiagram-WEYOIA3C-B4tvwU6C.js} +1 -1
  499. package/editor-web/assets/{architecture-WOLXFQ4H-g_Tjfl_y.js → architecture-WOLXFQ4H-V2fA0vY2.js} +1 -1
  500. package/editor-web/assets/{architectureDiagram-ZHVYKT53-CqdhofOL.js → architectureDiagram-ZHVYKT53-B6B7XN0M.js} +1 -1
  501. package/editor-web/assets/arrow-down-D-QZrqcz.js +1 -0
  502. package/editor-web/assets/arrow-up-B1zjKUHX.js +1 -0
  503. package/editor-web/assets/article-DW4eD_8K.js +3 -0
  504. package/editor-web/assets/article-Dm2dIEwc.js +7 -0
  505. package/editor-web/assets/{audio-lines-PZj77e7t.js → audio-lines-BFoW_IeO.js} +1 -1
  506. package/editor-web/assets/{bar-button-J9vbfzTx.js → bar-button-CJmpgNg4.js} +1 -1
  507. package/editor-web/assets/{blockDiagram-RJAE7QA3-Bc-28Bci.js → blockDiagram-RJAE7QA3-BizcUGOM.js} +1 -1
  508. package/editor-web/assets/{browser-C9NP0ZYz.js → browser-DEGNhKTV.js} +1 -1
  509. package/editor-web/assets/{c4Diagram-XDPPPE54-CTGJb8FB.js → c4Diagram-XDPPPE54-CBHS0dQ0.js} +1 -1
  510. package/editor-web/assets/calc-worker-Cr4a0xmt.js +168 -0
  511. package/editor-web/assets/channel-dyUtlVPg.js +1 -0
  512. package/editor-web/assets/{chart-no-axes-column-Be0lFcGF.js → chart-no-axes-column-Dyy25XZ_.js} +1 -1
  513. package/editor-web/assets/chip-BdQRH3FL.js +1 -0
  514. package/editor-web/assets/{chunk-2E7WHVMD-B2MPOVTU.js → chunk-2E7WHVMD-CMPBck_Q.js} +1 -1
  515. package/editor-web/assets/{chunk-4EMNKR2T-BUV1ZHP0.js → chunk-4EMNKR2T-Df22Adpt.js} +1 -1
  516. package/editor-web/assets/{chunk-55XCU76K-BZlpspL5.js → chunk-55XCU76K-CYrZ6_Q7.js} +1 -1
  517. package/editor-web/assets/{chunk-7S6XSTFO-CpKeisWE.js → chunk-7S6XSTFO-BfdG9NNW.js} +1 -1
  518. package/editor-web/assets/{chunk-AQDTSKZB-BJqwAPyo.js → chunk-AQDTSKZB-BCzZMoTJ.js} +1 -1
  519. package/editor-web/assets/{chunk-DSNLSHJZ-D6oPWl_W.js → chunk-DSNLSHJZ-DT0xT8Wf.js} +1 -1
  520. package/editor-web/assets/{chunk-HAGFOTED-B5pk4MZF.js → chunk-HAGFOTED-Bg3-EotU.js} +1 -1
  521. package/editor-web/assets/{chunk-HNE4Q36P-DHbSPvxQ.js → chunk-HNE4Q36P-BrSym24V.js} +1 -1
  522. package/editor-web/assets/{chunk-NQOKRVIF-CcL_GcRA.js → chunk-NQOKRVIF-CMxgkJWF.js} +1 -1
  523. package/editor-web/assets/{chunk-UHW7PFBP-YgiOL6XE.js → chunk-UHW7PFBP-DWEwoyPy.js} +1 -1
  524. package/editor-web/assets/{chunk-VQ5W62QI-p14b4UYc.js → chunk-VQ5W62QI-eTFh5_T9.js} +1 -1
  525. package/editor-web/assets/{chunk-WQQL4CDK-BWW0x-XH.js → chunk-WQQL4CDK-4PTupr9T.js} +1 -1
  526. package/editor-web/assets/{chunk-YZO67HFG-oG3qd68C.js → chunk-YZO67HFG-D5XAAFWm.js} +1 -1
  527. package/editor-web/assets/{chunk-ZAUX2LTX-CpcheH0u.js → chunk-ZAUX2LTX-CPsdaisO.js} +1 -1
  528. package/editor-web/assets/{chunk-ZCHMQSOR-cWQvLl1w.js → chunk-ZCHMQSOR-ClnuUyfy.js} +1 -1
  529. package/editor-web/assets/{classDiagram-v2-4MYWR3UA-7PG7YcdU.js → classDiagram-v2-4MYWR3UA-CM21waNF.js} +1 -1
  530. package/editor-web/assets/code-Ch6AB5bZ.js +1 -0
  531. package/editor-web/assets/{collaborator-BU4qU7O3.js → collaborator-CbTacvkB.js} +1 -1
  532. package/editor-web/assets/color-picker-BmKFn2ww.js +1 -0
  533. package/editor-web/assets/{copy-CuJSs0nI.js → copy-SoaMYqsN.js} +1 -1
  534. package/editor-web/assets/{createLucideIcon-lm_6n8YT.js → createLucideIcon-euu7Wcd9.js} +1 -1
  535. package/editor-web/assets/{cynefin-EF2NZ3EQ-CtcknEQ_.js → cynefin-EF2NZ3EQ-CJUHTgee.js} +1 -1
  536. package/editor-web/assets/{cynefinDiagram-WF24UDRP-Ca7VIsjN.js → cynefinDiagram-WF24UDRP-C9RIfuIV.js} +1 -1
  537. package/editor-web/assets/{dagre-NK4GIZVX-BzcSLtsr.js → dagre-NK4GIZVX-g-01KdpO.js} +1 -1
  538. package/editor-web/assets/deck-C0VxrlzX.js +1 -0
  539. package/editor-web/assets/{diagram-CBK3MWTC-DpRmTGlG.js → diagram-CBK3MWTC-CbOjWUu-.js} +1 -1
  540. package/editor-web/assets/{diagram-I5XIIV2D-BTrs_AX8.js → diagram-I5XIIV2D-C6psNS8J.js} +1 -1
  541. package/editor-web/assets/{diagram-ODIL2UCW-CkIVjPqH.js → diagram-ODIL2UCW-C9PUE46P.js} +1 -1
  542. package/editor-web/assets/{diagram-PFBEJUXE-BlFMbAG1.js → diagram-PFBEJUXE-vJ_pnB33.js} +1 -1
  543. package/editor-web/assets/{diagram-RJA3I4VV-D3f8VJ-D.js → diagram-RJA3I4VV-FwYlEfJ-.js} +1 -1
  544. package/editor-web/assets/{diagram-TYUNFSNR-Bbpngj6F.js → diagram-TYUNFSNR-FKpIxeUc.js} +1 -1
  545. package/editor-web/assets/{dist-DruvDNQe.js → dist-B8_6sJ_V.js} +5 -5
  546. package/editor-web/assets/dist-BI_BaYhO.js +19 -0
  547. package/editor-web/assets/dist-BaWFMuvr.js +1 -0
  548. package/editor-web/assets/dist-BdmMT8fP.js +5 -0
  549. package/editor-web/assets/dist-BgKyM9U6.js +3 -0
  550. package/editor-web/assets/dist-BqijryYd.js +1 -0
  551. package/editor-web/assets/dist-ByguWp3a.js +16 -0
  552. package/editor-web/assets/dist-CB-_0-X4.js +41 -0
  553. package/editor-web/assets/dist-CCP24Lel.js +19 -0
  554. package/editor-web/assets/dist-Cg0Z26Kv.js +6 -0
  555. package/editor-web/assets/dist-CtYjYJdv.js +1 -0
  556. package/editor-web/assets/dist-D07Kj8GR.js +1 -0
  557. package/editor-web/assets/dist-D2rGVz9C.js +1 -0
  558. package/editor-web/assets/dist-D3DwRF1k.js +547 -0
  559. package/editor-web/assets/dist-DCI21ljp.js +6 -0
  560. package/editor-web/assets/dist-DH8oJJw9.js +35 -0
  561. package/editor-web/assets/dist-DIJnhQFK.js +9 -0
  562. package/editor-web/assets/dist-DJvfQvM7.js +24 -0
  563. package/editor-web/assets/{dist-Bd8IxQPP.js → dist-DQ6RpEJD.js} +2 -2
  564. package/editor-web/assets/dist-DmCDcb2_.js +4 -0
  565. package/editor-web/assets/dist-H0z_DXDz.js +19 -0
  566. package/editor-web/assets/dist-QLXI7XGS.js +82 -0
  567. package/editor-web/assets/{docx-draw-CoK1oqQD.js → docx-draw-Dxb67W2d.js} +1 -1
  568. package/editor-web/assets/{ebnfDiagram-V4P3TTPT-BaKj-yL6.js → ebnfDiagram-V4P3TTPT-DBymUM-F.js} +1 -1
  569. package/editor-web/assets/{elk-QONTBCTQ-Cn2qv1_U.js → elk-QONTBCTQ-BNYR3OlS.js} +1 -1
  570. package/editor-web/assets/{erDiagram-KYQIGQAA-Bd7AEIDo.js → erDiagram-KYQIGQAA-cTNyOqW6.js} +1 -1
  571. package/editor-web/assets/esm-Cl3GKSDd.js +21 -0
  572. package/editor-web/assets/{eventmodeling-K75KTNOO-Sfp7_461.js → eventmodeling-K75KTNOO-C6FUZeXP.js} +1 -1
  573. package/editor-web/assets/eye-DwfE1USj.js +1 -0
  574. package/editor-web/assets/{file-question-mark-DlIjUK37.js → file-question-mark-PeZgyqkK.js} +1 -1
  575. package/editor-web/assets/flowDiagram-IUGLLWBU-ukTovy07.js +1 -0
  576. package/editor-web/assets/{ganttDiagram-R7GPNTJY-CBqcGdHI.js → ganttDiagram-R7GPNTJY-LD9mqQ1x.js} +1 -1
  577. package/editor-web/assets/{gitGraph-VSP46ZUC-WTokXKTW.js → gitGraph-VSP46ZUC-CtCBcQFl.js} +1 -1
  578. package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-BIWZHD9q.js → gitGraphDiagram-PDYL7XHY-DYQpOozz.js} +1 -1
  579. package/editor-web/assets/{group-BdrTp7gi.js → group-DwM2yqU8.js} +1 -1
  580. package/editor-web/assets/{hint-rlht0uxG.js → hint-F4fIBnVU.js} +1 -1
  581. package/editor-web/assets/index-Cah2zchD.css +2 -0
  582. package/editor-web/assets/index-omhSywJb.js +28 -0
  583. package/editor-web/assets/{info-OHQRW6UA-COC6G-_J.js → info-OHQRW6UA-IXInKPRO.js} +1 -1
  584. package/editor-web/assets/{infoDiagram-MVDRKAX5-DpaqdKBD.js → infoDiagram-MVDRKAX5-Ds7Cei7T.js} +1 -1
  585. package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-Dyn2MAy1.js → ishikawaDiagram-HPEHV2GE-DWs3qtAX.js} +1 -1
  586. package/editor-web/assets/iso-UwGLGD3F.js +1 -0
  587. package/editor-web/assets/{italic-zw4_eUNF.js → italic-BV7iHxoP.js} +1 -1
  588. package/editor-web/assets/{journeyDiagram-BOSHW7O7-DeSVfmm7.js → journeyDiagram-BOSHW7O7-BkNKVYBA.js} +1 -1
  589. package/editor-web/assets/{kanban-definition-FNSA4HC5-Bfg0lj7B.js → kanban-definition-FNSA4HC5-D3dMswnI.js} +1 -1
  590. package/editor-web/assets/{link-DopSU3aa.js → link-CFOv3nz-.js} +1 -1
  591. package/editor-web/assets/{mermaid-parser.core-CyhovuYE.js → mermaid-parser.core-D_W_0X0N.js} +3 -3
  592. package/editor-web/assets/{mermaid.core-Dx1fBVUG.js → mermaid.core-Bkirj-s5.js} +4 -4
  593. package/editor-web/assets/{mindmap-definition-6OY57UG3-QEU2HF_m.js → mindmap-definition-6OY57UG3-CMKkAAvI.js} +1 -1
  594. package/editor-web/assets/minus-ngE8owxs.js +1 -0
  595. package/editor-web/assets/{packet-JDAUHWVQ-ReJTa_hw.js → packet-JDAUHWVQ-CzCkgCfg.js} +1 -1
  596. package/editor-web/assets/palette-DchDLJj6.js +1 -0
  597. package/editor-web/assets/panes-BexRuZd2.js +3 -0
  598. package/editor-web/assets/{pegDiagram-ECIUJNBX-Bo1jFrvb.js → pegDiagram-ECIUJNBX-C8qHkx7M.js} +1 -1
  599. package/editor-web/assets/{pie-XZMESJXO-BrtYafNA.js → pie-XZMESJXO-BJqgxMrD.js} +1 -1
  600. package/editor-web/assets/{pieDiagram-GNMPY74T-Cj0zQqs_.js → pieDiagram-GNMPY74T-DyNntV5y.js} +1 -1
  601. package/editor-web/assets/{progress-CwKcXARv.js → progress-D1Uv3d1b.js} +1 -1
  602. package/editor-web/assets/{quadrantDiagram-D57K4MC3-D5npDAVn.js → quadrantDiagram-D57K4MC3-BHa-69ir.js} +1 -1
  603. package/editor-web/assets/{radar-ABXABTNO-C8RDrRqi.js → radar-ABXABTNO-BeRPjBBR.js} +1 -1
  604. package/editor-web/assets/{railroad-I3PHUGI6-ebDrmYTK.js → railroad-I3PHUGI6-BaRQqRsK.js} +1 -1
  605. package/editor-web/assets/{railroad-abnf-LNEFI6M7-BxKuqg6V.js → railroad-abnf-LNEFI6M7-BZfwomxZ.js} +1 -1
  606. package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-DOclnfpr.js → railroad-ebnf-DWYD2UWJ-DbgqpEF5.js} +1 -1
  607. package/editor-web/assets/{railroad-peg-JR7BVNR7-DN0A1fpq.js → railroad-peg-JR7BVNR7-BYOf3PsQ.js} +1 -1
  608. package/editor-web/assets/{railroadDiagram-Y72NRBL7-B3PjoVWw.js → railroadDiagram-Y72NRBL7-B5OAzOsD.js} +1 -1
  609. package/editor-web/assets/react-Byupo4pA.js +1 -0
  610. package/editor-web/assets/replace-CLLMtF4e.js +1 -0
  611. package/editor-web/assets/{requirementDiagram-EQYSW5RA-DLdzkQk5.js → requirementDiagram-EQYSW5RA-wqYNoqO0.js} +1 -1
  612. package/editor-web/assets/ribbon-tabs-B3IC9WOt.js +1 -0
  613. package/editor-web/assets/row-DqS4-5b1.js +1 -0
  614. package/editor-web/assets/{sankeyDiagram-SY24JHO5-Dip4Piv_.js → sankeyDiagram-SY24JHO5-Crf6GRsa.js} +1 -1
  615. package/editor-web/assets/schemas-C21MyseF.js +1 -0
  616. package/editor-web/assets/{iso-DoC-ZoBr.js → schemas-DlRAoVtq.js} +1 -1
  617. package/editor-web/assets/{scissors-B_xOiUhd.js → scissors-m6QcoEf2.js} +1 -1
  618. package/editor-web/assets/search-D75Bi2GU.js +1 -0
  619. package/editor-web/assets/{sequenceDiagram-BLEHNHQU-QnPcoybL.js → sequenceDiagram-BLEHNHQU-DUcHz4_d.js} +1 -1
  620. package/editor-web/assets/{session-DMlLCFWg.js → session--OJYv_B7.js} +1 -1
  621. package/editor-web/assets/{sigma-DSUsJhMn.js → sigma-B4AWtnVA.js} +1 -1
  622. package/editor-web/assets/snapshots-DYooVfOx.js +1 -0
  623. package/editor-web/assets/sound-DkR3qxSt.js +1 -0
  624. package/editor-web/assets/{square-arrow-out-up-right-DF5dvsSp.js → square-arrow-out-up-right-1NqFsNDe.js} +1 -1
  625. package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-D103CiMX.js → stateDiagram-v2-A6IESKWZ-DbeLdnpS.js} +1 -1
  626. package/editor-web/assets/{sticky-note-BdkIu5_D.js → sticky-note-s4QfzaBB.js} +1 -1
  627. package/editor-web/assets/{surface-DtCjIlrq.js → surface-BUoi7cmR.js} +1 -1
  628. package/editor-web/assets/swatch-DCmD1gZl.js +1 -0
  629. package/editor-web/assets/{swimlanes-B3ENRKFQ-y4gCqEoa.js → swimlanes-B3ENRKFQ-BDi6AeJI.js} +1 -1
  630. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-2wwOmxbv.js +8 -0
  631. package/editor-web/assets/{switch-8MU4Nfxe.js → switch-b6GCy_ix.js} +1 -1
  632. package/editor-web/assets/syntax-Bqyhj0dw.js +1 -0
  633. package/editor-web/assets/table-BW43XXVd.js +1 -0
  634. package/editor-web/assets/tablet-C6oePHEW.js +1 -0
  635. package/editor-web/assets/text-wrap-Baus6l-V.js +1 -0
  636. package/editor-web/assets/{textarea-D7TnPwv1.js → textarea-Bu6uPEqT.js} +1 -1
  637. package/editor-web/assets/{timeline-definition-JXYKGLGB-BMp76v4V.js → timeline-definition-JXYKGLGB-B0awa2hh.js} +1 -1
  638. package/editor-web/assets/tolerant-DM9s0Mt1.js +1 -0
  639. package/editor-web/assets/trash-2-SFReAxVM.js +1 -0
  640. package/editor-web/assets/{treeView-D4JQ5SDB-Q_GYyk0b.js → treeView-D4JQ5SDB-C91G0IGm.js} +1 -1
  641. package/editor-web/assets/{treemap-SAJKECNS-B5lRWdQB.js → treemap-SAJKECNS-CiOWiwl2.js} +1 -1
  642. package/editor-web/assets/{undo-2-C47jrRp5.js → undo-2-DCbMWoug.js} +1 -1
  643. package/editor-web/assets/updating-D0GEtwnJ.js +1 -0
  644. package/editor-web/assets/{usecaseDiagram-WPOLBNNX--QRllA-U.js → usecaseDiagram-WPOLBNNX-DMYM1MRe.js} +1 -1
  645. package/editor-web/assets/{vennDiagram-Q3Y3IDCW-CzkATPA3.js → vennDiagram-Q3Y3IDCW-DQIJ5vvN.js} +1 -1
  646. package/editor-web/assets/video-mMOFXHYK.js +1 -0
  647. package/editor-web/assets/{wardley-7MLQ67FV-BXzwcdJa.js → wardley-7MLQ67FV-C3H9HG8r.js} +1 -1
  648. package/editor-web/assets/{wardleyDiagram-IVAIDKWA-BQvC8Agx.js → wardleyDiagram-IVAIDKWA-DgsjqY1Y.js} +1 -1
  649. package/editor-web/assets/{whole-word-D3ZAtnkw.js → whole-word-C9TkGBCY.js} +1 -1
  650. package/editor-web/assets/{words-CaUHhQHf.js → words-B2jQwWpp.js} +3 -3
  651. package/editor-web/assets/words-DgMuEmDO.js +3 -0
  652. package/editor-web/assets/workbook-NtMEyLgf.js +41 -0
  653. package/editor-web/assets/{x-DlhyIKuu.js → x-BAJilkKD.js} +1 -1
  654. package/editor-web/assets/{xychartDiagram-4URNHDU4-aY-lsD5o.js → xychartDiagram-4URNHDU4-DzsGI527.js} +1 -1
  655. package/editor-web/assets/{zoom-in-PgsC94hP.js → zoom-in-yAGKspfC.js} +1 -1
  656. package/editor-web/index.html +9 -9
  657. package/package.json +6 -3
  658. package/CHANGELOG.md +0 -251
  659. package/dist/commands/render.js +0 -3
  660. package/dist/node_modules/@allyhub/video-extension/dist/inspect/motion.js +0 -4
  661. package/dist/node_modules/@allyhub/video-measure/dist/still.js +0 -2
  662. package/editor-web/assets/arrow-down-B8VUPCGi.js +0 -1
  663. package/editor-web/assets/arrow-up-Ds4juY8X.js +0 -1
  664. package/editor-web/assets/article-8evPh712.js +0 -3
  665. package/editor-web/assets/article-BhRtWYMd.js +0 -7
  666. package/editor-web/assets/calc-worker-oEIqrrTM.js +0 -45
  667. package/editor-web/assets/channel-wIj_OqDm.js +0 -1
  668. package/editor-web/assets/chart-amT4lgX3.js +0 -2
  669. package/editor-web/assets/chart-file-dGiRgFcH.js +0 -1
  670. package/editor-web/assets/code-CD-CbJG9.js +0 -1
  671. package/editor-web/assets/deck-C7fN0Qtn.js +0 -1
  672. package/editor-web/assets/dist-3iovns9K.js +0 -16
  673. package/editor-web/assets/dist-BkHnbOEj.js +0 -4
  674. package/editor-web/assets/dist-BvOrNcK-.js +0 -19
  675. package/editor-web/assets/dist-CEIszq39.js +0 -1
  676. package/editor-web/assets/dist-CU5RbLNH.js +0 -1
  677. package/editor-web/assets/dist-CWZj8IAm.js +0 -1
  678. package/editor-web/assets/dist-C_Mtrnif.js +0 -17
  679. package/editor-web/assets/dist-CdqpwdCV.js +0 -24
  680. package/editor-web/assets/dist-CjT76RAw.js +0 -43
  681. package/editor-web/assets/dist-CpzEn9T8.js +0 -6
  682. package/editor-web/assets/dist-CrFYWl5-.js +0 -3
  683. package/editor-web/assets/dist-D3C6FyrO.js +0 -82
  684. package/editor-web/assets/dist-D4eBFGVL.js +0 -1
  685. package/editor-web/assets/dist-DTcjb3cP.js +0 -18
  686. package/editor-web/assets/dist-D_WSM29I.js +0 -17
  687. package/editor-web/assets/dist-Dp_9ISjP.js +0 -531
  688. package/editor-web/assets/dist-J-tPYKGS.js +0 -5
  689. package/editor-web/assets/dist-YW8hS4IM.js +0 -9
  690. package/editor-web/assets/esm-Cjv8ogpP.js +0 -21
  691. package/editor-web/assets/file-exclamation-point-_L3ElCJ5.js +0 -1
  692. package/editor-web/assets/flowDiagram-IUGLLWBU-BlVUglzw.js +0 -1
  693. package/editor-web/assets/index-BQWZnyAQ.js +0 -28
  694. package/editor-web/assets/index-Dvh1t1om.css +0 -2
  695. package/editor-web/assets/layout-SWqqA0yV.js +0 -1
  696. package/editor-web/assets/minus-CbPnUIOy.js +0 -1
  697. package/editor-web/assets/props-form-BpSXbrSF.js +0 -1
  698. package/editor-web/assets/react-Edyoga_4.js +0 -1
  699. package/editor-web/assets/row-C_svyL8o.js +0 -1
  700. package/editor-web/assets/schemas-CQ_UU8-Z.js +0 -1
  701. package/editor-web/assets/search-Ba2BbT6T.js +0 -1
  702. package/editor-web/assets/slides-7xWhREpt.js +0 -1
  703. package/editor-web/assets/snapshots-BLX4NTQC.js +0 -1
  704. package/editor-web/assets/sound-bTlco_K3.js +0 -1
  705. package/editor-web/assets/split-tFGKk-x8.js +0 -3
  706. package/editor-web/assets/strikethrough-BwXWi4zg.js +0 -1
  707. package/editor-web/assets/svg-CWIBMIQ9.js +0 -1
  708. package/editor-web/assets/swatch-DhztHwPU.js +0 -1
  709. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-DKzB_wSf.js +0 -8
  710. package/editor-web/assets/syntax-CU_WPKxt.js +0 -1
  711. package/editor-web/assets/table-DRbddzx0.js +0 -1
  712. package/editor-web/assets/tabs-CuEawka3.js +0 -1
  713. package/editor-web/assets/tag-CIfWT8B_.js +0 -1
  714. package/editor-web/assets/text-align-start-Cic2-TLh.js +0 -1
  715. package/editor-web/assets/video-D0uTbHWx.js +0 -1
  716. package/editor-web/assets/words-XlXG79Ur.js +0 -3
  717. package/editor-web/assets/workbook-CiCXkjmN.js +0 -45
@@ -1,6 +1,6 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{mkdir as Z,mkdtemp as tt,readFile as T,rm as et}from"node:fs/promises";import{tmpdir as nt}from"node:os";import{dirname as at,join as B}from"node:path";import{openPage as j,startBrowser as st}from"@allyhub/browser";import{PAPER as q,blockNumbers as L,docParts as ot,effectiveLook as it,everyBlock as O,headingAnchors as rt,pageFaces as _,parseDoc as lt,resolvePage as ct,shownBlocks as H,sizePt as dt,splitTitle as U,titleText as ft}from"@allyhub/doc";import{PdfJoiner as W,pdfLib as G}from"./pdf.js";import{docPage as pt,PICTURE_DPI as ht,printOne as J,setContent as K,shrinkPictures as gt}from"./print.js";const A=25.4/72,ut=96/25.4,I="https://allyhub.invalid/",mt=3,wt=t=>`(() => {
3
- const H = ${JSON.stringify(I)};
2
+ import{mkdir as lt,mkdtemp as dt,readFile as O,rm as ft}from"node:fs/promises";import{tmpdir as pt}from"node:os";import{dirname as ut,join as T}from"node:path";import{openPage as _,startBrowser as ht}from"@allyhub/browser";import{PAPER as H,blockNumbers as G,docParts as U,fieldCodes as gt,partLook as W,effectiveLook as J,everyBlock as K,headingAnchors as mt,pageFaces as V,parseDoc as wt,resolvePage as D,shownBlocks as X,sizePt as bt,splitTitle as Y,titleText as yt,withTheme as xt,RUNNING_PICTURE_HEIGHT as vt,runningGap as kt}from"@allyhub/doc";import{PdfJoiner as Q,pdfLib as Z}from"./pdf.js";import{dataUrl as Pt,docPage as St,docPictures as $t,PICTURE_DPI as Mt,printOne as tt,setContent as et,shrinkPictures as Rt}from"./print.js";const C=25.4/72,Et=96/25.4,q="https://allyhub.invalid/",Nt=3,At=t=>`(() => {
3
+ const H = ${JSON.stringify(q)};
4
4
  const style = document.createElement("style");
5
5
  style.textContent = "a.allyhub-m{position:absolute;width:1px;height:1lh;margin:0;padding:0;border:0}a.allyhub-box{left:0;top:0;width:100%;height:100%}";
6
6
  document.head.append(style);
@@ -15,7 +15,7 @@ import{mkdir as Z,mkdtemp as tt,readFile as T,rm as et}from"node:fs/promises";im
15
15
  const placed = (el) => {
16
16
  if (getComputedStyle(el).position === "static") el.style.position = "relative";
17
17
  };
18
- const px = ${String(ut)};
18
+ const px = ${String(Et)};
19
19
  const out = { lines: {}, over: {}, drawn: {} };
20
20
  const range = document.createRange();
21
21
  const els = [...document.querySelectorAll("[data-b]")];
@@ -106,11 +106,12 @@ import{mkdir as Z,mkdtemp as tt,readFile as T,rm as et}from"node:fs/promises";im
106
106
  }
107
107
  }
108
108
  return out;
109
- })()`;async function bt(t,n,s,i,d){const o=await j(t,{width:1200,height:1200,allow:()=>!1});try{await K(o,n),d!==!1&&await gt(o,d);const e=i?await o.evaluate(wt(s)):void 0;return{pdf:await J(o,!i),...e===void 0?{}:{marks:e}}}finally{await o.close()}}async function yt(t,n){const{PDFArray:s,PDFDict:i,PDFDocument:d,PDFName:o,PDFNumber:e,PDFString:a}=await G(),r=await d.load(t,{updateMetadata:!1}),h=[],w=[];return r.getPages().forEach((l,f)=>{const{width:g,height:p}=l.getSize();h.push({width:g*A,height:p*A});const m=l.node.lookupMaybe(o.of("Annots"),s);if(m)for(let y=0;y<m.size();y++){const x=m.lookupMaybe(y,i),k=x?.lookupMaybe(o.of("A"),i)?.lookupMaybe(o.of("URI"),a),v=x?.lookupMaybe(o.of("Rect"),s);if(!k||!v)continue;const P=k.decodeText();if(!P.startsWith(I))continue;const[S=0,c=0,b=0,$=0]=v.asArray().map(R=>R instanceof e?R.asNumber():0),[N="",...E]=P.slice(I.length).split("/");w.push({kind:N,parts:E,at:{page:n+f+1,top:(p-Math.max(c,$))*A,bottom:(p-Math.min(c,$))*A,left:Math.min(S,b)*A,right:Math.max(S,b)*A}})}}),{pages:h,marks:w}}async function xt(t,n,s,i){const d=[],o=new Map;for(const e of t){const a=e.marks??{lines:{},over:{},drawn:{}},{pages:r,marks:h}=await yt(e.pdf,d.length);for(const l of r){const f=d.length,{top:g,right:p,bottom:m,left:y}=n.margins;d.push({n:f+1,width:l.width,height:l.height,landscape:l.width>l.height,text:{top:f===0&&s.cover!==void 0?0:g,bottom:l.height-m,left:y,right:l.width-p}})}const w=l=>{let f=o.get(l);if(!f){const g=a.over[String(l)],p=a.drawn[String(l)];f={n:l,boxes:[],lines:[],rows:[],past:g?.past??0,pastPaper:g?.pastPaper??0,...p===void 0?{}:{drawn:p}},o.set(l,f)}return f};for(const{kind:l,parts:f,at:g}of h){const p=Number(f[0]);if(!Number.isInteger(p))continue;const m=w(p);if(l==="B")m.boxes.push(g);else if(l==="E")m.end=g;else if(l==="R")m.rows.push({...g,row:Number(f[1])});else if(l==="L"){const y=Number(f[1]),x=a.lines[String(p)]?.[y];m.lines[y]={...g,chars:x?.chars??0,letters:x?.letters??0,first:x?.first??"",last:x?.last??""}}}}for(const e of o.values())e.lines=Object.values(e.lines),e.boxes.sort((a,r)=>a.page-r.page||a.top-r.top),e.rows.sort((a,r)=>a.row-r.row);return{pages:d,blocks:o,numbered:i,page:n}}export function headingPages(t,n){const s=L(n),i=new Map;for(const[d,o]of rt(n)){const e=s.get(d),a=e===void 0?void 0:t.blocks.get(e),r=a?.lines[0]?.page??a?.boxes[0]?.page;r!==void 0&&i.set(o,r)}return i}const kt=(t,n)=>t.size===n.size&&[...t].every(([s,i])=>n.get(s)===i);export async function printDoc(t){const n=await T(B(t.root,t.doc.file),"utf8"),s=lt(n),i=ct(s.page),d=L(s.blocks),o=[...O(s.blocks)].some(a=>a.type==="toc"),e=await st({gpu:!1,htmlInCanvas:!1});try{let a=o?new Map:void 0;const r=u=>u===void 0?void 0:k=>u.get(k)??88;let h,w=0,l=!0;const f=ot(s.blocks),g=u=>f[u]?.landscape===!0?i.height:i.width,p=async u=>{const k=[];for(let v=0;v<f.length;v++){t.signal?.throwIfAborted();const P=await pt(t.root,t.doc,t.stills,{...u?{ids:!0}:{},headingPage:r(a),...f.length>1?{part:v}:{}});k.push(await bt(e,P,g(v),u,s.page.pictureDpi??ht))}return k};for(;w+=1,h=await xt(await p(!0),i,s.page,d),a!==void 0;){const u=headingPages(h,s.blocks);if(kt(u,a))break;if(a=u,w>=mt){l=!1;break}}const m=await vt((await p(!1)).map(u=>u.pdf)),y=await Mt(e,h,s.blocks,s.page,t.doc);return{pdf:await At(m,y),layout:h,passes:w,settled:l}}finally{await e.close()}}async function vt(t){if(t.length===1&&t[0]!==void 0)return t[0];const n=await tt(B(nt(),"allyhub-doc-parts-"));try{const s=B(n,"doc.pdf"),i=await W.create(s);try{for(const d of t)await i.add(d)}finally{await i.close({})}return await T(s)}finally{await et(n,{recursive:!0,force:!0})}}export async function writeDocPdf(t){const n=await printDoc(t);await Z(at(t.file),{recursive:!0});const s=await W.create(t.file);try{await s.add(n.pdf)}finally{await s.close(t.title===void 0?{}:{title:t.title})}return n}const Pt=(t,n)=>t.replaceAll("{title}",n.title).replaceAll("{section}",n.section).replaceAll("{page}",String(n.page)).replaceAll("{pages}",String(n.pages)),St=t=>t.replace(/&/gu,"&amp;").replace(/</gu,"&lt;").replace(/>/gu,"&gt;");function $t(t,n){const{title:s}=U(H(n)),i=[...O(n)].filter(e=>e.type==="heading"&&e!==s),d=Math.min(...i.map(e=>e.level)),o=i.filter(e=>e.level===d).map(e=>{const a=t.numbered.get(e),r=a===void 0?void 0:t.blocks.get(a);return{page:r?.lines[0]?.page??r?.boxes[0]?.page??0,words:e.content.map(h=>h.text).join("")}}).filter(e=>e.page>0);return t.pages.map(e=>{const a=o.find(r=>r.page===e.n);return a?a.words:o.filter(r=>r.page<e.n).at(-1)?.words??""})}async function Mt(t,n,s,i,d){const o=n.page,{header:e,footer:a}=o;if(e===void 0&&a===void 0)return null;const r=it(i),h=ft(U(H(s)).title).trim(),w=h!==""?h:d.title??d.path,l=$t(n,s),f=_(i),g=n.pages.length,p=(c,b,$,N)=>{const E={title:w,section:l[b.n-1]??"",page:b.n,pages:g},R=b.n%2===1,M={left:[],center:[],right:[]};c.left!==void 0&&M.left.push(c.left),c.center!==void 0&&M.center.push(c.center),c.right!==void 0&&M.right.push(c.right),c.outside!==void 0&&M[R?"right":"left"].push(c.outside),c.inside!==void 0&&M[R?"left":"right"].push(c.inside);const V=c.size===void 0?Math.max(7.5,o.size*.75):dt(c.size),X=(c.font===void 0?f.text:Rt(c.font)).replaceAll('"',"'"),z=D=>Math.min(7,D/2),Y=$==="head"?`top:${String(b.text.top-z(o.margins.top))}mm;transform:translateY(-100%)`:`top:${String(b.text.bottom+z(o.margins.bottom))}mm`,F=D=>St(M[D].map(Q=>Pt(Q,E)).join(" ")),C="white-space:nowrap;overflow:hidden;text-overflow:ellipsis";return`<div style="position:absolute;left:${String(b.text.left)}mm;width:${String(b.text.right-b.text.left)}mm;${Y};display:flex;justify-content:space-between;gap:6mm;font-family:${X};font-size:${String(V)}pt;line-height:1.2;color:${N?q.leadSoft:q.ink}"><span style="min-width:0;${C}">${F("left")}</span><span style="position:absolute;left:0;right:0;text-align:center;${C}">${F("center")}</span><span style="min-width:0;text-align:right;${C}">${F("right")}</span></div>`},m=r.footer===void 0,x=n.pages.map(c=>{const b=e!==void 0&&!(c.n===1&&r.cover!==void 0)?p(e,c,"head",r.header===void 0):"",$=a===void 0?"":p(a,c,"foot",m);return`<div class="sheet${c.landscape?" turned":""}" style="width:${String(c.width)}mm;height:${String(c.height)}mm">${b}${$}</div>`}).join(""),{docFaces:u,docFontsCss:k}=await import("./fonts.js"),P=`<!doctype html><html><head><meta charset="utf-8"><style>${await k(`${w}${l.join("")}${x}`,u(i))}</style><style>
110
- @page { size: ${String(o.width)}mm ${String(o.height)}mm; margin: 0; }
111
- @page turned { size: ${String(o.height)}mm ${String(o.width)}mm; margin: 0; }
109
+ })()`;async function Ft(t,s,r,e,f){const c=await _(t,{width:1200,height:1200,allow:()=>!1});try{await et(c,s),f!==!1&&await Rt(c,f);const n=e?await c.evaluate(At(r)):void 0;return{pdf:await tt(c,!e),...n===void 0?{}:{marks:n}}}finally{await c.close()}}async function Ct(t,s){const{PDFArray:r,PDFDict:e,PDFDocument:f,PDFName:c,PDFNumber:n,PDFString:i}=await Z(),o=await f.load(t,{updateMetadata:!1}),u=[],b=[];return o.getPages().forEach((y,M)=>{const{width:l,height:h}=y.getSize();u.push({width:l*C,height:h*C});const g=y.node.lookupMaybe(c.of("Annots"),r);if(g)for(let w=0;w<g.size();w++){const v=g.lookupMaybe(w,e),p=v?.lookupMaybe(c.of("A"),e)?.lookupMaybe(c.of("URI"),i),k=v?.lookupMaybe(c.of("Rect"),r);if(!p||!k)continue;const R=p.decodeText();if(!R.startsWith(q))continue;const[A=0,F=0,a=0,d=0]=k.asArray().map($=>$ instanceof n?$.asNumber():0),[x="",...m]=R.slice(q.length).split("/");b.push({kind:x,parts:m,at:{page:s+M+1,top:(h-Math.max(F,d))*C,bottom:(h-Math.min(F,d))*C,left:Math.min(A,a)*C,right:Math.max(A,a)*C}})}}),{pages:u,marks:b}}async function It(t,s,r,e,f=[]){const c=[],n=new Map;for(const[i,o]of t.entries()){const u=o.marks??{lines:{},over:{},drawn:{}},{pages:b,marks:y}=await Ct(o.pdf,c.length);for(const l of b){const h=c.length,{top:g,right:w,bottom:v,left:S}=f[i]??s.margins;c.push({n:h+1,part:i,width:l.width,height:l.height,landscape:l.width>l.height,text:{top:h===0&&r.cover!==void 0?0:g,bottom:l.height-v,left:S,right:l.width-w}})}const M=l=>{let h=n.get(l);if(!h){const g=u.over[String(l)],w=u.drawn[String(l)];h={n:l,boxes:[],lines:[],rows:[],past:g?.past??0,pastPaper:g?.pastPaper??0,...w===void 0?{}:{drawn:w}},n.set(l,h)}return h};for(const{kind:l,parts:h,at:g}of y){const w=Number(h[0]);if(!Number.isInteger(w))continue;const v=M(w);if(l==="B")v.boxes.push(g);else if(l==="E")v.end=g;else if(l==="R")v.rows.push({...g,row:Number(h[1])});else if(l==="L"){const S=Number(h[1]),p=u.lines[String(w)]?.[S];v.lines[S]={...g,chars:p?.chars??0,letters:p?.letters??0,first:p?.first??"",last:p?.last??""}}}}for(const i of n.values())i.lines=Object.values(i.lines),i.boxes.sort((o,u)=>o.page-u.page||o.top-u.top),i.rows.sort((o,u)=>o.row-u.row);return{pages:c,blocks:n,numbered:e,page:s}}export function headingPages(t,s){const r=G(s),e=new Map;for(const[f,c]of mt(s)){const n=r.get(f),i=n===void 0?void 0:t.blocks.get(n),o=i?.lines[0]?.page??i?.boxes[0]?.page;o!==void 0&&e.set(c,o)}return e}const zt=(t,s)=>t.size===s.size&&[...t].every(([r,e])=>s.get(r)===e);export async function printDoc(t){const s=await O(T(t.root,t.doc.file),"utf8"),r=wt(s),e={...r,page:xt(r.page,t.doc.theme)},f=D(e.page),c=G(e.blocks),n=[...K(e.blocks)].some(o=>o.type==="toc")||gt(e.blocks).some(o=>/^PAGEREF\b/iu.test(o)),i=await ht({gpu:!1,htmlInCanvas:!1});try{let o=n?new Map:void 0;const u=p=>p===void 0?void 0:k=>p.get(k)??88;let b,y=0,M=!0;const l=U(e.blocks),h=p=>l[p]?.landscape===!0?f.height:f.width,g=async p=>{const k=[];for(let R=0;R<l.length;R++){t.signal?.throwIfAborted();const A=await St(t.root,t.doc,t.stills,{...p?{ids:!0}:{},headingPage:u(o),...l.length>1?{part:R}:{}});k.push(await Ft(i,A,h(R),p,e.page.pictureDpi??Mt))}return k};for(;y+=1,b=await It(await g(!0),f,e.page,c,l.map(k=>D(W(e.page,k)).margins)),o!==void 0;){const p=headingPages(b,e.blocks);if(zt(p,o))break;if(o=p,y>=Nt){M=!1;break}}const w=await Tt((await g(!1)).map(p=>p.pdf)),v=await Lt(i,b,e.blocks,e.page,t.doc,t.root);return{pdf:await jt(w,v),layout:b,passes:y,settled:M}}finally{await i.close()}}async function Tt(t){if(t.length===1&&t[0]!==void 0)return t[0];const s=await dt(T(pt(),"allyhub-doc-parts-"));try{const r=T(s,"doc.pdf"),e=await Q.create(r);try{for(const f of t)await e.add(f)}finally{await e.close({})}return await O(r)}finally{await ft(s,{recursive:!0,force:!0})}}export async function writeDocPdf(t){const s=await printDoc(t);await lt(ut(t.file),{recursive:!0});const r=await Q.create(t.file);try{await r.add(s.pdf)}finally{await r.close(t.title===void 0?{}:{title:t.title})}return s}const Dt=(t,s)=>t.replaceAll("{title}",s.title).replaceAll("{section}",s.section).replaceAll("{page}",String(s.page)).replaceAll("{pages}",String(s.pages)),qt=t=>t.replace(/&/gu,"&amp;").replace(/</gu,"&lt;").replace(/>/gu,"&gt;");function Bt(t,s){const{title:r}=Y(X(s)),e=[...K(s)].filter(n=>n.type==="heading"&&n!==r),f=Math.min(...e.map(n=>n.level)),c=e.filter(n=>n.level===f).map(n=>{const i=t.numbered.get(n),o=i===void 0?void 0:t.blocks.get(i);return{page:o?.lines[0]?.page??o?.boxes[0]?.page??0,words:n.content.map(u=>u.text).join("")}}).filter(n=>n.page>0);return t.pages.map(n=>{const i=c.find(o=>o.page===n.n);return i?i.words:c.filter(o=>o.page<n.n).at(-1)?.words??""})}async function Lt(t,s,r,e,f,c){const n=s.page,i=U(r).map(a=>{const d=W(e,a),x=D(d),m=J(d);return{header:x.header,footer:x.footer,quietHead:m.header===void 0,quietFoot:m.footer===void 0,opens:a.opens??[]}});if(i.every(a=>a.header===void 0&&a.footer===void 0))return null;const o=J(e),u=yt(Y(X(r)).title).trim(),b=u!==""?u:f.title??f.path,y=Bt(s,r),M=V(e),l=await $t(c,f,r.filter(a=>a.type==="pagebreak"),{...e.header===void 0?{}:{header:e.header},...e.footer===void 0?{}:{footer:e.footer}}),h=s.pages.length,g=(a,d,x,m)=>{const $={title:b,section:y[d.n-1]??"",page:d.n,pages:h},E=d.n%2===1,P={left:[],center:[],right:[]};a.left!==void 0&&P.left.push(a.left),a.center!==void 0&&P.center.push(a.center),a.right!==void 0&&P.right.push(a.right),a.outside!==void 0&&P[E?"right":"left"].push(a.outside),a.inside!==void 0&&P[E?"left":"right"].push(a.inside);const nt=a.size===void 0?Math.max(7.5,n.size*.75):bt(a.size),at=(a.font===void 0?M.text:Ot(a.font)).replaceAll('"',"'"),B=kt,st=x==="head"?`top:${String(d.text.top-B(d.text.top>0?d.text.top:n.margins.top))}mm;transform:translateY(-100%)`:`top:${String(d.text.bottom+B(d.height-d.text.bottom))}mm`,ot="white-space:pre;overflow:hidden;text-overflow:ellipsis",z=I=>{const rt=P[I].flatMap(N=>{if(typeof N=="string")return[];const j=l.get(N.picture);return j===void 0?[]:[`<img src="${Pt(j)}" style="display:block;height:${String(N.height??vt)}mm;width:auto;max-width:100%;${I==="center"?"margin:0 auto":I==="right"?"margin-left:auto":""}">`]}),L=P[I].filter(N=>typeof N=="string"),ct=L.length===0?[]:Dt(L.join(" "),$).split(`
110
+ `).map(N=>`<div style="${ot}">${qt(N)}</div>`);return[...rt,...ct].join("")},it=P.center.length===0?"minmax(0,max-content) minmax(0,1fr) minmax(0,max-content)":"minmax(0,1fr) auto minmax(0,1fr)";return`<div style="position:absolute;left:${String(d.text.left)}mm;width:${String(d.text.right-d.text.left)}mm;${st};display:grid;grid-template-columns:${it};align-items:start;gap:6mm;font-family:${at};font-size:${String(nt)}pt;line-height:1.2;color:${m?H.leadSoft:H.ink}"><div style="min-width:0">${z("left")}</div><div style="min-width:0;text-align:center">${z("center")}</div><div style="min-width:0;text-align:right">${z("right")}</div></div>`},w=(a,d)=>{const x=i[d.part],m=x?.[a];if(x===void 0||m===void 0)return;const $=x.opens.includes(a)?s.pages.find(P=>P.part===d.part)?.n:1,E=d.n===$&&m.first!==void 0?m.first:d.n%2===0&&m.even!==void 0?m.even:void 0;if(E===void 0)return m;if(E!==!1)return{...m.font===void 0?{}:{font:m.font},...m.size===void 0?{}:{size:m.size},...E}},S=s.pages.map(a=>{const d=i[a.part],x=w("header",a),m=x!==void 0&&!(a.n===1&&o.cover!==void 0)?g(x,a,"head",d?.quietHead??!1):"",$=w("footer",a),E=$===void 0?"":g($,a,"foot",d?.quietFoot??!1);return`<div class="sheet${a.landscape?" turned":""}" style="width:${String(a.width)}mm;height:${String(a.height)}mm">${m}${E}</div>`}).join(""),{docFaces:p,docFontsCss:k}=await import("./fonts.js"),A=`<!doctype html><html><head><meta charset="utf-8"><style>${await k(`${b}${y.join("")}${S}`,p(e))}</style><style>
111
+ @page { size: ${String(n.width)}mm ${String(n.height)}mm; margin: 0; }
112
+ @page turned { size: ${String(n.height)}mm ${String(n.width)}mm; margin: 0; }
112
113
  html, body { margin: 0; padding: 0; background: transparent; }
113
114
  .sheet { position: relative; overflow: hidden; break-after: page; }
114
115
  .sheet:last-child { break-after: auto; }
115
116
  .sheet.turned { page: turned; }
116
- </style></head><body>${x}</body></html>`,S=await j(t,{width:1200,height:1200,allow:()=>!1});try{return await K(S,P),await J(S,!1)}finally{await S.close()}}async function At(t,n){if(n===null)return t;const{PDFDocument:s}=await G(),i=await s.load(t,{updateMetadata:!1}),d=await s.load(n,{updateMetadata:!1}),o=i.getPages(),e=await i.embedPdf(d,o.map((a,r)=>Math.min(r,d.getPageCount()-1)));return o.forEach((a,r)=>{const h=e[r];if(h===void 0)return;const{width:w,height:l}=a.getSize();a.drawPage(h,{x:0,y:0,width:w,height:l})}),Buffer.from(await i.save({useObjectStreams:!1}))}function Rt(t){return _({font:t}).text}
117
+ </style></head><body>${S}</body></html>`,F=await _(t,{width:1200,height:1200,allow:()=>!1});try{return await et(F,A),await tt(F,!1)}finally{await F.close()}}async function jt(t,s){if(s===null)return t;const{PDFDocument:r}=await Z(),e=await r.load(t,{updateMetadata:!1}),f=await r.load(s,{updateMetadata:!1}),c=e.getPages(),n=await e.embedPdf(f,c.map((i,o)=>Math.min(o,f.getPageCount()-1)));return c.forEach((i,o)=>{const u=n[o];if(u===void 0)return;const{width:b,height:y}=i.getSize();i.drawPage(u,{x:0,y:0,width:b,height:y})}),Buffer.from(await e.save({useObjectStreams:!1}))}function Ot(t){return V({font:t}).text}
@@ -1,18 +1,18 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{mkdir as C,readFile as S,writeFile as D}from"node:fs/promises";import{cpus as N}from"node:os";import{dirname as $,extname as z,join as u,posix as j}from"node:path";import{openPage as I,startBrowser as v}from"@allyhub/browser";import{pagePicture as J}from"@allyhub/browser/picture";import{DRAWN_CODE as w,componentDrawingKey as R,docHtml as H,everyBlock as E,COVER_ASPECT as k,mathHtml as T,pageAccent as B,pageFaces as A,parseDoc as F}from"@allyhub/doc";import{docxOf as V}from"@allyhub/doc/docx";import{drawDiagrams as L,katexCss as q,mathPictures as Q}from"./drawn.js";import{docFaces as Y,docFontsCss as G}from"./fonts.js";import{PdfJoiner as K}from"./pdf.js";const x=(t,e)=>[...new Set([...E(t)].flatMap(a=>a.type==="code"&&a.language===e?[a.code]:[]))];async function X(t,e){const a=x(t,w.mermaid);if(a.length===0)return new Map;const n=await v({gpu:!1,htmlInCanvas:!1});try{return await L(n,a,{font:A(e).text,accent:B(e)})}finally{await n.close()}}const Z={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml"},tt=/^([a-z][a-z0-9+.-]*:|\/\/)/i,et=(t,e)=>{const a=t?.get(R(e));return a?{type:"image/webp",bytes:Buffer.from(a)}:void 0};async function U(t,e,a,n={}){const s=new Map,i=[...n.cover===void 0?[]:[n.cover],...[...E(a)].flatMap(r=>r.type==="image"?[r.src]:[])];for(const r of i){if(tt.test(r)||s.has(r))continue;const g=j.normalize(j.join(e.dir,decodeURIComponent(r))),d=Z[z(g).toLowerCase()];if(d===void 0||g.startsWith(".."))continue;const o=await S(u(t,g)).catch(()=>{});o&&s.set(r,{type:d,bytes:o})}return s}const W=1600;async function at(t,e,a){const n=await t.evaluate(`(async () => {
2
+ import{mkdir as C,readFile as O,writeFile as R}from"node:fs/promises";import{cpus as z}from"node:os";import{dirname as k,extname as H,join as v,posix as j}from"node:path";import{openPage as I,startBrowser as P}from"@allyhub/browser";import{pagePicture as V}from"@allyhub/browser/picture";import{DRAWN_CODE as x,componentDrawingKey as B,docChartSvg as G,docHtml as q,isExtended as Q,withoutTitle as Y,everyBlock as b,libraryBlockSvg as K,COVER_ASPECT as T,mathHtml as N,pageAccent as J,pageFaces as A,parseDoc as W,redline as X,runningPictures as Z,withTheme as F}from"@allyhub/doc";import{docxOf as tt}from"@allyhub/doc/docx";import{drawDiagrams as L,katexCss as et,mathPictures as at}from"./drawn.js";import{docFaces as nt,docFontsCss as it}from"./fonts.js";import{PdfJoiner as st}from"./pdf.js";const $=(t,a)=>[...new Set([...b(t)].flatMap(e=>e.type==="code"&&e.language===a?[e.code]:[]))];async function rt(t,a){const e=$(t,x.mermaid);if(e.length===0)return new Map;const i=await P({gpu:!1,htmlInCanvas:!1});try{return await L(i,e,{font:A(a).text,accent:J(a)})}finally{await i.close()}}const ot={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml"},ct=/^([a-z][a-z0-9+.-]*:|\/\/)/i,dt=(t,a)=>{const e=t?.get(B(a));return e?{type:"image/webp",bytes:Buffer.from(e)}:void 0};export async function docPictures(t,a,e,i={}){const r=new Map,o=[...i.cover===void 0?[]:[i.cover],...Z(i,e),...[...b(e)].flatMap(n=>n.type==="image"?[n.src]:[])];for(const n of o){if(ct.test(n)||r.has(n))continue;const c=j.normalize(j.join(a.dir,decodeURIComponent(n))),d=ot[H(c).toLowerCase()];if(d===void 0||c.startsWith(".."))continue;const l=await O(v(t,c)).catch(()=>{});l&&r.set(n,{type:d,bytes:l})}return r}const U=1600;async function gt(t,a,e){const i=await t.evaluate(`(async () => {
3
3
  const image = new Image();
4
- image.src = ${JSON.stringify(P(e))};
4
+ image.src = ${JSON.stringify(dataUrl(a))};
5
5
  try { await image.decode(); } catch { return null; }
6
6
  const w = image.naturalWidth || 1600;
7
7
  const h = image.naturalHeight || 900;
8
- const width = Math.min(${String(W)}, w);
9
- const height = Math.round(width * ${String(k)});
8
+ const width = Math.min(${String(U)}, w);
9
+ const height = Math.round(width * ${String(T)});
10
10
  // As object-fit: cover, at object-position 50% y%.
11
11
  const scale = Math.max(width / w, height / h);
12
12
  const sw = width / scale;
13
13
  const sh = height / scale;
14
14
  const sx = (w - sw) / 2;
15
- const sy = (h - sh) * ${String(a/100)};
15
+ const sy = (h - sh) * ${String(e/100)};
16
16
  const canvas = document.createElement("canvas");
17
17
  canvas.width = width;
18
18
  canvas.height = height;
@@ -20,26 +20,32 @@ import{mkdir as C,readFile as S,writeFile as D}from"node:fs/promises";import{cpu
20
20
  context.fillStyle = "#fff";
21
21
  context.fillRect(0, 0, width, height);
22
22
  context.drawImage(image, sx, sy, sw, sh, 0, 0, width, height);
23
- return canvas.toDataURL("image/jpeg", ${String(M)});
24
- })()`);if(n===null)return;const s=W;return{data:Buffer.from(n.slice(n.indexOf(",")+1),"base64"),type:"jpg",width:s,height:Math.round(s*k)}}const P=({type:t,bytes:e})=>`data:${t};base64,${e.toString("base64")}`;export async function docPage(t,e,a,n={}){const s=await S(u(t,e.file),"utf8"),i=F(s),r=await U(t,e,i.blocks,i.page),g=await X(i.blocks,i.page),d=x(i.blocks,w.math).length>0;return H(i.blocks,{title:e.title??e.path,page:i.page,base:e.dir,data:o=>e.data?.[o],sources:e.sources,diagram:o=>g.get(o),image:o=>{const f=r.get(o);return f&&P(f)},component:o=>{const f=et(a,o);return f&&P(f)},fonts:[await G(s,Y(i.page)),...d?[await q()]:[]].join(`
25
- `),...n.ids===!0?{ids:!0}:{},...n.part===void 0?{}:{part:n.part},headingPage:n.headingPage})}const nt={"image/png":"png","image/jpeg":"jpg","image/gif":"gif"},it=2,M=.92;async function st(t,e){const a=nt[e.type],n=await t.evaluate(`(async () => {
23
+ return canvas.toDataURL("image/jpeg", ${String(E)});
24
+ })()`);if(i===null)return;const r=U;return{data:Buffer.from(i.slice(i.indexOf(",")+1),"base64"),type:"jpg",width:r,height:Math.round(r*T)}}export const dataUrl=({type:t,bytes:a})=>`data:${t};base64,${a.toString("base64")}`;export async function docPage(t,a,e,i={}){const r=await O(v(t,a.file),"utf8"),o=W(r),n={...o,page:F(o.page,a.theme)},c=await docPictures(t,a,n.blocks,n.page),d=await rt(n.blocks,n.page),l=$(n.blocks,x.math).length>0;return q(n.blocks,{title:a.title??a.path,page:n.page,base:a.dir,data:g=>a.data?.[g],sources:a.sources,diagram:g=>d.get(g),image:g=>{const m=c.get(g);return m&&dataUrl(m)},component:g=>{const m=dt(e,g);return m&&dataUrl(m)},fonts:[await it(r,nt(n.page)),...l?[await et()]:[]].join(`
25
+ `),...i.ids===!0?{ids:!0}:{},...i.part===void 0?{}:{part:i.part},headingPage:i.headingPage})}const ft={"image/png":"png","image/jpeg":"jpg","image/gif":"gif"},lt=2,E=.92;async function ht(t,a){const e=ft[a.type],i=await t.evaluate(`(async () => {
26
26
  const image = new Image();
27
- image.src = ${JSON.stringify(P(e))};
27
+ image.src = ${JSON.stringify(dataUrl(a))};
28
28
  try { await image.decode(); } catch { return null; }
29
29
  const width = image.naturalWidth || 1024;
30
30
  const height = image.naturalHeight || 768;
31
- if (${JSON.stringify(a!==void 0)}) return { width, height };
32
- const scale = ${JSON.stringify(e.type==="image/svg+xml"?it:1)};
31
+ if (${JSON.stringify(e!==void 0)}) return { width, height };
32
+ const scale = ${JSON.stringify(a.type==="image/svg+xml"?lt:1)};
33
33
  const canvas = document.createElement("canvas");
34
34
  canvas.width = width * scale;
35
35
  canvas.height = height * scale;
36
36
  const context = canvas.getContext("2d");
37
37
  context.fillStyle = "#fff";
38
38
  context.fillRect(0, 0, canvas.width, canvas.height);
39
+ if (${JSON.stringify(a.type==="image/svg+xml")}) {
40
+ // An SVG is Word's own; its PNG, on no white, stands in for a Word before 2016.
41
+ context.clearRect(0, 0, canvas.width, canvas.height);
42
+ context.drawImage(image, 0, 0, canvas.width, canvas.height);
43
+ return { width, height, png: canvas.toDataURL("image/png") };
44
+ }
39
45
  context.drawImage(image, 0, 0, canvas.width, canvas.height);
40
- return { width, height, jpeg: canvas.toDataURL("image/jpeg", ${String(M)}) };
41
- })()`);if(!n)return;const{width:s,height:i,jpeg:r}=n;if(a!==void 0)return{data:e.bytes,type:a,width:s,height:i};if(r!==void 0)return{data:Buffer.from(r.slice(r.indexOf(",")+1),"base64"),type:"jpg",width:s,height:i}}export async function renderWord(t){const{root:e,doc:a}=t,{blocks:n,page:s}=F(await S(u(e,a.file),"utf8")),i=await U(e,a,n,s);let r;if([...E(n)].some(c=>c.type==="toc")){const{printDoc:c,headingPages:m}=await import("./layout.js"),b=await c({root:e,doc:a,stills:t.stills}),p=m(b.layout,n);r=y=>p.get(y)}for(const[c,m]of t.stills??[])i.set(`component:${c}`,{type:"image/webp",bytes:Buffer.from(m)});const g=x(n,w.math),d=x(n,w.mermaid),o=new Map;let f;if(i.size>0||g.length>0||d.length>0){const c=await v({gpu:!1,htmlInCanvas:!1});try{const m=await L(c,d,{font:A(s).text,accent:B(s)});for(const[h,l]of m)l.svg!==void 0&&i.set(`diagram:${h}`,{type:"image/svg+xml",bytes:Buffer.from(l.svg)});const b=await Q(c,g.map(h=>T(h).html));g.forEach(h=>{const l=b.get(T(h).html);l&&o.set(`math:${h}`,{data:l.data,type:"png",width:l.width,height:l.height})});const p=await I(c,{width:900,height:1200,allow:()=>!1});for(const[h,l]of i){const O=await st(p,l);O&&o.set(h,O)}const y=s.cover===void 0?void 0:i.get(s.cover);y&&(f=await at(p,y,s.coverY??50))}finally{await c.close()}}const _=await V(t.docx,t.zip,n,{title:a.title??a.path,page:s,headingPage:r,sources:a.sources,cover:f,base:a.dir,data:c=>a.data?.[c],picture:c=>o.get(c),component:c=>o.get(`component:${R(c)}`),drawn:c=>o.get(c.language===w.math?`math:${c.code}`:`diagram:${c.code}`)});await C($(t.out),{recursive:!0}),await D(t.out,_)}export async function setContent(t,e){const{frameTree:a}=await t.session.send("Page.getFrameTree");await t.session.send("Page.setDocumentContent",{frameId:a.frame.id,html:e}),await t.evaluate("new Promise((r) => (document.readyState === 'complete' ? r() : addEventListener('load', () => r(), { once: true }))).then(() => document.fonts.ready).then(() => window.allyhubReady).then(() => true)")}export const PICTURE_DPI=220;export async function shrinkPictures(t,e){await t.evaluate(`(async () => {
42
- const k = ${String(e)} / 96;
46
+ return { width, height, jpeg: canvas.toDataURL("image/jpeg", ${String(E)}) };
47
+ })()`);if(!i)return;const{width:r,height:o,jpeg:n,png:c}=i;if(e!==void 0)return{data:a.bytes,type:e,width:r,height:o};if(c!==void 0)return{data:a.bytes,type:"svg",fallback:Buffer.from(c.slice(c.indexOf(",")+1),"base64"),width:r,height:o};if(n!==void 0)return{data:Buffer.from(n.slice(n.indexOf(",")+1),"base64"),type:"jpg",width:r,height:o}}export async function renderWord(t){const{root:a,doc:e,changes:i}=t,r=W(await O(v(a,e.file),"utf8")),o=r.page,n=i===void 0?r.blocks:X(i.since,r.blocks,i),c=F(o,e.theme),d=await docPictures(a,e,n,c);let l;if([...b(n)].some(s=>s.type==="toc")){const{printDoc:s,headingPages:f}=await import("./layout.js"),u=await s({root:a,doc:e,stills:t.stills}),y=f(u.layout,n);l=S=>y.get(S)}for(const[s,f]of t.stills??[])d.set(`component:${s}`,{type:"image/webp",bytes:Buffer.from(f)});for(const s of b(n))if(s.type==="chart"&&Q(s.kind))for(const f of[s,Y(s)]){const{svg:u}=G(f,{page:c,base:e.dir,data:y=>e.data?.[y]});u!==void 0&&d.set(`chart:${JSON.stringify(f)}`,{type:"image/svg+xml",bytes:Buffer.from(u)})}for(const s of b(n))if(s.type==="block"){const{svg:f}=K(s,650,{page:c,base:e.dir,data:u=>e.data?.[u]});f!==void 0&&d.set(`block:${JSON.stringify(s)}`,{type:"image/svg+xml",bytes:Buffer.from(f)})}const g=$(n,x.math),m=$(n,x.mermaid),p=new Map;let D;if(d.size>0||g.length>0||m.length>0){const s=await P({gpu:!1,htmlInCanvas:!1});try{const f=await L(s,m,{font:A(c).text,accent:J(c)});for(const[w,h]of f)h.svg!==void 0&&d.set(`diagram:${w}`,{type:"image/svg+xml",bytes:Buffer.from(h.svg)});const u=await at(s,g.map(w=>N(w).html));g.forEach(w=>{const h=u.get(N(w).html);h&&p.set(`math:${w}`,{data:h.data,type:"png",width:h.width,height:h.height})});const y=await I(s,{width:900,height:1200,allow:()=>!1});for(const[w,h]of d){const M=await ht(y,h);M&&p.set(w,M)}const S=c.cover===void 0?void 0:d.get(c.cover);S&&(D=await gt(y,S,c.coverY??50))}finally{await s.close()}}const _=await tt(t.docx,t.zip,n,{title:e.title??e.path,page:c,shapes:t.shapes,math:t.math,headingPage:l,sources:e.sources,cover:D,base:e.dir,data:s=>e.data?.[s],picture:s=>p.get(s),component:s=>p.get(`component:${B(s)}`),block:s=>p.get(`block:${JSON.stringify(s)}`),chart:s=>p.get(`chart:${JSON.stringify(s)}`),drawn:s=>p.get(s.language===x.math?`math:${s.code}`:`diagram:${s.code}`)});await C(k(t.out),{recursive:!0}),await R(t.out,_)}export async function setContent(t,a){const{frameTree:e}=await t.session.send("Page.getFrameTree");await t.session.send("Page.setDocumentContent",{frameId:e.frame.id,html:a}),await t.evaluate("new Promise((r) => (document.readyState === 'complete' ? r() : addEventListener('load', () => r(), { once: true }))).then(() => document.fonts.ready).then(() => window.allyhubReady).then(() => true)")}export const PICTURE_DPI=220;export async function shrinkPictures(t,a){await t.evaluate(`(async () => {
48
+ const k = ${String(a)} / 96;
43
49
  for (const img of document.querySelectorAll("img")) {
44
50
  if (!img.src.startsWith("data:image/") || img.src.startsWith("data:image/svg")) continue;
45
51
  try { await img.decode(); } catch { continue; }
@@ -59,10 +65,10 @@ import{mkdir as C,readFile as S,writeFile as D}from"node:fs/promises";import{cpu
59
65
  const px = c.getImageData(0, 0, w, h).data;
60
66
  let clear = false;
61
67
  for (let i = 3; i < px.length; i += 4) if (px[i] < 255) { clear = true; break; }
62
- const src = clear ? canvas.toDataURL("image/png") : canvas.toDataURL("image/jpeg", ${String(M)});
68
+ const src = clear ? canvas.toDataURL("image/png") : canvas.toDataURL("image/jpeg", ${String(E)});
63
69
  if (src.length >= img.src.length) continue;
64
70
  img.src = src;
65
71
  try { await img.decode(); } catch {}
66
72
  }
67
73
  return true;
68
- })()`)}const rt=Math.max(1,Math.min(4,Math.floor(N().length/2)));export async function printOne(t,e,a){const{stream:n}=await t.session.send("Page.printToPDF",{...a===void 0?{}:{displayHeaderFooter:!0,headerTemplate:"<span></span>",footerTemplate:a},preferCSSPageSize:!0,printBackground:!0,generateTaggedPDF:e,generateDocumentOutline:!1,transferMode:"ReturnAsStream"});if(n===void 0)throw new Error("Chrome gave no PDF.");const s=[];for(;;){const i=await t.session.send("IO.read",{handle:n,size:1048576});if(s.push(Buffer.from(i.data,i.base64Encoded?"base64":"latin1")),i.eof)break}return await t.session.send("IO.close",{handle:n}),Buffer.concat(s)}export async function printPdf(t){await C($(t.file),{recursive:!0});const e=await v({gpu:!1,htmlInCanvas:!1}),a=await K.create(t.file),n=t.tagged??!0,s=async i=>{t.signal?.throwIfAborted();const r=await I(e,{width:900,height:1200,allow:()=>!1});try{return await setContent(r,await t.parts.html(i)),await printOne(r,n,t.footer)}finally{await r.close()}};try{const i=[];let r=0;const g=()=>{r<t.parts.count&&i.push(s(r++))};for(let d=0;d<rt;d++)g();for(let d=0;d<t.parts.count;d++){const o=i.shift();if(!o)break;const f=await o;g(),await a.add(f)}await Promise.allSettled(i)}finally{await a.close(t.title===void 0?{}:{title:t.title}),await e.close()}}export async function printPage(t){const e=[];for(const a of t.types){const n=u(t.out,`${t.name}.${a}`);await C($(n),{recursive:!0}),a==="pdf"?await printPdf({parts:{count:1,html:()=>t.html},file:n,...t.title===void 0?{}:{title:t.title},footer:t.footer}):await D(n,await ct(t)),e.push(`${t.name}.${a}`)}return e}async function ct(t){const e=await v({gpu:!1,htmlInCanvas:!1});try{const a=await I(e,{width:t.width??900,height:1200,scale:2,allow:()=>!1});return await setContent(a,t.html),t.pictureCss!==void 0&&await a.evaluate(`(() => { const s = document.createElement('style'); s.textContent = ${JSON.stringify(t.pictureCss)}; document.head.append(s); return true; })()`),(await J(a)).png}finally{await e.close()}}export async function renderDoc(t){const e=t.name??"doc",a=t.types?.length?t.types:["pdf"],n=[];for(const s of a){if(s==="pdf"){const{writeDocPdf:i}=await import("./layout.js"),r=await i({root:t.root,doc:t.doc,stills:t.stills,file:u(t.out,`${e}.pdf`),title:t.doc.title??t.doc.path});t.onPrinted?.(r)}else await printPage({html:await docPage(t.root,t.doc,t.stills),out:t.out,name:e,types:[s],pictureCss:"body{padding:48px 0;background:#fff}",title:t.doc.title??t.doc.path});n.push(`${e}.${s}`)}return n}
74
+ })()`)}const mt=Math.max(1,Math.min(4,Math.floor(z().length/2)));export async function printOne(t,a,e){const{stream:i}=await t.session.send("Page.printToPDF",{...e===void 0?{}:{displayHeaderFooter:!0,headerTemplate:"<span></span>",footerTemplate:e},preferCSSPageSize:!0,printBackground:!0,generateTaggedPDF:a,generateDocumentOutline:!1,transferMode:"ReturnAsStream"});if(i===void 0)throw new Error("Chrome gave no PDF.");const r=[];for(;;){const o=await t.session.send("IO.read",{handle:i,size:1048576});if(r.push(Buffer.from(o.data,o.base64Encoded?"base64":"latin1")),o.eof)break}return await t.session.send("IO.close",{handle:i}),Buffer.concat(r)}export async function printPdf(t){await C(k(t.file),{recursive:!0});const a=await P({gpu:!1,htmlInCanvas:!1}),e=await st.create(t.file),i=t.tagged??!0,r=async o=>{t.signal?.throwIfAborted();const n=await I(a,{width:900,height:1200,allow:()=>!1});try{return await setContent(n,await t.parts.html(o)),await printOne(n,i,t.footer)}finally{await n.close()}};try{const o=[];let n=0;const c=()=>{n<t.parts.count&&o.push(r(n++))};for(let d=0;d<mt;d++)c();for(let d=0;d<t.parts.count;d++){const l=o.shift();if(!l)break;const g=await l;c(),await e.add(g)}await Promise.allSettled(o)}finally{await e.close(t.title===void 0?{}:{title:t.title}),await a.close()}}export async function printPage(t){const a=[];for(const e of t.types){const i=v(t.out,`${t.name}.${e}`);await C(k(i),{recursive:!0}),e==="pdf"?await printPdf({parts:{count:1,html:()=>t.html},file:i,...t.title===void 0?{}:{title:t.title},footer:t.footer}):await R(i,await ut(t)),a.push(`${t.name}.${e}`)}return a}async function ut(t){const a=await P({gpu:!1,htmlInCanvas:!1});try{const e=await I(a,{width:t.width??900,height:t.height??1200,scale:2,allow:()=>!1});return await setContent(e,t.html),t.pictureCss!==void 0&&await e.evaluate(`(() => { const s = document.createElement('style'); s.textContent = ${JSON.stringify(t.pictureCss)}; document.head.append(s); return true; })()`),(await V(e)).png}finally{await a.close()}}export async function renderDoc(t){const a=t.name??"doc",e=t.types?.length?t.types:["pdf"],i=[];for(const r of e){if(r==="pdf"){const{writeDocPdf:o}=await import("./layout.js"),n=await o({root:t.root,doc:t.doc,stills:t.stills,file:v(t.out,`${a}.pdf`),title:t.doc.title??t.doc.path});t.onPrinted?.(n)}else await printPage({html:await docPage(t.root,t.doc,t.stills),out:t.out,name:a,types:[r],pictureCss:"body{padding:48px 0;background:#fff}",title:t.doc.title??t.doc.path});i.push(`${a}.${r}`)}return i}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/doc-print",
3
- "version": "0.19.0",
3
+ "version": "0.21.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{CACHE_DIR as Ie}from"@allyhub/formats";import{mkdir as je,stat as Le,writeFile as Pe}from"node:fs/promises";import{cpus as Ce}from"node:os";import{dirname as Ne,isAbsolute as Fe,join as C,relative as de,sep as Oe}from"node:path";import{itemKindBuild as q,madeType as ce,usesInOrder as Re}from"@allyhub/build";import{FILE_TYPES as le,comboKey as fe,exportProblem as Ee,pieceIs as Te,pieceNamed as pe,versionLabel as G}from"@allyhub/piece";import{runCheck as _e}from"@allyhub/check";import{ConsolePool as De,mergeConsole as Ke,dedupe as ue,indexNeeds as We,makeIndex as ze,CheckSession as Be,OpenedVersion as He,keyedStills as Ve,ProjectError as j}from"@allyhub/project";import{batchCsv as Ye,batchRows as qe}from"./batch.js";import{processFile as Ge}from"./processors.js";import{batchName as Je,checkName as Qe,exportName as me,exportNames as Ue}from"./names.js";export const exportsAtOnce=e=>Math.max(1,Math.min(e,Math.floor(Ce().length/4)));const J=(e,r)=>`${String(e)} ${r}${e===1?"":"s"}`,Q=(e,r)=>Te({id:e.id,path:e.entry},r);function Xe(e,r){if(e===void 0)return;const o=new Set([...Object.keys(le),...r.flatMap(d=>d.renders?.types??[])]);for(const d of e)if(!o.has(d))throw new j("bad-type",`Cannot render ${d}.`,"usage",`Types: ${[...o].join(", ")}.`);return[...e]}const Ze=e=>({...e.steps===!0?{steps:!0}:{},...e.pptx==="picture"?{pptx:"picture"}:{}});function he(e,r){return[...e.docs.filter(o=>o.place===r.id).map(o=>o.file),...e.sheets.filter(o=>o.place===r.id).flatMap(o=>o.files)]}async function U(e,r,o,d){const{files:m,type:b,...$}=r,{piece:S,...c}=o,y=m[0]??e,E=(await Promise.all(m.map(N=>Le(N)))).reduce((N,F)=>N+F.size,0);return{files:[...m],...$,name:ke(de(e,y)),path:y,piece:S,type:b,...c,bytes:E,seconds:Math.round((performance.now()-d)/10)/100}}const ge=e=>"failure"in e;export function exportProject(e){return ye(e,new Map)}export const MADE_DIR=`${Ie}/made`;const K=(e,r)=>`${e}\0${r}`;function we(e,r){return o=>{const d=e?.uses?.find($=>$.of===o&&ce($)!==void 0),m=d===void 0?void 0:ce(d);if(!d||m===void 0)return;const b=r.get(K(d.item,m))?.[0];if(b)return d.part===void 0?b.path:b.partFiles?.[d.part]}}async function ye(e,r){const o=Xe(e.types,e.kinds);e.name!==void 0&&Qe(e.name);const d=e.params??{},m=Ze(d),b=e.items??[],$=b.length>0,S=v=>b.some(A=>Q(v,A)),c=[],y=[],E=[],N={root:e.root,out:e.out,params:d,...e.log===void 0?{}:{log:e.log},...e.signal===void 0?{}:{signal:e.signal}},F=async v=>{c.push(await Ge(v,e.processors??[],N))},W=()=>Be.open({root:e.root,kinds:e.kinds,...e.gpu===void 0?{}:{gpu:e.gpu},...e.consoleLimit===void 0?{}:{consoleLimit:e.consoleLimit}});let p=await W(),z=!0;const X={componentStills:(v,A,L)=>Ve(A,{prepared:p.prepared,item:v,combo:L,gpu:p.gpu,withSession:l=>l(p)})},Z=new Set,ee=async(v,A,L)=>{Z.has(v)||(Z.add(v),await A?.ready?.(L,d))};try{const v=p.prepared.items.filter(n=>!$||S(n)),A=n=>{const t=p.prepared.kinds.find(u=>u.id===n.kind)?.renders;return o===void 0?t?.defaults??[]:o.filter(u=>t?.types.includes(u)===!0)},L=Re(p.prepared.items,v,A).filter(n=>!r.has(K(n.item.id,n.type)));if(L.length>0){const n=p.prepared.pieces;z=!1,await p.close();for(const t of L){e.signal?.throwIfAborted();const u=n.find(a=>a.place===t.item.id)?.combos[0];e.log?.(`Making ${t.item.id} as ${t.type} first, which another item uses…`);try{const a=await ye({root:e.root,kinds:e.kinds,items:[t.item.id],types:[t.type],out:C(e.root,MADE_DIR),...u===void 0?{}:{combos:[u]},...e.gpu===void 0?{}:{gpu:e.gpu},...e.consoleLimit===void 0?{}:{consoleLimit:e.consoleLimit},...e.index===void 0?{}:{index:e.index},...e.analyses===void 0?{}:{analyses:e.analyses},...e.log===void 0?{}:{log:e.log},...e.signal===void 0?{}:{signal:e.signal}},r);r.set(K(t.item.id,t.type),a.files.filter(h=>h.type===t.type)),y.push(...a.failed)}catch(a){if(e.signal?.aborted===!0)throw a;r.set(K(t.item.id,t.type),[]),y.push({name:t.item.id,piece:t.item.id,type:t.type,code:a instanceof j?a.code:"failed",message:`${t.item.id}, which another item uses, could not be made: ${a.message}`})}}p=await W(),z=!0}const l=p.prepared,T=n=>l.kinds.find(t=>t.id===n)?.renders,O=[];for(const n of l.items){const t=await q(l.kinds,n);t?.render&&t.onStage!==!0&&O.push({item:n,build:t})}const I=b.filter(n=>!O.some(t=>Q(t.item,n)));for(const n of I)if(!l.pieces.some(t=>pe({id:t.id,path:t.place},n))){const t=l.items.find(a=>Q(a,n)),u=t&&l.problems.filter(a=>a.level==="error"&&(a.piece===t.id||a.where?.file===t.entry||(a.where?.file?.startsWith(`${t.dir}/`)??!1)));throw t&&u&&u.length>0?new j("item-failed",`${t.id} could not be made: ${u.map(a=>a.message).join(" ")}`,"failed","allyhub check lists every problem."):new j("no-item",`No item ${n}.`,"not-found",`Items: ${[...l.pieces.map(a=>a.id),...O.map(a=>a.item.id)].join(", ")||"none"}.`)}const te=$&&I.length===0,be=new Set(l.pieces.flatMap(n=>T(n.kind)?.types??[])),ne=o?.filter(n=>n in le||be.has(n)),$e=te?[]:l.pieces.filter(n=>I.length===0||I.some(t=>pe({id:n.id,path:n.place},t))),B=o?.includes("csv")===!0?$e.filter(n=>n.matrix!==void 0):[];if(o?.includes("csv")===!0&&I.length>0&&B.length===0)throw new j("bad-type",`${I.join(", ")} has no slots (matrix.slots), so there is no table of ads to write as csv.`,"usage","csv is a batch's table of ads, or a sheet's rows.");let _=[...l.problems];const H=new De(p.consoleLimit),xe=new Set(O.flatMap(n=>he(l,n.item))),ve=n=>n.where?.file!==void 0&&xe.has(n.where.file),ie=n=>n.filter(t=>t.level==="error"&&!ve(t)).length;if(!te&&(ne?.length!==0||B.length>0)&&(l.pieces.length>0||ie(l.problems)>0)){e.log?.("Checking…");const n=()=>tt(p,e.root,I,e.combos);let t=await n();const u=e.index===!1?[]:We(t.results);if(u.length>0){const s=await ze(l.root,u,e.analyses??[],{env:e.env??process.env,onProgress:nt(e.log),signal:e.signal});E.push(...s.failed.map(i=>({file:i.need.file,error:i.error}))),s.done.length>0&&(await p.close(),p=await W(),t=await n())}_=t.problems,H.addReport(t.console);const a=ie(t.problems);if(a>0)throw new j("check-failed",`The check found ${J(a,"must-fix problem")}, so nothing is rendered.`,"failed","allyhub check lists them; fix them, then render.");for(const s of B){const i=performance.now(),k=Je(s.id),M=qe(s,t.wholes,p.prepared.media,et(e.root,e.out),e.name);await je(Ne(C(e.out,k)),{recursive:!0}),await Pe(C(e.out,k),Ye(M));const P=t.targets.filter(g=>g.piece===s.id).length;M.length<P&&e.log?.(`${k}: ${J(P-M.length,"ad")} not listed, which did not load (allyhub check says why).`),await F(await U(e.out,{type:"csv",files:[C(e.out,k)]},{piece:s.id},i))}const h=[],R=new Set;for(const s of t.targets){const i=p.prepared.pieces.find(x=>x.id===s.piece);if(!i)continue;if(!$&&i.options.deliverable===!1){R.add(s.piece);continue}const k=T(i.kind),M={kind:i.kind,types:k?.types??[]},P=t.wholes.find(x=>x.piece===s.piece&&fe(x.combo)===s.key&&x.format===s.format)?.speaks??!1,g={piece:s.piece,output:s.output,combo:s.combo,format:s.format,...s.id===void 0?{}:{id:s.id}};for(const x of ne??k?.defaults??[]){const f=Ee({...M,speech:P},x);if(!(f?.code==="bad_type"&&!$)){if(f&&f.code!=="no_speech")throw new j("bad-type",`${G(g)}: ${f.message}`,"usage",f.hint);h.push({target:g,kind:i.kind,type:x,...f?{refused:{name:me(g,x,m),piece:g.piece,type:x,code:"no-speech",message:`${G(g)}: ${f.message}`,...f.hint?{hint:f.hint}:{}}}:{}})}}}R.size>0&&e.log?.(`Not rendered, shown only inside another video (deliverable: false): ${[...R].join(", ")}. Name one to render it.`);for(const s of new Set(h.map(i=>i.kind)))await ee(s,await q(l.kinds,{kind:s}),h.filter(i=>i.kind===s).map(i=>i.type));const D=Ue(h,e.name,m);h.forEach((s,i)=>{s.refused&&(s.refused.name=D[i]??s.refused.name)});const w=[],V=new Array(h.length).fill(0),Y=(s,i)=>{V[s]=Math.max(V[s]??0,i),e.onProgress?.(V.reduce((k,M)=>k+M,0)/h.length)};let oe=0,Se=0;const Ae=async()=>{for(let s=oe++;s<h.length;s=oe++){e.signal?.throwIfAborted();const i=h[s];if(!i)continue;const k=D[s]??me(i.target,i.type,m);if(i.refused){y.push(i.refused),Y(s,1);continue}const M=await q(l.kinds,{kind:i.kind}),P=performance.now(),g=await He.open({root:e.root,session:p,item:i.target.piece,combos:[i.target.combo],purpose:"render"});try{const x=await M?.render?.(l.items.find(f=>f.id===g.piece.place)??{id:g.piece.place,kind:i.kind,dir:g.piece.dir,entry:g.piece.file,groups:[]},{root:e.root,prepared:p.prepared,types:[i.type],out:()=>C(e.out,k),params:d,version:g,session:X,made:we(l.items.find(f=>f.id===g.piece.place),r),onProgress:f=>{Y(s,f)},...e.log===void 0?{}:{log:e.log},...e.signal===void 0?{}:{signal:e.signal}})??[{type:i.type,failure:{code:"no-render",message:`${G(i.target)}: its kind (${i.kind}) makes no files.`}}];for(const f of x){if(ge(f)){y.push({name:k,piece:i.target.piece,type:i.type,code:f.failure.code,message:f.failure.message,...f.failure.hint?{hint:f.failure.hint}:{}});continue}const ae=await U(e.out,f,{piece:i.target.piece,combo:i.target.combo,key:fe(i.target.combo),format:i.target.format},P);await F(ae),e.log?.(`[${String(++Se)}/${String(h.length)}] ${k} (${ae.seconds.toFixed(1)} s)`)}}finally{w.push(...await g.problems()),H.add(i.target,await g.console()),await g.close(),Y(s,1)}}};h.length>0&&e.log?.(`Rendering ${J(h.length,"file")}…`);const re=(await Promise.allSettled(Array.from({length:exportsAtOnce(h.length)},Ae))).find(s=>s.status==="rejected");if(re)throw re.reason;_=ue([..._,...w])}const Me=n=>l.problems.find(t=>t.level==="error"&&t.where?.file!==void 0&&n.includes(t.where.file)),se=[];for(const n of O.filter(t=>!$||S(t.item))){const t=Me(he(l,n.item)),u=T(n.item.kind);t?y.push({name:n.item.id,piece:n.item.id,type:u?.defaults[0]??u?.types[0]??"",code:"check-failed",message:`${t.where?.file??n.item.entry}: ${t.message}`,hint:"Fix it, then render again."}):se.push(n)}e.signal?.throwIfAborted();for(const{item:n,build:t}of se){const u=T(n.kind),a=o===void 0?u?.defaults??[]:o.filter(w=>u?.types.includes(w)===!0);if(a.length===0)continue;await ee(n.kind,t,a);const h=performance.now(),R=n.id,D=await t.render?.(n,{root:e.root,prepared:p.prepared,types:a,out:w=>C(e.out,`${R}.${w}`),params:d,session:X,made:we(n,r),...e.log===void 0?{}:{log:e.log},...e.signal===void 0?{}:{signal:e.signal}})??[];for(const w of D)ge(w)?y.push({name:n.id,piece:n.id,type:w.type,code:w.failure.code,message:w.failure.message,...w.failure.hint?{hint:w.failure.hint}:{}}):await F(await U(e.out,w,{piece:n.id},h))}return{out:e.out,files:c,failed:y,problems:_,console:H.report(),unindexed:E}}finally{z&&await p.close()}}const ke=e=>e.split(Oe).join("/");function et(e,r){const o=de(e,r);return o===""?".":o.startsWith("..")||Fe(o)?r:ke(o)}async function tt(e,r,o,d){const m=[];for(const c of o.length>0?o:[void 0])m.push(await _e({dir:r,session:e,facts:!1,...c===void 0?{}:{piece:c},...d?{combos:[...d]}:{}}));const b=new Set,$=m.flatMap(c=>c.targets).filter(c=>{const y=`${c.piece}\0${c.key}\0${c.format}`;return b.has(y)?!1:(b.add(y),!0)}),S=ue(m.flatMap(c=>c.problems));return{targets:$,results:m.flatMap(c=>c.results),wholes:m.flatMap(c=>c.wholes),problems:S,errors:S.filter(c=>c.level==="error").length,console:Ke(e.consoleLimit,...m.map(c=>c.console))}}function nt(e){let r="";return o=>{const d=o.status==="failed"?`Could not index ${o.file}: ${o.message}`:o.message;o.status==="running"&&o.share!==void 0||d!==r&&(r=d,e?.(d))}}
2
+ import{CACHE_DIR as Ie}from"@allyhub/formats";import{mkdir as je,stat as Le,writeFile as Pe}from"node:fs/promises";import{cpus as Ce}from"node:os";import{dirname as Ne,isAbsolute as Fe,join as C,relative as de,sep as Oe}from"node:path";import{itemKindBuild as q,madeType as ce,usesInOrder as Re}from"@allyhub/build";import{FILE_TYPES as le,comboKey as fe,exportProblem as Ee,pieceIs as Te,pieceNamed as pe,versionLabel as G}from"@allyhub/piece";import{runCheck as _e}from"@allyhub/check";import{ConsolePool as De,mergeConsole as Ke,dedupe as ue,indexNeeds as We,makeIndex as ze,CheckSession as Be,OpenedVersion as He,keyedStills as Ve,ProjectError as j}from"@allyhub/project";import{batchCsv as Ye,batchRows as qe}from"./batch.js";import{processFile as Ge}from"./processors.js";import{batchName as Je,checkName as Qe,exportName as me,exportNames as Ue}from"./names.js";export const exportsAtOnce=e=>Math.max(1,Math.min(e,Math.floor(Ce().length/4)));const J=(e,r)=>`${String(e)} ${r}${e===1?"":"s"}`,Q=(e,r)=>Te({id:e.id,path:e.entry},r);function Xe(e,r){if(e===void 0)return;const o=new Set([...Object.keys(le),...r.flatMap(d=>d.renders?.types??[])]);for(const d of e)if(!o.has(d))throw new j("bad-type",`Cannot render ${d}.`,"usage",`Types: ${[...o].join(", ")}.`);return[...e]}const Ze=e=>({...e.steps===!0?{steps:!0}:{},...e.pptx==="picture"?{pptx:"picture"}:{}});function he(e,r){return[...e.docs.filter(o=>o.place===r.id).map(o=>o.file),...e.sheets.filter(o=>o.place===r.id).flatMap(o=>o.files)]}async function U(e,r,o,d){const{files:m,type:b,...$}=r,{piece:S,...c}=o,y=m[0]??e,E=(await Promise.all(m.map(N=>Le(N)))).reduce((N,F)=>N+F.size,0);return{files:[...m],...$,name:ke(de(e,y)),path:y,piece:S,type:b,...c,bytes:E,seconds:Math.round((performance.now()-d)/10)/100}}const ge=e=>"failure"in e;export function exportProject(e){return ye(e,new Map)}export const MADE_DIR=`${Ie}/made`;const K=(e,r)=>`${e}\0${r}`;function we(e,r){return o=>{const d=e?.uses?.find($=>$.of===o&&ce($)!==void 0),m=d===void 0?void 0:ce(d);if(!d||m===void 0)return;const b=r.get(K(d.item,m))?.[0];if(b)return d.part===void 0?b.path:b.partFiles?.[d.part]}}async function ye(e,r){const o=Xe(e.types,e.kinds);e.name!==void 0&&Qe(e.name);const d=e.params??{},m=Ze(d),b=e.items??[],$=b.length>0,S=v=>b.some(A=>Q(v,A)),c=[],y=[],E=[],N={root:e.root,out:e.out,params:d,...e.log===void 0?{}:{log:e.log},...e.signal===void 0?{}:{signal:e.signal}},F=async v=>{c.push(await Ge(v,e.processors??[],N))},W=()=>Be.open({root:e.root,kinds:e.kinds,...e.gpu===void 0?{}:{gpu:e.gpu},...e.consoleLimit===void 0?{}:{consoleLimit:e.consoleLimit}});let p=await W(),z=!0;const X={componentStills:(v,A,L)=>Ve(A,{prepared:p.prepared,item:v,combo:L,gpu:p.gpu,withSession:l=>l(p)})},Z=new Set,ee=async(v,A,L)=>{Z.has(v)||(Z.add(v),await A?.ready?.(L,d))};try{const v=p.prepared.items.filter(n=>!$||S(n)),A=n=>{const t=p.prepared.kinds.find(u=>u.id===n.kind)?.renders;return o===void 0?t?.defaults??[]:o.filter(u=>t?.types.includes(u)===!0)},L=Re(p.prepared.items,v,A).filter(n=>!r.has(K(n.item.id,n.type)));if(L.length>0){const n=p.prepared.pieces;z=!1,await p.close();for(const t of L){e.signal?.throwIfAborted();const u=n.find(a=>a.place===t.item.id)?.combos[0];e.log?.(`Making ${t.item.id} as ${t.type} first, which another item uses…`);try{const a=await ye({root:e.root,kinds:e.kinds,items:[t.item.id],types:[t.type],out:C(e.root,MADE_DIR),...u===void 0?{}:{combos:[u]},...e.gpu===void 0?{}:{gpu:e.gpu},...e.consoleLimit===void 0?{}:{consoleLimit:e.consoleLimit},...e.index===void 0?{}:{index:e.index},...e.analyses===void 0?{}:{analyses:e.analyses},...e.log===void 0?{}:{log:e.log},...e.signal===void 0?{}:{signal:e.signal}},r);r.set(K(t.item.id,t.type),a.files.filter(h=>h.type===t.type)),y.push(...a.failed)}catch(a){if(e.signal?.aborted===!0)throw a;r.set(K(t.item.id,t.type),[]),y.push({name:t.item.id,piece:t.item.id,type:t.type,code:a instanceof j?a.code:"failed",message:`${t.item.id}, which another item uses, could not be made: ${a.message}`})}}p=await W(),z=!0}const l=p.prepared,T=n=>l.kinds.find(t=>t.id===n)?.renders,O=[];for(const n of l.items){const t=await q(l.kinds,n);t?.render&&t.onStage!==!0&&O.push({item:n,build:t})}const I=b.filter(n=>!O.some(t=>Q(t.item,n)));for(const n of I)if(!l.pieces.some(t=>pe({id:t.id,path:t.place},n))){const t=l.items.find(a=>Q(a,n)),u=t&&l.problems.filter(a=>a.level==="error"&&(a.piece===t.id||a.where?.file===t.entry||(a.where?.file?.startsWith(`${t.dir}/`)??!1)));throw t&&u&&u.length>0?new j("item-failed",`${t.id} could not be made: ${u.map(a=>a.message).join(" ")}`,"failed","allyhub check lists every problem."):new j("no-item",`No item ${n}.`,"not-found",`Items: ${[...l.pieces.map(a=>a.id),...O.map(a=>a.item.id)].join(", ")||"none"}.`)}const te=$&&I.length===0,be=new Set(l.pieces.flatMap(n=>T(n.kind)?.types??[])),ne=o?.filter(n=>n in le||be.has(n)),$e=te?[]:l.pieces.filter(n=>I.length===0||I.some(t=>pe({id:n.id,path:n.place},t))),B=o?.includes("csv")===!0?$e.filter(n=>n.matrix!==void 0):[];if(o?.includes("csv")===!0&&I.length>0&&B.length===0)throw new j("bad-type",`${I.join(", ")} has no slots (matrix.slots), so there is no table of ads to write as csv.`,"usage","csv is a batch's table of ads, or a sheet's rows.");let _=[...l.problems];const H=new De(p.consoleLimit),xe=new Set(O.flatMap(n=>he(l,n.item))),ve=n=>n.where?.file!==void 0&&xe.has(n.where.file),ie=n=>n.filter(t=>t.level==="error"&&!ve(t)).length;if(!te&&(ne?.length!==0||B.length>0)&&(l.pieces.length>0||ie(l.problems)>0)){e.log?.("Checking…");const n=()=>tt(p,e.root,I,e.combos);let t=await n();const u=e.index===!1?[]:We(t.results);if(u.length>0){const s=await ze(l.root,u,e.analyses??[],{env:e.env??process.env,onProgress:nt(e.log),signal:e.signal});E.push(...s.failed.map(i=>({file:i.need.file,error:i.error}))),s.done.length>0&&(await p.close(),p=await W(),t=await n())}_=t.problems,H.addReport(t.console);const a=ie(t.problems);if(a>0)throw new j("check-failed",`The check found ${J(a,"error")}, so nothing is rendered.`,"failed","allyhub check lists them; fix them, then render.");for(const s of B){const i=performance.now(),k=Je(s.id),M=qe(s,t.wholes,p.prepared.media,et(e.root,e.out),e.name);await je(Ne(C(e.out,k)),{recursive:!0}),await Pe(C(e.out,k),Ye(M));const P=t.targets.filter(g=>g.piece===s.id).length;M.length<P&&e.log?.(`${k}: ${J(P-M.length,"ad")} not listed, which did not load (allyhub check says why).`),await F(await U(e.out,{type:"csv",files:[C(e.out,k)]},{piece:s.id},i))}const h=[],R=new Set;for(const s of t.targets){const i=p.prepared.pieces.find(x=>x.id===s.piece);if(!i)continue;if(!$&&i.options.deliverable===!1){R.add(s.piece);continue}const k=T(i.kind),M={kind:i.kind,types:k?.types??[]},P=t.wholes.find(x=>x.piece===s.piece&&fe(x.combo)===s.key&&x.format===s.format)?.speaks??!1,g={piece:s.piece,output:s.output,combo:s.combo,format:s.format,...s.id===void 0?{}:{id:s.id}};for(const x of ne??k?.defaults??[]){const f=Ee({...M,speech:P},x);if(!(f?.code==="bad_type"&&!$)){if(f&&f.code!=="no_speech")throw new j("bad-type",`${G(g)}: ${f.message}`,"usage",f.hint);h.push({target:g,kind:i.kind,type:x,...f?{refused:{name:me(g,x,m),piece:g.piece,type:x,code:"no-speech",message:`${G(g)}: ${f.message}`,...f.hint?{hint:f.hint}:{}}}:{}})}}}R.size>0&&e.log?.(`Not rendered, shown only inside another video (deliverable: false): ${[...R].join(", ")}. Name one to render it.`);for(const s of new Set(h.map(i=>i.kind)))await ee(s,await q(l.kinds,{kind:s}),h.filter(i=>i.kind===s).map(i=>i.type));const D=Ue(h,e.name,m);h.forEach((s,i)=>{s.refused&&(s.refused.name=D[i]??s.refused.name)});const w=[],V=new Array(h.length).fill(0),Y=(s,i)=>{V[s]=Math.max(V[s]??0,i),e.onProgress?.(V.reduce((k,M)=>k+M,0)/h.length)};let oe=0,Se=0;const Ae=async()=>{for(let s=oe++;s<h.length;s=oe++){e.signal?.throwIfAborted();const i=h[s];if(!i)continue;const k=D[s]??me(i.target,i.type,m);if(i.refused){y.push(i.refused),Y(s,1);continue}const M=await q(l.kinds,{kind:i.kind}),P=performance.now(),g=await He.open({root:e.root,session:p,item:i.target.piece,combos:[i.target.combo],purpose:"render"});try{const x=await M?.render?.(l.items.find(f=>f.id===g.piece.place)??{id:g.piece.place,kind:i.kind,dir:g.piece.dir,entry:g.piece.file,groups:[]},{root:e.root,prepared:p.prepared,types:[i.type],out:()=>C(e.out,k),params:d,version:g,session:X,made:we(l.items.find(f=>f.id===g.piece.place),r),onProgress:f=>{Y(s,f)},...e.log===void 0?{}:{log:e.log},...e.signal===void 0?{}:{signal:e.signal}})??[{type:i.type,failure:{code:"no-render",message:`${G(i.target)}: its kind (${i.kind}) makes no files.`}}];for(const f of x){if(ge(f)){y.push({name:k,piece:i.target.piece,type:i.type,code:f.failure.code,message:f.failure.message,...f.failure.hint?{hint:f.failure.hint}:{}});continue}const ae=await U(e.out,f,{piece:i.target.piece,combo:i.target.combo,key:fe(i.target.combo),format:i.target.format},P);await F(ae),e.log?.(`[${String(++Se)}/${String(h.length)}] ${k} (${ae.seconds.toFixed(1)} s)`)}}finally{w.push(...await g.problems()),H.add(i.target,await g.console()),await g.close(),Y(s,1)}}};h.length>0&&e.log?.(`Rendering ${J(h.length,"file")}…`);const re=(await Promise.allSettled(Array.from({length:exportsAtOnce(h.length)},Ae))).find(s=>s.status==="rejected");if(re)throw re.reason;_=ue([..._,...w])}const Me=n=>l.problems.find(t=>t.level==="error"&&t.where?.file!==void 0&&n.includes(t.where.file)),se=[];for(const n of O.filter(t=>!$||S(t.item))){const t=Me(he(l,n.item)),u=T(n.item.kind);t?y.push({name:n.item.id,piece:n.item.id,type:u?.defaults[0]??u?.types[0]??"",code:"check-failed",message:`${t.where?.file??n.item.entry}: ${t.message}`,hint:"Fix it, then render again."}):se.push(n)}e.signal?.throwIfAborted();for(const{item:n,build:t}of se){const u=T(n.kind),a=o===void 0?u?.defaults??[]:o.filter(w=>u?.types.includes(w)===!0);if(a.length===0)continue;await ee(n.kind,t,a);const h=performance.now(),R=n.id,D=await t.render?.(n,{root:e.root,prepared:p.prepared,types:a,out:w=>C(e.out,`${R}.${w}`),params:d,session:X,made:we(n,r),...e.log===void 0?{}:{log:e.log},...e.signal===void 0?{}:{signal:e.signal}})??[];for(const w of D)ge(w)?y.push({name:n.id,piece:n.id,type:w.type,code:w.failure.code,message:w.failure.message,...w.failure.hint?{hint:w.failure.hint}:{}}):await F(await U(e.out,w,{piece:n.id},h))}return{out:e.out,files:c,failed:y,problems:_,console:H.report(),unindexed:E}}finally{z&&await p.close()}}const ke=e=>e.split(Oe).join("/");function et(e,r){const o=de(e,r);return o===""?".":o.startsWith("..")||Fe(o)?r:ke(o)}async function tt(e,r,o,d){const m=[];for(const c of o.length>0?o:[void 0])m.push(await _e({dir:r,session:e,facts:!1,...c===void 0?{}:{piece:c},...d?{combos:[...d]}:{}}));const b=new Set,$=m.flatMap(c=>c.targets).filter(c=>{const y=`${c.piece}\0${c.key}\0${c.format}`;return b.has(y)?!1:(b.add(y),!0)}),S=ue(m.flatMap(c=>c.problems));return{targets:$,results:m.flatMap(c=>c.results),wholes:m.flatMap(c=>c.wholes),problems:S,errors:S.filter(c=>c.level==="error").length,console:Ke(e.consoleLimit,...m.map(c=>c.console))}}function nt(e){let r="";return o=>{const d=o.status==="failed"?`Could not index ${o.file}: ${o.message}`:o.message;o.status==="running"&&o.share!==void 0||d!==r&&(r=d,e?.(d))}}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/export",
3
- "version": "0.19.0",
3
+ "version": "0.21.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/extension-api",
3
- "version": "0.19.0",
3
+ "version": "0.21.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{CORE as _,declareRules as v,ruleOf as C}from"@allyhub/diagnostics";import{STAGE_LOADS as R}from"@allyhub/formats";import{LOCALES as A}from"@allyhub/i18n";import{PROJECT_TOOLS as L,StageFolderSchema as M,StageLoadSchema as W,known as V}from"@allyhub/protocol";import{RuntimeSchema as D}from"@allyhub/runtimes/schema";import{z as n}from"zod";import{KEY as K,MENUS as U,SETTING_TYPES as E,VIEW_CONTAINERS as p,inMenuBar as G,settingProblem as O,whenProblem as H}from"./shell.js";export const definePoint=e=>e,WordsSchema=n.record(n.string(),n.string().min(1));export function missingLocales(e){return A.filter(t=>!(t in e))}export const wordIn=(e,t)=>e[t]??e.en??Object.values(e)[0]??"";const h=n.string().regex(/^(@[a-z0-9][\w.-]*\/)?[a-z0-9][\w.-]*(\/[\w.-]+)*$/u);function b(e,t,i){if(typeof e!="object"||e===null||Array.isArray(e))return`is not an object of ${t}.`;const o=[];for(const[s,r]of Object.entries(e)){if(!Array.isArray(r))return`.${s} is not a list.`;r.forEach((d,u)=>{o.push([`.${s}[${String(u)}]`,typeof d=="object"&&d!==null?{...d,[i]:s}:d])})}return o}const y=n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),f=n.string().superRefine((e,t)=>{const i=H(e);i!==void 0&&t.addIssue({code:"custom",message:i})}),J=n.object({id:y,title:WordsSchema,enablement:f.optional(),place:n.enum(["workspace","ui"]).default("workspace")});export const COMMANDS=definePoint({id:"commands",about:"Commands a person runs from the palette, the menus and the keys.",entry:J,key:e=>e.id,activation:(e,t)=>e.place===t?[`onCommand:${e.id}`]:[],check:e=>{const t=missingLocales(e.title);return t.length>0?[`${e.id}'s title has no words in ${t.join(", ")}.`]:[]}});const B=n.object({command:y,key:n.string().regex(K,{message:"A key is modifiers among Mod, Shift and Alt, then a capital letter, a digit, a sign or a key's name (Mod+Shift+H)."}),when:f.optional()});export const KEYBINDING_POINT=definePoint({id:"keybindings",about:"Keys that run commands, each while its when clause holds.",entry:B});const F=n.object({menu:n.string().min(1),command:y,when:f.optional(),group:n.string().min(1).optional()});export const MENU_POINT=definePoint({id:"menus",about:`Commands in menus, by menu (${U.join(", ")}), each while its when clause holds.`,entry:F,entries:e=>b(e,"menus","menu"),check:e=>G(e.menu)?[`${e.command} is not placed in ${e.menu}: Studio's menu bar shows the core's entries alone yet.`]:[]});const x="Studio places no extension's view yet; its work card and its sidebar show the core's alone.",Y=n.object({location:n.string().min(1),id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),title:WordsSchema,icon:n.string().min(1).optional()});export const VIEW_CONTAINER_POINT=definePoint({id:"viewsContainers",about:`Containers of views, by where each goes; the shell gives its own (${p.join(", ")}) and takes none of an extension's yet.`,entry:Y,entries:e=>b(e,"places","location"),key:e=>e.id,check:e=>{const t=missingLocales(e.title);return[...t.length>0?[`${e.id}'s title has no words in ${t.join(", ")}.`]:[],`the container ${e.id} is not placed: ${x}`]}});const Z=n.object({container:n.string().min(1),id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),name:WordsSchema,when:f.optional(),icon:n.string().min(1).optional(),module:h.optional()});export const VIEW_POINT=definePoint({id:"views",about:`Views, by the container each is in (${p.join(", ")}): a page in a frame, as an editor is.`,entry:Z,entries:e=>b(e,"containers","container"),key:e=>e.id,check:e=>{const t=missingLocales(e.name);return[...p.includes(e.container)?[]:[`${e.container} is not a container: a view goes in ${p.join(" or ")}.`],...t.length>0?[`${e.id}'s name has no words in ${t.join(", ")}.`]:[],...e.module===void 0?[`${e.id} names no module: a view is a page's module, as an editor is.`]:[],`the view ${e.id} is not placed: ${x}`]}});const S=n.union([n.string(),n.boolean(),n.number()]),X=n.object({type:n.string().min(1),default:S.optional(),title:WordsSchema,description:WordsSchema.optional(),enum:n.array(S).min(1).optional(),enumItemLabels:n.array(WordsSchema).optional(),enumDescriptions:n.array(WordsSchema).optional(),minimum:n.number().optional(),maximum:n.number().optional(),minLength:n.number().int().min(0).optional(),order:n.number().int().optional()}),q=n.object({title:WordsSchema,order:n.number().int().optional(),properties:n.record(n.string(),X)});function Q(e,t){const i=[],o=(s,r)=>{const d=missingLocales(r);d.length>0&&i.push(`${e}'s ${s} has no words in ${d.join(", ")}.`)};return o("title",t.title),t.description!==void 0&&o("description",t.description),t.enumItemLabels?.forEach((s,r)=>{o(`label of choice ${String(r+1)}`,s)}),t.enumDescriptions?.forEach((s,r)=>{o(`description of choice ${String(r+1)}`,s)}),i}export const CONFIGURATION_POINT=definePoint({id:"configuration",about:"Settings: a title and JSON Schema properties by key, drawn as rows in the shell and read through allyhub.settings.",entry:q,entries:e=>Array.isArray(e)?e.map((t,i)=>[`[${String(i)}]`,t]):typeof e=="object"&&e!==null?[["",e]]:"is not a configuration or a list of them.",check:(e,t)=>{const i=[],o=missingLocales(e.title);o.length>0&&i.push(`a configuration's title has no words in ${o.join(", ")}.`);for(const[s,r]of Object.entries(e.properties)){if((!s.startsWith(`${t}.`)||s===`${t}.`)&&i.push(`${s} is not named by its extension: a setting's key is ${t}. and a name.`),i.push(...Q(s,r)),!E.includes(r.type)){i.push(`${s} is of type ${r.type}: a shell draws ${E.join(", ")}.`);continue}const d={...r,type:r.type};for(const[u,m]of(r.enum??[]).entries()){const c=O({type:d.type},m);c!==void 0&&i.push(`${s}'s choice ${String(u+1)}: ${c}`)}if(r.default!==void 0){const u=O(d,r.default);u!==void 0&&i.push(`${s}'s default: ${u}`)}for(const u of["enumItemLabels","enumDescriptions"]){const m=r[u];m!==void 0&&m.length!==(r.enum?.length??0)&&i.push(`${s}'s ${u} are ${String(m.length)}, and its choices ${String(r.enum?.length??0)}.`)}}return i}});const ee=n.object({name:n.string().regex(/^[a-z0-9][a-z0-9_-]*$/u),title:n.string().min(1),description:n.string().min(1),inputSchema:n.record(n.string(),n.unknown()),annotations:n.object({readOnlyHint:n.boolean(),destructiveHint:n.boolean(),idempotentHint:n.boolean(),openWorldHint:n.boolean()}).partial().optional()});export const WINDOW_TOOL_POINT=definePoint({id:"windowTools",about:"Tools an agent calls that act in the person's window, during its own turn: a name, a description, a JSON Schema of the input.",entry:ee,key:e=>e.name,check:e=>{const t=z(e.inputSchema);return[...t===void 0?[]:[`${e.name}'s inputSchema ${t}`],`the window tool ${e.name} is not given: Studio's MCP server gives the core's tools alone yet.`]}});const ne=n.object({name:n.string().regex(/^[a-z0-9][a-z0-9-]*( [a-z0-9][a-z0-9-]*){0,2}$/u),summary:n.string().min(1),work:n.string().min(1).optional(),module:n.string().min(1)});export const CLI_COMMANDS=definePoint({id:"cliCommands",about:"Commands the agent runs, `allyhub <name>`, listed in `allyhub help` before their module is loaded.",entry:ne,key:e=>e.name});const te=n.object({name:n.string().regex(/^[a-z0-9][a-z0-9.-]*\/[a-z][a-z0-9-]*$/u),source:n.enum(["project","asleep","machine"]),does:n.union([n.object({command:n.string().min(1)}),n.object({files:n.string().min(1)}),n.object({person:n.string().min(1)})]),module:n.string().min(1),readView:h.optional()});export const PROJECT_TOOL_POINT=definePoint({id:"projectTools",about:"Project tools: what an editor asks of a project through tools/call, each with the command or files that do the same for the agent.",entry:te,key:e=>e.name,check:(e,t)=>{if(Object.hasOwn(L,e.name))return[`${e.name} is the core's own project tool.`];const i=e.name.slice(0,e.name.lastIndexOf("/"));return T(t)||i===t?[]:[`the project tool ${e.name} does not start with its extension's id (${t}/…).`]}});const oe=n.object({folder:M,loads:n.array(W),module:n.string().min(1)});export const STAGE_ROUTE_POINT=definePoint({id:"stageRoutes",about:"Stage routes: a folder of the stage's tree an extension answers, what the stage's pages load from it, and what a snapshot records of it.",entry:oe,key:e=>e.folder});const ie=n.object({name:n.string().min(1),only:n.array(n.string().min(1)).min(1),values:n.array(n.string().min(1)).optional()}),se=n.object({files:n.record(n.string().min(1),n.string()),entry:n.string().min(1)}),w=e=>!e.startsWith("/")&&!e.includes("\\")&&e.split("/").every(t=>t!==""&&t!=="."&&t!==".."),ae=n.object({id:n.string().regex(/^[a-z][a-z0-9-]*$/u),name:WordsSchema,plural:WordsSchema.optional(),noun:n.string().min(1),part:n.object({noun:n.string().min(1),plural:n.string().min(1)}).optional(),pages:n.boolean().optional(),editor:n.string().min(1).optional(),shown:n.object({line:WordsSchema,order:n.number()}).optional(),icon:n.string().min(1).optional(),color:n.string().min(1).optional(),exports:n.object({types:n.array(n.string().min(1)).min(1),extras:n.array(n.string().min(1)).default([]),options:n.array(ie).default([]),names:n.record(n.string().min(1),WordsSchema).default({})}).optional(),renders:n.object({types:n.array(n.string().min(1)).min(1),defaults:n.array(n.string().min(1)).min(1)}).optional(),starter:se.optional(),turnInto:n.boolean().optional(),share:n.boolean().optional(),build:n.string().min(1).optional(),config:n.array(n.string().min(1)).optional(),layers:n.boolean().optional()});export const KIND_POINT=definePoint({id:"kinds",about:"Kinds of item: their names, their editor, their icon and colour, what they export and render, what a new one starts as, whether one is shared alone.",entry:ae,key:e=>e.id,activation:(e,t)=>t==="workspace"?[`onKind:${e.id}`]:[],check:e=>{const t=[],i=missingLocales(e.name);i.length>0&&t.push(`${e.id}'s name has no words in ${i.join(", ")}.`);const o=e.plural&&missingLocales(e.plural);o&&o.length>0&&t.push(`${e.id}'s plural has no words in ${o.join(", ")}.`);for(const[r,d]of Object.entries(e.exports?.names??{})){const u=missingLocales(d);u.length>0&&t.push(`${e.id}'s name for its export ${r} has no words in ${u.join(", ")}.`)}const s=Object.keys(e.starter?.files??{});for(const r of s.filter(d=>!w(d)))t.push(`${e.id}'s starter file ${r} is not inside the new item's folder.`);return e.starter&&!s.includes(e.starter.entry)&&t.push(`${e.id}'s starter's entry ${e.starter.entry} is none of its files.`),t}});const I=n.union([n.string().min(1),n.array(n.string().min(1)).min(1)]),re=n.object({id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),markup:I.optional(),kinds:n.array(n.string().min(1)).default([]),files:n.array(n.string().min(1)).default([]),noun:n.string().min(1).optional(),name:WordsSchema.optional(),plural:WordsSchema.optional(),icon:n.string().min(1).optional(),color:n.string().min(1).optional(),check:n.string().min(1).optional(),priority:n.enum(["default","option"]).default("default"),share:n.boolean().optional(),page:n.boolean().optional(),module:h.optional(),place:n.record(n.string(),n.unknown()).optional()});function z(e){if(e.type!=="object")return'is not of "type": "object".';try{n.fromJSONSchema(e)}catch(t){return`is not a JSON Schema zod reads: ${t instanceof Error?t.message:String(t)}.`}}export const EDITOR_POINT=definePoint({id:"editors",about:"Editors: the kinds each opens, or the files it opens by their names (glob patterns, with their name, sign and check), whether it is their default, the module a page imports for it, and the schema of where a person is in what it opens.",entry:re,key:e=>e.id,activation:(e,t)=>t==="ui"?[`onEditor:${e.id}`]:[],check:e=>{const t=[],i=e.place&&z(e.place);if(i!==void 0&&t.push(`${e.id}'s place ${i}`),e.kinds.length===0&&e.files.length===0&&t.push(`${e.id} opens no kind and no files.`),e.kinds.length>0&&e.files.length>0&&t.push(`${e.id} opens kinds and files: an editor opens one or the other.`),e.files.length>0){e.noun===void 0&&t.push(`${e.id} opens files and has no noun for them.`),e.name===void 0&&t.push(`${e.id} opens files and has no name for them.`);for(const[o,s]of[["name",e.name],["plural",e.plural]]){const r=s===void 0?[]:missingLocales(s);r.length>0&&t.push(`${e.id}'s ${o} has no words in ${r.join(", ")}.`)}for(const o of e.files)(o.startsWith("/")||o.split("/").includes(".."))&&t.push(`${e.id}'s pattern ${o} is not of project paths (no leading /, no ..).`)}else e.check!==void 0&&t.push(`${e.id} has a check and opens no files: a kind's items are checked by its build.`);return t}});export function fileEditorTable(e,t=(i,o)=>o){return e.flatMap(({extension:i,entry:o})=>o.files.length===0||o.name===void 0||o.noun===void 0?[]:[{id:o.id,files:[...o.files],noun:o.noun,name:{...o.name},...o.plural===void 0?{}:{plural:{...o.plural}},...o.icon===void 0?{}:{icon:o.icon},...o.color===void 0?{}:{color:o.color},...o.priority==="option"?{priority:o.priority}:{},...o.share===!0?{share:!0}:{},...o.page===!0?{page:!0}:{},...o.check===void 0?{}:{check:t(i,o.check)},extension:i}])}const de=n.object({id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),markup:I.optional(),types:n.array(n.string().regex(/^[a-z]+\/(?:\*|[\w.+-]+)$/u)).min(1),module:h});export const PREVIEW_RENDERER_POINT=definePoint({id:"previewRenderers",about:"Preview renderers: how a file of a media type is drawn wherever one is shown (a canvas's node); each its media types and the module a page imports for it.",entry:de,key:e=>e.id});const T=e=>e.startsWith("allyhub.");function $(e,t,i){return T(e)||t.startsWith(`${e}/`)?[]:[`the ${i} ${t} does not start with its extension's id (${e}/…).`]}const le=n.object({code:n.string().regex(/^(AK-[A-Z]\d{3}|[a-z0-9][a-z0-9-]*\.[a-z0-9][a-z0-9-]*\/[A-Za-z0-9][\w.-]*)$/u),level:n.enum(["error","warn"]),rule:n.string().min(1)});export const RULE_POINT=definePoint({id:"rules",about:"Rules: the codes an extension reports problems under, each with its level and what it says.",entry:le,key:e=>e.code,check:(e,t)=>{const i=C(e.code);return[...$(t,e.code,"rule"),...i&&i.extension!==t?[`${e.code} is ${i.extension===_?"the core's":`${i.extension}'s`} rule already.`]:[]]},added:(e,t)=>v(t,[e])});const ce=n.object({kind:n.string().regex(/^([a-z][a-z0-9-]*|[a-z0-9][a-z0-9-]*\.[a-z0-9][a-z0-9-]*\/[a-z][a-z0-9-]*)$/u),about:n.string().min(1)});export const FACT_POINT=definePoint({id:"facts",about:"Kinds of fact: what an extension measures for the agent to judge, each with what it says.",entry:ce,key:e=>e.kind,check:(e,t)=>$(t,e.kind,"kind of fact")});const ue=n.object({module:n.string().min(1)});export const BUILD_PLUGINS_POINT=definePoint({id:"buildPlugins",about:"Build plugins: a module whose Vite plugins and lent packages every stage bundle of a project takes.",entry:ue});const k=n.string().min(1),me=n.object({name:n.string().regex(/^[a-z][a-z0-9-]*$/u),summary:n.string().min(1),module:k});export const INSPECT_VIEW_POINT=definePoint({id:"inspectViews",about:"Views of `allyhub inspect <name>`: a measurement now, listed in `allyhub help` before its module is loaded.",entry:me,key:e=>e.name});const pe=n.object({id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),types:n.array(n.string().min(1)).min(1),module:k});export const EXPORT_PROCESSOR_POINT=definePoint({id:"exportProcessors",about:"Export processors: a step run on every file of the types it names that an export makes.",entry:pe,key:e=>e.id,check:(e,t)=>e.id.startsWith(`${t}.`)?[]:[`the processor ${e.id} does not start with its extension's id (${t}.…).`]});const he=n.object({id:n.string().regex(/^([a-z][a-z0-9-]*|[a-z0-9][a-z0-9-]*\.[a-z0-9][a-z0-9-]*\/[a-z][a-z0-9-]*)$/u),about:n.string().min(1),what:n.string().min(1),media:n.array(n.enum(["image","audio","video"])).min(1),runtimes:n.array(n.string().regex(/^[a-z0-9][a-z0-9-]*$/u)).default([]),module:k});export const MEDIA_ANALYSIS_POINT=definePoint({id:"mediaAnalyses",about:"Media analyses: what the media index measures of a file once, by its content, when a version needs it.",entry:he,key:e=>e.id,check:(e,t)=>$(t,e.id,"media analysis")});const fe=n.object({id:n.string().regex(/^[a-z0-9][a-z0-9-]*$/u),...D.shape});export const RUNTIME_POINT=definePoint({id:"runtimes",about:"Runtimes: a tool's pinned download (a program, a model), fetched when first needed, checked, cached.",entry:fe,key:e=>e.id}),SKILL_NAME=/^(?=.{1,64}$)[a-z0-9]+(-[a-z0-9]+)*$/u;const g=e=>e.replace(/^\.\//u,"").replace(/\/+$/u,""),ge=n.object({path:n.string().min(1)});export const SKILL_POINT=definePoint({id:"skills",about:"Skills for the agent: a folder laid out as an Agent Skill's, a skill of its own or files of the skill of its name.",entry:ge,check:e=>{const t=g(e.path);if(!w(t))return[`the skill folder ${e.path} is not a folder inside its package.`];const i=t.slice(t.lastIndexOf("/")+1);return SKILL_NAME.test(i)?[]:[`the skill folder ${e.path} is not named as a skill is (lower-case letters, digits and hyphens, at most 64).`]}});const P=n.record(n.string(),n.string()),be=n.union([n.object({name:n.string().regex(/^[a-z0-9][a-z0-9_-]*$/u),command:n.string().min(1),args:n.array(n.string()).default([]),env:P.default({}),cwd:n.string().min(1).optional()}),n.object({name:n.string().regex(/^[a-z0-9][a-z0-9_-]*$/u),url:n.url(),headers:P.default({})})]);export const MCP_SERVER_POINT=definePoint({id:"mcpServers",about:"MCP servers: a local program or an address that gives an agent tools, defined as .mcp.json defines one.",entry:be,key:e=>e.name,check:e=>"cwd"in e&&e.cwd!==void 0&&!w(g(e.cwd))?[`the MCP server ${e.name}'s cwd is not a folder inside its package.`]:[]}),CORE_POINTS=[COMMANDS,KEYBINDING_POINT,MENU_POINT,VIEW_CONTAINER_POINT,VIEW_POINT,CONFIGURATION_POINT,WINDOW_TOOL_POINT,CLI_COMMANDS,KIND_POINT,EDITOR_POINT,PREVIEW_RENDERER_POINT,RULE_POINT,FACT_POINT,BUILD_PLUGINS_POINT,PROJECT_TOOL_POINT,STAGE_ROUTE_POINT,INSPECT_VIEW_POINT,EXPORT_PROCESSOR_POINT,MEDIA_ANALYSIS_POINT,RUNTIME_POINT,SKILL_POINT,MCP_SERVER_POINT];export function kindTable(e,t=(d,u)=>u,i=[],o=[],s=[],r=()=>{}){const d=c=>{const a=i.filter(l=>l.extension===c).map(l=>t(c,l.entry.module));return a.length>0?a:void 0},u=c=>{const a=o.filter(l=>l.extension===c).map(({entry:l})=>({name:l.name,source:l.source,does:l.does,module:t(c,l.module),extension:c}));return a.length>0?a:void 0},m=c=>{const a=s.filter(l=>l.extension===c).map(({entry:l})=>({folder:l.folder,loads:l.loads.filter(N=>V(R,N)),module:t(c,l.module),extension:c}));return a.length>0?a:void 0};return e.map(({extension:c,entry:a})=>({id:a.id,editor:a.editor,noun:a.noun,part:a.part,...a.pages===!0?{pages:!0}:{},name:a.name,plural:a.plural,icon:a.icon,color:a.color,exports:a.exports&&{types:a.exports.types,extras:a.exports.extras,options:a.exports.options.map(l=>({name:l.name,only:l.only,...l.values===void 0?{}:{values:l.values}})),...Object.keys(a.exports.names).length===0?{}:{names:a.exports.names}},renders:a.renders&&{types:a.renders.types,defaults:a.renders.defaults},starter:a.starter&&{files:{...a.starter.files},entry:a.starter.entry},...a.shown===void 0?{}:{order:a.shown.order},...a.turnInto===!1?{turnInto:!1}:{},share:a.share,build:a.build===void 0?void 0:t(c,a.build),...a.config===void 0||a.config.length===0?{}:{config:a.config},...a.layers===!0?{layers:!0}:{},buildPlugins:d(c),projectTools:u(c),stageRoutes:m(c),points:r(c),extension:c}))}export const inspectViewTable=(e,t)=>e.map(({extension:i,entry:o})=>({name:o.name,summary:o.summary,module:t(i,o.module),extension:i})),cliCommandTable=(e,t)=>e.map(({extension:i,entry:o})=>({name:o.name,summary:o.summary,...o.work===void 0?{}:{work:o.work},module:t(i,o.module),extension:i})),processorTable=(e,t)=>e.map(({extension:i,entry:o})=>({id:o.id,types:o.types,module:t(i,o.module),extension:i})),analysisTable=(e,t)=>e.map(({extension:i,entry:o})=>({id:o.id,about:o.about,what:o.what,media:o.media,runtimes:o.runtimes,module:t(i,o.module),extension:i})),skillTable=(e,t)=>e.map(({extension:i,entry:o})=>{const s=g(o.path);return{name:s.slice(s.lastIndexOf("/")+1),folder:t(i,s),extension:i}});const j=(e,t)=>e.replaceAll("${PLUGIN_ROOT}",t);export const mcpServerTable=(e,t,i)=>e.map(({extension:o,entry:s})=>{if("url"in s)return{name:s.name,url:s.url,headers:{...s.headers},extension:o};const r=t(o);return{name:s.name,command:j(s.command,r),args:s.args.map(d=>j(d,r)),env:Object.fromEntries(Object.entries(s.env).map(([d,u])=>[d,j(u,r)])),cwd:s.cwd===void 0?r:i(o,g(s.cwd)),extension:o}});
2
+ import{CORE as _,declareRules as v,ruleOf as C}from"@allyhub/diagnostics";import{STAGE_LOADS as R}from"@allyhub/formats";import{LOCALES as A}from"@allyhub/i18n";import{PROJECT_TOOLS as L,StageFolderSchema as M,StageLoadSchema as W,known as V}from"@allyhub/protocol";import{RuntimeSchema as D}from"@allyhub/runtimes/schema";import{z as n}from"zod";import{KEY as K,MENUS as U,SETTING_TYPES as E,VIEW_CONTAINERS as p,inMenuBar as G,settingProblem as O,whenProblem as H}from"./shell.js";export const definePoint=e=>e,WordsSchema=n.record(n.string(),n.string().min(1));export function missingLocales(e){return A.filter(t=>!(t in e))}export const wordIn=(e,t)=>e[t]??e.en??Object.values(e)[0]??"";const h=n.string().regex(/^(@[a-z0-9][\w.-]*\/)?[a-z0-9][\w.-]*(\/[\w.-]+)*$/u);function b(e,t,i){if(typeof e!="object"||e===null||Array.isArray(e))return`is not an object of ${t}.`;const o=[];for(const[a,r]of Object.entries(e)){if(!Array.isArray(r))return`.${a} is not a list.`;r.forEach((d,u)=>{o.push([`.${a}[${String(u)}]`,typeof d=="object"&&d!==null?{...d,[i]:a}:d])})}return o}const w=n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),g=n.string().superRefine((e,t)=>{const i=H(e);i!==void 0&&t.addIssue({code:"custom",message:i})}),J=n.object({id:w,title:WordsSchema,enablement:g.optional(),place:n.enum(["workspace","ui"]).default("workspace")});export const COMMANDS=definePoint({id:"commands",about:"Commands a person runs from the palette, the menus and the keys.",entry:J,key:e=>e.id,activation:(e,t)=>e.place===t?[`onCommand:${e.id}`]:[],check:e=>{const t=missingLocales(e.title);return t.length>0?[`${e.id}'s title has no words in ${t.join(", ")}.`]:[]}});const B=n.object({command:w,key:n.string().regex(K,{message:"A key is modifiers among Mod, Shift and Alt, then a capital letter, a digit, a sign or a key's name (Mod+Shift+H)."}),when:g.optional()});export const KEYBINDING_POINT=definePoint({id:"keybindings",about:"Keys that run commands, each while its when clause holds.",entry:B});const F=n.object({menu:n.string().min(1),command:w,when:g.optional(),group:n.string().min(1).optional()});export const MENU_POINT=definePoint({id:"menus",about:`Commands in menus, by menu (${U.join(", ")}), each while its when clause holds.`,entry:F,entries:e=>b(e,"menus","menu"),check:e=>G(e.menu)?[`${e.command} is not placed in ${e.menu}: Studio's menu bar shows the core's entries alone yet.`]:[]});const x="Studio places no extension's view yet; its work card and its sidebar show the core's alone.",Y=n.object({location:n.string().min(1),id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),title:WordsSchema,icon:n.string().min(1).optional()});export const VIEW_CONTAINER_POINT=definePoint({id:"viewsContainers",about:`Containers of views, by where each goes; the shell gives its own (${p.join(", ")}) and takes none of an extension's yet.`,entry:Y,entries:e=>b(e,"places","location"),key:e=>e.id,check:e=>{const t=missingLocales(e.title);return[...t.length>0?[`${e.id}'s title has no words in ${t.join(", ")}.`]:[],`the container ${e.id} is not placed: ${x}`]}});const Z=n.object({container:n.string().min(1),id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),name:WordsSchema,when:g.optional(),icon:n.string().min(1).optional(),module:h.optional()});export const VIEW_POINT=definePoint({id:"views",about:`Views, by the container each is in (${p.join(", ")}): a page in a frame, as an editor is.`,entry:Z,entries:e=>b(e,"containers","container"),key:e=>e.id,check:e=>{const t=missingLocales(e.name);return[...p.includes(e.container)?[]:[`${e.container} is not a container: a view goes in ${p.join(" or ")}.`],...t.length>0?[`${e.id}'s name has no words in ${t.join(", ")}.`]:[],...e.module===void 0?[`${e.id} names no module: a view is a page's module, as an editor is.`]:[],`the view ${e.id} is not placed: ${x}`]}});const S=n.union([n.string(),n.boolean(),n.number()]),X=n.object({type:n.string().min(1),default:S.optional(),title:WordsSchema,description:WordsSchema.optional(),enum:n.array(S).min(1).optional(),enumItemLabels:n.array(WordsSchema).optional(),enumDescriptions:n.array(WordsSchema).optional(),minimum:n.number().optional(),maximum:n.number().optional(),minLength:n.number().int().min(0).optional(),order:n.number().int().optional()}),q=n.object({title:WordsSchema,order:n.number().int().optional(),properties:n.record(n.string(),X)});function Q(e,t){const i=[],o=(a,r)=>{const d=missingLocales(r);d.length>0&&i.push(`${e}'s ${a} has no words in ${d.join(", ")}.`)};return o("title",t.title),t.description!==void 0&&o("description",t.description),t.enumItemLabels?.forEach((a,r)=>{o(`label of choice ${String(r+1)}`,a)}),t.enumDescriptions?.forEach((a,r)=>{o(`description of choice ${String(r+1)}`,a)}),i}export const CONFIGURATION_POINT=definePoint({id:"configuration",about:"Settings: a title and JSON Schema properties by key, drawn as rows in the shell and read through allyhub.settings.",entry:q,entries:e=>Array.isArray(e)?e.map((t,i)=>[`[${String(i)}]`,t]):typeof e=="object"&&e!==null?[["",e]]:"is not a configuration or a list of them.",check:(e,t)=>{const i=[],o=missingLocales(e.title);o.length>0&&i.push(`a configuration's title has no words in ${o.join(", ")}.`);for(const[a,r]of Object.entries(e.properties)){if((!a.startsWith(`${t}.`)||a===`${t}.`)&&i.push(`${a} is not named by its extension: a setting's key is ${t}. and a name.`),i.push(...Q(a,r)),!E.includes(r.type)){i.push(`${a} is of type ${r.type}: a shell draws ${E.join(", ")}.`);continue}const d={...r,type:r.type};for(const[u,m]of(r.enum??[]).entries()){const l=O({type:d.type},m);l!==void 0&&i.push(`${a}'s choice ${String(u+1)}: ${l}`)}if(r.default!==void 0){const u=O(d,r.default);u!==void 0&&i.push(`${a}'s default: ${u}`)}for(const u of["enumItemLabels","enumDescriptions"]){const m=r[u];m!==void 0&&m.length!==(r.enum?.length??0)&&i.push(`${a}'s ${u} are ${String(m.length)}, and its choices ${String(r.enum?.length??0)}.`)}}return i}});const ee=n.object({name:n.string().regex(/^[a-z0-9][a-z0-9_-]*$/u),title:n.string().min(1),description:n.string().min(1),inputSchema:n.record(n.string(),n.unknown()),annotations:n.object({readOnlyHint:n.boolean(),destructiveHint:n.boolean(),idempotentHint:n.boolean(),openWorldHint:n.boolean()}).partial().optional()});export const WINDOW_TOOL_POINT=definePoint({id:"windowTools",about:"Tools an agent calls that act in the person's window, during its own turn: a name, a description, a JSON Schema of the input.",entry:ee,key:e=>e.name,check:e=>{const t=z(e.inputSchema);return[...t===void 0?[]:[`${e.name}'s inputSchema ${t}`],`the window tool ${e.name} is not given: Studio's MCP server gives the core's tools alone yet.`]}});const ne=n.object({name:n.string().regex(/^[a-z0-9][a-z0-9-]*( [a-z0-9][a-z0-9-]*){0,2}$/u),summary:n.string().min(1),work:n.string().min(1).optional(),module:n.string().min(1)});export const CLI_COMMANDS=definePoint({id:"cliCommands",about:"Commands the agent runs, `allyhub <name>`, listed in `allyhub help` before their module is loaded.",entry:ne,key:e=>e.name});const te=n.object({name:n.string().regex(/^[a-z0-9][a-z0-9.-]*\/[a-z][a-z0-9-]*$/u),source:n.enum(["project","asleep","machine"]),does:n.union([n.object({command:n.string().min(1)}),n.object({files:n.string().min(1)}),n.object({person:n.string().min(1)})]),module:n.string().min(1),readView:h.optional()});export const PROJECT_TOOL_POINT=definePoint({id:"projectTools",about:"Project tools: what an editor asks of a project through tools/call, each with the command or files that do the same for the agent.",entry:te,key:e=>e.name,check:(e,t)=>{if(Object.hasOwn(L,e.name))return[`${e.name} is the core's own project tool.`];const i=e.name.slice(0,e.name.lastIndexOf("/"));return T(t)||i===t?[]:[`the project tool ${e.name} does not start with its extension's id (${t}/…).`]}});const oe=n.object({folder:M,loads:n.array(W),module:n.string().min(1)});export const STAGE_ROUTE_POINT=definePoint({id:"stageRoutes",about:"Stage routes: a folder of the stage's tree an extension answers, what the stage's pages load from it, and what a snapshot records of it.",entry:oe,key:e=>e.folder});const ie=n.object({name:n.string().min(1),only:n.array(n.string().min(1)).min(1),values:n.array(n.string().min(1)).optional()}),se=n.object({files:n.record(n.string().min(1),n.string()),entry:n.string().min(1)}),y=e=>!e.startsWith("/")&&!e.includes("\\")&&e.split("/").every(t=>t!==""&&t!=="."&&t!==".."),ae=n.object({id:n.string().regex(/^[a-z][a-z0-9-]*$/u),name:WordsSchema,plural:WordsSchema.optional(),noun:n.string().min(1),part:n.object({noun:n.string().min(1),plural:n.string().min(1)}).optional(),pages:n.boolean().optional(),editor:n.string().min(1).optional(),shown:n.object({line:WordsSchema,order:n.number()}).optional(),icon:n.string().min(1).optional(),color:n.string().min(1).optional(),exports:n.object({types:n.array(n.string().min(1)).min(1),extras:n.array(n.string().min(1)).default([]),options:n.array(ie).default([]),names:n.record(n.string().min(1),WordsSchema).default({})}).optional(),renders:n.object({types:n.array(n.string().min(1)).min(1),defaults:n.array(n.string().min(1)).min(1)}).optional(),starter:se.optional(),share:n.boolean().optional(),network:n.boolean().optional(),build:n.string().min(1).optional(),migrations:n.strictObject({format:n.int().min(1),module:n.string().min(1)}).optional(),config:n.array(n.string().min(1)).optional(),layers:n.boolean().optional()});export const KIND_POINT=definePoint({id:"kinds",about:"Kinds of item: their names, their editor, their icon and colour, what they export and render, what a new one starts as, whether one is shared alone.",entry:ae,key:e=>e.id,activation:(e,t)=>t==="workspace"?[`onKind:${e.id}`]:[],check:e=>{const t=[],i=missingLocales(e.name);i.length>0&&t.push(`${e.id}'s name has no words in ${i.join(", ")}.`);const o=e.plural&&missingLocales(e.plural);o&&o.length>0&&t.push(`${e.id}'s plural has no words in ${o.join(", ")}.`);for(const[r,d]of Object.entries(e.exports?.names??{})){const u=missingLocales(d);u.length>0&&t.push(`${e.id}'s name for its export ${r} has no words in ${u.join(", ")}.`)}const a=Object.keys(e.starter?.files??{});for(const r of a.filter(d=>!y(d)))t.push(`${e.id}'s starter file ${r} is not inside the new item's folder.`);return e.starter&&!a.includes(e.starter.entry)&&t.push(`${e.id}'s starter's entry ${e.starter.entry} is none of its files.`),t}});const I=n.union([n.string().min(1),n.array(n.string().min(1)).min(1)]),re=n.object({id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),markup:I.optional(),kinds:n.array(n.string().min(1)).default([]),files:n.array(n.string().min(1)).default([]),noun:n.string().min(1).optional(),name:WordsSchema.optional(),plural:WordsSchema.optional(),icon:n.string().min(1).optional(),color:n.string().min(1).optional(),check:n.string().min(1).optional(),priority:n.enum(["default","option"]).default("default"),share:n.boolean().optional(),page:n.boolean().optional(),module:h.optional(),place:n.record(n.string(),n.unknown()).optional()});function z(e){if(e.type!=="object")return'is not of "type": "object".';try{n.fromJSONSchema(e)}catch(t){return`is not a JSON Schema zod reads: ${t instanceof Error?t.message:String(t)}.`}}export const EDITOR_POINT=definePoint({id:"editors",about:"Editors: the kinds each opens, or the files it opens by their names (glob patterns, with their name, sign and check), whether it is their default, the module a page imports for it, and the schema of where a person is in what it opens.",entry:re,key:e=>e.id,activation:(e,t)=>t==="ui"?[`onEditor:${e.id}`]:[],check:e=>{const t=[],i=e.place&&z(e.place);if(i!==void 0&&t.push(`${e.id}'s place ${i}`),e.kinds.length===0&&e.files.length===0&&t.push(`${e.id} opens no kind and no files.`),e.kinds.length>0&&e.files.length>0&&t.push(`${e.id} opens kinds and files: an editor opens one or the other.`),e.files.length>0){e.noun===void 0&&t.push(`${e.id} opens files and has no noun for them.`),e.name===void 0&&t.push(`${e.id} opens files and has no name for them.`);for(const[o,a]of[["name",e.name],["plural",e.plural]]){const r=a===void 0?[]:missingLocales(a);r.length>0&&t.push(`${e.id}'s ${o} has no words in ${r.join(", ")}.`)}for(const o of e.files)(o.startsWith("/")||o.split("/").includes(".."))&&t.push(`${e.id}'s pattern ${o} is not of project paths (no leading /, no ..).`)}else e.check!==void 0&&t.push(`${e.id} has a check and opens no files: a kind's items are checked by its build.`);return t}});export function fileEditorTable(e,t=(i,o)=>o){return e.flatMap(({extension:i,entry:o})=>o.files.length===0||o.name===void 0||o.noun===void 0?[]:[{id:o.id,files:[...o.files],noun:o.noun,name:{...o.name},...o.plural===void 0?{}:{plural:{...o.plural}},...o.icon===void 0?{}:{icon:o.icon},...o.color===void 0?{}:{color:o.color},...o.priority==="option"?{priority:o.priority}:{},...o.share===!0?{share:!0}:{},...o.page===!0?{page:!0}:{},...o.check===void 0?{}:{check:t(i,o.check)},extension:i}])}const de=n.object({id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),markup:I.optional(),types:n.array(n.string().regex(/^[a-z]+\/(?:\*|[\w.+-]+)$/u)).min(1),module:h});export const PREVIEW_RENDERER_POINT=definePoint({id:"previewRenderers",about:"Preview renderers: how a file of a media type is drawn wherever one is shown (a canvas's node); each its media types and the module a page imports for it.",entry:de,key:e=>e.id});const T=e=>e.startsWith("allyhub.");function $(e,t,i){return T(e)||t.startsWith(`${e}/`)?[]:[`the ${i} ${t} does not start with its extension's id (${e}/…).`]}const le=n.object({code:n.string().regex(/^(AK-[A-Z]\d{3}|[a-z0-9][a-z0-9-]*\.[a-z0-9][a-z0-9-]*\/[A-Za-z0-9][\w.-]*)$/u),level:n.enum(["error","warn"]),rule:n.string().min(1)});export const RULE_POINT=definePoint({id:"rules",about:"Rules: the codes an extension reports problems under, each with its level and what it says.",entry:le,key:e=>e.code,check:(e,t)=>{const i=C(e.code);return[...$(t,e.code,"rule"),...i&&i.extension!==t?[`${e.code} is ${i.extension===_?"the core's":`${i.extension}'s`} rule already.`]:[]]},added:(e,t)=>v(t,[e])});const ce=n.object({kind:n.string().regex(/^([a-z][a-z0-9-]*|[a-z0-9][a-z0-9-]*\.[a-z0-9][a-z0-9-]*\/[a-z][a-z0-9-]*)$/u),about:n.string().min(1)});export const FACT_POINT=definePoint({id:"facts",about:"Kinds of fact: what an extension measures for the agent to judge, each with what it says.",entry:ce,key:e=>e.kind,check:(e,t)=>$(t,e.kind,"kind of fact")});const ue=n.object({module:n.string().min(1)});export const BUILD_PLUGINS_POINT=definePoint({id:"buildPlugins",about:"Build plugins: a module whose Vite plugins and lent packages every stage bundle of a project takes.",entry:ue});const k=n.string().min(1),me=n.object({name:n.string().regex(/^[a-z][a-z0-9-]*$/u),summary:n.string().min(1),module:k});export const INSPECT_VIEW_POINT=definePoint({id:"inspectViews",about:"Views of `allyhub inspect <name>`: a measurement now, listed in `allyhub help` before its module is loaded.",entry:me,key:e=>e.name});const pe=n.object({id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),types:n.array(n.string().min(1)).min(1),module:k});export const EXPORT_PROCESSOR_POINT=definePoint({id:"exportProcessors",about:"Export processors: a step run on every file of the types it names that an export makes.",entry:pe,key:e=>e.id,check:(e,t)=>e.id.startsWith(`${t}.`)?[]:[`the processor ${e.id} does not start with its extension's id (${t}.…).`]});const he=n.object({id:n.string().regex(/^([a-z][a-z0-9-]*|[a-z0-9][a-z0-9-]*\.[a-z0-9][a-z0-9-]*\/[a-z][a-z0-9-]*)$/u),about:n.string().min(1),what:n.string().min(1),media:n.array(n.enum(["image","audio","video"])).min(1),runtimes:n.array(n.string().regex(/^[a-z0-9][a-z0-9-]*$/u)).default([]),module:k});export const MEDIA_ANALYSIS_POINT=definePoint({id:"mediaAnalyses",about:"Media analyses: what the media index measures of a file once, by its content, when a version needs it.",entry:he,key:e=>e.id,check:(e,t)=>$(t,e.id,"media analysis")});const ge=n.object({id:n.string().regex(/^[a-z0-9][a-z0-9-]*$/u),...D.shape});export const RUNTIME_POINT=definePoint({id:"runtimes",about:"Runtimes: a tool's pinned download (a program, a model), fetched when first needed, checked, cached.",entry:ge,key:e=>e.id}),SKILL_NAME=/^(?=.{1,64}$)[a-z0-9]+(-[a-z0-9]+)*$/u;const f=e=>e.replace(/^\.\//u,"").replace(/\/+$/u,""),fe=n.object({path:n.string().min(1)});export const SKILL_POINT=definePoint({id:"skills",about:"Skills for the agent: a folder laid out as an Agent Skill's, a skill of its own or files of the skill of its name.",entry:fe,check:e=>{const t=f(e.path);if(!y(t))return[`the skill folder ${e.path} is not a folder inside its package.`];const i=t.slice(t.lastIndexOf("/")+1);return SKILL_NAME.test(i)?[]:[`the skill folder ${e.path} is not named as a skill is (lower-case letters, digits and hyphens, at most 64).`]}});const P=n.record(n.string(),n.string()),be=n.union([n.object({name:n.string().regex(/^[a-z0-9][a-z0-9_-]*$/u),command:n.string().min(1),args:n.array(n.string()).default([]),env:P.default({}),cwd:n.string().min(1).optional()}),n.object({name:n.string().regex(/^[a-z0-9][a-z0-9_-]*$/u),url:n.url(),headers:P.default({})})]);export const MCP_SERVER_POINT=definePoint({id:"mcpServers",about:"MCP servers: a local program or an address that gives an agent tools, defined as .mcp.json defines one.",entry:be,key:e=>e.name,check:e=>"cwd"in e&&e.cwd!==void 0&&!y(f(e.cwd))?[`the MCP server ${e.name}'s cwd is not a folder inside its package.`]:[]}),CORE_POINTS=[COMMANDS,KEYBINDING_POINT,MENU_POINT,VIEW_CONTAINER_POINT,VIEW_POINT,CONFIGURATION_POINT,WINDOW_TOOL_POINT,CLI_COMMANDS,KIND_POINT,EDITOR_POINT,PREVIEW_RENDERER_POINT,RULE_POINT,FACT_POINT,BUILD_PLUGINS_POINT,PROJECT_TOOL_POINT,STAGE_ROUTE_POINT,INSPECT_VIEW_POINT,EXPORT_PROCESSOR_POINT,MEDIA_ANALYSIS_POINT,RUNTIME_POINT,SKILL_POINT,MCP_SERVER_POINT];export function kindTable(e,t=(d,u)=>u,i=[],o=[],a=[],r=()=>{}){const d=l=>{const s=i.filter(c=>c.extension===l).map(c=>t(l,c.entry.module));return s.length>0?s:void 0},u=l=>{const s=o.filter(c=>c.extension===l).map(({entry:c})=>({name:c.name,source:c.source,does:c.does,module:t(l,c.module),extension:l}));return s.length>0?s:void 0},m=l=>{const s=a.filter(c=>c.extension===l).map(({entry:c})=>({folder:c.folder,loads:c.loads.filter(N=>V(R,N)),module:t(l,c.module),extension:l}));return s.length>0?s:void 0};return e.map(({extension:l,entry:s})=>({id:s.id,editor:s.editor,noun:s.noun,part:s.part,...s.pages===!0?{pages:!0}:{},name:s.name,plural:s.plural,icon:s.icon,color:s.color,exports:s.exports&&{types:s.exports.types,extras:s.exports.extras,options:s.exports.options.map(c=>({name:c.name,only:c.only,...c.values===void 0?{}:{values:c.values}})),...Object.keys(s.exports.names).length===0?{}:{names:s.exports.names}},renders:s.renders&&{types:s.renders.types,defaults:s.renders.defaults},starter:s.starter&&{files:{...s.starter.files},entry:s.starter.entry},...s.shown===void 0?{}:{order:s.shown.order},share:s.share,...s.network===!0?{network:!0}:{},build:s.build===void 0?void 0:t(l,s.build),...s.migrations===void 0?{}:{migrations:{format:s.migrations.format,module:t(l,s.migrations.module)}},...s.config===void 0||s.config.length===0?{}:{config:s.config},...s.layers===!0?{layers:!0}:{},buildPlugins:d(l),projectTools:u(l),stageRoutes:m(l),points:r(l),extension:l}))}export const inspectViewTable=(e,t)=>e.map(({extension:i,entry:o})=>({name:o.name,summary:o.summary,module:t(i,o.module),extension:i})),cliCommandTable=(e,t)=>e.map(({extension:i,entry:o})=>({name:o.name,summary:o.summary,...o.work===void 0?{}:{work:o.work},module:t(i,o.module),extension:i})),processorTable=(e,t)=>e.map(({extension:i,entry:o})=>({id:o.id,types:o.types,module:t(i,o.module),extension:i})),analysisTable=(e,t)=>e.map(({extension:i,entry:o})=>({id:o.id,about:o.about,what:o.what,media:o.media,runtimes:o.runtimes,module:t(i,o.module),extension:i})),skillTable=(e,t)=>e.map(({extension:i,entry:o})=>{const a=f(o.path);return{name:a.slice(a.lastIndexOf("/")+1),folder:t(i,a),extension:i}});const j=(e,t)=>e.replaceAll("${PLUGIN_ROOT}",t);export const mcpServerTable=(e,t,i)=>e.map(({extension:o,entry:a})=>{if("url"in a)return{name:a.name,url:a.url,headers:{...a.headers},extension:o};const r=t(o);return{name:a.name,command:j(a.command,r),args:a.args.map(d=>j(d,r)),env:Object.fromEntries(Object.entries(a.env).map(([d,u])=>[d,j(u,r)])),cwd:a.cwd===void 0?r:i(o,f(a.cwd)),extension:o}});
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/extension-host",
3
- "version": "0.19.0",
3
+ "version": "0.21.0",
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
+ export const FLOW_KIND_ALIASES={alluvial:"sankey",alluvial_diagram:"sankey",sankey_diagram:"sankey",sankey_chart:"sankey",flows:"sankey",flow_diagram:"sankey",roadmap:"gantt",gantt_chart:"gantt",timeline_gantt:"gantt",gantt_timeline:"gantt",project_plan:"gantt"},SANKEY_MARKS=["links","flows","edges","nodes","source","target","from","to"],LINK={fields:[{name:"source",type:"string",aliases:["from","origin","src","parent"],required:!0},{name:"target",type:"string",aliases:["to","destination","dest","dst","child"],required:!0},{name:"value",type:"number",aliases:["amount","weight","flow","count","size","volume","qty","quantity","total"],required:!0},{name:"color",type:"color",aliases:["colour"]}]},SANKEY={fields:[{name:"nodes",type:"nodes",aliases:["node"]},{name:"format",type:"string",aliases:["number_format"]},{name:"values",type:"bool",aliases:["show_values","data_labels","labels"]},{name:"align",type:{oneOf:{justify:"justify",justified:"justify",left:"left",start:"left",right:"right",end:"right",center:"center",centre:"center"}},aliases:["node_align","alignment"]},{name:"alt",type:"words"}],item:"link",list:!0},TASK={fields:[{name:"name",type:"words",aliases:["title","task","label","activity","item","text"],required:!0},{name:"id",type:"string",aliases:["key","code","wbs"]},{name:"start",type:"string",aliases:["begin","from","start_date","starts","date"]},{name:"end",type:"string",aliases:["finish","to","due","end_date","ends","until","deadline"]},{name:"duration",type:"string",aliases:["days","length"]},{name:"group",type:"words",aliases:["lane","phase","stream","workstream","section","category","team","swimlane","track","epic"]},{name:"progress",type:"string",aliases:["complete","percent","percent_complete","completion","done"]},{name:"milestone",type:"bool",aliases:["is_milestone"]},{name:"depends",type:"names",aliases:["dependencies","depends_on","after","predecessors","needs"]},{name:"status",type:"tone",aliases:["tone","rag","health"]},{name:"color",type:"color",aliases:["colour"]}]},GANTT={fields:[{name:"today",type:"string",aliases:["now","as_of","status_date"]},{name:"scale",type:{oneOf:{day:"day",days:"day",daily:"day",week:"week",weeks:"week",weekly:"week",month:"month",months:"month",monthly:"month",quarter:"quarter",quarters:"quarter",quarterly:"quarter",year:"year",years:"year",yearly:"year"}},aliases:["unit","zoom","interval","period"]},{name:"alt",type:"words"}],item:"task",list:!0},FLOW_ITEM_ALIASES=["links","flows","edges","tasks","activities"];
@@ -0,0 +1,146 @@
1
+ import { z } from "zod";
2
+ import { type ChartFile, type ChartLegendPosition } from "./slides.js";
3
+ /** The kinds of block, in the design's order. */
4
+ export declare const BLOCK_KINDS: readonly ["chart", "table", "stats", "stat", "card", "tag", "callout", "icon", "progress", "timeline", "steps", "person", "people", "risk_matrix", "sankey", "gantt", "org_chart", "issue_tree", "decision_tree", "fishbone", "matrix", "marimekko", "heatmap", "small_multiples"];
5
+ export type BlockKind = (typeof BLOCK_KINDS)[number];
6
+ /** The kinds of a list's items. */
7
+ export type BlockItemKind = "stat" | "person" | "milestone" | "step" | "entry" | "link" | "task";
8
+ /** A name as it is compared: lower case, `-` and camelCase as `_`. */
9
+ export declare function fieldKey(name: string): string;
10
+ /** A block's kind by its name or an alias (`kpi`, `badge`, `alert`, `gauge`); undefined for none. */
11
+ export declare function blockKindOf(name: string): BlockKind | undefined;
12
+ /** Every name a kind is read by, canonical first. */
13
+ export declare function blockKindNames(kind: BlockKind): string[];
14
+ /**
15
+ * Whether a value names data rather than saying a figure (§7): a path from
16
+ * the file's folder with a part, or a data file; in a sheet, a formula's
17
+ * place (`=Summary!B4`, `=B2:B13`), a table's column (`kpis[conversion]`)
18
+ * or a sheet's cell (`Summary!B4`).
19
+ */
20
+ export declare function isBlockReference(v: unknown): v is string;
21
+ /**
22
+ * Whether a value names a project file's data by its path from the file's
23
+ * folder: `./`, `../` or `/` first with a part (`../budget/budget#orders`)
24
+ * or a data file (`../data/sales.csv`); or, without them, a path that is
25
+ * plainly a file's: a data file's extension (`nvidia-data.yaml#revenue`,
26
+ * `sales.csv`) or a folder and a part (`data/kpis#arr`). Words with a `#`
27
+ * and neither (`Q3#2`) stay words.
28
+ */
29
+ export declare function isPathReference(v: unknown): v is string;
30
+ /** A figure: words as read, a number, or a reference. */
31
+ export type Figure = string | number;
32
+ /** Numbers oldest first, or a reference to a column. */
33
+ export type Series = number[] | string;
34
+ /** A tone, or a reference to a cell holding one. */
35
+ export type ToneField = string;
36
+ type FieldType = "words" | "figure" | "series" | "tone" | "tone-ref" | "callout-tone" | "bool" | "number" | "string" | "color" | "tag" | "lines" | "labels" | "nodes" | "names" | {
37
+ oneOf: Readonly<Record<string, string>>;
38
+ };
39
+ interface FieldSpec {
40
+ name: string;
41
+ type: FieldType;
42
+ aliases?: readonly string[];
43
+ required?: boolean;
44
+ }
45
+ interface KindSpec {
46
+ fields: readonly FieldSpec[];
47
+ /** A list's items' kind: read from `items`, a bare list, or `data` with a column per field. */
48
+ item?: BlockItemKind;
49
+ /** Whether a bare list is the block's items. */
50
+ list?: boolean;
51
+ }
52
+ /** A kind's spec, as blocks-flow.ts writes the Sankey's and the Gantt's. */
53
+ export type BlockKindSpec = KindSpec;
54
+ /** The field names of a block's kind (or a list's item's), canonical, in order. */
55
+ export declare function blockFieldNames(kind: BlockKind | BlockItemKind): string[];
56
+ /** A field of a block as an editor shows it: its kind of value, and the canonical values it is one of. */
57
+ export interface BlockFieldInfo {
58
+ name: string;
59
+ type: Exclude<FieldType, {
60
+ oneOf: Readonly<Record<string, string>>;
61
+ }> | "choice";
62
+ /** A tone's or a choice's canonical values, in order. */
63
+ choices?: readonly string[];
64
+ }
65
+ /** The fields of a kind (or a list's item's) as an editor shows them, in order; none for a chart, a table or a diagram. */
66
+ export declare function blockFieldInfo(kind: BlockKind | BlockItemKind): BlockFieldInfo[];
67
+ /** The fields of a kind (or an item's) that are words: a deck's script may give them (§3.3). */
68
+ export declare function blockWordFields(kind: BlockKind | BlockItemKind): string[];
69
+ /** A problem with a block as written: where, and what. */
70
+ export interface BlockProblem {
71
+ path: (string | number)[];
72
+ message: string;
73
+ }
74
+ /** What reading a block takes: whether its words may come from elsewhere (a deck's script), so a missing one is not a problem. */
75
+ export interface BlockReadOptions {
76
+ wordsElsewhere?: boolean;
77
+ }
78
+ type Fields = Record<string, unknown>;
79
+ /** A block read: its kind and its fields by their canonical names. */
80
+ export interface BlockFile {
81
+ kind: BlockKind;
82
+ fields: Fields;
83
+ }
84
+ /** Whether a colour is one a block can draw: a role, a tone, a named colour, #RRGGBB, or a deck's colour. */
85
+ export declare function isBlockColor(s: string): boolean;
86
+ /** A table's column as read: its name and how its cells look. */
87
+ export interface BlockColumn {
88
+ name: string;
89
+ title?: string;
90
+ align?: "left" | "center" | "right";
91
+ format?: string;
92
+ width?: number | string;
93
+ tag?: boolean;
94
+ /** Its values are people: each drawn after a circle of their initials. */
95
+ avatar?: boolean;
96
+ }
97
+ /** A chart's type by an alias: `column`, `stacked-column`, `column_stacked`, `donut` (§4.1). */
98
+ export declare function chartTypeOf(name: string): string;
99
+ /** A chart axis as a block writes it: the slides file's, with its title. */
100
+ export type ChartBlockAxis = NonNullable<ChartFile["value_axis"]> & {
101
+ title?: string;
102
+ };
103
+ export type ChartBlockFile = Omit<ChartFile, "legend" | "value_axis" | "category_axis" | "secondary_axis"> & {
104
+ /** Where its legend is; `none` for none; absent: beside a pie, over more than one series. */
105
+ legend?: ChartLegendPosition | "none";
106
+ title?: string;
107
+ value_axis?: ChartBlockAxis;
108
+ category_axis?: ChartBlockAxis;
109
+ secondary_axis?: ChartBlockAxis;
110
+ /** Words on single points: by category on the first series, or by a series' name and category. */
111
+ points?: Record<string, string | Record<string, string>>;
112
+ alt?: string;
113
+ };
114
+ /**
115
+ * A block as a file writes it, read: `{ stat: { … } }` (its kind by name
116
+ * or alias, its fields), or its kind and fields apart. Every problem is
117
+ * said, its path from the block.
118
+ */
119
+ export declare function readBlock(kindName: string, raw: unknown, o?: BlockReadOptions): {
120
+ block?: BlockFile;
121
+ problems: BlockProblem[];
122
+ };
123
+ /**
124
+ * A block written as its kind holding its fields (`{ stat: { … } }`),
125
+ * with what is beside it (a frame, an anchor) left to the kind; undefined
126
+ * where no key of it is a block's kind.
127
+ */
128
+ export declare function blockKeyOf(o: Record<string, unknown>): string | undefined;
129
+ /** One item of a list block (a stat of stats, a milestone, a step, a person) read from its fields, as a row of data gives them. */
130
+ export declare function readBlockItem(kind: BlockItemKind, raw: unknown, o?: BlockReadOptions): {
131
+ fields?: Record<string, unknown>;
132
+ problems: BlockProblem[];
133
+ };
134
+ /** The kind of a list block's items. */
135
+ export declare function blockItemKind(kind: BlockKind): BlockItemKind | undefined;
136
+ /** The blocks a deck's shape names by a field of their kind (its chart and table are PowerPoint's own). */
137
+ export declare const DECK_BLOCK_KINDS: readonly ["stat", "stats", "card", "tag", "callout", "icon", "progress", "timeline", "steps", "person", "people", "risk_matrix", "sankey", "gantt", "org_chart", "issue_tree", "decision_tree", "fishbone", "matrix", "marimekko", "heatmap", "small_multiples"];
138
+ export type DeckBlockKind = (typeof DECK_BLOCK_KINDS)[number];
139
+ /**
140
+ * A block as a field of a file that is checked by schema (a deck's
141
+ * shape): any value, its problems said by readBlock at their paths. Its
142
+ * words may be the script's.
143
+ */
144
+ export declare function blockFieldSchema(kind: BlockKind): z.ZodType;
145
+ export {};
146
+ //# sourceMappingURL=blocks.d.ts.map