allyhub 0.15.2 → 0.17.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 (467) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/commands/add.js +1 -1
  3. package/dist/commands/cloud-tools.js +1 -1
  4. package/dist/commands/dev.js +6 -2
  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/index.js +1 -1
  10. package/dist/commands/inspect/layout.js +1 -1
  11. package/dist/commands/inspect/uses.js +3 -0
  12. package/dist/commands/mail.js +6 -6
  13. package/dist/commands/render.js +1 -1
  14. package/dist/main.js +8 -8
  15. package/dist/node_modules/@allyhub/3d-extension/dist/cli/scenery-text.js +2 -2
  16. package/dist/node_modules/@allyhub/3d-extension/package.json +1 -1
  17. package/dist/node_modules/@allyhub/audio/dist/index.js +1 -1
  18. package/dist/node_modules/@allyhub/audio/dist/place.js +2 -0
  19. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  20. package/dist/node_modules/@allyhub/browser/package.json +1 -1
  21. package/dist/node_modules/@allyhub/build/dist/content.d.ts +7 -0
  22. package/dist/node_modules/@allyhub/build/dist/file-check.d.ts +2 -2
  23. package/dist/node_modules/@allyhub/build/dist/imports.d.ts +17 -0
  24. package/dist/node_modules/@allyhub/build/dist/imports.js +2 -0
  25. package/dist/node_modules/@allyhub/build/dist/index.d.ts +3 -2
  26. package/dist/node_modules/@allyhub/build/dist/index.js +1 -1
  27. package/dist/node_modules/@allyhub/build/dist/inspect-view.d.ts +1 -1
  28. package/dist/node_modules/@allyhub/build/dist/inspect-view.js +1 -1
  29. package/dist/node_modules/@allyhub/build/dist/kind-build.d.ts +19 -3
  30. package/dist/node_modules/@allyhub/build/dist/prepare.js +3 -3
  31. package/dist/node_modules/@allyhub/build/dist/uses.d.ts +27 -6
  32. package/dist/node_modules/@allyhub/build/dist/uses.js +1 -1
  33. package/dist/node_modules/@allyhub/build/dist/work.d.ts +9 -1
  34. package/dist/node_modules/@allyhub/build/dist/work.js +3 -3
  35. package/dist/node_modules/@allyhub/build/package.json +1 -1
  36. package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
  37. package/dist/node_modules/@allyhub/canvas-extension/skills/allyhub/references/canvas.md +2 -2
  38. package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
  39. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  40. package/dist/node_modules/@allyhub/check/package.json +1 -1
  41. package/dist/node_modules/@allyhub/cloud/dist/blobs.js +1 -1
  42. package/dist/node_modules/@allyhub/cloud/dist/client.d.ts +12 -3
  43. package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
  44. package/dist/node_modules/@allyhub/cloud/dist/index.d.ts +1 -1
  45. package/dist/node_modules/@allyhub/cloud/dist/index.js +1 -1
  46. package/dist/node_modules/@allyhub/cloud/package.json +1 -1
  47. package/dist/node_modules/@allyhub/components/package.json +1 -1
  48. package/dist/node_modules/@allyhub/dev-server/dist/deletion.js +2 -0
  49. package/dist/node_modules/@allyhub/dev-server/dist/index.js +1 -1
  50. package/dist/node_modules/@allyhub/dev-server/dist/inputs.js +1 -1
  51. package/dist/node_modules/@allyhub/dev-server/dist/live.js +1 -1
  52. package/dist/node_modules/@allyhub/dev-server/dist/project.js +1 -1
  53. package/dist/node_modules/@allyhub/dev-server/dist/record.js +1 -1
  54. package/dist/node_modules/@allyhub/dev-server/dist/writer.js +3 -2
  55. package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
  56. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  57. package/dist/node_modules/@allyhub/doc/dist/docx.js +4 -4
  58. package/dist/node_modules/@allyhub/doc/dist/html.js +40 -40
  59. package/dist/node_modules/@allyhub/doc/dist/index.js +1 -1
  60. package/dist/node_modules/@allyhub/doc/dist/markdown.js +1 -1
  61. package/dist/node_modules/@allyhub/doc/dist/parse.js +4 -4
  62. package/dist/node_modules/@allyhub/doc/dist/table.js +1 -1
  63. package/dist/node_modules/@allyhub/doc/dist/write.js +26 -26
  64. package/dist/node_modules/@allyhub/doc/package.json +1 -1
  65. package/dist/node_modules/@allyhub/doc-extension/dist/build.js +2 -2
  66. package/dist/node_modules/@allyhub/doc-extension/dist/inspect.js +1 -1
  67. package/dist/node_modules/@allyhub/doc-extension/package.json +1 -1
  68. package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
  69. package/dist/node_modules/@allyhub/export/dist/export.js +1 -1
  70. package/dist/node_modules/@allyhub/export/package.json +1 -1
  71. package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
  72. package/dist/node_modules/@allyhub/extension-host/dist/points.js +1 -1
  73. package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
  74. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +15 -3
  75. package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
  76. package/dist/node_modules/@allyhub/formats/dist/data/website.js +1 -1
  77. package/dist/node_modules/@allyhub/formats/dist/items.d.ts +70 -11
  78. package/dist/node_modules/@allyhub/formats/dist/items.js +1 -1
  79. package/dist/node_modules/@allyhub/formats/dist/layout.d.ts +15 -4
  80. package/dist/node_modules/@allyhub/formats/dist/layout.js +1 -1
  81. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +4 -0
  82. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  83. package/dist/node_modules/@allyhub/i18n/dist/index.js +1 -1
  84. package/dist/node_modules/@allyhub/i18n/package.json +1 -1
  85. package/dist/node_modules/@allyhub/image-draw/dist/stage.js +1 -1
  86. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  87. package/dist/node_modules/@allyhub/image-extension/dist/tools.js +1 -1
  88. package/dist/node_modules/@allyhub/image-extension/dist/workspace.js +1 -1
  89. package/dist/node_modules/@allyhub/image-extension/package.json +2 -2
  90. package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +3 -3
  91. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  92. package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
  93. package/dist/node_modules/@allyhub/image-render/package.json +1 -1
  94. package/dist/node_modules/@allyhub/image-runtime/dist/load.js +2 -2
  95. package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
  96. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  97. package/dist/node_modules/@allyhub/jobs/package.json +1 -1
  98. package/dist/node_modules/@allyhub/linkedin-extension/package.json +3 -1
  99. package/dist/node_modules/@allyhub/linkedin-extension/skills/allyhub/references/linkedin.md +1 -1
  100. package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
  101. package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
  102. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  103. package/dist/node_modules/@allyhub/media/package.json +1 -1
  104. package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
  105. package/dist/node_modules/@allyhub/model/package.json +1 -1
  106. package/dist/node_modules/@allyhub/office-extension/LICENSE +241 -0
  107. package/dist/node_modules/@allyhub/office-extension/markup/csv/allyhub.yaml +2 -0
  108. package/dist/node_modules/@allyhub/office-extension/markup/csv/data/leads.csv +5 -0
  109. package/dist/node_modules/@allyhub/office-extension/markup/csv/markup.json +19 -0
  110. package/dist/node_modules/@allyhub/office-extension/markup/document/allyhub.yaml +2 -0
  111. package/dist/node_modules/@allyhub/office-extension/markup/document/briefs/launch.docx +0 -0
  112. package/dist/node_modules/@allyhub/office-extension/markup/document/markup.json +11 -0
  113. package/dist/node_modules/@allyhub/office-extension/markup/presentation/allyhub.yaml +2 -0
  114. package/dist/node_modules/@allyhub/office-extension/markup/presentation/decks/pitch.pptx +0 -0
  115. package/dist/node_modules/@allyhub/office-extension/markup/presentation/markup.json +11 -0
  116. package/dist/node_modules/@allyhub/office-extension/markup/workbook/allyhub.yaml +2 -0
  117. package/dist/node_modules/@allyhub/office-extension/markup/workbook/data/plans.xlsx +0 -0
  118. package/dist/node_modules/@allyhub/office-extension/markup/workbook/markup.json +10 -0
  119. package/dist/node_modules/@allyhub/office-extension/package.json +124 -0
  120. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  121. package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +15 -0
  122. package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +1 -0
  123. package/dist/node_modules/@allyhub/piece/dist/page/index.js +1 -1
  124. package/dist/node_modules/@allyhub/piece/dist/page/runtimes.d.ts +9 -0
  125. package/dist/node_modules/@allyhub/piece/dist/page/runtimes.js +2 -0
  126. package/dist/node_modules/@allyhub/piece/dist/source.d.ts +53 -10
  127. package/dist/node_modules/@allyhub/piece/dist/source.js +1 -1
  128. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  129. package/dist/node_modules/@allyhub/project/dist/digest.js +1 -1
  130. package/dist/node_modules/@allyhub/project/dist/part-keys.js +1 -1
  131. package/dist/node_modules/@allyhub/project/package.json +1 -1
  132. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +10 -11
  133. package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
  134. package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +7 -0
  135. package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
  136. package/dist/node_modules/@allyhub/protocol/dist/blobs.d.ts +9 -0
  137. package/dist/node_modules/@allyhub/protocol/dist/blobs.js +1 -1
  138. package/dist/node_modules/@allyhub/protocol/dist/cli.d.ts +2 -0
  139. package/dist/node_modules/@allyhub/protocol/dist/cli.js +1 -1
  140. package/dist/node_modules/@allyhub/protocol/dist/cloud-computer.d.ts +77 -0
  141. package/dist/node_modules/@allyhub/protocol/dist/cloud-computer.js +2 -0
  142. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +39 -9
  143. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  144. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +15 -15
  145. package/dist/node_modules/@allyhub/protocol/dist/events.d.ts +441 -5
  146. package/dist/node_modules/@allyhub/protocol/dist/events.js +1 -1
  147. package/dist/node_modules/@allyhub/protocol/dist/files.d.ts +2 -2
  148. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +4 -1
  149. package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
  150. package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +8 -0
  151. package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
  152. package/dist/node_modules/@allyhub/protocol/dist/jobs.d.ts +5 -5
  153. package/dist/node_modules/@allyhub/protocol/dist/kinds.d.ts +45 -0
  154. package/dist/node_modules/@allyhub/protocol/dist/kinds.js +1 -1
  155. package/dist/node_modules/@allyhub/protocol/dist/paywall.d.ts +134 -0
  156. package/dist/node_modules/@allyhub/protocol/dist/paywall.js +2 -0
  157. package/dist/node_modules/@allyhub/protocol/dist/place.js +1 -1
  158. package/dist/node_modules/@allyhub/protocol/dist/presence.d.ts +3 -3
  159. package/dist/node_modules/@allyhub/protocol/dist/purposes.d.ts +47 -0
  160. package/dist/node_modules/@allyhub/protocol/dist/purposes.js +2 -0
  161. package/dist/node_modules/@allyhub/protocol/dist/routes.js +1 -1
  162. package/dist/node_modules/@allyhub/protocol/dist/shares.d.ts +52 -5
  163. package/dist/node_modules/@allyhub/protocol/dist/shares.js +1 -1
  164. package/dist/node_modules/@allyhub/protocol/dist/sidebar-deletion.d.ts +34 -0
  165. package/dist/node_modules/@allyhub/protocol/dist/sidebar-deletion.js +2 -0
  166. package/dist/node_modules/@allyhub/protocol/dist/sites.d.ts +1 -0
  167. package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +21 -52
  168. package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
  169. package/dist/node_modules/@allyhub/protocol/dist/studio-server.d.ts +264 -0
  170. package/dist/node_modules/@allyhub/protocol/dist/studio-server.js +2 -0
  171. package/dist/node_modules/@allyhub/protocol/dist/studio-tool-calls.d.ts +18 -0
  172. package/dist/node_modules/@allyhub/protocol/dist/studio-tool-calls.js +2 -0
  173. package/dist/node_modules/@allyhub/protocol/dist/studio-window-requests.d.ts +97 -0
  174. package/dist/node_modules/@allyhub/protocol/dist/studio-window-requests.js +2 -0
  175. package/dist/node_modules/@allyhub/protocol/dist/teams.d.ts +3 -2
  176. package/dist/node_modules/@allyhub/protocol/dist/teams.js +1 -1
  177. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +26 -20
  178. package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
  179. package/dist/node_modules/@allyhub/protocol/dist/turns.d.ts +71 -0
  180. package/dist/node_modules/@allyhub/protocol/dist/turns.js +2 -0
  181. package/dist/node_modules/@allyhub/protocol/package.json +1 -1
  182. package/dist/node_modules/@allyhub/registry/package.json +1 -1
  183. package/dist/node_modules/@allyhub/render/package.json +1 -1
  184. package/dist/node_modules/@allyhub/runtime/dist/compose.js +1 -1
  185. package/dist/node_modules/@allyhub/runtime/dist/embed.js +1 -1
  186. package/dist/node_modules/@allyhub/runtime/dist/film.js +1 -1
  187. package/dist/node_modules/@allyhub/runtime/dist/piece.js +2 -2
  188. package/dist/node_modules/@allyhub/runtime/dist/player/player.js +1 -1
  189. package/dist/node_modules/@allyhub/runtime/package.json +1 -1
  190. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  191. package/dist/node_modules/@allyhub/scaffold/dist/index.js +4 -4
  192. package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
  193. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  194. package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
  195. package/dist/node_modules/@allyhub/sheet/dist/calc/coerce.js +1 -1
  196. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
  197. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.js +1 -1
  198. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/date.js +1 -1
  199. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/dynamic.js +1 -1
  200. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/info.js +1 -1
  201. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/logical.js +1 -1
  202. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/lookup.js +1 -1
  203. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
  204. package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
  205. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  206. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
  207. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
  208. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  209. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  210. package/dist/node_modules/@allyhub/sheet-extension/dist/build.js +1 -1
  211. package/dist/node_modules/@allyhub/sheet-extension/dist/cli/sheet.js +1 -1
  212. package/dist/node_modules/@allyhub/sheet-extension/package.json +3 -3
  213. package/dist/node_modules/@allyhub/slides-core/dist/animation.js +1 -1
  214. package/dist/node_modules/@allyhub/slides-core/dist/api.js +1 -1
  215. package/dist/node_modules/@allyhub/slides-core/dist/components.js +1 -1
  216. package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
  217. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  218. package/dist/node_modules/@allyhub/slides-extension/dist/build.js +2 -1
  219. package/dist/node_modules/@allyhub/slides-extension/dist/cli/slides.js +2 -2
  220. package/dist/node_modules/@allyhub/slides-extension/dist/deck-pptx.js +1 -1
  221. package/dist/node_modules/@allyhub/slides-extension/dist/evaluate.js +2 -2
  222. package/dist/node_modules/@allyhub/slides-extension/dist/export.js +1 -1
  223. package/dist/node_modules/@allyhub/slides-extension/package.json +2 -2
  224. package/dist/node_modules/@allyhub/slides-pptx/dist/audio-icon.js +1 -1
  225. package/dist/node_modules/@allyhub/slides-pptx/dist/write.js +2 -2
  226. package/dist/node_modules/@allyhub/slides-pptx/package.json +5 -1
  227. package/dist/node_modules/@allyhub/slides-runtime/dist/component.js +1 -1
  228. package/dist/node_modules/@allyhub/slides-runtime/dist/draw.js +2 -2
  229. package/dist/node_modules/@allyhub/slides-runtime/dist/item.js +2 -0
  230. package/dist/node_modules/@allyhub/slides-runtime/dist/load.js +5 -5
  231. package/dist/node_modules/@allyhub/slides-runtime/dist/slide-css.js +20 -0
  232. package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
  233. package/dist/node_modules/@allyhub/stage/package.json +1 -1
  234. package/dist/node_modules/@allyhub/stage-page/dist/install.js +1 -1
  235. package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.html +1 -1
  236. package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.js +2 -2
  237. package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
  238. package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +20 -20
  239. package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
  240. package/dist/node_modules/@allyhub/telemetry/dist/doc.js +17 -2
  241. package/dist/node_modules/@allyhub/telemetry/dist/level.js +2 -2
  242. package/dist/node_modules/@allyhub/telemetry/dist/levels.js +2 -0
  243. package/dist/node_modules/@allyhub/telemetry/dist/scrub.js +1 -1
  244. package/dist/node_modules/@allyhub/telemetry/package.json +5 -1
  245. package/dist/node_modules/@allyhub/text-extension/markup/markup.json +1 -1
  246. package/dist/node_modules/@allyhub/text-extension/markup-file/allyhub.yaml +2 -0
  247. package/dist/node_modules/@allyhub/text-extension/markup-file/archive/assets.zip +0 -0
  248. package/dist/node_modules/@allyhub/text-extension/markup-file/markup.json +10 -0
  249. package/dist/node_modules/@allyhub/text-extension/package.json +35 -1
  250. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  251. package/dist/node_modules/@allyhub/video-extension/dist/build.js +1 -1
  252. package/dist/node_modules/@allyhub/video-extension/dist/cli/reference-text.js +3 -3
  253. package/dist/node_modules/@allyhub/video-extension/package.json +2 -2
  254. package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
  255. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  256. package/dist/node_modules/@allyhub/website/package.json +1 -1
  257. package/dist/node_modules/@allyhub/website-extension/package.json +1 -1
  258. package/dist/node_modules/@allyhub/x-extension/package.json +3 -1
  259. package/dist/node_modules/@allyhub/x-extension/skills/allyhub/references/x.md +1 -1
  260. package/dist/node_modules/@allyhub/x-model/package.json +1 -1
  261. package/dist/node_modules/@allyhub/x-view/package.json +1 -1
  262. package/dist/package.json +13 -12
  263. package/dist/project.js +1 -1
  264. package/dist/telemetry.js +3 -3
  265. package/dist/text/console-text.js +2 -2
  266. package/dist/works.js +1 -1
  267. package/editor-web/assets/{abnfDiagram-WEYOIA3C-9z0ZEYUq.js → abnfDiagram-WEYOIA3C-CHNpVSPv.js} +1 -1
  268. package/editor-web/assets/{architecture-WOLXFQ4H-ELMO_PA6.js → architecture-WOLXFQ4H-gPsJqQwV.js} +1 -1
  269. package/editor-web/assets/{architectureDiagram-ZHVYKT53-C0yuCWU3.js → architectureDiagram-ZHVYKT53-CEIDcC6r.js} +1 -1
  270. package/editor-web/assets/arrow-down-B8VUPCGi.js +1 -0
  271. package/editor-web/assets/arrow-up-Ds4juY8X.js +1 -0
  272. package/editor-web/assets/article-BHTjq0_Y.js +3 -0
  273. package/editor-web/assets/article-DfELjJ2o.js +7 -0
  274. package/editor-web/assets/{audio-lines-1s1eRs4Q.js → audio-lines-PZj77e7t.js} +1 -1
  275. package/editor-web/assets/bar-button-J9vbfzTx.js +1 -0
  276. package/editor-web/assets/{blockDiagram-RJAE7QA3-vi6JOg4o.js → blockDiagram-RJAE7QA3-CUzEGVet.js} +4 -4
  277. package/editor-web/assets/browser-C1XuTMlp.js +1 -0
  278. package/editor-web/assets/{c4Diagram-XDPPPE54-Agf_H8uS.js → c4Diagram-XDPPPE54-CB94NR9s.js} +1 -1
  279. package/editor-web/assets/calc-worker-BdHh5LXM.js +45 -0
  280. package/editor-web/assets/channel-DCDCx5Es.js +1 -0
  281. package/editor-web/assets/chart-amT4lgX3.js +2 -0
  282. package/editor-web/assets/chart-file-CfbWK9l1.js +1 -0
  283. package/editor-web/assets/{chart-no-axes-column-CJmeYOSo.js → chart-no-axes-column-Be0lFcGF.js} +1 -1
  284. package/editor-web/assets/{chunk-2E7WHVMD-XalaZaha.js → chunk-2E7WHVMD-DFYo_Boi.js} +1 -1
  285. package/editor-web/assets/{chunk-4EMNKR2T-DUlRZkCS.js → chunk-4EMNKR2T-CLLjmweX.js} +1 -1
  286. package/editor-web/assets/{chunk-55XCU76K-DTa7whGr.js → chunk-55XCU76K-CkwQ_3m1.js} +1 -1
  287. package/editor-web/assets/{chunk-7S6XSTFO-85zCPzj0.js → chunk-7S6XSTFO-V-AvHpAB.js} +1 -1
  288. package/editor-web/assets/{chunk-AQDTSKZB-CWBseIyh.js → chunk-AQDTSKZB-PjHyYpb8.js} +1 -1
  289. package/editor-web/assets/chunk-DSNLSHJZ-QaczBS3J.js +127 -0
  290. package/editor-web/assets/{chunk-HAGFOTED-DFWda2Rk.js → chunk-HAGFOTED-aLaQB5Xu.js} +1 -1
  291. package/editor-web/assets/{chunk-HNE4Q36P-aXibFitC.js → chunk-HNE4Q36P-De3ftDQR.js} +1 -1
  292. package/editor-web/assets/{chunk-NQOKRVIF-CtJUuFdN.js → chunk-NQOKRVIF-CrhVQyvP.js} +17 -17
  293. package/editor-web/assets/{chunk-UHW7PFBP-B6QKSKWE.js → chunk-UHW7PFBP-BFmZ5ZLn.js} +1 -1
  294. package/editor-web/assets/{chunk-VQ5W62QI-CF6Al55P.js → chunk-VQ5W62QI-CzppUHLA.js} +1 -1
  295. package/editor-web/assets/{chunk-WQQL4CDK-w2TKLkyw.js → chunk-WQQL4CDK-BrAU7V6v.js} +1 -1
  296. package/editor-web/assets/{chunk-YZO67HFG-DVGOATM3.js → chunk-YZO67HFG-BSiF71qj.js} +1 -1
  297. package/editor-web/assets/{chunk-ZAUX2LTX-Cq7MMjDP.js → chunk-ZAUX2LTX-BJc4r5b1.js} +1 -1
  298. package/editor-web/assets/{chunk-ZCHMQSOR-GMW_lBh4.js → chunk-ZCHMQSOR-CkGTuehB.js} +1 -1
  299. package/editor-web/assets/{classDiagram-v2-4MYWR3UA-C7AK5Bkj.js → classDiagram-v2-4MYWR3UA-Byxc7J88.js} +7 -7
  300. package/editor-web/assets/code-CD-CbJG9.js +1 -0
  301. package/editor-web/assets/collaborator-BU4qU7O3.js +1 -0
  302. package/editor-web/assets/{copy-DvOiv9Ra.js → copy-CuJSs0nI.js} +1 -1
  303. package/editor-web/assets/{createLucideIcon-REX213UO.js → createLucideIcon-lm_6n8YT.js} +1 -1
  304. package/editor-web/assets/csv-Bwre9FdI.js +11 -0
  305. package/editor-web/assets/{cynefin-EF2NZ3EQ-ZnDieQsN.js → cynefin-EF2NZ3EQ-BSxkVbdf.js} +1 -1
  306. package/editor-web/assets/{cynefinDiagram-WF24UDRP-BrukKIBF.js → cynefinDiagram-WF24UDRP-IkCgARNs.js} +1 -1
  307. package/editor-web/assets/{dagre-NK4GIZVX-DfO0S2p_.js → dagre-NK4GIZVX-9PgeH6nY.js} +1 -1
  308. package/editor-web/assets/deck-tTzKONci.js +1 -0
  309. package/editor-web/assets/{diagram-CBK3MWTC-D43RLesi.js → diagram-CBK3MWTC-DRzeg3Ds.js} +1 -1
  310. package/editor-web/assets/{diagram-I5XIIV2D-bA1B1QQG.js → diagram-I5XIIV2D-B_zeKMN6.js} +1 -1
  311. package/editor-web/assets/{diagram-ODIL2UCW-DAdXBD2K.js → diagram-ODIL2UCW-FFm0O8SN.js} +1 -1
  312. package/editor-web/assets/{diagram-PFBEJUXE-C_KyEaws.js → diagram-PFBEJUXE-DrtCT8OA.js} +1 -1
  313. package/editor-web/assets/{diagram-RJA3I4VV-oXTtENF7.js → diagram-RJA3I4VV-DtxJ3V0q.js} +1 -1
  314. package/editor-web/assets/{diagram-TYUNFSNR-Czupe6mO.js → diagram-TYUNFSNR-DmxF_8H_.js} +16 -16
  315. package/editor-web/assets/dist-BEpzsYn_.js +6 -0
  316. package/editor-web/assets/dist-BUD4ywMB.js +18 -0
  317. package/editor-web/assets/{dist-BrGYx10E.js → dist-Bd8IxQPP.js} +1 -1
  318. package/editor-web/assets/dist-C21CkR7Z.js +531 -0
  319. package/editor-web/assets/dist-C56mWAec.js +5 -0
  320. package/editor-web/assets/dist-CAb3W9_P.js +43 -0
  321. package/editor-web/assets/dist-CEknsRDd.js +24 -0
  322. package/editor-web/assets/dist-CbZAznNW.js +19 -0
  323. package/editor-web/assets/{dist-2lNSE-G_.js → dist-D3C6FyrO.js} +1 -1
  324. package/editor-web/assets/dist-DDzjbKIg.js +4 -0
  325. package/editor-web/assets/dist-DaEbElXI.js +3 -0
  326. package/editor-web/assets/dist-Dr3o4vee.js +1 -0
  327. package/editor-web/assets/{dist-BtRMClDw.js → dist-DruvDNQe.js} +1 -1
  328. package/editor-web/assets/dist-JLyDtl9X.js +1 -0
  329. package/editor-web/assets/dist-PBbWAsrV.js +17 -0
  330. package/editor-web/assets/dist-ZZlQa66J.js +1 -0
  331. package/editor-web/assets/dist-bQKpw3Zz.js +16 -0
  332. package/editor-web/assets/dist-d4dayaWE.js +17 -0
  333. package/editor-web/assets/docx-draw-9Q_fArBC.js +4 -0
  334. package/editor-web/assets/docx-preview-pcg9ioe3.js +21 -0
  335. package/editor-web/assets/{ebnfDiagram-V4P3TTPT-BOhNZmtp.js → ebnfDiagram-V4P3TTPT-DSX1Aoty.js} +1 -1
  336. package/editor-web/assets/{elk-QONTBCTQ-DoZH3OoE.js → elk-QONTBCTQ-C7gy9q56.js} +1 -1
  337. package/editor-web/assets/{erDiagram-KYQIGQAA-Bv0KDJi4.js → erDiagram-KYQIGQAA-CKx_HoY4.js} +2 -2
  338. package/editor-web/assets/esm-BZb5QMQf.js +21 -0
  339. package/editor-web/assets/{eventmodeling-K75KTNOO-C-_xzqfj.js → eventmodeling-K75KTNOO-DL4HvSrd.js} +1 -1
  340. package/editor-web/assets/{file-exclamation-point-C_fX4fpI.js → file-exclamation-point-_L3ElCJ5.js} +1 -1
  341. package/editor-web/assets/file-question-mark-DlIjUK37.js +1 -0
  342. package/editor-web/assets/flowDiagram-IUGLLWBU-BUnRtJ8q.js +1 -0
  343. package/editor-web/assets/{ganttDiagram-R7GPNTJY-CAuJlaZX.js → ganttDiagram-R7GPNTJY-N-AP4slN.js} +1 -1
  344. package/editor-web/assets/{gitGraph-VSP46ZUC-Dx2xLi5C.js → gitGraph-VSP46ZUC-BKRGJKWm.js} +1 -1
  345. package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-DHsk_UOT.js → gitGraphDiagram-PDYL7XHY-ClwL7w2_.js} +1 -1
  346. package/editor-web/assets/{group-pebHQTdP.js → group-BdrTp7gi.js} +1 -1
  347. package/editor-web/assets/hint-rlht0uxG.js +1 -0
  348. package/editor-web/assets/index-BedbINE5.css +2 -0
  349. package/editor-web/assets/index-DG2nHq4D.js +28 -0
  350. package/editor-web/assets/{info-OHQRW6UA-CnKQHx5m.js → info-OHQRW6UA-DpcY8t23.js} +1 -1
  351. package/editor-web/assets/{infoDiagram-MVDRKAX5-ibAVFw_2.js → infoDiagram-MVDRKAX5-ChtmtWni.js} +1 -1
  352. package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-C1OCHt3y.js → ishikawaDiagram-HPEHV2GE-BZNTuG_F.js} +1 -1
  353. package/editor-web/assets/iso-ahTwmFwH.js +56 -0
  354. package/editor-web/assets/{italic-CtlNOXN9.js → italic-zw4_eUNF.js} +1 -1
  355. package/editor-web/assets/{journeyDiagram-BOSHW7O7-BDdqMOM1.js → journeyDiagram-BOSHW7O7-C3uVmZbL.js} +1 -1
  356. package/editor-web/assets/{kanban-definition-FNSA4HC5-CSAS_zGn.js → kanban-definition-FNSA4HC5-puEhftGG.js} +4 -4
  357. package/editor-web/assets/{link-CW2KxKT_.js → link-DopSU3aa.js} +1 -1
  358. package/editor-web/assets/{mermaid-parser.core-DTLyYXbn.js → mermaid-parser.core-Bw8re-WE.js} +3 -3
  359. package/editor-web/assets/mermaid.core-Cc2GIqBr.js +44 -0
  360. package/editor-web/assets/{mindmap-definition-6OY57UG3-DSWHcglH.js → mindmap-definition-6OY57UG3-C6MUl_S_.js} +3 -3
  361. package/editor-web/assets/minus-CbPnUIOy.js +1 -0
  362. package/editor-web/assets/{packet-JDAUHWVQ-_k1BF29s.js → packet-JDAUHWVQ-C75RnvC5.js} +1 -1
  363. package/editor-web/assets/{pegDiagram-ECIUJNBX-B22YyWAa.js → pegDiagram-ECIUJNBX-ChjmsdV4.js} +1 -1
  364. package/editor-web/assets/{pie-XZMESJXO-CSwV32hj.js → pie-XZMESJXO-BaKxJQpj.js} +1 -1
  365. package/editor-web/assets/{pieDiagram-GNMPY74T-rSFNeWnq.js → pieDiagram-GNMPY74T-CT2ez8pr.js} +1 -1
  366. package/editor-web/assets/progress-CwKcXARv.js +6 -0
  367. package/editor-web/assets/props-form-D5oKHfpk.js +1 -0
  368. package/editor-web/assets/purify.es-B9ve_eFf.js +3 -0
  369. package/editor-web/assets/{quadrantDiagram-D57K4MC3-Xrntfg4j.js → quadrantDiagram-D57K4MC3-BJItlTfk.js} +1 -1
  370. package/editor-web/assets/{radar-ABXABTNO-Dwq5qiNw.js → radar-ABXABTNO-DnLzBlTo.js} +1 -1
  371. package/editor-web/assets/{railroad-I3PHUGI6-sIUGWcZh.js → railroad-I3PHUGI6-D5hj6Yv3.js} +1 -1
  372. package/editor-web/assets/{railroad-abnf-LNEFI6M7-1rWlT9BX.js → railroad-abnf-LNEFI6M7-DUZlZoPu.js} +1 -1
  373. package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-DWdkzEHc.js → railroad-ebnf-DWYD2UWJ-CDyyDC6d.js} +1 -1
  374. package/editor-web/assets/{railroad-peg-JR7BVNR7-CME0JBbV.js → railroad-peg-JR7BVNR7-CC3ImNnT.js} +1 -1
  375. package/editor-web/assets/{railroadDiagram-Y72NRBL7-Ch4BpP22.js → railroadDiagram-Y72NRBL7-Bjw-8Se5.js} +1 -1
  376. package/editor-web/assets/{react-Bk7NnOLX.js → react-Edyoga_4.js} +1 -1
  377. package/editor-web/assets/{requirementDiagram-EQYSW5RA-CgE-x3wN.js → requirementDiagram-EQYSW5RA-CDFnuEIO.js} +1 -1
  378. package/editor-web/assets/row-C_svyL8o.js +1 -0
  379. package/editor-web/assets/{sankeyDiagram-SY24JHO5-DBf4G6n3.js → sankeyDiagram-SY24JHO5-CQPVLY1w.js} +1 -1
  380. package/editor-web/assets/schemas-moE_A7Nj.js +1 -0
  381. package/editor-web/assets/{scissors-BURkYWPv.js → scissors-B_xOiUhd.js} +1 -1
  382. package/editor-web/assets/{search-jKDvFIEU.js → search-Ba2BbT6T.js} +1 -1
  383. package/editor-web/assets/{sequenceDiagram-BLEHNHQU-Bz07CoUS.js → sequenceDiagram-BLEHNHQU-BQzuLmBX.js} +1 -1
  384. package/editor-web/assets/{session-CUCSWPTE.js → session-s1I85rox.js} +1 -1
  385. package/editor-web/assets/{sigma-CY2Chbro.js → sigma-DSUsJhMn.js} +1 -1
  386. package/editor-web/assets/slides-oQ_C0SVJ.js +1 -0
  387. package/editor-web/assets/snapshots-BPJKywuN.js +1 -0
  388. package/editor-web/assets/{sound-DUCxe9eC.js → sound-bTlco_K3.js} +1 -1
  389. package/editor-web/assets/split-7CVjIkSU.js +3 -0
  390. package/editor-web/assets/square-arrow-out-up-right-DF5dvsSp.js +1 -0
  391. package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-DuqAmDPP.js → stateDiagram-v2-A6IESKWZ-DOuageUf.js} +7 -7
  392. package/editor-web/assets/{sticky-note-C5qUDHhC.js → sticky-note-BdkIu5_D.js} +1 -1
  393. package/editor-web/assets/{strikethrough-DP-7tMz0.js → strikethrough-BwXWi4zg.js} +1 -1
  394. package/editor-web/assets/surface-DtCjIlrq.js +1 -0
  395. package/editor-web/assets/svg-CWIBMIQ9.js +1 -0
  396. package/editor-web/assets/swatch-DhztHwPU.js +1 -0
  397. package/editor-web/assets/{swimlanes-B3ENRKFQ-C7sOL6rB.js → swimlanes-B3ENRKFQ-CXKkok7X.js} +1 -1
  398. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-C3Car2M0.js +8 -0
  399. package/editor-web/assets/switch-8MU4Nfxe.js +1 -0
  400. package/editor-web/assets/{syntax-DSsHrzWF.js → syntax-CU_WPKxt.js} +1 -1
  401. package/editor-web/assets/{table-CTjNpE4W.js → table-DRbddzx0.js} +1 -1
  402. package/editor-web/assets/tabs-CiF1N-pL.js +1 -0
  403. package/editor-web/assets/tag-CIfWT8B_.js +1 -0
  404. package/editor-web/assets/text-align-start-Cic2-TLh.js +1 -0
  405. package/editor-web/assets/textarea-D7TnPwv1.js +1 -0
  406. package/editor-web/assets/{timeline-definition-JXYKGLGB-CaLYz9mc.js → timeline-definition-JXYKGLGB-DgAjAeZp.js} +3 -3
  407. package/editor-web/assets/{treeView-D4JQ5SDB-D1P1Kyxc.js → treeView-D4JQ5SDB-C0Xvnhck.js} +1 -1
  408. package/editor-web/assets/{treemap-SAJKECNS-2YaFL53t.js → treemap-SAJKECNS-aXfKAeSX.js} +1 -1
  409. package/editor-web/assets/{undo-2-DUGGyBdX.js → undo-2-C47jrRp5.js} +1 -1
  410. package/editor-web/assets/{usecaseDiagram-WPOLBNNX-uYdbUhUS.js → usecaseDiagram-WPOLBNNX-CvUlBa-L.js} +1 -1
  411. package/editor-web/assets/{vennDiagram-Q3Y3IDCW-DHepmX4t.js → vennDiagram-Q3Y3IDCW-qMJ1iCxs.js} +3 -3
  412. package/editor-web/assets/{video-Xl-OaXRc.js → video-DQrjo1TI.js} +1 -1
  413. package/editor-web/assets/{wardley-7MLQ67FV-Dx0MOPV1.js → wardley-7MLQ67FV-DEdnH0by.js} +1 -1
  414. package/editor-web/assets/{wardleyDiagram-IVAIDKWA-BX8ElwDW.js → wardleyDiagram-IVAIDKWA-Bt-B2hQ5.js} +1 -1
  415. package/editor-web/assets/{whole-word-6DliXke2.js → whole-word-D3ZAtnkw.js} +1 -1
  416. package/editor-web/assets/{words-B2FXYyeZ.js → words-0Ww2RyT4.js} +1 -1
  417. package/editor-web/assets/{words-DFIhHhHF.js → words-XlXG79Ur.js} +1 -1
  418. package/editor-web/assets/workbook-FSSUiIp9.js +45 -0
  419. package/editor-web/assets/x-DlhyIKuu.js +41 -0
  420. package/editor-web/assets/{xychartDiagram-4URNHDU4-DoWQRJUS.js → xychartDiagram-4URNHDU4-DV4bSzTb.js} +1 -1
  421. package/editor-web/assets/{zoom-in-C4lxmIDE.js → zoom-in-PgsC94hP.js} +1 -1
  422. package/editor-web/index.html +8 -6
  423. package/package.json +2 -2
  424. package/editor-web/assets/arrow-down-DzZjFrBL.js +0 -1
  425. package/editor-web/assets/arrow-up-hdmh9LVD.js +0 -1
  426. package/editor-web/assets/article-DHFgHYjv.js +0 -3
  427. package/editor-web/assets/article-Dt9id9Y9.js +0 -7
  428. package/editor-web/assets/button-BVQH7zxz.js +0 -41
  429. package/editor-web/assets/calc-worker-jImBXoeb.js +0 -45
  430. package/editor-web/assets/channel-Dkg198L0.js +0 -1
  431. package/editor-web/assets/chart-BC3kUUDD.js +0 -2
  432. package/editor-web/assets/chunk-DSNLSHJZ-BFnyvrWg.js +0 -129
  433. package/editor-web/assets/code-BID_OoRp.js +0 -1
  434. package/editor-web/assets/collaborator-2qfw-8OJ.js +0 -1
  435. package/editor-web/assets/dist-5HNrQ9AU.js +0 -45
  436. package/editor-web/assets/dist-BPecIPz6.js +0 -530
  437. package/editor-web/assets/dist-BXJKASX4.js +0 -24
  438. package/editor-web/assets/dist-BeDRTqQ8.js +0 -38
  439. package/editor-web/assets/dist-BlL-4sl3.js +0 -43
  440. package/editor-web/assets/dist-BuqBg8k8.js +0 -1
  441. package/editor-web/assets/dist-BwW08gSh.js +0 -1
  442. package/editor-web/assets/dist-C30Thvb3.js +0 -1
  443. package/editor-web/assets/dist-Cj5AmpVb.js +0 -5
  444. package/editor-web/assets/dist-CjjnDOa8.js +0 -3
  445. package/editor-web/assets/dist-D7ur8721.js +0 -6
  446. package/editor-web/assets/dist-DOHhp09C.js +0 -4
  447. package/editor-web/assets/dist-LhFEYZza.js +0 -16
  448. package/editor-web/assets/flowDiagram-IUGLLWBU-C7ZmHJZW.js +0 -1
  449. package/editor-web/assets/hint-mQB8slJ2.js +0 -1
  450. package/editor-web/assets/index-BGAXezRR.js +0 -28
  451. package/editor-web/assets/index-Br4a-QEv.css +0 -2
  452. package/editor-web/assets/mermaid.core-B8478wZ1.js +0 -44
  453. package/editor-web/assets/minus-D1tgAHbU.js +0 -1
  454. package/editor-web/assets/progress-udl4pNsP.js +0 -6
  455. package/editor-web/assets/props-form-B6mYjTgZ.js +0 -1
  456. package/editor-web/assets/row-dgHEAE7h.js +0 -1
  457. package/editor-web/assets/schemas-B89k2jEC.js +0 -1
  458. package/editor-web/assets/slides-BdaWgL_N.js +0 -1
  459. package/editor-web/assets/snapshots-CTS2iez5.js +0 -56
  460. package/editor-web/assets/split-mDSkdQkd.js +0 -3
  461. package/editor-web/assets/surface-D9qJjJQL.js +0 -1
  462. package/editor-web/assets/svg-nJtFNJ-7.js +0 -1
  463. package/editor-web/assets/swatch-S8YuBYyj.js +0 -1
  464. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-CQ2aWYP-.js +0 -8
  465. package/editor-web/assets/switch-D5kPl2jO.js +0 -1
  466. package/editor-web/assets/tabs-C0AHyuE5.js +0 -1
  467. package/editor-web/assets/textarea-mzr9Kfuf.js +0 -1
