allyhub 0.9.0 → 0.11.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 (582) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/commands/auth.js +4 -4
  3. package/dist/commands/cloud-tools.js +11 -11
  4. package/dist/commands/dev.js +2 -2
  5. package/dist/commands/frames/compare.js +2 -2
  6. package/dist/commands/frames/piece.js +1 -1
  7. package/dist/commands/frames/report.js +2 -0
  8. package/dist/commands/frames.js +11 -9
  9. package/dist/commands/index.js +1 -1
  10. package/dist/commands/inspect/common.js +4 -2
  11. package/dist/commands/inspect/facts.js +3 -3
  12. package/dist/commands/inspect/layout.js +1 -1
  13. package/dist/commands/orgs.js +2 -2
  14. package/dist/commands/render.js +2 -2
  15. package/dist/help.js +4 -4
  16. package/dist/main.js +8 -7
  17. package/dist/node_modules/@allyhub/3d-extension/dist/stage-routes.js +1 -1
  18. package/dist/node_modules/@allyhub/3d-extension/package.json +34 -2
  19. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  20. package/dist/node_modules/@allyhub/browser/dist/emoji.d.ts +29 -0
  21. package/dist/node_modules/@allyhub/browser/dist/emoji.js +57 -0
  22. package/dist/node_modules/@allyhub/browser/dist/picture.d.ts +18 -0
  23. package/dist/node_modules/@allyhub/browser/dist/picture.js +2 -0
  24. package/dist/node_modules/@allyhub/browser/package.json +9 -1
  25. package/dist/node_modules/@allyhub/build/dist/index.d.ts +1 -0
  26. package/dist/node_modules/@allyhub/build/dist/index.js +1 -1
  27. package/dist/node_modules/@allyhub/build/dist/kind-build.d.ts +7 -0
  28. package/dist/node_modules/@allyhub/build/dist/made-notes.d.ts +9 -0
  29. package/dist/node_modules/@allyhub/build/dist/made-notes.js +2 -0
  30. package/dist/node_modules/@allyhub/build/dist/project-tool.d.ts +17 -0
  31. package/dist/node_modules/@allyhub/build/dist/stage-route.d.ts +7 -0
  32. package/dist/node_modules/@allyhub/build/package.json +1 -1
  33. package/dist/node_modules/@allyhub/canvas-extension/package.json +2 -1
  34. package/dist/node_modules/@allyhub/canvas-extension/skills/allyhub/references/canvas.md +4 -24
  35. package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
  36. package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +2 -2
  37. package/dist/node_modules/@allyhub/chart/dist/chart.js +1 -1
  38. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  39. package/dist/node_modules/@allyhub/check/package.json +1 -1
  40. package/dist/node_modules/@allyhub/cloud/dist/client.d.ts +10 -0
  41. package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
  42. package/dist/node_modules/@allyhub/cloud/dist/config.d.ts +9 -0
  43. package/dist/node_modules/@allyhub/cloud/dist/config.js +1 -1
  44. package/dist/node_modules/@allyhub/cloud/dist/credentials.d.ts +4 -4
  45. package/dist/node_modules/@allyhub/cloud/dist/credentials.js +2 -2
  46. package/dist/node_modules/@allyhub/cloud/dist/device.d.ts +12 -0
  47. package/dist/node_modules/@allyhub/cloud/dist/device.js +2 -0
  48. package/dist/node_modules/@allyhub/cloud/package.json +1 -1
  49. package/dist/node_modules/@allyhub/components/package.json +1 -1
  50. package/dist/node_modules/@allyhub/components/r/callout.json +1 -1
  51. package/dist/node_modules/@allyhub/components/src/callout.ts +98 -13
  52. package/dist/node_modules/@allyhub/dev-server/dist/exports.js +1 -1
  53. package/dist/node_modules/@allyhub/dev-server/dist/index.js +1 -1
  54. package/dist/node_modules/@allyhub/dev-server/dist/inputs.js +2 -0
  55. package/dist/node_modules/@allyhub/dev-server/dist/live.js +1 -1
  56. package/dist/node_modules/@allyhub/dev-server/dist/pages.js +2 -0
  57. package/dist/node_modules/@allyhub/dev-server/dist/ports.js +2 -0
  58. package/dist/node_modules/@allyhub/dev-server/dist/project.js +1 -1
  59. package/dist/node_modules/@allyhub/dev-server/dist/record.js +1 -1
  60. package/dist/node_modules/@allyhub/dev-server/dist/respond.js +2 -0
  61. package/dist/node_modules/@allyhub/dev-server/dist/reveal.js +1 -1
  62. package/dist/node_modules/@allyhub/dev-server/dist/routes.js +1 -1
  63. package/dist/node_modules/@allyhub/dev-server/dist/server.js +2 -2
  64. package/dist/node_modules/@allyhub/dev-server/dist/tools.js +1 -1
  65. package/dist/node_modules/@allyhub/dev-server/dist/watcher.js +1 -1
  66. package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
  67. package/dist/node_modules/@allyhub/diagnostics/dist/problem.d.ts +7 -0
  68. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  69. package/dist/node_modules/@allyhub/doc/dist/captions.js +1 -1
  70. package/dist/node_modules/@allyhub/doc/dist/docx.js +4 -4
  71. package/dist/node_modules/@allyhub/doc/dist/html.js +51 -92
  72. package/dist/node_modules/@allyhub/doc/dist/model.js +1 -1
  73. package/dist/node_modules/@allyhub/doc/dist/page.js +1 -1
  74. package/dist/node_modules/@allyhub/doc/dist/paper.js +1 -1
  75. package/dist/node_modules/@allyhub/doc/dist/table.js +1 -1
  76. package/dist/node_modules/@allyhub/doc/dist/write.js +22 -22
  77. package/dist/node_modules/@allyhub/doc/package.json +1 -1
  78. package/dist/node_modules/@allyhub/doc-extension/dist/export.js +1 -1
  79. package/dist/node_modules/@allyhub/doc-extension/package.json +19 -6
  80. package/dist/node_modules/@allyhub/doc-print/dist/pages.js +5 -5
  81. package/dist/node_modules/@allyhub/doc-print/dist/print.js +10 -10
  82. package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
  83. package/dist/node_modules/@allyhub/export/dist/export.js +1 -1
  84. package/dist/node_modules/@allyhub/export/package.json +1 -1
  85. package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
  86. package/dist/node_modules/@allyhub/extension-host/dist/points.js +1 -1
  87. package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
  88. package/dist/node_modules/@allyhub/formats/dist/data/faces.d.ts +1 -1
  89. package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +87 -1
  90. package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
  91. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +89 -0
  92. package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
  93. package/dist/node_modules/@allyhub/formats/dist/note-shape.d.ts +20 -0
  94. package/dist/node_modules/@allyhub/formats/dist/note-shape.js +1 -1
  95. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +50 -0
  96. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  97. package/dist/node_modules/@allyhub/i18n/package.json +1 -1
  98. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  99. package/dist/node_modules/@allyhub/image-extension/dist/export.js +4 -1
  100. package/dist/node_modules/@allyhub/image-extension/package.json +16 -6
  101. package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +7 -39
  102. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  103. package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
  104. package/dist/node_modules/@allyhub/image-render/package.json +1 -1
  105. package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
  106. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  107. package/dist/node_modules/@allyhub/jobs/package.json +1 -1
  108. package/dist/node_modules/@allyhub/linkedin-extension/LICENSE +241 -0
  109. package/dist/node_modules/@allyhub/linkedin-extension/dist/article-build.js +2 -0
  110. package/dist/node_modules/@allyhub/linkedin-extension/dist/article-kind.js +2 -0
  111. package/dist/node_modules/@allyhub/linkedin-extension/dist/build-plugins.js +2 -0
  112. package/dist/node_modules/@allyhub/linkedin-extension/dist/build.js +5 -0
  113. package/dist/node_modules/@allyhub/linkedin-extension/dist/media.js +2 -0
  114. package/dist/node_modules/@allyhub/linkedin-extension/dist/stage-module.js +82 -0
  115. package/dist/node_modules/@allyhub/linkedin-extension/dist/stage.js +2 -0
  116. package/dist/node_modules/@allyhub/linkedin-extension/dist/workspace.js +2 -0
  117. package/dist/node_modules/@allyhub/linkedin-extension/package.json +287 -0
  118. package/dist/node_modules/@allyhub/linkedin-extension/skills/allyhub/references/linkedin.md +12 -0
  119. package/dist/node_modules/@allyhub/linkedin-model/LICENSE +241 -0
  120. package/dist/node_modules/@allyhub/linkedin-model/dist/article-check.js +5 -0
  121. package/dist/node_modules/@allyhub/linkedin-model/dist/article.js +3 -0
  122. package/dist/node_modules/@allyhub/linkedin-model/dist/check.js +2 -0
  123. package/dist/node_modules/@allyhub/linkedin-model/dist/count.js +3 -0
  124. package/dist/node_modules/@allyhub/linkedin-model/dist/edit.js +3 -0
  125. package/dist/node_modules/@allyhub/linkedin-model/dist/html.js +19 -0
  126. package/dist/node_modules/@allyhub/linkedin-model/dist/index.js +2 -0
  127. package/dist/node_modules/@allyhub/linkedin-model/dist/limits.js +2 -0
  128. package/dist/node_modules/@allyhub/linkedin-model/dist/little.js +2 -0
  129. package/dist/node_modules/@allyhub/linkedin-model/dist/post.js +2 -0
  130. package/dist/node_modules/@allyhub/linkedin-model/dist/requests.js +2 -0
  131. package/dist/node_modules/@allyhub/linkedin-model/package.json +14 -0
  132. package/dist/node_modules/@allyhub/linkedin-view/LICENSE +241 -0
  133. package/dist/node_modules/@allyhub/linkedin-view/dist/article.js +2 -0
  134. package/dist/node_modules/@allyhub/linkedin-view/dist/fold.js +3 -0
  135. package/dist/node_modules/@allyhub/linkedin-view/dist/index.js +2 -0
  136. package/dist/node_modules/@allyhub/linkedin-view/dist/post.js +2 -0
  137. package/dist/node_modules/@allyhub/linkedin-view/dist/stage.js +2 -0
  138. package/dist/node_modules/@allyhub/linkedin-view/dist/text.js +2 -0
  139. package/dist/node_modules/@allyhub/linkedin-view/package.json +21 -0
  140. package/dist/node_modules/@allyhub/linkedin-view/src/style.css +600 -0
  141. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  142. package/dist/node_modules/@allyhub/media/package.json +1 -1
  143. package/dist/node_modules/@allyhub/media-extension/dist/vision/faces.js +1 -1
  144. package/dist/node_modules/@allyhub/media-extension/package.json +7 -4
  145. package/dist/node_modules/@allyhub/model/package.json +1 -1
  146. package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.js +1 -1
  147. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  148. package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +2 -0
  149. package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +16 -0
  150. package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +1 -1
  151. package/dist/node_modules/@allyhub/piece/dist/page/index.js +1 -1
  152. package/dist/node_modules/@allyhub/piece/dist/page/locate.d.ts +14 -1
  153. package/dist/node_modules/@allyhub/piece/dist/page/locate.js +1 -1
  154. package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +18 -0
  155. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  156. package/dist/node_modules/@allyhub/project/dist/version.js +1 -1
  157. package/dist/node_modules/@allyhub/project/package.json +1 -1
  158. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +140 -0
  159. package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
  160. package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +19 -1
  161. package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
  162. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +157 -0
  163. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  164. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +10 -2
  165. package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
  166. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +101 -186
  167. package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
  168. package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +1 -0
  169. package/dist/node_modules/@allyhub/protocol/dist/mail.js +1 -1
  170. package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +92 -94
  171. package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
  172. package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +17 -0
  173. package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
  174. package/dist/node_modules/@allyhub/protocol/dist/teams.d.ts +7 -0
  175. package/dist/node_modules/@allyhub/protocol/dist/teams.js +1 -1
  176. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +15 -3
  177. package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
  178. package/dist/node_modules/@allyhub/protocol/package.json +1 -1
  179. package/dist/node_modules/@allyhub/registry/package.json +1 -1
  180. package/dist/node_modules/@allyhub/render/dist/encode.js +1 -1
  181. package/dist/node_modules/@allyhub/render/dist/index.js +1 -1
  182. package/dist/node_modules/@allyhub/render/dist/look.js +1 -1
  183. package/dist/node_modules/@allyhub/render/dist/render.js +2 -2
  184. package/dist/node_modules/@allyhub/render/package.json +1 -1
  185. package/dist/node_modules/@allyhub/report-extension/LICENSE +241 -0
  186. package/dist/node_modules/@allyhub/report-extension/dist/build.js +2 -0
  187. package/dist/node_modules/@allyhub/report-extension/dist/check.js +3 -0
  188. package/dist/node_modules/@allyhub/report-extension/dist/cli/find.js +2 -0
  189. package/dist/node_modules/@allyhub/report-extension/dist/cli/index.js +5 -0
  190. package/dist/node_modules/@allyhub/report-extension/dist/cli/picture.js +2 -0
  191. package/dist/node_modules/@allyhub/report-extension/dist/export.js +2 -0
  192. package/dist/node_modules/@allyhub/report-extension/dist/inline.js +58 -0
  193. package/dist/node_modules/@allyhub/report-extension/dist/page.js +21 -0
  194. package/dist/node_modules/@allyhub/report-extension/dist/project-tools.js +21 -0
  195. package/dist/node_modules/@allyhub/report-extension/dist/styles.js +5 -0
  196. package/dist/node_modules/@allyhub/report-extension/dist/theme.js +2 -0
  197. package/dist/node_modules/@allyhub/report-extension/dist/tools.js +2 -0
  198. package/dist/node_modules/@allyhub/report-extension/dist/workspace.js +2 -0
  199. package/dist/node_modules/@allyhub/report-extension/package.json +182 -0
  200. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/STYLE.md +132 -0
  201. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/style.css +105 -0
  202. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/style.json +17 -0
  203. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/tokens.js +38 -0
  204. package/dist/node_modules/@allyhub/runtime/dist/compose.js +1 -1
  205. package/dist/node_modules/@allyhub/runtime/dist/embed.js +1 -1
  206. package/dist/node_modules/@allyhub/runtime/dist/player/clips.js +1 -1
  207. package/dist/node_modules/@allyhub/runtime/dist/player/player.js +1 -1
  208. package/dist/node_modules/@allyhub/runtime/package.json +1 -1
  209. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  210. package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
  211. package/dist/node_modules/@allyhub/scenery/dist/index.d.ts +2 -2
  212. package/dist/node_modules/@allyhub/scenery/dist/index.js +1 -1
  213. package/dist/node_modules/@allyhub/scenery/dist/moire.d.ts +45 -5
  214. package/dist/node_modules/@allyhub/scenery/dist/moire.js +2 -2
  215. package/dist/node_modules/@allyhub/scenery/dist/phone.d.ts +4 -3
  216. package/dist/node_modules/@allyhub/scenery/dist/phone.js +1 -1
  217. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  218. package/dist/node_modules/@allyhub/scenery-host/dist/layer/grade.d.ts +7 -0
  219. package/dist/node_modules/@allyhub/scenery-host/dist/layer/grade.js +2 -0
  220. package/dist/node_modules/@allyhub/scenery-host/dist/layer/index.d.ts +4 -3
  221. package/dist/node_modules/@allyhub/scenery-host/dist/layer/index.js +1 -1
  222. package/dist/node_modules/@allyhub/scenery-host/dist/layer/screens.d.ts +1 -1
  223. package/dist/node_modules/@allyhub/scenery-host/dist/layer/screens.js +1 -1
  224. package/dist/node_modules/@allyhub/scenery-host/dist/measure/facts.js +1 -1
  225. package/dist/node_modules/@allyhub/scenery-host/dist/page/screens.d.ts +8 -0
  226. package/dist/node_modules/@allyhub/scenery-host/dist/page/screens.js +1 -1
  227. package/dist/node_modules/@allyhub/scenery-host/dist/viewer.d.ts +6 -0
  228. package/dist/node_modules/@allyhub/scenery-host/dist/viewer.js +1 -1
  229. package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
  230. package/dist/node_modules/@allyhub/sheet/dist/calc/coerce.js +1 -1
  231. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
  232. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.js +1 -1
  233. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/date.js +1 -1
  234. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.js +1 -1
  235. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/info.js +1 -1
  236. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/kernels.js +1 -1
  237. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/lookup.js +1 -1
  238. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/maths.js +1 -1
  239. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
  240. package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.js +1 -1
  241. package/dist/node_modules/@allyhub/sheet/dist/calc/types.js +1 -1
  242. package/dist/node_modules/@allyhub/sheet/dist/chart.js +1 -1
  243. package/dist/node_modules/@allyhub/sheet/dist/export.js +2 -4
  244. package/dist/node_modules/@allyhub/sheet/dist/formula/move.js +1 -1
  245. package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
  246. package/dist/node_modules/@allyhub/sheet/dist/formula/print.js +1 -1
  247. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  248. package/dist/node_modules/@allyhub/sheet/dist/inspect.js +1 -1
  249. package/dist/node_modules/@allyhub/sheet/dist/printed.js +2 -0
  250. package/dist/node_modules/@allyhub/sheet/dist/values.js +1 -1
  251. package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
  252. package/dist/node_modules/@allyhub/sheet/dist/write.js +15 -15
  253. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  254. package/dist/node_modules/@allyhub/sheet/dist/xlsx/formula.js +2 -2
  255. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
  256. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
  257. package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.js +3 -1
  258. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
  259. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  260. package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.js +3 -2
  261. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  262. package/dist/node_modules/@allyhub/sheet-extension/dist/export.js +2 -6
  263. package/dist/node_modules/@allyhub/sheet-extension/package.json +24 -9
  264. package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
  265. package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
  266. package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
  267. package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
  268. package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
  269. package/dist/node_modules/@allyhub/slides-core/dist/sdk.js +1 -1
  270. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  271. package/dist/node_modules/@allyhub/slides-extension/dist/export.js +1 -1
  272. package/dist/node_modules/@allyhub/slides-extension/package.json +22 -16
  273. package/dist/node_modules/@allyhub/slides-pptx/dist/import/code.js +2 -2
  274. package/dist/node_modules/@allyhub/slides-pptx/dist/import/index.js +2 -2
  275. package/dist/node_modules/@allyhub/slides-pptx/dist/read/common.js +1 -1
  276. package/dist/node_modules/@allyhub/slides-pptx/dist/read/shapes.js +1 -1
  277. package/dist/node_modules/@allyhub/slides-pptx/dist/read/text.js +1 -1
  278. package/dist/node_modules/@allyhub/slides-pptx/dist/shapes.js +1 -1
  279. package/dist/node_modules/@allyhub/slides-pptx/dist/text.js +1 -1
  280. package/dist/node_modules/@allyhub/slides-pptx/dist/write.js +2 -2
  281. package/dist/node_modules/@allyhub/slides-pptx/dist/xml.js +1 -1
  282. package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
  283. package/dist/node_modules/@allyhub/slides-runtime/dist/draw.js +2 -2
  284. package/dist/node_modules/@allyhub/slides-runtime/dist/load.js +5 -5
  285. package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
  286. package/dist/node_modules/@allyhub/stage/package.json +1 -1
  287. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400-italic.css +19 -0
  288. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400.css +19 -0
  289. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700-italic.css +19 -0
  290. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700.css +19 -0
  291. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/LICENSE +93 -0
  292. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/cambria.css +76 -0
  293. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-400-italic.woff2 +0 -0
  294. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-400-normal.woff2 +0 -0
  295. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-700-italic.woff2 +0 -0
  296. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-700-normal.woff2 +0 -0
  297. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-400-italic.woff2 +0 -0
  298. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-400-normal.woff2 +0 -0
  299. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-700-italic.woff2 +0 -0
  300. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-700-normal.woff2 +0 -0
  301. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400-italic.css +79 -0
  302. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400.css +79 -0
  303. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700-italic.css +79 -0
  304. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700.css +79 -0
  305. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/LICENSE +93 -0
  306. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/courier-new.css +316 -0
  307. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-400-italic.woff2 +0 -0
  308. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-400-normal.woff2 +0 -0
  309. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-700-italic.woff2 +0 -0
  310. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-700-normal.woff2 +0 -0
  311. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-400-italic.woff2 +0 -0
  312. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-400-normal.woff2 +0 -0
  313. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-700-italic.woff2 +0 -0
  314. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-700-normal.woff2 +0 -0
  315. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-400-italic.woff2 +0 -0
  316. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-400-normal.woff2 +0 -0
  317. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-700-italic.woff2 +0 -0
  318. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-700-normal.woff2 +0 -0
  319. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-400-italic.woff2 +0 -0
  320. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-400-normal.woff2 +0 -0
  321. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-700-italic.woff2 +0 -0
  322. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-700-normal.woff2 +0 -0
  323. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-400-italic.woff2 +0 -0
  324. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-400-normal.woff2 +0 -0
  325. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-700-italic.woff2 +0 -0
  326. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-700-normal.woff2 +0 -0
  327. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-400-italic.woff2 +0 -0
  328. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-400-normal.woff2 +0 -0
  329. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-700-italic.woff2 +0 -0
  330. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-700-normal.woff2 +0 -0
  331. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-400-italic.woff2 +0 -0
  332. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-400-normal.woff2 +0 -0
  333. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-700-italic.woff2 +0 -0
  334. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-700-normal.woff2 +0 -0
  335. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-400-italic.woff2 +0 -0
  336. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-400-normal.woff2 +0 -0
  337. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-700-italic.woff2 +0 -0
  338. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-700-normal.woff2 +0 -0
  339. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400-italic.css +79 -0
  340. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400.css +79 -0
  341. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700-italic.css +79 -0
  342. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700.css +79 -0
  343. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/LICENSE +93 -0
  344. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-400-italic.woff2 +0 -0
  345. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-400-normal.woff2 +0 -0
  346. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-700-italic.woff2 +0 -0
  347. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-700-normal.woff2 +0 -0
  348. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-400-italic.woff2 +0 -0
  349. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-400-normal.woff2 +0 -0
  350. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-700-italic.woff2 +0 -0
  351. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-700-normal.woff2 +0 -0
  352. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-400-italic.woff2 +0 -0
  353. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-400-normal.woff2 +0 -0
  354. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-700-italic.woff2 +0 -0
  355. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-700-normal.woff2 +0 -0
  356. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-400-italic.woff2 +0 -0
  357. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-400-normal.woff2 +0 -0
  358. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-700-italic.woff2 +0 -0
  359. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-700-normal.woff2 +0 -0
  360. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-400-italic.woff2 +0 -0
  361. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-400-normal.woff2 +0 -0
  362. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-700-italic.woff2 +0 -0
  363. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-700-normal.woff2 +0 -0
  364. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-400-italic.woff2 +0 -0
  365. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-400-normal.woff2 +0 -0
  366. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-700-italic.woff2 +0 -0
  367. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-700-normal.woff2 +0 -0
  368. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-400-italic.woff2 +0 -0
  369. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-400-normal.woff2 +0 -0
  370. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-700-italic.woff2 +0 -0
  371. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-700-normal.woff2 +0 -0
  372. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-400-italic.woff2 +0 -0
  373. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-400-normal.woff2 +0 -0
  374. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-700-italic.woff2 +0 -0
  375. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-700-normal.woff2 +0 -0
  376. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/times-new-roman.css +316 -0
  377. package/dist/node_modules/@allyhub/stage-page/dist/host.js +1 -1
  378. package/dist/node_modules/@allyhub/stage-page/dist/install.js +1 -1
  379. package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.html +3 -0
  380. package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.js +1 -1
  381. package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
  382. package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +18 -18
  383. package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
  384. package/dist/node_modules/@allyhub/video-core/dist/schema.js +1 -1
  385. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  386. package/dist/node_modules/@allyhub/video-extension/dist/export.js +1 -1
  387. package/dist/node_modules/@allyhub/video-extension/package.json +17 -4
  388. package/dist/node_modules/@allyhub/video-measure/dist/version.js +1 -1
  389. package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
  390. package/dist/node_modules/@allyhub/video-sdk/dist/phone.js +1 -1
  391. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  392. package/dist/node_modules/@allyhub/website/package.json +1 -1
  393. package/dist/node_modules/@allyhub/website-extension/dist/held.js +2 -0
  394. package/dist/node_modules/@allyhub/website-extension/dist/preview.js +5 -5
  395. package/dist/node_modules/@allyhub/website-extension/dist/project-tools.js +24 -1
  396. package/dist/node_modules/@allyhub/website-extension/dist/tools.js +1 -1
  397. package/dist/node_modules/@allyhub/website-extension/package.json +49 -2
  398. package/dist/node_modules/@allyhub/x-extension/dist/build.js +4 -3
  399. package/dist/node_modules/@allyhub/x-extension/package.json +43 -15
  400. package/dist/node_modules/@allyhub/x-extension/skills/allyhub/references/x.md +7 -62
  401. package/dist/node_modules/@allyhub/x-model/package.json +1 -1
  402. package/dist/node_modules/@allyhub/x-view/dist/article.js +1 -1
  403. package/dist/node_modules/@allyhub/x-view/dist/index.js +1 -1
  404. package/dist/node_modules/@allyhub/x-view/dist/post.js +2 -2
  405. package/dist/node_modules/@allyhub/x-view/package.json +1 -1
  406. package/dist/package.json +12 -10
  407. package/dist/text/facts-text.js +5 -5
  408. package/dist/text/index.js +1 -1
  409. package/dist/text/long-text.js +4 -0
  410. package/dist/works.js +1 -1
  411. package/editor-web/assets/{abnfDiagram-WEYOIA3C-CN5PiJYY.js → abnfDiagram-WEYOIA3C-BKmMA6gn.js} +1 -1
  412. package/editor-web/assets/{architecture-WOLXFQ4H-BnvZtQYk.js → architecture-WOLXFQ4H-BEFBgb4k.js} +1 -1
  413. package/editor-web/assets/{architectureDiagram-ZHVYKT53-tkcEcFQ8.js → architectureDiagram-ZHVYKT53-_u5YfCjY.js} +1 -1
  414. package/editor-web/assets/{arrow-up-DTP2yVSU.js → arrow-up-B5rJbBv0.js} +1 -1
  415. package/editor-web/assets/article-BUmD3xtR.js +8 -0
  416. package/editor-web/assets/article-DNioBb3p.js +7 -0
  417. package/editor-web/assets/{audio-lines-Ti8-m7H2.js → audio-lines-CzuzsGjI.js} +1 -1
  418. package/editor-web/assets/{blockDiagram-RJAE7QA3-DhqEIpie.js → blockDiagram-RJAE7QA3-DybfaO3Z.js} +1 -1
  419. package/editor-web/assets/bookmark-Dsd3kHJJ.js +1 -0
  420. package/editor-web/assets/button-eGxLxbv9.js +41 -0
  421. package/editor-web/assets/{c4Diagram-XDPPPE54-Bg9G95tl.js → c4Diagram-XDPPPE54-BfqLHB5i.js} +1 -1
  422. package/editor-web/assets/calc-worker-D2pGis6e.js +45 -0
  423. package/editor-web/assets/channel-TNPgFDrw.js +1 -0
  424. package/editor-web/assets/chart-C37xvZT2.js +1 -0
  425. package/editor-web/assets/chart-no-axes-column-BVkeF_Mr.js +1 -0
  426. package/editor-web/assets/{chunk-2E7WHVMD-C8Ve9lAa.js → chunk-2E7WHVMD-BVp1I_d0.js} +1 -1
  427. package/editor-web/assets/{chunk-4EMNKR2T-BDWwPUnT.js → chunk-4EMNKR2T-CTdgWEMr.js} +1 -1
  428. package/editor-web/assets/{chunk-55XCU76K-BQiNPKgx.js → chunk-55XCU76K-7pnsxeaP.js} +1 -1
  429. package/editor-web/assets/{chunk-7S6XSTFO-QoEt-6jf.js → chunk-7S6XSTFO-Dc0Dvkq7.js} +1 -1
  430. package/editor-web/assets/{chunk-AQDTSKZB-BeuwIv0-.js → chunk-AQDTSKZB-VAILIsfx.js} +1 -1
  431. package/editor-web/assets/{chunk-DSNLSHJZ-BHW7sLAz.js → chunk-DSNLSHJZ-CUDx1Rv5.js} +1 -1
  432. package/editor-web/assets/{chunk-HAGFOTED-bbGED0hu.js → chunk-HAGFOTED-DAoEe-dJ.js} +1 -1
  433. package/editor-web/assets/{chunk-HNE4Q36P-FltWp8yo.js → chunk-HNE4Q36P-g0akya12.js} +1 -1
  434. package/editor-web/assets/{chunk-NQOKRVIF-NeQzr6kH.js → chunk-NQOKRVIF-hTGjzXdJ.js} +1 -1
  435. package/editor-web/assets/{chunk-UHW7PFBP-eA4-WUhn.js → chunk-UHW7PFBP-BgLV8BIJ.js} +1 -1
  436. package/editor-web/assets/{chunk-VQ5W62QI-BPPv325z.js → chunk-VQ5W62QI-Bw19OOSD.js} +1 -1
  437. package/editor-web/assets/{chunk-WQQL4CDK-DOCIz7Te.js → chunk-WQQL4CDK-CMST9dyE.js} +1 -1
  438. package/editor-web/assets/{chunk-YZO67HFG-Dc_ihQJi.js → chunk-YZO67HFG-Bbpu36XF.js} +1 -1
  439. package/editor-web/assets/{chunk-ZAUX2LTX-CoqwCPSm.js → chunk-ZAUX2LTX-C48Ri0Gs.js} +1 -1
  440. package/editor-web/assets/{chunk-ZCHMQSOR-CZUQPkJx.js → chunk-ZCHMQSOR-DN1g01Oe.js} +1 -1
  441. package/editor-web/assets/{classDiagram-v2-4MYWR3UA-DUh9c50k.js → classDiagram-v2-4MYWR3UA-U6jbPr2d.js} +1 -1
  442. package/editor-web/assets/collaborator-B1u2td9m.js +1 -0
  443. package/editor-web/assets/createLucideIcon-GFZ_fxLc.js +1 -0
  444. package/editor-web/assets/{cynefin-EF2NZ3EQ-DUTZiog0.js → cynefin-EF2NZ3EQ-gzkai_7-.js} +1 -1
  445. package/editor-web/assets/{cynefinDiagram-WF24UDRP-oAjpfbrU.js → cynefinDiagram-WF24UDRP-DtSekSr6.js} +1 -1
  446. package/editor-web/assets/{dagre-NK4GIZVX-BrKvKCvb.js → dagre-NK4GIZVX-CiUwYVT6.js} +1 -1
  447. package/editor-web/assets/{diagram-CBK3MWTC-GekVRnmm.js → diagram-CBK3MWTC-r9XHCV-k.js} +1 -1
  448. package/editor-web/assets/{diagram-I5XIIV2D-CDd1VFRT.js → diagram-I5XIIV2D-DxVsDZ34.js} +1 -1
  449. package/editor-web/assets/{diagram-ODIL2UCW-535RISTn.js → diagram-ODIL2UCW-B0eNQoHV.js} +1 -1
  450. package/editor-web/assets/{diagram-PFBEJUXE-MXzzKCGG.js → diagram-PFBEJUXE-C7f2MfJT.js} +1 -1
  451. package/editor-web/assets/{diagram-RJA3I4VV-vKVwkQxY.js → diagram-RJA3I4VV-CSXcnvct.js} +1 -1
  452. package/editor-web/assets/{diagram-TYUNFSNR-UwGAiQLx.js → diagram-TYUNFSNR-DXzOD_ii.js} +1 -1
  453. package/editor-web/assets/dist-BGRwhCQO.js +1 -0
  454. package/editor-web/assets/{dist-9ymlIMhr.js → dist-BW4X7BrF.js} +1 -1
  455. package/editor-web/assets/dist-BgDRE85b.js +2 -0
  456. package/editor-web/assets/dist-Blq5nJnU.js +24 -0
  457. package/editor-web/assets/dist-BuWaZ3Y4.js +274 -0
  458. package/editor-web/assets/dist-C1emZ9wX.js +37 -0
  459. package/editor-web/assets/dist-CC7OeU1e.js +6 -0
  460. package/editor-web/assets/dist-CX-fiPSn.js +38 -0
  461. package/editor-web/assets/dist-C_VvG-_9.js +5 -0
  462. package/editor-web/assets/dist-Ce7HrBxv.js +3 -0
  463. package/editor-web/assets/dist-D2k6w-_a.js +1 -0
  464. package/editor-web/assets/dist-DDv_SbKw.js +84 -0
  465. package/editor-web/assets/dist-DEoEO4zs.js +1 -0
  466. package/editor-web/assets/dist-DlDxxPIP.js +16 -0
  467. package/editor-web/assets/dist-Gz6NDS0J.js +4 -0
  468. package/editor-web/assets/{ebnfDiagram-V4P3TTPT-73yGokYa.js → ebnfDiagram-V4P3TTPT-Cs4YRvDD.js} +1 -1
  469. package/editor-web/assets/{elk-QONTBCTQ-BW6V9y6a.js → elk-QONTBCTQ-Bh3LZ9WI.js} +1 -1
  470. package/editor-web/assets/{erDiagram-KYQIGQAA-BPqIJ22h.js → erDiagram-KYQIGQAA-C4vYTYXp.js} +1 -1
  471. package/editor-web/assets/{eventmodeling-K75KTNOO-_VZ8jvuy.js → eventmodeling-K75KTNOO-BN1kkHWS.js} +1 -1
  472. package/editor-web/assets/flowDiagram-IUGLLWBU-B04NGsyi.js +1 -0
  473. package/editor-web/assets/{ganttDiagram-R7GPNTJY-DZ157JN2.js → ganttDiagram-R7GPNTJY-CA1LkkC5.js} +1 -1
  474. package/editor-web/assets/{gitGraph-VSP46ZUC-fmcNL9bq.js → gitGraph-VSP46ZUC-Dy5tA7dG.js} +1 -1
  475. package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-DiZDyksR.js → gitGraphDiagram-PDYL7XHY-hJIB8EkH.js} +1 -1
  476. package/editor-web/assets/hint-B8JpEypy.js +1 -0
  477. package/editor-web/assets/index-CgB5osVc.js +28 -0
  478. package/editor-web/assets/index-Daytem9N.css +2 -0
  479. package/editor-web/assets/{info-OHQRW6UA-V06620kN.js → info-OHQRW6UA-DvzSf7rQ.js} +1 -1
  480. package/editor-web/assets/{infoDiagram-MVDRKAX5-CbIgheWX.js → infoDiagram-MVDRKAX5-BjIMm4Af.js} +1 -1
  481. package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-D5oJQPkG.js → ishikawaDiagram-HPEHV2GE-Bpz71S40.js} +1 -1
  482. package/editor-web/assets/{italic-CDhZKo_q.js → italic-D10w8n6C.js} +1 -1
  483. package/editor-web/assets/{journeyDiagram-BOSHW7O7-BZEv6JI4.js → journeyDiagram-BOSHW7O7-DAB-pZjD.js} +1 -1
  484. package/editor-web/assets/{kanban-definition-FNSA4HC5-CLG1R8y_.js → kanban-definition-FNSA4HC5-cYeyh3P6.js} +1 -1
  485. package/editor-web/assets/katex-5Z2zF-9g.js +257 -0
  486. package/editor-web/assets/link-BC5xK1-1.js +1 -0
  487. package/editor-web/assets/{mermaid-parser.core-DxDwXM7z.js → mermaid-parser.core-req5LE0X.js} +3 -3
  488. package/editor-web/assets/{mermaid.core-tU55ZwVG.js → mermaid.core-zFwZug4C.js} +4 -4
  489. package/editor-web/assets/{mindmap-definition-6OY57UG3-CYf4zzAh.js → mindmap-definition-6OY57UG3-TStWb7DG.js} +1 -1
  490. package/editor-web/assets/minus-DaWs5i8B.js +1 -0
  491. package/editor-web/assets/{packet-JDAUHWVQ-DsHeKYNL.js → packet-JDAUHWVQ-smFhVKcB.js} +1 -1
  492. package/editor-web/assets/palette-BIOudGkm.js +1 -0
  493. package/editor-web/assets/{pegDiagram-ECIUJNBX-CQyh6TTa.js → pegDiagram-ECIUJNBX-DvSNRv0-.js} +1 -1
  494. package/editor-web/assets/{pie-XZMESJXO-3vCIvpNB.js → pie-XZMESJXO-qjaGsBZG.js} +1 -1
  495. package/editor-web/assets/{pieDiagram-GNMPY74T-DF5yGBLn.js → pieDiagram-GNMPY74T-Dd9P-Pdc.js} +1 -1
  496. package/editor-web/assets/play-CrMmPghG.js +1 -0
  497. package/editor-web/assets/progress-DE4C5_3x.js +6 -0
  498. package/editor-web/assets/props-form-CsmDBqzy.js +1 -0
  499. package/editor-web/assets/{quadrantDiagram-D57K4MC3-B7pxlDYP.js → quadrantDiagram-D57K4MC3-h2IIKUUA.js} +1 -1
  500. package/editor-web/assets/{radar-ABXABTNO-cpEA41mL.js → radar-ABXABTNO-DlVrSA1d.js} +1 -1
  501. package/editor-web/assets/{railroad-I3PHUGI6-BLyy5R2c.js → railroad-I3PHUGI6-nFbuLAtc.js} +1 -1
  502. package/editor-web/assets/{railroad-abnf-LNEFI6M7-Y-oyol19.js → railroad-abnf-LNEFI6M7-Daj8h2iV.js} +1 -1
  503. package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-o58wHZsr.js → railroad-ebnf-DWYD2UWJ-eYJyl5PH.js} +1 -1
  504. package/editor-web/assets/{railroad-peg-JR7BVNR7-CcD3PXZ8.js → railroad-peg-JR7BVNR7-BTRhKZQq.js} +1 -1
  505. package/editor-web/assets/{railroadDiagram-Y72NRBL7-BuCC4eyy.js → railroadDiagram-Y72NRBL7-CeLGUjdp.js} +1 -1
  506. package/editor-web/assets/react-WA6wlt8S.js +1 -0
  507. package/editor-web/assets/{repeat-2-C5PCbNsg.js → repeat-2-VQP1EVOZ.js} +1 -1
  508. package/editor-web/assets/{requirementDiagram-EQYSW5RA-Dp-JFGn4.js → requirementDiagram-EQYSW5RA-Dmk9XRM5.js} +1 -1
  509. package/editor-web/assets/row-BRlEWRrK.js +1 -0
  510. package/editor-web/assets/{sankeyDiagram-SY24JHO5-rYuCqEvw.js → sankeyDiagram-SY24JHO5-Yn4zlrAM.js} +1 -1
  511. package/editor-web/assets/schemas-VikZYZIK.js +1 -0
  512. package/editor-web/assets/{sequenceDiagram-BLEHNHQU-DryW8x6d.js → sequenceDiagram-BLEHNHQU-BTRnp_PW.js} +1 -1
  513. package/editor-web/assets/session-Do9AqS38.js +1 -0
  514. package/editor-web/assets/slides-diTEQ3C5.js +1 -0
  515. package/editor-web/assets/snapshots-BUGlKQIB.js +56 -0
  516. package/editor-web/assets/sound-Bj3o9_Fa.js +1 -0
  517. package/editor-web/assets/split-CNU1RHcX.js +3 -0
  518. package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-Bnp0XfpT.js → stateDiagram-v2-A6IESKWZ-kstrRKv2.js} +1 -1
  519. package/editor-web/assets/{strikethrough-DJckA35o.js → strikethrough-CfXx6IYH.js} +1 -1
  520. package/editor-web/assets/{svg-BjM9RazX.js → svg-Cx50MpxK.js} +1 -1
  521. package/editor-web/assets/swatch-WeJD41aW.js +1 -0
  522. package/editor-web/assets/{swimlanes-B3ENRKFQ-BiRRhhbd.js → swimlanes-B3ENRKFQ-DaZsZkeP.js} +1 -1
  523. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-CBZAujYY.js +8 -0
  524. package/editor-web/assets/switch-N0G_sbqt.js +1 -0
  525. package/editor-web/assets/syntax-BVsgRJ4I.js +66 -0
  526. package/editor-web/assets/syntax-oWsKBWFw.js +1 -0
  527. package/editor-web/assets/table-B6hVZAMi.js +1 -0
  528. package/editor-web/assets/tabs-DIFDqj-l.js +1 -0
  529. package/editor-web/assets/{textarea-BGtPqZdB.js → textarea-tEWvBY9p.js} +1 -1
  530. package/editor-web/assets/{timeline-definition-JXYKGLGB-D-Q5ZtDF.js → timeline-definition-JXYKGLGB-CLCvY-Yf.js} +1 -1
  531. package/editor-web/assets/{trash-2-Bjj6cWzP.js → trash-2-BP6nqpg2.js} +1 -1
  532. package/editor-web/assets/{treeView-D4JQ5SDB-B6DDatXq.js → treeView-D4JQ5SDB-BmN0gwdC.js} +1 -1
  533. package/editor-web/assets/{treemap-SAJKECNS-D7j5ZhiI.js → treemap-SAJKECNS-DN29G_E_.js} +1 -1
  534. package/editor-web/assets/{undo-2-yOSG766T.js → undo-2-CHR0nvWL.js} +1 -1
  535. package/editor-web/assets/{usecaseDiagram-WPOLBNNX-tkrdKUJB.js → usecaseDiagram-WPOLBNNX-DTRS54cB.js} +1 -1
  536. package/editor-web/assets/{vennDiagram-Q3Y3IDCW-Ch4XbSnD.js → vennDiagram-Q3Y3IDCW-DAAc11Hx.js} +1 -1
  537. package/editor-web/assets/video-BlvmR8BK.js +1 -0
  538. package/editor-web/assets/{wardley-7MLQ67FV-Bynt7qNQ.js → wardley-7MLQ67FV-B-UYkmdB.js} +1 -1
  539. package/editor-web/assets/{wardleyDiagram-IVAIDKWA-DRuSgm_L.js → wardleyDiagram-IVAIDKWA-BmbwCaky.js} +1 -1
  540. package/editor-web/assets/words-D_4T9Adq.js +3 -0
  541. package/editor-web/assets/words-WgdEQdYP.js +2 -0
  542. package/editor-web/assets/{xychartDiagram-4URNHDU4-DctpvfkL.js → xychartDiagram-4URNHDU4-ChAfAq1U.js} +1 -1
  543. package/editor-web/index.html +6 -5
  544. package/package.json +8 -2
  545. package/editor-web/assets/alt-BOVao_9S.js +0 -4
  546. package/editor-web/assets/article-B6YCzhj8.js +0 -73
  547. package/editor-web/assets/calc-worker-B5-fDWnb.js +0 -45
  548. package/editor-web/assets/channel-C26aBI4o.js +0 -1
  549. package/editor-web/assets/chart-BOnxneyw.js +0 -1
  550. package/editor-web/assets/choice-O5nwc2N0.js +0 -1
  551. package/editor-web/assets/collaborator-BJU5qwHd.js +0 -1
  552. package/editor-web/assets/createLucideIcon-B3B95oX5.js +0 -1
  553. package/editor-web/assets/dist-C6NqUEG4.js +0 -16
  554. package/editor-web/assets/dist-C9UGmCG9.js +0 -6
  555. package/editor-web/assets/dist-CAk5bjBm.js +0 -1
  556. package/editor-web/assets/dist-CKyfo5RM.js +0 -340
  557. package/editor-web/assets/dist-CRaWqNwq.js +0 -37
  558. package/editor-web/assets/dist-CwIBc7HQ.js +0 -1
  559. package/editor-web/assets/dist-DXRmkezB.js +0 -38
  560. package/editor-web/assets/dist-EKK5i0dG.js +0 -219
  561. package/editor-web/assets/dist-hHJlpLWo.js +0 -5
  562. package/editor-web/assets/dist-oYKcwWUj.js +0 -4
  563. package/editor-web/assets/dist-shKo7XVN.js +0 -2
  564. package/editor-web/assets/dist-wrKxBrVu.js +0 -24
  565. package/editor-web/assets/flowDiagram-IUGLLWBU-ouDQYiTr.js +0 -1
  566. package/editor-web/assets/hint-_AQWCDMj.js +0 -1
  567. package/editor-web/assets/index-BsstP-cI.js +0 -28
  568. package/editor-web/assets/index-DQRcmxBO.css +0 -2
  569. package/editor-web/assets/minus-Cgmm6ncD.js +0 -1
  570. package/editor-web/assets/progress-0B_TVsPi.js +0 -6
  571. package/editor-web/assets/react-BP46yLMB.js +0 -1
  572. package/editor-web/assets/react-pgBZqVxJ.js +0 -96
  573. package/editor-web/assets/schemas-Ewwjtbf4.js +0 -1
  574. package/editor-web/assets/session-DiI9KYRI.js +0 -1
  575. package/editor-web/assets/slides-CCwgBcGH.js +0 -1
  576. package/editor-web/assets/sound-CqryteNl.js +0 -1
  577. package/editor-web/assets/swatch-DL3HqIjW.js +0 -1
  578. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-BkOls8Tv.js +0 -8
  579. package/editor-web/assets/switch-DltnKqN-.js +0 -1
  580. package/editor-web/assets/syntax-CC6QYhCz.js +0 -1
  581. package/editor-web/assets/tabs-C-re0Kxn.js +0 -1
  582. package/editor-web/assets/video-DXFiCNGc.js +0 -1
