allyhub 0.15.3 → 0.16.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 (382) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/commands/add.js +1 -1
  3. package/dist/commands/cloud-tools.js +1 -1
  4. package/dist/commands/dev.js +5 -5
  5. package/dist/commands/doctor.js +3 -3
  6. package/dist/commands/frames/doc.js +1 -1
  7. package/dist/commands/inspect/common.js +3 -3
  8. package/dist/commands/inspect/facts.js +2 -2
  9. package/dist/commands/inspect/layout.js +1 -1
  10. package/dist/commands/mail.js +6 -6
  11. package/dist/commands/render.js +1 -1
  12. package/dist/main.js +8 -8
  13. package/dist/node_modules/@allyhub/3d-extension/dist/cli/scenery-text.js +2 -2
  14. package/dist/node_modules/@allyhub/3d-extension/package.json +1 -1
  15. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  16. package/dist/node_modules/@allyhub/browser/package.json +1 -1
  17. package/dist/node_modules/@allyhub/build/dist/file-check.d.ts +2 -2
  18. package/dist/node_modules/@allyhub/build/dist/index.d.ts +1 -1
  19. package/dist/node_modules/@allyhub/build/dist/inspect-view.d.ts +1 -1
  20. package/dist/node_modules/@allyhub/build/dist/inspect-view.js +1 -1
  21. package/dist/node_modules/@allyhub/build/dist/prepare.js +3 -3
  22. package/dist/node_modules/@allyhub/build/dist/work.d.ts +9 -1
  23. package/dist/node_modules/@allyhub/build/dist/work.js +3 -3
  24. package/dist/node_modules/@allyhub/build/package.json +1 -1
  25. package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
  26. package/dist/node_modules/@allyhub/canvas-extension/skills/allyhub/references/canvas.md +2 -2
  27. package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
  28. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  29. package/dist/node_modules/@allyhub/check/package.json +1 -1
  30. package/dist/node_modules/@allyhub/cloud/dist/blobs.js +1 -1
  31. package/dist/node_modules/@allyhub/cloud/dist/client.d.ts +12 -3
  32. package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
  33. package/dist/node_modules/@allyhub/cloud/dist/index.d.ts +1 -1
  34. package/dist/node_modules/@allyhub/cloud/dist/index.js +1 -1
  35. package/dist/node_modules/@allyhub/cloud/package.json +1 -1
  36. package/dist/node_modules/@allyhub/components/package.json +1 -1
  37. package/dist/node_modules/@allyhub/dev-server/dist/deletion.js +2 -0
  38. package/dist/node_modules/@allyhub/dev-server/dist/index.js +1 -1
  39. package/dist/node_modules/@allyhub/dev-server/dist/inputs.js +1 -1
  40. package/dist/node_modules/@allyhub/dev-server/dist/project.js +1 -1
  41. package/dist/node_modules/@allyhub/dev-server/dist/record.js +1 -1
  42. package/dist/node_modules/@allyhub/dev-server/dist/writer.js +3 -2
  43. package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
  44. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  45. package/dist/node_modules/@allyhub/doc/package.json +1 -1
  46. package/dist/node_modules/@allyhub/doc-extension/dist/inspect.js +1 -1
  47. package/dist/node_modules/@allyhub/doc-extension/package.json +1 -1
  48. package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
  49. package/dist/node_modules/@allyhub/export/package.json +1 -1
  50. package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
  51. package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
  52. package/dist/node_modules/@allyhub/formats/dist/data/website.js +1 -1
  53. package/dist/node_modules/@allyhub/formats/dist/items.d.ts +30 -4
  54. package/dist/node_modules/@allyhub/formats/dist/items.js +1 -1
  55. package/dist/node_modules/@allyhub/formats/dist/layout.d.ts +15 -4
  56. package/dist/node_modules/@allyhub/formats/dist/layout.js +1 -1
  57. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  58. package/dist/node_modules/@allyhub/i18n/dist/index.js +1 -1
  59. package/dist/node_modules/@allyhub/i18n/package.json +1 -1
  60. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  61. package/dist/node_modules/@allyhub/image-extension/dist/tools.js +1 -1
  62. package/dist/node_modules/@allyhub/image-extension/dist/workspace.js +1 -1
  63. package/dist/node_modules/@allyhub/image-extension/package.json +2 -2
  64. package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +3 -3
  65. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  66. package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
  67. package/dist/node_modules/@allyhub/image-render/package.json +1 -1
  68. package/dist/node_modules/@allyhub/image-runtime/dist/load.js +2 -2
  69. package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
  70. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  71. package/dist/node_modules/@allyhub/jobs/package.json +1 -1
  72. package/dist/node_modules/@allyhub/linkedin-extension/package.json +1 -1
  73. package/dist/node_modules/@allyhub/linkedin-extension/skills/allyhub/references/linkedin.md +1 -1
  74. package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
  75. package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
  76. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  77. package/dist/node_modules/@allyhub/media/package.json +1 -1
  78. package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
  79. package/dist/node_modules/@allyhub/model/package.json +1 -1
  80. package/dist/node_modules/@allyhub/office-extension/LICENSE +241 -0
  81. package/dist/node_modules/@allyhub/office-extension/markup/csv/allyhub.yaml +2 -0
  82. package/dist/node_modules/@allyhub/office-extension/markup/csv/data/leads.csv +5 -0
  83. package/dist/node_modules/@allyhub/office-extension/markup/csv/markup.json +19 -0
  84. package/dist/node_modules/@allyhub/office-extension/markup/document/allyhub.yaml +2 -0
  85. package/dist/node_modules/@allyhub/office-extension/markup/document/briefs/launch.docx +0 -0
  86. package/dist/node_modules/@allyhub/office-extension/markup/document/markup.json +11 -0
  87. package/dist/node_modules/@allyhub/office-extension/markup/presentation/allyhub.yaml +2 -0
  88. package/dist/node_modules/@allyhub/office-extension/markup/presentation/decks/pitch.pptx +0 -0
  89. package/dist/node_modules/@allyhub/office-extension/markup/presentation/markup.json +11 -0
  90. package/dist/node_modules/@allyhub/office-extension/markup/workbook/allyhub.yaml +2 -0
  91. package/dist/node_modules/@allyhub/office-extension/markup/workbook/data/plans.xlsx +0 -0
  92. package/dist/node_modules/@allyhub/office-extension/markup/workbook/markup.json +10 -0
  93. package/dist/node_modules/@allyhub/office-extension/package.json +124 -0
  94. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  95. package/dist/node_modules/@allyhub/piece/dist/source.d.ts +2 -0
  96. package/dist/node_modules/@allyhub/piece/dist/source.js +1 -1
  97. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  98. package/dist/node_modules/@allyhub/project/dist/part-keys.js +1 -1
  99. package/dist/node_modules/@allyhub/project/package.json +1 -1
  100. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +10 -5
  101. package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
  102. package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +7 -0
  103. package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
  104. package/dist/node_modules/@allyhub/protocol/dist/blobs.d.ts +9 -0
  105. package/dist/node_modules/@allyhub/protocol/dist/blobs.js +1 -1
  106. package/dist/node_modules/@allyhub/protocol/dist/cli.d.ts +2 -0
  107. package/dist/node_modules/@allyhub/protocol/dist/cli.js +1 -1
  108. package/dist/node_modules/@allyhub/protocol/dist/cloud-computer.d.ts +77 -0
  109. package/dist/node_modules/@allyhub/protocol/dist/cloud-computer.js +2 -0
  110. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +39 -9
  111. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  112. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +15 -15
  113. package/dist/node_modules/@allyhub/protocol/dist/events.d.ts +441 -5
  114. package/dist/node_modules/@allyhub/protocol/dist/events.js +1 -1
  115. package/dist/node_modules/@allyhub/protocol/dist/files.d.ts +2 -2
  116. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +1 -1
  117. package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +8 -0
  118. package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
  119. package/dist/node_modules/@allyhub/protocol/dist/jobs.d.ts +5 -5
  120. package/dist/node_modules/@allyhub/protocol/dist/kinds.d.ts +15 -0
  121. package/dist/node_modules/@allyhub/protocol/dist/kinds.js +1 -1
  122. package/dist/node_modules/@allyhub/protocol/dist/paywall.d.ts +134 -0
  123. package/dist/node_modules/@allyhub/protocol/dist/paywall.js +2 -0
  124. package/dist/node_modules/@allyhub/protocol/dist/place.js +1 -1
  125. package/dist/node_modules/@allyhub/protocol/dist/presence.d.ts +3 -3
  126. package/dist/node_modules/@allyhub/protocol/dist/purposes.d.ts +47 -0
  127. package/dist/node_modules/@allyhub/protocol/dist/purposes.js +2 -0
  128. package/dist/node_modules/@allyhub/protocol/dist/routes.js +1 -1
  129. package/dist/node_modules/@allyhub/protocol/dist/shares.d.ts +52 -5
  130. package/dist/node_modules/@allyhub/protocol/dist/shares.js +1 -1
  131. package/dist/node_modules/@allyhub/protocol/dist/sidebar-deletion.d.ts +34 -0
  132. package/dist/node_modules/@allyhub/protocol/dist/sidebar-deletion.js +2 -0
  133. package/dist/node_modules/@allyhub/protocol/dist/sites.d.ts +1 -0
  134. package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +21 -52
  135. package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
  136. package/dist/node_modules/@allyhub/protocol/dist/studio-server.d.ts +264 -0
  137. package/dist/node_modules/@allyhub/protocol/dist/studio-server.js +2 -0
  138. package/dist/node_modules/@allyhub/protocol/dist/studio-tool-calls.d.ts +18 -0
  139. package/dist/node_modules/@allyhub/protocol/dist/studio-tool-calls.js +2 -0
  140. package/dist/node_modules/@allyhub/protocol/dist/studio-window-requests.d.ts +97 -0
  141. package/dist/node_modules/@allyhub/protocol/dist/studio-window-requests.js +2 -0
  142. package/dist/node_modules/@allyhub/protocol/dist/teams.d.ts +3 -2
  143. package/dist/node_modules/@allyhub/protocol/dist/teams.js +1 -1
  144. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +20 -20
  145. package/dist/node_modules/@allyhub/protocol/dist/turns.d.ts +71 -0
  146. package/dist/node_modules/@allyhub/protocol/dist/turns.js +2 -0
  147. package/dist/node_modules/@allyhub/protocol/package.json +1 -1
  148. package/dist/node_modules/@allyhub/registry/package.json +1 -1
  149. package/dist/node_modules/@allyhub/render/package.json +1 -1
  150. package/dist/node_modules/@allyhub/runtime/package.json +1 -1
  151. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  152. package/dist/node_modules/@allyhub/scaffold/dist/index.js +4 -4
  153. package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
  154. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  155. package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
  156. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  157. package/dist/node_modules/@allyhub/sheet-extension/dist/cli/sheet.js +1 -1
  158. package/dist/node_modules/@allyhub/sheet-extension/package.json +3 -3
  159. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  160. package/dist/node_modules/@allyhub/slides-extension/dist/cli/slides.js +2 -2
  161. package/dist/node_modules/@allyhub/slides-extension/package.json +2 -2
  162. package/dist/node_modules/@allyhub/slides-pptx/dist/audio-icon.js +1 -1
  163. package/dist/node_modules/@allyhub/slides-pptx/package.json +5 -1
  164. package/dist/node_modules/@allyhub/slides-runtime/dist/draw.js +1 -1
  165. package/dist/node_modules/@allyhub/slides-runtime/dist/slide-css.js +20 -0
  166. package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
  167. package/dist/node_modules/@allyhub/stage/package.json +1 -1
  168. package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.html +1 -1
  169. package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.js +2 -2
  170. package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
  171. package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +15 -15
  172. package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
  173. package/dist/node_modules/@allyhub/telemetry/dist/doc.js +17 -2
  174. package/dist/node_modules/@allyhub/telemetry/dist/level.js +2 -2
  175. package/dist/node_modules/@allyhub/telemetry/dist/levels.js +2 -0
  176. package/dist/node_modules/@allyhub/telemetry/dist/scrub.js +1 -1
  177. package/dist/node_modules/@allyhub/telemetry/package.json +5 -1
  178. package/dist/node_modules/@allyhub/text-extension/markup/markup.json +1 -1
  179. package/dist/node_modules/@allyhub/text-extension/markup-file/allyhub.yaml +2 -0
  180. package/dist/node_modules/@allyhub/text-extension/markup-file/archive/assets.zip +0 -0
  181. package/dist/node_modules/@allyhub/text-extension/markup-file/markup.json +10 -0
  182. package/dist/node_modules/@allyhub/text-extension/package.json +35 -1
  183. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  184. package/dist/node_modules/@allyhub/video-extension/dist/cli/reference-text.js +3 -3
  185. package/dist/node_modules/@allyhub/video-extension/package.json +2 -2
  186. package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
  187. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  188. package/dist/node_modules/@allyhub/website/package.json +1 -1
  189. package/dist/node_modules/@allyhub/website-extension/package.json +1 -1
  190. package/dist/node_modules/@allyhub/x-extension/package.json +1 -1
  191. package/dist/node_modules/@allyhub/x-extension/skills/allyhub/references/x.md +1 -1
  192. package/dist/node_modules/@allyhub/x-model/package.json +1 -1
  193. package/dist/node_modules/@allyhub/x-view/package.json +1 -1
  194. package/dist/package.json +13 -12
  195. package/dist/project.js +1 -1
  196. package/dist/telemetry.js +3 -3
  197. package/dist/text/console-text.js +2 -2
  198. package/editor-web/assets/{abnfDiagram-WEYOIA3C-arPHIJYC.js → abnfDiagram-WEYOIA3C-B1AxOB-Y.js} +1 -1
  199. package/editor-web/assets/{architecture-WOLXFQ4H-XPJlj9Iq.js → architecture-WOLXFQ4H-C-7xKJ2Z.js} +1 -1
  200. package/editor-web/assets/{architectureDiagram-ZHVYKT53-BZNJvOtd.js → architectureDiagram-ZHVYKT53-CyWb8_iD.js} +1 -1
  201. package/editor-web/assets/arrow-down-B8VUPCGi.js +1 -0
  202. package/editor-web/assets/arrow-up-Ds4juY8X.js +1 -0
  203. package/editor-web/assets/{article-Ck2ii-gZ.js → article-CTKW7Eo0.js} +2 -2
  204. package/editor-web/assets/article-qt4W_BKH.js +3 -0
  205. package/editor-web/assets/{audio-lines-1s1eRs4Q.js → audio-lines-PZj77e7t.js} +1 -1
  206. package/editor-web/assets/{bar-button-6Perrucg.js → bar-button-J9vbfzTx.js} +1 -1
  207. package/editor-web/assets/{blockDiagram-RJAE7QA3-B4L2P9Zz.js → blockDiagram-RJAE7QA3-uii4-7Ix.js} +4 -4
  208. package/editor-web/assets/browser-C1XuTMlp.js +1 -0
  209. package/editor-web/assets/{c4Diagram-XDPPPE54-D5t2-Sm8.js → c4Diagram-XDPPPE54-BtL5Z-wF.js} +1 -1
  210. package/editor-web/assets/channel-dEO-yacZ.js +1 -0
  211. package/editor-web/assets/chart-amT4lgX3.js +2 -0
  212. package/editor-web/assets/chart-file-HE-uXGmJ.js +1 -0
  213. package/editor-web/assets/{chart-no-axes-column-CJmeYOSo.js → chart-no-axes-column-Be0lFcGF.js} +1 -1
  214. package/editor-web/assets/{chunk-2E7WHVMD-bWUHKM6h.js → chunk-2E7WHVMD-BJjuZYBs.js} +1 -1
  215. package/editor-web/assets/{chunk-4EMNKR2T-CGGaxE7r.js → chunk-4EMNKR2T-nzPdUHaI.js} +1 -1
  216. package/editor-web/assets/{chunk-55XCU76K-BXCHI3wC.js → chunk-55XCU76K-CH52E3Nl.js} +1 -1
  217. package/editor-web/assets/{chunk-7S6XSTFO-H4tWSKhS.js → chunk-7S6XSTFO-Ba4LNKCV.js} +1 -1
  218. package/editor-web/assets/{chunk-AQDTSKZB-kyBZy8vG.js → chunk-AQDTSKZB-Co9SmoqD.js} +1 -1
  219. package/editor-web/assets/chunk-DSNLSHJZ-BHRvxRGi.js +127 -0
  220. package/editor-web/assets/{chunk-HAGFOTED-P8dIUq9O.js → chunk-HAGFOTED-F5Wd8ETY.js} +1 -1
  221. package/editor-web/assets/{chunk-HNE4Q36P-B_BAZXMj.js → chunk-HNE4Q36P-C_E0__p9.js} +1 -1
  222. package/editor-web/assets/{chunk-NQOKRVIF-Bubl63jI.js → chunk-NQOKRVIF-BvrtbbWm.js} +17 -17
  223. package/editor-web/assets/{chunk-UHW7PFBP-DYGk0ZDz.js → chunk-UHW7PFBP-D0HTPXRF.js} +1 -1
  224. package/editor-web/assets/{chunk-VQ5W62QI-BLFRyEGi.js → chunk-VQ5W62QI-B9hF2YMk.js} +1 -1
  225. package/editor-web/assets/{chunk-WQQL4CDK-kiwalF_c.js → chunk-WQQL4CDK-D7N3o-Ub.js} +1 -1
  226. package/editor-web/assets/{chunk-YZO67HFG-D-bT0L2N.js → chunk-YZO67HFG-XaLSrI_W.js} +1 -1
  227. package/editor-web/assets/{chunk-ZAUX2LTX-C_P5nPKV.js → chunk-ZAUX2LTX-sXc6qmw-.js} +1 -1
  228. package/editor-web/assets/{chunk-ZCHMQSOR-Deizt1PO.js → chunk-ZCHMQSOR-B0X6sNMX.js} +1 -1
  229. package/editor-web/assets/{classDiagram-v2-4MYWR3UA-PUtBnliw.js → classDiagram-v2-4MYWR3UA-CjXVvOUp.js} +7 -7
  230. package/editor-web/assets/code-CD-CbJG9.js +1 -0
  231. package/editor-web/assets/{collaborator--S95EupA.js → collaborator-BU4qU7O3.js} +1 -1
  232. package/editor-web/assets/{copy-DvOiv9Ra.js → copy-CuJSs0nI.js} +1 -1
  233. package/editor-web/assets/{createLucideIcon-REX213UO.js → createLucideIcon-lm_6n8YT.js} +1 -1
  234. package/editor-web/assets/csv-Bwre9FdI.js +11 -0
  235. package/editor-web/assets/{cynefin-EF2NZ3EQ-C09G_QFD.js → cynefin-EF2NZ3EQ-PQ9VyM9v.js} +1 -1
  236. package/editor-web/assets/{cynefinDiagram-WF24UDRP-JxxJ5-Ov.js → cynefinDiagram-WF24UDRP-KXuXFAhX.js} +1 -1
  237. package/editor-web/assets/{dagre-NK4GIZVX-6DkhWeGP.js → dagre-NK4GIZVX-CBTyfYD5.js} +1 -1
  238. package/editor-web/assets/deck-C-p17098.js +1 -0
  239. package/editor-web/assets/{diagram-CBK3MWTC-kI_Q07du.js → diagram-CBK3MWTC-CsVO64Bf.js} +1 -1
  240. package/editor-web/assets/{diagram-I5XIIV2D-FYaR41qP.js → diagram-I5XIIV2D-fzbUm1St.js} +1 -1
  241. package/editor-web/assets/{diagram-ODIL2UCW-29WBGOdl.js → diagram-ODIL2UCW-up6ihgN5.js} +1 -1
  242. package/editor-web/assets/{diagram-PFBEJUXE-BFZJ9s9P.js → diagram-PFBEJUXE-T6hVBoCD.js} +1 -1
  243. package/editor-web/assets/{diagram-RJA3I4VV-BSNFe4e-.js → diagram-RJA3I4VV-BDntFeuR.js} +1 -1
  244. package/editor-web/assets/{diagram-TYUNFSNR-Cb1wZgqj.js → diagram-TYUNFSNR-Dv1-mqbf.js} +16 -16
  245. package/editor-web/assets/dist-B-lYrbqX.js +43 -0
  246. package/editor-web/assets/dist-B94TkgAP.js +18 -0
  247. package/editor-web/assets/dist-BW8IR8bR.js +17 -0
  248. package/editor-web/assets/dist-Ba5Kv4A-.js +4 -0
  249. package/editor-web/assets/{dist-BrGYx10E.js → dist-Bd8IxQPP.js} +1 -1
  250. package/editor-web/assets/dist-Bfs4cZI_.js +24 -0
  251. package/editor-web/assets/dist-C66KgS8g.js +19 -0
  252. package/editor-web/assets/dist-CBeeIAlh.js +1 -0
  253. package/editor-web/assets/{dist-DXUMNYNX.js → dist-CHKVUdcE.js} +4 -4
  254. package/editor-web/assets/dist-CWXGbcPB.js +3 -0
  255. package/editor-web/assets/{dist-BaCVkpwc.js → dist-D3C6FyrO.js} +1 -1
  256. package/editor-web/assets/{dist-BuG-vxxb.js → dist-DhMagA-B.js} +3 -3
  257. package/editor-web/assets/{dist-BlqK1Oua.js → dist-DruvDNQe.js} +1 -1
  258. package/editor-web/assets/dist-DxcrMrCR.js +6 -0
  259. package/editor-web/assets/dist-DzjSp2i2.js +17 -0
  260. package/editor-web/assets/{dist-CnbKC_fW.js → dist-_ooK0TT9.js} +1 -1
  261. package/editor-web/assets/dist-aTV6Rwon.js +530 -0
  262. package/editor-web/assets/dist-mrWPE-br.js +1 -0
  263. package/editor-web/assets/docx-draw-CeiLkccT.js +4 -0
  264. package/editor-web/assets/docx-preview-pcg9ioe3.js +21 -0
  265. package/editor-web/assets/{ebnfDiagram-V4P3TTPT-t3vO5qHB.js → ebnfDiagram-V4P3TTPT-CZzljBYN.js} +1 -1
  266. package/editor-web/assets/{elk-QONTBCTQ-DfIcGBDb.js → elk-QONTBCTQ-6vNb82av.js} +1 -1
  267. package/editor-web/assets/{erDiagram-KYQIGQAA-Bgy1PYQf.js → erDiagram-KYQIGQAA-B8smxURG.js} +2 -2
  268. package/editor-web/assets/esm-CNi9O1ya.js +21 -0
  269. package/editor-web/assets/{eventmodeling-K75KTNOO-b8j935GM.js → eventmodeling-K75KTNOO-CngIhoUF.js} +1 -1
  270. package/editor-web/assets/{file-exclamation-point-C_fX4fpI.js → file-exclamation-point-_L3ElCJ5.js} +1 -1
  271. package/editor-web/assets/file-question-mark-DlIjUK37.js +1 -0
  272. package/editor-web/assets/flowDiagram-IUGLLWBU-CL0AVU4Y.js +1 -0
  273. package/editor-web/assets/{ganttDiagram-R7GPNTJY-B6C_nkwn.js → ganttDiagram-R7GPNTJY-BtzqHUiP.js} +1 -1
  274. package/editor-web/assets/{gitGraph-VSP46ZUC-CWtulOri.js → gitGraph-VSP46ZUC-DOOpoQDh.js} +1 -1
  275. package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-BT80Z9gj.js → gitGraphDiagram-PDYL7XHY-Cu4T8UUo.js} +1 -1
  276. package/editor-web/assets/{group-pebHQTdP.js → group-BdrTp7gi.js} +1 -1
  277. package/editor-web/assets/{hint-CKIaljPY.js → hint-rlht0uxG.js} +1 -1
  278. package/editor-web/assets/index-BCjGdcPh.js +28 -0
  279. package/editor-web/assets/index-D9ng69En.css +2 -0
  280. package/editor-web/assets/{info-OHQRW6UA-CyWiLOaB.js → info-OHQRW6UA-CiNozx0c.js} +1 -1
  281. package/editor-web/assets/{infoDiagram-MVDRKAX5-3TQgBeRh.js → infoDiagram-MVDRKAX5-A3mxzTmc.js} +1 -1
  282. package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-C3RAGFl7.js → ishikawaDiagram-HPEHV2GE-CIbVgY0Z.js} +1 -1
  283. package/editor-web/assets/iso-ahTwmFwH.js +56 -0
  284. package/editor-web/assets/{italic-CtlNOXN9.js → italic-zw4_eUNF.js} +1 -1
  285. package/editor-web/assets/{journeyDiagram-BOSHW7O7-B3ZJp3pT.js → journeyDiagram-BOSHW7O7-BwPXFmyS.js} +1 -1
  286. package/editor-web/assets/{kanban-definition-FNSA4HC5-ChjUoDH7.js → kanban-definition-FNSA4HC5-biRlEeb1.js} +4 -4
  287. package/editor-web/assets/{link-CW2KxKT_.js → link-DopSU3aa.js} +1 -1
  288. package/editor-web/assets/{mermaid-parser.core-CqJ7hTUI.js → mermaid-parser.core-ikwPmNne.js} +3 -3
  289. package/editor-web/assets/mermaid.core-B4GR7QVa.js +44 -0
  290. package/editor-web/assets/{mindmap-definition-6OY57UG3-Di0DNds3.js → mindmap-definition-6OY57UG3-BN8aiUmO.js} +3 -3
  291. package/editor-web/assets/minus-CbPnUIOy.js +1 -0
  292. package/editor-web/assets/{packet-JDAUHWVQ-CkCyk5LQ.js → packet-JDAUHWVQ-DWesZv6p.js} +1 -1
  293. package/editor-web/assets/{pegDiagram-ECIUJNBX-DGyUszOM.js → pegDiagram-ECIUJNBX-Bh3QEAL_.js} +1 -1
  294. package/editor-web/assets/{pie-XZMESJXO-D56l6NOA.js → pie-XZMESJXO-DT1ANL51.js} +1 -1
  295. package/editor-web/assets/{pieDiagram-GNMPY74T-C6Gy4c9c.js → pieDiagram-GNMPY74T-xXxgiv6O.js} +1 -1
  296. package/editor-web/assets/{progress-I2qmIfF4.js → progress-CwKcXARv.js} +1 -1
  297. package/editor-web/assets/props-form-BwZY8ZWd.js +1 -0
  298. package/editor-web/assets/purify.es-B9ve_eFf.js +3 -0
  299. package/editor-web/assets/{quadrantDiagram-D57K4MC3-CWfkAwXQ.js → quadrantDiagram-D57K4MC3-BGzRd8iZ.js} +1 -1
  300. package/editor-web/assets/{radar-ABXABTNO-BhyQtVw_.js → radar-ABXABTNO-C-rmMB0D.js} +1 -1
  301. package/editor-web/assets/{railroad-I3PHUGI6-CyOyOgY6.js → railroad-I3PHUGI6-CvLOq2i8.js} +1 -1
  302. package/editor-web/assets/{railroad-abnf-LNEFI6M7-ExhYWNk4.js → railroad-abnf-LNEFI6M7-DMsb025s.js} +1 -1
  303. package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-B7vR6DFd.js → railroad-ebnf-DWYD2UWJ-5bvVcIvh.js} +1 -1
  304. package/editor-web/assets/{railroad-peg-JR7BVNR7-hqCnhLuG.js → railroad-peg-JR7BVNR7-LKZ9-9ja.js} +1 -1
  305. package/editor-web/assets/{railroadDiagram-Y72NRBL7-D5X_R2ve.js → railroadDiagram-Y72NRBL7-DVBhzkmC.js} +1 -1
  306. package/editor-web/assets/{react-Bk7NnOLX.js → react-Edyoga_4.js} +1 -1
  307. package/editor-web/assets/{requirementDiagram-EQYSW5RA-CIP8sDsk.js → requirementDiagram-EQYSW5RA-B5RyzWna.js} +1 -1
  308. package/editor-web/assets/{row-k2eAfT-g.js → row-C_svyL8o.js} +1 -1
  309. package/editor-web/assets/{sankeyDiagram-SY24JHO5-BKDJlzrK.js → sankeyDiagram-SY24JHO5-BvOJG-gB.js} +1 -1
  310. package/editor-web/assets/schemas-BmdNnDyt.js +1 -0
  311. package/editor-web/assets/{scissors-BURkYWPv.js → scissors-B_xOiUhd.js} +1 -1
  312. package/editor-web/assets/{search-jKDvFIEU.js → search-Ba2BbT6T.js} +1 -1
  313. package/editor-web/assets/{sequenceDiagram-BLEHNHQU-CkRLYFZ7.js → sequenceDiagram-BLEHNHQU-BI7-Daqy.js} +1 -1
  314. package/editor-web/assets/{session-CUCSWPTE.js → session-D8E3nUwU.js} +1 -1
  315. package/editor-web/assets/{sigma-CY2Chbro.js → sigma-DSUsJhMn.js} +1 -1
  316. package/editor-web/assets/slides-bj0WJT_G.js +1 -0
  317. package/editor-web/assets/snapshots-CuflsO8Q.js +1 -0
  318. package/editor-web/assets/{sound-DUCxe9eC.js → sound-bTlco_K3.js} +1 -1
  319. package/editor-web/assets/{split-Cjm6rVDC.js → split-BrF9ECYb.js} +2 -2
  320. package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-CCvwoTcz.js → stateDiagram-v2-A6IESKWZ-C01p8WHX.js} +7 -7
  321. package/editor-web/assets/{sticky-note-C5qUDHhC.js → sticky-note-BdkIu5_D.js} +1 -1
  322. package/editor-web/assets/{strikethrough-DP-7tMz0.js → strikethrough-BwXWi4zg.js} +1 -1
  323. package/editor-web/assets/{surface-BocGwSox.js → surface-DtCjIlrq.js} +1 -1
  324. package/editor-web/assets/svg-CWIBMIQ9.js +1 -0
  325. package/editor-web/assets/{swatch-DGdJ5SeN.js → swatch-DhztHwPU.js} +1 -1
  326. package/editor-web/assets/{swimlanes-B3ENRKFQ-BXgW4pi4.js → swimlanes-B3ENRKFQ-B00P2SqG.js} +1 -1
  327. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-ChmNuO4G.js +8 -0
  328. package/editor-web/assets/{switch-Dwqxw1kp.js → switch-8MU4Nfxe.js} +1 -1
  329. package/editor-web/assets/{syntax-DSsHrzWF.js → syntax-CU_WPKxt.js} +1 -1
  330. package/editor-web/assets/{table-CTjNpE4W.js → table-DRbddzx0.js} +1 -1
  331. package/editor-web/assets/tabs-CloHB5Z4.js +1 -0
  332. package/editor-web/assets/tag-CIfWT8B_.js +1 -0
  333. package/editor-web/assets/text-align-start-Cic2-TLh.js +1 -0
  334. package/editor-web/assets/{textarea-BNH6Y1-o.js → textarea-D7TnPwv1.js} +1 -1
  335. package/editor-web/assets/{timeline-definition-JXYKGLGB-BwuUmgv1.js → timeline-definition-JXYKGLGB-BIBoOYJY.js} +3 -3
  336. package/editor-web/assets/{treeView-D4JQ5SDB-Da35tnkE.js → treeView-D4JQ5SDB-CL6DL8V0.js} +1 -1
  337. package/editor-web/assets/{treemap-SAJKECNS-4TcJReov.js → treemap-SAJKECNS-CPLGr0WY.js} +1 -1
  338. package/editor-web/assets/{undo-2-DUGGyBdX.js → undo-2-C47jrRp5.js} +1 -1
  339. package/editor-web/assets/{usecaseDiagram-WPOLBNNX-wj02og_C.js → usecaseDiagram-WPOLBNNX-L03lK2bO.js} +1 -1
  340. package/editor-web/assets/{vennDiagram-Q3Y3IDCW-Cun6o3pg.js → vennDiagram-Q3Y3IDCW-B5tKKP_-.js} +3 -3
  341. package/editor-web/assets/{video-DkuN7Uu7.js → video-BWUznyLR.js} +1 -1
  342. package/editor-web/assets/{wardley-7MLQ67FV-DiL2aSXm.js → wardley-7MLQ67FV-vsBpXT56.js} +1 -1
  343. package/editor-web/assets/{wardleyDiagram-IVAIDKWA-Cll7rTnv.js → wardleyDiagram-IVAIDKWA-CMCnVUgh.js} +1 -1
  344. package/editor-web/assets/{whole-word-6DliXke2.js → whole-word-D3ZAtnkw.js} +1 -1
  345. package/editor-web/assets/{words-QKSIyC_P.js → words-0Ww2RyT4.js} +1 -1
  346. package/editor-web/assets/{words-B-7GbYO2.js → words-XlXG79Ur.js} +1 -1
  347. package/editor-web/assets/workbook-C1QR6Cts.js +45 -0
  348. package/editor-web/assets/x-DlhyIKuu.js +41 -0
  349. package/editor-web/assets/{xychartDiagram-4URNHDU4-s55eVncs.js → xychartDiagram-4URNHDU4-C9XkBiEO.js} +1 -1
  350. package/editor-web/assets/{zoom-in-C4lxmIDE.js → zoom-in-PgsC94hP.js} +1 -1
  351. package/editor-web/index.html +8 -7
  352. package/package.json +2 -2
  353. package/editor-web/assets/arrow-down-DzZjFrBL.js +0 -1
  354. package/editor-web/assets/arrow-up-hdmh9LVD.js +0 -1
  355. package/editor-web/assets/article-v30Q5cvX.js +0 -3
  356. package/editor-web/assets/channel-B8881pqR.js +0 -1
  357. package/editor-web/assets/chart-BC3kUUDD.js +0 -2
  358. package/editor-web/assets/chunk-DSNLSHJZ-BlB7YIMo.js +0 -129
  359. package/editor-web/assets/code-BID_OoRp.js +0 -1
  360. package/editor-web/assets/dist-B3RkByp0.js +0 -1
  361. package/editor-web/assets/dist-BAeqmRLA.js +0 -530
  362. package/editor-web/assets/dist-CGJv5-SE.js +0 -45
  363. package/editor-web/assets/dist-CUdvgRW5.js +0 -1
  364. package/editor-web/assets/dist-DhKxOqdu.js +0 -43
  365. package/editor-web/assets/dist-Dx2yV02v.js +0 -6
  366. package/editor-web/assets/dist-QuK0-suW.js +0 -24
  367. package/editor-web/assets/dist-Sl2_j-4w.js +0 -38
  368. package/editor-web/assets/dist-b5nFx4mV.js +0 -3
  369. package/editor-web/assets/dist-tteqAu5L.js +0 -4
  370. package/editor-web/assets/flowDiagram-IUGLLWBU-CnzC5OOy.js +0 -1
  371. package/editor-web/assets/index-C3A0pCmH.css +0 -2
  372. package/editor-web/assets/index-CFqSJBZ-.js +0 -28
  373. package/editor-web/assets/mermaid.core-DR2O-coV.js +0 -44
  374. package/editor-web/assets/minus-D1tgAHbU.js +0 -1
  375. package/editor-web/assets/props-form-gwp-8pGV.js +0 -1
  376. package/editor-web/assets/schemas-B89k2jEC.js +0 -1
  377. package/editor-web/assets/slides-BdaWgL_N.js +0 -1
  378. package/editor-web/assets/snapshots-CTS2iez5.js +0 -56
  379. package/editor-web/assets/svg-nJtFNJ-7.js +0 -1
  380. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-AFpLq-Wf.js +0 -8
  381. package/editor-web/assets/tabs-B0bv2mMP.js +0 -1
  382. package/editor-web/assets/x-BsePFh6d.js +0 -41