@@ -0,0 +1,17 @@
1
+ import type { Item } from "@allyhub/formats";
2
+ import type { KindBuildContext } from "./kind-build.js";
3
+ /** An item a module imports: the item, the file that imports it, the reference as that file would write it, and its line. */
4
+ export interface ImportedItem {
5
+ readonly item: Item;
6
+ readonly from: string;
7
+ readonly of: string;
8
+ readonly line: number;
9
+ }
10
+ /**
11
+ * The items `item`'s entry imports, directly or through the project's
12
+ * modules it imports (a helper, a component), each once; never through
13
+ * another item's entry. Without the project's items (a context made
14
+ * outside a build), none.
15
+ */
16
+ export declare function importedItems(item: Item, context: Pick<KindBuildContext, "files" | "parsed" | "items">): ImportedItem[];
17
+ //# sourceMappingURL=imports.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{posix as m}from"node:path";import{repoPath as y}from"@allyhub/piece";import{lineAt as x}from"./scan.js";const v=["",".ts",".tsx",".js",".jsx",".mjs","/index.ts"];function w(r,e,d){const f=[];for(const t of e.program.body){if(!/^(Import|ExportNamed|ExportAll)Declaration$/.test(t.type)||t.importKind==="type"||t.exportKind==="type")continue;const o=t.source?.value;if(typeof o!="string"||!o.startsWith("."))continue;const i=y(r,o);if(i===void 0)continue;const p=v.map(s=>m.normalize(`${i}${s}`)).find(s=>d.has(s));p!==void 0&&f.push({path:p,line:x(e.source,t.start)})}return f}export function importedItems(r,e){const d=e.items??[],f=new Map(d.map(n=>[n.entry,n])),t=new Set(e.files),o=[],i=new Set,p=new Set([r.entry]),s=n=>{const h=e.parsed(n);if(h)for(const{path:c,line:l}of w(n,h,t)){const a=f.get(c);if(a!==void 0){if(a!==r&&!i.has(a.id)){i.add(a.id);const u=m.relative(m.dirname(n),c);o.push({item:a,from:n,of:u.startsWith(".")?u:`./${u}`,line:l})}continue}p.has(c)||(p.add(c),s(c))}};return s(r.entry),o}
@@ -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";
@@ -32,5 +32,6 @@ export { BUILD_FOLDER, inTime, issuesText, itemProblem, loadFailure, prepare, so
32
32
  export { codeOf, type PieceCode } from "./code.js";
33
33
  export { ProjectError, StuckError, type VersionPage } from "./version.js";
34
34
  export { generatedFile, generatedPagedFact, mismatchFacts, secondsOf, type ReadVersion, } from "./generated.js";
35
- export { resolveUses, splitReference, usesInOrder } from "./uses.js";
35
+ export { importedItems, type ImportedItem } from "./imports.js";
36
+ export { madeType, resolveUses, splitReference, usersOf, usesInOrder, type UseOffers, } from "./uses.js";
36
37
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- export{dependenciesOf,listFiles}from"./files.js";export{listWork,projectItems,readWork,unlistedWork}from"./work.js";export{moveEdits,movedPath,referencesOf,referringFiles}from"./move-refs.js";export{bundleForStage,compileErrorOf,createModuleLoader,createStageDevServer,loadUserVite}from"./vite.js";export{nodeStackPlace,placeFinder}from"./places.js";export{mergeScript,pieceLocales,readScripts,readMessages}from"./messages.js";export{MAX_DATA_BYTES,isDataFile,parseCsv,parseData,readData}from"./data.js";export{itemKindBuild,kindBuildOf}from"./kind-build.js";export{madeNotes}from"./made-notes.js";export{FACTS_HEAD,MOMENTS,PROJECT_DIR,STRETCH,VERSION_FIELDS,allFindings,defineView}from"./inspect-view.js";export{fileCheckOf,fileProblems,listedFileProblems}from"./file-check.js";export{FRESH,defineCliCommand,existingFile,fromMedia,media,parameters,progressLines,sizeOf}from"./cli-command.js";export{defineProjectTool}from"./project-tool.js";export{projectAt,projectOfFile,projectRoot}from"./project-root.js";export{buildPluginModules,nodeLending,sdkBindingsOf,sdkEntriesOf,stageAdditions}from"./build-plugins.js";export{deckReferences,referenceModule}from"./references.js";export{messagePrefix,parseComponentRef,readPropsText,resolveDims}from"@allyhub/piece";export{readMedia}from"./media.js";export{modelInfo}from"./model-info.js";export{takeVoice}from"./takes.js";export{resolveMatrix}from"./matrix.js";export{FONTS_MODULE,fontStyles,fontsDigest,fontsModule}from"./fonts.js";export{SDK,checkImports,discover,lineAt,packageName,parse,walk}from"./scan.js";export{allyhubPlugin,boundEntry,mediaHref}from"./plugin.js";export{MetaLoader}from"./meta.js";export{besideModule,fromFolder,plain}from"./evaluate.js";export{MESSAGE_TYPES,messageTypes,writeMessageTypes}from"./types.js";export{BUILD_FOLDER,inTime,issuesText,itemProblem,loadFailure,prepare,sourceOf,stageId,stageItem,stageName}from"./prepare.js";export{codeOf}from"./code.js";export{ProjectError,StuckError}from"./version.js";export{generatedFile,generatedPagedFact,mismatchFacts,secondsOf}from"./generated.js";export{resolveUses,splitReference,usesInOrder}from"./uses.js";
2
+ export{dependenciesOf,listFiles}from"./files.js";export{listWork,projectItems,readWork,unlistedWork}from"./work.js";export{moveEdits,movedPath,referencesOf,referringFiles}from"./move-refs.js";export{bundleForStage,compileErrorOf,createModuleLoader,createStageDevServer,loadUserVite}from"./vite.js";export{nodeStackPlace,placeFinder}from"./places.js";export{mergeScript,pieceLocales,readScripts,readMessages}from"./messages.js";export{MAX_DATA_BYTES,isDataFile,parseCsv,parseData,readData}from"./data.js";export{itemKindBuild,kindBuildOf}from"./kind-build.js";export{madeNotes}from"./made-notes.js";export{FACTS_HEAD,MOMENTS,PROJECT_DIR,STRETCH,VERSION_FIELDS,allFindings,defineView}from"./inspect-view.js";export{fileCheckOf,fileProblems,listedFileProblems}from"./file-check.js";export{FRESH,defineCliCommand,existingFile,fromMedia,media,parameters,progressLines,sizeOf}from"./cli-command.js";export{defineProjectTool}from"./project-tool.js";export{projectAt,projectOfFile,projectRoot}from"./project-root.js";export{buildPluginModules,nodeLending,sdkBindingsOf,sdkEntriesOf,stageAdditions}from"./build-plugins.js";export{deckReferences,referenceModule}from"./references.js";export{messagePrefix,parseComponentRef,readPropsText,resolveDims}from"@allyhub/piece";export{readMedia}from"./media.js";export{modelInfo}from"./model-info.js";export{takeVoice}from"./takes.js";export{resolveMatrix}from"./matrix.js";export{FONTS_MODULE,fontStyles,fontsDigest,fontsModule}from"./fonts.js";export{SDK,checkImports,discover,lineAt,packageName,parse,walk}from"./scan.js";export{allyhubPlugin,boundEntry,mediaHref}from"./plugin.js";export{MetaLoader}from"./meta.js";export{besideModule,fromFolder,plain}from"./evaluate.js";export{MESSAGE_TYPES,messageTypes,writeMessageTypes}from"./types.js";export{BUILD_FOLDER,inTime,issuesText,itemProblem,loadFailure,prepare,sourceOf,stageId,stageItem,stageName}from"./prepare.js";export{codeOf}from"./code.js";export{ProjectError,StuckError}from"./version.js";export{generatedFile,generatedPagedFact,mismatchFacts,secondsOf}from"./generated.js";export{importedItems}from"./imports.js";export{madeType,resolveUses,splitReference,usersOf,usesInOrder}from"./uses.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;
@@ -40,6 +40,12 @@ export interface KindBuildContext {
40
40
  * point it does not declare.
41
41
  */
42
42
  contributionsTo(point: string): readonly PointEntry[];
43
+ /**
44
+ * The project's items, as its list names them: what a kind's build
45
+ * finds another item by (an import of a deck's module, `importedItems`).
46
+ * Absent where a context is made outside a build.
47
+ */
48
+ readonly items?: readonly Item[];
43
49
  }
44
50
  /**
45
51
  * What the stage bundles for an item: a module of the project as it is
@@ -54,9 +60,12 @@ export interface StageEntry {
54
60
  readonly module?: string;
55
61
  /** The file that names its components. */
56
62
  readonly of?: string;
57
- readonly components?: readonly Pick<DocComponent, "of" | "module" | "name">[];
63
+ readonly components?: readonly Pick<DocComponent, "of" | "module" | "name" | "item">[];
58
64
  }