@@ -1,54 +1,54 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{Document as K,visit as Y}from"yaml";import{pageLookYaml as F}from"./page.js";import{BLOCK_TAG as C,CALLOUT_TAG as M,CARD_TAG as E,STAT_TAG as J,STATS_TAG as R,TAG_TAG as I,CHART_TAG as L,PAGE_BREAK_TAG as Q,COLUMN_TAG as B,COLUMNS_TAG as N,COMPONENT_TAG as V,TABLE_TAG as U,TOC_TAG as X,BIBLIOGRAPHY_TAG as Z}from"./parse.js";const A=["link","span","tag","underline","bold","italic","strike","code"];function g(e,n){switch(n){case"link":return e.href;case"tag":return e.styles.tag;case"span":return e.styles.color!==void 0||e.styles.background!==void 0?`${e.styles.color??""}
2
+ import{Document as K,visit as Y}from"yaml";import{pageLookYaml as F}from"./page.js";import{BLOCK_TAG as M,CALLOUT_TAG as E,CARD_TAG as R,STAT_TAG as J,STATS_TAG as I,TAG_TAG as B,CHART_TAG as O,PAGE_BREAK_TAG as Q,COLUMN_TAG as N,COLUMNS_TAG as U,COMPONENT_TAG as V,TABLE_TAG as W,TOC_TAG as X,BIBLIOGRAPHY_TAG as Z}from"./parse.js";const A=["link","span","tag","underline","bold","italic","strike","code"];function g(e,n){switch(n){case"link":return e.href;case"tag":return e.styles.tag;case"span":return e.styles.color!==void 0||e.styles.background!==void 0?`${e.styles.color??""}
3
3
  ${e.styles.background??""}`:void 0;default:return e.styles[n]?"on":void 0}}const s=(e,n)=>n===void 0?"":` ${e}="${n.replace(/&/g,"&amp;").replace(/"/g,"&quot;")}"`,_=e=>e!==void 0&&/[\p{L}\p{N}]/u.test(e);function G(e,n,r=n){let t="";const i=Array.from(e);return i.forEach((a,d)=>{const u=i[d-1],c=i[d+1];switch(a){case"\\":case"*":case"`":case"[":case"]":case"<":case">":case"{":case"}":case"~":t+=`\\${a}`;break;case"_":t+=_(u)&&_(c)?a:`\\${a}`;break;case"&":t+=/^&(#\d+|#x[0-9a-f]+|[a-z][a-z0-9]*);/i.test(i.slice(d,d+34).join(""))?"&amp;":a;break;case"|":t+=n?"\\|":a;break;case"!":t+=c===void 0?"\\!":a;break;case`