package/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  Feature highlights from each AllyHub release.
4
4
 
5
+ ## 0.16.0
6
+
7
+ - **One Studio on your Mac and in the cloud.** The app opens the same Studio as AllyHub in the cloud, with your projects and conversations as they were.
8
+ - **Your files open in Studio.** CSV, Excel, PowerPoint and Word files open to read, and everything has Download.
9
+ - **Delete from the sidebar.** What you delete goes to the project's trash, where your agent can bring it back.
10
+ - **Pictures you add stay in the project.** Your agent can use a photo you paste in what it makes, not only look at it, and it answers in the language you write in.
11
+ - **Your PowerPoint and Excel files stay editable.** One you give your agent becomes a deck or a sheet you can edit, downloaded as the file again.
12
+ - **An example project to start from**, with a doc, a sheet, a deck, images and a video.
13
+
5
14
  ## 0.15.3
6
15
 
7
16
  - **The editor keeps running after the agent's turn ends.** `allyhub dev` now returns once the page is up and serves in the background; `allyhub dev --stop` stops it, and `--foreground` serves until Ctrl+C as before.
@@ -2,5 +2,5 @@
2
2
  import{readFile as Y}from"node:fs/promises";import{join as x,posix as B,relative as V}from"node:path";import{fileURLToPath as W}from"node:url";import{z as h}from"zod";import{modelInfo as q}from"@allyhub/build";import{COMPONENTS_DIR as I}from"@allyhub/formats";import{EXIT as f}from"@allyhub/protocol";import{ASSET_DEFAULTS as G,ASSET_TYPES as K,PolyHaven as X,PolyHavenError as Z,RegistryError as J,applyAdd as T,fetchBakes as Q,folderRegistry as D,planAdd as L,searchIndex as O}from"@allyhub/registry";import{cacheHome as ee}from"@allyhub/runtimes";import{CLI_VERSION as te}from"../cli-version.js";import{CommandError as S,defineCommand as C}from"../command.js";import{projectRoot as ne}from"../project.js";import{dir as oe}from"../fields.js";import{resourcesIndex as R}from"../resources.js";const _=W(new URL(".",import.meta.resolve("@allyhub/components/registry.json"))),se=Object.keys(K),A=["component","3d-model","scenery","skill","template","lib","@polyhaven"],ae={"allyhub:component":"component","allyhub:model":"3d-model","allyhub:scenery":"scenery","allyhub:skill":"skill","allyhub:template":"template","allyhub:lib":"lib"},H=e=>ae[e]??e.replace(/^allyhub:/u,""),E=e=>`${H(e.type)}/${e.name}`;function ie(e){const n=/^(@?[a-z0-9-]+)\/(.+)$/u.exec(e),i=A.find(d=>d===n?.[1]);if(i===void 0||n?.[2]===void 0)throw new S("usage",n===null?`Name what to add as <type>/<name>: ${e} has no type.`:`${n[1]??""} is not a type: name what to add as <type>/<name>.`,{exit:f.usage,hint:`Types: ${A.join(", ")} (3d-model/monitor, scenery/home-desk-demo-day, skill/web-product-demos, component/caption-line, @polyhaven/<id>). allyhub add lists every one.`});return{type:i,name:n[2]}}const le={"allyhub:model":"3D models","allyhub:scenery":"3D sceneries","allyhub:skill":"Skills","allyhub:template":"Templates","allyhub:component":"Components","allyhub:lib":"Libs (added with what uses them)"};function F(e,n){if(e.from==="none")return["AllyHub's resources (models, sceneries) could not be read: check the connection."];const i=n??e.index?.items??[],d=Math.max(0,...i.map(s=>E(s).length)),r=[`AllyHub's resources (allyhub add <type>/<name> copies one with what it needs, its Poly Haven assets and its baked light)${e.from==="stale"?", as last read (the registry cannot be read now)":""}:`];for(const[s,p]of Object.entries(le)){const c=i.filter(u=>u.type===s);c.length!==0&&r.push(` ${p}:`,...c.map(u=>` ${E(u).padEnd(d)} ${u.description}`))}return r}const N=20,z=e=>e.replace(/\.(?:ts|js)$/u,"").replaceAll(/[A-Z]/gu,n=>`-${n.toLowerCase()}`).replace(/^-/u,"");function M(e){return e instanceof J?new S(e.code,e.message,{exit:e.code==="conflict"?f.conflict:e.code==="no-item"?f.notFound:f.failed,...e.hint===void 0?{}:{hint:e.hint}}):e instanceof Z?new S(e.code,e.message,{exit:e.code==="network"?f.platform:e.code==="not-found"?f.notFound:e.code==="bad-choice"?f.usage:f.failed,...e.hint===void 0?{}:{hint:e.hint}}):e}const P=e=>new X({userAgent:`AllyHub/${te} (+https://allyhub.com)`,cacheDir:x(ee(e.env),"polyhaven"),...e.env.ALLYHUB_POLYHAVEN_API?{api:e.env.ALLYHUB_POLYHAVEN_API}:{}}),k=e=>`${e.toFixed(3)} m`;function de(e){const n=[e.type,e.category,e.size?`${k(e.size.width)} wide, ${k(e.size.depth)} deep, ${k(e.size.height)} tall`:void 0,e.covers?`one tile covers ${e.covers.map(k).join(" × ")}`:void 0,e.polycount!==void 0?`${e.polycount.toLocaleString("en")} polygons`:void 0,e.maxResolution?`up to ${String(e.maxResolution[0])} px`:void 0,e.authors.length>0?`by ${e.authors.join(", ")}`:void 0].filter(i=>i!==void 0);return` @polyhaven/${e.id}: ${e.name} (${n.join("; ")})
3
3
  found in ${e.matchedIn.join(", ")||"everything"}; tags ${e.tags.join(", ")}`}async function U(e,n){const i=[`${n.name} from Poly Haven (CC0, by ${n.source.authors.join(", ")||"its authors"}): ${String(n.files.length)} files in ${n.dir}/, ${n.fetched>0?`${String(n.fetched)} fetched`:"all already there"}. Records: ${n.records.join(", ")}.`];if(n.type==="model"){const r=n.main[0]??"",s=await q(e,r,await Y(x(e,r))),p=s.bounds;return i.push(p?`Measured: ${p.size.map(c=>c.toFixed(3)).join(" × ")} m along x, y (up), z; from ${p.min.map(c=>c.toFixed(3)).join(", ")} to ${p.max.map(c=>c.toFixed(3)).join(", ")}.`:`Not measured: ${s.contentsMissing??"no contents"}.`,...s.missing.length>0?[`Missing: ${s.missing.join(", ")}.`]:[],`In a scenery: const m = await w.load("${r}");`),{lines:i,model:s}}if(n.type==="hdri")return i.push(`In a scenery: await w.environment("${n.main[0]??""}", { background: true });`),{lines:i};const d=n.covers;return i.push(d&&d.length>=2?`One tile covers ${k(d[0]??0)} × ${k(d[1]??0)} (Poly Haven's dimensions): a surface's repeat is its size over that.`:"Poly Haven gives no size for one tile.",...n.main.map((r,s)=>{const p=n.maps?.[s]??"";return` ${p}: await w.texture("${r}"${p==="diffuse"?"":', { colorSpace: "linear" }'})`})),{lines:i}}export const add=C({name:"add",summary:"Adds to the project what AllyHub and Poly Haven have, each named <type>/<name>: a starter component, a 3D model, a 3D scenery, a skill or a template from AllyHub's registry, or a CC0 model, HDRI or texture from Poly Haven; alone it lists everything AllyHub has, by type",input:h.strictObject({name:h.array(h.string()).optional().describe("What to add, each <type>/<name>: component/caption-line, 3d-model/monitor, scenery/home-desk-demo-day, skill/web-product-demos (a skill goes in .agents/skills, linked from .claude/skills), template/<name>, lib/<name>, or @polyhaven/<id> (as allyhub add search prints it)"),to:h.string().optional().describe(`The folder the files go in, from the project (default ${I} for a component; for an asset, its kind's folder under assets/media/ and its id)`),force:h.boolean().default(!1).describe("Replace a component's copy the project changed (its changes are lost)"),res:h.string().optional().describe(`An asset's resolution, of its textures or of the HDRI (default ${G.resolution})`),dir:oe}),positional:["name"],output:h.looseObject({}),examples:["allyhub add","allyhub add component/caption-line","allyhub add 3d-model/monitor scenery/home-desk-demo-day","allyhub add @polyhaven/metal_office_desk --res 2k"]},async(e,n)=>{const i=D(_);try{const d=await i.index();if(!e.name||e.name.length===0){const t=Math.max(...d.items.map(y=>`component/${y.name}`.length)),l=await R(n);return{value:{components:d.items,resources:l.index?.items??[]},text:["Starter components (allyhub add component/<name> copies one into components/; allyhub add search <words> finds among everything, Poly Haven's models, HDRIs and textures too):",...d.items.map(y=>` ${`component/${y.name}`.padEnd(t)} ${y.description}`),"",...F(l,void 0)].join(`
4
4
  `)}}const r=e.name.map(ie),s=await ne(n.cwd,e.dir),p=new Set(d.items.map(t=>t.name)),c=t=>t.type==="component"&&p.has(z(t.name)),u=r.filter(c).map(t=>z(t.name)),v=r.filter(t=>t.type==="@polyhaven").map(t=>t.name),g=r.filter(t=>t.type!=="@polyhaven"&&!c(t)),b=g.length>0?await R(n):void 0;for(const t of g){const l=b?.index?.items.find(y=>y.name===t.name);if(!l)throw new S("no-item",`There is no ${t.type}/${t.name}.`,{exit:f.notFound,hint:b?.from==="none"?"AllyHub's registry could not be read: check the connection.":`allyhub add search --type ${t.type} lists them.`});if(H(l.type)!==t.type)throw new S("usage",`${t.name} is a ${H(l.type)}, not a ${t.type}.`,{exit:f.usage,hint:`allyhub add ${E(l)}`})}const w=g.map(t=>t.name),a=[],j={};if(u.length>0){const t=e.to??I,l=await L(i,u,{root:s,dir:t,force:e.force});await T(s,l);const y=m=>m==="up to date"?"Up to date":m==="added"?"Added":"Replaced";a.push(...l.files.map(m=>`${y(m.status)} ${m.path}`));const $=l.items.find(m=>m.name===u[0]),o=$?.files[0]?.target.replaceAll("{dir}",t);if($&&o){const m=V(x(s,"name"),x(s,o)).split("\\").join("/").replace(/\.ts$/u,".js");a.push(`Import it from a piece's file one folder down (<folder>/<file>.ts): import { ${$.title} } from "${m.startsWith(".")?m:`./${m}`}"; one "../" more for each folder the file is deeper.`,"The file is the project's: change it as you like. allyhub add component/<name> --force puts the registry's back.")}l.missing.length>0&&a.push(`It needs packages the project does not declare: ${l.missing.join(", ")}.`),j.components=l.files.map(m=>({item:m.item,path:m.path,status:m.status})),j.missing=l.missing}if(b&&w.length>0){const t=await L(b.source,w,{root:s,dir:".",force:e.force});await T(s,t),a.length>0&&a.push(""),a.push(...t.files.map(o=>`${o.status==="up to date"?"Up to date":o.status==="added"?"Added":"Replaced"} ${o.path}`));const l=P(n);for(const o of t.assets){const m=await l.add(o.id,{root:s,...o.resolution===void 0?{}:{resolution:o.resolution},...o.maps===void 0?{}:{maps:o.maps}});a.push(...(await U(s,m)).lines)}const y=await Q(s,t.bakes);a.push(...y.map(o=>`${o.status==="added"?"Downloaded":"Up to date"} the baked light for ${o.bake.scenery}: ${o.path}`),"The files are the project's: change them as you like (a changed scenery is drawn unbaked until allyhub scenery bake bakes it again). allyhub add <type>/<name> --force puts the registry's back.");const $=t.files.filter(o=>o.path.endsWith("/README.md"));$.length>0&&a.push(`Read first, for its screens and cameras: ${$.map(o=>o.path).join(", ")}`),j.resources={files:t.files.map(o=>({item:o.item,path:o.path,status:o.status})),assets:t.assets,bakes:y.map(o=>({path:o.path,status:o.status}))}}if(v.length>0){const t=P(n),l=[];for(const y of v){const $=await t.add(y,{root:s,...e.to===void 0||u.length>0?{}:{to:B.normalize(e.to)},...e.res===void 0?{}:{resolution:e.res}}),o=await U(s,$);a.length>0&&a.push(""),a.push(...o.lines),l.push({...$,...o.model===void 0?{}:{model:o.model}})}j.assets=l}return{value:j,text:a.join(`
5
- `)}}catch(d){throw M(d)}}),addSearch=C({name:"add search",summary:"Finds the starter components, AllyHub's resources (models, sceneries) and Poly Haven's CC0 models, HDRIs and textures whose names, tags, categories or descriptions hold every word, each with where its words were found; with no words, lists every one",input:h.strictObject({words:h.array(h.string()).default([]).describe("The words to find (a word may start one of theirs); none lists every one"),type:h.array(h.enum(A)).optional().describe(`Only these types (default all): ${A.join(", ")} (@polyhaven: Poly Haven's models, HDRIs and textures)`),all:h.boolean().default(!1).describe(`Every match, not only the first ${String(N)} Poly Haven assets`)}),positional:["words"],output:h.looseObject({}),examples:["allyhub add search --type 3d-model",'allyhub add search "office desk" --type @polyhaven',"allyhub add search caption --type component"]},async(e,n)=>{const i=e.words.join(" ").trim(),d=i===""?"":` hold "${i}"`;try{const r=e.type??A,s=r.includes("component")?O(await D(_).index(),i):[],p=r.filter(a=>a!=="@polyhaven"),c=p.length>0?await R(n):void 0,u=c?.index?O(c.index,i).filter(a=>p.includes(H(a.type))):[],v=r.includes("@polyhaven")?se:[],{found:g,total:b}=v.length>0?await P(n).search(i,v):{found:[],total:0},w=e.all?g:g.slice(0,N);return{value:{query:i,components:s,resources:u,assets:{total:b,matches:g.length,found:w}},text:[...r.includes("component")?[`Starter components: ${String(s.length)}${d}.`,...s.map(a=>` component/${a.name} (${a.title}): ${a.description}`)]:[],...c?c.from==="none"?F(c,[]):[`AllyHub's resources: ${String(u.length)}${d}${c.from==="stale"?" (as last read)":""}.`,...u.map(a=>` ${E(a)} (${a.title}): ${a.description}`)]:[],...v.length>0?[`From Poly Haven (CC0): ${String(g.length)} of ${String(b)} assets${d}${w.length<g.length?`; the first ${String(w.length)} (--all for every one)`:""}.`,...w.map(de)]:[],"","Add one: allyhub add <type>/<name>"].join(`
5
+ `)}}catch(d){throw M(d)}}),addSearch=C({name:"add search",summary:"Finds the starter components, AllyHub's resources (models, sceneries) and Poly Haven's CC0 models, HDRIs and textures whose names, tags, categories or descriptions hold every word, each with where its words were found; with no words, lists every one",input:h.strictObject({words:h.array(h.string()).default([]).describe("The words to find (a word may start one of theirs); none lists every one"),type:h.array(h.enum(A)).optional().describe(`Only these types (default all): ${A.join(", ")} (@polyhaven: Poly Haven's models, HDRIs and textures)`),all:h.boolean().default(!1).describe(`Every match; default the first ${String(N)} Poly Haven assets`)}),positional:["words"],output:h.looseObject({}),examples:["allyhub add search --type 3d-model",'allyhub add search "office desk" --type @polyhaven',"allyhub add search caption --type component"]},async(e,n)=>{const i=e.words.join(" ").trim(),d=i===""?"":` hold "${i}"`;try{const r=e.type??A,s=r.includes("component")?O(await D(_).index(),i):[],p=r.filter(a=>a!=="@polyhaven"),c=p.length>0?await R(n):void 0,u=c?.index?O(c.index,i).filter(a=>p.includes(H(a.type))):[],v=r.includes("@polyhaven")?se:[],{found:g,total:b}=v.length>0?await P(n).search(i,v):{found:[],total:0},w=e.all?g:g.slice(0,N);return{value:{query:i,components:s,resources:u,assets:{total:b,matches:g.length,found:w}},text:[...r.includes("component")?[`Starter components: ${String(s.length)}${d}.`,...s.map(a=>` component/${a.name} (${a.title}): ${a.description}`)]:[],...c?c.from==="none"?F(c,[]):[`AllyHub's resources: ${String(u.length)}${d}${c.from==="stale"?" (as last read)":""}.`,...u.map(a=>` ${E(a)} (${a.title}): ${a.description}`)]:[],...v.length>0?[`From Poly Haven (CC0): ${String(g.length)} of ${String(b)} assets${d}${w.length<g.length?`; the first ${String(w.length)} (--all for every one)`:""}.`,...w.map(de)]:[],"","Add one: allyhub add <type>/<name>"].join(`
6
6
  `)}}catch(r){throw M(r)}});