59
- /** Another item's made file an item asks for, as its kind's build module writes it. */
65
+ /**
66
+ * Another item an item asks for, as its kind's build module writes it
67
+ * (docs/design/references.md): taken as its data, live, or as a made file.
68
+ */
60
69
  export interface UseAsk {
61
70
  /** The reference: the used item's entry file, relative to `from`, and `#` and a part where its kind has parts. */
62
71
  readonly of: string;
@@ -64,8 +73,15 @@ export interface UseAsk {
64
73
  readonly from?: string;
65
74
  /** Its line in that file, for a problem with it. */
66
75
  readonly line?: number;
67
- /** The types the using kind takes, the one it wants most first. */
76
+ /**
77
+ * The forms the using kind takes, the one it wants most first: `data`,
78
+ * `live` (USE_FORMS) or file types. Given `live` and file types, the
79
+ * first file type the used kind renders is what a file that cannot hold
80
+ * it live is given (`ItemUse.file`).
81
+ */
68
82
  readonly types: readonly string[];
83
+ /** The using item's types that hold the made file of a live use (`pptx`); absent, every type. */
84
+ readonly madeFor?: readonly string[];
69
85
  /** What it is to the using item, in its kind's own words. */
70
86
  readonly role?: string;
71
87
  }
@@ -1,4 +1,4 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{mkdir as te,readFile as se,readdir as ne,writeFile as ie}from"node:fs/promises";import{join as y}from"node:path";import{BAKE_DIR as U,CACHE_DIR as oe,CONFIG_FILES as ae,ConfigSchema as T,TEXT_DIR as j,itemsOf as ce,pointEntriesIn as re,WORK_FILE as b}from"@allyhub/formats";import{problem as w}from"@allyhub/diagnostics";import{looksOf as q,resolveDims as le}from"@allyhub/piece";import{readData as fe}from"./data.js";import{dependenciesOf as de,listFiles as me}from"./files.js";import{readWork as ue}from"./work.js";import{fontStyles as he}from"./fonts.js";import{kindBuildOf as G}from"./kind-build.js";import{readMedia as pe}from"./media.js";import{readMessages as ge}from"./messages.js";import{MetaLoader as we}from"./meta.js";import{allyhubPlugin as be,mediaHref as V}from"./plugin.js";import{buildPluginModules as ke,stageAdditions as $e}from"./build-plugins.js";import{checkImports as ye,discover as xe,parse as Se}from"./scan.js";import{writeMessageTypes as Oe}from"./types.js";import{resolveUses as je}from"./uses.js";import{bundleForStage as Me,loadUserVite as Ee}from"./vite.js";import{nodeStackPlace as Ae}from"./places.js";export const inTime=(e,n)=>n.find(s=>s.id===e.kind)?.pages!==!0;export function itemProblem(e){switch(e.code){case"unknown-kind":return w("AK-M002",`${b} lists ${e.file} as a ${e.kind}, a kind no extension here contributes.`,{where:{file:b}});case"no-editor":return w("AK-M002",`${b} lists ${e.file} with no kind, and no editor here opens a file of its name. Name its kind, or take it out of the list.`,{where:{file:b}});case"missing":return w("AK-M002",`${b} lists ${e.file}, which is not in the project. Write it, or take it out of the list.`,{where:{file:b}});case"same-id":return w("AK-M003",`${b} lists ${e.files.join(" and ")}, one name (${e.id}) for two pieces: rename one, or list it once.`,{where:{file:b}})}}export function loadFailure(e,n,s){const a=s?`${n} (at ${s.file}:${String(s.line)}:${String(s.column)})`:n,d=/\b(window|document|navigator|self|HTMLElement|customElements) is not defined/u.test(n);return w("AK-R001",d?`${e} uses something at its top level that only exists in the browser (${a}). The top level of a piece module must load in Node: move it into the output's function, or import it inside a component.`:`Failed to load ${e}: ${a}`,{where:s?{file:s.file,line:s.line}:{file:e}})}export const issuesText=e=>e.issues.map(n=>`${n.path.map(String).join(".")||"(root)"}: ${n.message}`).join("; ");async function ve(e){return(await ne(y(e,U)).catch(()=>[])).filter(s=>/^[0-9a-f]+\.[\w-]+\.bin$/u.test(s)).map(s=>`${U}/${s}`)}async function Fe(e){const n=[],s=new Set;for(const a of e){const d=await G(a)?.catch(()=>{});!d?.config||s.has(d)||(s.add(d),n.push(d.config))}return n}export async function prepare(e,n){const s=[],a=await me(e),d=await ue(e);for(const f of d.problems)s.push(w("AK-M002",f,{where:{file:b}}));const c=ce(d.work,n.kinds,new Set(a));for(const f of c.problems)s.push(itemProblem(f));const m=await de(e),r=await pe(e,[...a,...await ve(e)]),i=await $e(n.kinds,e,(f,p)=>{s.push(w("AK-R001",`The build plugins module ${f} did not load, so the stage's bundles go without it: ${p instanceof Error?p.message:String(p)}`,{}))}),h=new we({root:e,media:r,dependencies:[...m],user:!0,lent:{...i.lent},sdk:{...i.sdk},bound:{...i.bound},buildPlugins:ke(n.kinds)},n.metaTimeout);try{let f=T.parse({});const p=ae.find(t=>a.includes(t));if(p){const t=await h.request({type:"config",file:p});if(s.push(...t.problems),!t.ok)s.push(loadFailure(p,t.error??"",Ae(t.stack,e)));else{const o=t.value??{},l=await Fe(n.kinds),u=new Set(l.flatMap(g=>Object.keys(g.shape??{}))),$=T.safeParse(Object.fromEntries(Object.entries(o).filter(([g])=>!u.has(g)||Object.hasOwn(T.shape,g)))),W=l.map(g=>g.safeParse(o)),H=[...$.success?[]:[issuesText($.error)],...W.flatMap(g=>g.success?[]:[issuesText(g.error)])];if($.success&&H.length===0){f=$.data;for(const g of W)g.success&&(f={...f,...g.data})}else s.push(w("AK-M001",`${p} is not valid: ${H.join("; ")}.`,{where:{file:p}}))}}const K=f.defaults?.format,D=typeof K=="string"?K:"16x9",M=he(e,f);for(const t of M.missing)s.push(w("AK-A001",`allyhub.config's fonts name ${t}, which is not in the project or its packages.`,{where:{file:p??"allyhub.config.ts"}}));const x=await ge(e,a,{...f.locales?{locales:f.locales}:{},text:f.text??j});s.push(...x.problems);const X=a.filter(t=>/\.(ts|tsx|js|jsx|mts|mjs)$/u.test(t)&&!t.endsWith(".d.ts")),E=new Map;for(const t of X){const o=Se(t,await se(y(e,t),"utf8"));E.set(t,o),s.push(...ye(t,o,m,new Set(Object.keys(i.lent)),new Set(Object.keys(i.sdk))))}const I=[];for(const[t,o]of E){if(!xe(t,o).components)continue;const l=await h.request({type:"components",file:t});if(s.push(...l.problems),!!l.ok)for(const u of l.value??[])typeof u.name=="string"&&typeof u.export=="string"&&I.push({name:u.name,file:t,export:u.export,...typeof u.label=="string"||typeof u.label=="object"&&u.label!==null?{label:u.label}:{}})}const R=await Ke(c.items,n.kinds,s),P=new Map,_=(t,o)=>({root:e,files:a,meta:h,media:r,messages:x,defaultFormat:D,config:f,lent:t,data:o,parsed:l=>E.get(l),claim:(l,u)=>{const $=P.get(l);return $===void 0&&P.set(l,u),$},contributionsTo:()=>[]}),N=(t,o)=>({...t,contributionsTo:l=>re(n.kinds,o.kind,l)}),k=[];let S={};const z=_({},{}),A=new Map,v=new Map,L=(t,o)=>{A.set(t,[...A.get(t)??[],...o.files??[]]),o.uses&&o.uses.length>0&&v.set(t,[...v.get(t)??[],...o.uses])};for(const t of c.items){const o=await R.get(t)?.lend?.(t,N(z,t));o&&(k.push(o),L(t,o),S={...S,...o.data})}const B={...await fe(e,a.filter(t=>!c.items.some(o=>o.entry===t)),f.text??j),...S},Q=_(S,B);for(const t of c.items){const o=await R.get(t)?.read?.(t,N(Q,t));o&&(k.push(o),L(t,o));const l=new Set([t.entry]);t.files=[{path:t.entry,role:"entry"},...(A.get(t)??[]).filter(u=>!l.has(u.path)&&!!l.add(u.path))]}for(const t of k)s.push(...t.problems??[]);s.push(...je(c.items,n.kinds,v));const Y=k.flatMap(t=>t.piece?[t.piece]:[]),Z=k.flatMap(t=>t.doc?[t.doc]:[]),ee=k.flatMap(t=>t.sheet?[t.sheet]:[]),C=[...k.filter(t=>t.piece),...k.filter(t=>!t.piece)].flatMap(t=>t.stage?[t.stage]:[]),O=x.locales[0];await Oe(e,O===void 0?{}:x.messages[O]??{},O===void 0?void 0:x.files[O]);let F;if(n.buildDir&&C.length>0){const t=Object.fromEntries(await Promise.all(C.map(async l=>[l.name,await Te(e,l)]))),o=await Ee(e);try{const l=await Me({root:e,entries:t,outDir:n.buildDir,plugins:[be({root:e,media:r,dependencies:m,fonts:()=>M.styles,stageEntries:new Set(Object.values(t)),lent:i.lent,sdk:i.sdk,bound:i.bound}),...i.plugins],...o?{user:o}:{}}),u=await i.written(n.buildDir);F={dir:n.buildDir,chunks:l,beside:u}}catch(l){s.push(w("AK-R001",`The pieces could not be bundled for the stage: ${l.message.split(`
3
- `).slice(0,3).join(" ")}`,{}))}}const J=new Set;return{root:e,kinds:n.kinds,files:a,items:c.items,config:f,defaultFormat:D,dependencies:[...m].sort(),messages:x,media:r,data:B,docs:Z,sheets:ee,pieces:Y,components:I,fonts:M.styles,...F?{bundle:F}:{},problems:s.filter(t=>{const o=`${t.code}|${t.message}|${t.where?.file??""}|${String(t.where?.line??"")}`;return J.has(o)?!1:(J.add(o),!0)})}}finally{await h.close()}}export const BUILD_FOLDER="build/",stageName=e=>e.replaceAll("/","__"),stageId=e=>"components"in e?e.place:e.id;export function stageItem(e,n){return e.pieces.find(s=>s.id===n)??e.docs.find(s=>s.place===n&&s.components.length>0)}async function Te(e,n){const s=n.components??[];if(s.length===0&&n.module!==void 0)return y(e,n.module);const a=y(e,oe,"stage-entries");await te(a,{recursive:!0});const d=y(a,`${n.name}.ts`),c=[...new Set(s.map(r=>r.module))],m=[`// The components ${n.of??n.module??n.name} shows by their module (generated by the build).`,...n.module===void 0?[]:[`export { default } from ${JSON.stringify(y(e,n.module))};`],...c.map((r,i)=>`import * as m${String(i)} from ${JSON.stringify(y(e,r))};`),"export const components = {",...s.map(r=>` ${JSON.stringify(r.of)}: m${String(c.indexOf(r.module))}[${JSON.stringify(r.name)}],`),"};",""];return await ie(d,m.join(`
4
- `)),d}async function Ke(e,n,s){const a=new Map,d=new Map;for(const c of e){if(!a.has(c.kind)){const r=n.find(i=>i.id===c.kind);a.set(c.kind,await G(r)?.catch(i=>{s.push(w("AK-R001",`The ${r?.extension??c.kind} extension's build module did not load, so its items are not read: ${i instanceof Error?i.message:String(i)}`,{}))}))}const m=a.get(c.kind);m&&d.set(c,m)}return d}export function sourceOf(e,n){if("components"in n)return Ie(e,n);const s=n,a=BUILD_FOLDER,d=stageName(s.id),c=e.bundle?.chunks.entries[d];if(!c)throw new Error(`${s.id} was not bundled for the stage.`);const m=new Set,r=(i,h)=>{if(h.has(i))return;h.add(i);const f=e.bundle?.chunks.chunks[i];if(f){for(const p of f.css)m.add(`${a}${p}`);for(const p of f.imports)r(p,h)}};return r(c.file,new Set),{piece:s.id,file:s.file,module:`${a}${c.file}`,styles:[...m],dims:s.dims,...s.matrix?{matrix:{space:s.matrix.space,rules:s.matrix.rules}}:{},format:s.format,locales:e.messages.locales,messages:e.messages.messages,anchors:e.messages.anchors,text:e.config.text??j,...s.script===void 0?{}:{script:s.script},media:Object.fromEntries(Object.entries(e.media).map(([i,h])=>[i,{...h,url:V(i)}])),data:e.data,kind:s.kind,...s.loads,...q(e.config),pieces:Object.fromEntries(e.pieces.map(i=>[i.id,{file:i.file,dims:i.dims,format:i.format,...i.matrix?{matrix:{space:i.matrix.space,rules:i.matrix.rules}}:{}}]))}}const De="1920x1080";function Ie(e,n){const s=stageName(n.place),a=e.bundle?.chunks.entries[s];if(!a)throw new Error(`${n.place} shows no component: it has no stage bundle.`);const d=new Set,c=(m,r)=>{if(r.has(m))return;r.add(m);const i=e.bundle?.chunks.chunks[m];if(i){for(const h of i.css)d.add(`${BUILD_FOLDER}${h}`);for(const h of i.imports)c(h,r)}};return c(a.file,new Set),{kind:"doc",piece:n.place,file:n.file,module:`${BUILD_FOLDER}${a.file}`,styles:[...d],dims:le(void 0,{locales:e.messages.locales}),format:De,locales:e.messages.locales,messages:e.messages.messages,anchors:e.messages.anchors,text:e.config.text??j,media:Object.fromEntries(Object.entries(e.media).map(([m,r])=>[m,{...r,url:V(m)}])),data:e.data,...q(e.config)}}
2
+ import{mkdir as ie,readFile as oe,readdir as ae,writeFile as ce}from"node:fs/promises";import{join as y}from"node:path";import{BAKE_DIR as q,CACHE_DIR as re,CONFIG_FILES as le,ConfigSchema as T,TEXT_DIR as M,USE_FORMS as fe,itemsOf as de,pointEntriesIn as me,WORK_FILE as w}from"@allyhub/formats";import{problem as g}from"@allyhub/diagnostics";import{looksOf as G,resolveDims as ue}from"@allyhub/piece";import{readData as he}from"./data.js";import{dependenciesOf as ge,listFiles as pe}from"./files.js";import{readWork as we}from"./work.js";import{fontStyles as be}from"./fonts.js";import{kindBuildOf as V}from"./kind-build.js";import{readMedia as ke}from"./media.js";import{readMessages as $e}from"./messages.js";import{MetaLoader as ye}from"./meta.js";import{allyhubPlugin as xe,mediaHref as X}from"./plugin.js";import{buildPluginModules as Se,stageAdditions as Oe}from"./build-plugins.js";import{checkImports as Me,discover as je,parse as Ee}from"./scan.js";import{writeMessageTypes as ve}from"./types.js";import{resolveUses as Ae}from"./uses.js";import{bundleForStage as De,loadUserVite as Fe}from"./vite.js";import{nodeStackPlace as Te}from"./places.js";export const inTime=(e,n)=>n.find(s=>s.id===e.kind)?.pages!==!0;export function itemProblem(e){switch(e.code){case"unknown-kind":return g("AK-M002",`${w} lists ${e.file} as a ${e.kind}, a kind no extension here contributes.`,{where:{file:w}});case"no-editor":return g("AK-M002",`${w} lists ${e.file} with no kind, and no editor here opens a file of its name. Name its kind, or take it out of the list.`,{where:{file:w}});case"missing":return g("AK-M002",`${w} lists ${e.file}, which is not in the project. Write it, or take it out of the list.`,{where:{file:w}});case"same-id":return g("AK-M003",`${w} lists ${e.files.join(" and ")}, one id (${e.id}) for two pieces, so only the first is shown: rename one, or list it once.`,{where:{file:w}})}}export function loadFailure(e,n,s){const o=s?`${n} (at ${s.file}:${String(s.line)}:${String(s.column)})`:n,f=/\b(window|document|navigator|self|HTMLElement|customElements) is not defined/u.test(n);return g("AK-R001",f?`${e} uses something at its top level that only exists in the browser (${o}). The top level of a piece module must load in Node: move it into the output's function, or import it inside a component.`:`Failed to load ${e}: ${o}`,{where:s?{file:s.file,line:s.line}:{file:e}})}export const issuesText=e=>e.issues.map(n=>`${n.path.map(String).join(".")||"(root)"}: ${n.message}`).join("; ");async function Ke(e){return(await ae(y(e,q)).catch(()=>[])).filter(s=>/^[0-9a-f]+\.[\w-]+\.bin$/u.test(s)).map(s=>`${q}/${s}`)}async function Ie(e){const n=[],s=new Set;for(const o of e){const f=await V(o)?.catch(()=>{});!f?.config||s.has(f)||(s.add(f),n.push(f.config))}return n}export async function prepare(e,n){const s=[],o=await pe(e),f=await we(e);for(const m of f.problems)s.push(g("AK-M002",m,{where:{file:w}}));const i=de(f.work,n.kinds,new Set(o));for(const m of i.problems)s.push(itemProblem(m));const r=await ge(e),c=await ke(e,[...o,...await Ke(e)]),l=await Oe(n.kinds,e,(m,p)=>{s.push(g("AK-R001",`The build plugins module ${m} did not load, so the stage's bundles go without it: ${p instanceof Error?p.message:String(p)}`,{}))}),b=new ye({root:e,media:c,dependencies:[...r],user:!0,lent:{...l.lent},sdk:{...l.sdk},bound:{...l.bound},buildPlugins:Se(n.kinds)},n.metaTimeout);try{let m=T.parse({});const p=le.find(t=>o.includes(t));if(p){const t=await b.request({type:"config",file:p});if(s.push(...t.problems),!t.ok)s.push(loadFailure(p,t.error??"",Te(t.stack,e)));else{const a=t.value??{},d=await Ie(n.kinds),u=new Set(d.flatMap(h=>Object.keys(h.shape??{}))),$=T.safeParse(Object.fromEntries(Object.entries(a).filter(([h])=>!u.has(h)||Object.hasOwn(T.shape,h)))),W=d.map(h=>h.safeParse(a)),H=[...$.success?[]:[issuesText($.error)],...W.flatMap(h=>h.success?[]:[issuesText(h.error)])];if($.success&&H.length===0){m=$.data;for(const h of W)h.success&&(m={...m,...h.data})}else s.push(g("AK-M001",`${p} is not valid: ${H.join("; ")}.`,{where:{file:p}}))}}const I=m.defaults?.format,R=typeof I=="string"?I:"16x9",j=be(e,m);for(const t of j.missing)s.push(g("AK-A001",`allyhub.config's fonts name ${t}, which is not in the project or its packages.`,{where:{file:p??"allyhub.config.ts"}}));const x=await $e(e,o,{...m.locales?{locales:m.locales}:{},text:m.text??M});s.push(...x.problems);const Q=o.filter(t=>/\.(ts|tsx|js|jsx|mts|mjs)$/u.test(t)&&!t.endsWith(".d.ts")),E=new Map;for(const t of Q){const a=Ee(t,await oe(y(e,t),"utf8"));E.set(t,a),s.push(...Me(t,a,r,new Set(Object.keys(l.lent)),new Set(Object.keys(l.sdk))))}const _=[];for(const[t,a]of E){if(!je(t,a).components)continue;const d=await b.request({type:"components",file:t});if(s.push(...d.problems),!!d.ok)for(const u of d.value??[])typeof u.name=="string"&&typeof u.export=="string"&&_.push({name:u.name,file:t,export:u.export,...typeof u.label=="string"||typeof u.label=="object"&&u.label!==null?{label:u.label}:{}})}const v=await _e(i.items,n.kinds,s),P=new Map,N=(t,a)=>({root:e,files:o,meta:b,media:c,messages:x,defaultFormat:R,config:m,lent:t,data:a,parsed:d=>E.get(d),items:i.items,claim:(d,u)=>{const $=P.get(d);return $===void 0&&P.set(d,u),$},contributionsTo:()=>[]}),L=(t,a)=>({...t,contributionsTo:d=>me(n.kinds,a.kind,d)}),k=[];let S={};const Y=N({},{}),A=new Map,D=new Map,B=(t,a)=>{A.set(t,[...A.get(t)??[],...a.files??[]]),a.uses&&a.uses.length>0&&D.set(t,[...D.get(t)??[],...a.uses])};for(const t of i.items){const a=await v.get(t)?.lend?.(t,L(Y,t));a&&(k.push(a),B(t,a),S={...S,...a.data})}const C={...await he(e,o.filter(t=>!i.items.some(a=>a.entry===t)),m.text??M),...S},Z=N(S,C);for(const t of i.items){const a=await v.get(t)?.read?.(t,L(Z,t));a&&(k.push(a),B(t,a));const d=new Set([t.entry]);t.files=[{path:t.entry,role:"entry"},...(A.get(t)??[]).filter(u=>!d.has(u.path)&&!!d.add(u.path))]}for(const t of k)s.push(...t.problems??[]);const ee=new Set(i.items.flatMap(t=>v.get(t)?.onStage?[t.kind]:[]));s.push(...Ae(i.items,n.kinds,D,{live:t=>ee.has(t),lent:new Set(Object.keys(S))}));const te=k.flatMap(t=>t.piece?[t.piece]:[]),se=k.flatMap(t=>t.doc?[t.doc]:[]),ne=k.flatMap(t=>t.sheet?[t.sheet]:[]),J=[...k.filter(t=>t.piece),...k.filter(t=>!t.piece)].flatMap(t=>t.stage?[t.stage]:[]),O=x.locales[0];await ve(e,O===void 0?{}:x.messages[O]??{},O===void 0?void 0:x.files[O]);let F;if(n.buildDir&&J.length>0){const t=Object.fromEntries(await Promise.all(J.map(async d=>[d.name,await Re(e,d)]))),a=await Fe(e);try{const d=await De({root:e,entries:t,outDir:n.buildDir,plugins:[xe({root:e,media:c,dependencies:r,fonts:()=>j.styles,stageEntries:new Set(Object.values(t)),lent:l.lent,sdk:l.sdk,bound:l.bound}),...l.plugins],...a?{user:a}:{}}),u=await l.written(n.buildDir);F={dir:n.buildDir,chunks:d,beside:u}}catch(d){s.push(g("AK-R001",`The pieces could not be bundled for the stage: ${d.message.split(`
3
+ `).slice(0,3).join(" ")}`,{}))}}const U=new Set;return{root:e,kinds:n.kinds,files:o,items:i.items,config:m,defaultFormat:R,dependencies:[...r].sort(),messages:x,media:c,data:C,docs:se,sheets:ne,pieces:te,components:_,fonts:j.styles,...F?{bundle:F}:{},problems:s.filter(t=>{const a=`${t.code}|${t.message}|${t.where?.file??""}|${String(t.where?.line??"")}`;return U.has(a)?!1:(U.add(a),!0)})}}finally{await b.close()}}export const BUILD_FOLDER="build/",stageName=e=>e.replaceAll("/","__"),stageId=e=>"components"in e?e.place:e.id;export function stageItem(e,n){return e.pieces.find(s=>s.id===n)??e.docs.find(s=>s.place===n&&s.components.length>0)}async function Re(e,n){const s=(n.components??[]).filter(c=>c.item!==!0);if(s.length===0&&n.module!==void 0)return y(e,n.module);const o=y(e,re,"stage-entries");await ie(o,{recursive:!0});const f=y(o,`${n.name}.ts`),i=[...new Set(s.map(c=>c.module))],r=[`// The components ${n.of??n.module??n.name} shows by their module (generated by the build).`,...n.module===void 0?[]:[`export { default } from ${JSON.stringify(y(e,n.module))};`],...i.map((c,l)=>`import * as m${String(l)} from ${JSON.stringify(y(e,c))};`),"export const components = {",...s.map(c=>` ${JSON.stringify(c.of)}: m${String(i.indexOf(c.module))}[${JSON.stringify(c.name)}],`),"};",""];return await ce(f,r.join(`
4
+ `)),f}async function _e(e,n,s){const o=new Map,f=new Map;for(const i of e){if(!o.has(i.kind)){const c=n.find(l=>l.id===i.kind);o.set(i.kind,await V(c)?.catch(l=>{s.push(g("AK-R001",`The ${c?.extension??i.kind} extension's build module did not load, so its items are not read: ${l instanceof Error?l.message:String(l)}`,{}))}))}const r=o.get(i.kind);r&&f.set(i,r)}return f}function K(e,n){const s=[],o=new Set,f=new Set,i=r=>{if(f.has(r))return;f.add(r);const c=e.bundle?.chunks.chunks[r];if(c){r!==n&&s.push(`${BUILD_FOLDER}${r}`);for(const l of c.css)o.add(`${BUILD_FOLDER}${l}`);for(const l of c.imports)i(l)}};return i(n),{imports:s,styles:[...o]}}export function sourceOf(e,n){if("components"in n)return Ne(e,n);const s=n,o=BUILD_FOLDER,f=stageName(s.id),i=e.bundle?.chunks.entries[f];if(!i)throw new Error(`${s.id} was not bundled for the stage.`);const{imports:r,styles:c}=K(e,i.file);return{piece:s.id,file:s.file,module:`${o}${i.file}`,imports:r,styles:c,dims:s.dims,...s.matrix?{matrix:{space:s.matrix.space,rules:s.matrix.rules}}:{},format:s.format,locales:e.messages.locales,messages:e.messages.messages,anchors:e.messages.anchors,text:e.config.text??M,...s.script===void 0?{}:{script:s.script},media:Object.fromEntries(Object.entries(e.media).map(([l,b])=>[l,{...b,url:X(l)}])),data:e.data,kind:s.kind,...s.loads,...G(e.config),pieces:z(e,s.place)}}function z(e,n){const s=new Map(e.items.map(i=>[i.id,i])),o=new Set,f=i=>{for(const r of s.get(i)?.uses??[])r.type!==fe.live||o.has(r.item)||(o.add(r.item),f(r.item))};return f(n),Object.fromEntries(e.pieces.map(i=>{const r={file:i.file,dims:i.dims,format:i.format,...i.matrix?{matrix:{space:i.matrix.space,rules:i.matrix.rules}}:{}},c=e.bundle?.chunks.entries[stageName(i.id)];if(!o.has(i.place)||i.place===n||!c)return[i.id,r];const{imports:l,styles:b}=K(e,c.file);return[i.id,{...r,kind:i.kind,module:`${BUILD_FOLDER}${c.file}`,imports:l,styles:b,...i.script===void 0?{}:{script:i.script},...i.loads?.kindData===void 0?{}:{kindData:i.loads.kindData}}]}))}const Pe="1920x1080";function Ne(e,n){const s=stageName(n.place),o=e.bundle?.chunks.entries[s];if(!o)throw new Error(`${n.place} shows no component: it has no stage bundle.`);const{imports:f,styles:i}=K(e,o.file);return{kind:"doc",piece:n.place,file:n.file,module:`${BUILD_FOLDER}${o.file}`,imports:f,styles:i,dims:ue(void 0,{locales:e.messages.locales}),format:Pe,locales:e.messages.locales,messages:e.messages.messages,anchors:e.messages.anchors,text:e.config.text??M,media:Object.fromEntries(Object.entries(e.media).map(([r,c])=>[r,{...c,url:X(r)}])),data:e.data,...G(e.config),pieces:z(e,n.place)}}
@@ -1,4 +1,4 @@
1
- import type { Item, KindTable } from "@allyhub/formats";
1
+ import { type Item, type ItemUse, type KindTable } from "@allyhub/formats";
2
2
  import { type Problem } from "@allyhub/diagnostics";
3
3
  import type { UseAsk } from "./kind-build.js";
4
4
  /** A reference split: the entry's path as written, and the part after `#`. */
@@ -7,16 +7,37 @@ export declare function splitReference(of: string): {
7
7
  part?: string;
8
8
  };
9
9
  /**
10
- * Each item's asks resolved onto it (`Item.uses`, and its entry among the
11
- * item's files as `use`), and the problems of those that could not be.
10
+ * What the used items give besides their made files, as the build read
11
+ * them (docs/design/references.md §3.2): whether an item of a kind is
12
+ * drawn live by its kind's runtime, and the data the kinds lent, by the
13
+ * paths they lent it at (`sales/sales.yaml#revenue`).
12
14
  */
13
- export declare function resolveUses(items: readonly Item[], kinds: KindTable, asks: ReadonlyMap<Item, readonly UseAsk[]>): Problem[];
15
+ export interface UseOffers {
16
+ readonly live?: (kind: string) => boolean;
17
+ readonly lent?: ReadonlySet<string>;
18
+ }
19
+ /**
20
+ * Each item's asks resolved onto it (`Item.uses`, and the entries and
21
+ * files of what it uses, through every step, among the item's files as
22
+ * `use`), and the problems of those that could not be.
23
+ */
24
+ export declare function resolveUses(items: readonly Item[], kinds: KindTable, asks: ReadonlyMap<Item, readonly UseAsk[]>, offers?: UseOffers): Problem[];
25
+ /** What uses an item, directly: each using item's id with its use of it, in the list's order. */
26
+ export declare function usersOf(items: readonly Item[], id: string): {
27
+ item: string;
28
+ use: ItemUse;
29
+ }[];
30
+ /** The file type a use is made as, if any: its form when that is a file type, else a live use's file. */
31
+ export declare function madeType(use: ItemUse): string | undefined;
14
32
  /**
15
33
  * What making `asked` needs made first, each used item and type once, in
16
34
  * an order where what an item uses comes before it; a cycle is cut where
17
- * it closes (the build said so).
35
+ * it closes (the build said so). Only made files are made: a use of an
36
+ * item's data or of its drawing live needs nothing made, but a live use's
37
+ * file does where the using item is made as a type that holds it
38
+ * (`typesOf`: the types asked of an item; absent, every type).
18
39
  */
19
- export declare function usesInOrder(items: readonly Item[], asked: readonly Item[]): {
40
+ export declare function usesInOrder(items: readonly Item[], asked: readonly Item[], typesOf?: (item: Item) => readonly string[]): {
20
41
  item: Item;
21
42
  type: string;
22
43
  }[];
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{posix as h}from"node:path";import{problem as y}from"@allyhub/diagnostics";export function splitReference(o){const i=o.indexOf("#");if(i<0)return{path:o};const r=o.slice(i+1);return r===""?{path:o.slice(0,i)}:{path:o.slice(0,i),part:r}}function x(o,i){const r=h.normalize(h.join(h.dirname(o),i));return r===".."||r.startsWith("../")||h.isAbsolute(i)?void 0:r}export function resolveUses(o,i,r){const c=[],d=new Map(o.map(n=>[n.entry,n]));for(const[n,t]of r){const s=[];for(const e of t){const p=e.from??n.entry,a={file:p,...e.line===void 0?{}:{line:e.line}},{path:k,part:w}=splitReference(e.of),$=x(p,k),l=$===void 0?void 0:d.get($);if(l===void 0){c.push(y("AK-M016",`${e.of} names no item of the work list: a reference is an item's file, from the file that writes it (${p}).`,{where:a}));continue}if(l===n){c.push(y("AK-M016",`${n.entry} cannot use its own made file.`,{where:a}));continue}const g=i.find(m=>m.id===l.kind)?.renders?.types??[],b=e.types.find(m=>g.includes(m));if(b===void 0){c.push(y("AK-M016",`${e.of} is a ${l.kind}, which makes ${g.join(", ")||"no file"}; here it is taken as ${e.types.join(", ")}.`,{where:a}));continue}s.push({of:e.of,from:p,item:l.id,...w===void 0?{}:{part:w},type:b,...e.role===void 0?{}:{role:e.role}})}if(s.length===0)continue;n.uses=s;const u=n.files??[{path:n.entry,role:"entry"}],f=new Set(u.map(e=>e.path));for(const e of s){const p=o.find(a=>a.id===e.item)?.entry;p!==void 0&&!f.has(p)&&(f.add(p),u.push({path:p,role:"use"}))}n.files=u}return c.push(...M(o)),c}function M(o){const i=new Map(o.map(t=>[t.id,t])),r=[],c=new Set,d=[],n=t=>{if(c.has(t.id))return;const s=d.indexOf(t.id);if(s>=0){const u=[...d.slice(s),t.id],f=i.get(d[d.length-1]??"");r.push(y("AK-M016",`${u.join(" uses ")}: an item cannot use itself through another.`,{where:{file:f?.entry??t.entry}}));return}d.push(t.id);for(const u of t.uses??[]){const f=i.get(u.item);f&&n(f)}d.pop(),c.add(t.id)};for(const t of o)n(t);return r}export function usesInOrder(o,i){const r=new Map(o.map(s=>[s.id,s])),c=[],d=new Set,n=new Set,t=s=>{if(!n.has(s.id)){n.add(s.id);for(const u of s.uses??[]){const f=r.get(u.item);if(!f)continue;t(f);const e=`${f.id}\0${u.type}`;d.has(e)||(d.add(e),c.push({item:f,type:u.type}))}n.delete(s.id)}};for(const s of i)t(s);return c}
2
+ import{posix as b}from"node:path";import{USE_FORMS as g,isFileForm as j}from"@allyhub/formats";import{problem as v}from"@allyhub/diagnostics";export function splitReference(e){const r=e.indexOf("#");if(r<0)return{path:e};const i=e.slice(r+1);return i===""?{path:e.slice(0,r)}:{path:e.slice(0,r),part:i}}function A(e,r){const i=b.normalize(b.join(b.dirname(e),r));return i===".."||i.startsWith("../")||b.isAbsolute(r)?void 0:i}function I(e,r,i,n){const d=[];return r!==void 0&&n.lent?.has(`${e.entry}#${r}`)===!0&&d.push(g.data),n.live?.(e.kind)===!0&&d.push(g.live),d.push(...i.find(u=>u.id===e.kind)?.renders?.types??[]),d}export function resolveUses(e,r,i,n={}){const d=[],u=new Map(e.map(o=>[o.entry,o])),f=new Map(e.map(o=>[o.id,o]));for(const[o,s]of i){const c=[],l=new Set;for(const t of s){const a=t.from??o.entry,y={file:a,...t.line===void 0?{}:{line:t.line}},{path:S,part:w}=splitReference(t.of),x=A(a,S),h=x===void 0?void 0:u.get(x)??(t.types.length===1&&t.types[0]===g.data?f.get(x):void 0);if(h===void 0){d.push(v("AK-M016",`${t.of} names no item of the work list: a reference is an item's file (a table's, also its sheet's id), from the file that writes it (${a}).`,{where:y}));continue}if(h===o){d.push(v("AK-M016",`${o.entry} cannot use itself.`,{where:y}));continue}const $=I(h,w,r,n),M=t.types.find(m=>$.includes(m));if(M===void 0){const m=t.types.includes(g.data)&&w!==void 0;d.push(v("AK-M016",m&&!$.includes(g.data)?`${t.of}: ${h.entry} lends no ${w}${n.lent?`; it lends ${O(h,n.lent)||"nothing"}`:""}.`:`${t.of} is a ${h.kind}, which gives ${$.join(", ")||"nothing"}; here it is taken as ${t.types.join(", ")}.`,{where:y}));continue}const k=[t.of,a,M,t.role??""].join("\0");if(l.has(k))continue;l.add(k);const F=M===g.live?t.types.find(m=>j(m)&&$.includes(m)):void 0;c.push({of:t.of,from:a,...t.line===void 0?{}:{line:t.line},item:h.id,...w===void 0?{}:{part:w},type:M,...F===void 0?{}:{file:F},...F===void 0||t.madeFor===void 0?{}:{madeFor:[...t.madeFor]},...t.role===void 0?{}:{role:t.role}})}c.length>0&&(o.uses=c)}const p=U(e);return d.push(...p),K(e),d}function O(e,r){const i=`${e.entry}#`;return[...r].filter(n=>n.startsWith(i)).map(n=>n.slice(i.length)).join(", ")}function K(e){const r=new Map(e.map(n=>[n.id,n])),i=new Map(e.map(n=>[n.id,n.files??[{path:n.entry,role:"entry"}]]));for(const n of e){if(!n.uses)continue;const d=[...i.get(n.id)??[]],u=new Set(d.map(o=>o.path)),f=new Set([n.id]),p=o=>{if(f.has(o))return;f.add(o);const s=r.get(o);if(s){for(const c of i.get(o)??[])u.has(c.path)||(u.add(c.path),d.push({path:c.path,role:"use"}));for(const c of s.uses??[])p(c.item)}};for(const o of n.uses)p(o.item);n.files=d}}export function usersOf(e,r){return e.flatMap(i=>(i.uses??[]).filter(n=>n.item===r).map(n=>({item:i.id,use:n})))}function U(e){const r=new Map(e.map(f=>[f.id,f])),i=[],n=new Set,d=[],u=f=>{if(n.has(f.id))return;const p=d.indexOf(f.id);if(p>=0){const o=[...d.slice(p),f.id],s=r.get(d[d.length-1]??"");i.push(v("AK-M016",`${o.join(" uses ")}: an item cannot use itself through another.`,{where:{file:s?.entry??f.entry}}));return}d.push(f.id);for(const o of f.uses??[]){const s=r.get(o.item);s&&u(s)}d.pop(),n.add(f.id)};for(const f of e)u(f);return i}export function madeType(e){return j(e.type)?e.type:e.file}export function usesInOrder(e,r,i){const n=new Map(e.map(s=>[s.id,s])),d=[],u=new Set,f=new Set,p=(s,c)=>{const l=madeType(s);return l===void 0||j(s.type)||s.madeFor===void 0||c===void 0||c.some(t=>s.madeFor?.includes(t))?l:void 0},o=(s,c)=>{if(!f.has(s.id)){f.add(s.id);for(const l of s.uses??[]){const t=n.get(l.item),a=p(l,c);if(!t||a===void 0)continue;o(t,[a]);const y=`${t.id}\0${a}`;u.has(y)||(u.add(y),d.push({item:t,type:a}))}f.delete(s.id)}};for(const s of r)o(s,i?.(s));return d}
@@ -18,13 +18,21 @@ export declare function projectItems(root: string, kinds: KindTable, files?: rea
18
18
  * Nothing when the file is listed already.
19
19
  */
20
20
  export declare function listWork(root: string, item: WorkItem): Promise<void>;
21
+ /** A piece taken out of the list as it was written there: its entry, every field of it, and the headings it stood under, outermost first. */
22
+ export interface UnlistedEntry {
23
+ entry: Record<string, unknown>;
24
+ groups: string[];
25
+ }
21
26
  /**
22
27
  * The project's list without the pieces whose file is `gone` or under it
23
28
  * (a file or a folder removed), the rest of it, comments included, as it
24
- * was, and the pieces taken out; undefined when it names none of them.
29
+ * was, and the pieces taken out: as pieces (`items`), and as they were
30
+ * written, with the headings over each (`entries`, what puts one back
31
+ * where it was); undefined when it names none of them.
25
32
  */
26
33
  export declare function unlistedWork(text: string, gone: string): {
27
34
  text: string;
28
35
  items: WorkItem[];
36
+ entries: UnlistedEntry[];
29
37
  } | undefined;
30
38
  //# sourceMappingURL=work.d.ts.map
@@ -1,4 +1,4 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{readFile as u,writeFile as m}from"node:fs/promises";import{join as l}from"node:path";import{itemsOf as w,parseWork as k,WORK_FILE as c,WorkItemSchema as S}from"@allyhub/formats";import{isMap as h,isScalar as y,isSeq as g,parseDocument as p,parse as b,visit as d}from"yaml";import{listFiles as x}from"./files.js";export async function readWork(s){const e=await u(l(s,c),"utf8").catch(()=>{});if(e===void 0)return{work:{work:[]},problems:[]};let o;try{o=b(e)}catch(t){return{work:{work:[]},problems:[`${c} is not valid YAML: ${t.message.split(`
3
- `)[0]??""}`]}}const r=k(o);return r.ok?{work:r.value,problems:[]}:{work:{work:[]},problems:r.problems.map(t=>`${c}: ${t}`)}}export async function projectItems(s,e,o,r){const{work:t,problems:i}=await readWork(s);return{...w(t,e,new Set(o??await x(s)),r),listProblems:i}}export async function listWork(s,e){const o=l(s,c),r=await u(o,"utf8").catch(()=>`work: []
4
- `),t=p(r),i=t.toJS()?.work;if(JSON.stringify(i??[]).includes(JSON.stringify(e.file)))return;Array.isArray(i)||t.set("work",t.createNode([]));const a=t.get("work",!0);g(a)&&(a.flow=!1),t.addIn(["work"],e),await m(o,t.toString())}export function unlistedWork(s,e){const o=p(s),r=[];return d(o,{Map(t,i){if(!h(i))return;const n=i.get("file",!0);if(!y(n)||typeof n.value!="string")return;const a=n.value.replace(/^\.\//u,"");if(a!==e&&!a.startsWith(`${e}/`))return;const f=S.safeParse(i.toJSON());return f.success&&r.push(f.data),d.REMOVE}}),r.length>0?{text:o.toString(),items:r}:void 0}
2
+ import{readFile as w,writeFile as W}from"node:fs/promises";import{join as k}from"node:path";import{itemsOf as b,parseWork as v,WORK_FILE as c,WorkItemSchema as O}from"@allyhub/formats";import{isMap as g,isScalar as y,isSeq as M,parseDocument as S,parse as $,visit as h}from"yaml";import{listFiles as F}from"./files.js";export async function readWork(s){const r=await w(k(s,c),"utf8").catch(()=>{});if(r===void 0)return{work:{work:[]},problems:[]};let e;try{e=$(r)}catch(t){return{work:{work:[]},problems:[`${c} is not valid YAML: ${t.message.split(`
3
+ `)[0]??""}`]}}const o=v(e);return o.ok?{work:o.value,problems:[]}:{work:{work:[]},problems:o.problems.map(t=>`${c}: ${t}`)}}export async function projectItems(s,r,e,o){const{work:t,problems:n}=await readWork(s);return{...b(t,r,new Set(e??await F(s)),o),listProblems:n}}export async function listWork(s,r){const e=k(s,c),o=await w(e,"utf8").catch(()=>`work: []
4
+ `),t=S(o),n=t.toJS()?.work;if(JSON.stringify(n??[]).includes(JSON.stringify(r.file)))return;Array.isArray(n)||t.set("work",t.createNode([]));const a=t.get("work",!0);M(a)&&(a.flow=!1),t.addIn(["work"],r),await W(e,t.toString())}export function unlistedWork(s,r){const e=S(s),o=[],t=[];return h(e,{Map(n,i,a){if(!g(i))return;const u=i.get("file",!0);if(!y(u)||typeof u.value!="string")return;const p=u.value.replace(/^\.\//u,"");if(p!==r&&!p.startsWith(`${r}/`))return;const l=i.toJSON(),d=O.safeParse(l);d.success&&o.push(d.data);const x=a.flatMap(m=>{if(!g(m))return[];const f=m.get("group",!0);return y(f)&&typeof f.value=="string"?[f.value]:[]});return t.push({entry:l,groups:x}),h.REMOVE}}),t.length>0?{text:e.toString(),items:o,entries:t}:void 0}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/build",
3
- "version": "0.15.2",
3
+ "version": "0.17.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/canvas-extension",
3
- "version": "0.15.2",
3
+ "version": "0.17.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./package.json": "./package.json",
@@ -1,7 +1,7 @@
1
1
  # references/canvas.md
2
2
 
3
- A canvas lays a project's work out to be seen together, compared and talked over: a launch's outputs side by side, two cuts of a video, a mood board, candidates with your reasons beside them. It draws nothing of its own and exports nothing. It is a `.canvas` file (JSON Canvas, as Obsidian writes it) anywhere in the project, written by hand and listed in `allyhub.yaml` for the person to see it.
3
+ A canvas lays a project's work out to be seen together, compared and talked over: a launch's outputs side by side, two cuts of a video, a mood board, candidates with your reasons beside them. It shows the project's own items, with notes and edges between them, and stays in the project as a place to work. It is a `.canvas` file (JSON Canvas, as Obsidian writes it) anywhere in the project, written by hand and listed in `allyhub.yaml` for the person to see it.
4
4
 
5
5
  - `allyhub help canvases` lists the commands and prints where the SDK's `canvas.md` is. Read it before writing a canvas.
6
6
  - **The person moves things and adds notes and edges in the same file.** Read it before you change it, and keep what they put there.
7
- - `allyhub inspect canvas <file>` lists what it holds and where, without drawing it; `allyhub dev <file>` opens it for the person.
7
+ - `allyhub inspect canvas <file>` lists what it holds and where, without drawing it. It is handed over as any item is.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/canvas-model",
3
- "version": "0.15.2",
3
+ "version": "0.17.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/chart",
3
- "version": "0.15.2",
3
+ "version": "0.17.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/check",
3
- "version": "0.15.2",
3
+ "version": "0.17.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{mkdir as p,readFile as w,writeFile as b}from"node:fs/promises";import{dirname as y}from"node:path";import{BLOBS_MAX as d,BlobsResponseSchema as S}from"@allyhub/protocol";import{CloudError as k}from"./errors.js";const g=4,v=30*6e4;export class BlobStore{cloud;path;file;known;constructor(i,s){this.cloud=i,this.path=s.path,this.file=s.file}async load(){if(this.known)return this.known;if(this.file===void 0)return this.known=new Set;try{this.known=new Set(JSON.parse(await w(this.file,"utf8")))}catch{this.known=new Set}return this.known}async save(){this.file!==void 0&&(await p(y(this.file),{recursive:!0}),await b(this.file,JSON.stringify([...this.known??[]])))}async forget(i){const s=await this.load();for(const n of i)s.delete(n);await this.save()}async put(i){let s=0;const n=await this.load(),o=new Map;for(const e of i)n.has(e.sha256)||o.set(e.sha256,e);const l=[...o.values()];for(let e=0;e<l.length;e+=d){const c=l.slice(e,e+d),{uploads:a}=S.parse(await this.cloud.json(this.path,{method:"POST",body:{blobs:c.map(t=>({sha256:t.sha256,size:t.size,contentType:t.type}))}}));let f=0;const u=async()=>{for(;f<a.length;){const t=a[f++],r=t&&o.get(t.sha256);if(!t||!r)continue;const m=r.bytes??await w(r.file??""),h=await this.cloud.config.fetch(t.url,{method:"PUT",headers:t.headers,body:new Uint8Array(m),signal:AbortSignal.timeout(v)});if(!h.ok)throw new k("blob-refused",`Storage refused a blob: ${String(h.status)} ${(await h.text()).slice(0,200)}`);s+=1}};await Promise.all(Array.from({length:Math.min(g,a.length)},u));for(const t of c)n.add(t.sha256);await this.save()}return s}}
2
+ import{mkdir as p,readFile as w,writeFile as S}from"node:fs/promises";import{dirname as b}from"node:path";import{BLOBS_MAX as d,BlobsResponseSchema as y}from"@allyhub/protocol";import{CloudError as g}from"./errors.js";const k=4,A=30*6e4,v=3*6e4;export class BlobStore{cloud;path;file;known;constructor(i,s){this.cloud=i,this.path=s.path,this.file=s.file}async load(){if(this.known)return this.known;if(this.file===void 0)return this.known=new Set;try{this.known=new Set(JSON.parse(await w(this.file,"utf8")))}catch{this.known=new Set}return this.known}async save(){this.file!==void 0&&(await p(b(this.file),{recursive:!0}),await S(this.file,JSON.stringify([...this.known??[]])))}async forget(i){const s=await this.load();for(const n of i)s.delete(n);await this.save()}async put(i){let s=0;const n=await this.load(),o=new Map;for(const e of i)n.has(e.sha256)||o.set(e.sha256,e);const l=[...o.values()];for(let e=0;e<l.length;e+=d){const c=l.slice(e,e+d),{uploads:a}=y.parse(await this.cloud.json(this.path,{method:"POST",signal:AbortSignal.timeout(v),body:{blobs:c.map(t=>({sha256:t.sha256,size:t.size,contentType:t.type}))}}));let f=0;const u=async()=>{for(;f<a.length;){const t=a[f++],r=t&&o.get(t.sha256);if(!t||!r)continue;const m=r.bytes??await w(r.file??""),h=await this.cloud.config.fetch(t.url,{method:"PUT",headers:t.headers,body:new Uint8Array(m),signal:AbortSignal.timeout(A)});if(!h.ok)throw new g("blob-refused",`Storage refused a blob: ${String(h.status)} ${(await h.text()).slice(0,200)}`);s+=1}};await Promise.all(Array.from({length:Math.min(k,a.length)},u));for(const t of c)n.add(t.sha256);await this.save()}return s}}
@@ -13,13 +13,22 @@ export interface Key {
13
13
  }
14
14
  /** Removes anything key-shaped from text that may reach the screen. */
15
15
  export declare function scrub(text: string, key?: string): string;
16
+ /**
17
+ * Work no person asked for (a Studio server's save on its clock), run so
18
+ * that every call it makes to AllyHub says so (BACKGROUND_HEADER): a
19
+ * refusal of one is marked as background. What it answers.
20
+ */
21
+ export declare function callsMadeInBackground<T>(work: () => Promise<T>): Promise<T>;
16
22
  export declare class Cloud {
17
23
  readonly config: CloudConfig;
18
24
  constructor(config: CloudConfig);
19
25
  /**
20
- * Run by an agent in Studio, Studio is told a call was refused for
21
- * credits, and offers the person to buy them. Never fails the command:
22
- * a Host that does not answer in a second is left.
26
+ * Run by an agent in Studio, Studio is told a call was refused for what
27
+ * buying fixes (credits, a plan, storage), with what it was and its
28
+ * numbers, and opens its paywall for the person (docs/design/paywall.md).
29
+ * Never fails the command: a Studio that does not answer in a second is
30
+ * left. One from before the paywall knows only credits, at its old
31
+ * address, and is told of them there.
23
32
  */
24
33
  private tellStudio;
25
34
  get url(): string;
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{createHash as w}from"node:crypto";import{DEVICE_HEADER as m,EXIT as r,IDEMPOTENCY_KEY_HEADER as b,ORGANIZATION_HEADER as l,planPageAddress as g}from"@allyhub/protocol";import{accessOf as _,SignedOut as k}from"./credentials.js";import{userAgent as E}from"./device.js";import{CloudError as u,notSignedIn as y,unreachable as p}from"./errors.js";export function scrub(f,t){let e=f.replace(/(authorization)\s*[:=]\s*[^\r\n]+/giu,"$1: <redacted>");return e=e.replace(/\bahk_[A-Za-z0-9_-]+/gu,"<api-key>"),e=e.replace(/\beyJ[\w-]+\.[\w-]+\.[\w-]+/gu,"<token>"),t&&(e=e.split(t).join("<key>")),e}export class Cloud{config;constructor(t){this.config=t}async tellStudio(){const t=this.config.studioHost;t!==void 0&&await fetch(`${t}/out-of-credits`,{method:"POST",signal:AbortSignal.timeout(1e3)}).then(e=>e.body?.cancel(),()=>{})}get url(){return this.config.url}async key(t={}){const e=this.config.apiKey;if(e)return{key:e,source:"env",account:w("sha256").update(e).digest("hex")};try{const n=await _(this.config,t);if(!n)return;const c=n.credentials.account.organization?.id,s=n.credentials.device;return{key:n.token,source:"oauth",account:n.credentials.account.id,expiresAt:n.expiresAt,...c===void 0?{}:{organization:c},...s===void 0?{}:{device:s}}}catch(n){if(n instanceof k)return;throw p(this.url,n)}}async requireKey(){const t=await this.key();if(!t)throw y();return t}keyedFetch=async(t,e)=>{const n=this.config.client===void 0?void 0:await E(this.config.client),c=d=>{const o=new Headers(e?.headers);return o.set("authorization",`Bearer ${d.key}`),n!==void 0&&!o.has("user-agent")&&o.set("user-agent",n),this.config.traceparent!==void 0&&!o.has("traceparent")&&o.set("traceparent",this.config.traceparent),d.organization!==void 0&&!o.has(l)&&o.set(l,d.organization),d.device!==void 0&&o.set(m,d.device),this.config.fetch(t,{...e,headers:o})},s=await this.requireKey(),i=await c(s);if(i.status!==401||s.source!=="oauth"||e?.body instanceof ReadableStream||t instanceof Request)return i;const a=await this.key({refused:s.key});return a===void 0?i:(await i.body?.cancel(),c(a))};async json(t,e={}){const n=e.auth!==!1,c=n?await this.requireKey():void 0,s=c?.key,i=e.organization??c?.organization;let a;try{a=await(n?this.keyedFetch:this.config.fetch)(`${this.url}${t}`,{redirect:"error",signal:e.signal??AbortSignal.timeout(3e4),method:e.method??"GET",headers:{accept:"application/json",...e.body===void 0?{}:{"content-type":"application/json"},...e.organization===void 0?{}:{[l]:e.organization},...e.idempotencyKey===void 0?{}:{[b]:e.idempotencyKey}},...e.body===void 0?{}:{body:JSON.stringify(e.body)}})}catch(h){throw h instanceof u?h:p(this.url,h)}const d=await a.text(),o=a.ok?void 0:S(d,a.status,s,this.url,i);if(o?.code==="insufficient-credits"&&await this.tellStudio(),o&&a.status!==401)throw o;if(a.status===403)throw new u("forbidden","This AllyHub account does not have access to this operation.",{exit:r.auth,status:403});if(a.status===401)throw y(n?"This computer's AllyHub sign-in is not valid any more.":void 0);if(!a.ok)throw new u("api-error",`${this.url}${t} answered ${String(a.status)}: ${scrub(d.slice(0,300),s)}`,{exit:a.status>=500?r.platform:r.usage,status:a.status});try{return JSON.parse(d)}catch{throw new u("api-error",`${this.url}${t} did not answer JSON.`,{exit:r.platform,status:a.status})}}}const A={bad_input:r.usage,insufficient_credits:r.auth,plan_required:r.auth,tool_off:r.auth,storage_full:r.auth,limit_reached:r.auth,forbidden:r.auth,not_found:r.notFound,conflict:r.conflict,worked_elsewhere:r.conflict};function S(f,t,e,n,c){let s;try{s=JSON.parse(f)}catch{return}const i=s?.error;if(typeof i?.code!="string"||typeof i.message!="string")return;const a=i.code==="insufficient_credits"?`Buy credits at ${g(n,{organization:c,open:"credits"})}, or ask an owner or admin of the team to.`:i.code==="plan_required"?`Subscribe at ${g(n,{organization:c,open:"plans"})}, or ask an owner or admin of the team to.`:i.code==="tool_off"?`Turn it on in Capabilities at ${n}/, or ask an owner or admin of the team to.`:typeof i.hint=="string"?i.hint:void 0;return new u(i.code.replaceAll("_","-"),scrub(i.message,e),{exit:A[i.code]??r.platform,status:t,...a===void 0?{}:{hint:a},...typeof i.data=="object"&&i.data!==null?{data:i.data}:{}})}
2
+ import{AsyncLocalStorage as _}from"node:async_hooks";import{createHash as b}from"node:crypto";import{BACKGROUND_HEADER as A,COMMAND_LINE_PAYWALL_MET as E,DEVICE_HEADER as O,EXIT as c,IDEMPOTENCY_KEY_HEADER as k,ORGANIZATION_HEADER as g,paywallNumbersOfData as S,paywallReasonOfCode as $,planPageAddress as y}from"@allyhub/protocol";import{accessOf as N,SignedOut as x}from"./credentials.js";import{userAgent as z}from"./device.js";import{CloudError as h,notSignedIn as p,unreachable as w}from"./errors.js";export function scrub(u,n){let t=u.replace(/(authorization)\s*[:=]\s*[^\r\n]+/giu,"$1: <redacted>");return t=t.replace(/\bahk_[A-Za-z0-9_-]+/gu,"<api-key>"),t=t.replace(/\beyJ[\w-]+\.[\w-]+\.[\w-]+/gu,"<token>"),n&&(t=t.split(n).join("<key>")),t}const I="/api/tools",m=new _;export function callsMadeInBackground(u){return m.run(!0,u)}export class Cloud{config;constructor(n){this.config=n}async tellStudio(n,t,i){const r=this.config.studioHost;if(r===void 0)return;const s={reason:n,what:t.startsWith(I)?"tool":"command",numbers:S(i)},e=(d,o)=>fetch(`${r}/${d}`,{method:"POST",signal:AbortSignal.timeout(1e3),...o===void 0?{}:{headers:{"content-type":"application/json"},body:o}}).then(async f=>(await f.body?.cancel(),f.status),()=>{});await e(E,JSON.stringify(s))===404&&n==="insufficient_credits"&&await e("out-of-credits")}get url(){return this.config.url}async key(n={}){const t=this.config.apiKey;if(t)return{key:t,source:"env",account:b("sha256").update(t).digest("hex")};try{const i=await N(this.config,n);if(!i)return;const r=i.credentials.account.organization?.id,s=i.credentials.device;return{key:i.token,source:"oauth",account:i.credentials.account.id,expiresAt:i.expiresAt,...r===void 0?{}:{organization:r},...s===void 0?{}:{device:s}}}catch(i){if(i instanceof x)return;throw w(this.url,i)}}async requireKey(){const n=await this.key();if(!n)throw p();return n}keyedFetch=async(n,t)=>{const i=this.config.client===void 0?void 0:await z(this.config.client),r=d=>{const o=new Headers(t?.headers);return o.set("authorization",`Bearer ${d.key}`),i!==void 0&&!o.has("user-agent")&&o.set("user-agent",i),this.config.traceparent!==void 0&&!o.has("traceparent")&&o.set("traceparent",this.config.traceparent),d.organization!==void 0&&!o.has(g)&&o.set(g,d.organization),d.device!==void 0&&o.set(O,d.device),m.getStore()===!0&&o.set(A,"1"),this.config.fetch(n,{...t,headers:o})},s=await this.requireKey(),e=await r(s);if(e.status!==401||s.source!=="oauth"||t?.body instanceof ReadableStream||n instanceof Request)return e;const a=await this.key({refused:s.key});return a===void 0?e:(await e.body?.cancel(),r(a))};async json(n,t={}){const i=t.auth!==!1,r=i?await this.requireKey():void 0,s=r?.key,e=t.organization??r?.organization;let a;try{a=await(i?this.keyedFetch:this.config.fetch)(`${this.url}${n}`,{redirect:"error",signal:t.signal??AbortSignal.timeout(3e4),method:t.method??"GET",headers:{accept:"application/json",...t.body===void 0?{}:{"content-type":"application/json"},...t.organization===void 0?{}:{[g]:t.organization},...t.idempotencyKey===void 0?{}:{[k]:t.idempotencyKey}},...t.body===void 0?{}:{body:JSON.stringify(t.body)}})}catch(l){throw l instanceof h?l:w(this.url,l)}const d=await a.text(),o=a.ok?void 0:T(d,a.status,s,this.url,e),f=$(o?.code);if(f!==void 0&&await this.tellStudio(f,n,o?.data),o&&a.status!==401)throw o;if(a.status===403)throw new h("forbidden","This AllyHub account does not have access to this operation.",{exit:c.auth,status:403});if(a.status===401)throw p(i?"This computer's AllyHub sign-in is not valid any more.":void 0);if(!a.ok)throw new h("api-error",`${this.url}${n} answered ${String(a.status)}: ${scrub(d.slice(0,300),s)}`,{exit:a.status>=500?c.platform:c.usage,status:a.status});if(a.status!==204)try{return JSON.parse(d)}catch{throw new h("api-error",`${this.url}${n} did not answer JSON.`,{exit:c.platform,status:a.status})}}}const R={bad_input:c.usage,insufficient_credits:c.auth,plan_required:c.auth,tool_off:c.auth,storage_full:c.auth,limit_reached:c.auth,forbidden:c.auth,not_found:c.notFound,conflict:c.conflict};function T(u,n,t,i,r){let s;try{s=JSON.parse(u)}catch{return}const e=s?.error;if(typeof e?.code!="string"||typeof e.message!="string")return;const a=e.code==="insufficient_credits"?`Buy credits at ${y(i,{organization:r,open:"credits"})}, or ask an owner or admin of the team to.`:e.code==="plan_required"?`Subscribe at ${y(i,{organization:r,open:"plans"})}, or ask an owner or admin of the team to.`:e.code==="tool_off"?`Turn it on in Capabilities at ${i}/, or ask an owner or admin of the team to.`:typeof e.hint=="string"?e.hint:void 0;return new h(e.code.replaceAll("_","-"),scrub(e.message,t),{exit:R[e.code]??c.platform,status:n,...a===void 0?{}:{hint:a},...typeof e.data=="object"&&e.data!==null?{data:e.data}:{}})}
@@ -1,6 +1,6 @@
1
1
  export { cloudConfig, hostsText, type CloudConfig } from "./config.js";
2
2
  export { CloudError, cloudWork, notSignedIn, SIGN_IN } from "./errors.js";
3
- export { Cloud, scrub, type Key } from "./client.js";
3
+ export { Cloud, callsMadeInBackground, scrub, type Key } from "./client.js";
4
4
  export { SignedOut, accessOf, accountOf, authServer, chooseOrganization, forgetCredentials, readCredentials, signInWithCode, signInWithDevice, signOut, writeCredentials, type Credentials, } from "./credentials.js";
5
5
  export { SIGN_IN_WAIT_MS, openBrowser, signIn, signInByEmail, signInDevice, signInInBackground, signedInAs, type SignInHint, } from "./signin.js";
6
6
  export { osKeychain, type Keychain, type KeychainEntry } from "./keychain.js";
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- export{cloudConfig,hostsText}from"./config.js";export{CloudError,cloudWork,notSignedIn,SIGN_IN}from"./errors.js";export{Cloud,scrub}from"./client.js";export{SignedOut,accessOf,accountOf,authServer,chooseOrganization,forgetCredentials,readCredentials,signInWithCode,signInWithDevice,signOut,writeCredentials}from"./credentials.js";export{SIGN_IN_WAIT_MS,openBrowser,signIn,signInByEmail,signInDevice,signInInBackground,signedInAs}from"./signin.js";export{osKeychain}from"./keychain.js";export{LoopbackError,startLoopback}from"./loopback.js";export{pkcePair,randomState}from"./pkce.js";export{billingSummary,browserLink,organizations,webLink}from"./token.js";export{BlobStore}from"./blobs.js";export{Hashes,hashFolder,sha256Of}from"./hashes.js";export{addDeployment,changeSite,createSite,goLive,listSites,removeSite,siteDetail,unpublishSite}from"./sites.js";export{createMailAlias,mailbox,rawMail,readMail,replyMail,searchMail,sendMail}from"./mail.js";export{CATALOG_CACHE_SECONDS,findTool,loadCatalog}from"./catalog.js";export{POLL_SECONDS,READ_SECONDS,RETRY_SECONDS,WAIT_SECONDS,callTool,resumeJob}from"./call.js";export{REUSE_LEFT_MS,UPLOAD_CONCURRENCY,UPLOAD_TYPES,uploadFiles,urlExpiry,withKnownUploads}from"./uploads.js";export{BASE64_FROM,LARGE_FROM,canonical,genRecord,inputHash,isSecretName,namedFile,readGen,recordInput,recordOutput,toolWords,withoutSignature,writeGen,writeWords}from"./records.js";export{makeSay,sayInput}from"./voice.js";
2
+ export{cloudConfig,hostsText}from"./config.js";export{CloudError,cloudWork,notSignedIn,SIGN_IN}from"./errors.js";export{Cloud,callsMadeInBackground,scrub}from"./client.js";export{SignedOut,accessOf,accountOf,authServer,chooseOrganization,forgetCredentials,readCredentials,signInWithCode,signInWithDevice,signOut,writeCredentials}from"./credentials.js";export{SIGN_IN_WAIT_MS,openBrowser,signIn,signInByEmail,signInDevice,signInInBackground,signedInAs}from"./signin.js";export{osKeychain}from"./keychain.js";export{LoopbackError,startLoopback}from"./loopback.js";export{pkcePair,randomState}from"./pkce.js";export{billingSummary,browserLink,organizations,webLink}from"./token.js";export{BlobStore}from"./blobs.js";export{Hashes,hashFolder,sha256Of}from"./hashes.js";export{addDeployment,changeSite,createSite,goLive,listSites,removeSite,siteDetail,unpublishSite}from"./sites.js";export{createMailAlias,mailbox,rawMail,readMail,replyMail,searchMail,sendMail}from"./mail.js";export{CATALOG_CACHE_SECONDS,findTool,loadCatalog}from"./catalog.js";export{POLL_SECONDS,READ_SECONDS,RETRY_SECONDS,WAIT_SECONDS,callTool,resumeJob}from"./call.js";export{REUSE_LEFT_MS,UPLOAD_CONCURRENCY,UPLOAD_TYPES,uploadFiles,urlExpiry,withKnownUploads}from"./uploads.js";export{BASE64_FROM,LARGE_FROM,canonical,genRecord,inputHash,isSecretName,namedFile,readGen,recordInput,recordOutput,toolWords,withoutSignature,writeGen,writeWords}from"./records.js";export{makeSay,sayInput}from"./voice.js";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/cloud",
3
- "version": "0.15.2",
3
+ "version": "0.17.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/components",
3
- "version": "0.15.2",
3
+ "version": "0.17.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.ts",
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{readFile as p,readdir as m,rm as h}from"node:fs/promises";import{join as a}from"node:path";import{listsFile as d,TRASH_DIR as y,WORK_FILE as E}from"@allyhub/formats";import{isInput as l}from"./inputs.js";export const TRASH_KEPT_DAYS=30,DELETED_FILE="deleted.json";const O=(e,n)=>n===e.entry||e.files!==void 0&&d(e.files,n)||e.inputs.some(o=>l(o,n));export function movesOfDeletion(e){const{target:n}=e,o=new Set([n.entry]);for(const t of e.files)(n.files!==void 0&&d(n.files,t)||n.inputs.some(c=>c!==""&&l(c,t)))&&o.add(t);o.delete(E);const s=e.others.some(t=>t.ofKind&&t.files===void 0),i=new Set(e.listed),r=[],f=[];for(const t of[...o].sort())i.has(t)||e.others.some(u=>O(u,t))||s&&t!==n.entry?f.push(t):r.push(t);return{moves:r,stays:f}}export const utcStampOf=e=>`${e.toISOString().slice(0,19).replaceAll("-","").replaceAll(":","")}Z`;export function shortNameOf(e){const o=(e.split("/").pop()??"").replace(/[^A-Za-z0-9._-]+/gu,"-").replace(/^[-.]+|-+$/gu,"").slice(0,40);return o===""?"item":o}export async function emptyTrashOlderThan(e,n,o){const s=a(e,y),i=await m(s,{withFileTypes:!0}).catch(t=>{if(hasErrorCode(t,"ENOENT","ENOTDIR"))return[];throw t}),r=o.getTime()-n*24*60*60*1e3,f=[];for(const t of i){if(!t.isDirectory())continue;const c=await T(a(s,t.name,DELETED_FILE));c===void 0||c>=r||(await h(a(s,t.name),{recursive:!0,force:!0}),f.push(t.name))}return f}async function T(e){let n;try{n=await p(e,"utf8")}catch(r){if(hasErrorCode(r,"ENOENT","ENOTDIR"))return;throw r}let o;try{o=JSON.parse(n)}catch(r){if(r instanceof SyntaxError)return;throw r}const s=typeof o=="object"&&o!==null&&"deletedAt"in o?o.deletedAt:void 0;if(typeof s!="string")return;const i=Date.parse(s);return Number.isNaN(i)?void 0:i}export const hasErrorCode=(e,...n)=>typeof e=="object"&&e!==null&&"code"in e&&typeof e.code=="string"&&n.includes(e.code);
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- export{PING_MS,RAW_PATH,RPC_PATH,forwardedHost,startDevServer}from"./server.js";export{ProjectServer,SERVER_METHODS}from"./project.js";export{Writer,LIST_LIMIT,UPLOAD_MAX_BYTES}from"./writer.js";export{Watcher}from"./watcher.js";export{Presence}from"./presence.js";export{changedLines}from"./texts.js";export{writeProblems,dataFileOf}from"./validate.js";export{pathProblem,versionOf}from"./paths.js";export{SETTLE_MS}from"./background.js";export{recordTree}from"./record.js";export{itemPreview,projectName}from"./card.js";export{downloadsFolder,hasFileManager,revealFile}from"./reveal.js";
2
+ export{PING_MS,RAW_PATH,RPC_PATH,forwardedHost,startDevServer}from"./server.js";export{ProjectServer,SERVER_METHODS}from"./project.js";export{Writer,LIST_LIMIT,UPLOAD_MAX_BYTES}from"./writer.js";export{DELETED_FILE,TRASH_KEPT_DAYS,movesOfDeletion}from"./deletion.js";export{Watcher}from"./watcher.js";export{Presence}from"./presence.js";export{changedLines}from"./texts.js";export{writeProblems,dataFileOf}from"./validate.js";export{pathProblem,versionOf}from"./paths.js";export{SETTLE_MS}from"./background.js";export{recordTree}from"./record.js";export{itemPreview,projectName}from"./card.js";export{downloadsFolder,hasFileManager,revealFile}from"./reveal.js";
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{listsFile as c}from"@allyhub/formats";const l=(d,t)=>d===""||d.endsWith("/")?t.startsWith(d):d===t;export class Inputs{recorded=new Map;set(t,s,o){let e=this.recorded.get(t);e||(e=new Map,this.recorded.set(t,e)),e.set(s,new Set(o))}add(t,s,o){const e=this.recorded.get(t)?.get(s);e?e.add(o):this.set(t,s,[o])}of(t){const s=new Set;for(const o of this.recorded.get(t)?.values()??[])for(const e of o)s.add(e);return s}affected(t,s){const o=new Map;for(const e of t){const f=[...this.of(e.id)],n=s.filter(r=>r===e.entry||e.files!==void 0&&c(e.files,r)||f.some(i=>l(i,r)));n.length>0&&o.set(e.id,n)}return o}}
2
+ import{listsFile as c}from"@allyhub/formats";export const isInput=(r,t)=>r===""||r.endsWith("/")?t.startsWith(r):r===t;export class Inputs{recorded=new Map;set(t,s,o){let e=this.recorded.get(t);e||(e=new Map,this.recorded.set(t,e)),e.set(s,new Set(o))}add(t,s,o){const e=this.recorded.get(t)?.get(s);e?e.add(o):this.set(t,s,[o])}of(t){const s=new Set;for(const o of this.recorded.get(t)?.values()??[])for(const e of o)s.add(e);return s}affected(t,s){const o=new Map;for(const e of t){const f=[...this.of(e.id)],n=s.filter(d=>d===e.entry||e.files!==void 0&&c(e.files,d)||f.some(i=>isInput(i,d)));n.length>0&&o.set(e.id,n)}return o}}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{rm as f}from"node:fs/promises";import{join as u}from"node:path";import{startBrowser as m}from"@allyhub/browser";import{kindBuildOf as w,mediaHref as b,nodeLending as v,projectItems as g,sourceOf as k,stageItem as S}from"@allyhub/build";import{CACHE_DIR as y}from"@allyhub/formats";import{CheckSession as D,ProjectError as R,pickTarget as E,parseCombo as O}from"@allyhub/project";import{RPC_ERROR as h,RpcError as c,SNAPSHOT_TREE as l}from"@allyhub/protocol";import{prepareStage as $,viewStage as C}from"@allyhub/stage";import{Routes as P}from"./routes.js";export function rpcErrorOf(o){return o instanceof R?new c(o.kind==="not-found"?h.notFound:h.invalid,o.hint?`${o.message} ${o.hint}`:o.message):o}export class Live{root;buildDir;revision=0;prep;last;lease;old=new Set;browserStarted;gpu;building=Promise.resolve();closed=!1;codes=new Map;kinds;routes;constructor(e,i){this.root=e,this.kinds=i.kinds,this.buildDir=u(e,y,"build",`dev-${String(process.pid)}`),this.gpu=i.gpu,this.routes=new P({root:e,kinds:i.kinds,buildDir:this.buildDir,revision:()=>this.revision,prepared:()=>this.prepared(),latest:()=>this.latest(),view:(t,s)=>C(e,t,s,i.kinds),recordInputs:(t,s,n)=>{i.recordInputs?.(t,s,n)}})}moved(e){this.revision=e,this.lease&&this.lease.revision!==e&&this.retire(this.lease)}prepared(){const e=this.revision;if(this.prep?.revision===e)return this.prep.promise;const i=this.building.then(()=>e===this.revision?this.build():void 0);this.building=i.catch(()=>{});const t=i.then(s=>s??this.prepared());return this.prep={revision:e,promise:t},t.catch(()=>{this.prep?.promise===t&&(this.prep=void 0)}),t}async build(){const e=await $(this.root,this.pieceDir,this.kinds);return this.last=e,e}async itemCode(e){const i=await this.item(e),t=i?await w(this.kinds.find(r=>r.id===i.kind))?.catch(()=>{}):void 0,s=t?.code?.bind(t);if(!i||!s)return{failed:!1};const n=this.codes.get(e),d=n?.revision===this.revision?n.promise:v(this.kinds,this.root).then(r=>s(i,{root:this.root,lend:r})).catch(()=>{});return this.codes.set(e,{revision:this.revision,promise:d}),await d??{failed:!0}}async item(e){const{items:i}=await g(this.root,this.kinds);return i.find(t=>t.id===e)}get pieceDir(){return u(this.buildDir,"stage")}latest(){return this.last}async target(e,i){const t=await this.prepared();try{const{piece:s,target:n}=E(t,e,i===void 0?void 0:[O(i)]);return{prepared:t,piece:s,combo:n.combo}}catch(s){throw rpcErrorOf(s)}}async componentHost(e,i){const t=await this.prepared(),s=t.docs.find(r=>r.place===e||r.file===e);if(s){if(s.components.length===0)throw new c(h.notFound,`${s.place} shows no component.`);const r=t.messages.locales[0];return{prepared:t,host:s,combo:r===void 0?{}:{lang:r}}}const{piece:n,combo:d}=await this.target(e,i);return{prepared:t,host:n,combo:d}}async source(e){const i=await this.prepared(),t=S(i,e);if(!t)throw new c(h.notFound,`No piece ${e}.`);const s=k(i,t),n={...s.media},d=(r,a)=>`${r}${b(a).slice(l.media.length)}`;return await Promise.all(Object.entries(n).map(async([r,a])=>{let p=a;a.kind==="video"&&a.matte===!0&&(p={...p,matteUrl:d(l.matte,r)}),n[r]=await this.routes.mediaOf(r,p)})),{...s,media:n}}browser(){return this.browserStarted??=m(this.gpu===void 0?{}:{gpu:this.gpu}),this.browserStarted}async withSession(e){this.refuseStopped();let i=this.lease;if(i?.revision!==this.revision){i&&this.retire(i);const t=await this.browser();if(this.refuseStopped(),i=this.lease,i?.revision!==this.revision){i&&this.retire(i);const s={revision:this.revision,session:this.prepared().then(n=>D.open({root:this.root,kinds:this.kinds,browser:t,prepared:n})),users:0,retired:!1};i=s,this.lease=s,s.session.catch(()=>{this.lease===s&&(this.lease=void 0)})}}i.users++;try{return await e(await i.session)}finally{i.users--,i.retired&&i.users===0&&this.end(i)}}refuseStopped(){if(this.closed)throw new c(h.unavailable,"allyhub dev is stopping.")}retire(e){e.retired=!0,this.lease===e&&(this.lease=void 0),this.old.add(e),e.users===0&&this.end(e)}end(e){return e.ended??=(async()=>{this.old.delete(e),await e.session.then(i=>i.close()).catch(()=>{})})(),e.ended}async close(){this.closed=!0;const e=[...this.old,...this.lease?[this.lease]:[]];this.lease&&this.retire(this.lease),await Promise.all(e.map(i=>this.end(i))),await this.browserStarted?.then(i=>i.close()).catch(()=>{}),await this.building,await f(this.buildDir,{recursive:!0,force:!0})}}
2
+ import{rm as f}from"node:fs/promises";import{join as u}from"node:path";import{startBrowser as m}from"@allyhub/browser";import{kindBuildOf as w,mediaHref as b,nodeLending as v,projectItems as g,sourceOf as k,stageItem as S}from"@allyhub/build";import{CACHE_DIR as y}from"@allyhub/formats";import{CheckSession as D,ProjectError as R,pickTarget as E,parseCombo as O}from"@allyhub/project";import{RPC_ERROR as h,RpcError as c,SNAPSHOT_TREE as l}from"@allyhub/protocol";import{prepareStage as $,viewStage as C}from"@allyhub/stage";import{Routes as P}from"./routes.js";export function rpcErrorOf(o){return o instanceof R?new c(o.kind==="not-found"?h.notFound:h.invalid,o.hint?`${o.message} ${o.hint}`:o.message):o}export class Live{root;buildDir;revision=0;prep;last;lease;old=new Set;browserStarted;gpu;building=Promise.resolve();closed=!1;codes=new Map;kinds;routes;constructor(e,i){this.root=e,this.kinds=i.kinds,this.buildDir=u(e,y,"build",`dev-${String(process.pid)}`),this.gpu=i.gpu,this.routes=new P({root:e,kinds:i.kinds,buildDir:this.buildDir,revision:()=>this.revision,prepared:()=>this.prepared(),latest:()=>this.latest(),view:(t,s)=>C(e,t,s,i.kinds),recordInputs:(t,s,n)=>{i.recordInputs?.(t,s,n)}})}moved(e){this.revision=e,this.lease&&this.lease.revision!==e&&this.retire(this.lease)}prepared(){const e=this.revision;if(this.prep?.revision===e)return this.prep.promise;const i=this.building.then(()=>e===this.revision?this.build():void 0);this.building=i.catch(()=>{});const t=i.then(s=>s??this.prepared());return this.prep={revision:e,promise:t},t.catch(()=>{this.prep?.promise===t&&(this.prep=void 0)}),t}async build(){const e=await $(this.root,this.pieceDir,this.kinds);return this.last=e,e}async itemCode(e){const i=await this.item(e),t=i?await w(this.kinds.find(r=>r.id===i.kind))?.catch(()=>{}):void 0,s=t?.code?.bind(t);if(!i||!s)return{failed:!1};const n=this.codes.get(e),d=n?.revision===this.revision?n.promise:v(this.kinds,this.root).then(r=>s(i,{root:this.root,lend:r})).catch(()=>{});return this.codes.set(e,{revision:this.revision,promise:d}),await d??{failed:!0}}async item(e){const{items:i}=await g(this.root,this.kinds);return i.find(t=>t.id===e)}get pieceDir(){return u(this.buildDir,"stage")}latest(){return this.last}async target(e,i){const t=await this.prepared();try{const{piece:s,target:n}=E(t,e,i===void 0?void 0:[O(i)]);return{prepared:t,piece:s,combo:n.combo}}catch(s){throw rpcErrorOf(s)}}async componentHost(e,i){const t=await this.prepared(),s=t.docs.find(r=>r.place===e||r.file===e);if(s){if(s.components.length===0)throw new c(h.notFound,`${s.place} shows no component.`);const r=t.messages.locales[0];return{prepared:t,host:s,combo:r===void 0?{}:{lang:r}}}const{piece:n,combo:d}=await this.target(e,i);return{prepared:t,host:n,combo:d}}async source(e){const i=await this.prepared(),t=S(i,e);if(!t)throw new c(h.notFound,`No piece ${e}.`);const s=k(i,t),n={...s.media},d=(r,a)=>`${r}${b(a).slice(l.media.length)}`;return await Promise.all(Object.entries(n).map(async([r,a])=>{let p=a;a.kind==="video"&&a.matte===!0&&(p={...p,matteUrl:d(l.matte,r)}),n[r]=await this.routes.mediaOf(r,p)})),{...s,media:n}}browser(){return this.refuseStopped(),this.browserStarted??=m(this.gpu===void 0?{}:{gpu:this.gpu}),this.browserStarted}async withSession(e){this.refuseStopped();let i=this.lease;if(i?.revision!==this.revision){i&&this.retire(i);const t=await this.browser();if(this.refuseStopped(),i=this.lease,i?.revision!==this.revision){i&&this.retire(i);const s={revision:this.revision,session:this.prepared().then(n=>D.open({root:this.root,kinds:this.kinds,browser:t,prepared:n})),users:0,retired:!1};i=s,this.lease=s,s.session.catch(()=>{this.lease===s&&(this.lease=void 0)})}}i.users++;try{return await e(await i.session)}finally{i.users--,i.retired&&i.users===0&&this.end(i)}}refuseStopped(){if(this.closed)throw new c(h.unavailable,"allyhub dev is stopping.")}retire(e){e.retired=!0,this.lease===e&&(this.lease=void 0),this.old.add(e),e.users===0&&this.end(e)}end(e){return e.ended??=(async()=>{this.old.delete(e),await e.session.then(i=>i.close()).catch(()=>{})})(),e.ended}async close(){this.closed=!0;const e=[...this.old,...this.lease?[this.lease]:[]];this.lease&&this.retire(this.lease),await Promise.all(e.map(i=>this.end(i))),await this.browserStarted?.then(i=>i.close()).catch(()=>{}),await this.building,await f(this.buildDir,{recursive:!0,force:!0})}}