4
4
  `:t+=r?"<br />":`\\
5
- `;break;default:t+=a}}),t}function b(e){const n=Math.max(0,...(e.match(/`+/g)??[]).map(i=>i.length)),r="`".repeat(n+1),t=e.startsWith("`")||e.endsWith("`")||e.startsWith(" ")&&e.endsWith(" ")&&e.trim()!==""?" ":"";return`${r}${t}${e}${t}${r}`}const k={bold:"**",italic:"*",strike:"~~"},W={underline:"u",bold:"strong",italic:"em",strike:"del",code:"code"};function T(e,n){let r="",t=0,i=!0;for(;t<e.length;){const a=e[t];if(a===void 0)break;if(a.note!==void 0||a.cite!==void 0){r+=a.note===void 0?`[${a.cite??""}]`:`[^${a.note}]`,i=!1,t++;continue}const d=A.find(f=>!n.used.has(f)&&g(a,f)!==void 0);if(d===void 0){r+=G(a.text,n.inTable,n.oneLine),i=!0,t++;continue}const u=g(a,d);let c=t+1;for(;c<e.length;){const f=e[c];if(f===void 0||g(f,d)!==u||d==="code"&&A.some(p=>p!=="code"&&!n.used.has(p)&&g(f,p)!==void 0))break;c++}const o=e.slice(t,c),$=new Set([...n.used,d]),h=o.map(f=>f.text).join(""),j=e[c],q=j===void 0||A.every(f=>n.used.has(f)||g(j,f)===void 0);if(d==="code")r+=h.includes(`
6
- `)||n.inTable&&h.includes("|")?`<code>${G(h,n.inTable,n.oneLine)}</code>`:b(h);else if(d==="link"){const f=T(o,{...n,used:$}),p=(u??"").replace(/[\s()<>\\]/g,x=>encodeURIComponent(x));r+=`[${f}](${p})`}else if(d==="tag"){const f=T(o,{...n,used:$});r+=`<${I}${s("color",u)}>${f}</${I}>`}else if(d==="span"){const f=T(o,{...n,used:$}),p=o[0];r+=`<span${s("color",p?.styles.color)}${s("bg",p?.styles.background)}>${f}</span>`}else{const f=T(o,{...n,used:$}),p=k[d],x=Array.from(h),D=t===0&&c===e.length,P=n.used.has("bold")||n.used.has("italic")||n.used.has("strike"),O=w=>w!==void 0&&A.every(y=>$.has(y)||g(w,y)===void 0),z=d==="bold"&&o.every(w=>w.styles.italic===!0&&A.every(y=>y==="italic"||$.has(y)||g(w,y)===void 0)),H=p!==void 0&&_(x[0])&&_(x.at(-1))&&!h.includes(`
7
- `)&&i&&q&&(!P||D&&d==="italic"&&n.used.has("bold"))&&(O(o[0])&&O(o.at(-1))||z);r+=H?`${p}${f}${p}`:`<${W[d]}>${f}</${W[d]}>`}i=!1,t=c}return r}function ee(e){if(/^(import|export)(\s|$)/.test(e))return`&#x${e.charCodeAt(0).toString(16)};${e.slice(1)}`;if(/^(#{1,6}(\s|$)|[-+](\s|$)|[=-]+\s*$|[|:\-\s]*-[|:\-\s]*$)/.test(e))return`\\${e}`;const n=/^(\d{1,9})([.)])(\s|$)/.exec(e);return n?.[1]!==void 0?`${n[1]}\\${e.slice(n[1].length)}`:e}function l(e,n=!1,r=n){const t=e.filter(d=>d.text!==""||d.href!==void 0).map((d,u,c)=>{if(d.note===void 0)return d;const o=c.slice(0,u).findLast($=>$.note===void 0);return o===void 0?d:{...d,styles:{...o.styles},...o.href===void 0?{}:{href:o.href}}}),i=T(t,{inTable:n,oneLine:r,used:new Set}),a=d=>d.replace(/ +$/,"").replace(/^ +/,u=>"&#x20;".repeat(u.length));return r?a(i):i.split(`
8
- `).map(d=>ee(a(d))).join(`
9
- `)}const v=(e,n)=>e.split(`
5
+ `;break;default:t+=a}}),t}function b(e){const n=Math.max(0,...(e.match(/`+/g)??[]).map(i=>i.length)),r="`".repeat(n+1),t=e.startsWith("`")||e.endsWith("`")||e.startsWith(" ")&&e.endsWith(" ")&&e.trim()!==""?" ":"";return`${r}${t}${e}${t}${r}`}const k={bold:"**",italic:"*",strike:"~~"},q={underline:"u",bold:"strong",italic:"em",strike:"del",code:"code"};function T(e,n){let r="",t=0,i=!0;for(;t<e.length;){const a=e[t];if(a===void 0)break;if(a.note!==void 0||a.cite!==void 0){r+=a.note===void 0?`[${a.cite??""}]`:`[^${a.note}]`,i=!1,t++;continue}const d=A.find($=>!n.used.has($)&&g(a,$)!==void 0);if(d===void 0){r+=G(a.text,n.inTable,n.oneLine),i=!0,t++;continue}const u=g(a,d);let c=t+1;for(;c<e.length;){const $=e[c];if($===void 0||g($,d)!==u||d==="code"&&A.some(p=>p!=="code"&&!n.used.has(p)&&g($,p)!==void 0))break;c++}const o=e.slice(t,c),f=new Set([...n.used,d]),h=o.map($=>$.text).join(""),j=e[c],D=j===void 0||A.every($=>n.used.has($)||g(j,$)===void 0);if(d==="code")r+=h.includes(`
6
+ `)||n.inTable&&h.includes("|")?`<code>${G(h,n.inTable,n.oneLine)}</code>`:b(h);else if(d==="link"){const $=T(o,{...n,used:f}),p=(u??"").replace(/[\s<>\\]/g,L=>encodeURIComponent(L)),x=ee(p)?p:p.replace(/[()]/g,"\\$&");r+=`[${$}](${x})`}else if(d==="tag"){const $=T(o,{...n,used:f});r+=`<${B}${s("color",u)}>${$}</${B}>`}else if(d==="span"){const $=T(o,{...n,used:f}),p=o[0];r+=`<span${s("color",p?.styles.color)}${s("bg",p?.styles.background)}>${$}</span>`}else{const $=T(o,{...n,used:f}),p=k[d],x=Array.from(h),L=t===0&&c===e.length,P=n.used.has("bold")||n.used.has("italic")||n.used.has("strike"),C=w=>w!==void 0&&A.every(y=>f.has(y)||g(w,y)===void 0),z=d==="bold"&&o.every(w=>w.styles.italic===!0&&A.every(y=>y==="italic"||f.has(y)||g(w,y)===void 0)),H=p!==void 0&&_(x[0])&&_(x.at(-1))&&!h.includes(`
7
+ `)&&i&&D&&(!P||L&&d==="italic"&&n.used.has("bold"))&&(C(o[0])&&C(o.at(-1))||z);r+=H?`${p}${$}${p}`:`<${q[d]}>${$}</${q[d]}>`}i=!1,t=c}return r}function ee(e){let n=0;for(const r of e)if(r==="(")n+=1;else if(r===")"&&--n<0)return!1;return n===0}function ne(e){if(/^[ \t]/.test(e))return`&#x${e.charCodeAt(0).toString(16)};${e.slice(1)}`;if(/^(import|export)(\s|$)/.test(e))return`&#x${e.charCodeAt(0).toString(16)};${e.slice(1)}`;if(/^(#{1,6}(\s|$)|[-+](\s|$)|[=-]+\s*$|[|:\-\s]*-[|:\-\s]*$)/.test(e))return`\\${e}`;const n=/^(\d{1,9})([.)])(\s|$)/.exec(e);return n?.[1]!==void 0?`${n[1]}\\${e.slice(n[1].length)}`:e}function l(e,n=!1,r=n){const t=e.filter(d=>d.text!==""||d.href!==void 0).map((d,u,c)=>{if(d.note===void 0)return d;const o=c.slice(0,u).findLast(f=>f.note===void 0);return o===void 0?d:{...d,styles:{...o.styles},...o.href===void 0?{}:{href:o.href}}}),i=T(t,{inTable:n,oneLine:r,used:new Set}),a=d=>d.replace(/ +$/,"").replace(/^ +/,u=>"&#x20;".repeat(u.length));return r?a(i):i.split(`
8
+ `).map(d=>ne(a(d))).join(`
9
+ `)}const S=(e,n)=>e.split(`
10
10
  `).map((r,t)=>t===0||r===""?r:`${n}${r}`).join(`
11
- `),m=e=>e.type==="bullet"||e.type==="numbered"||e.type==="check",ne=e=>`${s("align",e?.align)}${s("color",e?.color)}${s("bg",e?.background)}`,te=e=>e!==void 0&&Object.keys(e).length>0;function S(e){return!("content"in e)||e.type==="callout"?!1:te(e.look)||e.type==="toggle"||e.type==="heading"&&e.toggle?!0:(e.type==="paragraph"||e.type==="heading")&&(e.children?.length??0)>0}function re(e){const n=Math.max(2,...(e.match(/^\s*`{3,}/gm)??[]).map(r=>r.trim().length));return"`".repeat(n+1)}function se(e,n,r){const t=e.type==="numbered"?`${String(n)}${r} `:e.type==="check"?`- [${e.checked?"x":" "}] `:"- ",i=" ".repeat(e.type==="numbered"?t.length:2),a=e.children??[],d=l(e.content)||(e.type==="check"&&(e.children??[]).length===0?"<br />":"");if(a.length===0)return`${t}${v(d,i)}`.trimEnd();const u=d===""?"<br />":d,[c]=a,o=c!==void 0&&m(c)&&l(c.content)!==""&&!(c.type==="numbered"&&(c.start??1)!==1),$=a.every(m)&&d!==""&&o;return`${t}${v(u,i)}${$?`
11
+ `),m=e=>e.type==="bullet"||e.type==="numbered"||e.type==="check",te=e=>`${s("align",e?.align)}${s("color",e?.color)}${s("bg",e?.background)}`,re=e=>e!==void 0&&Object.keys(e).length>0;function v(e){return!("content"in e)||e.type==="callout"?!1:re(e.look)||e.type==="toggle"||e.type==="heading"&&e.toggle?!0:(e.type==="paragraph"||e.type==="heading")&&(e.children?.length??0)>0}function se(e){const n=Math.max(2,...(e.match(/^\s*`{3,}/gm)??[]).map(r=>r.trim().length));return"`".repeat(n+1)}function ie(e,n,r){const t=e.type==="numbered"?`${String(n)}${r} `:e.type==="check"?`- [${e.checked?"x":" "}] `:"- ",i=" ".repeat(e.type==="numbered"?t.length:2),a=e.children??[],d=l(e.content)||(e.type==="check"&&(e.children??[]).length===0?"<br />":"");if(a.length===0)return`${t}${S(d,i)}`.trimEnd();const u=d===""?"<br />":d,[c]=a,o=c!==void 0&&m(c)&&l(c.content)!==""&&!(c.type==="numbered"&&(c.start??1)!==1),f=a.every(m)&&d!==""&&o;return`${t}${S(u,i)}${f?`
12
12
  `:`
13
13
 
14
- `}${i}${v(writeBlocks(a),i)}`}function ie(e){switch(e.type){case"paragraph":{const n=l(e.content);return n===""?"<br />":n}case"heading":return`${"#".repeat(e.level)} ${l(e.content,!1,!0).replace(/(^| )(#+)$/,"$1\\$2")}`.trimEnd();case"toggle":return l(e.content)||"<br />";case"quote":{const n=l(e.content);return(e.children?.length?[n===""?"<br />":n,writeBlocks(e.children)]:[n]).join(`
14
+ `}${i}${S(writeBlocks(a),i)}`}function de(e){switch(e.type){case"paragraph":{const n=l(e.content);return n===""?"<br />":n}case"heading":return`${"#".repeat(e.level)} ${l(e.content,!1,!0).replace(/(^| )(#+)$/,"$1\\$2")}`.trimEnd();case"toggle":return l(e.content)||"<br />";case"quote":{const n=l(e.content);return(e.children?.length?[n===""?"<br />":n,writeBlocks(e.children)]:[n]).join(`
15
15
 
16
16
  `).split(`
17
17
  `).map(t=>t===""?">":`> ${t}`).join(`
18
18
  `)}case"callout":{const n=l(e.content),r=[n===""?"<br />":n,...e.children?.length?[writeBlocks(e.children)]:[]].join(`
19
19
 
20
- `);return`<${M}${s("icon",e.icon)}${s("color",e.look?.color)}${s("bg",e.look?.background)}>
20
+ `);return`<${E}${s("icon",e.icon)}${s("color",e.look?.color)}${s("bg",e.look?.background)}>
21
21
 
22
22
  ${r}
23
23
 
24
- </${M}>`}case"card":{const n=e.children?.length?writeBlocks(e.children):"";return`<${E}${s("title",e.title)}${s("subtitle",e.subtitle)}>
24
+ </${E}>`}case"card":{const n=e.children?.length?writeBlocks(e.children):"";return`<${R}${s("title",e.title)}${s("subtitle",e.subtitle)}>
25
25
 
26
26
  ${n===""?"<br />":n}
27
27
 
28
- </${E}>`}case"stats":return[`<${R}>`,...e.stats.map(n=>`<${J}${s("label",n.label)}${s("value",n.value)}${s("delta",n.delta)}${s("note",n.note)}${n.downIsGood?" down-is-good":""}${s("trend",n.trend?.join(","))} />`),`</${R}>`].join(`
29
- `);case"code":{const n=re(e.code);return`${n}${e.language??""}
28
+ </${R}>`}case"stats":return[`<${I}>`,...e.stats.map(n=>`<${J}${s("label",n.label)}${s("value",n.value)}${s("delta",n.delta)}${s("note",n.note)}${n.downIsGood?" down-is-good":""}${s("trend",n.trend?.join(","))} />`),`</${I}>`].join(`
29
+ `);case"code":{const n=se(e.code);return`${n}${e.language??""}
30
30
  ${e.code}
31
31
  ${n}`}case"image":{const n=e.src.replace(/[\s()<>\\]/g,t=>encodeURIComponent(t));if(e.width!==void 0||e.align!==void 0||e.id!==void 0)return`<img${s("src",e.src)}${s("alt",e.alt)}${s("title",e.caption)}${s("width",e.width===void 0?void 0:String(e.width))}${s("align",e.align)}${s("id",e.id)} />`;const r=e.caption===void 0?"":` "${e.caption.replace(/["\\]/g,"\\$&")}"`;return`![${G(e.alt??"",!1)}](${n}${r})`}case"table":{const n=Math.max(1,...e.rows.map(u=>u.length)),r=u=>`| ${Array.from({length:n},(c,o)=>l(u[o]??[],!0)).join(" | ")} |`,[t,...i]=e.rows,a=[r(t??[]),`| ${Array.from({length:n},()=>"---").join(" | ")} |`,...i.map(r)].join(`
32
- `),d=e.widths?.some(u=>u!==null)?e.widths.map(u=>u===null?"":String(u)).join(","):void 0;return d===void 0&&e.head===void 0&&e.caption===void 0&&e.id===void 0?a:`<${U}${s("widths",d)}${s("head",e.head)}${s("caption",e.caption)}${s("id",e.id)}>
32
+ `),d=e.widths?.some(u=>u!==null)?e.widths.map(u=>u===null?"":String(u)).join(","):void 0;return d===void 0&&e.head===void 0&&e.caption===void 0&&e.id===void 0?a:`<${W}${s("widths",d)}${s("head",e.head)}${s("caption",e.caption)}${s("id",e.id)}>
33
33
 
34
34
  ${a}
35
35
 
36
- </${U}>`}case"divider":return"---";case"component":{const n=t=>t===void 0?void 0:String(t),r=Object.entries(e.props).map(([t,i])=>s(t,i)).join("");return`<${V}${s("of",e.of)}${s("width",n(e.width))}${s("height",n(e.height))}${s("at",n(e.at))}${r}${s("alt",e.alt)}${s("title",e.caption)}${s("align",e.align)}${s("id",e.id)} />`}case"chart":return de(e);case"pagebreak":return`<${Q}${s("orientation",e.orientation)} />`;case"bibliography":return`<${Z} />`;case"toc":return`<${X}${s("levels",e.levels===void 0?void 0:String(e.levels))}${s("title",e.title)} />`;case"note":{const n=l(e.content)||"<br />",r=e.children?.length?`
36
+ </${W}>`}case"divider":return"---";case"component":{const n=t=>t===void 0?void 0:String(t),r=Object.entries(e.props).map(([t,i])=>s(t,i)).join("");return`<${V}${s("of",e.of)}${s("width",n(e.width))}${s("height",n(e.height))}${s("at",n(e.at))}${r}${s("alt",e.alt)}${s("title",e.caption)}${s("align",e.align)}${s("id",e.id)} />`}case"chart":return ae(e);case"pagebreak":return`<${Q}${s("orientation",e.orientation)} />`;case"bibliography":return`<${Z} />`;case"toc":return`<${X}${s("levels",e.levels===void 0?void 0:String(e.levels))}${s("title",e.title)} />`;case"note":{const n=l(e.content)||"<br />",r=e.children?.length?`
37
37
 
38
38
  ${writeBlocks(e.children).split(`
39
39
  `).map(t=>t===""?t:` ${t}`).join(`
40
- `)}`:"";return`[^${e.label}]: ${v(n," ")}${r}`}case"columns":return[`<${N}>`,...e.columns.map(n=>{const r=writeBlocks(n.blocks);return`<${B}${s("width",n.width===void 0?void 0:String(n.width))}>
40
+ `)}`:"";return`[^${e.label}]: ${S(n," ")}${r}`}case"columns":return[`<${U}>`,...e.columns.map(n=>{const r=writeBlocks(n.blocks);return`<${N}${s("width",n.width===void 0?void 0:String(n.width))}>
41
41
 
42
42
  ${r===""?"<br />":r}
43
43
 
44
- </${B}>`}),`</${N}>`].join(`
44
+ </${N}>`}),`</${U}>`].join(`
45
45
 
46
- `);case"embed":case"source":return e.source}}function de(e){const n=$=>$===void 0?void 0:String($),r=$=>$===void 0?void 0:$.join(","),t=e.labels?.length===1&&e.labels[0]==="value"?" labels":s("labels",r(e.labels)),i=[s("type",e.kind),s("title",e.title),s("data",e.data),s("categories",e.categories),s("series",r(e.series)),s("legend",e.legend),t,s("format",e.format),s("min",n(e.min)),s("max",n(e.max)),s("colors",r(e.colors)),e.smooth?" smooth":"",s("width",n(e.width)),s("height",n(e.height)),s("alt",e.alt),s("id",e.id)].join("");if(e.table===void 0)return`<${L}${i} />`;const a=Math.max(1,...e.table.map($=>$.length)),d=$=>`| ${Array.from({length:a},(h,j)=>G($[j]??"",!0)).join(" | ")} |`,[u,...c]=e.table,o=[d(u??[]),`| ${Array.from({length:a},()=>"---").join(" | ")} |`,...c.map(d)].join(`
47
- `);return`<${L}${i}>
46
+ `);case"embed":case"source":return e.source}}function ae(e){const n=f=>f===void 0?void 0:String(f),r=f=>f===void 0?void 0:f.join(","),t=e.labels?.length===1&&e.labels[0]==="value"?" labels":s("labels",r(e.labels)),i=[s("type",e.kind),s("title",e.title),s("data",e.data),s("categories",e.categories),s("series",r(e.series)),s("legend",e.legend),t,s("format",e.format),s("min",n(e.min)),s("max",n(e.max)),s("colors",r(e.colors)),e.smooth?" smooth":"",s("width",n(e.width)),s("height",n(e.height)),s("alt",e.alt),s("id",e.id)].join("");if(e.table===void 0)return`<${O}${i} />`;const a=Math.max(1,...e.table.map(f=>f.length)),d=f=>`| ${Array.from({length:a},(h,j)=>G(f[j]??"",!0)).join(" | ")} |`,[u,...c]=e.table,o=[d(u??[]),`| ${Array.from({length:a},()=>"---").join(" | ")} |`,...c.map(d)].join(`
47
+ `);return`<${O}${i}>
48
48
 
49
49
  ${o}
50
50
 
51
- </${L}>`}export function frontMatterOf(e){const n=F(e);if(Object.keys(n).length===0)return"";const r=new K(n);return Y(r,{Seq:(t,i)=>{i.flow=!0},Map:(t,i,a)=>{a.length>1&&(i.flow=!0)}}),r.toString({lineWidth:0}).trimEnd()}export function withPage(e,n){const r=frontMatterOf(n),t=r===""?"":`---
51
+ </${O}>`}export function frontMatterOf(e){const n=F(e);if(Object.keys(n).length===0)return"";const r=new K(n);return Y(r,{Seq:(t,i)=>{i.flow=!0},Map:(t,i,a)=>{a.length>1&&(i.flow=!0)}}),r.toString({lineWidth:0}).trimEnd()}export function withPage(e,n){const r=frontMatterOf(n),t=r===""?"":`---
52
52
  ${r}
53
53
  ---`,i=e.frontMatter;if(i===void 0){if(t==="")return e.source;const d=e.source.replace(/^\s+/u,"");return d===""?`${t}
54
54
  `:`${t}
@@ -56,13 +56,13 @@ ${r}
56
56
  ${d}`}const a=e.source.slice(i.end).replace(/^\s+/u,"");return t===""?a:a===""?`${t}
57
57
  `:`${t}
58
58
 
59
- ${a}`}function ae(e){const n=e.type==="toggle"||e.type==="heading"&&e.toggle,{children:r}=e,t={...e};delete t.look,delete t.children;const i=t.type==="toggle"?{type:"paragraph",content:t.content}:t.type==="heading"?{type:"heading",level:t.level,content:t.content}:t,a=m(i)||i.type==="quote",d=writeBlocks(a?[{...i,...r?{children:r}:{}}]:[i,...r??[]]);return`<${C}${ne(e.look)}${n?" toggle":""}>
59
+ ${a}`}function oe(e){const n=e.type==="toggle"||e.type==="heading"&&e.toggle,{children:r}=e,t={...e};delete t.look,delete t.children;const i=t.type==="toggle"?{type:"paragraph",content:t.content}:t.type==="heading"?{type:"heading",level:t.level,content:t.content}:t,a=m(i)||i.type==="quote",d=writeBlocks(a?[{...i,...r?{children:r}:{}}]:[i,...r??[]]);return`<${M}${te(e.look)}${n?" toggle":""}>
60
60
 
61
61
  ${d}
62
62
 
63
- </${C}>`}export function continuesList(e,n){return m(e)&&m(n)&&!S(e)&&!S(n)&&e.type==="numbered"==(n.type==="numbered")&&!(n.type==="numbered"&&n.start!==void 0)}export function writeBlocks(e){const n=[];let r=0,t;for(;r<e.length;){const i=e[r];if(i===void 0)break;if(S(i)){n.push(ae(i)),t=void 0,r++;continue}if(!m(i)){n.push(r===0&&i.type==="divider"?"***":ie(i)),t=void 0,r++;continue}const a=i.type==="numbered",d=i.type==="numbered"?i.start??1:1,u=a&&t==="."?")":".",c=[];let o=r;for(;o<e.length;){const h=e[o];if(h===void 0||!m(h)||S(h)||h.type==="numbered"!==a||o>r&&!continuesList(i,h))break;c.push(se(h,d+(o-r),u)),o++}const $=c.some(h=>h.includes(`
63
+ </${M}>`}export function continuesList(e,n){return m(e)&&m(n)&&!v(e)&&!v(n)&&e.type==="numbered"==(n.type==="numbered")&&!(n.type==="numbered"&&n.start!==void 0)}export function writeBlocks(e){const n=[];let r=0,t;for(;r<e.length;){const i=e[r];if(i===void 0)break;if(v(i)){n.push(oe(i)),t=void 0,r++;continue}if(!m(i)){n.push(r===0&&i.type==="divider"?"***":de(i)),t=void 0,r++;continue}const a=i.type==="numbered",d=i.type==="numbered"?i.start??1:1,u=a&&t==="."?")":".",c=[];let o=r;for(;o<e.length;){const h=e[o];if(h===void 0||!m(h)||v(h)||h.type==="numbered"!==a||o>r&&!continuesList(i,h))break;c.push(ie(h,d+(o-r),u)),o++}const f=c.some(h=>h.includes(`
64
64
 
65
- `));n.push(c.join($?`
65
+ `));n.push(c.join(f?`
66
66
 
67
67
  `:`
68
68
  `)),t=a?u:void 0,r=o}return n.join(`
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/doc",
3
- "version": "0.9.0",
3
+ "version": "0.11.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{createHash as M}from"node:crypto";import{mkdir as $,readFile as x,writeFile as D}from"node:fs/promises";import{basename as P,dirname as d,join as p}from"node:path";import{componentDraws as W,componentDrawingKey as O,markdownOf as j,parseDoc as F}from"@allyhub/doc";import{renderDoc as k,renderWord as z}from"@allyhub/doc-print";import{createPackages as C}from"@allyhub/runtimes";export const DOC_TYPES=["pdf","docx","png","md"];async function E(l){const s=C(),e=()=>l?.("Getting docx, once, to write Word documents…"),[i,a]=await Promise.all([s.load("docx",{onFetch:e}),s.load("docx",{module:"fflate",onFetch:e})]);return{docx:i,zip:a}}export async function renderDocFiles(l,s){const e=s.prepared.docs.find(t=>t.place===l.id);if(!e||s.types.length===0)return[];const{root:i,log:a,types:f}=s;a?.(`Rendering ${e.file}…`);const c=[],g={file:e.file,dir:e.dir,path:e.place,title:e.title,data:e.data,sources:e.sources},h=s.prepared.messages.locales[0],m=e.components.length===0?new Map:await s.session.componentStills(e,W(F(await x(p(s.prepared.root,e.file),"utf8")).blocks),h===void 0?{}:{lang:h});if(f.includes("md")){const t=s.out("md"),o=F(await x(p(i,e.file),"utf8"));await $(d(t),{recursive:!0});const r=`${P(t,".md")}.assets`,w=new Map;for(const[n,v]of m){const b=`${M("sha256").update(n).digest("hex").slice(0,16)}.webp`;await $(p(d(t),r),{recursive:!0}),await D(p(d(t),r,b),v),w.set(n,`${r}/${b}`)}await D(t,j(o.blocks,{page:o.page,component:n=>w.get(O(n)),base:e.dir,data:n=>e.data[n],sources:e.sources})),c.push({type:"md",files:[t]})}if(f.includes("docx")){const t=s.out("docx");await z({root:i,doc:g,out:t,...await E(a),stills:m}),c.push({type:"docx",files:[t]})}const y=f.filter(t=>t==="pdf"||t==="png");if(y.length===0)return c;const u=s.out("pdf"),S=await k({root:i,doc:g,out:d(u),name:P(u,".pdf"),types:y,stills:m,onPrinted:t=>{const o=[...t.layout.blocks.values()].filter(r=>r.pastPaper>.1).length;o>0&&a?.(`${e.file}: ${String(o)} block${o===1?" runs":"s run"} past the paper's edge, which cuts ${o===1?"it":"them"}; allyhub inspect pages ${e.place} says where and by how much.`),t.settled||a?.(`${e.file}: its contents' page numbers did not hold after ${String(t.passes)} printings; one may be a page off.`)}});for(const t of S)c.push({type:t.endsWith(".png")?"png":"pdf",files:[p(d(u),t)]});return c}
2
+ import{readFile as x}from"node:fs/promises";import{basename as P,dirname as b,join as m}from"node:path";import{componentDraws as M,parseDoc as w}from"@allyhub/doc";import{PAGE_FACT_DEFAULTS as j,pageFacts as v,printDoc as S,renderDoc as A,renderWord as E}from"@allyhub/doc-print";import{createPackages as T}from"@allyhub/runtimes";export const DOC_TYPES=["pdf","docx","png"];async function W(i){const t=T(),e=()=>i?.("Getting docx, once, to write Word documents…"),[s,a]=await Promise.all([t.load("docx",{onFetch:e}),t.load("docx",{module:"fflate",onFetch:e})]);return{docx:s,zip:a}}export async function renderDocFiles(i,t){const e=t.prepared.docs.find(o=>o.place===i.id);if(!e||t.types.length===0)return[];const{root:s,log:a,types:r}=t;a?.(`Rendering ${e.file}…`);const d=[],p={file:e.file,dir:e.dir,path:e.place,title:e.title,data:e.data,sources:e.sources},f=t.prepared.messages.locales[0],c=e.components.length===0?new Map:await t.session.componentStills(e,M(w(await x(m(t.prepared.root,e.file),"utf8")).blocks),f===void 0?{}:{lang:f});if(r.includes("docx")){const o=t.out("docx");await E({root:s,doc:p,out:o,...await W(a),stills:c}),d.push({type:"docx",files:[o]})}const n=r.filter(o=>o==="pdf"||o==="png"),h=async o=>{const l=w(await x(m(s,e.file),"utf8"));for(const F of pagesLines(e.file,e.place,l,o))a?.(F)};if(n.length===0){if(r.includes("docx")){const o=await S({root:s,doc:p,stills:c});await h(o);for(const l of paperNotes(e.file,o))a?.(l)}return d}const g=t.out("pdf"),$={},D=await A({root:s,doc:p,out:b(g),name:P(g,".pdf"),types:n,stills:c,onPrinted:o=>{$.done=o}}),u=$.done??(r.includes("docx")?await S({root:s,doc:p,stills:c}):void 0);u!==void 0&&await h(u);const y=u===void 0?[]:paperNotes(e.file,u);for(const o of D){const l=o.endsWith(".png")?"png":"pdf";d.push({type:l,files:[m(b(g),o)],...l==="pdf"&&y.length>0?{notes:y}:{}})}return d}export function pagesLines(i,t,e,s){const a=v(e,s.layout,t,{...j,all:!1}),r=n=>`${String(Math.round(n*100))}%`,d=a.flatMap(n=>n.kind==="page-fill"?[n.data]:[]),p=a.flatMap(n=>n.kind==="page-split"?[n.data]:[]),f=s.layout.pages.length,c=[`${i}: ${String(f)} page${f===1?"":"s"} as it prints; left empty at each page's foot: ${d.map(n=>`page ${String(n.page)} ${r(n.share)}`).join(", ")}.`];return p.length>0&&c.push(`${i}: broken over pages: ${p.map(n=>`line ${String(n.line)} ${n.block} (pages ${n.pages.join(", ")})`).join("; ")}.`),c.push(`allyhub inspect pages ${t} has every fact, and a picture of the pages.`),c}export function paperNotes(i,t){const e=[],s=[...t.layout.blocks.values()].filter(a=>a.pastPaper>.1).length;return s>0&&e.push(`${i}: ${String(s)} block${s===1?" runs":"s run"} past the paper's edge, which cuts ${s===1?"it":"them"}.`),t.settled||e.push(`${i}: its contents' page numbers did not hold after ${String(t.passes)} printings; one may be a page off.`),e}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/doc-extension",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./cli": {
@@ -46,14 +46,27 @@
46
46
  },
47
47
  "noun": "doc",
48
48
  "editor": "allyhub.doc.editor",
49
+ "shown": {
50
+ "line": {
51
+ "en": "Briefs, memos and docs, page by page",
52
+ "zh-cn": "简报、备忘录和文档,逐页排版",
53
+ "zh-tw": "簡報、備忘錄和文件,逐頁排版",
54
+ "ja": "ブリーフ、メモ、ドキュメントをページ単位で",
55
+ "ko": "브리프, 메모, 문서를 페이지 단위로",
56
+ "es": "Briefs, memorandos y documentos, página a página",
57
+ "pt": "Briefings, memorandos e documentos, página a página",
58
+ "de": "Briefings, Memos und Dokumente, Seite für Seite",
59
+ "fr": "Briefs, notes et documents, page par page"
60
+ },
61
+ "order": 10
62
+ },
49
63
  "icon": "file-text",
50
64
  "color": "kind-blue",
51
65
  "exports": {
52
66
  "types": [
53
67
  "pdf",
54
68
  "docx",
55
- "png",
56
- "md"
69
+ "png"
57
70
  ],
58
71
  "extras": []
59
72
  },
@@ -61,8 +74,7 @@
61
74
  "types": [
62
75
  "pdf",
63
76
  "docx",
64
- "png",
65
- "md"
77
+ "png"
66
78
  ],
67
79
  "defaults": [
68
80
  "pdf"
@@ -84,7 +96,8 @@
84
96
  "kinds": [
85
97
  "doc"
86
98
  ],
87
- "module": "@allyhub/doc-editor"
99
+ "module": "@allyhub/doc-editor",
100
+ "markup": "./markup"
88
101
  }
89
102
  ],
90
103
  "rules": [
@@ -1,11 +1,11 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{readFile as g}from"node:fs/promises";import{createRequire as w}from"node:module";import{dirname as x,join as l}from"node:path";import{drawHtml as b,openPage as y,startBrowser as m,startServer as v}from"@allyhub/browser";import{createPackages as k}from"@allyhub/runtimes";import{printDoc as j}from"./layout.js";export class DocPageError extends Error{page;count;constructor(a,o){super(`The doc has ${String(o)} page${o===1?"":"s"}: there is no page ${String(a)}.`),this.page=a,this.count=o}}const f=16,S=22;export function placesOf(t){const a=new Map,o=e=>{const r=a.get(e.page);a.set(e.page,r===void 0?{...e}:{page:e.page,top:Math.min(r.top,e.top),bottom:Math.max(r.bottom,e.bottom),left:Math.min(r.left,e.left),right:Math.max(r.right,e.right)})},s=t.boxes[0],n=e=>s===void 0?e:{...e,left:s.left,right:s.right};if(t.lines.length>0){for(const e of t.lines)o(n(e));if(t.end&&o(n(t.end)),s&&t.boxes.length===1)o(s);else if(s){const e=a.get(s.page);e&&(e.top=Math.min(e.top,s.top))}}else if(t.rows.length>0)for(const e of t.rows)o(e);else for(const e of t.boxes)o(e);return[...a.values()].sort((e,r)=>e.page-r.page)}function $(t,a){const o=[],s=[...t.blocks.values()].map(n=>({b:n,places:placesOf(n)}));for(const n of t.pages){o.push({page:n.n,...n.text,label:"",kind:"area"});let e=n.text.top;for(const{b:p,places:c}of s)for(const d of c.filter(i=>i.page===n.n)){e=Math.max(e,d.bottom);const i=a.get(p.n);i!==void 0&&o.push({...d,label:i,kind:"block"})}const r=n.text.bottom-e;r>.5&&o.push({page:n.n,top:e,bottom:n.text.bottom,left:n.text.left,right:n.text.right,label:`${r.toFixed(1)} mm`,kind:"foot"})}return o}function M(t,a,o,s,n){return`<!doctype html><meta charset="utf-8">
2
+ import{readFile as g}from"node:fs/promises";import{createRequire as w}from"node:module";import{dirname as x,join as l}from"node:path";import{drawHtml as b,openPage as y,startBrowser as m,startServer as v}from"@allyhub/browser";import{createPackages as k}from"@allyhub/runtimes";import{printDoc as S}from"./layout.js";export class DocPageError extends Error{page;count;constructor(a,o){super(`The doc has ${String(o)} page${o===1?"":"s"}: there is no page ${String(a)}.`),this.page=a,this.count=o}}const f=16,j=22;export function placesOf(t){const a=new Map,o=e=>{const r=a.get(e.page);a.set(e.page,r===void 0?{...e}:{page:e.page,top:Math.min(r.top,e.top),bottom:Math.max(r.bottom,e.bottom),left:Math.min(r.left,e.left),right:Math.max(r.right,e.right)})},s=t.boxes[0],n=e=>s===void 0?e:{...e,left:s.left,right:s.right};if(t.lines.length>0){for(const e of t.lines)o(n(e));if(t.end&&o(n(t.end)),s&&t.boxes.length===1)o(s);else if(s){const e=a.get(s.page);e&&(e.top=Math.min(e.top,s.top))}}else if(t.rows.length>0)for(const e of t.rows)o(e);else for(const e of t.boxes)o(e);return[...a.values()].sort((e,r)=>e.page-r.page)}function $(t,a){const o=[],s=[...t.blocks.values()].map(n=>({b:n,places:placesOf(n)}));for(const n of t.pages){o.push({page:n.n,...n.text,label:"",kind:"area"});let e=n.text.top;for(const{b:p,places:d}of s)for(const c of d.filter(i=>i.page===n.n)){e=Math.max(e,c.bottom);const i=a.get(p.n);i!==void 0&&o.push({...c,label:i,kind:"block"})}const r=n.text.bottom-e;r>.5&&o.push({page:n.n,top:e,bottom:n.text.bottom,left:n.text.left,right:n.text.right,label:`${r.toFixed(1)} mm`,kind:"foot"})}return o}function M(t,a,o,s,n){return`<!doctype html><meta charset="utf-8">
3
3
  <style>
4
4
  body{margin:0;background:#e7e5e0;font:12px/1 system-ui,sans-serif;color:#57534e}
5
5
  .grid{display:grid;grid-template-columns:repeat(${String(s)},${String(o)}px);gap:${String(f)}px;padding:${String(f)}px;width:max-content}
6
6
  figure{margin:0;position:relative}
7
7
  canvas{display:block;width:${String(o)}px;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.2)}
8
- figcaption{height:${String(S-6)}px;padding-top:6px;text-align:center}
8
+ figcaption{height:${String(j-6)}px;padding-top:6px;text-align:center}
9
9
  .o{position:absolute;box-sizing:border-box;pointer-events:none}
10
10
  .o.area{border:1px dashed rgba(37,99,235,.45)}
11
11
  .o.block{border:1px solid rgba(225,29,72,.7)}
@@ -54,7 +54,7 @@ window.allyhubReady = (async () => {
54
54
  grid.append(figure);
55
55
  }
56
56
  })();
57
- <\/script>`}async function E(t){try{return x(w(import.meta.url).resolve("pdfjs-dist/package.json"))}catch{}const{dir:a}=await k().ensure("pdfjs-dist",{...t===void 0?{}:{onFetch:t}});return l(a,"node_modules","pdfjs-dist")}async function u(t,a){const o=await E(a);return[{at:"/pdf.mjs",body:await g(l(o,"build","pdf.min.mjs")),type:"text/javascript"},{at:"/pdf.worker.mjs",body:await g(l(o,"build","pdf.worker.min.mjs")),type:"text/javascript"},{at:"/doc.pdf",body:t,type:"application/pdf"}]}export async function docPages(t){const a=await j({root:t.root,doc:t.doc,stills:t.stills}),o=a.layout.pages.length,s=a.layout.pages[0],n=t.pages!==void 0&&t.pages.length>0;for(const i of t.pages??[])if(!Number.isInteger(i)||i<1||i>o)throw new DocPageError(i,o);const e=n?[...new Set(t.pages)]:Array.from({length:o},(i,h)=>h+1),r=t.pageWidth??(n?760:360),p=Math.max(1,Math.min(t.columns??(n?2:4),e.length)),c=t.outlines===void 0?[]:$(a.layout,t.outlines),d=await m({gpu:!1,htmlInCanvas:!1});try{const i=await b(d,{html:M(e,o,r,p,c),width:p*r+(p+1)*f,format:t.format??"png",...t.format==="webp"?{quality:90}:{},mounts:await u(a.pdf,t.onFetch)});return{count:o,paper:{width:Math.round(s?.width??210),height:Math.round(s?.height??297)},drawn:e,picture:i,layout:a.layout,printing:{passes:a.passes,settled:a.settled}}}finally{await d.close()}}export async function pagePictures(t,a,o,s){if(a.length===0)return[];const n=await v([...await u(t.pdf,s),{at:"/index.html",body:`<!doctype html><meta charset="utf-8"><script type="module">
57
+ <\/script>`}async function E(t){try{return x(w(import.meta.url).resolve("pdfjs-dist/package.json"))}catch{}const{dir:a}=await k().ensure("pdfjs-dist",{...t===void 0?{}:{onFetch:t}});return l(a,"node_modules","pdfjs-dist")}async function u(t,a){const o=await E(a);return[{at:"/pdf.mjs",body:await g(l(o,"build","pdf.min.mjs")),type:"text/javascript"},{at:"/pdf.worker.mjs",body:await g(l(o,"build","pdf.worker.min.mjs")),type:"text/javascript"},{at:"/doc.pdf",body:t,type:"application/pdf"}]}export async function docPages(t){const a=await S({root:t.root,doc:t.doc,stills:t.stills}),o=a.layout.pages.length,s=a.layout.pages[0],n=t.pages!==void 0&&t.pages.length>0;for(const i of t.pages??[])if(!Number.isInteger(i)||i<1||i>o)throw new DocPageError(i,o);const e=n?[...new Set(t.pages)]:Array.from({length:o},(i,h)=>h+1),r=t.pageWidth??(n?760:360),p=Math.max(1,Math.min(t.columns??(n?2:4),e.length)),d=t.outlines===void 0?[]:$(a.layout,t.outlines),c=await m({gpu:!1,htmlInCanvas:!1});try{const i=await b(c,{html:M(e,o,r,p,d),width:p*r+(p+1)*f,format:t.format??"png",...t.format==="webp"?{quality:90}:{},mounts:await u(a.pdf,t.onFetch)});return{count:o,paper:{width:Math.round(s?.width??210),height:Math.round(s?.height??297)},drawn:e,picture:i,layout:a.layout,printing:{passes:a.passes,settled:a.settled}}}finally{await c.close()}}export async function pagePictures(t,a,o,s,n="webp"){if(a.length===0)return[];const e=await v([...await u(t.pdf,s),{at:"/index.html",body:`<!doctype html><meta charset="utf-8"><script type="module">
58
58
  import * as pdfjs from "/pdf.mjs";
59
59
  pdfjs.GlobalWorkerOptions.workerSrc = "/pdf.worker.mjs";
60
60
  window.drawn = (async () => {
@@ -70,8 +70,8 @@ window.drawn = (async () => {
70
70
  context.fillStyle = "#fff";
71
71
  context.fillRect(0, 0, canvas.width, canvas.height);
72
72
  await page.render({ canvasContext: context, canvas, viewport }).promise;
73
- out.push(canvas.toDataURL("image/webp", 0.9));
73
+ out.push(canvas.toDataURL(${JSON.stringify(`image/${n}`)}, 0.9));
74
74
  }
75
75
  return out;
76
76
  })();
77
- <\/script>`,type:"text/html; charset=utf-8"}]),e=await m({gpu:!1,htmlInCanvas:!1});try{const r=await y(e,{width:800,height:600,allow:n.allow});return await r.goto(`${n.origin}/index.html`),(await r.evaluate("window.drawn")).map(c=>Buffer.from(c.slice(c.indexOf(",")+1),"base64"))}finally{await e.close(),await n.close()}}
77
+ <\/script>`,type:"text/html; charset=utf-8"}]),r=await m({gpu:!1,htmlInCanvas:!1});try{const p=await y(r,{width:800,height:600,allow:e.allow});return await p.goto(`${e.origin}/index.html`),(await p.evaluate("window.drawn")).map(c=>Buffer.from(c.slice(c.indexOf(",")+1),"base64"))}finally{await r.close(),await e.close()}}
@@ -1,11 +1,11 @@
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 _}from"node:os";import{dirname as $,extname as N,join as m,posix as j}from"node:path";import{openPage as M,startBrowser as v}from"@allyhub/browser";import{DRAWN_CODE as w,componentDrawingKey as R,docHtml as J,everyBlock as I,COVER_ASPECT as k,mathHtml as B,pageAccent as T,pageFaces as A,parseDoc as F}from"@allyhub/doc";import{docxOf as H}from"@allyhub/doc/docx";import{drawDiagrams as L,katexCss as V,mathPictures as q}from"./drawn.js";import{docFaces as Q,docFontsCss as Y}from"./fonts.js";import{PdfJoiner as G}from"./pdf.js";const x=(t,e)=>[...new Set([...I(t)].flatMap(a=>a.type==="code"&&a.language===e?[a.code]:[]))];async function K(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:T(e)})}finally{await n.close()}}const X={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml"},Z=/^([a-z][a-z0-9+.-]*:|\/\/)/i,tt=(t,e)=>{const a=t?.get(R(e));return a?{type:"image/webp",bytes:Buffer.from(a)}:void 0};async function z(t,e,a,n={}){const s=new Map,i=[...n.cover===void 0?[]:[n.cover],...[...I(a)].flatMap(r=>r.type==="image"?[r.src]:[])];for(const r of i){if(Z.test(r)||s.has(r))continue;const g=j.normalize(j.join(e.dir,decodeURIComponent(r))),d=X[N(g).toLowerCase()];if(d===void 0||g.startsWith(".."))continue;const o=await S(m(t,g)).catch(()=>{});o&&s.set(r,{type:d,bytes:o})}return s}const U=1600;async function et(t,e,a){const n=await t.evaluate(`(async () => {
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 () => {
3
3
  const image = new Image();
4
4
  image.src = ${JSON.stringify(P(e))};
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(U)}, w);
8
+ const width = Math.min(${String(W)}, w);
9
9
  const height = Math.round(width * ${String(k)});