@@ -13,4 +13,4 @@ ${a}}`}return JSON.stringify(e)}function Y(e,a=5,n=160){const o=i=>{const t=i===
13
13
  `)}const Z=e=>{const a=Math.max(0,Math.round(e));return`${String(Math.floor(a/60))}:${String(a%60).padStart(2,"0")}`};async function ee(e,a){const n=e.trim().startsWith("{"),o=n?e:await L(W(a.cwd,e),"utf8").catch(i=>{throw new g("not-found",`--input: cannot read ${e}: ${i.message}`,{exit:m.notFound,hint:"Give a JSON object, or a file of one."})});let r;try{r=JSON.parse(o)}catch{r=void 0}if(!j(r))throw k(`--input: ${n?"the text":e} is not a JSON object.`,`Give '{"field": …}', or a file of it.`);return r}export function toolCommand(e){const a=`${e.work} ${e.name}`,n=K(e.input,Object.keys(f)),o=s.strictObject({...n.shape,...f,input:f.input.describe(n.inputOnly.length?`${f.input.description??""}. Fields only it gives: ${n.inputOnly.join(", ")}`:f.input.description??"")}),r=new Set(n.fields.values()),i=Object.keys(j(e.input.properties)?e.input.properties:{}).filter(l=>!r.has(l)),t=[...n.fields].filter(([,l])=>n.required.includes(l)).map(([l,c])=>`--${_(l)} <${c}>`);return{spec:{name:a,summary:e.description,input:o,output:s.looseObject({tool:s.string(),output:s.record(s.string(),s.unknown()).optional(),outputFile:s.string().optional(),credits:s.number().optional(),file:s.string().optional(),gen:s.string().optional(),more:s.record(s.string(),s.string()).optional(),words:s.string().optional(),jobId:s.string().optional()}),examples:[`allyhub ${[a,...e.example?G(n,e.example):t].join(" ")}`]},about:{lines:[e.title,...e.shown?[wordOf(e.shown.name)===e.name?`Shown to people in AllyHub as "${e.shown.name}".`:`Shown to people in AllyHub as "${e.shown.name}": allyhub ${e.work} ${wordOf(e.shown.name)} finds it too.`]:[],"","A call is charged once, when it worked, as the description says; a failed call is free.",...e.long?["A long tool: the command waits for it (--no-wait returns its call, --resume waits again)."]:[],...v("In --input",R(e.input,{only:i,required:!0})),...v("Output",R(e.output,{depth:3}))],value:{work:e.work,title:e.title,...e.shown?{shown:e.shown.name}:{},long:e.long,inputSchema:e.input,outputSchema:e.output}},run:(l,c)=>w(async()=>{const u=l,b=l,O=p(c),S=await z(c),y=B(n,b,u.input===void 0?{}:await ee(u.input,c));let A=0;const N={base:S,signal:c.signal,onRunning:d=>{Date.now()-A<3e4||(A=Date.now(),c.progress(`${e.name}: working · ${Z((Date.now()-Date.parse(d.createdAt))/1e3)} (call ${d.id})`))},onRetry:(d,E,I)=>{c.progress(`${e.name}: ${E.message}; reading call ${d} again in ${String(I)} s`)}};if(u.resume!==void 0){if(Object.keys(y).length>0||u.file!==void 0)throw k("--resume waits for a call as it was made: give it no input or --file.");const d=await H(O,u.resume,{...N,tool:e.name});return{value:{...d},text:C(d,a)}}const J=q(n,y);if(J.length>0)throw k(`${e.name} needs ${J.join(", ")}.`,`allyhub help ${a} shows its options.`);const x=await M(O,e.name,y,{...N,outDir:D(S,U,e.work,e.name),...u.file===void 0?{}:{file:W(c.cwd,u.file)},force:u.force,wait:u.wait});return{value:{...x},text:C(x,a)}})}}export const CLOUD_SOURCE={entries:[{name:"<work>",summary:"List a work's cloud tools (AllyHub's catalog), a line each; allyhub help lists the works"},{name:"<work> <tool>",summary:"Run a cloud tool with the account's credits, its input as options (allyhub help <work> <tool>, which says how its credits are counted)"}],async nouns(e){return(await h(p(e))).works.map(n=>({name:n.id,summary:`${n.title}: ${n.description}`}))},resolve:(e,a)=>w(async()=>{const[n,o]=e;if(n===void 0||n.startsWith("-"))return;let r;const i=(u,b)=>(r=u,b);let t=await h(p(a)).catch(i),l=t?.works.find(u=>u.id===n);if(l||(t=await h(p(a),{refresh:!0}).catch(u=>i(u,t)),l=t?.works.find(u=>u.id===n)),!t)throw new g("catalog-unreachable",`"${n}" is none of allyhub's own commands, and its cloud tools could not be read: ${r instanceof Error?r.message:String(r)}.`,{exit:m.failed,hint:"They need the network: run allyhub outside a sandbox that blocks it."});if(!l)return;if(o===void 0||o.startsWith("-"))return{command:Q(l),rest:e.slice(1),list:!0};const c=t.tools.find(u=>u.name===o)??t.tools.find(u=>u.work===l.id&&u.shown!==void 0&&wordOf(u.shown.name)===wordOf(o));if(c?.work!==l.id)throw new g("unknown-tool",c?`${o} is not a ${l.id} tool: it is in allyhub ${c.work}.`:`No ${l.id} tool ${o}.`,{exit:m.notFound,hint:c?`allyhub ${c.work} ${o}`:`allyhub ${l.id} lists its tools.`});return{command:toolCommand(c),rest:e.slice(2),list:!1}})},upload=F({name:"upload",summary:"Upload files from this computer for a cloud tool whose input takes a URL (a presenter photo, speech audio, a reference clip), and print a signed URL for each, which works for a few hours",input:s.strictObject({files:s.array(s.string()).min(1).describe("The files: images (.jpg, .png, .webp, .gif), sound (.mp3, .wav, .m4a, .aac, .ogg, .flac) or video (.mp4, .mov, .webm), 50 MB at most")}),positional:["files"],output:s.looseObject({files:s.array(s.looseObject({file:s.string(),ok:s.boolean(),url:s.string().optional()}))}),examples:["allyhub upload assets/media/presenter.jpg"]},(e,a)=>w(async()=>{const n=await T(p(a),e.files,{base:a.cwd}),o=n.filter(t=>!t.ok),r=n.map(t=>t.ok?`${t.file}
14
14
  ${t.url}${t.expiresAt===void 0?"":` (works until ${t.expiresAt})`}`:`${t.file}
15
15
  failed: ${t.error.message}${t.error.hint?` ${t.error.hint}`:""}`);n.length>1&&r.push(o.length===0?`${$(n.length,"file")} uploaded.`:`${String(n.length-o.length)} of ${$(n.length,"file")} uploaded; ${String(o.length)} failed.`);const i=o[0];return{value:{files:n.map(t=>t.ok?{...t}:{file:t.file,ok:!1,error:{code:t.error.code,message:t.error.message,...t.error.hint?{hint:t.error.hint}:{}}})},text:r.join(`
16
- `),...i?{exit:i.error.exit}:{}}}));
16
+ `),...i?{exit:i.error.exit,code:i.error.code}:{}}}));
@@ -1,7 +1,7 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{spawn as C}from"node:child_process";import{mkdir as $,open as L,readFile as v,rm as P,writeFile as _}from"node:fs/promises";import{dirname as w,join as f,resolve as N}from"node:path";import{fileURLToPath as E}from"node:url";import{z as l}from"zod";import{projectItems as G}from"@allyhub/build";import{openBrowser as b}from"@allyhub/cloud";import{startDevServer as y}from"@allyhub/dev-server";import{DEV_FILE as R}from"@allyhub/formats";import{EXIT as M}from"@allyhub/protocol";import{nodeCommand as x}from"@allyhub/runtimes/node";import{CommandError as c,defineCommand as F}from"../command.js";import{dir as U,indexing as B}from"../fields.js";import{itemNamed as H,projectRoot as J}from"../project.js";import{extensionsAt as V,fileEditorsAt as Y,kindsAt as j}from"./extensions.js";export const PAGE=f(w(E(import.meta.url)),"../../editor-web");const h=".allyhub/dev.log",z=f(w(E(import.meta.url)),"../../bin/allyhub.js"),k=12e4,D=1e4,g=4340,W=20;export async function start(t,e,n,s){const a={root:t,kinds:j(t),extensions:V(t),ui:PAGE,...s===void 0?{}:{exportsTo:()=>s},index:n};if(e!==void 0)return y({...a,port:e}).catch(r=>{throw r.code==="EADDRINUSE"?new c("port-in-use",`Port ${String(e)} is in use.`,{hint:"Choose another with --port, or leave it out."}):r});for(let r=g;r<g+W;r++)try{return await y({...a,port:r})}catch(o){if(o.code!=="EADDRINUSE")throw o}return y(a)}const I="allyhub dev";async function S(t){try{const e=JSON.parse(await v(f(t,R),"utf8"));return typeof e.url!="string"||typeof e.pid!="number"?void 0:(process.kill(e.pid,0),(await fetch(e.url,{signal:AbortSignal.timeout(2e3)})).ok?{url:e.url,pid:e.pid,mine:e.by===I}:void 0)}catch{return}}async function X(t){return(await S(t))?.url}function q(t){try{return process.kill(t,0),!0}catch{return!1}}const O=t=>new Promise(e=>setTimeout(e,t));async function K(t){return(await v(f(t,h),"utf8").catch(()=>"")).trim().split(`
2
+ import{spawn as A}from"node:child_process";import{mkdir as T,open as C,readFile as v,rm as L,writeFile as P}from"node:fs/promises";import{dirname as w,join as f,resolve as _}from"node:path";import{fileURLToPath as $}from"node:url";import{z as l}from"zod";import{projectItems as N}from"@allyhub/build";import{openBrowser as b}from"@allyhub/cloud";import{startDevServer as y}from"@allyhub/dev-server";import{DEV_FILE as E}from"@allyhub/formats";import{EXIT as x}from"@allyhub/protocol";import{nodeCommand as G}from"@allyhub/runtimes/node";import{CommandError as c,defineCommand as M}from"../command.js";import{dir as F,indexing as U}from"../fields.js";import{itemNamed as B,projectRoot as H}from"../project.js";import{extensionsAt as J,fileEditorsAt as V,kindsAt as R}from"./extensions.js";export const PAGE=f(w($(import.meta.url)),"../../editor-web");const h=".allyhub/dev.log",Y=f(w($(import.meta.url)),"../../bin/allyhub.js"),j=12e4,k=1e4,g=4340,z=20;export async function start(t,e,n,s){const a={root:t,kinds:R(t),extensions:J(t),ui:PAGE,...s===void 0?{}:{exportsTo:()=>s},index:n};if(e!==void 0)return y({...a,port:e}).catch(r=>{throw r.code==="EADDRINUSE"?new c("port-in-use",`Port ${String(e)} is in use.`,{hint:"Choose another with --port, or leave it out."}):r});for(let r=g;r<g+z;r++)try{return await y({...a,port:r})}catch(o){if(o.code!=="EADDRINUSE")throw o}return y(a)}const D="allyhub dev";async function S(t){try{const e=JSON.parse(await v(f(t,E),"utf8"));return typeof e.url!="string"||typeof e.pid!="number"?void 0:(process.kill(e.pid,0),(await fetch(e.url,{signal:AbortSignal.timeout(2e3)})).ok?{url:e.url,pid:e.pid,mine:e.by===D}:void 0)}catch{return}}async function W(t){return(await S(t))?.url}function X(t){try{return process.kill(t,0),!0}catch{return!1}}const I=t=>new Promise(e=>setTimeout(e,t));async function q(t){return(await v(f(t,h),"utf8").catch(()=>"")).trim().split(`
3
3
  `).slice(-20).join(`
4
- `)}async function Q(t,e,n,s,a){const r=f(t,h);await $(w(r),{recursive:!0});const o=await L(r,"w");let i,d;try{const u=C(x(n),[z,"dev","--foreground","--no-open","--dir",t,...s===void 0?[]:["--port",String(s)],...a===void 0?[]:["--exports",a]],{cwd:e,env:{...n,ALLYHUB_NO_LOCAL:"1"},detached:!0,stdio:["ignore",o.fd,o.fd],windowsHide:!0});u.once("error",m=>{i=m.message}),u.once("exit",(m,A)=>{i=A??`exit code ${String(m)}`}),u.unref(),d=u.pid}finally{await o.close()}const p=Date.now()+k;for(;Date.now()<p&&i===void 0;){const u=await S(t);if(u!==void 0&&u.pid===d)return u.url;await O(150)}throw i===void 0&&d!==void 0&&process.kill(d,"SIGTERM"),new c("dev-failed",i===void 0?`allyhub dev did not answer within ${String(k/1e3)} s.`:`allyhub dev stopped as it started (${i}).`,{hint:`What it said, in ${h}:
5
- ${await K(t)||"(nothing)"}`})}async function Z(t){const e=await S(t);if(e===void 0)return;if(!e.mine)throw new c("not-dev",`The server at ${e.url} is not one this allyhub dev started (it is AllyHub Studio's, or an older allyhub's), so it is left running.`,{hint:"Studio's stops with its project; an older allyhub dev stops with Ctrl+C where it runs."});process.kill(e.pid,"SIGTERM");const n=Date.now()+D;for(;q(e.pid);){if(Date.now()>n)throw new c("dev-stuck",`allyhub dev (process ${String(e.pid)}) did not stop within ${String(D/1e3)} s.`,{hint:`Stop it with: kill -9 ${String(e.pid)}`});await O(100)}return e.url}async function T(t,e,n,s){if(s===void 0)return n;const{listed:a}=await G(t,j(t),void 0,Y(t)),r=H(a,t,e,s);if(!r)throw new c("not-found",`There is no item ${s} in the project's list.`,{exit:M.notFound,hint:`Its items: ${a.map(o=>o.id).join(", ")||"none"} (allyhub.yaml lists them).`});return`${n}?${new URLSearchParams({item:r.id}).toString()}`}export const dev=F({name:"dev",summary:"The project's items in the browser, each in its editor (docs, sheets, videos, 3D sceneries; websites listed), as their files change; serves from a process of its own until --stop, which outlives the shell that started it, and run again while it runs, opens its page and ends",input:l.strictObject({item:l.string().optional().describe("Open the page on this item: its id (its file without its extension) or its file; or on a file the list names with no kind, which an editor opens by its name (a canvas)"),dir:U,port:l.number().int().min(1).max(65535).optional().describe(`The port; default the first free one from ${String(g)}`),open:l.boolean().default(!0).describe("Open the page in the browser; --no-open only prints it"),foreground:l.boolean().default(!1).describe(`Serve from this process until Ctrl+C; default a detached process of its own, its output in ${h}`),stop:l.boolean().default(!1).describe("Stop the project's running allyhub dev"),exports:l.string().min(1).optional().describe("The folder an export from the page is saved in; default ~/Downloads (each file is made in .allyhub/out/ first)")}),positional:["item"],output:l.strictObject({url:l.string().optional().describe("The page; with --stop, the one stopped, none when none ran")}),examples:["allyhub dev","allyhub dev launch/plan","allyhub dev --port 4400 --no-open","allyhub dev --stop"]},async(t,e)=>{const n=await J(e.cwd,t.dir);if(t.stop){const i=await Z(n);return e.progress(i===void 0?"No allyhub dev runs for this project.":`Stopped allyhub dev at ${i}`),{value:i===void 0?{}:{url:i},text:""}}const s=t.port===void 0?await X(n):void 0;if(s!==void 0){const i=await T(n,e.cwd,s,t.item);return e.progress(`allyhub dev is already running at ${i}`),t.open&&b(i,e.env),{value:{url:i},text:""}}const a=t.exports===void 0?void 0:N(e.cwd,t.exports);if(!t.foreground){const i=await Q(n,e.cwd,e.env,t.port,a),d=await T(n,e.cwd,i,t.item);return e.progress(`allyhub dev is at ${d}
6
- It runs until allyhub dev --stop; what it says is in ${h}.`),t.open&&b(d,e.env),{value:{url:d},text:""}}const r=await start(n,t.port,B(e.env),a),o=f(n,R);try{const i=await T(n,e.cwd,r.url,t.item);return await $(w(o),{recursive:!0}),await _(o,JSON.stringify({url:r.url,pid:process.pid,token:r.token,by:I})),e.progress(`allyhub dev is at ${i}
7
- Press Ctrl+C to stop.`),t.open&&b(i,e.env),await new Promise(d=>{const p=()=>{process.off("SIGTERM",p),e.signal.removeEventListener("abort",p),d()};e.signal.aborted&&d(),e.signal.addEventListener("abort",p),process.once("SIGTERM",p)}),{value:{url:i},text:""}}finally{(await v(o,"utf8").catch(()=>"")).includes(`"pid":${String(process.pid)}`)&&await P(o,{force:!0}),await r.close(),await r.project.extensions?.deactivate()}});
4
+ `)}async function K(t,e,n,s,a){const r=f(t,h);await T(w(r),{recursive:!0});const o=await C(r,"w");let i,d;try{const u=A(G(n),[Y,"dev","--foreground","--no-open","--dir",t,...s===void 0?[]:["--port",String(s)],...a===void 0?[]:["--exports",a]],{cwd:e,env:{...n,ALLYHUB_NO_LOCAL:"1"},detached:!0,stdio:["ignore",o.fd,o.fd],windowsHide:!0});u.once("error",m=>{i=m.message}),u.once("exit",(m,O)=>{i=O??`exit code ${String(m)}`}),u.unref(),d=u.pid}finally{await o.close()}const p=Date.now()+j;for(;Date.now()<p&&i===void 0;){const u=await S(t);if(u!==void 0&&u.pid===d)return u.url;await I(150)}throw i===void 0&&d!==void 0&&process.kill(d,"SIGTERM"),new c("dev-failed",i===void 0?`allyhub dev did not answer within ${String(j/1e3)} s.`:`allyhub dev stopped as it started (${i}).`,{hint:`What it said, in ${h}:
5
+ ${await q(t)||"(nothing)"}`})}async function Q(t){const e=await S(t);if(e===void 0)return;if(!e.mine)throw new c("not-dev",`The server at ${e.url} is not one this allyhub dev started (it is AllyHub Studio's, or an older allyhub's), so it is left running.`,{hint:"Studio's stops with its project; an older allyhub dev stops with Ctrl+C where it runs."});process.kill(e.pid,"SIGTERM");const n=Date.now()+k;for(;X(e.pid);){if(Date.now()>n)throw new c("dev-stuck",`allyhub dev (process ${String(e.pid)}) did not stop within ${String(k/1e3)} s.`,{hint:`Stop it with: kill -9 ${String(e.pid)}`});await I(100)}return e.url}export async function pageOn(t,e,n,s){if(s===void 0)return n;const{listed:a}=await N(t,R(t),void 0,V(t)),r=B(a,t,e,s);if(!r)throw new c("not-found",`There is no item ${s} in the project's list.`,{exit:x.notFound,hint:`Its items: ${a.map(o=>o.id).join(", ")||"none"} (allyhub.yaml lists them).`});return`${n}?${new URLSearchParams({item:r.id}).toString()}`}export const dev=M({name:"dev",summary:"The project's items in the browser, each in its editor (docs, sheets, videos, 3D sceneries; websites listed), as their files change; serves from a process of its own until --stop, which outlives the shell that started it, and run again while it runs, opens its page and ends",input:l.strictObject({item:l.string().optional().describe("Open the page on this item: its id (its file without its extension) or its file; or on a file the list names with no kind, which an editor opens by its name (a canvas)"),dir:F,port:l.number().int().min(1).max(65535).optional().describe(`The port; default the first free one from ${String(g)}`),open:l.boolean().default(!0).describe("Open the page in the browser; --no-open only prints it"),foreground:l.boolean().default(!1).describe(`Serve from this process until Ctrl+C; default a detached process of its own, its output in ${h}`),stop:l.boolean().default(!1).describe("Stop the project's running allyhub dev"),exports:l.string().min(1).optional().describe("The folder an export from the page is saved in; default ~/Downloads (each file is made in .allyhub/out/ first)")}),positional:["item"],output:l.strictObject({url:l.string().optional().describe("The page; with --stop, the one stopped, none when none ran")}),examples:["allyhub dev","allyhub dev launch/plan","allyhub dev --port 4400 --no-open","allyhub dev --stop"]},async(t,e)=>{const n=await H(e.cwd,t.dir);if(t.stop){const i=await Q(n);return e.progress(i===void 0?"No allyhub dev runs for this project.":`Stopped allyhub dev at ${i}`),{value:i===void 0?{}:{url:i},text:""}}const s=t.port===void 0?await W(n):void 0;if(s!==void 0){const i=await pageOn(n,e.cwd,s,t.item);return e.progress(`allyhub dev is already running at ${i}`),t.open&&b(i,e.env),{value:{url:i},text:""}}const a=t.exports===void 0?void 0:_(e.cwd,t.exports);if(!t.foreground){const i=await K(n,e.cwd,e.env,t.port,a),d=await pageOn(n,e.cwd,i,t.item);return e.progress(`allyhub dev is at ${d}
6
+ It runs until allyhub dev --stop; what it says is in ${h}.`),t.open&&b(d,e.env),{value:{url:d},text:""}}const r=await start(n,t.port,U(e.env),a),o=f(n,E);try{const i=await pageOn(n,e.cwd,r.url,t.item);return await T(w(o),{recursive:!0}),await P(o,JSON.stringify({url:r.url,pid:process.pid,token:r.token,by:D})),e.progress(`allyhub dev is at ${i}
7
+ Press Ctrl+C to stop.`),t.open&&b(i,e.env),await new Promise(d=>{const p=()=>{process.off("SIGTERM",p),e.signal.removeEventListener("abort",p),d()};e.signal.aborted&&d(),e.signal.addEventListener("abort",p),process.once("SIGTERM",p)}),{value:{url:i},text:""}}finally{(await v(o,"utf8").catch(()=>"")).includes(`"pid":${String(process.pid)}`)&&await L(o,{force:!0}),await r.close(),await r.project.extensions?.deactivate()}});
@@ -1,5 +1,5 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{z as m}from"zod";import{startBrowser as v}from"@allyhub/browser";import{formatBytes as c}from"@allyhub/media";import{EXIT as u}from"@allyhub/protocol";import{ENCODERS as j,FFMPEG_MINIMUM as N,FFMPEG_PINNED as h,ffmpegEncoders as A,ffmpegHint as p,findFfmpeg as E}from"@allyhub/render";import{createPackages as g,createRuntimes as l}from"@allyhub/runtimes";import{defineCommand as C}from"../command.js";const f=[22,19],$=["word","pages","3d","ffmpeg","chrome","yt-dlp"],w={word:["docx"],pages:["pdfjs-dist"],"3d":["manifold-3d","gltf-tools"]};function F(){const[o=0,e=0]=process.versions.node.split(".").map(Number),t=o>f[0]||o===f[0]&&e>=f[1];return{name:"node",ok:t,detail:`Node.js ${process.versions.node}`,...t?{}:{hint:`AllyHub needs Node.js ${f.join(".")} or newer: install it from nodejs.org or with a version manager.`}}}const k=(o,e)=>({name:e,ok:o?.available??!1,detail:o?.available?`not downloaded yet (${c(o.size)} the first time a command needs it, into ${o.dir})`:`AllyHub has no ${e} build for this computer`,...o?.available?{}:{hint:`Set ALLYHUB_${e.toUpperCase()} to one installed here.`}});async function H(o){const e=await l().locate("ffmpeg"),t=e?.bins.ffmpeg;if(t===void 0)return k(o,"ffmpeg");const a=await E(t);if(!a)return{name:"ffmpeg",ok:!1,detail:`${t} does not run`,hint:p(!0)};const n=`AllyHub needs ${N} or newer and is made with ${h}`;if(a.old)return{name:"ffmpeg",ok:!1,detail:`ffmpeg ${a.version} (${t}) is too old: ${n}`,hint:p(!0)};const s=await A(t),i=Object.entries(j).filter(([,d])=>!s.has(d)),r=[...a.pinned?[]:[`Not ${h}: its frames may differ from another computer's. ${p(!1)}`],...i.length>0?[`It cannot render ${i.map(([d,b])=>`${d} (no ${b})`).join(", ")}.`]:[]];return{name:"ffmpeg",ok:s.has("libx264"),detail:`ffmpeg ${a.version} (${t}${e?.from==="env"?", named by ALLYHUB_FFMPEG":""})`,...r.length>0?{hint:r.join(" ")}:{}}}async function I(o){if(!await l().locate("chrome"))return k(o,"chrome");try{const e=await v({gpu:!1}),t=e.product;return await e.close(),{name:"chrome",ok:!0,detail:t}}catch(e){return{name:"chrome",ok:!1,detail:`headless Chrome does not start: ${e.message.split(`
3
- `)[0]??""}`,hint:"Run allyhub outside the agent's sandbox, or set ALLYHUB_CHROME to another Chrome."}}}function M(o){const e=g(),t=w[o],a=t.reduce((n,s)=>n+e.size(s),0);return t.every(n=>e.locate(n)!==void 0)?`${o}: installed (${c(a)})`:`${o}: not installed (${c(a)} to download, on first use or with --install ${o})`}async function y(o,e,t){const a=[];for(const n of o){if(n==="ffmpeg"||n==="chrome"||n==="yt-dlp"){const s=l();e?await s.remove(n):(t.progress(`Getting ${n}…`),await s.ensure(n,{signal:t.signal}))}else{const s=g();for(const i of w[n])e?await s.remove(i):(t.progress(`Getting ${i}…`),await s.ensure(i,{signal:t.signal}))}a.push(`${e?"Removed":"Installed"} ${n}.`)}return a}export const doctor=C({name:"doctor",summary:"What this computer has for AllyHub: Node.js, ffmpeg, headless Chrome, yt-dlp, the packages; --install and --remove",input:m.strictObject({install:m.array(m.enum($)).default([]).describe("Download ahead what a command would on first use: a package (word: Word documents; pages: a doc's pages in frames; 3d: building and reading models), ffmpeg, chrome or yt-dlp (reference videos)"),remove:m.array(m.enum($)).default([]).describe("Take them off this computer; a command downloads them again when it needs them")}),output:m.looseObject({ok:m.boolean(),checks:m.array(m.unknown())}),examples:["allyhub doctor","allyhub doctor --install ffmpeg"]},async(o,e)=>{const t=[...await y(o.remove,!0,e),...await y(o.install,!1,e)],a=await l().status(),n=r=>a.find(d=>d.name===r),s=[F(),await H(n("ffmpeg")),await I(n("chrome"))],i=s.every(r=>r.ok);return{value:{ok:i,checks:s,runtimes:a,changed:t},text:[...t,...s.map(r=>`${r.ok?"ok ":"FAIL"} ${r.name}: ${r.detail}${r.hint===void 0?"":`
4
- ${r.hint}`}`),...["word","pages","3d"].map(r=>` ${M(r)}`)].join(`
2
+ import{z as m}from"zod";import{startBrowser as v}from"@allyhub/browser";import{formatBytes as c}from"@allyhub/media";import{EXIT as u}from"@allyhub/protocol";import{ENCODERS as j,FFMPEG_MINIMUM as A,FFMPEG_PINNED as h,ffmpegEncoders as E,ffmpegHint as p,findFfmpeg as N}from"@allyhub/render";import{createPackages as g,createRuntimes as l}from"@allyhub/runtimes";import{defineCommand as C}from"../command.js";const f=[22,19],$=["word","pages","3d","ffmpeg","chrome","yt-dlp"],w={word:["docx"],pages:["pdfjs-dist"],"3d":["manifold-3d","gltf-tools"]};function F(){const[o=0,e=0]=process.versions.node.split(".").map(Number),t=o>f[0]||o===f[0]&&e>=f[1];return{name:"node",ok:t,detail:`Node.js ${process.versions.node}`,...t?{}:{hint:`AllyHub needs Node.js ${f.join(".")} or newer: install it from nodejs.org or with a version manager.`}}}const k=(o,e)=>({name:e,ok:o?.available??!1,detail:o?.available?`not downloaded yet (${c(o.size)} the first time a command needs it, into ${o.dir})`:`AllyHub has no ${e} build for this computer`,...o?.available?{}:{hint:`Set ALLYHUB_${e.toUpperCase()} to one installed here.`}});async function H(o){const e=await l().locate("ffmpeg"),t=e?.bins.ffmpeg;if(t===void 0)return k(o,"ffmpeg");const a=await N(t);if(!a)return{name:"ffmpeg",ok:!1,detail:`${t} does not run`,hint:p(!0)};const n=`AllyHub needs ${A} or newer and is made with ${h}`;if(a.old)return{name:"ffmpeg",ok:!1,detail:`ffmpeg ${a.version} (${t}) is too old: ${n}`,hint:p(!0)};const s=await E(t),i=Object.entries(j).filter(([,d])=>!s.has(d)),r=[...a.pinned?[]:[`Render with ${h} for the same frames on every computer. ${p(!1)}`],...i.length>0?[`Use an ffmpeg with ${i.map(([d,b])=>`${b} for ${d}`).join(", ")}.`]:[]];return{name:"ffmpeg",ok:s.has("libx264"),detail:`ffmpeg ${a.version} (${t}${e?.from==="env"?", named by ALLYHUB_FFMPEG":""})`,...r.length>0?{hint:r.join(" ")}:{}}}async function M(o){if(!await l().locate("chrome"))return k(o,"chrome");try{const e=await v({gpu:!1}),t=e.product;return await e.close(),{name:"chrome",ok:!0,detail:t}}catch(e){return{name:"chrome",ok:!1,detail:`headless Chrome does not start: ${e.message.split(`
3
+ `)[0]??""}`,hint:"Run allyhub outside the agent's sandbox, or set ALLYHUB_CHROME to another Chrome."}}}function I(o){const e=g(),t=w[o],a=t.reduce((n,s)=>n+e.size(s),0);return t.every(n=>e.locate(n)!==void 0)?`${o}: installed (${c(a)})`:`${o}: not installed (${c(a)} to download, on first use or with --install ${o})`}async function y(o,e,t){const a=[];for(const n of o){if(n==="ffmpeg"||n==="chrome"||n==="yt-dlp"){const s=l();e?await s.remove(n):(t.progress(`Getting ${n}…`),await s.ensure(n,{signal:t.signal}))}else{const s=g();for(const i of w[n])e?await s.remove(i):(t.progress(`Getting ${i}…`),await s.ensure(i,{signal:t.signal}))}a.push(`${e?"Removed":"Installed"} ${n}.`)}return a}export const doctor=C({name:"doctor",summary:"What this computer has for AllyHub: Node.js, ffmpeg, headless Chrome, yt-dlp, the packages; --install and --remove",input:m.strictObject({install:m.array(m.enum($)).default([]).describe("Download ahead what a command would on first use: a package (word: Word documents; pages: a doc's pages in frames; 3d: building and reading models), ffmpeg, chrome or yt-dlp (reference videos)"),remove:m.array(m.enum($)).default([]).describe("Take them off this computer; a command downloads them again when it needs them")}),output:m.looseObject({ok:m.boolean(),checks:m.array(m.unknown())}),examples:["allyhub doctor","allyhub doctor --install ffmpeg"]},async(o,e)=>{const t=[...await y(o.remove,!0,e),...await y(o.install,!1,e)],a=await l().status(),n=r=>a.find(d=>d.name===r),s=[F(),await H(n("ffmpeg")),await M(n("chrome"))],i=s.every(r=>r.ok);return{value:{ok:i,checks:s,runtimes:a,changed:t},text:[...t,...s.map(r=>`${r.ok?"ok ":"FAIL"} ${r.name}: ${r.detail}${r.hint===void 0?"":`
4
+ ${r.hint}`}`),...["word","pages","3d"].map(r=>` ${I(r)}`)].join(`
5
5
  `),exit:i?u.ok:u.failed}});
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{dirname as f,join as m,relative as i}from"node:path";import{fromBuild as u,pagesOf as g}from"@allyhub/doc-extension/cli";import{EXIT as l}from"@allyhub/protocol";import{DocPageError as w,docPages as h}from"@allyhub/doc-print";import{CommandError as P}from"../../command.js";import{projectSession as j}from"../inspect/views.js";import{looks as k,picturePath as E,save as $,workPath as v}from"./common.js";export async function docPicture(e){const r=i(e.root,f(e.file)),a=e.page===void 0?void 0:g(e.page),{stills:s,data:n,sources:c}=await u(e.file,r,o=>j(e.root,o));let t;try{t=await h({root:e.root,doc:{file:i(e.root,e.file),dir:r,path:r,...n===void 0?{}:{data:n},sources:c},pages:a,stills:s,format:k(),onFetch:()=>{e.progress?.("Getting pdf.js, once, to draw a doc's pages…")}})}catch(o){throw o instanceof w?new P("not-found",o.message,{exit:l.notFound,hint:`Pages are 1 to ${String(o.count)}.`}):o}const p=a===void 0?"pages":`page-${e.page?.replace(/[^\d]+/gu,"-")??""}`,d=await $(E(e.cwd,e.out,m(v(e.root,"frames",r),`${p}.png`)),t.picture);return{mode:"frame",source:"doc",doc:r,out:d,pages:t.count,paper:t.paper,drawn:t.drawn}}
2
+ import{dirname as m,join as u,relative as a,sep as g}from"node:path";import{fromBuild as l,pagesOf as w}from"@allyhub/doc-extension/cli";import{itemIdOf as h}from"@allyhub/formats";import{EXIT as P}from"@allyhub/protocol";import{DocPageError as j,docPages as k}from"@allyhub/doc-print";import{CommandError as E}from"../../command.js";import{projectSession as $}from"../inspect/views.js";import{looks as v,picturePath as x,save as y,workPath as F}from"./common.js";export async function docPicture(e){const t=a(e.root,m(e.file)),i=e.page===void 0?void 0:w(e.page),s=h(a(e.root,e.file).split(g).join("/")),{stills:p,data:n,sources:c}=await l(e.file,s,o=>$(e.root,o));let r;try{r=await k({root:e.root,doc:{file:a(e.root,e.file),dir:t,path:t,...n===void 0?{}:{data:n},sources:c},pages:i,stills:p,format:v(),onFetch:()=>{e.progress?.("Getting pdf.js, once, to draw a doc's pages…")}})}catch(o){throw o instanceof j?new E("not-found",o.message,{exit:P.notFound,hint:`Pages are 1 to ${String(o.count)}.`}):o}const d=i===void 0?"pages":`page-${e.page?.replace(/[^\d]+/gu,"-")??""}`,f=await y(x(e.cwd,e.out,u(F(e.root,"frames",t),`${d}.png`)),r.picture);return{mode:"frame",source:"doc",doc:t,out:f,pages:r.count,paper:r.paper,drawn:r.drawn}}
@@ -1,5 +1,5 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{mkdirSync as d,writeFileSync as x}from"node:fs";import{dirname as g,join as h}from"node:path";import{z as s}from"zod";import{FACTS_HEAD as $,MOMENTS as b,STRETCH as y,allFindings as w}from"@allyhub/build";import{consoleJson as m}from"@allyhub/project";import{momentsIn as k}from"@allyhub/video-measure";import{EXIT as f}from"@allyhub/protocol";import{WORK_DIR as v}from"@allyhub/formats";import{countFacts as E}from"@allyhub/diagnostics";import{CommandError as p}from"../../command.js";import{builtInExtensions as F,extensionsAt as u,factKindsOf as c,factOwner as O}from"../extensions.js";import{formatConsole as T,formatFacts as a,formatProblem as j}from"../../text/index.js";import{known as S}from"../../version.js";export const plural=(e,t)=>`${String(e)} ${t}${e===1?"":"s"}`,sec=e=>e.toFixed(2),boxText=e=>`[${e.join(",")}]`,HEAD=$;export{b as MOMENTS,y as STRETCH};export const kind=s.array(s.string()).optional().describe(`Only facts of these kinds: ${c(F()).map(e=>e.kind).join(", ")}`),all=w;export function kindsOf(e,t){if(e===void 0)return;const n=c(u(t)).map(o=>o.kind);return e.map(o=>{if(!n.includes(o))throw new p("bad-kind",`There is no kind of fact ${o}.`,{exit:f.usage,hint:`Kinds: ${n.join(", ")}.`});return o})}export function momentsOf(e,t){if(e.at!==void 0&&e.every!==void 0)throw new p("bad-option","--at and --every do not go together.",{exit:f.usage});const n=e.at?.map(o=>{const r=Number(o.replace(/s$/u,""));return o.trim().startsWith("@")||!Number.isFinite(r)?o:r});return S(()=>k(t.timeline,{...n===void 0?{}:{at:n},...e.every===void 0?{}:{every:e.every},part:e.part,from:e.from,to:e.to},t.target))}export function pageLines(e){const t=e.problems.filter(n=>n.level==="error");return[...t.length>0?["Must fix (facts may be missing where they are):",...t.map(j)]:[],...T(m(e.console))]}export const pageJson=e=>({problems:e.problems.filter(t=>t.level==="error"),...m(e.console)});export function factLines(e,t,n){const o=a(e,{all:t});if(t||n===void 0)return o;const r=a(e,{all:!0});return o.some(i=>/^ {4}… \d+ more \(/u.test(i))?(d(g(n),{recursive:!0}),x(n,`${r.join(`
2
+ import{mkdirSync as d,writeFileSync as x}from"node:fs";import{dirname as $,join as g}from"node:path";import{z as s}from"zod";import{FACTS_HEAD as h,MOMENTS as b,STRETCH as y,allFindings as w}from"@allyhub/build";import{consoleJson as m}from"@allyhub/project";import{momentsIn as v}from"@allyhub/video-measure";import{EXIT as f}from"@allyhub/protocol";import{WORK_DIR as k}from"@allyhub/formats";import{countFacts as E}from"@allyhub/diagnostics";import{CommandError as u}from"../../command.js";import{builtInExtensions as F,extensionsAt as p,factKindsOf as c,factOwner as O}from"../extensions.js";import{formatConsole as T,formatFacts as a,formatProblem as j}from"../../text/index.js";import{known as S}from"../../version.js";export const plural=(e,t)=>`${String(e)} ${t}${e===1?"":"s"}`,sec=e=>e.toFixed(2),boxText=e=>`[${e.join(",")}]`,HEAD=h;export{b as MOMENTS,y as STRETCH};export const kind=s.array(s.string()).optional().describe(`Only facts of these kinds: ${c(F()).map(e=>e.kind).join(", ")}`),all=w;export function kindsOf(e,t){if(e===void 0)return;const n=c(p(t)).map(o=>o.kind);return e.map(o=>{if(!n.includes(o))throw new u("bad-kind",`There is no kind of fact ${o}.`,{exit:f.usage,hint:`Kinds: ${n.join(", ")}.`});return o})}export function momentsOf(e,t){if(e.at!==void 0&&e.every!==void 0)throw new u("bad-option","--at and --every do not go together.",{exit:f.usage});const n=e.at?.map(o=>{const r=Number(o.replace(/s$/u,""));return o.trim().startsWith("@")||!Number.isFinite(r)?o:r});return S(()=>v(t.timeline,{...n===void 0?{}:{at:n},...e.every===void 0?{}:{every:e.every},part:e.part,from:e.from,to:e.to},t.target))}export function pageLines(e){const t=e.problems.filter(n=>n.level==="error");return[...t.length>0?["Must fix, to measure every fact:",...t.map(j)]:[],...T(m(e.console))]}export const pageJson=e=>({problems:e.problems.filter(t=>t.level==="error"),...m(e.console)});export function factLines(e,t,n){const o=a(e,{all:t});if(t||n===void 0)return o;const r=a(e,{all:!0});return o.some(i=>/^ {4}… \d+ more \(/u.test(i))?(d($(n),{recursive:!0}),x(n,`${r.join(`
3
3
  `)}
4
- `),[...o,`Every finding, a line each: ${n}`]):o}export const factsFile=(e,t)=>h(e,v,"inspect",`${t.replace(/[^\w.-]+/gu,"-")}.txt`);export function factsResult(e,t,n,o=[]){return{value:{facts:e,counts:E(e),total:n.total??e.length,...n.extra,...pageJson(t)},text:[`${plural(e.length,"fact")} measured now: ${HEAD}`,...factLines(e,n.all,n.save),...o,...pageLines(t)].join(`
5
- `)}}export function unseenKinds(e,t,n){const o=u(n);return(e??[]).flatMap(r=>{if(t.some(l=>l.kind===r))return[];const i=O(o,r);return i?[{kind:r,...i}]:[]})}export const unseenLines=e=>e.map(t=>`No ${t.kind} facts here. It is ${t.extension}'s: ${t.about}`);
4
+ `),[...o,`Every finding, a line each: ${n}`]):o}export const factsFile=(e,t)=>g(e,k,"inspect",`${t.replace(/[^\w.-]+/gu,"-")}.txt`);export function factsResult(e,t,n,o=[]){return{value:{facts:e,counts:E(e),total:n.total??e.length,...n.extra,...pageJson(t)},text:[`${plural(e.length,"fact")} measured now: ${HEAD}`,...factLines(e,n.all,n.save),...o,...pageLines(t)].join(`
5
+ `)}}export function unseenKinds(e,t,n){const o=p(n);return(e??[]).flatMap(r=>{if(t.some(l=>l.kind===r))return[];const i=O(o,r);return i?[{kind:r,...i}]:[]})}export const unseenLines=e=>e.map(t=>`No ${t.kind} facts here. It is ${t.extension}'s: ${t.about}`);
@@ -1,4 +1,4 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{z as f}from"zod";import{itemKindBuild as S,projectItems as b}from"@allyhub/build";import{NEVER_CANCELLED as C}from"@allyhub/extension-api";import{consoleJson as A}from"@allyhub/project";import{countFacts as g,filterFacts as j}from"@allyhub/diagnostics";import{defineCommand as F}from"../../command.js";import{dir as N}from"../../fields.js";import{itemNamed as I,projectRoot as K}from"../../project.js";import{checkIndexed as R,combosOf as T,commandError as z}from"../../version.js";import{factLines as y,factsFile as $,HEAD as O,STRETCH as D,all as H,kind as P,kindsOf as B,pageLines as J,plural as h,unseenKinds as v,unseenLines as E}from"./common.js";import{extensionsAt as V,factKindsOf as _,kindsAt as x}from"../extensions.js";async function w(t,i,n){const e=V(t),o=await e.kindProvider(i.kind);if(!o?.facts)return;const r=new Set(_(e).map(s=>s.kind));return(await o.facts(i,{root:t,tool:s=>Promise.reject(new Error(`No project tool ${s} in the CLI.`))},n,C)??[]).filter(s=>r.has(s.kind))}async function q(t,i){const{items:n}=await b(t,x(t)),e=[];for(const o of n)e.push(...await w(t,o,i)??[]);return e}async function G(t,i,n){const e=x(t),{items:o}=await b(t,e),r=I(o,t,i,n);if(!r)return;const l=await S(e,r);return{item:r,onStage:l?.onStage===!0}}export const inspect=F({name:"inspect",summary:"The check's facts, for you to judge, never problems: by kind, part and time",input:f.strictObject({item:f.string().optional().describe("Only this item: its id (its file without its extension) or its file, or a folder of items"),combo:f.array(f.string()).optional().describe("Only combos matching name=value pairs joined with commas (lang=zh-cn,hook=b), or a combo's id (c03)"),kind:P,...D,all:H(),dir:N}),positional:["item"],output:f.looseObject({}),examples:["allyhub inspect","allyhub inspect launch/film --kind text-time,text-covered","allyhub inspect launch/film --part hook --all"]},async(t,i)=>{try{const n=await K(i.cwd,t.dir),e=B(t.kind,n),o=t.item===void 0?void 0:await G(n,i.cwd,t.item),r=o?.onStage===!1?o.item:void 0,l=r&&await w(n,r,{all:t.all});if(l){const d=l,m=j(d,{kinds:e}),p=v(e,m,n);return{value:{facts:m,counts:g(m),total:d.length,problems:[],...p.length>0?{unseen:p}:{}},text:[`${h(m.length,"fact")}: ${O}`,...y(m,t.all,$(n,`${t.item??"project"}.facts${t.kind?`.${t.kind.join("+")}`:""}`)),...E(p)].join(`
3
- `)}}const s=await R({dir:n,...t.item===void 0?{}:{piece:t.item},combos:T(t)},i),a=[...s.facts,...t.item===void 0?await q(n,{all:t.all}):o===void 0?[]:await w(n,o.item,{all:t.all})??[]],c=j(a,{kinds:e,part:t.part,from:t.from,to:t.to}),k=s.problems.filter(d=>d.level==="error"),u=v(e,c,n),L=c.length===a.length?h(a.length,"fact"):`${h(c.length,"fact")} of ${String(a.length)}`;return{value:{facts:c,counts:g(c),total:a.length,problems:k,...u.length>0?{unseen:u}:{},...A(s.console)},text:[`${L}: ${O}`,...y(c,t.all,$(n,`${t.item??"project"}.facts${t.kind?`.${t.kind.join("+")}`:""}`)),...E(u),...J({problems:k,console:s.console})].join(`
2
+ import{z as f}from"zod";import{itemKindBuild as S,projectItems as g}from"@allyhub/build";import{NEVER_CANCELLED as C}from"@allyhub/extension-api";import{consoleJson as A}from"@allyhub/project";import{countFacts as b,filterFacts as j}from"@allyhub/diagnostics";import{defineCommand as F}from"../../command.js";import{dir as N}from"../../fields.js";import{itemNamed as I,projectRoot as K}from"../../project.js";import{checkIndexed as R,combosOf as T,commandError as z}from"../../version.js";import{factLines as y,factsFile as $,HEAD as O,STRETCH as D,all as H,kind as P,kindsOf as B,pageLines as J,plural as h,unseenKinds as E,unseenLines as v}from"./common.js";import{extensionsAt as V,factKindsOf as _,kindsAt as x}from"../extensions.js";async function w(t,i,n){const e=V(t),o=await e.kindProvider(i.kind);if(!o?.facts)return;const c=new Set(_(e).map(s=>s.kind));return(await o.facts(i,{root:t,tool:s=>Promise.reject(new Error(`No project tool ${s} in the CLI.`))},n,C)??[]).filter(s=>c.has(s.kind))}async function q(t,i){const{items:n}=await g(t,x(t)),e=[];for(const o of n)e.push(...await w(t,o,i)??[]);return e}async function G(t,i,n){const e=x(t),{items:o}=await g(t,e),c=I(o,t,i,n);if(!c)return;const l=await S(e,c);return{item:c,onStage:l?.onStage===!0}}export const inspect=F({name:"inspect",summary:"The check's facts, for you to judge: by kind, part and time",input:f.strictObject({item:f.string().optional().describe("Only this item: its id (its file without its extension) or its file, or a folder of items"),combo:f.array(f.string()).optional().describe("Only combos matching name=value pairs joined with commas (lang=zh-cn,hook=b), or a combo's id (c03)"),kind:P,...D,all:H(),dir:N}),positional:["item"],output:f.looseObject({}),examples:["allyhub inspect","allyhub inspect launch/film --kind text-time,text-covered","allyhub inspect launch/film --part hook --all"]},async(t,i)=>{try{const n=await K(i.cwd,t.dir),e=B(t.kind,n),o=t.item===void 0?void 0:await G(n,i.cwd,t.item),c=o?.onStage===!1?o.item:void 0,l=c&&await w(n,c,{all:t.all});if(l){const d=l,m=j(d,{kinds:e}),p=E(e,m,n);return{value:{facts:m,counts:b(m),total:d.length,problems:[],...p.length>0?{unseen:p}:{}},text:[`${h(m.length,"fact")}: ${O}`,...y(m,t.all,$(n,`${t.item??"project"}.facts${t.kind?`.${t.kind.join("+")}`:""}`)),...v(p)].join(`
3
+ `)}}const s=await R({dir:n,...t.item===void 0?{}:{piece:t.item},combos:T(t)},i),a=[...s.facts,...t.item===void 0?await q(n,{all:t.all}):o===void 0?[]:await w(n,o.item,{all:t.all})??[]],r=j(a,{kinds:e,part:t.part,from:t.from,to:t.to}),k=s.problems.filter(d=>d.level==="error"),u=E(e,r,n),L=r.length===a.length?h(a.length,"fact"):`${h(r.length,"fact")} of ${String(a.length)}`;return{value:{facts:r,counts:b(r),total:a.length,problems:k,...u.length>0?{unseen:u}:{},...A(s.console)},text:[`${L}: ${O}`,...y(r,t.all,$(n,`${t.item??"project"}.facts${t.kind?`.${t.kind.join("+")}`:""}`)),...v(u),...J({problems:k,console:s.console})].join(`
4
4
  `)}}catch(n){throw z(n)}});
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{z as r}from"zod";import{measuredFacts as k}from"@allyhub/video-measure";import{DECK_FACT_DEFAULTS as d,deckFacts as b}from"@allyhub/slides-core";import{stretchOf as w}from"@allyhub/video-measure";import{ffmpegOf as g}from"@allyhub/render";import{filterFacts as x}from"@allyhub/diagnostics";import{defineCommand as $}from"../../command.js";import{textOnScreen as v}from"../../text/index.js";import{VERSION_FIELDS as O,known as S,withVersion as A}from"../../version.js";import{MOMENTS as F,STRETCH as E,all as T,boxText as j,factsFile as C,factsResult as L,kind as N,kindsOf as D,momentsOf as M,sec as R}from"./common.js";export const inspectLayout=$({name:"inspect layout",summary:"One version's layout measured now, at its measured moments or at --at / --every; --texts lists every text block with its fonts",input:r.strictObject({...O,...F,...E,texts:r.boolean().default(!1).describe("List every text block at every moment, with its box and fonts"),within:r.number().positive().optional().describe(`A deck: lines up to this many points apart and not in line are near-alignment (default ${String(d.within)})`),drift:r.number().nonnegative().optional().describe(`A deck: places further apart than this, in points, are placement-drift (default ${String(d.drift)})`),level:r.array(r.enum(["master","layout","slide"])).optional().describe("A deck: measure only shapes of these levels (default every one): slide leaves out what a master or a layout draws on every slide"),except:r.array(r.string()).optional().describe("A deck: leave shapes of these names out of every fact, * for any letters (tick-*)"),room:r.string().regex(/^[\d.]+,[\d.]+$/u).optional().describe("A deck's read-size: a room as its screen's width and its farthest seat, in metres (3,12); without it no room is measured"),kind:N,all:T()}),positional:["item"],output:r.looseObject({}),examples:["allyhub inspect layout launch/film --at 1.5,@press --texts","allyhub inspect layout launch/film --every 0.5 --part hook","allyhub inspect layout launch/deck --kind near-alignment --within 10","allyhub inspect layout launch/deck --level slide --except 'tick-*'"]},async(e,p)=>{const n=await A(e,p,"render",async t=>{const s=t.timeline,{part:l}=S(()=>w(s,e)),o=await t.version.measure(M(e,t)),m=[...t.version.summary?.facts??[],...o.deck?b(o.deck,{width:o.width,height:o.height},{piece:t.target.piece,output:t.target.output,combo:t.target.combo,format:t.target.format},{...e.within===void 0?{}:{within:e.within},...e.drift===void 0?{}:{drift:e.drift},...e.level===void 0?{}:{levels:e.level},...e.except===void 0?{}:{except:e.except},...e.room===void 0?{}:{room:{screen:Number(e.room.split(",")[0]),distance:Number(e.room.split(",")[1])}}}):await k(o,s,t.target,{root:t.prepared.root,media:t.prepared.media,ffmpeg:await g()})];return{save:C(t.prepared.root,`${t.target.piece}.layout${e.kind?`.${e.kind.join("+")}`:""}`),facts:x(m,{kinds:D(e.kind,t.prepared.root),part:e.part}),total:m.length,moments:e.texts?o.moments.filter(i=>!l||i.part===l.key).map(i=>({t:i.t,part:i.part,...i.face?{face:i.face}:{},texts:o.deck?i.texts.map(c=>({...c,box:c.box.map(y=>Math.round(y/(o.deck?.pxPerPt??1)*2)/2)})):i.texts})):void 0}}),{facts:f,total:u,moments:a,save:h}=n.result;return L(f,n,{all:e.all,total:u,save:h,...a?{extra:{moments:a}}:{}},(a??[]).map(t=>` ${R(t.t)} ${t.part}${t.face?` face ${j(t.face)}`:""}: ${t.texts.map(v).join("; ")||"(no text)"}`))});
2
+ import{z as r}from"zod";import{measuredFacts as k}from"@allyhub/video-measure";import{DECK_FACT_DEFAULTS as d,deckFacts as b}from"@allyhub/slides-core";import{stretchOf as w}from"@allyhub/video-measure";import{ffmpegOf as g}from"@allyhub/render";import{filterFacts as x}from"@allyhub/diagnostics";import{defineCommand as v}from"../../command.js";import{textOnScreen as $}from"../../text/index.js";import{VERSION_FIELDS as O,known as S,withVersion as A}from"../../version.js";import{MOMENTS as F,STRETCH as E,all as T,boxText as j,factsFile as C,factsResult as L,kind as N,kindsOf as D,momentsOf as M,sec as R}from"./common.js";export const inspectLayout=v({name:"inspect layout",summary:"One version's layout measured now, at its measured moments or at --at / --every; --texts lists every text block with its fonts",input:r.strictObject({...O,...F,...E,texts:r.boolean().default(!1).describe("List every text block at every moment, with its box and fonts"),within:r.number().positive().optional().describe(`A deck: lines up to this many points apart and not in line are near-alignment (default ${String(d.within)})`),drift:r.number().nonnegative().optional().describe(`A deck: places further apart than this, in points, are placement-drift (default ${String(d.drift)})`),level:r.array(r.enum(["master","layout","slide"])).optional().describe("A deck: measure only shapes of these levels (default every one): slide leaves out what a master or a layout draws on every slide"),except:r.array(r.string()).optional().describe("A deck: leave shapes of these names out of every fact, * for any letters (tick-*)"),room:r.string().regex(/^[\d.]+,[\d.]+$/u).optional().describe("A deck's read-size: a room as its screen's width and its farthest seat, in metres (3,12); the room is measured when given"),kind:N,all:T()}),positional:["item"],output:r.looseObject({}),examples:["allyhub inspect layout launch/film --at 1.5,@press --texts","allyhub inspect layout launch/film --every 0.5 --part hook","allyhub inspect layout launch/deck --kind near-alignment --within 10","allyhub inspect layout launch/deck --level slide --except 'tick-*'"]},async(e,p)=>{const n=await A(e,p,"render",async t=>{const s=t.timeline,{part:l}=S(()=>w(s,e)),o=await t.version.measure(M(e,t)),m=[...t.version.summary?.facts??[],...o.deck?b(o.deck,{width:o.width,height:o.height},{piece:t.target.piece,output:t.target.output,combo:t.target.combo,format:t.target.format},{...e.within===void 0?{}:{within:e.within},...e.drift===void 0?{}:{drift:e.drift},...e.level===void 0?{}:{levels:e.level},...e.except===void 0?{}:{except:e.except},...e.room===void 0?{}:{room:{screen:Number(e.room.split(",")[0]),distance:Number(e.room.split(",")[1])}}}):await k(o,s,t.target,{root:t.prepared.root,media:t.prepared.media,ffmpeg:await g()})];return{save:C(t.prepared.root,`${t.target.piece}.layout${e.kind?`.${e.kind.join("+")}`:""}`),facts:x(m,{kinds:D(e.kind,t.prepared.root),part:e.part}),total:m.length,moments:e.texts?o.moments.filter(i=>!l||i.part===l.key).map(i=>({t:i.t,part:i.part,...i.face?{face:i.face}:{},texts:o.deck?i.texts.map(c=>({...c,box:c.box.map(y=>Math.round(y/(o.deck?.pxPerPt??1)*2)/2)})):i.texts})):void 0}}),{facts:f,total:u,moments:a,save:h}=n.result;return L(f,n,{all:e.all,total:u,save:h,...a?{extra:{moments:a}}:{}},(a??[]).map(t=>` ${R(t.t)} ${t.part}${t.face?` face ${j(t.face)}`:""}: ${t.texts.map($).join("; ")||"(no text)"}`))});
@@ -1,9 +1,9 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{readFile as h}from"node:fs/promises";import{basename as k,resolve as R}from"node:path";import{setTimeout as D}from"node:timers/promises";import{lookup as L}from"mrmime";import{z as t}from"zod";import{CloudError as F,createMailAlias as N,mailbox as C,rawMail as E,readMail as y,replyMail as H,searchMail as w,sendMail as _}from"@allyhub/cloud";import{EXIT as x,MAIL_LIMITS as f,MAIL_DIRECTIONS as z,MAIL_ORDERS as W}from"@allyhub/protocol";import{CommandError as j,defineCommand as r}from"../command.js";import{cloudOf as l,cloudWork as d}from"./cloud.js";const Z=t.looseObject({address:t.string(),name:t.string()}),u=t.looseObject({id:t.string(),receivedAt:t.string(),to:t.string(),from:Z.nullable(),subject:t.string(),threadId:t.string()}),$=u.extend({text:t.string(),links:t.array(t.looseObject({href:t.string(),text:t.string()}))}),B=e=>e instanceof F&&(e.code==="network"||e.status!==void 0&&e.status>=500),O={to:t.string().optional().describe("Sent to this address (or its part before @), with or without its +tag"),from:t.string().optional().describe("A part of the sender's address or name"),subject:t.string().optional().describe("A part of the subject"),text:t.string().optional().describe("A part of the text"),project:t.string().optional().describe("Sent to an address labelled with this project"),thread:t.string().optional().describe("In this thread (a thread id)")},S=e=>e.from===null?"(no sender)":e.from.name===""?e.from.address:`${e.from.name} <${e.from.address}>`,v=e=>e.direction==="out"&&e.recipients.length>0?e.recipients.map(s=>s.address).join(", "):e.to,P=e=>`${e.id} ${e.receivedAt} ${S(e)}
3
- to ${v(e)}: ${e.subject===""?"(no subject)":e.subject}`;function g(e){const s=[`From: ${S(e)}`,`To: ${v(e)}`,`Subject: ${e.subject}`,`Received: ${e.receivedAt}`,`Id: ${e.id} Thread: ${e.threadId}`,"",e.text===""?"(no text)":e.text];return e.textCut&&s.push("","(The text is cut; --raw prints all of it.)"),e.links.length>0&&s.push("","Links:",...e.links.map(a=>` ${a.href}${a.text===""?"":` (${a.text})`}`)),e.attachments.length>0&&s.push("","Attachments:",...e.attachments.map(a=>` ${a.name??"(no name)"} ${a.type} ${String(a.size)} bytes`)),s.join(`
4
- `)}export const mailAddresses=r({name:"mail addresses",summary:"Your mailbox's addresses in this organization, which your agents use as their own (made the first time); mail to any of them, with any +tag, comes to the same mailbox",input:t.strictObject({}),output:t.looseObject({domain:t.string(),displayName:t.string(),addresses:t.array(t.looseObject({address:t.string(),kind:t.string(),project:t.string().nullable()}))}),examples:["allyhub mail addresses"]},(e,s)=>d(async()=>{const a=await C(l(s));return{value:a,text:[...a.addresses.map(i=>`${i.address} ${i.kind}${i.project===null?"":` project ${i.project}`}`),`Sent as "${a.displayName}"; mail is kept ${String(a.retentionDays)} days.`].join(`
5
- `)}})),mailAlias=r({name:"mail alias",summary:"Add an address of its own to your mailbox (<name>.<team>@<domain>), for a site that refuses +tags or wants a different address for each account",input:t.strictObject({name:t.string().describe("Its name: 2 to 40 lowercase letters, digits and hyphens"),project:t.string().optional().describe("A project to label it with, to search its mail by")}),positional:["name"],output:t.looseObject({address:t.string()}),examples:["allyhub mail alias launch-test2 --project acme-launch"]},(e,s)=>d(async()=>{const a=await N(l(s),{name:e.name,...e.project===void 0?{}:{project:e.project}});return{value:a,text:a.address}})),mailSearch=r({name:"mail search",summary:"List the mail your mailbox received and sent, newest first; each option narrows it",input:t.strictObject({...O,direction:t.enum(z).optional().describe("in (received) or out (sent); both by default"),since:t.string().optional().describe("Received after this moment (ISO 8601, as 2026-11-05T10:00:00Z)"),order:t.enum(W).default("newest").describe("newest or oldest first"),limit:t.number().int().min(1).max(f.listed).default(20).describe(`How many to list, at most ${String(f.listed)}`)}),output:t.looseObject({messages:t.array(u)}),examples:["allyhub mail search --from shop.example --limit 5","allyhub mail search --to ada.acme+staging --since 2026-11-05T10:00:00Z"]},(e,s)=>d(async()=>{const a=await w(l(s),e);return{value:{messages:a},text:a.length===0?"No mail matches.":a.map(P).join(`
6
- `)}})),mailRead=r({name:"mail read",summary:"Read a message: its text, its links and its attachments' names; its HTML or the message as it came on ask",input:t.strictObject({id:t.string().describe("The message's id, from mail search or mail wait"),html:t.boolean().default(!1).describe("Include its HTML"),raw:t.boolean().default(!1).describe("Print the message as it came (MIME), headers and all")}),positional:["id"],output:t.union([$,t.looseObject({raw:t.string()})]),examples:["allyhub mail read 3f2c… --html"]},(e,s)=>d(async()=>{const a=l(s);if(e.raw){const o=new TextDecoder().decode(await E(a,e.id));return{value:{raw:o},text:o}}const i=await y(a,e.id,{html:e.html});return{value:i,text:i.html===void 0?g(i):`${g(i)}
2
+ import{readFile as b}from"node:fs/promises";import{basename as k,resolve as R}from"node:path";import{setTimeout as D}from"node:timers/promises";import{lookup as L}from"mrmime";import{z as t}from"zod";import{CloudError as F,createMailAlias as N,mailbox as C,rawMail as E,readMail as y,replyMail as H,searchMail as w,sendMail as z}from"@allyhub/cloud";import{EXIT as x,MAIL_LIMITS as f,MAIL_DIRECTIONS as _,MAIL_ORDERS as W}from"@allyhub/protocol";import{CommandError as j,defineCommand as r}from"../command.js";import{cloudOf as l,cloudWork as d}from"./cloud.js";const Z=t.looseObject({address:t.string(),name:t.string()}),u=t.looseObject({id:t.string(),receivedAt:t.string(),to:t.string(),from:Z.nullable(),subject:t.string(),threadId:t.string()}),$=u.extend({text:t.string(),links:t.array(t.looseObject({href:t.string(),text:t.string()}))}),B=e=>e instanceof F&&(e.code==="network"||e.status!==void 0&&e.status>=500),O={to:t.string().optional().describe("Sent to this address (or its part before @), with or without its +tag"),from:t.string().optional().describe("A part of the sender's address or name"),subject:t.string().optional().describe("A part of the subject"),text:t.string().optional().describe("A part of the text"),project:t.string().optional().describe("Sent to an address labelled with this project"),thread:t.string().optional().describe("In this thread (a thread id)")},S=e=>e.from===null?"(no sender)":e.from.name===""?e.from.address:`${e.from.name} <${e.from.address}>`,v=e=>e.direction==="out"&&e.recipients.length>0?e.recipients.map(s=>s.address).join(", "):e.to,P=e=>`${e.id} ${e.receivedAt} ${S(e)}
3
+ to ${v(e)}: ${e.subject===""?"(no subject)":e.subject}`;function p(e){const s=[`From: ${S(e)}`,`To: ${v(e)}`,`Subject: ${e.subject}`,`Received: ${e.receivedAt}`,`Id: ${e.id} Thread: ${e.threadId}`,"",e.text===""?"(no text)":e.text];return e.textCut&&s.push("","(The text is cut; --raw prints all of it.)"),e.links.length>0&&s.push("","Links:",...e.links.map(a=>` ${a.href}${a.text===""?"":` (${a.text})`}`)),e.attachments.length>0&&s.push("","Attachments:",...e.attachments.map(a=>` ${a.name??"(no name)"} ${a.type} ${String(a.size)} bytes`)),s.join(`
4
+ `)}export const mailAddresses=r({name:"mail addresses",summary:"Your mailbox's addresses in this organization, which your agents use as their own (made the first time); mail to any of them, with any +tag, comes to the same mailbox. The mailbox comes with a plan for the organization",input:t.strictObject({}),output:t.looseObject({domain:t.string(),displayName:t.string(),addresses:t.array(t.looseObject({address:t.string(),kind:t.string(),project:t.string().nullable()}))}),examples:["allyhub mail addresses"]},(e,s)=>d(async()=>{const a=await C(l(s));return{value:a,text:[...a.addresses.map(i=>`${i.address} ${i.kind}${i.project===null?"":` project ${i.project}`}`),`Sent as "${a.displayName}"; mail is kept ${String(a.retentionDays)} days.`].join(`
5
+ `)}})),mailAlias=r({name:"mail alias",summary:"Add an address of its own to your mailbox (<name>.<team>@<domain>), for a site that refuses +tags or wants a different address for each account",input:t.strictObject({name:t.string().describe("Its name: 2 to 40 lowercase letters, digits and hyphens"),project:t.string().optional().describe("A project to label it with, to search its mail by")}),positional:["name"],output:t.looseObject({address:t.string()}),examples:["allyhub mail alias launch-test2 --project acme-launch"]},(e,s)=>d(async()=>{const a=await N(l(s),{name:e.name,...e.project===void 0?{}:{project:e.project}});return{value:a,text:a.address}})),mailSearch=r({name:"mail search",summary:"List the mail your mailbox received and sent, newest first; each option narrows it",input:t.strictObject({...O,direction:t.enum(_).optional().describe("in (received) or out (sent); both by default"),since:t.string().optional().describe("Received after this moment (ISO 8601, as 2026-11-05T10:00:00Z)"),order:t.enum(W).default("newest").describe("newest or oldest first"),limit:t.number().int().min(1).max(f.listed).default(20).describe(`How many to list, at most ${String(f.listed)}`)}),output:t.looseObject({messages:t.array(u)}),examples:["allyhub mail search --from shop.example --limit 5","allyhub mail search --to ada.acme+staging --since 2026-11-05T10:00:00Z"]},(e,s)=>d(async()=>{const a=await w(l(s),e);return{value:{messages:a},text:a.length===0?"No mail matches.":a.map(P).join(`
6
+ `)}})),mailRead=r({name:"mail read",summary:"Read a message: its text, its links and its attachments' names; its HTML or the message as it came on ask",input:t.strictObject({id:t.string().describe("The message's id, from mail search or mail wait"),html:t.boolean().default(!1).describe("Include its HTML"),raw:t.boolean().default(!1).describe("Print the message as it came (MIME), headers and all")}),positional:["id"],output:t.union([$,t.looseObject({raw:t.string()})]),examples:["allyhub mail read 3f2c… --html"]},(e,s)=>d(async()=>{const a=l(s);if(e.raw){const o=new TextDecoder().decode(await E(a,e.id));return{value:{raw:o},text:o}}const i=await y(a,e.id,{html:e.html});return{value:i,text:i.html===void 0?p(i):`${p(i)}
7
7
 
8
8
  HTML:
9
- ${i.html}`}})),mailWait=r({name:"mail wait",summary:"Wait for the next message that matches, received after --since (by default, when the wait starts), and print it whole",input:t.strictObject({...O,since:t.string().optional().describe("Count mail received after this moment (ISO 8601); give the moment before you acted, so a message that came first is not missed"),timeout:t.number().min(1).max(3600).default(120).describe("Seconds to wait before giving up"),every:t.number().min(1).max(60).default(3).describe("Seconds between looks")}),output:t.looseObject({message:$.nullable(),timedOut:t.boolean()}),examples:['allyhub mail wait --to ada.acme+staging --from staging.example --since "$(date -u +%Y-%m-%dT%H:%M:%SZ)"']},(e,s)=>d(async()=>{const a=l(s),i=e.since??new Date().toISOString();if(Number.isNaN(Date.parse(i)))throw new j("invalid-since",`--since is not a moment: "${i}".`,{hint:"Write it as 2026-11-05T10:00:00Z.",exit:x.usage});const{timeout:o,every:c,...n}=e,T={...n,direction:"in",since:new Date(i).toISOString(),order:"oldest",limit:1},p=Date.now()+o*1e3;for(;;){let b;try{[b]=await w(a,T,s.signal)}catch(m){if(!B(m)||s.signal.aborted||Date.now()+c*1e3>p)throw m}if(b!==void 0){const m=await y(a,b.id);return{value:{message:m,timedOut:!1},text:g(m)}}if(Date.now()+c*1e3>p)break;await D(c*1e3,void 0,{signal:s.signal})}return{value:{message:null,timedOut:!0},text:`No mail matched in ${String(o)} seconds.`,exit:1}}));const I={text:t.string().optional().describe("Its text; or --body-file"),bodyFile:t.string().optional().describe("A file holding its text"),htmlFile:t.string().optional().describe("A file holding its HTML, sent beside its text"),attach:t.array(t.string()).optional().describe(`Files to attach, ${String(f.attachmentBytes/1024/1024)} MB together at most`),from:t.string().optional().describe("One of your mailbox's addresses, a +tag allowed; your main one by default")};async function A(e,s){const a=n=>R(s.cwd,n);if(e.text===void 0==(e.bodyFile===void 0))throw new j("no-text","Give the message's text with --text or --body-file, one of them.",{exit:x.usage});const i=e.text??await h(a(e.bodyFile??""),"utf8"),o=e.htmlFile===void 0?void 0:await h(a(e.htmlFile),"utf8"),c=await Promise.all((e.attach??[]).map(async n=>({name:k(n),type:L(n)??"application/octet-stream",content:(await h(a(n))).toString("base64")})));return{text:i,...o===void 0?{}:{html:o},...c.length===0?{}:{attachments:c},...e.from===void 0?{}:{from:e.from}}}const M=(e,s)=>`${s} ${e.subject===""?"(no subject)":`"${e.subject}"`} from ${e.to}. Id: ${e.id} Thread: ${e.threadId}`;export const mailSend=r({name:"mail send",summary:"Send a message from your mailbox, to whom your person lets it write (your organization's people by default); a line under it says an AI agent wrote it",input:t.strictObject({to:t.array(t.string()).min(1).describe("Recipients' addresses"),cc:t.array(t.string()).optional().describe("Addresses to copy"),subject:t.string().describe("Its subject"),...I}),output:u,examples:['allyhub mail send --to ben@acme.com --subject "Storyboard v2" --body-file note.txt --attach out/storyboard.pdf']},(e,s)=>d(async()=>{const a=await A(e,s),i=await _(l(s),{to:e.to,...e.cc===void 0?{}:{cc:e.cc},subject:e.subject,...a});return{value:i,text:M(i,"Sent")}})),mailReply=r({name:"mail reply",summary:"Reply to a message, in its thread: to its sender, or with --all to everyone it named; from the address it came to",input:t.strictObject({id:t.string().describe("The message's id"),all:t.boolean().default(!1).describe("Reply to everyone it named too"),...I}),positional:["id"],output:u,examples:['allyhub mail reply 3f2c… --text "Thanks, on it."']},(e,s)=>d(async()=>{const a=await A(e,s),i=await H(l(s),e.id,{...e.all?{all:!0}:{},...a});return{value:i,text:M(i,"Replied")}})),MAIL_COMMANDS=[mailAddresses,mailAlias,mailSearch,mailRead,mailWait,mailSend,mailReply];
9
+ ${i.html}`}})),mailWait=r({name:"mail wait",summary:"Wait for the next message that matches, received after --since (by default, when the wait starts), and print it whole",input:t.strictObject({...O,since:t.string().optional().describe("Count mail received after this moment (ISO 8601); give the moment before you acted, so the wait counts a message that came first too"),timeout:t.number().min(1).max(3600).default(120).describe("Seconds to wait at most"),every:t.number().min(1).max(60).default(3).describe("Seconds between looks")}),output:t.looseObject({message:$.nullable(),timedOut:t.boolean()}),examples:['allyhub mail wait --to ada.acme+staging --from staging.example --since "$(date -u +%Y-%m-%dT%H:%M:%SZ)"']},(e,s)=>d(async()=>{const a=l(s),i=e.since??new Date().toISOString();if(Number.isNaN(Date.parse(i)))throw new j("invalid-since",`--since is not a moment: "${i}".`,{hint:"Write it as 2026-11-05T10:00:00Z.",exit:x.usage});const{timeout:o,every:c,...n}=e,M={...n,direction:"in",since:new Date(i).toISOString(),order:"oldest",limit:1},g=Date.now()+o*1e3;for(;;){let h;try{[h]=await w(a,M,s.signal)}catch(m){if(!B(m)||s.signal.aborted||Date.now()+c*1e3>g)throw m}if(h!==void 0){const m=await y(a,h.id);return{value:{message:m,timedOut:!1},text:p(m)}}if(Date.now()+c*1e3>g)break;await D(c*1e3,void 0,{signal:s.signal})}return{value:{message:null,timedOut:!0},text:`No mail matched in ${String(o)} seconds.`,exit:1}}));const I={text:t.string().optional().describe("Its text; or --body-file"),bodyFile:t.string().optional().describe("A file holding its text"),htmlFile:t.string().optional().describe("A file holding its HTML, sent beside its text"),attach:t.array(t.string()).optional().describe(`Files to attach, ${String(f.attachmentBytes/1024/1024)} MB together at most`),from:t.string().optional().describe("One of your mailbox's addresses, a +tag allowed; your main one by default")};async function T(e,s){const a=n=>R(s.cwd,n);if(e.text===void 0==(e.bodyFile===void 0))throw new j("no-text","Give the message's text with --text or --body-file, one of them.",{exit:x.usage});const i=e.text??await b(a(e.bodyFile??""),"utf8"),o=e.htmlFile===void 0?void 0:await b(a(e.htmlFile),"utf8"),c=await Promise.all((e.attach??[]).map(async n=>({name:k(n),type:L(n)??"application/octet-stream",content:(await b(a(n))).toString("base64")})));return{text:i,...o===void 0?{}:{html:o},...c.length===0?{}:{attachments:c},...e.from===void 0?{}:{from:e.from}}}const A=(e,s)=>`${s} ${e.subject===""?"(no subject)":`"${e.subject}"`} from ${e.to}. Id: ${e.id} Thread: ${e.threadId}`;export const mailSend=r({name:"mail send",summary:"Send a message from your mailbox, to whom your person lets it write (your organization's people by default); a line under it says an AI agent wrote it",input:t.strictObject({to:t.array(t.string()).min(1).describe("Recipients' addresses"),cc:t.array(t.string()).optional().describe("Addresses to copy"),subject:t.string().describe("Its subject"),...I}),output:u,examples:['allyhub mail send --to ben@acme.com --subject "Storyboard v2" --body-file note.txt --attach out/storyboard.pdf']},(e,s)=>d(async()=>{const a=await T(e,s),i=await z(l(s),{to:e.to,...e.cc===void 0?{}:{cc:e.cc},subject:e.subject,...a});return{value:i,text:A(i,"Sent")}})),mailReply=r({name:"mail reply",summary:"Reply to a message, in its thread: to its sender, or with --all to everyone it named; from the address it came to",input:t.strictObject({id:t.string().describe("The message's id"),all:t.boolean().default(!1).describe("Reply to everyone it named too"),...I}),positional:["id"],output:u,examples:['allyhub mail reply 3f2c… --text "Thanks, on it."']},(e,s)=>d(async()=>{const a=await T(e,s),i=await H(l(s),e.id,{...e.all?{all:!0}:{},...a});return{value:i,text:A(i,"Replied")}})),MAIL_COMMANDS=[mailAddresses,mailAlias,mailSearch,mailRead,mailWait,mailSend,mailReply];
@@ -1,3 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{join as x,resolve as w}from"node:path";import{z as e}from"zod";import{formatConsole as v,formatProblem as k}from"../text/index.js";import{exportProject as P}from"@allyhub/export";import{GIF_ENCODE as m,SHARE_ENCODE as n}from"@allyhub/render";import{consoleJson as p}from"@allyhub/project";import{OUT_DIR as $}from"@allyhub/formats";import{EXIT as c}from"@allyhub/protocol";import{madeNotes as A}from"@allyhub/build";import{defineCommand as j}from"../command.js";import{parameters as O}from"../parameters.js";import{projectRoot as S}from"../project.js";import{combosOf as D,commandError as F}from"../version.js";import{dir as E,indexing as N}from"../fields.js";import{extensionsAt as h,kindsAt as T}from"./extensions.js";const z={codec:e.enum(["h264","h265"]).default("h264").describe("The mp4's video codec; h265 is smaller"),crf:e.number().int().min(0).max(63).optional().describe(`Quality, lower is better: default ${String(n.crf)} for an mp4, ready to share, 30 for a webm`),maxBitrate:e.number().int().min(0).max(5e5).optional().describe(`An mp4's most video bitrate, kbit/s, 0 for none: default ${String(n.maxKbps)} at 1080p ${String(n.fps)} fps, scaled by the frame's pixels and the frames a second (16000 at 1080p 60, 32000 at 4K 30), so the file is ready to share`),audioBitrate:e.number().int().min(32).max(512).optional().describe("The sound's bitrate, kbit/s: default 192 (AAC in an mp4), 160 (Opus in a webm); a mov keeps PCM"),gifWidth:e.number().int().min(0).max(16384).optional().describe(`A gif's width in pixels, its height in proportion, never more than the video's: default ${String(m.width)}; 0 for the video's own`),gifFps:e.number().min(0).max(120).optional().describe(`A gif's frames a second, never more than the video's: default ${String(m.fps)}; 0 for the video's own`),steps:e.boolean().default(!1).describe("A deck's pdf, png and pptx: a page, a file or a slide per step of each page, not only its last"),values:e.enum(["data","shown"]).optional().describe("A sheet's csv, json and md: each value as data (a date 2026-01-15, a time 09:30, a duration 36:00, a number to 15 digits; csv's and json's default) or as its format shows it (15 Jan 2026, $1,200.00; md's default)"),bom:e.boolean().default(!0).describe("A sheet's csv starts with a UTF-8 byte-order mark, by which Excel reads its letters right (é, €, 中文); false for a tool that does not expect one"),quality:e.number().int().min(0).max(100).optional().describe("An image's jpeg and webp, 0–100: default 90 for a jpeg, a webp lossless"),scale:e.number().min(.25).max(4).optional().describe("An image's png, jpeg, webp and zip: each board's picture this many times its size, its layout kept (type and shapes drawn sharp, a picture as many pixels as its file has); default 1"),width:e.number().int().min(1).optional().describe("An image's pictures each this many pixels wide, the height in proportion: a scale for each board"),height:e.number().int().min(1).optional().describe("An image's pictures each this many pixels high, the width in proportion: a scale for each board"),maxKb:e.number().min(1).optional().describe("An image's jpeg and webp: each board's file at most this many KB, at the best quality under it (said); a png over it is not made"),psd:e.enum(["psd","psb"]).default("psd").describe("An image's psd: psd, or psb (Photoshop's large document format); a board is at most 16384 pixels a side, which a psd holds"),pptx:e.enum(["native","picture"]).default("native").describe("A deck's pptx: native, PowerPoint's own model, editable there (the deck's masters, layouts, placeholders, shapes, text, pictures, videos and notes, a component as its picture); or picture, each slide a picture of the page")},C=(s,i)=>`${String(s)} ${i}${s===1?"":"s"}`;export const render=j({name:"render",summary:"The files: a video, its frames, subtitles, cover and mastered mix; a batch's table of ads; a deck's PDF, PPTX and PNGs; a doc's PDF and Markdown; a sheet's Excel workbook with live formulas, PDF, PNG, CSV, Markdown and JSON; an image's pictures, PDF and layered PSDs; a 3D model's GLB",input:e.strictObject({items:e.array(e.string()).optional().describe("Only these items: each an id (its file without its extension) or its file, or a folder of items; default every one"),combo:e.array(e.string()).optional().describe("Only the combos matching name=value pairs joined with commas (lang=zh-cn,hook=b), or a combo's id (c03)"),type:e.array(e.string()).optional().describe("File types: mp4, mov, webm, gif, png, srt, vtt (cues cut as the piece's captions layer cuts them, else by default), cover, wav (the mix, mastered as the render masters it: 48 kHz, 16 bits, the film's length); csv for a piece with slots, its table of ads (<piece>.ads.csv: a row per ad with its combo, picks, length, file, name and generated media); a doc's pdf, docx, png; a sheet's xlsx (every sheet, formulas live with their values cached), pdf, png, csv (a file a sheet); an image's png, jpeg, webp (a file a board), pdf, zip and psd (a layered Photoshop file a board: each layer of its kind, its pixels drawn by Chrome); a deck's pdf, png, pptx; a report's html (one file that runs offline), pdf, png; a LinkedIn or X post's linkedin-post or x-post (its API request, its media beside), txt (its text as written, its media and their alt text beside), png; an article's linkedin-article or x-article, png; a 3D model's glb. Default mp4 for a video, pdf for a deck and a doc, html for a report, xlsx for a sheet, png for an image, glb for a model; a type an item does not have is skipped"),out:e.string().optional().describe("The folder the files go in; default .allyhub/out"),name:e.string().optional().describe("Name a video's or deck's files <name>.<ext> in its folder of the output, with what tells its versions apart before the extension when there are several (<name>.zh-cn.mp4, <name>.c03.mp4); default <output>.<combo>.<ext>"),params:O(z),dir:E}),positional:["items"],output:e.looseObject({out:e.string(),files:e.array(e.looseObject({name:e.string(),path:e.string(),type:e.string()})),failed:e.array(e.looseObject({name:e.string(),code:e.string()}))}),examples:["allyhub render","allyhub render launch/film --type mp4,srt","allyhub render launch/film --type wav","allyhub render ads/tidyform --type csv","allyhub render launch/plan --type pdf,md","allyhub render finance/budget --type xlsx,pdf","allyhub render finance/budget --type csv --param bom=false","allyhub render launch/deck --type pptx --param pptx=picture","allyhub render launch/poster --type psd","allyhub render launch/poster --type jpeg --param scale=2 --param max-kb=2000","allyhub render --combo lang=zh-cn --param crf=16","allyhub render launch/film --name launch-film --param max-bitrate=0"]},async(s,i)=>{const o=await S(i.cwd,s.dir),f=w(i.cwd,s.out??x(o,$)),u=Object.fromEntries(Object.entries(s.params).filter(([,a])=>a!==void 0));let d=0,t;try{t=await P({root:o,kinds:T(o),out:f,...s.items===void 0?{}:{items:s.items},combos:D(s),...s.type===void 0?{}:{types:s.type},...s.name===void 0?{}:{name:s.name},params:u,index:N(i.env),analyses:h(o).mediaAnalyses(),env:i.env,processors:h(o).exportProcessors(),log:a=>{i.progress(a)},onProgress:a=>{const r=Math.floor(a*10);r<=d||r>=10||(d=r,i.progress(`${String(r*10)}%`))},signal:i.signal})}catch(a){throw F(a)}const b=a=>a?` (${a.integrated.toFixed(1)} LUFS, true peak ${a.truePeak===void 0?"–":a.truePeak.toFixed(1)} dBTP)`:"",g=t.problems.filter(a=>a.level==="error"),l=t.files.flatMap(a=>a.files.length>1?a.files.map(r=>` ${r}`):[` ${a.path}${b(a.loudness)}`]),y=[`${C(l.length,"file")} in ${t.out}:`,...l,...t.failed.length>0?["Not made:",...t.failed.map(a=>` ${a.name}: ${a.message}${a.hint?` ${a.hint}`:""}`)]:[],...t.unindexed.map(a=>`Not indexed, drawn the fallback way: ${a.file} (${a.error})`),...A(t.files),...g.map(k),...v(p(t.console))];return{value:{out:t.out,files:t.files.map(a=>({...a})),failed:t.failed.map(a=>({...a})),problems:t.problems,...t.unindexed.length>0?{unindexed:t.unindexed}:{},...p(t.console)},text:y.join(`
2
+ import{join as x,resolve as w}from"node:path";import{z as e}from"zod";import{formatConsole as v,formatProblem as k}from"../text/index.js";import{exportProject as P}from"@allyhub/export";import{GIF_ENCODE as m,SHARE_ENCODE as n}from"@allyhub/render";import{consoleJson as p}from"@allyhub/project";import{OUT_DIR as $}from"@allyhub/formats";import{EXIT as c}from"@allyhub/protocol";import{madeNotes as A}from"@allyhub/build";import{defineCommand as j}from"../command.js";import{parameters as O}from"../parameters.js";import{projectRoot as S}from"../project.js";import{combosOf as F,commandError as D}from"../version.js";import{dir as E,indexing as T}from"../fields.js";import{extensionsAt as h,kindsAt as N}from"./extensions.js";const z={codec:e.enum(["h264","h265"]).default("h264").describe("The mp4's video codec; h265 is smaller"),crf:e.number().int().min(0).max(63).optional().describe(`Quality, lower is better: default ${String(n.crf)} for an mp4, ready to share, 30 for a webm`),maxBitrate:e.number().int().min(0).max(5e5).optional().describe(`An mp4's most video bitrate, kbit/s, 0 for none: default ${String(n.maxKbps)} at 1080p ${String(n.fps)} fps, scaled by the frame's pixels and the frames a second (16000 at 1080p 60, 32000 at 4K 30), so the file is ready to share`),audioBitrate:e.number().int().min(32).max(512).optional().describe("The sound's bitrate, kbit/s: default 192 (AAC in an mp4), 160 (Opus in a webm); a mov keeps PCM"),gifWidth:e.number().int().min(0).max(16384).optional().describe(`A gif's width in pixels, its height in proportion, up to the video's: default ${String(m.width)}; 0 for the video's own`),gifFps:e.number().min(0).max(120).optional().describe(`A gif's frames a second, up to the video's: default ${String(m.fps)}; 0 for the video's own`),steps:e.boolean().default(!1).describe("A deck's pdf, png and pptx: a page, a file or a slide per step of each page (default each page's last step)"),values:e.enum(["data","shown"]).optional().describe("A sheet's csv, json and md: each value as data (a date 2026-01-15, a time 09:30, a duration 36:00, a number to 15 digits; csv's and json's default) or as its format shows it (15 Jan 2026, $1,200.00; md's default)"),bom:e.boolean().default(!0).describe("A sheet's csv starts with a UTF-8 byte-order mark, by which Excel reads its letters right (é, €, 中文); false for a tool that reads plain UTF-8"),quality:e.number().int().min(0).max(100).optional().describe("An image's jpeg and webp, 0–100: default 90 for a jpeg, a webp lossless"),scale:e.number().min(.25).max(4).optional().describe("An image's png, jpeg, webp and zip: each board's picture this many times its size, its layout kept (type and shapes drawn sharp, a picture as many pixels as its file has); default 1"),width:e.number().int().min(1).optional().describe("An image's pictures each this many pixels wide, the height in proportion: a scale for each board"),height:e.number().int().min(1).optional().describe("An image's pictures each this many pixels high, the width in proportion: a scale for each board"),maxKb:e.number().min(1).optional().describe("An image's jpeg and webp: each board's file at most this many KB, at the best quality under it (said); a png is made when it fits under it"),psd:e.enum(["psd","psb"]).default("psd").describe("An image's psd: psd, or psb (Photoshop's large document format); a board is at most 16384 pixels a side, which a psd holds"),pptx:e.enum(["native","picture"]).default("native").describe("A deck's pptx: native, PowerPoint's own model, editable there (the deck's masters, layouts, placeholders, shapes, text, pictures, videos and notes, a component as its picture); or picture, each slide a picture of the page")},C=(s,i)=>`${String(s)} ${i}${s===1?"":"s"}`;export const render=j({name:"render",summary:"The files: a video, its frames, subtitles, cover and mastered mix; a batch's table of ads; a deck's PDF, PPTX and PNGs; a doc's PDF and Markdown; a sheet's Excel workbook with live formulas, PDF, PNG, CSV, Markdown and JSON; an image's pictures, PDF and layered PSDs; a 3D model's GLB",input:e.strictObject({items:e.array(e.string()).optional().describe("Only these items: each an id (its file without its extension) or its file, or a folder of items; default every one"),combo:e.array(e.string()).optional().describe("Only the combos matching name=value pairs joined with commas (lang=zh-cn,hook=b), or a combo's id (c03)"),type:e.array(e.string()).optional().describe("File types: mp4, mov, webm, gif, png, srt, vtt (cues cut as the piece's captions layer cuts them, else by default), cover, wav (the mix, mastered as the render masters it: 48 kHz, 16 bits, the film's length); csv for a piece with slots, its table of ads (<piece>.ads.csv: a row per ad with its combo, picks, length, file, name and generated media); a doc's pdf, docx, png; a sheet's xlsx (every sheet, formulas live with their values cached), pdf, png, csv (a file a sheet); an image's png, jpeg, webp (a file a board), pdf, zip and psd (a layered Photoshop file a board: each layer of its kind, its pixels drawn by Chrome); a deck's pdf, png, pptx; a report's html (one file that runs offline), pdf, png; a LinkedIn or X post's linkedin-post or x-post (its API request, its media beside), txt (its text as written, its media and their alt text beside), png; an article's linkedin-article or x-article, png; a 3D model's glb. Default mp4 for a video, pdf for a deck and a doc, html for a report, xlsx for a sheet, png for an image, glb for a model; each item makes the types it has"),out:e.string().optional().describe("The folder the files go in; default .allyhub/out"),name:e.string().optional().describe("Name a video's or deck's files <name>.<ext> in its folder of the output, with what tells its versions apart before the extension when there are several (<name>.zh-cn.mp4, <name>.c03.mp4); default <output>.<combo>.<ext>"),params:O(z),dir:E}),positional:["items"],output:e.looseObject({out:e.string(),files:e.array(e.looseObject({name:e.string(),path:e.string(),type:e.string()})),failed:e.array(e.looseObject({name:e.string(),code:e.string()}))}),examples:["allyhub render","allyhub render launch/film --type mp4,srt","allyhub render launch/film --type wav","allyhub render ads/tidyform --type csv","allyhub render launch/plan --type pdf,md","allyhub render finance/budget --type xlsx,pdf","allyhub render finance/budget --type csv --param bom=false","allyhub render launch/deck --type pptx --param pptx=picture","allyhub render launch/poster --type psd","allyhub render launch/poster --type jpeg --param scale=2 --param max-kb=2000","allyhub render --combo lang=zh-cn --param crf=16","allyhub render launch/film --name launch-film --param max-bitrate=0"]},async(s,i)=>{const o=await S(i.cwd,s.dir),f=w(i.cwd,s.out??x(o,$)),u=Object.fromEntries(Object.entries(s.params).filter(([,a])=>a!==void 0));let d=0,t;try{t=await P({root:o,kinds:N(o),out:f,...s.items===void 0?{}:{items:s.items},combos:F(s),...s.type===void 0?{}:{types:s.type},...s.name===void 0?{}:{name:s.name},params:u,index:T(i.env),analyses:h(o).mediaAnalyses(),env:i.env,processors:h(o).exportProcessors(),log:a=>{i.progress(a)},onProgress:a=>{const r=Math.floor(a*10);r<=d||r>=10||(d=r,i.progress(`${String(r*10)}%`))},signal:i.signal})}catch(a){throw D(a)}const b=a=>a?` (${a.integrated.toFixed(1)} LUFS, true peak ${a.truePeak===void 0?"–":a.truePeak.toFixed(1)} dBTP)`:"",g=t.problems.filter(a=>a.level==="error"),l=t.files.flatMap(a=>a.files.length>1?a.files.map(r=>` ${r}`):[` ${a.path}${b(a.loudness)}`]),y=[`${C(l.length,"file")} in ${t.out}:`,...l,...t.failed.length>0?["Not made:",...t.failed.map(a=>` ${a.name}: ${a.message}${a.hint?` ${a.hint}`:""}`)]:[],...t.unindexed.map(a=>`Not indexed, drawn the fallback way: ${a.file} (${a.error})`),...A(t.files),...g.map(k),...v(p(t.console))];return{value:{out:t.out,files:t.files.map(a=>({...a})),failed:t.failed.map(a=>({...a})),problems:t.problems,...t.unindexed.length>0?{unindexed:t.unindexed}:{},...p(t.console)},text:y.join(`
3
3
  `),exit:t.failed.length>0?c.failed:c.ok}});
package/dist/main.js CHANGED
@@ -1,9 +1,9 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{mkdir as P,writeFile as Y}from"node:fs/promises";import{tmpdir as F}from"node:os";import{dirname as V,join as O}from"node:path";import"@allyhub/stage-runtime/use";import{EXIT as m,describeCommand as T}from"@allyhub/protocol";import{WORK_DIR as X}from"@allyhub/formats";import{projectAt as q}from"./project.js";import{cutLong as z}from"./text/index.js";import{readArgs as Q}from"./args.js";import{CLI_VERSION as x}from"./cli-version.js";import{CommandError as C}from"./command.js";import{COMMAND_SOURCES as H,COMMANDS as W,allCommands as Z}from"./commands/index.js";import{contributedSpecs as tt}from"./commands/contributed.js";import{builtInExtensions as nt}from"./commands/extensions.js";import{commandHelp as _,groupHelp as et,listHelp as ot,workHelp as rt}from"./help.js";import{sdkDocs as it}from"./sdk-docs.js";import{cliTelemetry as st}from"./telemetry.js";import{turnOf as at}from"./turn.js";import{WORKS as ct,cloudNouns as lt,withJoined as J,workNamed as mt,workTitle as U}from"./works.js";const j={stdout:e=>process.stdout.write(e),stderr:e=>process.stderr.write(e),cwd:process.cwd(),env:process.env};export function findCommand(e,i=W){let p;for(const c of i){const d=c.spec.name.split(" ");d.every((f,h)=>e[h]===f)&&d.length>(p?.length??0)&&(p={command:c,length:d.length})}return p?{command:p.command,rest:e.slice(p.length)}:{rest:[...e]}}export async function resolveCommand(e,i,p=W,c=H){const d=findCommand(e,p);if(d.command){const f=d.command.spec.name;if(d.rest.length>0)for(const h of c.filter(o=>o.under===f)){const o=await h.resolve(e,i);if(o)return o}return d}for(const f of c){const h=await f.resolve(e,i);if(h)return h}return d}const B=e=>({...T(e.spec),...e.about?.value});export async function main(e,i=j,p,c=H,d){nt();const f=p??await Z(),h=e.includes("--json"),o=e.filter(t=>t!=="--json"),y=async(t,n,g)=>{if(h){i.stdout(`${JSON.stringify(t,null,2)}
3
- `);return}const b=await q(i.cwd),l=O(b===void 0?O(F(),"allyhub"):O(b,X),"out",`${g.replaceAll(" ","-")}.txt`),u=z(n,l);u!==void 0&&(await P(V(l),{recursive:!0}),await Y(l,`${n}
4
- `)),i.stdout(`${u??n}
5
- `)},N=f.map(t=>t.spec),S=t=>N.filter(n=>t.length>0&&n.name.startsWith(`${t.join(" ")} `)),A=new AbortController,w={cwd:i.cwd,env:{ALLYHUB_CLIENT:`AllyHub-CLI/${x}`,...i.env},progress:t=>{i.stderr(`${t}
6
- `)},signal:A.signal};if(o[0]==="--version"||o[0]==="-v")return await y({version:x},x,"version"),m.ok;if(o.length===0||o[0]==="help"||o[0]==="--help"||o[0]==="-h"){const t=o.slice(1).findIndex(r=>r.startsWith("-")),n=(t<0?o.slice(1):o.slice(1,t+1)).flatMap(r=>r.split(" ").filter(a=>a!=="")),g=await it(i.cwd).catch(()=>{}),b=async()=>{const r=await Promise.all(c.map(a=>a.nouns(w).then(G=>G.map(K=>({...K,work:a.works!==!1}))).catch(()=>{})));return r.some(a=>a===void 0)?void 0:r.flatMap(a=>a??[])},l=await tt(w);if(n.length===0){const r=await b();return await y({version:x,docs:g?.dir,works:ct.map(a=>({...J(a,l),title:U(a,r)})),commands:N.map(T),made:[...c.flatMap(a=>a.entries),...r??[]]},ot(N,c,r,g?.dir),"help"),m.ok}const u=n.length===1?mt(n[0]??""):void 0,k=u&&J(u,l);if(k){const r=k.cloud===void 0?[]:await b();return await y({...k,title:U(k,r),...k.cloud===void 0?{}:{cloudWorks:r&&lt(k,r)},docsDir:g?.dir},rt(k,N,c,g?.dir,r,l),`help ${n.join(" ")}`),m.ok}let v;try{v=await resolveCommand(n,w,f,c)}catch(r){return I(r)}const{command:s,rest:R}=v;if(s&&v.list===!0)return await M(s,R);const L=S(n);return!s&&L.length>0?(await y({commands:L.map(T)},et(n.join(" "),L),`help ${n.join(" ")}`),m.ok):!s||R.length>0?I(new C("unknown-command",`allyhub has no command "${n.join(" ")}".`,{exit:m.usage,hint:"allyhub help lists them and the works."})):(await y(B(s),_(s.spec,s.about?.lines,S(s.spec.name.split(" "))),`help ${s.spec.name}`),m.ok)}let D;try{D=await resolveCommand(o,w,f,c)}catch(t){return I(t)}const{command:$,rest:E}=D;if(!$){const t=S(o.slice(0,1));return I(new C("unknown-command",`allyhub has no command "${o.join(" ")}".`,{exit:m.usage,hint:t.length>0?`${o[0]??""} has these: ${t.map(n=>n.name).join(", ")}.`:"allyhub help lists them."}))}if(E.includes("--help")||E.includes("-h"))return await y(B($),_($.spec,$.about?.lines,S($.spec.name.split(" "))),`${$.spec.name} help`),m.ok;return await M($,E);async function M(t,n){const g=()=>{A.abort(new C("interrupted","Stopped.",{exit:m.interrupted}))};process.once("SIGINT",g);const b=Date.now();let l=m.failed;const u=await at(w.env,w.cwd),k=u===void 0?w:{...w,env:{...w.env,TRACEPARENT:u}};try{const v=Q(t.spec,n),s=await t.run(v,k);await y(s.value,s.text,t.spec.name),l=s.exit??m.ok}catch(v){l=I(v)}finally{process.off("SIGINT",g)}return await d?.({command:t.spec.name,ms:Date.now()-b,exit:l,...u===void 0?{}:{traceparent:u}}),l}function I(t){const n=t instanceof C?t:A.signal.aborted?new C("interrupted","Stopped.",{exit:m.interrupted}):new C("failed",t instanceof Error?t.message:String(t));return h?i.stdout(`${JSON.stringify({error:{code:n.code,message:n.message,...n.hint?{hint:n.hint}:{}}},null,2)}
7
- `):i.stderr(`${n.message}${n.hint?`
8
- ${n.hint}`:""}
9
- `),n.exit}}export function run(e){return main(e,j,void 0,H,st({ALLYHUB_CLIENT:`AllyHub-CLI/${x}`,...j.env},i=>{j.stderr(i)}))}
2
+ import{mkdir as Y,writeFile as V}from"node:fs/promises";import{tmpdir as X}from"node:os";import{dirname as q,join as T}from"node:path";import"@allyhub/stage-runtime/use";import{EXIT as l,PROBLEMS_FOUND as z,describeCommand as D}from"@allyhub/protocol";import{WORK_DIR as Q}from"@allyhub/formats";import{projectAt as Z}from"./project.js";import{cutLong as tt}from"./text/index.js";import{readArgs as et}from"./args.js";import{CLI_VERSION as I}from"./cli-version.js";import{CommandError as x}from"./command.js";import{COMMAND_SOURCES as H,COMMANDS as U,allCommands as nt}from"./commands/index.js";import{contributedSpecs as ot}from"./commands/contributed.js";import{builtInExtensions as rt}from"./commands/extensions.js";import{commandHelp as B,groupHelp as it,listHelp as st,workHelp as at}from"./help.js";import{sdkDocs as ct}from"./sdk-docs.js";import{cliTelemetry as lt}from"./telemetry.js";import{turnOf as dt}from"./turn.js";import{WORKS as mt,cloudNouns as ut,withJoined as J,workNamed as pt,workTitle as P}from"./works.js";const A={stdout:n=>process.stdout.write(n),stderr:n=>process.stderr.write(n),cwd:process.cwd(),env:process.env};export function findCommand(n,i=U){let h;for(const d of i){const u=d.spec.name.split(" ");u.every((w,g)=>n[g]===w)&&u.length>(h?.length??0)&&(h={command:d,length:u.length})}return h?{command:h.command,rest:n.slice(h.length)}:{rest:[...n]}}export async function resolveCommand(n,i,h=U,d=H){const u=findCommand(n,h);if(u.command){const w=u.command.spec.name;if(u.rest.length>0)for(const g of d.filter(o=>o.under===w)){const o=await g.resolve(n,i);if(o)return o}return u}for(const w of d){const g=await w.resolve(n,i);if(g)return g}return u}const F=n=>({...D(n.spec),...n.about?.value});export async function main(n,i=A,h,d=H,u){rt();const w=h??await nt(),g=n.includes("--json"),o=n.filter(t=>t!=="--json"),b=async(t,e,$)=>{if(g){i.stdout(`${JSON.stringify(t,null,2)}
3
+ `);return}const k=await Z(i.cwd),s=T(k===void 0?T(X(),"allyhub"):T(k,Q),"out",`${$.replaceAll(" ","-")}.txt`),f=tt(e,s);f!==void 0&&(await Y(q(s),{recursive:!0}),await V(s,`${e}
4
+ `)),i.stdout(`${f??e}
5
+ `)},N=w.map(t=>t.spec),S=t=>N.filter(e=>t.length>0&&e.name.startsWith(`${t.join(" ")} `)),O=new AbortController,y={cwd:i.cwd,env:{ALLYHUB_CLIENT:`AllyHub-CLI/${I}`,...i.env},progress:t=>{i.stderr(`${t}
6
+ `)},signal:O.signal};if(o[0]==="--version"||o[0]==="-v")return await b({version:I},I,"version"),l.ok;if(o.length===0||o[0]==="help"||o[0]==="--help"||o[0]==="-h"){const t=o.slice(1).findIndex(r=>r.startsWith("-")),e=(t<0?o.slice(1):o.slice(1,t+1)).flatMap(r=>r.split(" ").filter(c=>c!=="")),$=await ct(i.cwd).catch(()=>{}),k=async()=>{const r=await Promise.all(d.map(c=>c.nouns(y).then(G=>G.map(K=>({...K,work:c.works!==!1}))).catch(()=>{})));return r.some(c=>c===void 0)?void 0:r.flatMap(c=>c??[])},s=await ot(y);if(e.length===0){const r=await k();return await b({version:I,docs:$?.dir,works:mt.map(c=>({...J(c,s),title:P(c,r)})),commands:N.map(D),made:[...d.flatMap(c=>c.entries),...r??[]]},st(N,d,r,$?.dir),"help"),l.ok}const f=e.length===1?pt(e[0]??""):void 0,m=f&&J(f,s);if(m){const r=m.cloud===void 0?[]:await k();return await b({...m,title:P(m,r),...m.cloud===void 0?{}:{cloudWorks:r&&ut(m,r)},docsDir:$?.dir},at(m,N,d,$?.dir,r,s),`help ${e.join(" ")}`),l.ok}let C;try{C=await resolveCommand(e,y,w,d)}catch(r){return j(r)}const{command:a,rest:p}=C;if(a&&C.list===!0)return await R(a,p);const L=S(e);return!a&&L.length>0?(await b({commands:L.map(D)},it(e.join(" "),L),`help ${e.join(" ")}`),l.ok):!a||p.length>0?j(new x("unknown-command",`allyhub has no command "${e.join(" ")}".`,{exit:l.usage,hint:"allyhub help lists them and the works."})):(await b(F(a),B(a.spec,a.about?.lines,S(a.spec.name.split(" "))),`help ${a.spec.name}`),l.ok)}let M;try{M=await resolveCommand(o,y,w,d)}catch(t){return j(t)}const{command:v,rest:E}=M;if(!v){const t=S(o.slice(0,1));return j(new x("unknown-command",`allyhub has no command "${o.join(" ")}".`,{exit:l.usage,hint:t.length>0?`${o[0]??""} has these: ${t.map(e=>e.name).join(", ")}.`:"allyhub help lists them."}))}if(E.includes("--help")||E.includes("-h"))return await b(F(v),B(v.spec,v.about?.lines,S(v.spec.name.split(" "))),`${v.spec.name} help`),l.ok;return await R(v,E);async function R(t,e){const $=()=>{O.abort(new x("interrupted","Stopped.",{exit:l.interrupted}))};process.once("SIGINT",$);const k=Date.now();let s=l.failed,f;const m=await dt(y.env,y.cwd),C=m===void 0?y:{...y,env:{...y.env,TRACEPARENT:m}};try{const a=et(t.spec,e),p=await t.run(a,C);await b(p.value,p.text,t.spec.name),s=p.exit??l.ok,s!==l.ok&&(f=p.code??z)}catch(a){const p=_(a);s=p.exit,f=p.code,W(p)}finally{process.off("SIGINT",$)}return await u?.({command:t.spec.name,ms:Date.now()-k,exit:s,...f===void 0?{}:{code:f},...m===void 0?{}:{traceparent:m}}),s}function j(t){const e=_(t);return W(e),e.exit}function _(t){return t instanceof x?t:O.signal.aborted?new x("interrupted","Stopped.",{exit:l.interrupted}):new x("failed",t instanceof Error?t.message:String(t))}function W(t){g?i.stdout(`${JSON.stringify({error:{code:t.code,message:t.message,...t.hint?{hint:t.hint}:{}}},null,2)}
7
+ `):i.stderr(`${t.message}${t.hint?`
8
+ ${t.hint}`:""}
9
+ `)}}export function run(n){return main(n,A,void 0,H,lt({ALLYHUB_CLIENT:`AllyHub-CLI/${I}`,...A.env},i=>{A.stderr(i)}))}
@@ -1,10 +1,10 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{relative as S}from"node:path";import{CAMERA_DEFAULTS as F,SOLVE_DEFAULTS as b,fieldOfView as y,topObjects as w}from"@allyhub/scenery";import{ruleOf as j}from"@allyhub/scenery-host";export const plural=(e,t)=>`${String(e)} ${t}${e===1?"":"s"}`,shown=(e,t)=>{const s=S(e,t);return s===""||s.startsWith("..")?t:s};const c=e=>e.toFixed(2),l=e=>`(${c(e[0])}, ${c(e[1])}, ${c(e[2])})`,f=e=>e>=1e6?`${(e/1e6).toFixed(2)} M`:e>=1e4?`${(e/1e3).toFixed(1)} k`:String(e),k=e=>e>=1e9?`${(e/1e9).toFixed(2)} GB`:e>=1e6?`${(e/1e6).toFixed(1)} MB`:`${(e/1e3).toFixed(0)} kB`;export function facing(e){const[t,s,o]=e;if(Math.abs(s)>.99)return s>0?"faces up":"faces down";const n=Math.atan2(t,o)*180/Math.PI,i=[[0,"+Z"],[90,"+X"],[180,"−Z"],[-180,"−Z"],[-90,"−X"]].find(([r])=>Math.abs(n-Number(r))<.05);return i?`faces ${String(i[1])}`:`faces yaw ${n.toFixed(1)}°`}const x=200;export function objectLine(e){const t=[`${" ".repeat(e.depth)}${e.path}`,e.type];return e.visible||t.push("hidden"),t.push(`at ${l(e.position)} m`,facing(e.front)),e.upright&&e.box?(t.push(`size ${c(e.upright.length)} × ${c(e.upright.width)} × ${c(e.upright.height)} m upright (along ${e.upright.angle.toFixed(1)}°)`,`box ${l(e.box.min)} to ${l(e.box.max)}`),e.own&&t.push(`own ${c(e.own.size[0])} × ${c(e.own.size[1])} × ${c(e.own.size[2])} m`)):t.push("draws nothing"),e.triangles>0&&t.push(`${f(e.triangles)} tris in ${String(e.meshes)} ${e.meshes===1?"mesh":"meshes"}`),e.materials.length>0&&t.push(e.materials.join(", ")),t.join(" | ")}export function cameraLine(e,t){const s=t.target===void 0?t.direction?`along ${l(t.direction)}`:`yaw ${String(t.yaw??0)}° pitch ${String(t.pitch??0)}°`:typeof t.target=="string"?`→ ${t.target}`:`→ ${l(t.target)}`,o=t.fov!==void 0?`fov ${String(t.fov)}°`:`${String(t.lens??F.lens)} mm`;return` ${e}: at ${l(t.position)} ${s}, ${o}`}export function inventoryText(e,t,s){const o=t.totals,n=t.objects.filter($=>$.name!=="").length,i=[`${e} at ${t.t.toFixed(2)} s. Y up, metres; a camera looks down −Z, a glTF model faces +Z. Positions and sizes in world space.`,`Drawn by ${t.renderer.gl||"an unknown renderer"}, three.js r${t.renderer.three} (${t.renderer.kind}).`,`${plural(o.objects,"object")} (${String(n)} named, ${String(t.unnamed)} unnamed), ${String(o.meshes)} meshes, ${f(o.triangles)} triangles, ${plural(o.drawCalls,"draw call")}, ${plural(o.textures,"texture")} (${k(o.textureBytes)} with mipmaps); a ${String(o.frameSize[0])} × ${String(o.frameSize[1])} frame drew in ${o.frameMs.toFixed(0)} ms${o.transmission?`, ${o.transmission.withoutMs.toFixed(0)} ms without its ${plural(o.transmission.objects.length,"transmissive object")} (${o.transmission.objects.join(", ")}), for which three.js draws the scene once more`:""}.`],r=Object.entries(t.repeated);r.length>0&&i.push(`Names given to more than one object (a camera, move or measurement cannot use them): ${r.map(([$,u])=>`${$} (${String(u)})`).join(", ")}.`),i.push("","Objects:");const a=s?t.objects:w(t.objects);for(const $ of a.slice(0,x))i.push(objectLine($));a.length>x&&i.push(`… ${String(a.length-x)} more, in --json.`);const h=s?0:t.objects.length-w(t.objects).length;h>0&&i.push(`(${plural(h,"object")} inside models and groups not listed: --nested lists them.)`),i.push("",t.lights.length>0?"Lights:":"Lights: none.");for(const $ of t.lights){const u=$.type==="DirectionalLight"?"lx":$.type==="PointLight"||$.type==="SpotLight"?"cd":"";i.push(` ${$.path} | ${$.type} | at ${l($.position)}${$.target?` → ${l($.target)}`:""} | ${$.color} ${String($.intensity)}${u?` ${u}`:""}${$.castShadow?` | shadows ${String($.shadowMap??"")}`:""}${$.angle!==void 0?` | cone ${String($.angle)}°`:""}${$.distance!==void 0?` | reach ${String($.distance)} m`:""}`)}const g=Object.entries(t.cameras);i.push("",g.length>0?"Cameras:":"Cameras: none named.");for(const[$,u]of g)i.push(cameraLine($,u));return i.push(t.moves.length>0?`Moves: ${t.moves.join(", ")}.`:"Moves: none named."),i.join(`
2
+ import{relative as S}from"node:path";import{CAMERA_DEFAULTS as F,SOLVE_DEFAULTS as b,fieldOfView as y,topObjects as w}from"@allyhub/scenery";import{ruleOf as j}from"@allyhub/scenery-host";export const plural=(e,t)=>`${String(e)} ${t}${e===1?"":"s"}`,shown=(e,t)=>{const s=S(e,t);return s===""||s.startsWith("..")?t:s};const c=e=>e.toFixed(2),l=e=>`(${c(e[0])}, ${c(e[1])}, ${c(e[2])})`,f=e=>e>=1e6?`${(e/1e6).toFixed(2)} M`:e>=1e4?`${(e/1e3).toFixed(1)} k`:String(e),k=e=>e>=1e9?`${(e/1e9).toFixed(2)} GB`:e>=1e6?`${(e/1e6).toFixed(1)} MB`:`${(e/1e3).toFixed(0)} kB`;export function facing(e){const[t,s,o]=e;if(Math.abs(s)>.99)return s>0?"faces up":"faces down";const n=Math.atan2(t,o)*180/Math.PI,i=[[0,"+Z"],[90,"+X"],[180,"−Z"],[-180,"−Z"],[-90,"−X"]].find(([r])=>Math.abs(n-Number(r))<.05);return i?`faces ${String(i[1])}`:`faces yaw ${n.toFixed(1)}°`}const x=200;export function objectLine(e){const t=[`${" ".repeat(e.depth)}${e.path}`,e.type];return e.visible||t.push("hidden"),t.push(`at ${l(e.position)} m`,facing(e.front)),e.upright&&e.box?(t.push(`size ${c(e.upright.length)} × ${c(e.upright.width)} × ${c(e.upright.height)} m upright (along ${e.upright.angle.toFixed(1)}°)`,`box ${l(e.box.min)} to ${l(e.box.max)}`),e.own&&t.push(`own ${c(e.own.size[0])} × ${c(e.own.size[1])} × ${c(e.own.size[2])} m`)):t.push("draws nothing"),e.triangles>0&&t.push(`${f(e.triangles)} tris in ${String(e.meshes)} ${e.meshes===1?"mesh":"meshes"}`),e.materials.length>0&&t.push(e.materials.join(", ")),t.join(" | ")}export function cameraLine(e,t){const s=t.target===void 0?t.direction?`along ${l(t.direction)}`:`yaw ${String(t.yaw??0)}° pitch ${String(t.pitch??0)}°`:typeof t.target=="string"?`→ ${t.target}`:`→ ${l(t.target)}`,o=t.fov!==void 0?`fov ${String(t.fov)}°`:`${String(t.lens??F.lens)} mm`;return` ${e}: at ${l(t.position)} ${s}, ${o}`}export function inventoryText(e,t,s){const o=t.totals,n=t.objects.filter($=>$.name!=="").length,i=[`${e} at ${t.t.toFixed(2)} s. Y up, metres; a camera looks down −Z, a glTF model faces +Z. Positions and sizes in world space.`,`Drawn by ${t.renderer.gl||"an unknown renderer"}, three.js r${t.renderer.three} (${t.renderer.kind}).`,`${plural(o.objects,"object")} (${String(n)} named, ${String(t.unnamed)} unnamed), ${String(o.meshes)} meshes, ${f(o.triangles)} triangles, ${plural(o.drawCalls,"draw call")}, ${plural(o.textures,"texture")} (${k(o.textureBytes)} with mipmaps); a ${String(o.frameSize[0])} × ${String(o.frameSize[1])} frame drew in ${o.frameMs.toFixed(0)} ms${o.transmission?`, ${o.transmission.withoutMs.toFixed(0)} ms without its ${plural(o.transmission.objects.length,"transmissive object")} (${o.transmission.objects.join(", ")}), for which three.js draws the scene once more`:""}.`],r=Object.entries(t.repeated);r.length>0&&i.push(`Names given to more than one object (give each object a name of its own for a camera, move or measurement to use): ${r.map(([$,u])=>`${$} (${String(u)})`).join(", ")}.`),i.push("","Objects:");const a=s?t.objects:w(t.objects);for(const $ of a.slice(0,x))i.push(objectLine($));a.length>x&&i.push(`… ${String(a.length-x)} more, in --json.`);const h=s?0:t.objects.length-w(t.objects).length;h>0&&i.push(`(${plural(h,"object")} inside models and groups not listed: --nested lists them.)`),i.push("",t.lights.length>0?"Lights:":"Lights: none.");for(const $ of t.lights){const u=$.type==="DirectionalLight"?"lx":$.type==="PointLight"||$.type==="SpotLight"?"cd":"";i.push(` ${$.path} | ${$.type} | at ${l($.position)}${$.target?` → ${l($.target)}`:""} | ${$.color} ${String($.intensity)}${u?` ${u}`:""}${$.castShadow?` | shadows ${String($.shadowMap??"")}`:""}${$.angle!==void 0?` | cone ${String($.angle)}°`:""}${$.distance!==void 0?` | reach ${String($.distance)} m`:""}`)}const g=Object.entries(t.cameras);i.push("",g.length>0?"Cameras:":"Cameras: none named.");for(const[$,u]of g)i.push(cameraLine($,u));return i.push(t.moves.length>0?`Moves: ${t.moves.join(", ")}.`:"Moves: none named."),i.join(`
3
3
  `)}export function cameraText(e){const t=e.target?`→ ${e.targetName!==void 0?`${e.targetName} `:""}${l(e.target)}`:`along ${l(e.forward)}`;return`at ${l(e.position)} ${t}, yaw ${e.yaw.toFixed(1)}° pitch ${e.pitch.toFixed(1)}° roll ${e.roll.toFixed(1)}°, ${e.lens.toFixed(1)} mm (${e.fov.horizontal.toFixed(1)}° × ${e.fov.vertical.toFixed(1)}°, ${e.fov.diagonal.toFixed(1)}° diagonal), near ${String(e.near)} m`}export function viewText(e,t,s){const o=[`${e}: ${String(t.width)} × ${String(t.height)} px, ${plural(t.tiles.length,"picture")} in ${plural(t.columns,"column")}.`];return t.tiles.forEach((n,i)=>{if(o.push(`${String(i+1)}. ${n.label} at ${n.t.toFixed(2)} s: ${cameraText(n.camera)}.`),s){const r=(n.seen??[]).filter(h=>h.pixels>0);r.length===0&&o.push(" No named object in view.");for(const h of r)o.push(` ${h.path}: ${(h.share*100).toFixed(1)}% of the frame, ${(h.hidden*100).toFixed(1)}% of it hidden, its pixels centred at (${h.centroid?`${h.centroid[0].toFixed(0)}, ${h.centroid[1].toFixed(0)}`:"-"}) px`);const a=(n.seen??[]).filter(h=>h.pixels===0).map(h=>h.name);a.length>0&&o.push(` Not in view: ${a.join(", ")}.`)}}),o.join(`
4
4
  `)}const p=e=>`${(e*100).toFixed(1)}%`,d=e=>Math.abs(e)<.1?`${(e*1e3).toFixed(1)} mm`:`${e.toFixed(3)} m`;export function contactText(e){const t=`${e.a} and ${e.b}`;if(e.missing!==void 0)return`${t}: not measured: ${e.missing}`;if(!e.crossing&&!e.within)return e.area!==void 0?`${t}: touching, faces in one plane sharing ${e.area.toFixed(4)} m²`:e.gap!==void 0?`${t}: ${d(e.gap)} apart${e.touching?" (touching, within the tolerance)":""}`:`${t}: touching`;const s=[e.crossing&&e.curve?`crossing along ${d(e.curve.length)} (${String(e.curve.segments)} segments) between ${l(e.curve.min)} and ${l(e.curve.max)}`:`${e.within==="a in b"?e.a:e.b} is inside ${e.within==="a in b"?e.b:e.a}, their surfaces not crossing`],o=(n,i)=>n===void 0||n.includes("not a closed solid")?`${i} has no inside`:n;if(e.depth){const n=e.depth.aInB!==void 0?`${d(e.depth.aInB)} of ${e.a} is in ${e.b}`:void 0,i=e.depth.bInA!==void 0?`${d(e.depth.bInA)} of ${e.b} in ${e.a}`:void 0;(n||i)&&s.push(`at least ${[n,i].filter(Boolean).join(", ")} (the deepest of ${String(e.depth.samples)} surface samples and every vertex: a lower bound)`);const r=[n?"":o(e.depth.aInBMissing,e.b),i?"":o(e.depth.bInAMissing,e.a)].filter(Boolean);r.length>0&&s.push(`depth not measured: ${[...new Set(r)].join(", ")}`)}if(e.lift){const[n,i]=e.lift.b<e.lift.a?[[e.b,e.lift.b],[e.a,e.lift.a]]:[[e.a,e.lift.a],[e.b,e.lift.b]];s.push(`moving ${n[0]} ${d(n[1])} along ${l(e.lift.direction)} (or ${i[0]} ${d(i[1])}) clears them`)}return e.volume!==void 0?s.push(`they share ${e.volume.toExponential(3)} m³`):e.volumeMissing&&!e.volumeMissing.includes("not a closed solid")&&s.push(`shared volume not measured: ${e.volumeMissing}`),`${t}: ${s.join("; ")}`}export function supportText(e){if(e.columns===0)return`${e.path}: no column met its surface from above`;const t=e.columns+(e.feet??0),s=`${plural(t,"column")}: ${String(e.columns)} across its footprint, ${String(e.feet??0)} at its lowest points`;if(e.gap===null)return`${e.path}: nothing below it in ${s} (its lowest point y ${c(e.bottom)})`;const n=[`on ${e.on.map(i=>`${i.path} (${p(i.share)} of the columns, least gap ${d(i.gap)})`).join(", ")} (${s})`,e.gap<0?`sunk ${d(-e.gap)}`:`gap ${d(e.gap)}`,`${p(e.footprintShare)} of its footprint within the tolerance`];return e.angle!==void 0&&n.push(`its faces at up to ${e.angle.toFixed(2)}° to those below where they touch`),e.contactArea!==void 0&&n.push(`about ${e.contactArea.toFixed(3)} m² in contact`),e.margin!==void 0&&n.push(e.margin>=0?`its centre of mass ${d(e.margin)} inside the contact's hull`:`its centre of mass ${d(-e.margin)} outside the contact's hull`),e.nothingBelow>0&&n.push(`nothing below in ${plural(e.nothingBelow,"column")}`),`${e.path}: ${n.join("; ")}`}export function measureText(e,t,s){const o=[`${e} at ${t.t.toFixed(2)} s: ${plural(t.objects.length,"named object")} measured; touching within ${d(s.tolerance)}, pairs closer than ${d(s.near)}${s.all?" (every pair: --all)":""}.`,"","Surfaces (closed: no open or non-manifold edges; only a closed surface whose faces turn out has an inside):"];for(const n of t.health){const i=[n.openEdges?`${String(n.openEdges)} open edges`:"",n.nonManifoldEdges?`${String(n.nonManifoldEdges)} non-manifold edges`:"",n.degenerate?`${String(n.degenerate)} triangles without area`:"",n.selfIntersections===null?"self-intersections not counted (too many triangles)":n.selfIntersections>0?`${n.selfIntersectionsAtLeast?"at least ":""}${String(n.selfIntersections)} self-intersecting triangle pairs`:""].filter(Boolean);o.push(` ${n.path}: ${n.closed?(n.volume??0)<0?"closed, its faces turned in (it encloses space: not a solid)":"closed":"open"}, ${f(n.triangles)} triangles${i.length?`; ${i.join(", ")}`:""}`)}o.push("",t.contacts.length>0?"Pairs:":"Pairs: none touching, crossing or closer than the distance asked.");for(const n of t.contacts)o.push(` ${contactText(n)}`);o.push("","Support (columns down through each object's footprint):");for(const n of t.support)o.push(` ${supportText(n)}`);if(t.sight){const n=t.sight.blockedBy.map(i=>`${i.path} ${p(i.share)}`).join(", ");o.push("",`Line of sight ${t.sight.a} to ${t.sight.b}: ${p(t.sight.clear)} of ${String(t.sight.rays)} rays clear${n?`; stopped by ${n}`:""}.`)}if(t.clear){const n=t.clear;o.push("",n.least===void 0?`Ahead of ${n.path} (its +Z ${l(n.front)}): nothing within ${String(n.far)} m on any of ${String(n.rays)} rays.`:`Ahead of ${n.path} (its +Z ${l(n.front)}): clear for ${d(n.least)} at least, ${d(n.median??0)} on the median ray, ${d(n.most??0)} at most; ${String(n.open)} of ${String(n.rays)} rays meet nothing within ${String(n.far)} m.`)}if(t.floor){const n=t.floor,i=n.reach.map(r=>`${r.path} ${r.reached?"reached":"not reached"}`).join(", ");o.push("",`Floor ${n.floor} (cells of ${String(n.cell)} m; free a radius ${String(n.radius)} m from anything standing below ${String(n.height)} m): ${n.floorArea.toFixed(2)} m² of floor, ${n.freeArea.toFixed(2)} m² free, ${n.connected.toFixed(2)} m² connected${n.from?` to ${n.from}`:" (the largest free area)"}.${i?` ${i}.`:""}`)}return o.join(`
5
5
  `)}const m=(e,t)=>`${e.peak.toFixed(3)} ${t} at ${e.at.toFixed(2)} s (mean ${e.mean.toFixed(3)})`;export function motionText(e,t){const s=[`Motion of ${e} from ${t.from.toFixed(2)} to ${t.to.toFixed(2)} s, ${String(t.samples)} samples at ${String(t.fps)} a second, ${t.length.toFixed(3)} m travelled. Peaks in the camera's own frame:`,` truck ${m(t.truck,"m/s")}; pedestal ${m(t.pedestal,"m/s")}; dolly ${m(t.dolly,"m/s")}`,` pan ${m(t.pan,"°/s")}; tilt ${m(t.tilt,"°/s")}; roll ${m(t.roll,"°/s")}`,` zoom ${m(t.zoom,"stops/s")}${t.arc?`; arc about its target ${m(t.arc,"°/s")}`:""}`,` speed ${m(t.speed,"m/s")}; view turning ${m(t.turn,"°/s")}`,` acceleration ${m(t.acceleration,"m/s²")}; jerk ${m(t.jerk,"m/s³")}; smoothness (log dimensionless jerk) ${t.smoothness===null?"not measured: it does not move":t.smoothness.toFixed(3)}`,` largest step between samples ${d(t.step.distance)} and ${t.step.angle.toFixed(3)}° at ${t.step.at.toFixed(2)} s`];t.clearance&&s.push(` nearest surface over the move: ${t.clearance.path} ${d(t.clearance.distance)} at ${t.clearance.at.toFixed(2)} s (ten checks a second)`);for(const o of t.objects)s.push(` ${o.path} on the frame: up to ${o.screen.peak.toFixed(1)} px a sample at ${o.screen.at.toFixed(2)} s (mean ${o.screen.mean.toFixed(1)}); its size changing up to ${p(o.growth.peak)} a second; in view in ${p(o.inView)} of the samples`);return s.join(`
6
6
  `)}export function seeText(e){const t=[`Pictures of ${String(e.width)} × ${String(e.height)} px.`];return e.tiles.forEach((s,o)=>{t.push(`${String(o+1)}. ${s.label} at ${s.t.toFixed(2)} s: ${cameraText(s.camera)}.`);const n=s.objects.filter(a=>a.pixels>0);for(const a of n){const h=(a.by??[]).filter(g=>g.share>=.001).map(g=>`${g.path} ${p(g.share)}`).join(", ");t.push(` ${a.path}: ${p(a.share)} of the frame; ${p(a.hidden)} of it hidden${h?` (by ${h})`:""}; ${p(a.cut??0)} cut by the frame's edges; ${a.distance!==void 0?`${d(a.distance)} away`:"distance not measured"}; centred at (${a.centroid?`${a.centroid[0].toFixed(0)}, ${a.centroid[1].toFixed(0)}`:"-"}) px`)}const i=s.objects.filter(a=>a.pixels===0).map(a=>a.path);i.length>0&&t.push(` Not in view: ${i.join(", ")}.`);const r=s.clearance;if(t.push(` Camera: ${r.inside.length>0?`inside ${r.inside.map(a=>`${a.path}${a.closed?"":" (open: a vote, not a fact)"}`).join(", ")}`:"inside nothing"}; nearest surface ${r.nearest?`${r.nearest.path} ${d(r.nearest.distance)}`:"none"}; the near plane cuts ${r.nearCut.length>0?r.nearCut.join(", "):"nothing"}.`,` Picture: mean level ${s.levels.mean.toFixed(3)}; ${p(s.levels.black)} of pixels at 0 and ${p(s.levels.white)} at 255 on a channel.`),s.pick){const a=s.pick;t.push(a.path?` At (${String(a.x)}, ${String(a.y)}) px: ${a.path} at ${l(a.point??[0,0,0])}, ${d(a.distance??0)} from the camera.`:` At (${String(a.x)}, ${String(a.y)}) px: nothing.`)}}),t.join(`
7
7
  `)}export function cameraCode(e){const t=o=>String(o??0),s=typeof e.lensFrame=="string"?JSON.stringify(e.lensFrame):e.lensFrame?`{ aspect: ${String(e.lensFrame.aspect)}, keep: "${e.lensFrame.keep}" }`:void 0;return`{ position: [${e.position.map(String).join(", ")}], yaw: ${t(e.yaw)}, pitch: ${t(e.pitch)}, roll: ${t(e.roll)}, lens: ${t(e.lens)}${s?`, lensFrame: ${s}`:""} }`}export function solveText(e,t){if(!e.camera)return`No camera: ${e.missing??"nothing could be solved"}`;const s=y(e.camera.lens??b.lens,t.size[0]/t.size[1],e.camera.lensFrame??b.lensFrame);return[`Camera: ${cameraCode(e.camera)}`,` sees ${s.horizontal.toFixed(1)}° × ${s.vertical.toFixed(1)}° on ${String(t.size[0])} × ${String(t.size[1])} px; rms ${e.rms===void 0?"not measured":`${e.rms.toFixed(2)} px`} over ${plural(e.residuals.length,"correspondence")} (${plural(e.starts,"start")} tried)`,...e.residuals.map((n,i)=>` ${n.kind} ${n.name??String(i+1)}: measured ${n.px.map(r=>r.toFixed(1)).join(", ")}, ${Number.isFinite(n.distance)?`drawn ${n.drawn.map(r=>r.toFixed(1)).join(", ")}: ${n.distance.toFixed(2)} px off`:"behind the camera"}`),...e.undetermined.map(n=>` Not fixed: ${n}.`),...e.spread?[` 1 px of error in each mark moves it (one standard deviation): ${Object.entries(e.spread).map(([n,i])=>`${n} ±${String(i)}${n==="lens"?" mm":n==="x"||n==="y"||n==="z"?" m":"°"}`).join(", ")}`]:[],...t.png?[` Drawn with the points: ${t.png}`]:[]].join(`
8
8
  `)}export function bakeText(e,t,s,o){const n=t.lights.filter(a=>a.baked).length,i=t.lights.length-n,r=[`Baked ${e}: an atlas of ${String(t.size)} px (${String(t.density)} texels/m at weight 1), ${String(t.baked.length)} ${t.baked.length===1?"mesh":"meshes"} with a lightmap, ${String(t.left.length)} without; ${plural(n,"light")}${i>0?` (${String(i)} not baked)`:""}${t.sky.length>0?" and the sky":""}; ${t.seconds.total.toFixed(1)} s on ${t.gl||"the GPU"}.`,`Irradiance: median ${String(t.irradiance.median)}, 10% ${String(t.irradiance.p10)}, 90% ${String(t.irradiance.p90)}, largest ${String(t.irradiance.max)}; ${String(Math.round(t.covered*100))}% of the atlas covered.`,`Bake: ${s.bake} (${v(t.bytes)}), laid on the scenery each time it is built while the scene stays as baked.`,`Report (each mesh, what was left out and why, the lights, the sky): ${s.report}`];for(const a of t.lights){const h=a.around?.[0];h&&h.share>=.5&&r.push(`${a.name} is closed in by ${h.name}, which stops ${String(Math.round(h.share*100))}% of its rays within 0.5 m: bake.ignore it, or move the light out of it.`)}return o&&r.push(`The scenery's previous bake (${o}) was removed.`),r.join(`
9
- `)}const v=e=>`${(e/1024/1024).toFixed(1)} MB`;export function bakeLine(e,t,s,o){if(t.laid)return`Bake: laid${t.bakedOn===t.renderer?"":" (the CPU's: this renderer has none of its own)"}${o?`, an atlas of ${String(o.size)} px on ${String(o.meshes)} meshes${o.probe?", with its reflection probe":""}`:""}.`;const n=t.renderer==="cpu",i=`${n?"ALLYHUB_GPU=0 ":""}allyhub scenery bake ${e}`;return t.elsewhere?`Bake: none made on ${n?"the CPU":`this GPU (${s||t.renderer}) or the CPU`}, so it is drawn unbaked; the one made on ${t.elsewhere.join(", ")} is laid only there, since another renderer gathers light a little differently. ${i} makes one${n?", which every renderer lays":" here, or with ALLYHUB_GPU=0 one every renderer lays"}.`:t.stale!==void 0?`Bake: out of date (the scene changed since it was baked), so it is drawn unbaked; ${i} makes it again.`:`Bake: none; ${i} makes one.`}export const problemLines=e=>e.map(t=>`${j(t.kind)} ${t.level}: ${t.message}`);export function mapText(e,t,s,o){return[...e.views.map(n=>`${t(s[n.view]??"")}: ${n.view}, ${String(n.width)} × ${String(n.height)} px, ${n.scale.toFixed(1)} px per metre, covering ${l(n.bounds.min)} to ${l(n.bounds.max)} m.`),`${t(o)}: ${plural(e.footprints.length,"footprint")}, ${plural(e.paths.length,"path")}.`,"","Footprints (upright rectangle on the floor, its height, where it faces):",...e.footprints.map(n=>{const i=n.corners.map(a=>a[0]),r=n.corners.map(a=>a[1]);return` ${n.path}: x ${c(Math.min(...i))} to ${c(Math.max(...i))}, z ${c(Math.min(...r))} to ${c(Math.max(...r))}, y ${c(n.bottom)} to ${c(n.top)} m, faces yaw ${n.facing.toFixed(1)}°`}),...e.paths.map(n=>`Move ${n.name}: ${n.points.map(i=>`${i.t.toFixed(2)} s ${l(i.position)}`).join("; ")}`),...(e.left??[]).map(n=>`Move ${n.move} is not drawn: ${n.why}`)].join(`
9
+ `)}const v=e=>`${(e/1024/1024).toFixed(1)} MB`;export function bakeLine(e,t,s,o){if(t.laid)return`Bake: laid${t.bakedOn===t.renderer?"":" (the CPU's: this renderer has none of its own)"}${o?`, an atlas of ${String(o.size)} px on ${String(o.meshes)} meshes${o.probe?", with its reflection probe":""}`:""}.`;const n=t.renderer==="cpu",i=`${n?"ALLYHUB_GPU=0 ":""}allyhub scenery bake ${e}`;return t.elsewhere?`Bake: none made on ${n?"the CPU":`this GPU (${s||t.renderer}) or the CPU`}, so it is drawn unbaked; the one made on ${t.elsewhere.join(", ")} is laid there alone, matched to how that renderer gathers light. ${i} makes one${n?", which every renderer lays":" here, or with ALLYHUB_GPU=0 one every renderer lays"}.`:t.stale!==void 0?`Bake: out of date (the scene changed since it was baked), so it is drawn unbaked; ${i} makes it again.`:`Bake: none; ${i} makes one.`}export const problemLines=e=>e.map(t=>`${j(t.kind)} ${t.level}: ${t.message}`);export function mapText(e,t,s,o){return[...e.views.map(n=>`${t(s[n.view]??"")}: ${n.view}, ${String(n.width)} × ${String(n.height)} px, ${n.scale.toFixed(1)} px per metre, covering ${l(n.bounds.min)} to ${l(n.bounds.max)} m.`),`${t(o)}: ${plural(e.footprints.length,"footprint")}, ${plural(e.paths.length,"path")}.`,"","Footprints (upright rectangle on the floor, its height, where it faces):",...e.footprints.map(n=>{const i=n.corners.map(a=>a[0]),r=n.corners.map(a=>a[1]);return` ${n.path}: x ${c(Math.min(...i))} to ${c(Math.max(...i))}, z ${c(Math.min(...r))} to ${c(Math.max(...r))}, y ${c(n.bottom)} to ${c(n.top)} m, faces yaw ${n.facing.toFixed(1)}°`}),...e.paths.map(n=>`Move ${n.name}: ${n.points.map(i=>`${i.t.toFixed(2)} s ${l(i.position)}`).join("; ")}`),...(e.left??[]).map(n=>`Move ${n.move} is not drawn: ${n.why}`)].join(`
10
10
  `)}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/3d-extension",
3
- "version": "0.15.3",
3
+ "version": "0.16.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./tools": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/audio",
3
- "version": "0.15.3",
3
+ "version": "0.16.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/browser",
3
- "version": "0.15.3",
3
+ "version": "0.16.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -28,8 +28,8 @@ export declare function fileProblems(root: string, files: readonly string[], ite
28
28
  /**
29
29
  * What is wrong with the project's list where it names a file with no
30
30
  * kind, which only the file editors know (the build reads kinds only): one
31
- * no editor of `table` opens by its name, one not there, or one whose id
32
- * an item has too.
31
+ * no editor of `table` opens by its name, one not there, or one listed
32
+ * twice (its id, its path, twice).
33
33
  */
34
34
  export declare function listedFileProblems(root: string, files: readonly string[], kinds: KindTable, table: FileEditorTable): Promise<Problem[]>;
35
35
  //# sourceMappingURL=file-check.d.ts.map
@@ -1,5 +1,5 @@
1
1
  export { dependenciesOf, listFiles } from "./files.js";
2
- export { listWork, projectItems, readWork, unlistedWork } from "./work.js";
2
+ export { listWork, projectItems, readWork, unlistedWork, type UnlistedEntry, } from "./work.js";
3
3
  export { moveEdits, movedPath, referencesOf, referringFiles, } from "./move-refs.js";
4
4
  export { bundleForStage, compileErrorOf, createModuleLoader, createStageDevServer, loadUserVite, type CompileError, type Handler, type Inline, type ModuleLoader, type Plugin, type StageBundle, type StageChunk, type StageDevServer, type UserVite, } from "./vite.js";
5
5
  export { nodeStackPlace, placeFinder, type PlaceFinder, type PlaceOptions, type SourcePlace, } from "./places.js";
@@ -29,7 +29,7 @@ export declare const MOMENTS: {
29
29
  /** `--all`: every finding on its own line, and what the view's thresholds leave out. */
30
30
  export declare const allFindings: (what?: string) => z.ZodDefault<z.ZodBoolean>;
31
31
  /** What every view of facts says first. */
32
- export declare const FACTS_HEAD = "measurements for you to judge, not problems. Boxes are [x,y,w,h], in pixels (a deck's in points); --json has every one.";
32
+ export declare const FACTS_HEAD = "measurements for you to judge. Boxes are [x,y,w,h], in pixels (a deck's in points); --json has every one.";
33
33
  /** The fields that name a version, as a view's input reads them. */
34
34
  export interface VersionInput {
35
35
  item?: string | undefined;
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{z as e}from"zod";export const PROJECT_DIR=e.string().optional().describe("The project's folder; default the one around where it is run"),VERSION_FIELDS={item:e.string().optional().describe("The piece: its id (its file without its extension) or its file; default the project's only one"),combo:e.array(e.string()).optional().describe("The first combo matching name=value pairs joined with commas (lang=zh-cn,hook=b), or a combo's id (c03); default the first combo"),dir:PROJECT_DIR},STRETCH={part:e.string().optional().describe("Only this part"),from:e.number().min(0).optional().describe("From this second of the video"),to:e.number().min(0).optional().describe("Up to this second of the video")},MOMENTS={at:e.array(e.string()).optional().describe("At these moments: seconds (from --part's start when given) or anchors (@press, @/map, @press+0.2)"),every:e.number().positive().optional().describe("Every this many seconds through the stretch (--part, or --from to --to, else all of it)")},allFindings=o=>e.boolean().default(!1).describe(`Every finding on a line of its own${o===void 0?"":`, and ${o}`}`),FACTS_HEAD="measurements for you to judge, not problems. Boxes are [x,y,w,h], in pixels (a deck's in points); --json has every one.",defineView=o=>o;
2
+ import{z as e}from"zod";export const PROJECT_DIR=e.string().optional().describe("The project's folder; default the one around where it is run"),VERSION_FIELDS={item:e.string().optional().describe("The piece: its id (its file without its extension) or its file; default the project's only one"),combo:e.array(e.string()).optional().describe("The first combo matching name=value pairs joined with commas (lang=zh-cn,hook=b), or a combo's id (c03); default the first combo"),dir:PROJECT_DIR},STRETCH={part:e.string().optional().describe("Only this part"),from:e.number().min(0).optional().describe("From this second of the video"),to:e.number().min(0).optional().describe("Up to this second of the video")},MOMENTS={at:e.array(e.string()).optional().describe("At these moments: seconds (from --part's start when given) or anchors (@press, @/map, @press+0.2)"),every:e.number().positive().optional().describe("Every this many seconds through the stretch (--part, or --from to --to, else all of it)")},allFindings=o=>e.boolean().default(!1).describe(`Every finding on a line of its own${o===void 0?"":`, and ${o}`}`),FACTS_HEAD="measurements for you to judge. Boxes are [x,y,w,h], in pixels (a deck's in points); --json has every one.",defineView=o=>o;