10
10
  // As object-fit: cover, at object-position 50% y%.
11
11
  const scale = Math.max(width / w, height / h);
@@ -20,16 +20,16 @@ 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(E)});
24
- })()`);if(n===null)return;const s=U;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(m(t,e.file),"utf8"),i=F(s),r=await z(t,e,i.blocks,i.page),g=await K(i.blocks,i.page),d=x(i.blocks,w.math).length>0;return J(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=tt(a,o);return f&&P(f)},fonts:[await Y(s,Q(i.page)),...d?[await V()]:[]].join(`
25
- `),...n.ids===!0?{ids:!0}:{},...n.part===void 0?{}:{part:n.part},headingPage:n.headingPage})}const at={"image/png":"png","image/jpeg":"jpg","image/gif":"gif"},nt=2,E=.92;async function it(t,e){const a=at[e.type],n=await t.evaluate(`(async () => {
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 () => {
26
26
  const image = new Image();
27
27
  image.src = ${JSON.stringify(P(e))};
28
28
  try { await image.decode(); } catch { return null; }
29
29
  const width = image.naturalWidth || 1024;
30
30
  const height = image.naturalHeight || 768;
31
31
  if (${JSON.stringify(a!==void 0)}) return { width, height };
32
- const scale = ${JSON.stringify(e.type==="image/svg+xml"?nt:1)};
32
+ const scale = ${JSON.stringify(e.type==="image/svg+xml"?it:1)};
33
33
  const canvas = document.createElement("canvas");
34
34
  canvas.width = width * scale;
35
35
  canvas.height = height * scale;
@@ -37,8 +37,8 @@ import{mkdir as C,readFile as S,writeFile as D}from"node:fs/promises";import{cpu
37
37
  context.fillStyle = "#fff";
38
38
  context.fillRect(0, 0, canvas.width, canvas.height);
39
39
  context.drawImage(image, 0, 0, canvas.width, canvas.height);
40
- return { width, height, jpeg: canvas.toDataURL("image/jpeg", ${String(E)}) };
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(m(e,a.file),"utf8")),i=await z(e,a,n,s);let r;if([...I(n)].some(c=>c.type==="toc")){const{printDoc:c,headingPages:u}=await import("./layout.js"),b=await c({root:e,doc:a,stills:t.stills}),p=u(b.layout,n);r=y=>p.get(y)}for(const[c,u]of t.stills??[])i.set(`component:${c}`,{type:"image/webp",bytes:Buffer.from(u)});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 u=await L(c,d,{font:A(s).text,accent:T(s)});for(const[h,l]of u)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=>B(h).html));g.forEach(h=>{const l=b.get(B(h).html);l&&o.set(`math:${h}`,{data:l.data,type:"png",width:l.width,height:l.height})});const p=await M(c,{width:900,height:1200,allow:()=>!1});for(const[h,l]of i){const O=await it(p,l);O&&o.set(h,O)}const y=s.cover===void 0?void 0:i.get(s.cover);y&&(f=await et(p,y,s.coverY??50))}finally{await c.close()}}const W=await H(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,W)}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 () => {
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
42
  const k = ${String(e)} / 96;
43
43
  for (const img of document.querySelectorAll("img")) {
44
44
  if (!img.src.startsWith("data:image/") || img.src.startsWith("data:image/svg")) continue;
@@ -59,10 +59,10 @@ import{mkdir as C,readFile as S,writeFile as D}from"node:fs/promises";import{cpu
59
59
  const px = c.getImageData(0, 0, w, h).data;
60
60
  let clear = false;
61
61
  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(E)});
62
+ const src = clear ? canvas.toDataURL("image/png") : canvas.toDataURL("image/jpeg", ${String(M)});
63
63
  if (src.length >= img.src.length) continue;
64
64
  img.src = src;
65
65
  try { await img.decode(); } catch {}
66
66
  }
67
67
  return true;
68
- })()`)}async function st(t){const{cssContentSize:e}=await t.session.send("Page.getLayoutMetrics"),a=await t.session.send("Page.captureScreenshot",{format:"png",clip:{x:0,y:0,width:Math.ceil(e.width),height:Math.ceil(e.height),scale:1},captureBeyondViewport:!0});return Buffer.from(a.data,"base64")}const rt=Math.max(1,Math.min(4,Math.floor(_().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 G.create(t.file),n=t.tagged??!0,s=async i=>{t.signal?.throwIfAborted();const r=await M(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=m(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 M(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 st(a)}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:m(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}
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}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/doc-print",
3
- "version": "0.9.0",
3
+ "version": "0.11.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 Se}from"@allyhub/formats";import{mkdir as Ie,stat as Ae,writeFile as Le}from"node:fs/promises";import{cpus as Pe}from"node:os";import{dirname as je,isAbsolute as Ce,join as j,relative as re,sep as Ne}from"node:path";import{itemKindBuild as Y,usesInOrder as Fe}from"@allyhub/build";import{FILE_TYPES as ae,comboKey as ce,exportProblem as Oe,pieceIs as Re,pieceNamed as de,versionLabel as q}from"@allyhub/piece";import{runCheck as Ee}from"@allyhub/check";import{ConsolePool as Te,mergeConsole as _e,dedupe as le,indexNeeds as De,makeIndex as Ke,CheckSession as ze,OpenedVersion as We,keyedStills as Be,ProjectError as C}from"@allyhub/project";import{batchCsv as He,batchRows as Ve}from"./batch.js";import{processFile as Ye}from"./processors.js";import{batchName as qe,checkName as Ge,exportName as fe,exportNames as Je}from"./names.js";export const exportsAtOnce=e=>Math.max(1,Math.min(e,Math.floor(Pe().length/4)));const G=(e,r)=>`${String(e)} ${r}${e===1?"":"s"}`,pe=(e,r)=>Re({id:e.id,path:e.entry},r);function Qe(e,r){if(e===void 0)return;const o=new Set([...Object.keys(ae),...r.flatMap(a=>a.renders?.types??[])]);for(const a of e)if(!o.has(a))throw new C("bad-type",`Cannot render ${a}.`,"usage",`Types: ${[...o].join(", ")}.`);return[...e]}const Ue=e=>({...e.steps===!0?{steps:!0}:{},...e.pptx==="picture"?{pptx:"picture"}:{}});function ue(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 J(e,r,o,a){const{files:p,type:$,...v}=r,{piece:I,...c}=o,w=p[0]??e,E=(await Promise.all(p.map(N=>Ae(N)))).reduce((N,F)=>N+F.size,0);return{files:[...p],...v,name:we(re(e,w)),path:w,piece:I,type:$,...c,bytes:E,seconds:Math.round((performance.now()-a)/10)/100}}const me=e=>"failure"in e;export function exportProject(e){return ge(e,new Map)}export const MADE_DIR=`${Se}/made`;const D=(e,r)=>`${e}\0${r}`;function he(e,r){return o=>{const a=e?.uses?.find($=>$.of===o);if(!a)return;const p=r.get(D(a.item,a.type))?.[0];if(p)return a.part===void 0?p.path:p.partFiles?.[a.part]}}async function ge(e,r){const o=Qe(e.types,e.kinds);e.name!==void 0&&Ge(e.name);const a=e.params??{},p=Ue(a),$=e.items??[],v=$.length>0,I=x=>$.some(S=>pe(x,S)),c=[],w=[],E=[],N={root:e.root,out:e.out,params:a,...e.log===void 0?{}:{log:e.log},...e.signal===void 0?{}:{signal:e.signal}},F=async x=>{c.push(await Ye(x,e.processors??[],N))},K=()=>ze.open({root:e.root,kinds:e.kinds,...e.gpu===void 0?{}:{gpu:e.gpu},...e.consoleLimit===void 0?{}:{consoleLimit:e.consoleLimit}});let f=await K(),z=!0;const Q={componentStills:(x,S,d)=>Be(S,{prepared:f.prepared,item:x,combo:d,gpu:f.gpu,withSession:L=>L(f)})},U=new Set,X=async(x,S,d)=>{U.has(x)||(U.add(x),await S?.ready?.(d,a))};try{const x=f.prepared.items.filter(n=>!v||I(n)),S=Fe(f.prepared.items,x).filter(n=>!r.has(D(n.item.id,n.type)));if(S.length>0){const n=f.prepared.pieces;z=!1,await f.close();for(const t of S){e.signal?.throwIfAborted();const b=n.find(h=>h.place===t.item.id)?.combos[0];e.log?.(`Making ${t.item.id} as ${t.type} first, which another item uses…`);try{const h=await ge({root:e.root,kinds:e.kinds,items:[t.item.id],types:[t.type],out:j(e.root,MADE_DIR),...b===void 0?{}:{combos:[b]},...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(D(t.item.id,t.type),h.files.filter(u=>u.type===t.type)),w.push(...h.failed)}catch(h){if(e.signal?.aborted===!0)throw h;r.set(D(t.item.id,t.type),[]),w.push({name:t.item.id,piece:t.item.id,type:t.type,code:h instanceof C?h.code:"failed",message:`${t.item.id}, which another item uses, could not be made: ${h.message}`})}}f=await K(),z=!0}const d=f.prepared,L=n=>d.kinds.find(t=>t.id===n)?.renders,O=[];for(const n of d.items){const t=await Y(d.kinds,n);t?.render&&t.onStage!==!0&&O.push({item:n,build:t})}const A=$.filter(n=>!O.some(t=>pe(t.item,n)));for(const n of A)if(!d.pieces.some(t=>de({id:t.id,path:t.place},n)))throw new C("no-item",`No item ${n}.`,"not-found",`Items: ${[...d.pieces.map(t=>t.id),...O.map(t=>t.item.id)].join(", ")||"none"}.`);const Z=v&&A.length===0,ye=new Set(d.pieces.flatMap(n=>L(n.kind)?.types??[])),ee=o?.filter(n=>n in ae||ye.has(n)),ke=Z?[]:d.pieces.filter(n=>A.length===0||A.some(t=>de({id:n.id,path:n.place},t))),W=o?.includes("csv")===!0?ke.filter(n=>n.matrix!==void 0):[];if(o?.includes("csv")===!0&&A.length>0&&W.length===0)throw new C("bad-type",`${A.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 T=[...d.problems];const B=new Te(f.consoleLimit),be=new Set(O.flatMap(n=>ue(d,n.item))),$e=n=>n.where?.file!==void 0&&be.has(n.where.file),te=n=>n.filter(t=>t.level==="error"&&!$e(t)).length;if(!Z&&(ee?.length!==0||W.length>0)&&(d.pieces.length>0||te(d.problems)>0)){e.log?.("Checking…");const n=()=>Ze(f,e.root,A,e.combos);let t=await n();const b=e.index===!1?[]:De(t.results);if(b.length>0){const i=await Ke(d.root,b,e.analyses??[],{env:e.env??process.env,onProgress:et(e.log),signal:e.signal});E.push(...i.failed.map(s=>({file:s.need.file,error:s.error}))),i.done.length>0&&(await f.close(),f=await K(),t=await n())}T=t.problems,B.addReport(t.console);const h=te(t.problems);if(h>0)throw new C("check-failed",`The check found ${G(h,"must-fix problem")}, so nothing is rendered.`,"failed","allyhub check lists them; fix them, then render.");for(const i of W){const s=performance.now(),y=qe(i.id),M=Ve(i,t.wholes,f.prepared.media,Xe(e.root,e.out),e.name);await Ie(je(j(e.out,y)),{recursive:!0}),await Le(j(e.out,y),He(M));const P=t.targets.filter(m=>m.piece===i.id).length;M.length<P&&e.log?.(`${y}: ${G(P-M.length,"ad")} not listed, which did not load (allyhub check says why).`),await F(await J(e.out,{type:"csv",files:[j(e.out,y)]},{piece:i.id},s))}const u=[],R=new Set;for(const i of t.targets){const s=f.prepared.pieces.find(k=>k.id===i.piece);if(!s)continue;if(!v&&s.options.deliverable===!1){R.add(i.piece);continue}const y=L(s.kind),M={kind:s.kind,types:y?.types??[]},P=t.wholes.find(k=>k.piece===i.piece&&ce(k.combo)===i.key&&k.format===i.format)?.speaks??!1,m={piece:i.piece,output:i.output,combo:i.combo,format:i.format,...i.id===void 0?{}:{id:i.id}};for(const k of ee??y?.defaults??[]){const l=Oe({...M,speech:P},k);if(!(l?.code==="bad_type"&&!v)){if(l&&l.code!=="no_speech")throw new C("bad-type",`${q(m)}: ${l.message}`,"usage",l.hint);u.push({target:m,kind:s.kind,type:k,...l?{refused:{name:fe(m,k,p),piece:m.piece,type:k,code:"no-speech",message:`${q(m)}: ${l.message}`,...l.hint?{hint:l.hint}:{}}}:{}})}}}R.size>0&&e.log?.(`Not rendered, shown only inside another video (deliverable: false): ${[...R].join(", ")}. Name one to render it.`);for(const i of new Set(u.map(s=>s.kind)))await X(i,await Y(d.kinds,{kind:i}),u.filter(s=>s.kind===i).map(s=>s.type));const _=Je(u,e.name,p);u.forEach((i,s)=>{i.refused&&(i.refused.name=_[s]??i.refused.name)});const g=[],H=new Array(u.length).fill(0),V=(i,s)=>{H[i]=Math.max(H[i]??0,s),e.onProgress?.(H.reduce((y,M)=>y+M,0)/u.length)};let se=0,ve=0;const Me=async()=>{for(let i=se++;i<u.length;i=se++){e.signal?.throwIfAborted();const s=u[i];if(!s)continue;const y=_[i]??fe(s.target,s.type,p);if(s.refused){w.push(s.refused),V(i,1);continue}const M=await Y(d.kinds,{kind:s.kind}),P=performance.now(),m=await We.open({root:e.root,session:f,item:s.target.piece,combos:[s.target.combo],purpose:"render"});try{const k=await M?.render?.(d.items.find(l=>l.id===m.piece.place)??{id:m.piece.place,kind:s.kind,dir:m.piece.dir,entry:m.piece.file,groups:[]},{root:e.root,prepared:f.prepared,types:[s.type],out:()=>j(e.out,y),params:a,version:m,session:Q,made:he(d.items.find(l=>l.id===m.piece.place),r),onProgress:l=>{V(i,l)},...e.log===void 0?{}:{log:e.log},...e.signal===void 0?{}:{signal:e.signal}})??[{type:s.type,failure:{code:"no-render",message:`${q(s.target)}: its kind (${s.kind}) makes no files.`}}];for(const l of k){if(me(l)){w.push({name:y,piece:s.target.piece,type:s.type,code:l.failure.code,message:l.failure.message,...l.failure.hint?{hint:l.failure.hint}:{}});continue}const oe=await J(e.out,l,{piece:s.target.piece,combo:s.target.combo,key:ce(s.target.combo),format:s.target.format},P);await F(oe),e.log?.(`[${String(++ve)}/${String(u.length)}] ${y} (${oe.seconds.toFixed(1)} s)`)}}finally{g.push(...await m.problems()),B.add(s.target,await m.console()),await m.close(),V(i,1)}}};u.length>0&&e.log?.(`Rendering ${G(u.length,"file")}…`);const ie=(await Promise.allSettled(Array.from({length:exportsAtOnce(u.length)},Me))).find(i=>i.status==="rejected");if(ie)throw ie.reason;T=le([...T,...g])}const xe=n=>d.problems.find(t=>t.level==="error"&&t.where?.file!==void 0&&n.includes(t.where.file)),ne=[];for(const n of O.filter(t=>!v||I(t.item))){const t=xe(ue(d,n.item)),b=L(n.item.kind);t?w.push({name:n.item.id,piece:n.item.id,type:b?.defaults[0]??b?.types[0]??"",code:"check-failed",message:`${t.where?.file??n.item.entry}: ${t.message}`,hint:"Fix it, then render again."}):ne.push(n)}e.signal?.throwIfAborted();for(const{item:n,build:t}of ne){const b=L(n.kind),h=o===void 0?b?.defaults??[]:o.filter(g=>b?.types.includes(g)===!0);if(h.length===0)continue;await X(n.kind,t,h);const u=performance.now(),R=n.id,_=await t.render?.(n,{root:e.root,prepared:f.prepared,types:h,out:g=>j(e.out,`${R}.${g}`),params:a,session:Q,made:he(n,r),...e.log===void 0?{}:{log:e.log},...e.signal===void 0?{}:{signal:e.signal}})??[];for(const g of _)me(g)?w.push({name:n.id,piece:n.id,type:g.type,code:g.failure.code,message:g.failure.message,...g.failure.hint?{hint:g.failure.hint}:{}}):await F(await J(e.out,g,{piece:n.id},u))}return{out:e.out,files:c,failed:w,problems:T,console:B.report(),unindexed:E}}finally{z&&await f.close()}}const we=e=>e.split(Ne).join("/");function Xe(e,r){const o=re(e,r);return o===""?".":o.startsWith("..")||Ce(o)?r:we(o)}async function Ze(e,r,o,a){const p=[];for(const c of o.length>0?o:[void 0])p.push(await Ee({dir:r,session:e,facts:!1,...c===void 0?{}:{piece:c},...a?{combos:[...a]}:{}}));const $=new Set,v=p.flatMap(c=>c.targets).filter(c=>{const w=`${c.piece}\0${c.key}\0${c.format}`;return $.has(w)?!1:($.add(w),!0)}),I=le(p.flatMap(c=>c.problems));return{targets:v,results:p.flatMap(c=>c.results),wholes:p.flatMap(c=>c.wholes),problems:I,errors:I.filter(c=>c.level==="error").length,console:_e(e.consoleLimit,...p.map(c=>c.console))}}function et(e){let r="";return o=>{const a=o.status==="failed"?`Could not index ${o.file}: ${o.message}`:o.message;o.status==="running"&&o.share!==void 0||a!==r&&(r=a,e?.(a))}}
2
+ import{CACHE_DIR as Se}from"@allyhub/formats";import{mkdir as Ie,stat as je,writeFile as Ae}from"node:fs/promises";import{cpus as Le}from"node:os";import{dirname as Pe,isAbsolute as Ce,join as C,relative as ae,sep as Ne}from"node:path";import{itemKindBuild as Y,usesInOrder as Fe}from"@allyhub/build";import{FILE_TYPES as ce,comboKey as de,exportProblem as Oe,pieceIs as Re,pieceNamed as le,versionLabel as q}from"@allyhub/piece";import{runCheck as Ee}from"@allyhub/check";import{ConsolePool as Te,mergeConsole as _e,dedupe as fe,indexNeeds as De,makeIndex as Ke,CheckSession as We,OpenedVersion as ze,keyedStills as Be,ProjectError as A}from"@allyhub/project";import{batchCsv as He,batchRows as Ve}from"./batch.js";import{processFile as Ye}from"./processors.js";import{batchName as qe,checkName as Ge,exportName as pe,exportNames as Je}from"./names.js";export const exportsAtOnce=e=>Math.max(1,Math.min(e,Math.floor(Le().length/4)));const G=(e,r)=>`${String(e)} ${r}${e===1?"":"s"}`,J=(e,r)=>Re({id:e.id,path:e.entry},r);function Qe(e,r){if(e===void 0)return;const o=new Set([...Object.keys(ce),...r.flatMap(c=>c.renders?.types??[])]);for(const c of e)if(!o.has(c))throw new A("bad-type",`Cannot render ${c}.`,"usage",`Types: ${[...o].join(", ")}.`);return[...e]}const Ue=e=>({...e.steps===!0?{steps:!0}:{},...e.pptx==="picture"?{pptx:"picture"}:{}});function me(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 Q(e,r,o,c){const{files:m,type:$,...v}=r,{piece:I,...l}=o,y=m[0]??e,E=(await Promise.all(m.map(N=>je(N)))).reduce((N,F)=>N+F.size,0);return{files:[...m],...v,name:we(ae(e,y)),path:y,piece:I,type:$,...l,bytes:E,seconds:Math.round((performance.now()-c)/10)/100}}const ue=e=>"failure"in e;export function exportProject(e){return ge(e,new Map)}export const MADE_DIR=`${Se}/made`;const D=(e,r)=>`${e}\0${r}`;function he(e,r){return o=>{const c=e?.uses?.find($=>$.of===o);if(!c)return;const m=r.get(D(c.item,c.type))?.[0];if(m)return c.part===void 0?m.path:m.partFiles?.[c.part]}}async function ge(e,r){const o=Qe(e.types,e.kinds);e.name!==void 0&&Ge(e.name);const c=e.params??{},m=Ue(c),$=e.items??[],v=$.length>0,I=x=>$.some(S=>J(x,S)),l=[],y=[],E=[],N={root:e.root,out:e.out,params:c,...e.log===void 0?{}:{log:e.log},...e.signal===void 0?{}:{signal:e.signal}},F=async x=>{l.push(await Ye(x,e.processors??[],N))},K=()=>We.open({root:e.root,kinds:e.kinds,...e.gpu===void 0?{}:{gpu:e.gpu},...e.consoleLimit===void 0?{}:{consoleLimit:e.consoleLimit}});let p=await K(),W=!0;const U={componentStills:(x,S,d)=>Be(S,{prepared:p.prepared,item:x,combo:d,gpu:p.gpu,withSession:L=>L(p)})},X=new Set,Z=async(x,S,d)=>{X.has(x)||(X.add(x),await S?.ready?.(d,c))};try{const x=p.prepared.items.filter(n=>!v||I(n)),S=Fe(p.prepared.items,x).filter(n=>!r.has(D(n.item.id,n.type)));if(S.length>0){const n=p.prepared.pieces;W=!1,await p.close();for(const t of S){e.signal?.throwIfAborted();const g=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 ge({root:e.root,kinds:e.kinds,items:[t.item.id],types:[t.type],out:C(e.root,MADE_DIR),...g===void 0?{}:{combos:[g]},...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(D(t.item.id,t.type),a.files.filter(u=>u.type===t.type)),y.push(...a.failed)}catch(a){if(e.signal?.aborted===!0)throw a;r.set(D(t.item.id,t.type),[]),y.push({name:t.item.id,piece:t.item.id,type:t.type,code:a instanceof A?a.code:"failed",message:`${t.item.id}, which another item uses, could not be made: ${a.message}`})}}p=await K(),W=!0}const d=p.prepared,L=n=>d.kinds.find(t=>t.id===n)?.renders,O=[];for(const n of d.items){const t=await Y(d.kinds,n);t?.render&&t.onStage!==!0&&O.push({item:n,build:t})}const j=$.filter(n=>!O.some(t=>J(t.item,n)));for(const n of j)if(!d.pieces.some(t=>le({id:t.id,path:t.place},n))){const t=d.items.find(a=>J(a,n)),g=t&&d.problems.filter(a=>a.level==="error"&&(a.piece===t.id||a.where?.file===t.entry||(a.where?.file?.startsWith(`${t.dir}/`)??!1)));throw t&&g&&g.length>0?new A("item-failed",`${t.id} could not be made: ${g.map(a=>a.message).join(" ")}`,"failed","allyhub check lists every problem."):new A("no-item",`No item ${n}.`,"not-found",`Items: ${[...d.pieces.map(a=>a.id),...O.map(a=>a.item.id)].join(", ")||"none"}.`)}const ee=v&&j.length===0,ye=new Set(d.pieces.flatMap(n=>L(n.kind)?.types??[])),te=o?.filter(n=>n in ce||ye.has(n)),be=ee?[]:d.pieces.filter(n=>j.length===0||j.some(t=>le({id:n.id,path:n.place},t))),z=o?.includes("csv")===!0?be.filter(n=>n.matrix!==void 0):[];if(o?.includes("csv")===!0&&j.length>0&&z.length===0)throw new A("bad-type",`${j.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 T=[...d.problems];const B=new Te(p.consoleLimit),ke=new Set(O.flatMap(n=>me(d,n.item))),$e=n=>n.where?.file!==void 0&&ke.has(n.where.file),ne=n=>n.filter(t=>t.level==="error"&&!$e(t)).length;if(!ee&&(te?.length!==0||z.length>0)&&(d.pieces.length>0||ne(d.problems)>0)){e.log?.("Checking…");const n=()=>Ze(p,e.root,j,e.combos);let t=await n();const g=e.index===!1?[]:De(t.results);if(g.length>0){const s=await Ke(d.root,g,e.analyses??[],{env:e.env??process.env,onProgress:et(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 K(),t=await n())}T=t.problems,B.addReport(t.console);const a=ne(t.problems);if(a>0)throw new A("check-failed",`The check found ${G(a,"must-fix problem")}, so nothing is rendered.`,"failed","allyhub check lists them; fix them, then render.");for(const s of z){const i=performance.now(),b=qe(s.id),M=Ve(s,t.wholes,p.prepared.media,Xe(e.root,e.out),e.name);await Ie(Pe(C(e.out,b)),{recursive:!0}),await Ae(C(e.out,b),He(M));const P=t.targets.filter(h=>h.piece===s.id).length;M.length<P&&e.log?.(`${b}: ${G(P-M.length,"ad")} not listed, which did not load (allyhub check says why).`),await F(await Q(e.out,{type:"csv",files:[C(e.out,b)]},{piece:s.id},i))}const u=[],R=new Set;for(const s of t.targets){const i=p.prepared.pieces.find(k=>k.id===s.piece);if(!i)continue;if(!v&&i.options.deliverable===!1){R.add(s.piece);continue}const b=L(i.kind),M={kind:i.kind,types:b?.types??[]},P=t.wholes.find(k=>k.piece===s.piece&&de(k.combo)===s.key&&k.format===s.format)?.speaks??!1,h={piece:s.piece,output:s.output,combo:s.combo,format:s.format,...s.id===void 0?{}:{id:s.id}};for(const k of te??b?.defaults??[]){const f=Oe({...M,speech:P},k);if(!(f?.code==="bad_type"&&!v)){if(f&&f.code!=="no_speech")throw new A("bad-type",`${q(h)}: ${f.message}`,"usage",f.hint);u.push({target:h,kind:i.kind,type:k,...f?{refused:{name:pe(h,k,m),piece:h.piece,type:k,code:"no-speech",message:`${q(h)}: ${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(u.map(i=>i.kind)))await Z(s,await Y(d.kinds,{kind:s}),u.filter(i=>i.kind===s).map(i=>i.type));const _=Je(u,e.name,m);u.forEach((s,i)=>{s.refused&&(s.refused.name=_[i]??s.refused.name)});const w=[],H=new Array(u.length).fill(0),V=(s,i)=>{H[s]=Math.max(H[s]??0,i),e.onProgress?.(H.reduce((b,M)=>b+M,0)/u.length)};let se=0,ve=0;const Me=async()=>{for(let s=se++;s<u.length;s=se++){e.signal?.throwIfAborted();const i=u[s];if(!i)continue;const b=_[s]??pe(i.target,i.type,m);if(i.refused){y.push(i.refused),V(s,1);continue}const M=await Y(d.kinds,{kind:i.kind}),P=performance.now(),h=await ze.open({root:e.root,session:p,item:i.target.piece,combos:[i.target.combo],purpose:"render"});try{const k=await M?.render?.(d.items.find(f=>f.id===h.piece.place)??{id:h.piece.place,kind:i.kind,dir:h.piece.dir,entry:h.piece.file,groups:[]},{root:e.root,prepared:p.prepared,types:[i.type],out:()=>C(e.out,b),params:c,version:h,session:U,made:he(d.items.find(f=>f.id===h.piece.place),r),onProgress:f=>{V(s,f)},...e.log===void 0?{}:{log:e.log},...e.signal===void 0?{}:{signal:e.signal}})??[{type:i.type,failure:{code:"no-render",message:`${q(i.target)}: its kind (${i.kind}) makes no files.`}}];for(const f of k){if(ue(f)){y.push({name:b,piece:i.target.piece,type:i.type,code:f.failure.code,message:f.failure.message,...f.failure.hint?{hint:f.failure.hint}:{}});continue}const re=await Q(e.out,f,{piece:i.target.piece,combo:i.target.combo,key:de(i.target.combo),format:i.target.format},P);await F(re),e.log?.(`[${String(++ve)}/${String(u.length)}] ${b} (${re.seconds.toFixed(1)} s)`)}}finally{w.push(...await h.problems()),B.add(i.target,await h.console()),await h.close(),V(s,1)}}};u.length>0&&e.log?.(`Rendering ${G(u.length,"file")}…`);const oe=(await Promise.allSettled(Array.from({length:exportsAtOnce(u.length)},Me))).find(s=>s.status==="rejected");if(oe)throw oe.reason;T=fe([...T,...w])}const xe=n=>d.problems.find(t=>t.level==="error"&&t.where?.file!==void 0&&n.includes(t.where.file)),ie=[];for(const n of O.filter(t=>!v||I(t.item))){const t=xe(me(d,n.item)),g=L(n.item.kind);t?y.push({name:n.item.id,piece:n.item.id,type:g?.defaults[0]??g?.types[0]??"",code:"check-failed",message:`${t.where?.file??n.item.entry}: ${t.message}`,hint:"Fix it, then render again."}):ie.push(n)}e.signal?.throwIfAborted();for(const{item:n,build:t}of ie){const g=L(n.kind),a=o===void 0?g?.defaults??[]:o.filter(w=>g?.types.includes(w)===!0);if(a.length===0)continue;await Z(n.kind,t,a);const u=performance.now(),R=n.id,_=await t.render?.(n,{root:e.root,prepared:p.prepared,types:a,out:w=>C(e.out,`${R}.${w}`),params:c,session:U,made:he(n,r),...e.log===void 0?{}:{log:e.log},...e.signal===void 0?{}:{signal:e.signal}})??[];for(const w of _)ue(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 Q(e.out,w,{piece:n.id},u))}return{out:e.out,files:l,failed:y,problems:T,console:B.report(),unindexed:E}}finally{W&&await p.close()}}const we=e=>e.split(Ne).join("/");function Xe(e,r){const o=ae(e,r);return o===""?".":o.startsWith("..")||Ce(o)?r:we(o)}async function Ze(e,r,o,c){const m=[];for(const l of o.length>0?o:[void 0])m.push(await Ee({dir:r,session:e,facts:!1,...l===void 0?{}:{piece:l},...c?{combos:[...c]}:{}}));const $=new Set,v=m.flatMap(l=>l.targets).filter(l=>{const y=`${l.piece}\0${l.key}\0${l.format}`;return $.has(y)?!1:($.add(y),!0)}),I=fe(m.flatMap(l=>l.problems));return{targets:v,results:m.flatMap(l=>l.results),wholes:m.flatMap(l=>l.wholes),problems:I,errors:I.filter(l=>l.level==="error").length,console:_e(e.consoleLimit,...m.map(l=>l.console))}}function et(e){let r="";return o=>{const c=o.status==="failed"?`Could not index ${o.file}: ${o.message}`:o.message;o.status==="running"&&o.share!==void 0||c!==r&&(r=c,e?.(c))}}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/export",
3
- "version": "0.9.0",
3
+ "version": "0.11.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.9.0",
3
+ "version": "0.11.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 N,declareRules as _,ruleOf as v}from"@allyhub/diagnostics";import{STAGE_LOADS as C}from"@allyhub/formats";import{LOCALES as R}from"@allyhub/i18n";import{PROJECT_TOOLS as A,RuntimeSchema as L,StageFolderSchema as M,StageLoadSchema as W,known as V}from"@allyhub/protocol";import{z as n}from"zod";import{KEY as D,MENUS as K,SETTING_TYPES as j,VIEW_CONTAINERS as p,inMenuBar as U,settingProblem as O,whenProblem as G}from"./shell.js";export const definePoint=e=>e,WordsSchema=n.record(n.string(),n.string().min(1));export function missingLocales(e){return R.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,a]of Object.entries(e)){if(!Array.isArray(a))return`.${s} is not a list.`;a.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=G(e);i!==void 0&&t.addIssue({code:"custom",message:i})}),H=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:H,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 J=n.object({command:y,key:n.string().regex(D,{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:J});const B=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 (${K.join(", ")}), each while its when clause holds.`,entry:B,entries:e=>b(e,"menus","menu"),check:e=>U(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.",F=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:F,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 Y=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:Y,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()]),Z=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()}),X=n.object({title:WordsSchema,order:n.number().int().optional(),properties:n.record(n.string(),Z)});function q(e,t){const i=[],o=(s,a)=>{const d=missingLocales(a);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,a)=>{o(`label of choice ${String(a+1)}`,s)}),t.enumDescriptions?.forEach((s,a)=>{o(`description of choice ${String(a+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:X,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,a]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,a)),!j.includes(a.type)){i.push(`${s} is of type ${a.type}: a shell draws ${j.join(", ")}.`);continue}const d={...a,type:a.type};for(const[u,m]of(a.enum??[]).entries()){const c=O({type:d.type},m);c!==void 0&&i.push(`${s}'s choice ${String(u+1)}: ${c}`)}if(a.default!==void 0){const u=O(d,a.default);u!==void 0&&i.push(`${s}'s default: ${u}`)}for(const u of["enumItemLabels","enumDescriptions"]){const m=a[u];m!==void 0&&m.length!==(a.enum?.length??0)&&i.push(`${s}'s ${u} are ${String(m.length)}, and its choices ${String(a.enum?.length??0)}.`)}}return i}});const Q=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:Q,key:e=>e.name,check:e=>{const t=I(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 ee=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:ee,key:e=>e.name});const ne=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:ne,key:e=>e.name,check:(e,t)=>{if(Object.hasOwn(A,e.name))return[`${e.name} is the core's own project tool.`];const i=e.name.slice(0,e.name.lastIndexOf("/"));return z(t)||i===t?[]:[`the project tool ${e.name} does not start with its extension's id (${t}/…).`]}});const te=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:te,key:e=>e.folder});const oe=n.object({name:n.string().min(1),only:n.array(n.string().min(1)).min(1),values:n.array(n.string().min(1)).optional()}),ie=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!==".."),se=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(),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(oe).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:ie.optional(),share:n.boolean().optional(),build:n.string().min(1).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:se,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[a,d]of Object.entries(e.exports?.names??{})){const u=missingLocales(d);u.length>0&&t.push(`${e.id}'s name for its export ${a} has no words in ${u.join(", ")}.`)}const s=Object.keys(e.starter?.files??{});for(const a of s.filter(d=>!w(d)))t.push(`${e.id}'s starter file ${a} 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 ae=n.object({id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),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"),module:h.optional(),place:n.record(n.string(),n.unknown()).optional()});function I(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:ae,key:e=>e.id,activation:(e,t)=>t==="ui"?[`onEditor:${e.id}`]:[],check:e=>{const t=[],i=e.place&&I(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 a=s===void 0?[]:missingLocales(s);a.length>0&&t.push(`${e.id}'s ${o} has no words in ${a.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.check===void 0?{}:{check:t(i,o.check)},extension:i}])}const re=n.object({id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),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:re,key:e=>e.id});const z=e=>e.startsWith("allyhub.");function $(e,t,i){return z(e)||t.startsWith(`${e}/`)?[]:[`the ${i} ${t} does not start with its extension's id (${e}/…).`]}const de=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:de,key:e=>e.code,check:(e,t)=>{const i=v(e.code);return[...$(t,e.code,"rule"),...i&&i.extension!==t?[`${e.code} is ${i.extension===N?"the core's":`${i.extension}'s`} rule already.`]:[]]},added:(e,t)=>_(t,[e])});const le=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:le,key:e=>e.kind,check:(e,t)=>$(t,e.kind,"kind of fact")});const ce=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:ce});const k=n.string().min(1),ue=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:ue,key:e=>e.name});const me=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:me,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 pe=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:pe,key:e=>e.id,check:(e,t)=>$(t,e.id,"media analysis")});const he=n.object({id:n.string().regex(/^[a-z0-9][a-z0-9-]*$/u),...L.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:he,key:e=>e.id}),SKILL_NAME=/^(?=.{1,64}$)[a-z0-9]+(-[a-z0-9]+)*$/u;const g=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=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 T=n.record(n.string(),n.string()),ge=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:T.default({}),cwd:n.string().min(1).optional()}),n.object({name:n.string().regex(/^[a-z0-9][a-z0-9_-]*$/u),url:n.url(),headers:T.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:ge,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=[],a=()=>{}){const d=c=>{const r=i.filter(l=>l.extension===c).map(l=>t(c,l.entry.module));return r.length>0?r:void 0},u=c=>{const r=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 r.length>0?r:void 0},m=c=>{const r=s.filter(l=>l.extension===c).map(({entry:l})=>({folder:l.folder,loads:l.loads.filter(P=>V(C,P)),module:t(c,l.module),extension:c}));return r.length>0?r:void 0};return e.map(({extension:c,entry:r})=>({id:r.id,editor:r.editor,noun:r.noun,part:r.part,...r.pages===!0?{pages:!0}:{},name:r.name,plural:r.plural,icon:r.icon,color:r.color,exports:r.exports&&{types:r.exports.types,extras:r.exports.extras,options:r.exports.options.map(l=>({name:l.name,only:l.only,...l.values===void 0?{}:{values:l.values}})),...Object.keys(r.exports.names).length===0?{}:{names:r.exports.names}},renders:r.renders&&{types:r.renders.types,defaults:r.renders.defaults},starter:r.starter&&{files:{...r.starter.files},entry:r.starter.entry},share:r.share,build:r.build===void 0?void 0:t(c,r.build),buildPlugins:d(c),projectTools:u(c),stageRoutes:m(c),points:a(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 E=(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 a=t(o);return{name:s.name,command:E(s.command,a),args:s.args.map(d=>E(d,a)),env:Object.fromEntries(Object.entries(s.env).map(([d,u])=>[d,E(u,a)])),cwd:s.cwd===void 0?a: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,RuntimeSchema as M,StageFolderSchema as W,StageLoadSchema as V,known as D}from"@allyhub/protocol";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,a]of Object.entries(e)){if(!Array.isArray(a))return`.${s} is not a list.`;a.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,a)=>{const d=missingLocales(a);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,a)=>{o(`label of choice ${String(a+1)}`,s)}),t.enumDescriptions?.forEach((s,a)=>{o(`description of choice ${String(a+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,a]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,a)),!E.includes(a.type)){i.push(`${s} is of type ${a.type}: a shell draws ${E.join(", ")}.`);continue}const d={...a,type:a.type};for(const[u,m]of(a.enum??[]).entries()){const c=O({type:d.type},m);c!==void 0&&i.push(`${s}'s choice ${String(u+1)}: ${c}`)}if(a.default!==void 0){const u=O(d,a.default);u!==void 0&&i.push(`${s}'s default: ${u}`)}for(const u of["enumItemLabels","enumDescriptions"]){const m=a[u];m!==void 0&&m.length!==(a.enum?.length??0)&&i.push(`${s}'s ${u} are ${String(m.length)}, and its choices ${String(a.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:W,loads:n.array(V),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(),share:n.boolean().optional(),build:n.string().min(1).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[a,d]of Object.entries(e.exports?.names??{})){const u=missingLocales(d);u.length>0&&t.push(`${e.id}'s name for its export ${a} has no words in ${u.join(", ")}.`)}const s=Object.keys(e.starter?.files??{});for(const a of s.filter(d=>!w(d)))t.push(`${e.id}'s starter file ${a} 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"),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 a=s===void 0?[]:missingLocales(s);a.length>0&&t.push(`${e.id}'s ${o} has no words in ${a.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.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),...M.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=[],a=()=>{}){const d=c=>{const r=i.filter(l=>l.extension===c).map(l=>t(c,l.entry.module));return r.length>0?r:void 0},u=c=>{const r=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 r.length>0?r:void 0},m=c=>{const r=s.filter(l=>l.extension===c).map(({entry:l})=>({folder:l.folder,loads:l.loads.filter(N=>D(R,N)),module:t(c,l.module),extension:c}));return r.length>0?r:void 0};return e.map(({extension:c,entry:r})=>({id:r.id,editor:r.editor,noun:r.noun,part:r.part,...r.pages===!0?{pages:!0}:{},name:r.name,plural:r.plural,icon:r.icon,color:r.color,exports:r.exports&&{types:r.exports.types,extras:r.exports.extras,options:r.exports.options.map(l=>({name:l.name,only:l.only,...l.values===void 0?{}:{values:l.values}})),...Object.keys(r.exports.names).length===0?{}:{names:r.exports.names}},renders:r.renders&&{types:r.renders.types,defaults:r.renders.defaults},starter:r.starter&&{files:{...r.starter.files},entry:r.starter.entry},share:r.share,build:r.build===void 0?void 0:t(c,r.build),buildPlugins:d(c),projectTools:u(c),stageRoutes:m(c),points:a(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 a=t(o);return{name:s.name,command:j(s.command,a),args:s.args.map(d=>j(d,a)),env:Object.fromEntries(Object.entries(s.env).map(([d,u])=>[d,j(u,a)])),cwd:s.cwd===void 0?a:i(o,g(s.cwd)),extension:o}});
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/extension-host",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -18,7 +18,7 @@ export interface TrackedFace {
18
18
  */
19
19
  export interface FaceTrack {
20
20
  version: 2;
21
- /** What found the faces: the cloud tool ("find-faces"), never the model behind it. */
21
+ /** What found the faces: the cloud tool ("detect-faces"), never the model behind it. */
22
22
  model: string;
23
23
  /** The displayed picture's pixels the boxes are in. */
24
24
  width: number;