allyhub 0.18.0 → 0.19.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 (580) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/bin/allyhub.js +10 -0
  3. package/dist/args.js +1 -1
  4. package/dist/command.js +1 -1
  5. package/dist/commands/add.js +1 -1
  6. package/dist/commands/auth.js +1 -1
  7. package/dist/commands/cloud-tools.js +1 -1
  8. package/dist/commands/cloud.js +1 -1
  9. package/dist/commands/contributed.js +1 -1
  10. package/dist/commands/found-extensions.js +2 -0
  11. package/dist/commands/frames/common.js +1 -1
  12. package/dist/commands/frames/doc.js +1 -1
  13. package/dist/commands/frames.js +9 -9
  14. package/dist/commands/index.js +1 -1
  15. package/dist/commands/inspect/common.js +3 -3
  16. package/dist/commands/inspect/index.js +1 -1
  17. package/dist/commands/inspect/layout.js +1 -1
  18. package/dist/commands/inspect/views.js +1 -1
  19. package/dist/commands/list.js +2 -0
  20. package/dist/commands/mail.js +1 -1
  21. package/dist/commands/render.js +1 -1
  22. package/dist/commands/run-context.js +2 -0
  23. package/dist/commands.json +1 -0
  24. package/dist/fields.js +1 -1
  25. package/dist/main.js +7 -7
  26. package/dist/node_modules/@allyhub/3d-extension/dist/build.js +1 -1
  27. package/dist/node_modules/@allyhub/3d-extension/dist/scenery-build.js +1 -1
  28. package/dist/node_modules/@allyhub/3d-extension/package.json +3 -2
  29. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  30. package/dist/node_modules/@allyhub/browser/package.json +1 -1
  31. package/dist/node_modules/@allyhub/build/dist/build-plugins.js +1 -1
  32. package/dist/node_modules/@allyhub/build/dist/index.js +1 -1
  33. package/dist/node_modules/@allyhub/build/dist/meta-worker.js +1 -1
  34. package/dist/node_modules/@allyhub/build/dist/plugin.js +9 -9
  35. package/dist/node_modules/@allyhub/build/dist/prepare.js +3 -3
  36. package/dist/node_modules/@allyhub/build/dist/project-root.js +1 -1
  37. package/dist/node_modules/@allyhub/build/dist/scan.js +1 -1
  38. package/dist/node_modules/@allyhub/build/dist/sdk-parts.js +2 -0
  39. package/dist/node_modules/@allyhub/build/dist/vite.js +2 -2
  40. package/dist/node_modules/@allyhub/build/package.json +9 -1
  41. package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
  42. package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
  43. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  44. package/dist/node_modules/@allyhub/check/dist/check.js +2 -2
  45. package/dist/node_modules/@allyhub/check/package.json +1 -1
  46. package/dist/node_modules/@allyhub/cloud/dist/blobs.js +1 -1
  47. package/dist/node_modules/@allyhub/cloud/dist/call.js +1 -1
  48. package/dist/node_modules/@allyhub/cloud/dist/catalog.js +1 -1
  49. package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
  50. package/dist/node_modules/@allyhub/cloud/dist/config.js +1 -1
  51. package/dist/node_modules/@allyhub/cloud/dist/credentials.js +1 -1
  52. package/dist/node_modules/@allyhub/cloud/dist/device.js +1 -1
  53. package/dist/node_modules/@allyhub/cloud/dist/errors.js +1 -1
  54. package/dist/node_modules/@allyhub/cloud/dist/index.js +1 -1
  55. package/dist/node_modules/@allyhub/cloud/dist/loopback.js +2 -2
  56. package/dist/node_modules/@allyhub/cloud/dist/mail.js +1 -1
  57. package/dist/node_modules/@allyhub/cloud/dist/records.js +1 -1
  58. package/dist/node_modules/@allyhub/cloud/dist/signin.js +2 -2
  59. package/dist/node_modules/@allyhub/cloud/dist/sites.js +1 -1
  60. package/dist/node_modules/@allyhub/cloud/dist/token.js +1 -1
  61. package/dist/node_modules/@allyhub/cloud/dist/tools.js +2 -0
  62. package/dist/node_modules/@allyhub/cloud/dist/uploads.js +1 -1
  63. package/dist/node_modules/@allyhub/cloud/dist/voice.js +1 -1
  64. package/dist/node_modules/@allyhub/cloud/package.json +5 -1
  65. package/dist/node_modules/@allyhub/components/package.json +1 -1
  66. package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
  67. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  68. package/dist/node_modules/@allyhub/doc/package.json +1 -1
  69. package/dist/node_modules/@allyhub/doc-extension/dist/cli/find.js +1 -1
  70. package/dist/node_modules/@allyhub/doc-extension/dist/workspace.js +1 -1
  71. package/dist/node_modules/@allyhub/doc-extension/package.json +1 -1
  72. package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
  73. package/dist/node_modules/@allyhub/export/package.json +1 -1
  74. package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
  75. package/dist/node_modules/@allyhub/extension-host/dist/points.js +1 -1
  76. package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
  77. package/dist/node_modules/@allyhub/formats/dist/items.d.ts +24 -7
  78. package/dist/node_modules/@allyhub/formats/dist/items.js +1 -1
  79. package/dist/node_modules/@allyhub/formats/dist/note-shape.d.ts +1 -1
  80. package/dist/node_modules/@allyhub/formats/package.json +25 -1
  81. package/dist/node_modules/@allyhub/html-extension/package.json +1 -1
  82. package/dist/node_modules/@allyhub/i18n/package.json +1 -1
  83. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  84. package/dist/node_modules/@allyhub/image-extension/package.json +1 -1
  85. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  86. package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
  87. package/dist/node_modules/@allyhub/image-render/package.json +1 -1
  88. package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
  89. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  90. package/dist/node_modules/@allyhub/jobs/package.json +1 -1
  91. package/dist/node_modules/@allyhub/linkedin-extension/package.json +1 -1
  92. package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
  93. package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
  94. package/dist/node_modules/@allyhub/linkedin-view/src/style.css +1 -600
  95. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  96. package/dist/node_modules/@allyhub/media/package.json +5 -1
  97. package/dist/node_modules/@allyhub/media-extension/dist/asr/hear.js +1 -1
  98. package/dist/node_modules/@allyhub/media-extension/dist/vision/track.js +1 -1
  99. package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
  100. package/dist/node_modules/@allyhub/model/package.json +1 -1
  101. package/dist/node_modules/@allyhub/office-extension/package.json +1 -1
  102. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  103. package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +1 -2
  104. package/dist/node_modules/@allyhub/piece/dist/media.d.ts +1 -1
  105. package/dist/node_modules/@allyhub/piece/dist/source.d.ts +2 -2
  106. package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +2 -2
  107. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  108. package/dist/node_modules/@allyhub/project/package.json +1 -1
  109. package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
  110. package/dist/node_modules/@allyhub/protocol/dist/blobs.js +1 -1
  111. package/dist/node_modules/@allyhub/protocol/dist/cli.js +1 -1
  112. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  113. package/dist/node_modules/@allyhub/protocol/dist/errors.js +1 -1
  114. package/dist/node_modules/@allyhub/protocol/dist/events.js +1 -1
  115. package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
  116. package/dist/node_modules/@allyhub/protocol/dist/jsonrpc.js +1 -1
  117. package/dist/node_modules/@allyhub/protocol/dist/kinds.js +1 -1
  118. package/dist/node_modules/@allyhub/protocol/dist/mail.js +1 -1
  119. package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
  120. package/dist/node_modules/@allyhub/protocol/dist/paywall.js +1 -1
  121. package/dist/node_modules/@allyhub/protocol/dist/purposes.js +1 -1
  122. package/dist/node_modules/@allyhub/protocol/dist/registry.js +1 -1
  123. package/dist/node_modules/@allyhub/protocol/dist/sites.js +1 -1
  124. package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
  125. package/dist/node_modules/@allyhub/protocol/dist/teams.js +1 -1
  126. package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
  127. package/dist/node_modules/@allyhub/protocol/package.json +41 -1
  128. package/dist/node_modules/@allyhub/registry/package.json +1 -1
  129. package/dist/node_modules/@allyhub/render/dist/errors.js +1 -1
  130. package/dist/node_modules/@allyhub/render/dist/post-probe.js +1 -1
  131. package/dist/node_modules/@allyhub/render/package.json +9 -1
  132. package/dist/node_modules/@allyhub/runtime/package.json +1 -1
  133. package/dist/node_modules/@allyhub/runtimes/dist/bundled.js +1 -1
  134. package/dist/node_modules/@allyhub/runtimes/dist/declared.js +1 -1
  135. package/dist/node_modules/@allyhub/runtimes/dist/index.js +1 -1
  136. package/dist/node_modules/@allyhub/runtimes/dist/manifest.js +1 -1
  137. package/dist/node_modules/@allyhub/runtimes/dist/runtimes.js +1 -1
  138. package/dist/node_modules/@allyhub/runtimes/package.json +9 -1
  139. package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
  140. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  141. package/dist/node_modules/@allyhub/scenery-host/dist/bundle.js +3 -3
  142. package/dist/node_modules/@allyhub/scenery-host/dist/fact.d.ts +1 -1
  143. package/dist/node_modules/@allyhub/scenery-host/dist/model-stage.js +2 -2
  144. package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
  145. package/dist/node_modules/@allyhub/sheet/dist/annotations.js +1 -1
  146. package/dist/node_modules/@allyhub/sheet/dist/api/workbook.js +1 -1
  147. package/dist/node_modules/@allyhub/sheet/dist/arrange.js +1 -1
  148. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
  149. package/dist/node_modules/@allyhub/sheet/dist/filter.js +1 -1
  150. package/dist/node_modules/@allyhub/sheet/dist/generated.js +1 -1
  151. package/dist/node_modules/@allyhub/sheet/dist/html.js +6 -6
  152. package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
  153. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  154. package/dist/node_modules/@allyhub/sheet-extension/dist/cli/open.js +1 -1
  155. package/dist/node_modules/@allyhub/sheet-extension/dist/code.js +1 -1
  156. package/dist/node_modules/@allyhub/sheet-extension/dist/export.js +2 -2
  157. package/dist/node_modules/@allyhub/sheet-extension/package.json +1 -1
  158. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  159. package/dist/node_modules/@allyhub/slides-extension/package.json +1 -1
  160. package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
  161. package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
  162. package/dist/node_modules/@allyhub/stage/package.json +1 -1
  163. package/dist/node_modules/@allyhub/stage-page/dist/fonts/arimo/400-italic.css +1 -79
  164. package/dist/node_modules/@allyhub/stage-page/dist/fonts/arimo/400.css +1 -79
  165. package/dist/node_modules/@allyhub/stage-page/dist/fonts/arimo/700-italic.css +1 -79
  166. package/dist/node_modules/@allyhub/stage-page/dist/fonts/arimo/700.css +1 -79
  167. package/dist/node_modules/@allyhub/stage-page/dist/fonts/arimo/arial.css +1 -316
  168. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400-italic.css +1 -19
  169. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400.css +1 -19
  170. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700-italic.css +1 -19
  171. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700.css +1 -19
  172. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/cambria.css +1 -76
  173. package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/400-italic.css +1 -69
  174. package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/400.css +1 -69
  175. package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/700-italic.css +1 -69
  176. package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/700.css +1 -69
  177. package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/calibri.css +1 -276
  178. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400-italic.css +1 -79
  179. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400.css +1 -79
  180. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700-italic.css +1 -79
  181. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700.css +1 -79
  182. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/courier-new.css +1 -316
  183. package/dist/node_modules/@allyhub/stage-page/dist/fonts/noto-color-emoji/emoji.css +1 -8
  184. package/dist/node_modules/@allyhub/stage-page/dist/fonts/noto-sans-sc/400.css +1 -1009
  185. package/dist/node_modules/@allyhub/stage-page/dist/fonts/noto-sans-sc/700.css +1 -1009
  186. package/dist/node_modules/@allyhub/stage-page/dist/fonts/noto-sans-sc/microsoft-yahei.css +1 -2018
  187. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400-italic.css +1 -79
  188. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400.css +1 -79
  189. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700-italic.css +1 -79
  190. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700.css +1 -79
  191. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/times-new-roman.css +1 -316
  192. package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
  193. package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
  194. package/dist/node_modules/@allyhub/telemetry/dist/doc.js +1 -1
  195. package/dist/node_modules/@allyhub/telemetry/dist/errors.js +1 -1
  196. package/dist/node_modules/@allyhub/telemetry/dist/telemetry.js +2 -2
  197. package/dist/node_modules/@allyhub/telemetry/package.json +1 -1
  198. package/dist/node_modules/@allyhub/text-extension/package.json +1 -1
  199. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  200. package/dist/node_modules/@allyhub/video-extension/dist/build-plugins.js +1 -1
  201. package/dist/node_modules/@allyhub/video-extension/package.json +6 -2
  202. package/dist/node_modules/@allyhub/video-measure/dist/plans.js +2 -2
  203. package/dist/node_modules/@allyhub/video-measure/dist/reference/video.js +1 -1
  204. package/dist/node_modules/@allyhub/video-measure/package.json +5 -1
  205. package/dist/node_modules/@allyhub/video-sdk/dist/config.js +2 -0
  206. package/dist/node_modules/@allyhub/video-sdk/dist/piece.js +1 -1
  207. package/dist/node_modules/@allyhub/video-sdk/package.json +5 -1
  208. package/dist/node_modules/@allyhub/website/package.json +1 -1
  209. package/dist/node_modules/@allyhub/website-extension/dist/build.js +1 -1
  210. package/dist/node_modules/@allyhub/website-extension/package.json +4 -4
  211. package/dist/node_modules/@allyhub/x-extension/dist/build.js +1 -1
  212. package/dist/node_modules/@allyhub/x-extension/package.json +8 -2
  213. package/dist/node_modules/@allyhub/x-model/package.json +1 -1
  214. package/dist/node_modules/@allyhub/x-view/package.json +1 -1
  215. package/dist/node_modules/@allyhub/x-view/src/style.css +1 -709
  216. package/dist/package.json +14 -14
  217. package/dist/project.js +1 -1
  218. package/dist/resources.js +1 -1
  219. package/dist/sdk-docs.js +1 -1
  220. package/dist/slot.js +4 -0
  221. package/dist/telemetry.js +1 -1
  222. package/dist/version.js +1 -1
  223. package/editor-web/assets/{abnfDiagram-WEYOIA3C-Hy4-O0wN.js → abnfDiagram-WEYOIA3C-DYaMS_BB.js} +1 -1
  224. package/editor-web/assets/{architecture-WOLXFQ4H-43JEVxqz.js → architecture-WOLXFQ4H-g_Tjfl_y.js} +1 -1
  225. package/editor-web/assets/{architectureDiagram-ZHVYKT53-7bFTl41n.js → architectureDiagram-ZHVYKT53-CqdhofOL.js} +1 -1
  226. package/editor-web/assets/{article-CS48wwvk.js → article-8evPh712.js} +1 -1
  227. package/editor-web/assets/{article-Cyle57uq.js → article-BhRtWYMd.js} +1 -1
  228. package/editor-web/assets/{blockDiagram-RJAE7QA3-DcoNo1WH.js → blockDiagram-RJAE7QA3-Bc-28Bci.js} +1 -1
  229. package/editor-web/assets/{c4Diagram-XDPPPE54-CsMt61gx.js → c4Diagram-XDPPPE54-CTGJb8FB.js} +1 -1
  230. package/editor-web/assets/{calc-worker-BdHh5LXM.js → calc-worker-oEIqrrTM.js} +1 -1
  231. package/editor-web/assets/channel-wIj_OqDm.js +1 -0
  232. package/editor-web/assets/{chart-file-CfbWK9l1.js → chart-file-dGiRgFcH.js} +1 -1
  233. package/editor-web/assets/{chunk-2E7WHVMD-fj-TJIRG.js → chunk-2E7WHVMD-B2MPOVTU.js} +1 -1
  234. package/editor-web/assets/{chunk-4EMNKR2T-Du5cRy-Y.js → chunk-4EMNKR2T-BUV1ZHP0.js} +1 -1
  235. package/editor-web/assets/{chunk-55XCU76K-BHXxBBtm.js → chunk-55XCU76K-BZlpspL5.js} +1 -1
  236. package/editor-web/assets/{chunk-7S6XSTFO-R5HW6X5I.js → chunk-7S6XSTFO-CpKeisWE.js} +1 -1
  237. package/editor-web/assets/{chunk-AQDTSKZB-C98F2BUb.js → chunk-AQDTSKZB-BJqwAPyo.js} +1 -1
  238. package/editor-web/assets/{chunk-DSNLSHJZ-NIGsJ2cK.js → chunk-DSNLSHJZ-D6oPWl_W.js} +1 -1
  239. package/editor-web/assets/{chunk-HAGFOTED-BtHxtfW5.js → chunk-HAGFOTED-B5pk4MZF.js} +1 -1
  240. package/editor-web/assets/{chunk-HNE4Q36P-BI8i7Vkk.js → chunk-HNE4Q36P-DHbSPvxQ.js} +1 -1
  241. package/editor-web/assets/{chunk-NQOKRVIF-DP_Z_zEA.js → chunk-NQOKRVIF-CcL_GcRA.js} +1 -1
  242. package/editor-web/assets/{chunk-UHW7PFBP-C_8bui28.js → chunk-UHW7PFBP-YgiOL6XE.js} +1 -1
  243. package/editor-web/assets/{chunk-VQ5W62QI-CKZgzWB2.js → chunk-VQ5W62QI-p14b4UYc.js} +1 -1
  244. package/editor-web/assets/{chunk-WQQL4CDK-Ff4DgCht.js → chunk-WQQL4CDK-BWW0x-XH.js} +1 -1
  245. package/editor-web/assets/{chunk-YZO67HFG-Csbx1-pi.js → chunk-YZO67HFG-oG3qd68C.js} +1 -1
  246. package/editor-web/assets/{chunk-ZAUX2LTX-BO1kcV3w.js → chunk-ZAUX2LTX-CpcheH0u.js} +1 -1
  247. package/editor-web/assets/{chunk-ZCHMQSOR-CxeNZYZG.js → chunk-ZCHMQSOR-cWQvLl1w.js} +1 -1
  248. package/editor-web/assets/{classDiagram-v2-4MYWR3UA-D8eHQa5i.js → classDiagram-v2-4MYWR3UA-7PG7YcdU.js} +1 -1
  249. package/editor-web/assets/{cynefin-EF2NZ3EQ-lIUY3WQQ.js → cynefin-EF2NZ3EQ-CtcknEQ_.js} +1 -1
  250. package/editor-web/assets/{cynefinDiagram-WF24UDRP-CFOOhEEs.js → cynefinDiagram-WF24UDRP-Ca7VIsjN.js} +1 -1
  251. package/editor-web/assets/{dagre-NK4GIZVX-DdHVup2I.js → dagre-NK4GIZVX-BzcSLtsr.js} +1 -1
  252. package/editor-web/assets/deck-C7fN0Qtn.js +1 -0
  253. package/editor-web/assets/{diagram-CBK3MWTC-CFAD9Y2B.js → diagram-CBK3MWTC-DpRmTGlG.js} +1 -1
  254. package/editor-web/assets/{diagram-I5XIIV2D-DZJAn95A.js → diagram-I5XIIV2D-BTrs_AX8.js} +1 -1
  255. package/editor-web/assets/{diagram-ODIL2UCW-BcIeYTaY.js → diagram-ODIL2UCW-CkIVjPqH.js} +1 -1
  256. package/editor-web/assets/{diagram-PFBEJUXE-CnZmh_fl.js → diagram-PFBEJUXE-BlFMbAG1.js} +1 -1
  257. package/editor-web/assets/{diagram-RJA3I4VV-DpDd9rGx.js → diagram-RJA3I4VV-D3f8VJ-D.js} +1 -1
  258. package/editor-web/assets/{diagram-TYUNFSNR-ouGiUQcR.js → diagram-TYUNFSNR-Bbpngj6F.js} +1 -1
  259. package/editor-web/assets/{dist-DGKjn59H.js → dist-3iovns9K.js} +1 -1
  260. package/editor-web/assets/dist-BkHnbOEj.js +4 -0
  261. package/editor-web/assets/dist-BvOrNcK-.js +19 -0
  262. package/editor-web/assets/dist-CEIszq39.js +1 -0
  263. package/editor-web/assets/{dist-BI8QjOsV.js → dist-CU5RbLNH.js} +1 -1
  264. package/editor-web/assets/dist-CWZj8IAm.js +1 -0
  265. package/editor-web/assets/{dist-NQNQ5HqZ.js → dist-C_Mtrnif.js} +3 -3
  266. package/editor-web/assets/{dist-BajH5QfK.js → dist-CdqpwdCV.js} +4 -4
  267. package/editor-web/assets/{dist-SV0sOVIC.js → dist-CjT76RAw.js} +1 -1
  268. package/editor-web/assets/{dist-elglzHMT.js → dist-CpzEn9T8.js} +1 -1
  269. package/editor-web/assets/dist-CrFYWl5-.js +3 -0
  270. package/editor-web/assets/{dist-hHcrvNn9.js → dist-D4eBFGVL.js} +1 -1
  271. package/editor-web/assets/dist-DTcjb3cP.js +18 -0
  272. package/editor-web/assets/dist-D_WSM29I.js +17 -0
  273. package/editor-web/assets/{dist-Y_XZZa8q.js → dist-Dp_9ISjP.js} +10 -10
  274. package/editor-web/assets/{dist-BBshIz1Q.js → dist-J-tPYKGS.js} +4 -4
  275. package/editor-web/assets/{docx-draw-C4aiB8HI.js → docx-draw-CoK1oqQD.js} +1 -1
  276. package/editor-web/assets/{ebnfDiagram-V4P3TTPT-HRjVlbUf.js → ebnfDiagram-V4P3TTPT-BaKj-yL6.js} +1 -1
  277. package/editor-web/assets/{elk-QONTBCTQ-BFmtKyOf.js → elk-QONTBCTQ-Cn2qv1_U.js} +1 -1
  278. package/editor-web/assets/{erDiagram-KYQIGQAA-C9gcGEgK.js → erDiagram-KYQIGQAA-Bd7AEIDo.js} +1 -1
  279. package/editor-web/assets/{esm-DzxAod8Q.js → esm-Cjv8ogpP.js} +1 -1
  280. package/editor-web/assets/{eventmodeling-K75KTNOO-Bpma5Bdb.js → eventmodeling-K75KTNOO-Sfp7_461.js} +1 -1
  281. package/editor-web/assets/flowDiagram-IUGLLWBU-BlVUglzw.js +1 -0
  282. package/editor-web/assets/{ganttDiagram-R7GPNTJY-CE5ut4C3.js → ganttDiagram-R7GPNTJY-CBqcGdHI.js} +1 -1
  283. package/editor-web/assets/{gitGraph-VSP46ZUC-Dva3iGx2.js → gitGraph-VSP46ZUC-WTokXKTW.js} +1 -1
  284. package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-CJXFsAWp.js → gitGraphDiagram-PDYL7XHY-BIWZHD9q.js} +1 -1
  285. package/editor-web/assets/index-BQWZnyAQ.js +28 -0
  286. package/editor-web/assets/{info-OHQRW6UA-BY0AOfex.js → info-OHQRW6UA-COC6G-_J.js} +1 -1
  287. package/editor-web/assets/{infoDiagram-MVDRKAX5-4Up1gMvC.js → infoDiagram-MVDRKAX5-DpaqdKBD.js} +1 -1
  288. package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-BkvB9Qbn.js → ishikawaDiagram-HPEHV2GE-Dyn2MAy1.js} +1 -1
  289. package/editor-web/assets/{iso-ahTwmFwH.js → iso-DoC-ZoBr.js} +1 -1
  290. package/editor-web/assets/{journeyDiagram-BOSHW7O7-BxV09WdR.js → journeyDiagram-BOSHW7O7-DeSVfmm7.js} +1 -1
  291. package/editor-web/assets/{kanban-definition-FNSA4HC5-zTJtIDPG.js → kanban-definition-FNSA4HC5-Bfg0lj7B.js} +1 -1
  292. package/editor-web/assets/{mermaid-parser.core-BWT9UQh_.js → mermaid-parser.core-CyhovuYE.js} +3 -3
  293. package/editor-web/assets/{mermaid.core-DFf_Vg5X.js → mermaid.core-Dx1fBVUG.js} +4 -4
  294. package/editor-web/assets/{mindmap-definition-6OY57UG3-BYexiugS.js → mindmap-definition-6OY57UG3-QEU2HF_m.js} +1 -1
  295. package/editor-web/assets/{packet-JDAUHWVQ-DX_kSrI6.js → packet-JDAUHWVQ-ReJTa_hw.js} +1 -1
  296. package/editor-web/assets/{pegDiagram-ECIUJNBX-I3SrcMLp.js → pegDiagram-ECIUJNBX-Bo1jFrvb.js} +1 -1
  297. package/editor-web/assets/{pie-XZMESJXO-BmAFSw3E.js → pie-XZMESJXO-BrtYafNA.js} +1 -1
  298. package/editor-web/assets/{pieDiagram-GNMPY74T-DIZKcme5.js → pieDiagram-GNMPY74T-Cj0zQqs_.js} +1 -1
  299. package/editor-web/assets/{props-form-DUFxM5eb.js → props-form-BpSXbrSF.js} +1 -1
  300. package/editor-web/assets/{quadrantDiagram-D57K4MC3-CO3oSqpQ.js → quadrantDiagram-D57K4MC3-D5npDAVn.js} +1 -1
  301. package/editor-web/assets/{radar-ABXABTNO-D5CkFrrb.js → radar-ABXABTNO-C8RDrRqi.js} +1 -1
  302. package/editor-web/assets/{railroad-I3PHUGI6-BeKY1p0K.js → railroad-I3PHUGI6-ebDrmYTK.js} +1 -1
  303. package/editor-web/assets/{railroad-abnf-LNEFI6M7-CIYV9_3-.js → railroad-abnf-LNEFI6M7-BxKuqg6V.js} +1 -1
  304. package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-DN0zDl6d.js → railroad-ebnf-DWYD2UWJ-DOclnfpr.js} +1 -1
  305. package/editor-web/assets/{railroad-peg-JR7BVNR7-Bd_GcO24.js → railroad-peg-JR7BVNR7-DN0A1fpq.js} +1 -1
  306. package/editor-web/assets/{railroadDiagram-Y72NRBL7-DlFoiMhb.js → railroadDiagram-Y72NRBL7-B3PjoVWw.js} +1 -1
  307. package/editor-web/assets/{requirementDiagram-EQYSW5RA-LWAEz8Gy.js → requirementDiagram-EQYSW5RA-DLdzkQk5.js} +1 -1
  308. package/editor-web/assets/{sankeyDiagram-SY24JHO5-B_pZGwUK.js → sankeyDiagram-SY24JHO5-Dip4Piv_.js} +1 -1
  309. package/editor-web/assets/schemas-CQ_UU8-Z.js +1 -0
  310. package/editor-web/assets/{sequenceDiagram-BLEHNHQU-bNhyCq0C.js → sequenceDiagram-BLEHNHQU-QnPcoybL.js} +1 -1
  311. package/editor-web/assets/{session-Beijw9EK.js → session-DMlLCFWg.js} +1 -1
  312. package/editor-web/assets/slides-7xWhREpt.js +1 -0
  313. package/editor-web/assets/snapshots-BLX4NTQC.js +1 -0
  314. package/editor-web/assets/{split-zARio3J8.js → split-tFGKk-x8.js} +1 -1
  315. package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-DI-oM3qz.js → stateDiagram-v2-A6IESKWZ-D103CiMX.js} +1 -1
  316. package/editor-web/assets/{swimlanes-B3ENRKFQ-awDmoLdW.js → swimlanes-B3ENRKFQ-y4gCqEoa.js} +1 -1
  317. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-DKzB_wSf.js +8 -0
  318. package/editor-web/assets/{tabs-BHBvbekZ.js → tabs-CuEawka3.js} +1 -1
  319. package/editor-web/assets/{timeline-definition-JXYKGLGB-CayduPvL.js → timeline-definition-JXYKGLGB-BMp76v4V.js} +1 -1
  320. package/editor-web/assets/{treeView-D4JQ5SDB-BVEuNzCO.js → treeView-D4JQ5SDB-Q_GYyk0b.js} +1 -1
  321. package/editor-web/assets/{treemap-SAJKECNS-BOB14HP3.js → treemap-SAJKECNS-B5lRWdQB.js} +1 -1
  322. package/editor-web/assets/{usecaseDiagram-WPOLBNNX-DxT99uaq.js → usecaseDiagram-WPOLBNNX--QRllA-U.js} +1 -1
  323. package/editor-web/assets/{vennDiagram-Q3Y3IDCW-CWUKom-r.js → vennDiagram-Q3Y3IDCW-CzkATPA3.js} +1 -1
  324. package/editor-web/assets/{video-oJ3qa1Qv.js → video-D0uTbHWx.js} +1 -1
  325. package/editor-web/assets/{wardley-7MLQ67FV-BAQyTneD.js → wardley-7MLQ67FV-BXzwcdJa.js} +1 -1
  326. package/editor-web/assets/{wardleyDiagram-IVAIDKWA-CiIYz4lZ.js → wardleyDiagram-IVAIDKWA-BQvC8Agx.js} +1 -1
  327. package/editor-web/assets/{words-0Ww2RyT4.js → words-CaUHhQHf.js} +1 -1
  328. package/editor-web/assets/workbook-CiCXkjmN.js +45 -0
  329. package/editor-web/assets/{xychartDiagram-4URNHDU4-D_D5IGmd.js → xychartDiagram-4URNHDU4-aY-lsD5o.js} +1 -1
  330. package/editor-web/index.html +3 -3
  331. package/package.json +2 -2
  332. package/dist/node_modules/@allyhub/browser/dist/browser.d.ts +0 -24
  333. package/dist/node_modules/@allyhub/browser/dist/capture.d.ts +0 -61
  334. package/dist/node_modules/@allyhub/browser/dist/cdp.d.ts +0 -51
  335. package/dist/node_modules/@allyhub/browser/dist/emoji.d.ts +0 -29
  336. package/dist/node_modules/@allyhub/browser/dist/flags.d.ts +0 -13
  337. package/dist/node_modules/@allyhub/browser/dist/frames.d.ts +0 -35
  338. package/dist/node_modules/@allyhub/browser/dist/html.d.ts +0 -19
  339. package/dist/node_modules/@allyhub/browser/dist/index.d.ts +0 -10
  340. package/dist/node_modules/@allyhub/browser/dist/launch.d.ts +0 -35
  341. package/dist/node_modules/@allyhub/browser/dist/page.d.ts +0 -74
  342. package/dist/node_modules/@allyhub/browser/dist/picture.d.ts +0 -18
  343. package/dist/node_modules/@allyhub/browser/dist/server.d.ts +0 -26
  344. package/dist/node_modules/@allyhub/build/dist/build-plugins.d.ts +0 -91
  345. package/dist/node_modules/@allyhub/build/dist/cli-command.d.ts +0 -84
  346. package/dist/node_modules/@allyhub/build/dist/code.d.ts +0 -26
  347. package/dist/node_modules/@allyhub/build/dist/content.d.ts +0 -64
  348. package/dist/node_modules/@allyhub/build/dist/data.d.ts +0 -11
  349. package/dist/node_modules/@allyhub/build/dist/evaluate.d.ts +0 -44
  350. package/dist/node_modules/@allyhub/build/dist/file-check.d.ts +0 -35
  351. package/dist/node_modules/@allyhub/build/dist/files.d.ts +0 -4
  352. package/dist/node_modules/@allyhub/build/dist/fonts.d.ts +0 -26
  353. package/dist/node_modules/@allyhub/build/dist/generated.d.ts +0 -29
  354. package/dist/node_modules/@allyhub/build/dist/imports.d.ts +0 -17
  355. package/dist/node_modules/@allyhub/build/dist/index.d.ts +0 -37
  356. package/dist/node_modules/@allyhub/build/dist/inspect-view.d.ts +0 -119
  357. package/dist/node_modules/@allyhub/build/dist/kind-build.d.ts +0 -530
  358. package/dist/node_modules/@allyhub/build/dist/made-notes.d.ts +0 -9
  359. package/dist/node_modules/@allyhub/build/dist/matrix.d.ts +0 -19
  360. package/dist/node_modules/@allyhub/build/dist/media.d.ts +0 -10
  361. package/dist/node_modules/@allyhub/build/dist/messages.d.ts +0 -60
  362. package/dist/node_modules/@allyhub/build/dist/meta-worker.d.ts +0 -59
  363. package/dist/node_modules/@allyhub/build/dist/meta.d.ts +0 -24
  364. package/dist/node_modules/@allyhub/build/dist/model-info.d.ts +0 -6
  365. package/dist/node_modules/@allyhub/build/dist/move-refs.d.ts +0 -16
  366. package/dist/node_modules/@allyhub/build/dist/places.d.ts +0 -23
  367. package/dist/node_modules/@allyhub/build/dist/plugin.d.ts +0 -50
  368. package/dist/node_modules/@allyhub/build/dist/prepare.d.ts +0 -138
  369. package/dist/node_modules/@allyhub/build/dist/project-root.d.ts +0 -19
  370. package/dist/node_modules/@allyhub/build/dist/project-tool.d.ts +0 -136
  371. package/dist/node_modules/@allyhub/build/dist/references.d.ts +0 -6
  372. package/dist/node_modules/@allyhub/build/dist/scan.d.ts +0 -45
  373. package/dist/node_modules/@allyhub/build/dist/stage-route.d.ts +0 -80
  374. package/dist/node_modules/@allyhub/build/dist/takes.d.ts +0 -9
  375. package/dist/node_modules/@allyhub/build/dist/types.d.ts +0 -11
  376. package/dist/node_modules/@allyhub/build/dist/uses.d.ts +0 -44
  377. package/dist/node_modules/@allyhub/build/dist/version.d.ts +0 -56
  378. package/dist/node_modules/@allyhub/build/dist/vite.d.ts +0 -115
  379. package/dist/node_modules/@allyhub/build/dist/work.d.ts +0 -38
  380. package/dist/node_modules/@allyhub/cloud/dist/blobs.d.ts +0 -48
  381. package/dist/node_modules/@allyhub/cloud/dist/call.d.ts +0 -91
  382. package/dist/node_modules/@allyhub/cloud/dist/catalog.d.ts +0 -12
  383. package/dist/node_modules/@allyhub/cloud/dist/client.d.ts +0 -64
  384. package/dist/node_modules/@allyhub/cloud/dist/config.d.ts +0 -40
  385. package/dist/node_modules/@allyhub/cloud/dist/credentials.d.ts +0 -76
  386. package/dist/node_modules/@allyhub/cloud/dist/device.d.ts +0 -14
  387. package/dist/node_modules/@allyhub/cloud/dist/errors.d.ts +0 -24
  388. package/dist/node_modules/@allyhub/cloud/dist/hashes.d.ts +0 -43
  389. package/dist/node_modules/@allyhub/cloud/dist/index.d.ts +0 -19
  390. package/dist/node_modules/@allyhub/cloud/dist/keychain.d.ts +0 -18
  391. package/dist/node_modules/@allyhub/cloud/dist/loopback.d.ts +0 -22
  392. package/dist/node_modules/@allyhub/cloud/dist/mail.d.ts +0 -16
  393. package/dist/node_modules/@allyhub/cloud/dist/pkce.d.ts +0 -11
  394. package/dist/node_modules/@allyhub/cloud/dist/records.d.ts +0 -42
  395. package/dist/node_modules/@allyhub/cloud/dist/signin-worker.d.ts +0 -2
  396. package/dist/node_modules/@allyhub/cloud/dist/signin.d.ts +0 -48
  397. package/dist/node_modules/@allyhub/cloud/dist/sites.d.ts +0 -20
  398. package/dist/node_modules/@allyhub/cloud/dist/token.d.ts +0 -20
  399. package/dist/node_modules/@allyhub/cloud/dist/uploads.d.ts +0 -58
  400. package/dist/node_modules/@allyhub/cloud/dist/voice.d.ts +0 -22
  401. package/dist/node_modules/@allyhub/jobs/dist/index.d.ts +0 -3
  402. package/dist/node_modules/@allyhub/jobs/dist/jobs.d.ts +0 -139
  403. package/dist/node_modules/@allyhub/jobs/dist/show.d.ts +0 -41
  404. package/dist/node_modules/@allyhub/measure/dist/compare.d.ts +0 -195
  405. package/dist/node_modules/@allyhub/measure/dist/grain.d.ts +0 -8
  406. package/dist/node_modules/@allyhub/measure/dist/image.d.ts +0 -16
  407. package/dist/node_modules/@allyhub/measure/dist/index.d.ts +0 -4
  408. package/dist/node_modules/@allyhub/media/dist/analysis.d.ts +0 -25
  409. package/dist/node_modules/@allyhub/media/dist/audio.d.ts +0 -16
  410. package/dist/node_modules/@allyhub/media/dist/beats.d.ts +0 -100
  411. package/dist/node_modules/@allyhub/media/dist/cache.d.ts +0 -26
  412. package/dist/node_modules/@allyhub/media/dist/errors.d.ts +0 -34
  413. package/dist/node_modules/@allyhub/media/dist/fetch.d.ts +0 -11
  414. package/dist/node_modules/@allyhub/media/dist/grid.d.ts +0 -101
  415. package/dist/node_modules/@allyhub/media/dist/index.d.ts +0 -21
  416. package/dist/node_modules/@allyhub/media/dist/picture.d.ts +0 -130
  417. package/dist/node_modules/@allyhub/media/dist/probe.d.ts +0 -52
  418. package/dist/node_modules/@allyhub/media/dist/progress.d.ts +0 -16
  419. package/dist/node_modules/@allyhub/media/dist/run.d.ts +0 -25
  420. package/dist/node_modules/@allyhub/media/dist/sheet.d.ts +0 -67
  421. package/dist/node_modules/@allyhub/media/dist/shots.d.ts +0 -110
  422. package/dist/node_modules/@allyhub/media/dist/sync.d.ts +0 -156
  423. package/dist/node_modules/@allyhub/media/dist/tools.d.ts +0 -25
  424. package/dist/node_modules/@allyhub/media/dist/video.d.ts +0 -35
  425. package/dist/node_modules/@allyhub/media/dist/vision/cache.d.ts +0 -42
  426. package/dist/node_modules/@allyhub/media/dist/vision/probe.d.ts +0 -39
  427. package/dist/node_modules/@allyhub/media/dist/vision/types.d.ts +0 -2
  428. package/dist/node_modules/@allyhub/media/dist/voice-shape.d.ts +0 -51
  429. package/dist/node_modules/@allyhub/model/dist/authoring.d.ts +0 -48
  430. package/dist/node_modules/@allyhub/model/dist/bevel-attributes.d.ts +0 -19
  431. package/dist/node_modules/@allyhub/model/dist/bevel-collapse.d.ts +0 -12
  432. package/dist/node_modules/@allyhub/model/dist/bevel-corner-plan.d.ts +0 -24
  433. package/dist/node_modules/@allyhub/model/dist/bevel-deform.d.ts +0 -5
  434. package/dist/node_modules/@allyhub/model/dist/bevel-fans.d.ts +0 -12
  435. package/dist/node_modules/@allyhub/model/dist/bevel-junction.d.ts +0 -16
  436. package/dist/node_modules/@allyhub/model/dist/bevel-marks.d.ts +0 -14
  437. package/dist/node_modules/@allyhub/model/dist/bevel-metric.d.ts +0 -4
  438. package/dist/node_modules/@allyhub/model/dist/bevel-mixed.d.ts +0 -12
  439. package/dist/node_modules/@allyhub/model/dist/bevel-offsets.d.ts +0 -22
  440. package/dist/node_modules/@allyhub/model/dist/bevel-patch.d.ts +0 -45
  441. package/dist/node_modules/@allyhub/model/dist/bevel-profile.d.ts +0 -13
  442. package/dist/node_modules/@allyhub/model/dist/bevel-projection.d.ts +0 -10
  443. package/dist/node_modules/@allyhub/model/dist/bevel-reflex.d.ts +0 -10
  444. package/dist/node_modules/@allyhub/model/dist/bevel-square-out.d.ts +0 -18
  445. package/dist/node_modules/@allyhub/model/dist/bevel-strips.d.ts +0 -8
  446. package/dist/node_modules/@allyhub/model/dist/bmesh-cycles.d.ts +0 -52
  447. package/dist/node_modules/@allyhub/model/dist/build-cache.d.ts +0 -42
  448. package/dist/node_modules/@allyhub/model/dist/build-job.d.ts +0 -34
  449. package/dist/node_modules/@allyhub/model/dist/build-worker.d.ts +0 -2
  450. package/dist/node_modules/@allyhub/model/dist/build.d.ts +0 -67
  451. package/dist/node_modules/@allyhub/model/dist/cancel.d.ts +0 -8
  452. package/dist/node_modules/@allyhub/model/dist/curve-math.d.ts +0 -21
  453. package/dist/node_modules/@allyhub/model/dist/curve-mesh.d.ts +0 -30
  454. package/dist/node_modules/@allyhub/model/dist/evaluation-guard.d.ts +0 -11
  455. package/dist/node_modules/@allyhub/model/dist/export.d.ts +0 -12
  456. package/dist/node_modules/@allyhub/model/dist/mesh-queries.d.ts +0 -34
  457. package/dist/node_modules/@allyhub/model/dist/names.d.ts +0 -9
  458. package/dist/node_modules/@allyhub/model/dist/png.d.ts +0 -12
  459. package/dist/node_modules/@allyhub/model/dist/polygon-triangulation.d.ts +0 -4
  460. package/dist/node_modules/@allyhub/model/dist/program-location.d.ts +0 -7
  461. package/dist/node_modules/@allyhub/model/dist/report.d.ts +0 -70
  462. package/dist/node_modules/@allyhub/piece/dist/page/console.d.ts +0 -21
  463. package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +0 -4
  464. package/dist/node_modules/@allyhub/piece/dist/page/locate.d.ts +0 -17
  465. package/dist/node_modules/@allyhub/piece/dist/page/runtimes.d.ts +0 -9
  466. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +0 -661
  467. package/dist/node_modules/@allyhub/protocol/dist/account.js +0 -2
  468. package/dist/node_modules/@allyhub/protocol/dist/app.d.ts +0 -30
  469. package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +0 -200
  470. package/dist/node_modules/@allyhub/protocol/dist/blobs.d.ts +0 -44
  471. package/dist/node_modules/@allyhub/protocol/dist/cli.d.ts +0 -68
  472. package/dist/node_modules/@allyhub/protocol/dist/cloud-computer.d.ts +0 -77
  473. package/dist/node_modules/@allyhub/protocol/dist/cloud-computer.js +0 -2
  474. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +0 -577
  475. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +0 -674
  476. package/dist/node_modules/@allyhub/protocol/dist/errors.d.ts +0 -7
  477. package/dist/node_modules/@allyhub/protocol/dist/events.d.ts +0 -803
  478. package/dist/node_modules/@allyhub/protocol/dist/files.d.ts +0 -103
  479. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +0 -247
  480. package/dist/node_modules/@allyhub/protocol/dist/image.d.ts +0 -8
  481. package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +0 -38
  482. package/dist/node_modules/@allyhub/protocol/dist/jobs.d.ts +0 -91
  483. package/dist/node_modules/@allyhub/protocol/dist/jsonrpc.d.ts +0 -83
  484. package/dist/node_modules/@allyhub/protocol/dist/kinds.d.ts +0 -144
  485. package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +0 -274
  486. package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +0 -211
  487. package/dist/node_modules/@allyhub/protocol/dist/open.d.ts +0 -13
  488. package/dist/node_modules/@allyhub/protocol/dist/paywall.d.ts +0 -134
  489. package/dist/node_modules/@allyhub/protocol/dist/peer.d.ts +0 -59
  490. package/dist/node_modules/@allyhub/protocol/dist/peer.js +0 -2
  491. package/dist/node_modules/@allyhub/protocol/dist/place.d.ts +0 -21
  492. package/dist/node_modules/@allyhub/protocol/dist/presence.d.ts +0 -125
  493. package/dist/node_modules/@allyhub/protocol/dist/purposes.d.ts +0 -47
  494. package/dist/node_modules/@allyhub/protocol/dist/registry.d.ts +0 -191
  495. package/dist/node_modules/@allyhub/protocol/dist/routes.d.ts +0 -14
  496. package/dist/node_modules/@allyhub/protocol/dist/routes.js +0 -2
  497. package/dist/node_modules/@allyhub/protocol/dist/runtimes.d.ts +0 -96
  498. package/dist/node_modules/@allyhub/protocol/dist/shape.d.ts +0 -35
  499. package/dist/node_modules/@allyhub/protocol/dist/shape.js +0 -2
  500. package/dist/node_modules/@allyhub/protocol/dist/shares.d.ts +0 -156
  501. package/dist/node_modules/@allyhub/protocol/dist/shares.js +0 -2
  502. package/dist/node_modules/@allyhub/protocol/dist/sidebar-deletion.d.ts +0 -34
  503. package/dist/node_modules/@allyhub/protocol/dist/sidebar-deletion.js +0 -2
  504. package/dist/node_modules/@allyhub/protocol/dist/sites.d.ts +0 -298
  505. package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +0 -503
  506. package/dist/node_modules/@allyhub/protocol/dist/sources.d.ts +0 -14
  507. package/dist/node_modules/@allyhub/protocol/dist/studio-server.d.ts +0 -264
  508. package/dist/node_modules/@allyhub/protocol/dist/studio-server.js +0 -2
  509. package/dist/node_modules/@allyhub/protocol/dist/studio-tool-calls.d.ts +0 -18
  510. package/dist/node_modules/@allyhub/protocol/dist/studio-tool-calls.js +0 -2
  511. package/dist/node_modules/@allyhub/protocol/dist/studio-window-requests.d.ts +0 -97
  512. package/dist/node_modules/@allyhub/protocol/dist/studio-window-requests.js +0 -2
  513. package/dist/node_modules/@allyhub/protocol/dist/teams.d.ts +0 -196
  514. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +0 -578
  515. package/dist/node_modules/@allyhub/protocol/dist/turns.d.ts +0 -71
  516. package/dist/node_modules/@allyhub/protocol/dist/turns.js +0 -2
  517. package/dist/node_modules/@allyhub/runtimes/dist/bundled.d.ts +0 -10
  518. package/dist/node_modules/@allyhub/runtimes/dist/declared.d.ts +0 -14
  519. package/dist/node_modules/@allyhub/runtimes/dist/download.d.ts +0 -38
  520. package/dist/node_modules/@allyhub/runtimes/dist/errors.d.ts +0 -20
  521. package/dist/node_modules/@allyhub/runtimes/dist/ffmpeg.d.ts +0 -15
  522. package/dist/node_modules/@allyhub/runtimes/dist/home.d.ts +0 -2
  523. package/dist/node_modules/@allyhub/runtimes/dist/index.d.ts +0 -12
  524. package/dist/node_modules/@allyhub/runtimes/dist/lock.d.ts +0 -14
  525. package/dist/node_modules/@allyhub/runtimes/dist/manifest.d.ts +0 -3
  526. package/dist/node_modules/@allyhub/runtimes/dist/node-program.d.ts +0 -12
  527. package/dist/node_modules/@allyhub/runtimes/dist/packages.d.ts +0 -101
  528. package/dist/node_modules/@allyhub/runtimes/dist/runtimes.d.ts +0 -73
  529. package/dist/node_modules/@allyhub/runtimes/dist/unpack.d.ts +0 -14
  530. package/dist/node_modules/@allyhub/scenery-host/dist/allyhub.d.ts +0 -20
  531. package/dist/node_modules/@allyhub/scenery-host/dist/bake/digest.d.ts +0 -14
  532. package/dist/node_modules/@allyhub/scenery-host/dist/bake/envmap.d.ts +0 -21
  533. package/dist/node_modules/@allyhub/scenery-host/dist/bake/run.d.ts +0 -63
  534. package/dist/node_modules/@allyhub/scenery-host/dist/budget.d.ts +0 -40
  535. package/dist/node_modules/@allyhub/scenery-host/dist/bundle.d.ts +0 -92
  536. package/dist/node_modules/@allyhub/scenery-host/dist/commands.d.ts +0 -54
  537. package/dist/node_modules/@allyhub/scenery-host/dist/draw2d.d.ts +0 -47
  538. package/dist/node_modules/@allyhub/scenery-host/dist/glass.d.ts +0 -39
  539. package/dist/node_modules/@allyhub/scenery-host/dist/index.d.ts +0 -25
  540. package/dist/node_modules/@allyhub/scenery-host/dist/inventory.d.ts +0 -18
  541. package/dist/node_modules/@allyhub/scenery-host/dist/layer/fidelity.d.ts +0 -70
  542. package/dist/node_modules/@allyhub/scenery-host/dist/layer/grade.d.ts +0 -7
  543. package/dist/node_modules/@allyhub/scenery-host/dist/layer/moire.d.ts +0 -6
  544. package/dist/node_modules/@allyhub/scenery-host/dist/measure/contacts.d.ts +0 -45
  545. package/dist/node_modules/@allyhub/scenery-host/dist/measure/health.d.ts +0 -10
  546. package/dist/node_modules/@allyhub/scenery-host/dist/measure/index.d.ts +0 -110
  547. package/dist/node_modules/@allyhub/scenery-host/dist/measure/relations.d.ts +0 -17
  548. package/dist/node_modules/@allyhub/scenery-host/dist/measure/solid.d.ts +0 -32
  549. package/dist/node_modules/@allyhub/scenery-host/dist/measure/support.d.ts +0 -11
  550. package/dist/node_modules/@allyhub/scenery-host/dist/model-stage.d.ts +0 -32
  551. package/dist/node_modules/@allyhub/scenery-host/dist/queries/inventory.d.ts +0 -5
  552. package/dist/node_modules/@allyhub/scenery-host/dist/queries/map.d.ts +0 -5
  553. package/dist/node_modules/@allyhub/scenery-host/dist/queries/view.d.ts +0 -10
  554. package/dist/node_modules/@allyhub/scenery-host/dist/scene.d.ts +0 -35
  555. package/dist/node_modules/@allyhub/scenery-host/dist/screen-dom.d.ts +0 -24
  556. package/dist/node_modules/@allyhub/scenery-host/dist/stage/bakes.d.ts +0 -42
  557. package/dist/node_modules/@allyhub/scenery-host/dist/stage/index.d.ts +0 -6
  558. package/dist/node_modules/@allyhub/scenery-host/dist/stage/page.d.ts +0 -70
  559. package/dist/node_modules/@allyhub/scenery-host/dist/stage/solve.d.ts +0 -49
  560. package/dist/node_modules/@allyhub/scenery-host/dist/stage/version.d.ts +0 -73
  561. package/dist/node_modules/@allyhub/scenery-host/dist/stage/view.d.ts +0 -18
  562. package/dist/node_modules/@allyhub/scenery-host/dist/steady.d.ts +0 -4
  563. package/dist/node_modules/@allyhub/scenery-host/dist/viewer.d.ts +0 -134
  564. package/editor-web/assets/channel-HUlo15J7.js +0 -1
  565. package/editor-web/assets/deck-CtEtDHo2.js +0 -1
  566. package/editor-web/assets/dist-Bl74xqMW.js +0 -19
  567. package/editor-web/assets/dist-BrUtQth3.js +0 -18
  568. package/editor-web/assets/dist-CN5A7Au2.js +0 -1
  569. package/editor-web/assets/dist-CcL6r6l3.js +0 -1
  570. package/editor-web/assets/dist-D2E3cgRP.js +0 -4
  571. package/editor-web/assets/dist-ZrBAbqyJ.js +0 -3
  572. package/editor-web/assets/dist-d4dayaWE.js +0 -17
  573. package/editor-web/assets/flowDiagram-IUGLLWBU-tz5ewhC5.js +0 -1
  574. package/editor-web/assets/index-q7X6hdHp.js +0 -28
  575. package/editor-web/assets/schemas-moE_A7Nj.js +0 -1
  576. package/editor-web/assets/slides-oQ_C0SVJ.js +0 -1
  577. package/editor-web/assets/snapshots-Dd0Wd_qM.js +0 -1
  578. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-X35m3xN6.js +0 -8
  579. package/editor-web/assets/workbook-DznVDqoE.js +0 -45
  580. /package/dist/node_modules/@allyhub/{protocol/dist/runtimes.js → runtimes/dist/schema.js} +0 -0
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
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}:{}})}
2
+ import{AsyncLocalStorage as _}from"node:async_hooks";import{createHash as b}from"node:crypto";import{BACKGROUND_HEADER as A,DEVICE_HEADER as E,ORGANIZATION_HEADER as g}from"@allyhub/protocol/auth";import{COMMAND_LINE_PAYWALL_MET as O,paywallNumbersOfData as k,paywallReasonOfCode as S}from"@allyhub/protocol/paywall";import{EXIT as c}from"@allyhub/protocol/cli";import{IDEMPOTENCY_KEY_HEADER as $,planPageAddress as y}from"@allyhub/protocol/cloud";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 m}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",w=new _;export function callsMadeInBackground(u){return w.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:k(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(O,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 m(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(E,d.device),w.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?{}:{[$]:t.idempotencyKey}},...t.body===void 0?{}:{body:JSON.stringify(t.body)}})}catch(l){throw l instanceof h?l:m(this.url,l)}const d=await a.text(),o=a.ok?void 0:T(d,a.status,s,this.url,e),f=S(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,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{homedir as d}from"node:os";import{join as u}from"node:path";import{API_KEY_ENV as l,CREDENTIALS_FILE as a}from"@allyhub/protocol";import{cacheHome as A}from"@allyhub/runtimes";import{osKeychain as E}from"./keychain.js";const T="https://app.allyhub.com",_=["ALLYHUB_URL"],h=/^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$/u,H=o=>o.replace(/\/+$/u,"");export function cloudConfig(o,r={}){const c=o[l]?.trim(),t=H(o.ALLYHUB_URL??T),e=o.ALLYHUB_HOME,i=r.client??o.ALLYHUB_CLIENT,n=h.exec(o.TRACEPARENT?.trim()??"")?.[0],f=u(e??d(),a),L=o.ALLYHUB_CREDENTIALS_STORE,m=L==="keychain"||L!=="file"&&e===void 0?E({service:"AllyHub",account:e===void 0?t:`${t} ${f}`}):void 0;return{url:t,from:_.filter(s=>o[s]!==void 0),credentialsFile:f,...m?{keychain:m}:{},cacheDir:u(A(o),"cloud"),...c?{apiKey:c}:{},fetch:r.fetch??fetch,...i===void 0?{}:{client:i},...n===void 0?{}:{traceparent:n},...o.ALLYHUB_STUDIO_HOST?{studioHost:o.ALLYHUB_STUDIO_HOST}:{}}}export function hostsText(o){return o.from.length>0?`${o.url} (from ${o.from.join(", ")})`:o.url}
2
+ import{homedir as d}from"node:os";import{join as u}from"node:path";import{API_KEY_ENV as l}from"@allyhub/protocol/cloud";import{CREDENTIALS_FILE as a}from"@allyhub/protocol/auth";import{cacheHome as A}from"@allyhub/runtimes/home";import{osKeychain as E}from"./keychain.js";const T="https://app.allyhub.com",_=["ALLYHUB_URL"],h=/^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$/u,H=o=>o.replace(/\/+$/u,"");export function cloudConfig(o,r={}){const c=o[l]?.trim(),t=H(o.ALLYHUB_URL??T),e=o.ALLYHUB_HOME,i=r.client??o.ALLYHUB_CLIENT,n=h.exec(o.TRACEPARENT?.trim()??"")?.[0],f=u(e??d(),a),m=o.ALLYHUB_CREDENTIALS_STORE,L=m==="keychain"||m!=="file"&&e===void 0?E({service:"AllyHub",account:e===void 0?t:`${t} ${f}`}):void 0;return{url:t,from:_.filter(s=>o[s]!==void 0),credentialsFile:f,...L?{keychain:L}:{},cacheDir:u(A(o),"cloud"),...c?{apiKey:c}:{},fetch:r.fetch??fetch,...i===void 0?{}:{client:i},...n===void 0?{}:{traceparent:n},...o.ALLYHUB_STUDIO_HOST?{studioHost:o.ALLYHUB_STUDIO_HOST}:{}}}export function hostsText(o){return o.from.length>0?`${o.url} (from ${o.from.join(", ")})`:o.url}
@@ -1,3 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{randomBytes as T}from"node:crypto";import{chmod as C,mkdir as m,readFile as b,rename as P,rm as h,stat as O,writeFile as z}from"node:fs/promises";import{dirname as x}from"node:path";import*as y from"zod";import{ACCOUNT_PATH as I,AccountSchema as j,AuthServerSchema as N,CLIENT_ID as w,CredentialsFileSchema as $,DeviceAuthorizationSchema as R,METADATA_PATH as J,OAuthErrorSchema as L,SCOPES as U,TokenResponseSchema as B}from"@allyhub/protocol";import{deviceHeaders as W,newDeviceId as E}from"./device.js";import{notSignedIn as G}from"./errors.js";export class SignedOut extends Error{}const K=6e4,p={waitMs:15e3,staleMs:3e4,stepMs:50},g=new Map;export function authServer(e){let n=g.get(e.url);return n||(n=(async()=>{const t=await e.fetch(`${e.url}${J}`,{redirect:"error",headers:{accept:"application/json"},signal:AbortSignal.timeout(3e4)});if(!t.ok)throw new Error(`AllyHub's sign-in metadata answered ${String(t.status)}.`);return N.parse(await t.json())})(),n.catch(()=>g.delete(e.url)),g.set(e.url,n)),n}const V=y.object({revision:y.string().min(1),refreshToken:y.string().min(1),access:$.shape.access}),k=new Map;async function q(e,n,t){const r=k.get(e.credentialsFile);if(!t&&r?.revision===n)return r;if(e.keychain)try{const i=await e.keychain.get(),a=V.safeParse(i===void 0?void 0:JSON.parse(i));return!a.success||a.data.revision!==n?void 0:(k.set(e.credentialsFile,a.data),a.data)}catch{return}}export async function readCredentials(e,n=!1){for(let t=0;t<3;t+=1){let r;try{const a=$.safeParse(JSON.parse(await b(e.credentialsFile,"utf8")));if(!a.success||a.data.url!==e.url)return;r=a.data}catch{return}if(r.keychain===void 0)return r.refreshToken===void 0?void 0:{...r,refreshToken:r.refreshToken};const i=await q(e,r.keychain,n||t>0);if(i){const{access:a,refreshToken:o}=i;return{...r,refreshToken:o,...a?{access:a}:{}}}await new Promise(a=>setTimeout(a,p.stepMs))}}export async function writeCredentials(e,n){const{refreshToken:t,access:r,...i}=n,a={version:i.version,url:i.url,issuer:i.issuer,account:i.account,since:i.since,...i.device===void 0?{}:{device:i.device}};let o={...a,refreshToken:t,...r?{access:r}:{}};if(e.keychain){const f={revision:T(9).toString("base64url"),refreshToken:t,...r?{access:r}:{}},A=JSON.stringify(f);try{if(await e.keychain.set(A),await e.keychain.get()!==A)throw new Error(`${e.keychain.name} did not keep the sign-in.`);k.set(e.credentialsFile,f),o={...a,keychain:f.revision}}catch{}}const d=e.credentialsFile,u=`${JSON.stringify(o,null,2)}
2
+ import{randomBytes as T}from"node:crypto";import{chmod as C,mkdir as m,readFile as b,rename as P,rm as h,stat as O,writeFile as z}from"node:fs/promises";import{dirname as x}from"node:path";import*as y from"zod";import{ACCOUNT_PATH as I,AccountSchema as j,AuthServerSchema as N,CLIENT_ID as w,CredentialsFileSchema as $,DeviceAuthorizationSchema as R,METADATA_PATH as J,OAuthErrorSchema as L,SCOPES as U,TokenResponseSchema as B}from"@allyhub/protocol/auth";import{deviceHeaders as W,newDeviceId as E}from"./device.js";import{notSignedIn as G}from"./errors.js";export class SignedOut extends Error{}const K=6e4,p={waitMs:15e3,staleMs:3e4,stepMs:50},g=new Map;export function authServer(e){let n=g.get(e.url);return n||(n=(async()=>{const t=await e.fetch(`${e.url}${J}`,{redirect:"error",headers:{accept:"application/json"},signal:AbortSignal.timeout(3e4)});if(!t.ok)throw new Error(`AllyHub's sign-in metadata answered ${String(t.status)}.`);return N.parse(await t.json())})(),n.catch(()=>g.delete(e.url)),g.set(e.url,n)),n}const V=y.object({revision:y.string().min(1),refreshToken:y.string().min(1),access:$.shape.access}),k=new Map;async function q(e,n,t){const r=k.get(e.credentialsFile);if(!t&&r?.revision===n)return r;if(e.keychain)try{const i=await e.keychain.get(),a=V.safeParse(i===void 0?void 0:JSON.parse(i));return!a.success||a.data.revision!==n?void 0:(k.set(e.credentialsFile,a.data),a.data)}catch{return}}export async function readCredentials(e,n=!1){for(let t=0;t<3;t+=1){let r;try{const a=$.safeParse(JSON.parse(await b(e.credentialsFile,"utf8")));if(!a.success||a.data.url!==e.url)return;r=a.data}catch{return}if(r.keychain===void 0)return r.refreshToken===void 0?void 0:{...r,refreshToken:r.refreshToken};const i=await q(e,r.keychain,n||t>0);if(i){const{access:a,refreshToken:o}=i;return{...r,refreshToken:o,...a?{access:a}:{}}}await new Promise(a=>setTimeout(a,p.stepMs))}}export async function writeCredentials(e,n){const{refreshToken:t,access:r,...i}=n,a={version:i.version,url:i.url,issuer:i.issuer,account:i.account,since:i.since,...i.device===void 0?{}:{device:i.device}};let o={...a,refreshToken:t,...r?{access:r}:{}};if(e.keychain){const f={revision:T(9).toString("base64url"),refreshToken:t,...r?{access:r}:{}},A=JSON.stringify(f);try{if(await e.keychain.set(A),await e.keychain.get()!==A)throw new Error(`${e.keychain.name} did not keep the sign-in.`);k.set(e.credentialsFile,f),o={...a,keychain:f.revision}}catch{}}const d=e.credentialsFile,u=`${JSON.stringify(o,null,2)}
3
3
  `,c=await O(d).catch(()=>{});if(c!==void 0&&(c.mode&511)===384&&await b(d,"utf8").catch(()=>{})===u)return;await m(x(d),{recursive:!0,mode:448});const s=`${d}.${T(6).toString("hex")}.tmp`;try{await z(s,u,{mode:384}),await C(s,384),await P(s,d)}finally{await h(s,{force:!0})}}export async function forgetCredentials(e,n){if(n!==void 0){const t=await readCredentials(e,!0);if(t!==void 0&&t.refreshToken!==n)return}await h(e.credentialsFile,{force:!0}),k.delete(e.credentialsFile),await e.keychain?.delete().catch(()=>{})}async function _(e,n){const t=`${e}.lock`;await m(x(e),{recursive:!0,mode:448});const r=Date.now()+p.waitMs;for(;;)try{await m(t);break}catch{const i=await O(t).catch(()=>{});if(i&&Date.now()-i.mtimeMs>p.staleMs){await h(t,{recursive:!0,force:!0});continue}if(Date.now()>r)throw new Error("Another AllyHub program holds the sign-in's lock.");await new Promise(a=>setTimeout(a,p.stepMs))}try{return await n()}finally{await h(t,{recursive:!0,force:!0})}}async function l(e,n,t,r,i={}){return e.fetch(n,{method:"POST",redirect:"error",headers:{...i,"content-type":"application/x-www-form-urlencoded",accept:"application/json"},body:new URLSearchParams(t).toString(),signal:r??AbortSignal.timeout(3e4)})}async function v(e){const n=await e.json().catch(()=>({}));if(e.ok)return B.parse(n);const t=L.safeParse(n);return{error:t.success?t.data.error:`http_${String(e.status)}`}}const D=e=>({token:e.access_token,expiresAt:new Date(Date.now()+e.expires_in*1e3).toISOString()});export async function accountOf(e,n){const t=await e.fetch(`${e.url}${I}`,{redirect:"error",headers:{authorization:`Bearer ${n}`,accept:"application/json"},signal:AbortSignal.timeout(3e4)});if(t.status===401)throw new SignedOut("This computer is signed out of AllyHub.");if(!t.ok)throw new Error(`Reading the account: AllyHub answered ${String(t.status)}.`);const r=await t.json();return j.parse({id:r.id,email:r.email,...r.name?{name:r.name}:{},...r.organization?{organization:r.organization}:{}})}const Q=e=>e.client??"AllyHub",S=(e,n)=>W(Q(e),n),F=async e=>(await readCredentials(e).catch(()=>{}))?.device??E();async function H(e,n,t){if(n.refresh_token===void 0)throw new Error("AllyHub gave no refresh token.");const r=await authServer(e),i={version:1,url:e.url,issuer:r.issuer,account:await accountOf(e,n.access_token),refreshToken:n.refresh_token,access:D(n),since:new Date().toISOString(),device:t},a=await readCredentials(e).catch(()=>{});return await writeCredentials(e,i),a!==void 0&&a.device===void 0&&a.refreshToken!==i.refreshToken&&await M(e,r.revocation_endpoint,a.refreshToken).then(o=>o.body?.cancel()).catch(()=>{}),i}const M=(e,n,t)=>l(e,n,{token:t,token_type_hint:"refresh_token",client_id:w});export async function signInWithCode(e,n){const t=await authServer(e),r=await F(e),i=await v(await l(e,t.token_endpoint,{grant_type:"authorization_code",client_id:w,code:n.code,redirect_uri:n.redirectUri,code_verifier:n.codeVerifier,resource:e.url},void 0,await S(e,r)));if("error"in i)throw new Error(`Signing in: AllyHub refused the code (${i.error}).`);return H(e,i,r)}export async function signInWithDevice(e,n,t){const r=await authServer(e),i=await l(e,r.device_authorization_endpoint,{client_id:w,scope:U,resource:e.url});if(!i.ok)throw new Error(`Asking for a device's code: AllyHub answered ${String(i.status)}.`);const a=R.parse(await i.json()),o=await F(e),d=await S(e,o);n(a);let u=(a.interval??5)*1e3;const c=Date.now()+a.expires_in*1e3;for(;Date.now()<c;){if(await new Promise(f=>setTimeout(f,u)),t?.aborted===!0)throw new Error("Signing in was stopped.");const s=await v(await l(e,r.token_endpoint,{grant_type:"urn:ietf:params:oauth:grant-type:device_code",client_id:w,device_code:a.device_code,resource:e.url},void 0,d));if(!("error"in s))return H(e,s,o);if(s.error!=="authorization_pending"){if(s.error==="slow_down"){u+=5e3;continue}throw new Error(s.error==="access_denied"?"The sign-in was turned down.":`Signing in: AllyHub refused (${s.error}).`)}}throw new Error("The device's code ran out before it was entered.")}export async function accessOf(e,n={}){const t=o=>o?.access!==void 0&&o.access.token!==n.refused&&Date.parse(o.access.expiresAt)-K>Date.now()?{token:o.access.token,expiresAt:o.access.expiresAt,credentials:o}:void 0;let r=await readCredentials(e);if(!r||(e.keychain&&r.keychain===void 0&&(r=await _(e.credentialsFile,async()=>{const o=await readCredentials(e,!0);return o&&o.keychain===void 0&&await writeCredentials(e,o),o})),!r))return;const i=t(r);if(i)return i;const a=await authServer(e);return _(e.credentialsFile,async()=>{const o=await readCredentials(e,!0);if(!o)return;const d=t(o);if(d)return d;const u=o.device??E(),c=await v(await l(e,a.token_endpoint,{grant_type:"refresh_token",client_id:w,refresh_token:o.refreshToken,resource:e.url},void 0,await S(e,u)));if("error"in c)throw c.error==="invalid_grant"?(await forgetCredentials(e,o.refreshToken),new SignedOut("This computer is signed out of AllyHub.")):new Error(`Renewing the sign-in: AllyHub answered ${c.error}.`);const s={...o,refreshToken:c.refresh_token??o.refreshToken,access:D(c),device:u};return await writeCredentials(e,s),{token:s.access?.token??c.access_token,expiresAt:s.access?.expiresAt??"",credentials:s}})}export async function signOut(e,n){await forgetCredentials(e,n.refreshToken);const t=await authServer(e),r=await M(e,t.revocation_endpoint,n.refreshToken);if(await r.body?.cancel(),!r.ok&&r.status!==400)throw new Error(`Signing out: AllyHub answered ${String(r.status)}.`)}export async function chooseOrganization(e,n){await _(e.credentialsFile,async()=>{const t=await readCredentials(e,!0);if(!t)throw G();await writeCredentials(e,{...t,account:{...t.account,organization:n}})})}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{execFile as m}from"node:child_process";import{randomBytes as l}from"node:crypto";import{arch as p,hostname as w,platform as s,release as r}from"node:os";import{DEVICE_HEADER as d,DEVICE_NAME_HEADER as f}from"@allyhub/protocol";const a=(e,t)=>new Promise(n=>{m(e,t,{timeout:2e3},(c,u)=>{const o=u.trim();n(c===null&&o!==""?o:void 0)})});let i;export function thisComputer(){return i??=(async()=>{const e=w().replace(/\.local$/u,"");switch(s()){case"darwin":{const[t,n]=await Promise.all([a("/usr/sbin/scutil",["--get","ComputerName"]),a("/usr/bin/sw_vers",["-productVersion"])]);return{name:t??e,os:`macOS ${n??r()}`}}case"win32":return{name:e,os:`Windows ${r()}`};case"linux":return{name:e,os:`Linux ${r()}`};default:return{name:e,os:`${s()} ${r()}`}}})(),i}export const newDeviceId=()=>l(18).toString("base64url");export async function userAgent(e){const t=await thisComputer();return`${e} (${t.os}; ${p()})`}export async function deviceHeaders(e,t){const n=await thisComputer();return{"user-agent":await userAgent(e),[d]:t,[f]:encodeURIComponent(n.name)}}
2
+ import{execFile as m}from"node:child_process";import{randomBytes as l}from"node:crypto";import{arch as p,hostname as w,platform as s,release as r}from"node:os";import{DEVICE_HEADER as d,DEVICE_NAME_HEADER as f}from"@allyhub/protocol/auth";const a=(e,t)=>new Promise(n=>{m(e,t,{timeout:2e3},(c,u)=>{const o=u.trim();n(c===null&&o!==""?o:void 0)})});let i;export function thisComputer(){return i??=(async()=>{const e=w().replace(/\.local$/u,"");switch(s()){case"darwin":{const[t,n]=await Promise.all([a("/usr/sbin/scutil",["--get","ComputerName"]),a("/usr/bin/sw_vers",["-productVersion"])]);return{name:t??e,os:`macOS ${n??r()}`}}case"win32":return{name:e,os:`Windows ${r()}`};case"linux":return{name:e,os:`Linux ${r()}`};default:return{name:e,os:`${s()} ${r()}`}}})(),i}export const newDeviceId=()=>l(18).toString("base64url");export async function userAgent(e){const t=await thisComputer();return`${e} (${t.os}; ${p()})`}export async function deviceHeaders(e,t){const n=await thisComputer();return{"user-agent":await userAgent(e),[d]:t,[f]:encodeURIComponent(n.name)}}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{CommandError as o,EXIT as r}from"@allyhub/protocol";export class CloudError extends Error{code;hint;exit;status;data;constructor(t,i,n={}){super(i,n.cause===void 0?void 0:{cause:n.cause}),this.name="CloudError",this.code=t,this.hint=n.hint,this.exit=n.exit??r.failed,this.status=n.status,this.data=n.data}}export async function cloudWork(e){try{return await e()}catch(t){throw t instanceof CloudError?new o(t.code,t.message,{exit:t.exit,...t.hint===void 0?{}:{hint:t.hint},cause:t}):t}}export const SIGN_IN="Run allyhub auth login (or set ALLYHUB_API_KEY).",notSignedIn=(e,t)=>new CloudError("not-signed-in",e??"This computer is not signed in to AllyHub.",{exit:r.auth,hint:t??SIGN_IN}),unreachable=(e,t)=>new CloudError("network",`Cannot reach ${e}: ${t instanceof Error?t.message:String(t)}`,{exit:r.platform,hint:"Check the connection; ALLYHUB_URL sets another address.",cause:t});
2
+ import{CommandError as o,EXIT as r}from"@allyhub/protocol/cli";export class CloudError extends Error{code;hint;exit;status;data;constructor(t,i,n={}){super(i,n.cause===void 0?void 0:{cause:n.cause}),this.name="CloudError",this.code=t,this.hint=n.hint,this.exit=n.exit??r.failed,this.status=n.status,this.data=n.data}}export async function cloudWork(e){try{return await e()}catch(t){throw t instanceof CloudError?new o(t.code,t.message,{exit:t.exit,...t.hint===void 0?{}:{hint:t.hint},cause:t}):t}}export const SIGN_IN="Run allyhub auth login (or set ALLYHUB_API_KEY).",notSignedIn=(e,t)=>new CloudError("not-signed-in",e??"This computer is not signed in to AllyHub.",{exit:r.auth,hint:t??SIGN_IN}),unreachable=(e,t)=>new CloudError("network",`Cannot reach ${e}: ${t instanceof Error?t.message:String(t)}`,{exit:r.platform,hint:"Check the connection; ALLYHUB_URL sets another address.",cause:t});
@@ -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,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,BlobsUnavailable}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*from"./tools.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,BlobsUnavailable}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{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,4 +1,4 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{timingSafeEqual as y}from"node:crypto";import{createServer as x}from"node:http";const k=3e4,h="/callback";export class LoopbackError extends Error{code;constructor(n,i){super(i),this.name="LoopbackError",this.code=n}}export async function startLoopback(e){let n={ok:()=>{},fail:()=>{}};const i=new Promise((a,o)=>{n={ok:a,fail:o}});let t,r;const s=a=>{const o=t;t=void 0,clearTimeout(r),!(o===void 0||o.writableEnded)&&(a!==void 0?c(o,200,l("Sign-in failed.",a.message)):e.landing!==void 0?o.writeHead(303,{location:e.landing,"cache-control":"no-store",connection:"close"}).end():c(o,200,l("You're signed in.","You can close this tab and go back to AllyHub.")))},d=x((a,o)=>{T(a,o,e.state,{...n,ok:b=>{t=o,r=setTimeout(()=>{t===void 0||t.writableEnded||(c(t,200,l("Returning to AllyHub…","You can close this tab.")),t=void 0)},k),n.ok(b)}})});await A(d);const{port:g}=d.address(),p=`http://127.0.0.1:${String(g)}${h}`;let u=!1;const f=async()=>{u||(u=!0,clearTimeout(w),n.fail(new LoopbackError("sign-in-cancelled","Sign-in was cancelled.")),s(),d.closeAllConnections(),await new Promise(a=>{d.close(()=>{a()})}))},w=setTimeout(()=>{n.fail(new LoopbackError("sign-in-timeout",`Nobody signed in within ${String(Math.round(e.timeoutMs/6e4))} minutes.`)),f()},e.timeoutMs);return i.catch(f),{result:i,redirectUri:p,finish:async a=>{s(a),await f()},close:f}}async function A(e){await new Promise((n,i)=>{e.once("error",i),e.listen(0,"127.0.0.1",()=>{e.off("error",i),n()})})}function T(e,n,i,t){if(e.method!=="GET"){n.writeHead(405,{"content-type":"text/plain"}).end();return}const r=new URL(e.url??"/","http://127.0.0.1");if(r.pathname!==h){n.writeHead(404,{"content-type":"text/plain"}).end();return}if(!S(r.searchParams.get("state")??"",i)){c(n,400,l("This sign-in link is not valid.","Run allyhub auth login again.")),t.fail(new LoopbackError("sign-in-state","The sign-in did not match this one."));return}if(r.searchParams.get("error")==="access_denied"){c(n,200,l("Sign-in cancelled.","You can close this tab.")),t.fail(new LoopbackError("sign-in-denied","The sign-in was cancelled in the browser."));return}const s=r.searchParams.get("code");if(!s){c(n,400,l("Sign-in failed.","Run allyhub auth login again.")),t.fail(new LoopbackError("sign-in-failed","The browser came back without a code."));return}t.ok(s)}function S(e,n){const i=Buffer.from(e),t=Buffer.from(n);return i.length===t.length&&y(i,t)}function c(e,n,i){e.writeHead(n,{"content-type":"text/html; charset=utf-8","cache-control":"no-store",connection:"close"}).end(i)}const m=e=>e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;");function l(e,n){return`<!doctype html><html><head><meta charset="utf-8"><title>AllyHub</title>
2
+ import{timingSafeEqual as y}from"node:crypto";const{createServer:x}=process.getBuiltinModule("node:http"),k=3e4,h="/callback";export class LoopbackError extends Error{code;constructor(n,i){super(i),this.name="LoopbackError",this.code=n}}export async function startLoopback(e){let n={ok:()=>{},fail:()=>{}};const i=new Promise((a,o)=>{n={ok:a,fail:o}});let t,r;const l=a=>{const o=t;t=void 0,clearTimeout(r),!(o===void 0||o.writableEnded)&&(a!==void 0?c(o,200,s("Sign-in failed.",a.message)):e.landing!==void 0?o.writeHead(303,{location:e.landing,"cache-control":"no-store",connection:"close"}).end():c(o,200,s("You're signed in.","You can close this tab and go back to AllyHub.")))},d=x((a,o)=>{T(a,o,e.state,{...n,ok:b=>{t=o,r=setTimeout(()=>{t===void 0||t.writableEnded||(c(t,200,s("Returning to AllyHub…","You can close this tab.")),t=void 0)},k),n.ok(b)}})});await A(d);const{port:m}=d.address(),p=`http://127.0.0.1:${String(m)}${h}`;let f=!1;const u=async()=>{f||(f=!0,clearTimeout(w),n.fail(new LoopbackError("sign-in-cancelled","Sign-in was cancelled.")),l(),d.closeAllConnections(),await new Promise(a=>{d.close(()=>{a()})}))},w=setTimeout(()=>{n.fail(new LoopbackError("sign-in-timeout",`Nobody signed in within ${String(Math.round(e.timeoutMs/6e4))} minutes.`)),u()},e.timeoutMs);return i.catch(u),{result:i,redirectUri:p,finish:async a=>{l(a),await u()},close:u}}async function A(e){await new Promise((n,i)=>{e.once("error",i),e.listen(0,"127.0.0.1",()=>{e.off("error",i),n()})})}function T(e,n,i,t){if(e.method!=="GET"){n.writeHead(405,{"content-type":"text/plain"}).end();return}const r=new URL(e.url??"/","http://127.0.0.1");if(r.pathname!==h){n.writeHead(404,{"content-type":"text/plain"}).end();return}if(!S(r.searchParams.get("state")??"",i)){c(n,400,s("This sign-in link is not valid.","Run allyhub auth login again.")),t.fail(new LoopbackError("sign-in-state","The sign-in did not match this one."));return}if(r.searchParams.get("error")==="access_denied"){c(n,200,s("Sign-in cancelled.","You can close this tab.")),t.fail(new LoopbackError("sign-in-denied","The sign-in was cancelled in the browser."));return}const l=r.searchParams.get("code");if(!l){c(n,400,s("Sign-in failed.","Run allyhub auth login again.")),t.fail(new LoopbackError("sign-in-failed","The browser came back without a code."));return}t.ok(l)}function S(e,n){const i=Buffer.from(e),t=Buffer.from(n);return i.length===t.length&&y(i,t)}function c(e,n,i){e.writeHead(n,{"content-type":"text/html; charset=utf-8","cache-control":"no-store",connection:"close"}).end(i)}const g=e=>e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;");function s(e,n){return`<!doctype html><html><head><meta charset="utf-8"><title>AllyHub</title>
3
3
  <style>body{font-family:system-ui,sans-serif;display:flex;align-items:center;justify-content:center;height:100vh;margin:0;background:#f7f7f6;color:#1b1b19}main{max-width:440px;text-align:center;padding:32px;border-radius:10px;background:#fff;border:1px solid #dfdfdc}h1{font-family:Piazzolla,Georgia,serif;font-size:20px;font-weight:600;margin:0 0 8px}p{margin:0;color:#605f5a}</style>
4
- </head><body><main><h1>${m(e)}</h1><p>${m(n)}</p></main></body></html>`}
4
+ </head><body><main><h1>${g(e)}</h1><p>${g(n)}</p></main></body></html>`}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{MAIL_ALIASES_PATH as S,MAIL_MESSAGES_PATH as n,MAIL_PATH as h,MAIL_SEND_PATH as p,MailAddressSchema as y,MailMessageSchema as M,MailSearchResponseSchema as A,MailSummarySchema as o,MailboxSchema as d,mailMessagePath as i,mailRawPath as c,mailReplyPath as w}from"@allyhub/protocol";export const mailbox=async a=>d.parse(await a.json(h)),createMailAlias=async(a,e)=>y.parse(await a.json(S,{method:"POST",body:e}));export async function searchMail(a,e,t){const r=new URLSearchParams;for(const[m,s]of Object.entries(e))s!==void 0&&r.set(m,String(s));const l=r.size===0?n:`${n}?${r.toString()}`;return A.parse(await a.json(l,t===void 0?{}:{signal:t})).messages}export const readMail=async(a,e,t={})=>M.parse(await a.json(t.html===!0?`${i(e)}?html=1`:i(e)));export async function rawMail(a,e){const t=await a.keyedFetch(`${a.url}${c(e)}`,{redirect:"error",signal:AbortSignal.timeout(6e4)});if(t.ok)return new Uint8Array(await t.arrayBuffer());throw await t.body?.cancel(),await a.json(c(e)),new Error(`The message could not be read (${String(t.status)}).`)}export const sendMail=async(a,e)=>o.parse(await a.json(p,{method:"POST",body:e,signal:AbortSignal.timeout(12e4)})),replyMail=async(a,e,t)=>o.parse(await a.json(w(e),{method:"POST",body:t,signal:AbortSignal.timeout(12e4)}));
2
+ import{MAIL_ALIASES_PATH as S,MAIL_MESSAGES_PATH as n,MAIL_PATH as h,MAIL_SEND_PATH as p,MailAddressSchema as y,MailMessageSchema as M,MailSearchResponseSchema as A,MailSummarySchema as o,MailboxSchema as d,mailMessagePath as i,mailRawPath as c,mailReplyPath as w}from"@allyhub/protocol/mail";export const mailbox=async a=>d.parse(await a.json(h)),createMailAlias=async(a,e)=>y.parse(await a.json(S,{method:"POST",body:e}));export async function searchMail(a,e,t){const r=new URLSearchParams;for(const[m,s]of Object.entries(e))s!==void 0&&r.set(m,String(s));const l=r.size===0?n:`${n}?${r.toString()}`;return A.parse(await a.json(l,t===void 0?{}:{signal:t})).messages}export const readMail=async(a,e,t={})=>M.parse(await a.json(t.html===!0?`${i(e)}?html=1`:i(e)));export async function rawMail(a,e){const t=await a.keyedFetch(`${a.url}${c(e)}`,{redirect:"error",signal:AbortSignal.timeout(6e4)});if(t.ok)return new Uint8Array(await t.arrayBuffer());throw await t.body?.cancel(),await a.json(c(e)),new Error(`The message could not be read (${String(t.status)}).`)}export const sendMail=async(a,e)=>o.parse(await a.json(p,{method:"POST",body:e,signal:AbortSignal.timeout(12e4)})),replyMail=async(a,e,t)=>o.parse(await a.json(w(e),{method:"POST",body:t,signal:AbortSignal.timeout(12e4)}));
@@ -1,4 +1,4 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{createHash as x}from"node:crypto";import{readdir as S,readFile as p,rename as O,stat as b,writeFile as l}from"node:fs/promises";import{basename as F,dirname as o,extname as $,join as h}from"node:path";import{GenFileSchema as y,WordsFileSchema as A,genFileFor as a,wordsFileFor as j}from"@allyhub/formats";const u=t=>x("sha256").update(t).digest("hex");export function canonical(t){if(Array.isArray(t))return`[${t.map(canonical).join(",")}]`;if(typeof t=="object"&&t!==null){const e=t;return`{${Object.keys(e).filter(n=>e[n]!==void 0).sort().map(n=>`${JSON.stringify(n)}:${canonical(e[n])}`).join(",")}}`}return JSON.stringify(t??null)}export function inputHash(t,e){return u(canonical({tool:t,input:e}))}export const BASE64_FROM=1024,LARGE_FROM=2e3;const k=t=>t.replace(/([a-z0-9])([A-Z])/gu,"$1_$2").toLowerCase().split(/[^a-z0-9]+/u).filter(Boolean),N=new Set(["apikey","token","secret","password","passwd","passphrase","authorization","credential","credentials","cookie","bearer"]),E=new Set(["api","access","secret","private","auth","signing"]);export function isSecretName(t){const e=k(t);return e.some(n=>N.has(n))?!0:e.some((n,r)=>n==="key"&&E.has(e[r-1]??""))}function W(t){if(t.length<BASE64_FROM)return;const e=/^data:[^,]*;base64,/u.exec(t),n=e?t.slice(e[0].length):t;if(/^[A-Za-z0-9+/_-]+(?:\r?\n[A-Za-z0-9+/_-]+)*={0,2}\s*$/u.test(n))return Buffer.from(n,"base64")}const _=/^(x-amz-(signature|credential|security-token)|x-goog-(signature|credential)|signature|sig|se|sp|token|expires|key-pair-id|policy)$/iu;export function withoutSignature(t){if(!/^https?:\/\//iu.test(t))return t;let e;try{e=new URL(t)}catch{return t}return[...e.searchParams.keys()].some(n=>_.test(n))?(e.search="",`${e.toString()}?[signature redacted]`):t}const g=t=>({omitted:!0,sha256:u(t),bytes:typeof t=="string"?Buffer.byteLength(t):t.length});function c(t,e){if(e!==void 0&&isSecretName(e))return t==null?t:"[redacted]";if(typeof t=="string"){const n=W(t);return n?g(n):withoutSignature(t)}return Array.isArray(t)?t.map(n=>c(n,void 0)):typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t).map(([n,r])=>[n,c(r,n)])):t}export function recordInput(t){return c(t,void 0)}export function recordOutput(t){const e={};for(const[n,r]of Object.entries(recordInput(t))){const i=r===void 0?"null":JSON.stringify(r);e[n]=i.length>LARGE_FROM?g(i):r}return e}const m=t=>typeof t=="string"&&t!==""?t:void 0;export async function genRecord(t,e){const n=await p(t),r=e.model??m(e.output.model)??m(e.input.model);return y.parse({version:1,ai:!0,tool:e.tool,...r?{model:r}:{},input:recordInput(e.input),inputHash:inputHash(e.tool,e.input),output:recordOutput(e.output),...e.credits===void 0?{}:{credits:e.credits},at:(e.at??new Date).toISOString(),sha256:u(n),bytes:n.length})}export async function writeGen(t,e){const n=a(t);return await l(`${n}.part`,`${JSON.stringify(e,null,2)}
2
+ import{createHash as x}from"node:crypto";import{readdir as S,readFile as p,rename as O,stat as b,writeFile as l}from"node:fs/promises";import{basename as F,dirname as o,extname as $,join as h}from"node:path";import{GenFileSchema as y,genFileFor as a}from"@allyhub/formats/data/gen";import{WordsFileSchema as A,wordsFileFor as j}from"@allyhub/formats/data/words";const u=t=>x("sha256").update(t).digest("hex");export function canonical(t){if(Array.isArray(t))return`[${t.map(canonical).join(",")}]`;if(typeof t=="object"&&t!==null){const e=t;return`{${Object.keys(e).filter(n=>e[n]!==void 0).sort().map(n=>`${JSON.stringify(n)}:${canonical(e[n])}`).join(",")}}`}return JSON.stringify(t??null)}export function inputHash(t,e){return u(canonical({tool:t,input:e}))}export const BASE64_FROM=1024,LARGE_FROM=2e3;const k=t=>t.replace(/([a-z0-9])([A-Z])/gu,"$1_$2").toLowerCase().split(/[^a-z0-9]+/u).filter(Boolean),N=new Set(["apikey","token","secret","password","passwd","passphrase","authorization","credential","credentials","cookie","bearer"]),E=new Set(["api","access","secret","private","auth","signing"]);export function isSecretName(t){const e=k(t);return e.some(n=>N.has(n))?!0:e.some((n,r)=>n==="key"&&E.has(e[r-1]??""))}function W(t){if(t.length<BASE64_FROM)return;const e=/^data:[^,]*;base64,/u.exec(t),n=e?t.slice(e[0].length):t;if(/^[A-Za-z0-9+/_-]+(?:\r?\n[A-Za-z0-9+/_-]+)*={0,2}\s*$/u.test(n))return Buffer.from(n,"base64")}const _=/^(x-amz-(signature|credential|security-token)|x-goog-(signature|credential)|signature|sig|se|sp|token|expires|key-pair-id|policy)$/iu;export function withoutSignature(t){if(!/^https?:\/\//iu.test(t))return t;let e;try{e=new URL(t)}catch{return t}return[...e.searchParams.keys()].some(n=>_.test(n))?(e.search="",`${e.toString()}?[signature redacted]`):t}const g=t=>({omitted:!0,sha256:u(t),bytes:typeof t=="string"?Buffer.byteLength(t):t.length});function c(t,e){if(e!==void 0&&isSecretName(e))return t==null?t:"[redacted]";if(typeof t=="string"){const n=W(t);return n?g(n):withoutSignature(t)}return Array.isArray(t)?t.map(n=>c(n,void 0)):typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t).map(([n,r])=>[n,c(r,n)])):t}export function recordInput(t){return c(t,void 0)}export function recordOutput(t){const e={};for(const[n,r]of Object.entries(recordInput(t))){const i=r===void 0?"null":JSON.stringify(r);e[n]=i.length>LARGE_FROM?g(i):r}return e}const m=t=>typeof t=="string"&&t!==""?t:void 0;export async function genRecord(t,e){const n=await p(t),r=e.model??m(e.output.model)??m(e.input.model);return y.parse({version:1,ai:!0,tool:e.tool,...r?{model:r}:{},input:recordInput(e.input),inputHash:inputHash(e.tool,e.input),output:recordOutput(e.output),...e.credits===void 0?{}:{credits:e.credits},at:(e.at??new Date).toISOString(),sha256:u(n),bytes:n.length})}export async function writeGen(t,e){const n=a(t);return await l(`${n}.part`,`${JSON.stringify(e,null,2)}
3
3
  `),await O(`${n}.part`,n),n}export async function readGen(t){try{const e=y.safeParse(JSON.parse(await p(a(t),"utf8")));return e.success&&e.data.inputHash!==void 0?e.data:void 0}catch{return}}const d=a("");export async function namedFile(t){if($(t))return(await b(t).catch(()=>{}))?.isFile()?t:void 0;const e=F(t),r=(await S(o(t)).catch(()=>[])).filter(s=>s.startsWith(`${e}.`)),i=r.find(s=>s.endsWith(d)&&r.includes(s.slice(0,-d.length)));if(i)return h(o(t),i.slice(0,-d.length));const f=r.find(s=>!s.endsWith(".json")&&/^\.[^.]+$/u.test(s.slice(e.length)));return f?h(o(t),f):void 0}const w=t=>Math.round(t*1e3)/1e3;export function toolWords(t){const n=(Array.isArray(t.words)?t.words:[]).flatMap(r=>{const i=r;return typeof i.text=="string"&&i.text!==""&&typeof i.start=="number"&&typeof i.end=="number"&&i.end>=i.start&&i.start>=0?[{text:i.text,start:w(i.start),end:w(i.end)}]:[]});return n.length>0?n:void 0}export async function writeWords(t,e,n){const r=j(t),i=A.parse({version:1,...n===void 0?{}:{duration:n},words:e});return await l(r,`${JSON.stringify(i,null,1)}
4
4
  `),r}
@@ -1,4 +1,4 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{spawn as k}from"node:child_process";import{mkdtemp as j,open as E,readFile as m,rename as O,rm as g,writeFile as N}from"node:fs/promises";import{tmpdir as U}from"node:os";import{join as s}from"node:path";import{fileURLToPath as b}from"node:url";import{CLIENT_ID as P,EXIT as p,SCOPES as L,SIGN_IN_LINK_PATH as R,signedInAddress as v}from"@allyhub/protocol";import{accessOf as $,authServer as A,SignedOut as D,signInWithCode as W,signInWithDevice as C}from"./credentials.js";import{nodeCommand as J}from"@allyhub/runtimes/node";import{CloudError as l,unreachable as u}from"./errors.js";import{LoopbackError as B,startLoopback as h}from"./loopback.js";import{pkcePair as z,randomState as F}from"./pkce.js";const H="idp_hint";export const SIGN_IN_WAIT_MS=5*6e4;const M=3e4;function y(){return{state:F(),...z()}}async function I(t,e,o,r={}){const i=await A(t),n=new URLSearchParams({response_type:"code",client_id:P,redirect_uri:o,scope:L,state:e.state,code_challenge:e.challenge,code_challenge_method:"S256",resource:t.url});return r.with!==void 0&&n.set(H,r.with),r.email!==void 0&&n.set("login_hint",r.email),`${i.authorization_endpoint}?${n.toString()}`}export function openBrowser(t,e){if(e.BROWSER==="none")return;const[o,r]=process.platform==="darwin"?["open",[t]]:process.platform==="win32"?["cmd",["/c","start","",t]]:["xdg-open",[t]];try{const i=k(o,r,{stdio:"ignore",detached:!0});i.on("error",()=>{}),i.unref()}catch{}}export async function signedInAs(t){try{return(await $(t.config))?.credentials.account}catch(e){if(e instanceof D)return;throw u(t.url,e)}}const S=t=>new l(t instanceof B?t.code:"sign-in-failed",t instanceof Error?t.message:String(t),{exit:p.auth,hint:"Run allyhub auth login again."});async function _(t,e,o){let r;try{r=await o.result}catch(n){throw S(n)}let i;try{i=(await W(t,{code:r,codeVerifier:e.verifier,redirectUri:o.redirectUri})).account}catch(n){const a=S(n);throw await o.finish(a),a}return await o.finish(),i}const x=(t,e={})=>v(t.url,{desktop:e.desktop});export async function signIn(t,e,o=SIGN_IN_WAIT_MS,r={}){const i=y(),n=await h({state:i.state,timeoutMs:o,landing:x(t.config,r)});try{e(await I(t.config,i,n.redirectUri,r))}catch(a){throw await n.close(),u(t.url,a)}return _(t.config,i,n)}export async function signInByEmail(t,e,o,r=SIGN_IN_WAIT_MS,i={}){const n=t.config,a=y(),f=await h({state:a.state,timeoutMs:r,landing:x(n,i)});try{const d={email:e,authorization:await I(n,a,f.redirectUri)},c=await n.fetch(`${n.url}${R}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(d)});if(!c.ok)throw new l("sign-in-failed",`AllyHub did not send the link (${String(c.status)}): ${(await c.text()).slice(0,300)}`,{exit:p.auth,status:c.status});await c.body?.cancel()}catch(d){throw await f.close(),d instanceof l?d:u(t.url,d)}return o(),_(n,a,f)}export async function signInDevice(t,e,o){try{return(await C(t.config,e,o)).account}catch(r){throw S(r)}}const G=b(new URL("./signin-worker.js",import.meta.url));export async function signInInBackground(t,e,o=SIGN_IN_WAIT_MS){const r=y(),i=await j(s(U(),"allyhub-sign-in-"));await N(s(i,"flow.json"),JSON.stringify({flow:r,timeoutMs:o}),{mode:384});const n=await E(s(i,"worker.log"),"w"),a=k(J(e),[G,i],{detached:!0,stdio:["ignore","ignore",n.fd],env:{...e}});await n.close();const f={exited:!1};a.once("exit",()=>{f.exited=!0}),a.unref();const d=Date.now()+M;for(;Date.now()<d;)try{const w=JSON.parse(await m(s(i,"ready.json"),"utf8"));return await I(t.config,r,w.redirectUri)}catch(w){if(w instanceof Error&&!("code"in w))throw u(t.url,w);if(f.exited)break;await new Promise(T=>setTimeout(T,50))}const c=(await m(s(i,"worker.log"),"utf8").catch(()=>"")).trim().split(`
2
+ import{spawn as k}from"node:child_process";import{mkdtemp as j,open as E,readFile as m,rename as O,rm as p,writeFile as N}from"node:fs/promises";import{tmpdir as U}from"node:os";import{join as s}from"node:path";import{fileURLToPath as b}from"node:url";import{CLIENT_ID as P,SCOPES as L,SIGN_IN_LINK_PATH as R,signedInAddress as v}from"@allyhub/protocol/auth";import{EXIT as g}from"@allyhub/protocol/cli";import{accessOf as $,authServer as A,SignedOut as D,signInWithCode as W,signInWithDevice as C}from"./credentials.js";import{nodeCommand as J}from"@allyhub/runtimes/node";import{CloudError as l,unreachable as u}from"./errors.js";import{LoopbackError as B,startLoopback as h}from"./loopback.js";import{pkcePair as z,randomState as F}from"./pkce.js";const H="idp_hint";export const SIGN_IN_WAIT_MS=5*6e4;const M=3e4;function y(){return{state:F(),...z()}}async function I(t,e,o,r={}){const i=await A(t),n=new URLSearchParams({response_type:"code",client_id:P,redirect_uri:o,scope:L,state:e.state,code_challenge:e.challenge,code_challenge_method:"S256",resource:t.url});return r.with!==void 0&&n.set(H,r.with),r.email!==void 0&&n.set("login_hint",r.email),`${i.authorization_endpoint}?${n.toString()}`}export function openBrowser(t,e){if(e.BROWSER==="none")return;const[o,r]=process.platform==="darwin"?["open",[t]]:process.platform==="win32"?["cmd",["/c","start","",t]]:["xdg-open",[t]];try{const i=k(o,r,{stdio:"ignore",detached:!0});i.on("error",()=>{}),i.unref()}catch{}}export async function signedInAs(t){try{return(await $(t.config))?.credentials.account}catch(e){if(e instanceof D)return;throw u(t.url,e)}}const S=t=>new l(t instanceof B?t.code:"sign-in-failed",t instanceof Error?t.message:String(t),{exit:g.auth,hint:"Run allyhub auth login again."});async function _(t,e,o){let r;try{r=await o.result}catch(n){throw S(n)}let i;try{i=(await W(t,{code:r,codeVerifier:e.verifier,redirectUri:o.redirectUri})).account}catch(n){const a=S(n);throw await o.finish(a),a}return await o.finish(),i}const x=(t,e={})=>v(t.url,{desktop:e.desktop});export async function signIn(t,e,o=SIGN_IN_WAIT_MS,r={}){const i=y(),n=await h({state:i.state,timeoutMs:o,landing:x(t.config,r)});try{e(await I(t.config,i,n.redirectUri,r))}catch(a){throw await n.close(),u(t.url,a)}return _(t.config,i,n)}export async function signInByEmail(t,e,o,r=SIGN_IN_WAIT_MS,i={}){const n=t.config,a=y(),f=await h({state:a.state,timeoutMs:r,landing:x(n,i)});try{const d={email:e,authorization:await I(n,a,f.redirectUri)},c=await n.fetch(`${n.url}${R}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(d)});if(!c.ok)throw new l("sign-in-failed",`AllyHub did not send the link (${String(c.status)}): ${(await c.text()).slice(0,300)}`,{exit:g.auth,status:c.status});await c.body?.cancel()}catch(d){throw await f.close(),d instanceof l?d:u(t.url,d)}return o(),_(n,a,f)}export async function signInDevice(t,e,o){try{return(await C(t.config,e,o)).account}catch(r){throw S(r)}}const G=b(new URL("./signin-worker.js",import.meta.url));export async function signInInBackground(t,e,o=SIGN_IN_WAIT_MS){const r=y(),i=await j(s(U(),"allyhub-sign-in-"));await N(s(i,"flow.json"),JSON.stringify({flow:r,timeoutMs:o}),{mode:384});const n=await E(s(i,"worker.log"),"w"),a=k(J(e),[G,i],{detached:!0,stdio:["ignore","ignore",n.fd],env:{...e}});await n.close();const f={exited:!1};a.once("exit",()=>{f.exited=!0}),a.unref();const d=Date.now()+M;for(;Date.now()<d;)try{const w=JSON.parse(await m(s(i,"ready.json"),"utf8"));return await I(t.config,r,w.redirectUri)}catch(w){if(w instanceof Error&&!("code"in w))throw u(t.url,w);if(f.exited)break;await new Promise(T=>setTimeout(T,50))}const c=(await m(s(i,"worker.log"),"utf8").catch(()=>"")).trim().split(`
3
3
  `).slice(-5).join(`
4
- `);throw await g(i,{recursive:!0,force:!0}),new l("sign-in-failed",c?`The sign-in listener did not start: ${c}`:"The sign-in listener did not start.",{exit:p.platform})}export async function serveSignIn(t,e){const{flow:o,timeoutMs:r}=JSON.parse(await m(s(e,"flow.json"),"utf8"));await g(s(e,"flow.json"),{force:!0});const i=await h({state:o.state,timeoutMs:r,landing:x(t)});await N(s(e,"ready.json.tmp"),JSON.stringify({redirectUri:i.redirectUri})),await O(s(e,"ready.json.tmp"),s(e,"ready.json"));try{await _(t,o,i)}finally{await new Promise(n=>setTimeout(n,200)),await g(e,{recursive:!0,force:!0})}}
4
+ `);throw await p(i,{recursive:!0,force:!0}),new l("sign-in-failed",c?`The sign-in listener did not start: ${c}`:"The sign-in listener did not start.",{exit:g.platform})}export async function serveSignIn(t,e){const{flow:o,timeoutMs:r}=JSON.parse(await m(s(e,"flow.json"),"utf8"));await p(s(e,"flow.json"),{force:!0});const i=await h({state:o.state,timeoutMs:r,landing:x(t)});await N(s(e,"ready.json.tmp"),JSON.stringify({redirectUri:i.redirectUri})),await O(s(e,"ready.json.tmp"),s(e,"ready.json"));try{await _(t,o,i)}finally{await new Promise(n=>setTimeout(n,200)),await p(e,{recursive:!0,force:!0})}}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{DeploymentMadeSchema as S,SITES_PATH as n,SITE_PERSON_QUERY as p,SiteDetailSchema as m,SiteLiveAnswerSchema as h,SiteSchema as o,SitesResponseSchema as y,siteDeploymentsPath as d,siteLivePath as i,sitePath as r,siteSettingsPath as P}from"@allyhub/protocol";export const listSites=async e=>y.parse(await e.json(n)),createSite=async(e,t)=>o.parse(await e.json(n,{method:"POST",body:t})),addDeployment=async(e,t,s)=>S.parse(await e.json(d(t),{method:"POST",body:s,signal:AbortSignal.timeout(12e4)})),siteDetail=async(e,t)=>m.parse(await e.json(r(t)));const a=(e,t)=>t?`${e}?${p}`:e;export const goLive=async(e,t,s,c={})=>h.parse(await e.json(a(i(t),c.person===!0),{method:"PUT",body:{deployment:s}})),unpublishSite=async(e,t)=>o.parse(await e.json(a(i(t),!0),{method:"DELETE"})),removeSite=async(e,t)=>{await e.json(a(r(t),!0),{method:"DELETE"})},changeSite=async(e,t,s)=>o.parse(await e.json(a(P(t),!0),{method:"PUT",body:s}));
2
+ import{DeploymentMadeSchema as S,SITES_PATH as n,SITE_PERSON_QUERY as p,SiteDetailSchema as m,SiteLiveAnswerSchema as h,SiteSchema as o,SitesResponseSchema as y,siteDeploymentsPath as d,siteLivePath as i,sitePath as r,siteSettingsPath as P}from"@allyhub/protocol/sites";export const listSites=async e=>y.parse(await e.json(n)),createSite=async(e,t)=>o.parse(await e.json(n,{method:"POST",body:t})),addDeployment=async(e,t,s)=>S.parse(await e.json(d(t),{method:"POST",body:s,signal:AbortSignal.timeout(12e4)})),siteDetail=async(e,t)=>m.parse(await e.json(r(t)));const a=(e,t)=>t?`${e}?${p}`:e;export const goLive=async(e,t,s,c={})=>h.parse(await e.json(a(i(t),c.person===!0),{method:"PUT",body:{deployment:s}})),unpublishSite=async(e,t)=>o.parse(await e.json(a(i(t),!0),{method:"DELETE"})),removeSite=async(e,t)=>{await e.json(a(r(t),!0),{method:"DELETE"})},changeSite=async(e,t,s)=>o.parse(await e.json(a(P(t),!0),{method:"PUT",body:s}));
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{BILLING_SUMMARY_PATH as e,BROWSER_LINK_PATH as i,BillingSummarySchema as t,BrowserLinkSchema as o,ORGANIZATIONS_PATH as s,OrganizationsSchema as c}from"@allyhub/protocol";export async function billingSummary(n){return t.parse(await n.json(e))}export async function organizations(n){return c.parse(await n.json(s)).organizations}export async function browserLink(n,a){return o.parse(await n.json(i,{method:"POST",body:{to:a}})).url}export async function webLink(n,a){const r=new URL(a,n.config.url);return n.config.apiKey!==void 0?r.href:browserLink(n,`${r.pathname}${r.search}`).catch(()=>r.href)}
2
+ import{BILLING_SUMMARY_PATH as i,BillingSummarySchema as e}from"@allyhub/protocol/cloud";import{BROWSER_LINK_PATH as o,BrowserLinkSchema as t}from"@allyhub/protocol/auth";import{ORGANIZATIONS_PATH as s,OrganizationsSchema as c}from"@allyhub/protocol/teams";export async function billingSummary(n){return e.parse(await n.json(i))}export async function organizations(n){return c.parse(await n.json(s)).organizations}export async function browserLink(n,a){return t.parse(await n.json(o,{method:"POST",body:{to:a}})).url}export async function webLink(n,a){const r=new URL(a,n.config.url);return n.config.apiKey!==void 0?r.href:browserLink(n,`${r.pathname}${r.search}`).catch(()=>r.href)}
@@ -0,0 +1,2 @@
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,callsMadeInBackground,scrub}from"./client.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";
@@ -1,3 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{createHash as b}from"node:crypto";import{chmod as U,mkdir as F,readFile as x,realpath as S,stat as P,writeFile as C}from"node:fs/promises";import{basename as D,dirname as N,extname as _,isAbsolute as L,join as R,relative as A,resolve as g}from"node:path";import{EXIT as $,FILES_PATH as M,FILE_MAX_BYTES as O,FileContentResponseSchema as z,FileCreatedSchema as v,UploadedFileSchema as X,fileContentPath as q,fileDonePath as H}from"@allyhub/protocol";import{CloudError as p}from"./errors.js";export const UPLOAD_TYPES={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",mp3:"audio/mpeg",wav:"audio/wav",m4a:"audio/mp4",aac:"audio/aac",ogg:"audio/ogg",oga:"audio/ogg",flac:"audio/flac",mp4:"video/mp4",mov:"video/quicktime",webm:"video/webm"},REUSE_LEFT_MS=3600*1e3;const K=720*60*60*1e3;export const UPLOAD_CONCURRENCY=4;const Y=Object.keys(UPLOAD_TYPES).map(e=>`.${e}`).join(", ");async function j(e){const t=(await e.key())?.account??"",i=b("sha256").update(`${e.url}
2
+ import{createHash as b}from"node:crypto";import{chmod as U,mkdir as F,readFile as x,realpath as S,stat as P,writeFile as C}from"node:fs/promises";import{basename as D,dirname as N,extname as _,isAbsolute as L,join as R,relative as A,resolve as g}from"node:path";import{EXIT as $}from"@allyhub/protocol/cli";import{FILES_PATH as M,FILE_MAX_BYTES as O,FileContentResponseSchema as z,FileCreatedSchema as v,UploadedFileSchema as X,fileContentPath as q,fileDonePath as H}from"@allyhub/protocol/cloud";import{CloudError as p}from"./errors.js";export const UPLOAD_TYPES={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",mp3:"audio/mpeg",wav:"audio/wav",m4a:"audio/mp4",aac:"audio/aac",ogg:"audio/ogg",oga:"audio/ogg",flac:"audio/flac",mp4:"video/mp4",mov:"video/quicktime",webm:"video/webm"},REUSE_LEFT_MS=3600*1e3;const K=720*60*60*1e3;export const UPLOAD_CONCURRENCY=4;const Y=Object.keys(UPLOAD_TYPES).map(e=>`.${e}`).join(", ");async function j(e){const t=(await e.key())?.account??"",i=b("sha256").update(`${e.url}
3
3
  ${t}`).digest("hex").slice(0,12);return R(e.config.cacheDir,`uploads-${i}.json`)}async function E(e){try{const t=JSON.parse(await x(e,"utf8"));return{files:t.files??{},urls:t.urls??{}}}catch{return{files:{},urls:{}}}}async function J(e,t){const i=Date.now();for(const[c,o]of Object.entries(t.urls))i-Date.parse(o.expiresAt??o.at)>K&&Reflect.deleteProperty(t.urls,c);await F(N(e),{recursive:!0}),await C(e,JSON.stringify(t),{mode:384}),await U(e,384)}export function urlExpiry(e){let t;try{t=new URL(e).searchParams}catch{return}const i=/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})Z$/u.exec(t.get("X-Amz-Date")??""),c=Number(t.get("X-Amz-Expires"));if(!i||!Number.isFinite(c)||c<=0)return;const[o,r,l,a,n,u]=i.slice(1).map(Number);return new Date(Date.UTC(o,r-1,l,a,n,u)+c*1e3).toISOString()}const T=async e=>await S(g(e)).catch(()=>g(e)),y=(e,t)=>{const i=A(e,t);return i.startsWith("..")||L(i)},w=(e,t)=>new p("bad-input",e,{exit:$.usage,...t===void 0?{}:{hint:t}});async function W(e,t){const i=g(t.base,e),c=()=>w(`${e} is not inside ${String(t.inside)}.`,"Upload a file of the project.");if(t.inside!==void 0&&y(g(t.inside),i))throw c();const o=await P(i).catch(()=>{});if(!o?.isFile())throw w(`There is no file ${i}.`,"A relative path is read from the folder it is run in.");const r=await S(i);if(t.inside!==void 0&&y(await T(t.inside),r))throw c();const l=_(r).slice(1).toLowerCase(),a=UPLOAD_TYPES[l];if(a===void 0)throw w(`${e} is a${l?` .${l}`:"n unnamed"} file; an upload is one of ${Y}.`,"Convert it first, for example with ffmpeg.");if(o.size>O)throw w(`${e} is ${String(o.size)} bytes; AllyHub keeps files of at most ${String(O)}.`,"Make it smaller first, for example with ffmpeg.");const n=await x(r);return{given:e,path:r,type:a,sha256:b("sha256").update(n).digest("hex"),bytes:n}}async function B(e,t,i){const c=new Array(e.length);let o=0;const r=async()=>{for(;o<e.length;){const l=o++;c[l]=await i(e[l])}};return await Promise.all(Array.from({length:Math.min(t,e.length)},r)),c}async function k(e,t,i,c){const o=i.files[t.sha256];if(o&&!c)return{fileId:o.fileId,known:!0};const r={name:D(t.path),size:t.bytes.length,sha256:t.sha256,contentType:t.type},l=v.parse(await e.json(M,{method:"POST",body:r}));if(l.upload!==null){const n=await e.config.fetch(l.upload.url,{method:"PUT",headers:l.upload.headers,body:new Uint8Array(t.bytes),signal:AbortSignal.timeout(3e5)});if(!n.ok)throw new p("upload-failed",`Storage refused ${t.given}: ${String(n.status)} ${(await n.text()).slice(0,200)}`,{exit:$.platform})}const a=X.parse(await e.json(H(l.id),{method:"POST"}));return i.files[t.sha256]={fileId:a.id,path:t.path,bytes:t.bytes.length},{fileId:a.id,known:!1}}const I=async(e,t)=>z.parse(await e.json(q(t,"inline"))).url;export async function uploadFiles(e,t,i){if(t.length===0)throw w("Name at least one file to upload.");const c=[];for(const a of t)c.push(await W(a,{base:i.base,...i.inside===void 0?{}:{inside:i.inside}}));await e.requireKey();const o=await j(e),r=await E(o),l=await B(c,i.concurrency??UPLOAD_CONCURRENCY,async a=>{const n=(s,d,f,m,h)=>({ok:!0,file:a.given,path:a.path,fileId:s,url:d,...f===void 0?{}:{expiresAt:f},sha256:a.sha256,bytes:a.bytes.length,contentType:a.type,known:m,reused:h}),u=r.files[a.sha256];if(u){const s=Date.now(),d=Object.entries(r.urls).find(([,f])=>f.sha256===a.sha256&&f.expiresAt!==void 0&&Date.parse(f.expiresAt)-s>=REUSE_LEFT_MS);if(d)return u.path=a.path,n(u.fileId,d[0],d[1].expiresAt,!0,!0)}try{let s=await k(e,a,r,!1),d;try{d=await I(e,s.fileId)}catch(h){if(!s.known||!(h instanceof p)||h.status!==404)throw h;s=await k(e,a,r,!0),d=await I(e,s.fileId)}const f=urlExpiry(d);r.urls[d]={sha256:a.sha256,...f===void 0?{}:{expiresAt:f},at:new Date().toISOString()};const m=r.files[a.sha256];return m&&(m.path=a.path),n(s.fileId,d,f,s.known,!1)}catch(s){if(!(s instanceof p)||s.code==="not-signed-in")throw s;return{ok:!1,file:a.given,error:new p(s.code==="api-error"?"upload-failed":s.code,`Uploading ${a.given} failed. ${s.message}`,{exit:s.exit,...s.hint?{hint:s.hint}:{}})}}});return await J(o,r),l}export async function withKnownUploads(e,t,i){const c=await E(await j(e)),o=await T(i),r=n=>y(o,n)?n:A(o,n),l=new Map;for(const[n,u]of Object.entries(c.urls)){const s=c.files[u.sha256];s&&l.set(n,{uploaded:r(s.path),sha256:u.sha256,bytes:s.bytes})}const a=n=>typeof n=="string"?l.get(n)??n:Array.isArray(n)?n.map(a):typeof n=="object"&&n!==null?Object.fromEntries(Object.entries(n).map(([u,s])=>[u,a(s)])):n;return a(t)}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{copyFile as c,mkdir as p,mkdtemp as s,rm as w}from"node:fs/promises";import{tmpdir as v}from"node:os";import{dirname as x,extname as I,join as r}from"node:path";import{WORK_DIR as g,genFileFor as k}from"@allyhub/formats";import{EXIT as F}from"@allyhub/protocol";import{callTool as b}from"./call.js";import{CloudError as h}from"./errors.js";import{toolWords as D,writeWords as W}from"./records.js";export function sayInput(o){return{...o.params??{},text:o.text,...o.voice===void 0?{}:{voiceId:o.voice}}}export async function makeSay(o,e,n,f){const u=await s(r(v(),"allyhub-voice-"));try{const t=await b(o,n.tool,sayInput(n),{...f,outDir:u,outputDir:r(e,g,"voice"),wait:!0});if("jobId"in t||t.file===void 0)throw new h("no-audio",`${n.tool} returned no audio file.`,{exit:F.platform});const d=D(t.output)??[],a=t.output.durationSeconds,m=typeof a=="number"?a:d.at(-1)?.end??0,i=`${n.stem}${I(t.file).toLowerCase()||".mp3"}`;await p(x(r(e,i)),{recursive:!0}),await c(t.file,r(e,i)),t.gen&&await c(t.gen,r(e,k(i)));const l=await W(r(e,i),d,m>=0?m:void 0);return{file:i,words:l.slice(e.length+1),seconds:m,credits:t.credits??0}}finally{await w(u,{recursive:!0,force:!0})}}
2
+ import{copyFile as c,mkdir as p,mkdtemp as s,rm as w}from"node:fs/promises";import{tmpdir as v}from"node:os";import{dirname as x,extname as I,join as r}from"node:path";import{WORK_DIR as g}from"@allyhub/formats/layout";import{genFileFor as k}from"@allyhub/formats/data/gen";import{EXIT as F}from"@allyhub/protocol/cli";import{callTool as b}from"./call.js";import{CloudError as h}from"./errors.js";import{toolWords as D,writeWords as W}from"./records.js";export function sayInput(t){return{...t.params??{},text:t.text,...t.voice===void 0?{}:{voiceId:t.voice}}}export async function makeSay(t,e,n,f){const u=await s(r(v(),"allyhub-voice-"));try{const o=await b(t,n.tool,sayInput(n),{...f,outDir:u,outputDir:r(e,g,"voice"),wait:!0});if("jobId"in o||o.file===void 0)throw new h("no-audio",`${n.tool} returned no audio file.`,{exit:F.platform});const d=D(o.output)??[],a=o.output.durationSeconds,m=typeof a=="number"?a:d.at(-1)?.end??0,i=`${n.stem}${I(o.file).toLowerCase()||".mp3"}`;await p(x(r(e,i)),{recursive:!0}),await c(o.file,r(e,i)),o.gen&&await c(o.gen,r(e,k(i)));const l=await W(r(e,i),d,m>=0?m:void 0);return{file:i,words:l.slice(e.length+1),seconds:m,credits:o.credits??0}}finally{await w(u,{recursive:!0,force:!0})}}
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "@allyhub/cloud",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
8
8
  "default": "./dist/index.js"
9
+ },
10
+ "./tools": {
11
+ "types": "./dist/tools.d.ts",
12
+ "default": "./dist/tools.js"
9
13
  }
10
14
  },
11
15
  "private": true,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/components",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/dev-server",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/diagnostics",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/doc",
3
- "version": "0.18.0",
3
+ "version": "0.19.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{readFile as f,stat as w}from"node:fs/promises";import{join as u,relative as k,resolve as b,sep as y}from"node:path";import{readWork as x}from"@allyhub/build";import{componentDraws as D,everyBlock as $,parseDoc as m}from"@allyhub/doc";import{itemIdOf as j,listedWork as v}from"@allyhub/formats";import{CommandError as W,EXIT as B}from"@allyhub/protocol";const C=/\.mdx?$/iu;export async function findDoc(r,i,c){const t=b(i,c),o=k(r,t).split(y).join("/"),a=v((await x(r)).work);if(C.test(t)&&(await w(t).catch(()=>{}))?.isFile())return a.some(s=>s.file===o&&s.kind!=="doc")?void 0:t;const e=new Set([o,c.replace(/^\.\//u,"").replace(/\/+$/u,"")]),n=a.find(s=>s.kind==="doc"&&e.has(j(s.file)));return n===void 0?void 0:u(r,n.file)}export function pagesOf(r){const i=[];for(const c of r.split(",")){const t=/^\s*(\d+)\s*(?:-\s*(\d+)\s*)?$/u.exec(c),o=Number(t?.[1]),a=t?.[2]===void 0?o:Number(t[2]);if(!t||o<1||a<o)throw new W("bad-page",`Cannot read the pages "${r}".`,{exit:B.usage,hint:"Write pages from 1, joined with commas: --page 2, --page 2-4, --page 1,5."});for(let e=o;e<=a;e++)i.push(e)}return i}export async function fromBuild(r,i,c){const t=await f(r,"utf8"),o=e=>e.type==="component"||e.type==="chart"&&e.data!==void 0,a=m(t);return![...$(a.blocks)].some(o)&&a.page.bibliography===void 0?{}:c(async e=>{const n=e.prepared.docs.find(h=>h.place===i);if(!n)return{};const s=e.prepared.messages.locales[0],d=n.components.length===0?[]:D(m(await f(u(e.prepared.root,n.file),"utf8")).blocks),p=s===void 0?{}:{lang:s},l=d.length===0?void 0:await e.componentStills(n,d,p),g=d.length===0?void 0:await e.componentMeasures?.(n,d,p);return{stills:l,measures:g,data:n.data,sources:n.sources}})}
2
+ import{readFile as l,stat as b}from"node:fs/promises";import{join as g,relative as y,resolve as x,sep as D}from"node:path";import{readWork as $}from"@allyhub/build";import{itemIdOf as j,listedWork as v}from"@allyhub/formats";import{CommandError as W,EXIT as B}from"@allyhub/protocol";const C=/\.mdx?$/iu;export async function findDoc(o,c,d){const e=x(c,d),t=y(o,e).split(D).join("/"),s=v((await $(o)).work);if(C.test(e)&&(await b(e).catch(()=>{}))?.isFile())return s.some(a=>a.file===t&&a.kind!=="doc")?void 0:e;const r=new Set([t,d.replace(/^\.\//u,"").replace(/\/+$/u,"")]),p=s.find(a=>a.kind==="doc"&&r.has(j(a.file)));return p===void 0?void 0:g(o,p.file)}export function pagesOf(o){const c=[];for(const d of o.split(",")){const e=/^\s*(\d+)\s*(?:-\s*(\d+)\s*)?$/u.exec(d),t=Number(e?.[1]),s=e?.[2]===void 0?t:Number(e[2]);if(!e||t<1||s<t)throw new W("bad-page",`Cannot read the pages "${o}".`,{exit:B.usage,hint:"Write pages from 1, joined with commas: --page 2, --page 2-4, --page 1,5."});for(let r=t;r<=s;r++)c.push(r)}return c}export async function fromBuild(o,c,d){const e=await l(o,"utf8"),{componentDraws:t,everyBlock:s,parseDoc:r}=await import("@allyhub/doc"),p=n=>n.type==="component"||n.type==="chart"&&n.data!==void 0,a=r(e);return![...s(a.blocks)].some(p)&&a.page.bibliography===void 0?{}:d(async n=>{const i=n.prepared.docs.find(k=>k.place===c);if(!i)return{};const u=n.prepared.messages.locales[0],f=i.components.length===0?[]:t(r(await l(g(n.prepared.root,i.file),"utf8")).blocks),m=u===void 0?{}:{lang:u},h=f.length===0?void 0:await n.componentStills(i,f,m),w=f.length===0?void 0:await n.componentMeasures?.(i,f,m);return{stills:h,measures:w,data:i.data,sources:i.sources}})}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{readFile as r}from"node:fs/promises";import{join as c}from"node:path";import{componentAt as f,everyBlock as u,parseDoc as s,splitTitle as a,titleText as p}from"@allyhub/doc";export const PREVIEW_DEFAULTS={lines:4,chars:240};function l(t){if(!("content"in t)||!Array.isArray(t.content))return;const n=t.content.map(e=>e.text).join("").trim();return n===""?void 0:n}const h=(t,n)=>t.length<=n?t:`${t.slice(0,n-1).trimEnd()}…`;export function docPreview(t){const{body:n}=a(s(t).blocks),e=[];for(const i of n){const o=l(i);if(o!==void 0&&e.push(h(o,PREVIEW_DEFAULTS.chars)),e.length===PREVIEW_DEFAULTS.lines)break}return{type:"text",lines:e}}export async function docTitle(t,n){try{const e=await r(c(t,n.entry),"utf8");return p(a(s(e).blocks).title)||void 0}catch{return}}export async function docSnapshot(t,{root:n,tool:e}){await e("doc/data",{item:t.id}).catch(()=>{});const i=await r(c(n,t.entry),"utf8").catch(()=>{});if(i===void 0)return{};const o=[];for(const d of u(s(i).blocks))d.type==="component"&&o.push(f(d));return o.length===0?{}:{stills:[{version:"",components:o}]}}export function activate(t){t.subscriptions.push(t.allyhub.kinds.registerKindProvider("doc",{preview:async(n,{root:e})=>docPreview(await r(c(e,n.entry),"utf8")),title:(n,{root:e})=>docTitle(e,n),snapshot:(n,e)=>docSnapshot(n,e)}))}
2
+ import{readFile as a}from"node:fs/promises";import{join as d}from"node:path";const u=()=>import("@allyhub/doc");export const PREVIEW_DEFAULTS={lines:4,chars:240};function p(t){if(!("content"in t)||!Array.isArray(t.content))return;const n=t.content.map(e=>e.text).join("").trim();return n===""?void 0:n}const l=(t,n)=>t.length<=n?t:`${t.slice(0,n-1).trimEnd()}…`;export async function docPreview(t){const{parseDoc:n,splitTitle:e}=await u(),{body:i}=e(n(t).blocks),o=[];for(const r of i){const c=p(r);if(c!==void 0&&o.push(l(c,PREVIEW_DEFAULTS.chars)),o.length===PREVIEW_DEFAULTS.lines)break}return{type:"text",lines:o}}export async function docTitle(t,n){try{const e=await a(d(t,n.entry),"utf8"),{parseDoc:i,splitTitle:o,titleText:r}=await u();return r(o(i(e).blocks).title)||void 0}catch{return}}export async function docSnapshot(t,{root:n,tool:e}){await e("doc/data",{item:t.id}).catch(()=>{});const i=await a(d(n,t.entry),"utf8").catch(()=>{});if(i===void 0)return{};const{componentAt:o,everyBlock:r,parseDoc:c}=await u(),s=[];for(const f of r(c(i).blocks))f.type==="component"&&s.push(o(f));return s.length===0?{}:{stills:[{version:"",components:s}]}}export function activate(t){t.subscriptions.push(t.allyhub.kinds.registerKindProvider("doc",{preview:async(n,{root:e})=>docPreview(await a(d(e,n.entry),"utf8")),title:(n,{root:e})=>docTitle(e,n),snapshot:(n,e)=>docSnapshot(n,e)}))}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/doc-extension",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./cli": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/doc-print",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/export",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/extension-api",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{CORE as _,declareRules as v,ruleOf as C}from"@allyhub/diagnostics";import{STAGE_LOADS as R}from"@allyhub/formats";import{LOCALES as A}from"@allyhub/i18n";import{PROJECT_TOOLS as L,RuntimeSchema as M,StageFolderSchema as W,StageLoadSchema as V,known as D}from"@allyhub/protocol";import{z as n}from"zod";import{KEY as K,MENUS as U,SETTING_TYPES as E,VIEW_CONTAINERS as p,inMenuBar as G,settingProblem as O,whenProblem as H}from"./shell.js";export const definePoint=e=>e,WordsSchema=n.record(n.string(),n.string().min(1));export function missingLocales(e){return A.filter(t=>!(t in e))}export const wordIn=(e,t)=>e[t]??e.en??Object.values(e)[0]??"";const h=n.string().regex(/^(@[a-z0-9][\w.-]*\/)?[a-z0-9][\w.-]*(\/[\w.-]+)*$/u);function b(e,t,i){if(typeof e!="object"||e===null||Array.isArray(e))return`is not an object of ${t}.`;const o=[];for(const[s,r]of Object.entries(e)){if(!Array.isArray(r))return`.${s} is not a list.`;r.forEach((d,u)=>{o.push([`.${s}[${String(u)}]`,typeof d=="object"&&d!==null?{...d,[i]:s}:d])})}return o}const y=n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),f=n.string().superRefine((e,t)=>{const i=H(e);i!==void 0&&t.addIssue({code:"custom",message:i})}),J=n.object({id:y,title:WordsSchema,enablement:f.optional(),place:n.enum(["workspace","ui"]).default("workspace")});export const COMMANDS=definePoint({id:"commands",about:"Commands a person runs from the palette, the menus and the keys.",entry:J,key:e=>e.id,activation:(e,t)=>e.place===t?[`onCommand:${e.id}`]:[],check:e=>{const t=missingLocales(e.title);return t.length>0?[`${e.id}'s title has no words in ${t.join(", ")}.`]:[]}});const B=n.object({command:y,key:n.string().regex(K,{message:"A key is modifiers among Mod, Shift and Alt, then a capital letter, a digit, a sign or a key's name (Mod+Shift+H)."}),when:f.optional()});export const KEYBINDING_POINT=definePoint({id:"keybindings",about:"Keys that run commands, each while its when clause holds.",entry:B});const F=n.object({menu:n.string().min(1),command:y,when:f.optional(),group:n.string().min(1).optional()});export const MENU_POINT=definePoint({id:"menus",about:`Commands in menus, by menu (${U.join(", ")}), each while its when clause holds.`,entry:F,entries:e=>b(e,"menus","menu"),check:e=>G(e.menu)?[`${e.command} is not placed in ${e.menu}: Studio's menu bar shows the core's entries alone yet.`]:[]});const x="Studio places no extension's view yet; its work card and its sidebar show the core's alone.",Y=n.object({location:n.string().min(1),id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),title:WordsSchema,icon:n.string().min(1).optional()});export const VIEW_CONTAINER_POINT=definePoint({id:"viewsContainers",about:`Containers of views, by where each goes; the shell gives its own (${p.join(", ")}) and takes none of an extension's yet.`,entry:Y,entries:e=>b(e,"places","location"),key:e=>e.id,check:e=>{const t=missingLocales(e.title);return[...t.length>0?[`${e.id}'s title has no words in ${t.join(", ")}.`]:[],`the container ${e.id} is not placed: ${x}`]}});const Z=n.object({container:n.string().min(1),id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),name:WordsSchema,when:f.optional(),icon:n.string().min(1).optional(),module:h.optional()});export const VIEW_POINT=definePoint({id:"views",about:`Views, by the container each is in (${p.join(", ")}): a page in a frame, as an editor is.`,entry:Z,entries:e=>b(e,"containers","container"),key:e=>e.id,check:e=>{const t=missingLocales(e.name);return[...p.includes(e.container)?[]:[`${e.container} is not a container: a view goes in ${p.join(" or ")}.`],...t.length>0?[`${e.id}'s name has no words in ${t.join(", ")}.`]:[],...e.module===void 0?[`${e.id} names no module: a view is a page's module, as an editor is.`]:[],`the view ${e.id} is not placed: ${x}`]}});const S=n.union([n.string(),n.boolean(),n.number()]),X=n.object({type:n.string().min(1),default:S.optional(),title:WordsSchema,description:WordsSchema.optional(),enum:n.array(S).min(1).optional(),enumItemLabels:n.array(WordsSchema).optional(),enumDescriptions:n.array(WordsSchema).optional(),minimum:n.number().optional(),maximum:n.number().optional(),minLength:n.number().int().min(0).optional(),order:n.number().int().optional()}),q=n.object({title:WordsSchema,order:n.number().int().optional(),properties:n.record(n.string(),X)});function Q(e,t){const i=[],o=(s,r)=>{const d=missingLocales(r);d.length>0&&i.push(`${e}'s ${s} has no words in ${d.join(", ")}.`)};return o("title",t.title),t.description!==void 0&&o("description",t.description),t.enumItemLabels?.forEach((s,r)=>{o(`label of choice ${String(r+1)}`,s)}),t.enumDescriptions?.forEach((s,r)=>{o(`description of choice ${String(r+1)}`,s)}),i}export const CONFIGURATION_POINT=definePoint({id:"configuration",about:"Settings: a title and JSON Schema properties by key, drawn as rows in the shell and read through allyhub.settings.",entry:q,entries:e=>Array.isArray(e)?e.map((t,i)=>[`[${String(i)}]`,t]):typeof e=="object"&&e!==null?[["",e]]:"is not a configuration or a list of them.",check:(e,t)=>{const i=[],o=missingLocales(e.title);o.length>0&&i.push(`a configuration's title has no words in ${o.join(", ")}.`);for(const[s,r]of Object.entries(e.properties)){if((!s.startsWith(`${t}.`)||s===`${t}.`)&&i.push(`${s} is not named by its extension: a setting's key is ${t}. and a name.`),i.push(...Q(s,r)),!E.includes(r.type)){i.push(`${s} is of type ${r.type}: a shell draws ${E.join(", ")}.`);continue}const d={...r,type:r.type};for(const[u,m]of(r.enum??[]).entries()){const c=O({type:d.type},m);c!==void 0&&i.push(`${s}'s choice ${String(u+1)}: ${c}`)}if(r.default!==void 0){const u=O(d,r.default);u!==void 0&&i.push(`${s}'s default: ${u}`)}for(const u of["enumItemLabels","enumDescriptions"]){const m=r[u];m!==void 0&&m.length!==(r.enum?.length??0)&&i.push(`${s}'s ${u} are ${String(m.length)}, and its choices ${String(r.enum?.length??0)}.`)}}return i}});const ee=n.object({name:n.string().regex(/^[a-z0-9][a-z0-9_-]*$/u),title:n.string().min(1),description:n.string().min(1),inputSchema:n.record(n.string(),n.unknown()),annotations:n.object({readOnlyHint:n.boolean(),destructiveHint:n.boolean(),idempotentHint:n.boolean(),openWorldHint:n.boolean()}).partial().optional()});export const WINDOW_TOOL_POINT=definePoint({id:"windowTools",about:"Tools an agent calls that act in the person's window, during its own turn: a name, a description, a JSON Schema of the input.",entry:ee,key:e=>e.name,check:e=>{const t=z(e.inputSchema);return[...t===void 0?[]:[`${e.name}'s inputSchema ${t}`],`the window tool ${e.name} is not given: Studio's MCP server gives the core's tools alone yet.`]}});const ne=n.object({name:n.string().regex(/^[a-z0-9][a-z0-9-]*( [a-z0-9][a-z0-9-]*){0,2}$/u),summary:n.string().min(1),work:n.string().min(1).optional(),module:n.string().min(1)});export const CLI_COMMANDS=definePoint({id:"cliCommands",about:"Commands the agent runs, `allyhub <name>`, listed in `allyhub help` before their module is loaded.",entry:ne,key:e=>e.name});const te=n.object({name:n.string().regex(/^[a-z0-9][a-z0-9.-]*\/[a-z][a-z0-9-]*$/u),source:n.enum(["project","asleep","machine"]),does:n.union([n.object({command:n.string().min(1)}),n.object({files:n.string().min(1)}),n.object({person:n.string().min(1)})]),module:n.string().min(1),readView:h.optional()});export const PROJECT_TOOL_POINT=definePoint({id:"projectTools",about:"Project tools: what an editor asks of a project through tools/call, each with the command or files that do the same for the agent.",entry:te,key:e=>e.name,check:(e,t)=>{if(Object.hasOwn(L,e.name))return[`${e.name} is the core's own project tool.`];const i=e.name.slice(0,e.name.lastIndexOf("/"));return T(t)||i===t?[]:[`the project tool ${e.name} does not start with its extension's id (${t}/…).`]}});const oe=n.object({folder:W,loads:n.array(V),module:n.string().min(1)});export const STAGE_ROUTE_POINT=definePoint({id:"stageRoutes",about:"Stage routes: a folder of the stage's tree an extension answers, what the stage's pages load from it, and what a snapshot records of it.",entry:oe,key:e=>e.folder});const ie=n.object({name:n.string().min(1),only:n.array(n.string().min(1)).min(1),values:n.array(n.string().min(1)).optional()}),se=n.object({files:n.record(n.string().min(1),n.string()),entry:n.string().min(1)}),w=e=>!e.startsWith("/")&&!e.includes("\\")&&e.split("/").every(t=>t!==""&&t!=="."&&t!==".."),ae=n.object({id:n.string().regex(/^[a-z][a-z0-9-]*$/u),name:WordsSchema,plural:WordsSchema.optional(),noun:n.string().min(1),part:n.object({noun:n.string().min(1),plural:n.string().min(1)}).optional(),pages:n.boolean().optional(),editor:n.string().min(1).optional(),shown:n.object({line:WordsSchema,order:n.number()}).optional(),icon:n.string().min(1).optional(),color:n.string().min(1).optional(),exports:n.object({types:n.array(n.string().min(1)).min(1),extras:n.array(n.string().min(1)).default([]),options:n.array(ie).default([]),names:n.record(n.string().min(1),WordsSchema).default({})}).optional(),renders:n.object({types:n.array(n.string().min(1)).min(1),defaults:n.array(n.string().min(1)).min(1)}).optional(),starter:se.optional(),turnInto:n.boolean().optional(),share:n.boolean().optional(),build:n.string().min(1).optional()});export const KIND_POINT=definePoint({id:"kinds",about:"Kinds of item: their names, their editor, their icon and colour, what they export and render, what a new one starts as, whether one is shared alone.",entry:ae,key:e=>e.id,activation:(e,t)=>t==="workspace"?[`onKind:${e.id}`]:[],check:e=>{const t=[],i=missingLocales(e.name);i.length>0&&t.push(`${e.id}'s name has no words in ${i.join(", ")}.`);const o=e.plural&&missingLocales(e.plural);o&&o.length>0&&t.push(`${e.id}'s plural has no words in ${o.join(", ")}.`);for(const[r,d]of Object.entries(e.exports?.names??{})){const u=missingLocales(d);u.length>0&&t.push(`${e.id}'s name for its export ${r} has no words in ${u.join(", ")}.`)}const s=Object.keys(e.starter?.files??{});for(const r of s.filter(d=>!w(d)))t.push(`${e.id}'s starter file ${r} is not inside the new item's folder.`);return e.starter&&!s.includes(e.starter.entry)&&t.push(`${e.id}'s starter's entry ${e.starter.entry} is none of its files.`),t}});const I=n.union([n.string().min(1),n.array(n.string().min(1)).min(1)]),re=n.object({id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),markup:I.optional(),kinds:n.array(n.string().min(1)).default([]),files:n.array(n.string().min(1)).default([]),noun:n.string().min(1).optional(),name:WordsSchema.optional(),plural:WordsSchema.optional(),icon:n.string().min(1).optional(),color:n.string().min(1).optional(),check:n.string().min(1).optional(),priority:n.enum(["default","option"]).default("default"),share:n.boolean().optional(),page:n.boolean().optional(),module:h.optional(),place:n.record(n.string(),n.unknown()).optional()});function z(e){if(e.type!=="object")return'is not of "type": "object".';try{n.fromJSONSchema(e)}catch(t){return`is not a JSON Schema zod reads: ${t instanceof Error?t.message:String(t)}.`}}export const EDITOR_POINT=definePoint({id:"editors",about:"Editors: the kinds each opens, or the files it opens by their names (glob patterns, with their name, sign and check), whether it is their default, the module a page imports for it, and the schema of where a person is in what it opens.",entry:re,key:e=>e.id,activation:(e,t)=>t==="ui"?[`onEditor:${e.id}`]:[],check:e=>{const t=[],i=e.place&&z(e.place);if(i!==void 0&&t.push(`${e.id}'s place ${i}`),e.kinds.length===0&&e.files.length===0&&t.push(`${e.id} opens no kind and no files.`),e.kinds.length>0&&e.files.length>0&&t.push(`${e.id} opens kinds and files: an editor opens one or the other.`),e.files.length>0){e.noun===void 0&&t.push(`${e.id} opens files and has no noun for them.`),e.name===void 0&&t.push(`${e.id} opens files and has no name for them.`);for(const[o,s]of[["name",e.name],["plural",e.plural]]){const r=s===void 0?[]:missingLocales(s);r.length>0&&t.push(`${e.id}'s ${o} has no words in ${r.join(", ")}.`)}for(const o of e.files)(o.startsWith("/")||o.split("/").includes(".."))&&t.push(`${e.id}'s pattern ${o} is not of project paths (no leading /, no ..).`)}else e.check!==void 0&&t.push(`${e.id} has a check and opens no files: a kind's items are checked by its build.`);return t}});export function fileEditorTable(e,t=(i,o)=>o){return e.flatMap(({extension:i,entry:o})=>o.files.length===0||o.name===void 0||o.noun===void 0?[]:[{id:o.id,files:[...o.files],noun:o.noun,name:{...o.name},...o.plural===void 0?{}:{plural:{...o.plural}},...o.icon===void 0?{}:{icon:o.icon},...o.color===void 0?{}:{color:o.color},...o.priority==="option"?{priority:o.priority}:{},...o.share===!0?{share:!0}:{},...o.page===!0?{page:!0}:{},...o.check===void 0?{}:{check:t(i,o.check)},extension:i}])}const de=n.object({id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),markup:I.optional(),types:n.array(n.string().regex(/^[a-z]+\/(?:\*|[\w.+-]+)$/u)).min(1),module:h});export const PREVIEW_RENDERER_POINT=definePoint({id:"previewRenderers",about:"Preview renderers: how a file of a media type is drawn wherever one is shown (a canvas's node); each its media types and the module a page imports for it.",entry:de,key:e=>e.id});const T=e=>e.startsWith("allyhub.");function $(e,t,i){return T(e)||t.startsWith(`${e}/`)?[]:[`the ${i} ${t} does not start with its extension's id (${e}/…).`]}const le=n.object({code:n.string().regex(/^(AK-[A-Z]\d{3}|[a-z0-9][a-z0-9-]*\.[a-z0-9][a-z0-9-]*\/[A-Za-z0-9][\w.-]*)$/u),level:n.enum(["error","warn"]),rule:n.string().min(1)});export const RULE_POINT=definePoint({id:"rules",about:"Rules: the codes an extension reports problems under, each with its level and what it says.",entry:le,key:e=>e.code,check:(e,t)=>{const i=C(e.code);return[...$(t,e.code,"rule"),...i&&i.extension!==t?[`${e.code} is ${i.extension===_?"the core's":`${i.extension}'s`} rule already.`]:[]]},added:(e,t)=>v(t,[e])});const ce=n.object({kind:n.string().regex(/^([a-z][a-z0-9-]*|[a-z0-9][a-z0-9-]*\.[a-z0-9][a-z0-9-]*\/[a-z][a-z0-9-]*)$/u),about:n.string().min(1)});export const FACT_POINT=definePoint({id:"facts",about:"Kinds of fact: what an extension measures for the agent to judge, each with what it says.",entry:ce,key:e=>e.kind,check:(e,t)=>$(t,e.kind,"kind of fact")});const ue=n.object({module:n.string().min(1)});export const BUILD_PLUGINS_POINT=definePoint({id:"buildPlugins",about:"Build plugins: a module whose Vite plugins and lent packages every stage bundle of a project takes.",entry:ue});const k=n.string().min(1),me=n.object({name:n.string().regex(/^[a-z][a-z0-9-]*$/u),summary:n.string().min(1),module:k});export const INSPECT_VIEW_POINT=definePoint({id:"inspectViews",about:"Views of `allyhub inspect <name>`: a measurement now, listed in `allyhub help` before its module is loaded.",entry:me,key:e=>e.name});const pe=n.object({id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),types:n.array(n.string().min(1)).min(1),module:k});export const EXPORT_PROCESSOR_POINT=definePoint({id:"exportProcessors",about:"Export processors: a step run on every file of the types it names that an export makes.",entry:pe,key:e=>e.id,check:(e,t)=>e.id.startsWith(`${t}.`)?[]:[`the processor ${e.id} does not start with its extension's id (${t}.…).`]});const he=n.object({id:n.string().regex(/^([a-z][a-z0-9-]*|[a-z0-9][a-z0-9-]*\.[a-z0-9][a-z0-9-]*\/[a-z][a-z0-9-]*)$/u),about:n.string().min(1),what:n.string().min(1),media:n.array(n.enum(["image","audio","video"])).min(1),runtimes:n.array(n.string().regex(/^[a-z0-9][a-z0-9-]*$/u)).default([]),module:k});export const MEDIA_ANALYSIS_POINT=definePoint({id:"mediaAnalyses",about:"Media analyses: what the media index measures of a file once, by its content, when a version needs it.",entry:he,key:e=>e.id,check:(e,t)=>$(t,e.id,"media analysis")});const fe=n.object({id:n.string().regex(/^[a-z0-9][a-z0-9-]*$/u),...M.shape});export const RUNTIME_POINT=definePoint({id:"runtimes",about:"Runtimes: a tool's pinned download (a program, a model), fetched when first needed, checked, cached.",entry:fe,key:e=>e.id}),SKILL_NAME=/^(?=.{1,64}$)[a-z0-9]+(-[a-z0-9]+)*$/u;const g=e=>e.replace(/^\.\//u,"").replace(/\/+$/u,""),ge=n.object({path:n.string().min(1)});export const SKILL_POINT=definePoint({id:"skills",about:"Skills for the agent: a folder laid out as an Agent Skill's, a skill of its own or files of the skill of its name.",entry:ge,check:e=>{const t=g(e.path);if(!w(t))return[`the skill folder ${e.path} is not a folder inside its package.`];const i=t.slice(t.lastIndexOf("/")+1);return SKILL_NAME.test(i)?[]:[`the skill folder ${e.path} is not named as a skill is (lower-case letters, digits and hyphens, at most 64).`]}});const P=n.record(n.string(),n.string()),be=n.union([n.object({name:n.string().regex(/^[a-z0-9][a-z0-9_-]*$/u),command:n.string().min(1),args:n.array(n.string()).default([]),env:P.default({}),cwd:n.string().min(1).optional()}),n.object({name:n.string().regex(/^[a-z0-9][a-z0-9_-]*$/u),url:n.url(),headers:P.default({})})]);export const MCP_SERVER_POINT=definePoint({id:"mcpServers",about:"MCP servers: a local program or an address that gives an agent tools, defined as .mcp.json defines one.",entry:be,key:e=>e.name,check:e=>"cwd"in e&&e.cwd!==void 0&&!w(g(e.cwd))?[`the MCP server ${e.name}'s cwd is not a folder inside its package.`]:[]}),CORE_POINTS=[COMMANDS,KEYBINDING_POINT,MENU_POINT,VIEW_CONTAINER_POINT,VIEW_POINT,CONFIGURATION_POINT,WINDOW_TOOL_POINT,CLI_COMMANDS,KIND_POINT,EDITOR_POINT,PREVIEW_RENDERER_POINT,RULE_POINT,FACT_POINT,BUILD_PLUGINS_POINT,PROJECT_TOOL_POINT,STAGE_ROUTE_POINT,INSPECT_VIEW_POINT,EXPORT_PROCESSOR_POINT,MEDIA_ANALYSIS_POINT,RUNTIME_POINT,SKILL_POINT,MCP_SERVER_POINT];export function kindTable(e,t=(d,u)=>u,i=[],o=[],s=[],r=()=>{}){const d=c=>{const a=i.filter(l=>l.extension===c).map(l=>t(c,l.entry.module));return a.length>0?a:void 0},u=c=>{const a=o.filter(l=>l.extension===c).map(({entry:l})=>({name:l.name,source:l.source,does:l.does,module:t(c,l.module),extension:c}));return a.length>0?a:void 0},m=c=>{const a=s.filter(l=>l.extension===c).map(({entry:l})=>({folder:l.folder,loads:l.loads.filter(N=>D(R,N)),module:t(c,l.module),extension:c}));return a.length>0?a:void 0};return e.map(({extension:c,entry:a})=>({id:a.id,editor:a.editor,noun:a.noun,part:a.part,...a.pages===!0?{pages:!0}:{},name:a.name,plural:a.plural,icon:a.icon,color:a.color,exports:a.exports&&{types:a.exports.types,extras:a.exports.extras,options:a.exports.options.map(l=>({name:l.name,only:l.only,...l.values===void 0?{}:{values:l.values}})),...Object.keys(a.exports.names).length===0?{}:{names:a.exports.names}},renders:a.renders&&{types:a.renders.types,defaults:a.renders.defaults},starter:a.starter&&{files:{...a.starter.files},entry:a.starter.entry},...a.shown===void 0?{}:{order:a.shown.order},...a.turnInto===!1?{turnInto:!1}:{},share:a.share,build:a.build===void 0?void 0:t(c,a.build),buildPlugins:d(c),projectTools:u(c),stageRoutes:m(c),points:r(c),extension:c}))}export const inspectViewTable=(e,t)=>e.map(({extension:i,entry:o})=>({name:o.name,summary:o.summary,module:t(i,o.module),extension:i})),cliCommandTable=(e,t)=>e.map(({extension:i,entry:o})=>({name:o.name,summary:o.summary,...o.work===void 0?{}:{work:o.work},module:t(i,o.module),extension:i})),processorTable=(e,t)=>e.map(({extension:i,entry:o})=>({id:o.id,types:o.types,module:t(i,o.module),extension:i})),analysisTable=(e,t)=>e.map(({extension:i,entry:o})=>({id:o.id,about:o.about,what:o.what,media:o.media,runtimes:o.runtimes,module:t(i,o.module),extension:i})),skillTable=(e,t)=>e.map(({extension:i,entry:o})=>{const s=g(o.path);return{name:s.slice(s.lastIndexOf("/")+1),folder:t(i,s),extension:i}});const j=(e,t)=>e.replaceAll("${PLUGIN_ROOT}",t);export const mcpServerTable=(e,t,i)=>e.map(({extension:o,entry:s})=>{if("url"in s)return{name:s.name,url:s.url,headers:{...s.headers},extension:o};const r=t(o);return{name:s.name,command:j(s.command,r),args:s.args.map(d=>j(d,r)),env:Object.fromEntries(Object.entries(s.env).map(([d,u])=>[d,j(u,r)])),cwd:s.cwd===void 0?r:i(o,g(s.cwd)),extension:o}});
2
+ import{CORE as _,declareRules as v,ruleOf as C}from"@allyhub/diagnostics";import{STAGE_LOADS as R}from"@allyhub/formats";import{LOCALES as A}from"@allyhub/i18n";import{PROJECT_TOOLS as L,StageFolderSchema as M,StageLoadSchema as W,known as V}from"@allyhub/protocol";import{RuntimeSchema as D}from"@allyhub/runtimes/schema";import{z as n}from"zod";import{KEY as K,MENUS as U,SETTING_TYPES as E,VIEW_CONTAINERS as p,inMenuBar as G,settingProblem as O,whenProblem as H}from"./shell.js";export const definePoint=e=>e,WordsSchema=n.record(n.string(),n.string().min(1));export function missingLocales(e){return A.filter(t=>!(t in e))}export const wordIn=(e,t)=>e[t]??e.en??Object.values(e)[0]??"";const h=n.string().regex(/^(@[a-z0-9][\w.-]*\/)?[a-z0-9][\w.-]*(\/[\w.-]+)*$/u);function b(e,t,i){if(typeof e!="object"||e===null||Array.isArray(e))return`is not an object of ${t}.`;const o=[];for(const[s,r]of Object.entries(e)){if(!Array.isArray(r))return`.${s} is not a list.`;r.forEach((d,u)=>{o.push([`.${s}[${String(u)}]`,typeof d=="object"&&d!==null?{...d,[i]:s}:d])})}return o}const y=n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),f=n.string().superRefine((e,t)=>{const i=H(e);i!==void 0&&t.addIssue({code:"custom",message:i})}),J=n.object({id:y,title:WordsSchema,enablement:f.optional(),place:n.enum(["workspace","ui"]).default("workspace")});export const COMMANDS=definePoint({id:"commands",about:"Commands a person runs from the palette, the menus and the keys.",entry:J,key:e=>e.id,activation:(e,t)=>e.place===t?[`onCommand:${e.id}`]:[],check:e=>{const t=missingLocales(e.title);return t.length>0?[`${e.id}'s title has no words in ${t.join(", ")}.`]:[]}});const B=n.object({command:y,key:n.string().regex(K,{message:"A key is modifiers among Mod, Shift and Alt, then a capital letter, a digit, a sign or a key's name (Mod+Shift+H)."}),when:f.optional()});export const KEYBINDING_POINT=definePoint({id:"keybindings",about:"Keys that run commands, each while its when clause holds.",entry:B});const F=n.object({menu:n.string().min(1),command:y,when:f.optional(),group:n.string().min(1).optional()});export const MENU_POINT=definePoint({id:"menus",about:`Commands in menus, by menu (${U.join(", ")}), each while its when clause holds.`,entry:F,entries:e=>b(e,"menus","menu"),check:e=>G(e.menu)?[`${e.command} is not placed in ${e.menu}: Studio's menu bar shows the core's entries alone yet.`]:[]});const x="Studio places no extension's view yet; its work card and its sidebar show the core's alone.",Y=n.object({location:n.string().min(1),id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),title:WordsSchema,icon:n.string().min(1).optional()});export const VIEW_CONTAINER_POINT=definePoint({id:"viewsContainers",about:`Containers of views, by where each goes; the shell gives its own (${p.join(", ")}) and takes none of an extension's yet.`,entry:Y,entries:e=>b(e,"places","location"),key:e=>e.id,check:e=>{const t=missingLocales(e.title);return[...t.length>0?[`${e.id}'s title has no words in ${t.join(", ")}.`]:[],`the container ${e.id} is not placed: ${x}`]}});const Z=n.object({container:n.string().min(1),id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),name:WordsSchema,when:f.optional(),icon:n.string().min(1).optional(),module:h.optional()});export const VIEW_POINT=definePoint({id:"views",about:`Views, by the container each is in (${p.join(", ")}): a page in a frame, as an editor is.`,entry:Z,entries:e=>b(e,"containers","container"),key:e=>e.id,check:e=>{const t=missingLocales(e.name);return[...p.includes(e.container)?[]:[`${e.container} is not a container: a view goes in ${p.join(" or ")}.`],...t.length>0?[`${e.id}'s name has no words in ${t.join(", ")}.`]:[],...e.module===void 0?[`${e.id} names no module: a view is a page's module, as an editor is.`]:[],`the view ${e.id} is not placed: ${x}`]}});const S=n.union([n.string(),n.boolean(),n.number()]),X=n.object({type:n.string().min(1),default:S.optional(),title:WordsSchema,description:WordsSchema.optional(),enum:n.array(S).min(1).optional(),enumItemLabels:n.array(WordsSchema).optional(),enumDescriptions:n.array(WordsSchema).optional(),minimum:n.number().optional(),maximum:n.number().optional(),minLength:n.number().int().min(0).optional(),order:n.number().int().optional()}),q=n.object({title:WordsSchema,order:n.number().int().optional(),properties:n.record(n.string(),X)});function Q(e,t){const i=[],o=(s,r)=>{const d=missingLocales(r);d.length>0&&i.push(`${e}'s ${s} has no words in ${d.join(", ")}.`)};return o("title",t.title),t.description!==void 0&&o("description",t.description),t.enumItemLabels?.forEach((s,r)=>{o(`label of choice ${String(r+1)}`,s)}),t.enumDescriptions?.forEach((s,r)=>{o(`description of choice ${String(r+1)}`,s)}),i}export const CONFIGURATION_POINT=definePoint({id:"configuration",about:"Settings: a title and JSON Schema properties by key, drawn as rows in the shell and read through allyhub.settings.",entry:q,entries:e=>Array.isArray(e)?e.map((t,i)=>[`[${String(i)}]`,t]):typeof e=="object"&&e!==null?[["",e]]:"is not a configuration or a list of them.",check:(e,t)=>{const i=[],o=missingLocales(e.title);o.length>0&&i.push(`a configuration's title has no words in ${o.join(", ")}.`);for(const[s,r]of Object.entries(e.properties)){if((!s.startsWith(`${t}.`)||s===`${t}.`)&&i.push(`${s} is not named by its extension: a setting's key is ${t}. and a name.`),i.push(...Q(s,r)),!E.includes(r.type)){i.push(`${s} is of type ${r.type}: a shell draws ${E.join(", ")}.`);continue}const d={...r,type:r.type};for(const[u,m]of(r.enum??[]).entries()){const c=O({type:d.type},m);c!==void 0&&i.push(`${s}'s choice ${String(u+1)}: ${c}`)}if(r.default!==void 0){const u=O(d,r.default);u!==void 0&&i.push(`${s}'s default: ${u}`)}for(const u of["enumItemLabels","enumDescriptions"]){const m=r[u];m!==void 0&&m.length!==(r.enum?.length??0)&&i.push(`${s}'s ${u} are ${String(m.length)}, and its choices ${String(r.enum?.length??0)}.`)}}return i}});const ee=n.object({name:n.string().regex(/^[a-z0-9][a-z0-9_-]*$/u),title:n.string().min(1),description:n.string().min(1),inputSchema:n.record(n.string(),n.unknown()),annotations:n.object({readOnlyHint:n.boolean(),destructiveHint:n.boolean(),idempotentHint:n.boolean(),openWorldHint:n.boolean()}).partial().optional()});export const WINDOW_TOOL_POINT=definePoint({id:"windowTools",about:"Tools an agent calls that act in the person's window, during its own turn: a name, a description, a JSON Schema of the input.",entry:ee,key:e=>e.name,check:e=>{const t=z(e.inputSchema);return[...t===void 0?[]:[`${e.name}'s inputSchema ${t}`],`the window tool ${e.name} is not given: Studio's MCP server gives the core's tools alone yet.`]}});const ne=n.object({name:n.string().regex(/^[a-z0-9][a-z0-9-]*( [a-z0-9][a-z0-9-]*){0,2}$/u),summary:n.string().min(1),work:n.string().min(1).optional(),module:n.string().min(1)});export const CLI_COMMANDS=definePoint({id:"cliCommands",about:"Commands the agent runs, `allyhub <name>`, listed in `allyhub help` before their module is loaded.",entry:ne,key:e=>e.name});const te=n.object({name:n.string().regex(/^[a-z0-9][a-z0-9.-]*\/[a-z][a-z0-9-]*$/u),source:n.enum(["project","asleep","machine"]),does:n.union([n.object({command:n.string().min(1)}),n.object({files:n.string().min(1)}),n.object({person:n.string().min(1)})]),module:n.string().min(1),readView:h.optional()});export const PROJECT_TOOL_POINT=definePoint({id:"projectTools",about:"Project tools: what an editor asks of a project through tools/call, each with the command or files that do the same for the agent.",entry:te,key:e=>e.name,check:(e,t)=>{if(Object.hasOwn(L,e.name))return[`${e.name} is the core's own project tool.`];const i=e.name.slice(0,e.name.lastIndexOf("/"));return T(t)||i===t?[]:[`the project tool ${e.name} does not start with its extension's id (${t}/…).`]}});const oe=n.object({folder:M,loads:n.array(W),module:n.string().min(1)});export const STAGE_ROUTE_POINT=definePoint({id:"stageRoutes",about:"Stage routes: a folder of the stage's tree an extension answers, what the stage's pages load from it, and what a snapshot records of it.",entry:oe,key:e=>e.folder});const ie=n.object({name:n.string().min(1),only:n.array(n.string().min(1)).min(1),values:n.array(n.string().min(1)).optional()}),se=n.object({files:n.record(n.string().min(1),n.string()),entry:n.string().min(1)}),w=e=>!e.startsWith("/")&&!e.includes("\\")&&e.split("/").every(t=>t!==""&&t!=="."&&t!==".."),ae=n.object({id:n.string().regex(/^[a-z][a-z0-9-]*$/u),name:WordsSchema,plural:WordsSchema.optional(),noun:n.string().min(1),part:n.object({noun:n.string().min(1),plural:n.string().min(1)}).optional(),pages:n.boolean().optional(),editor:n.string().min(1).optional(),shown:n.object({line:WordsSchema,order:n.number()}).optional(),icon:n.string().min(1).optional(),color:n.string().min(1).optional(),exports:n.object({types:n.array(n.string().min(1)).min(1),extras:n.array(n.string().min(1)).default([]),options:n.array(ie).default([]),names:n.record(n.string().min(1),WordsSchema).default({})}).optional(),renders:n.object({types:n.array(n.string().min(1)).min(1),defaults:n.array(n.string().min(1)).min(1)}).optional(),starter:se.optional(),turnInto:n.boolean().optional(),share:n.boolean().optional(),build:n.string().min(1).optional(),config:n.array(n.string().min(1)).optional(),layers:n.boolean().optional()});export const KIND_POINT=definePoint({id:"kinds",about:"Kinds of item: their names, their editor, their icon and colour, what they export and render, what a new one starts as, whether one is shared alone.",entry:ae,key:e=>e.id,activation:(e,t)=>t==="workspace"?[`onKind:${e.id}`]:[],check:e=>{const t=[],i=missingLocales(e.name);i.length>0&&t.push(`${e.id}'s name has no words in ${i.join(", ")}.`);const o=e.plural&&missingLocales(e.plural);o&&o.length>0&&t.push(`${e.id}'s plural has no words in ${o.join(", ")}.`);for(const[r,d]of Object.entries(e.exports?.names??{})){const u=missingLocales(d);u.length>0&&t.push(`${e.id}'s name for its export ${r} has no words in ${u.join(", ")}.`)}const s=Object.keys(e.starter?.files??{});for(const r of s.filter(d=>!w(d)))t.push(`${e.id}'s starter file ${r} is not inside the new item's folder.`);return e.starter&&!s.includes(e.starter.entry)&&t.push(`${e.id}'s starter's entry ${e.starter.entry} is none of its files.`),t}});const I=n.union([n.string().min(1),n.array(n.string().min(1)).min(1)]),re=n.object({id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),markup:I.optional(),kinds:n.array(n.string().min(1)).default([]),files:n.array(n.string().min(1)).default([]),noun:n.string().min(1).optional(),name:WordsSchema.optional(),plural:WordsSchema.optional(),icon:n.string().min(1).optional(),color:n.string().min(1).optional(),check:n.string().min(1).optional(),priority:n.enum(["default","option"]).default("default"),share:n.boolean().optional(),page:n.boolean().optional(),module:h.optional(),place:n.record(n.string(),n.unknown()).optional()});function z(e){if(e.type!=="object")return'is not of "type": "object".';try{n.fromJSONSchema(e)}catch(t){return`is not a JSON Schema zod reads: ${t instanceof Error?t.message:String(t)}.`}}export const EDITOR_POINT=definePoint({id:"editors",about:"Editors: the kinds each opens, or the files it opens by their names (glob patterns, with their name, sign and check), whether it is their default, the module a page imports for it, and the schema of where a person is in what it opens.",entry:re,key:e=>e.id,activation:(e,t)=>t==="ui"?[`onEditor:${e.id}`]:[],check:e=>{const t=[],i=e.place&&z(e.place);if(i!==void 0&&t.push(`${e.id}'s place ${i}`),e.kinds.length===0&&e.files.length===0&&t.push(`${e.id} opens no kind and no files.`),e.kinds.length>0&&e.files.length>0&&t.push(`${e.id} opens kinds and files: an editor opens one or the other.`),e.files.length>0){e.noun===void 0&&t.push(`${e.id} opens files and has no noun for them.`),e.name===void 0&&t.push(`${e.id} opens files and has no name for them.`);for(const[o,s]of[["name",e.name],["plural",e.plural]]){const r=s===void 0?[]:missingLocales(s);r.length>0&&t.push(`${e.id}'s ${o} has no words in ${r.join(", ")}.`)}for(const o of e.files)(o.startsWith("/")||o.split("/").includes(".."))&&t.push(`${e.id}'s pattern ${o} is not of project paths (no leading /, no ..).`)}else e.check!==void 0&&t.push(`${e.id} has a check and opens no files: a kind's items are checked by its build.`);return t}});export function fileEditorTable(e,t=(i,o)=>o){return e.flatMap(({extension:i,entry:o})=>o.files.length===0||o.name===void 0||o.noun===void 0?[]:[{id:o.id,files:[...o.files],noun:o.noun,name:{...o.name},...o.plural===void 0?{}:{plural:{...o.plural}},...o.icon===void 0?{}:{icon:o.icon},...o.color===void 0?{}:{color:o.color},...o.priority==="option"?{priority:o.priority}:{},...o.share===!0?{share:!0}:{},...o.page===!0?{page:!0}:{},...o.check===void 0?{}:{check:t(i,o.check)},extension:i}])}const de=n.object({id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),markup:I.optional(),types:n.array(n.string().regex(/^[a-z]+\/(?:\*|[\w.+-]+)$/u)).min(1),module:h});export const PREVIEW_RENDERER_POINT=definePoint({id:"previewRenderers",about:"Preview renderers: how a file of a media type is drawn wherever one is shown (a canvas's node); each its media types and the module a page imports for it.",entry:de,key:e=>e.id});const T=e=>e.startsWith("allyhub.");function $(e,t,i){return T(e)||t.startsWith(`${e}/`)?[]:[`the ${i} ${t} does not start with its extension's id (${e}/…).`]}const le=n.object({code:n.string().regex(/^(AK-[A-Z]\d{3}|[a-z0-9][a-z0-9-]*\.[a-z0-9][a-z0-9-]*\/[A-Za-z0-9][\w.-]*)$/u),level:n.enum(["error","warn"]),rule:n.string().min(1)});export const RULE_POINT=definePoint({id:"rules",about:"Rules: the codes an extension reports problems under, each with its level and what it says.",entry:le,key:e=>e.code,check:(e,t)=>{const i=C(e.code);return[...$(t,e.code,"rule"),...i&&i.extension!==t?[`${e.code} is ${i.extension===_?"the core's":`${i.extension}'s`} rule already.`]:[]]},added:(e,t)=>v(t,[e])});const ce=n.object({kind:n.string().regex(/^([a-z][a-z0-9-]*|[a-z0-9][a-z0-9-]*\.[a-z0-9][a-z0-9-]*\/[a-z][a-z0-9-]*)$/u),about:n.string().min(1)});export const FACT_POINT=definePoint({id:"facts",about:"Kinds of fact: what an extension measures for the agent to judge, each with what it says.",entry:ce,key:e=>e.kind,check:(e,t)=>$(t,e.kind,"kind of fact")});const ue=n.object({module:n.string().min(1)});export const BUILD_PLUGINS_POINT=definePoint({id:"buildPlugins",about:"Build plugins: a module whose Vite plugins and lent packages every stage bundle of a project takes.",entry:ue});const k=n.string().min(1),me=n.object({name:n.string().regex(/^[a-z][a-z0-9-]*$/u),summary:n.string().min(1),module:k});export const INSPECT_VIEW_POINT=definePoint({id:"inspectViews",about:"Views of `allyhub inspect <name>`: a measurement now, listed in `allyhub help` before its module is loaded.",entry:me,key:e=>e.name});const pe=n.object({id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),types:n.array(n.string().min(1)).min(1),module:k});export const EXPORT_PROCESSOR_POINT=definePoint({id:"exportProcessors",about:"Export processors: a step run on every file of the types it names that an export makes.",entry:pe,key:e=>e.id,check:(e,t)=>e.id.startsWith(`${t}.`)?[]:[`the processor ${e.id} does not start with its extension's id (${t}.…).`]});const he=n.object({id:n.string().regex(/^([a-z][a-z0-9-]*|[a-z0-9][a-z0-9-]*\.[a-z0-9][a-z0-9-]*\/[a-z][a-z0-9-]*)$/u),about:n.string().min(1),what:n.string().min(1),media:n.array(n.enum(["image","audio","video"])).min(1),runtimes:n.array(n.string().regex(/^[a-z0-9][a-z0-9-]*$/u)).default([]),module:k});export const MEDIA_ANALYSIS_POINT=definePoint({id:"mediaAnalyses",about:"Media analyses: what the media index measures of a file once, by its content, when a version needs it.",entry:he,key:e=>e.id,check:(e,t)=>$(t,e.id,"media analysis")});const fe=n.object({id:n.string().regex(/^[a-z0-9][a-z0-9-]*$/u),...D.shape});export const RUNTIME_POINT=definePoint({id:"runtimes",about:"Runtimes: a tool's pinned download (a program, a model), fetched when first needed, checked, cached.",entry:fe,key:e=>e.id}),SKILL_NAME=/^(?=.{1,64}$)[a-z0-9]+(-[a-z0-9]+)*$/u;const g=e=>e.replace(/^\.\//u,"").replace(/\/+$/u,""),ge=n.object({path:n.string().min(1)});export const SKILL_POINT=definePoint({id:"skills",about:"Skills for the agent: a folder laid out as an Agent Skill's, a skill of its own or files of the skill of its name.",entry:ge,check:e=>{const t=g(e.path);if(!w(t))return[`the skill folder ${e.path} is not a folder inside its package.`];const i=t.slice(t.lastIndexOf("/")+1);return SKILL_NAME.test(i)?[]:[`the skill folder ${e.path} is not named as a skill is (lower-case letters, digits and hyphens, at most 64).`]}});const P=n.record(n.string(),n.string()),be=n.union([n.object({name:n.string().regex(/^[a-z0-9][a-z0-9_-]*$/u),command:n.string().min(1),args:n.array(n.string()).default([]),env:P.default({}),cwd:n.string().min(1).optional()}),n.object({name:n.string().regex(/^[a-z0-9][a-z0-9_-]*$/u),url:n.url(),headers:P.default({})})]);export const MCP_SERVER_POINT=definePoint({id:"mcpServers",about:"MCP servers: a local program or an address that gives an agent tools, defined as .mcp.json defines one.",entry:be,key:e=>e.name,check:e=>"cwd"in e&&e.cwd!==void 0&&!w(g(e.cwd))?[`the MCP server ${e.name}'s cwd is not a folder inside its package.`]:[]}),CORE_POINTS=[COMMANDS,KEYBINDING_POINT,MENU_POINT,VIEW_CONTAINER_POINT,VIEW_POINT,CONFIGURATION_POINT,WINDOW_TOOL_POINT,CLI_COMMANDS,KIND_POINT,EDITOR_POINT,PREVIEW_RENDERER_POINT,RULE_POINT,FACT_POINT,BUILD_PLUGINS_POINT,PROJECT_TOOL_POINT,STAGE_ROUTE_POINT,INSPECT_VIEW_POINT,EXPORT_PROCESSOR_POINT,MEDIA_ANALYSIS_POINT,RUNTIME_POINT,SKILL_POINT,MCP_SERVER_POINT];export function kindTable(e,t=(d,u)=>u,i=[],o=[],s=[],r=()=>{}){const d=c=>{const a=i.filter(l=>l.extension===c).map(l=>t(c,l.entry.module));return a.length>0?a:void 0},u=c=>{const a=o.filter(l=>l.extension===c).map(({entry:l})=>({name:l.name,source:l.source,does:l.does,module:t(c,l.module),extension:c}));return a.length>0?a:void 0},m=c=>{const a=s.filter(l=>l.extension===c).map(({entry:l})=>({folder:l.folder,loads:l.loads.filter(N=>V(R,N)),module:t(c,l.module),extension:c}));return a.length>0?a:void 0};return e.map(({extension:c,entry:a})=>({id:a.id,editor:a.editor,noun:a.noun,part:a.part,...a.pages===!0?{pages:!0}:{},name:a.name,plural:a.plural,icon:a.icon,color:a.color,exports:a.exports&&{types:a.exports.types,extras:a.exports.extras,options:a.exports.options.map(l=>({name:l.name,only:l.only,...l.values===void 0?{}:{values:l.values}})),...Object.keys(a.exports.names).length===0?{}:{names:a.exports.names}},renders:a.renders&&{types:a.renders.types,defaults:a.renders.defaults},starter:a.starter&&{files:{...a.starter.files},entry:a.starter.entry},...a.shown===void 0?{}:{order:a.shown.order},...a.turnInto===!1?{turnInto:!1}:{},share:a.share,build:a.build===void 0?void 0:t(c,a.build),...a.config===void 0||a.config.length===0?{}:{config:a.config},...a.layers===!0?{layers:!0}:{},buildPlugins:d(c),projectTools:u(c),stageRoutes:m(c),points:r(c),extension:c}))}export const inspectViewTable=(e,t)=>e.map(({extension:i,entry:o})=>({name:o.name,summary:o.summary,module:t(i,o.module),extension:i})),cliCommandTable=(e,t)=>e.map(({extension:i,entry:o})=>({name:o.name,summary:o.summary,...o.work===void 0?{}:{work:o.work},module:t(i,o.module),extension:i})),processorTable=(e,t)=>e.map(({extension:i,entry:o})=>({id:o.id,types:o.types,module:t(i,o.module),extension:i})),analysisTable=(e,t)=>e.map(({extension:i,entry:o})=>({id:o.id,about:o.about,what:o.what,media:o.media,runtimes:o.runtimes,module:t(i,o.module),extension:i})),skillTable=(e,t)=>e.map(({extension:i,entry:o})=>{const s=g(o.path);return{name:s.slice(s.lastIndexOf("/")+1),folder:t(i,s),extension:i}});const j=(e,t)=>e.replaceAll("${PLUGIN_ROOT}",t);export const mcpServerTable=(e,t,i)=>e.map(({extension:o,entry:s})=>{if("url"in s)return{name:s.name,url:s.url,headers:{...s.headers},extension:o};const r=t(o);return{name:s.name,command:j(s.command,r),args:s.args.map(d=>j(d,r)),env:Object.fromEntries(Object.entries(s.env).map(([d,u])=>[d,j(u,r)])),cwd:s.cwd===void 0?r:i(o,g(s.cwd)),extension:o}});
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/extension-host",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -23,7 +23,7 @@ export interface KindStarter {
23
23
  readonly entry: string;
24
24
  }
25
25
  /**
26
- * A kind as its extension contributes it (docs/design/framework.md, 5.1):
26
+ * A kind as its extension contributes it:
27
27
  * what the core needs to find and name its items. The extension host makes
28
28
  * the table from the extensions loaded; nothing in the core lists kinds.
29
29
  */
@@ -81,6 +81,19 @@ export interface KindSpec {
81
81
  * without one is only listed, by its entry file.
82
82
  */
83
83
  readonly build?: string | undefined;
84
+ /**
85
+ * The keys of allyhub.config.ts its build module's part reads
86
+ * (`KindBuild.config`, its contribution's `config`): a project with no
87
+ * item of the kind has its build module imported for its part only when
88
+ * its config sets one of them. None: it reads no part.
89
+ */
90
+ readonly config?: readonly string[] | undefined;
91
+ /**
92
+ * Its build module measures the layers its extension draws in other
93
+ * kinds' versions (`KindBuild.layers`, its contribution's `layers`): the
94
+ * check imports it for them in a project with no item of the kind.
95
+ */
96
+ readonly layers?: true | undefined;
84
97
  /**
85
98
  * The build plugin modules its extension contributes (its
86
99
  * `buildPlugins`, each resolved as `build` is): what every stage bundle
@@ -105,8 +118,7 @@ export interface KindSpec {
105
118
  */
106
119
  readonly stageRoutes?: readonly StageRouteSpec[] | undefined;
107
120
  /**
108
- * The entries of the points its extension declares (`extensionPoints`,
109
- * docs/design/framework.md, 4.8), by point id, as the host read them:
121
+ * The entries of the points its extension declares (`extensionPoints`), by point id, as the host read them:
110
122
  * what its build module, its exporter and its tools read where no
111
123
  * extension is activated. Each kind of the
112
124
  * extension carries them; none when its extension declares no point.
@@ -126,6 +138,12 @@ export interface PointEntry {
126
138
  export declare function pointEntriesIn(table: KindTable, kind: string, point: string): readonly PointEntry[];
127
139
  /** The kinds the extensions loaded contribute. */
128
140
  export type KindTable = readonly KindSpec[];
141
+ /**
142
+ * The kinds of a table that a project's items are (its list names them),
143
+ * in the table's order: those whose build modules its build, check and
144
+ * export import, where the table names every kind the extensions loaded.
145
+ */
146
+ export declare const kindsUsed: (table: KindTable, items: readonly Pick<Item, "kind">[]) => KindTable;
129
147
  /** A piece of work in the project, as its list names it. */
130
148
  export interface Item {
131
149
  /** What names it: its file without its extension (`launch/teaser`), unique in the project. */
@@ -142,19 +160,18 @@ export interface Item {
142
160
  groups: string[];
143
161
  /**
144
162
  * The files it uses, its entry first, as its kind's build listed them
145
- * once it read it (docs/design/item-files.md); absent before.
163
+ * once it read it; absent before.
146
164
  */
147
165
  files?: ItemFile[];
148
166
  /**
149
- * The other items it uses (docs/design/references.md): their data,
167
+ * The other items it uses: their data,
150
168
  * their drawing live or their made files, as the build resolved them
151
169
  * once its kind read it; absent before, and for an item that uses none.
152
170
  */
153
171
  uses?: ItemUse[];
154
172
  }
155
173
  /**
156
- * The forms a use takes an item as besides a made file's type
157
- * (docs/design/references.md §3.2): its values, which its kind lends
174
+ * The forms a use takes an item as besides a made file's type: its values, which its kind lends
158
175
  * (`data`), and its drawing by its own kind's runtime inside the using
159
176
  * item's page (`live`). Any other form is a file type (`png`, `mp4`).
160
177
  */
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{listedWork as O}from"./data/work.js";import{fileEditorIn as g}from"./files.js";import{baseOf as m,dirOf as k}from"./layout.js";export function pointEntriesIn(t,e,i){return t.find(n=>n.id===e)?.points?.[i]??[]}export const USE_FORMS={data:"data",live:"live"},isFileForm=t=>t!==USE_FORMS.data&&t!==USE_FORMS.live,LOCALE_MARK="{locale}";export function listsFile(t,e){return t.some(i=>{const n=i.path.indexOf(LOCALE_MARK);if(n<0)return i.path===e;const r=i.path.slice(0,n),d=i.path.slice(n+LOCALE_MARK.length);return e.length>r.length+d.length&&e.startsWith(r)&&e.endsWith(d)})}export const itemFiles=t=>t.files??[{path:t.entry,role:"entry"}],itemIdOf=t=>{const e=m(t),i=e.lastIndexOf(".");return i<=0?t:t.slice(0,t.length-(e.length-i))},listedFileIdOf=t=>t,itemNameOf=(t,e)=>t.title??e??m(t.id);export function listedPieceByIdOrFormerId(t,e){const i=t.filter(n=>n.kind===void 0);return t.find(n=>n.id===e)??i.find(n=>n.entry===e)??i.find(n=>itemIdOf(n.entry)===e)}export const isListedFile=t=>"editor"in t;export function itemsOf(t,e,i,n){const r=[],d=[],u=new Map;for(const s of O(t)){const o=s.file.replace(/^\.\//u,""),l=s.kind;let c;if(l===void 0){if(n===void 0)continue;const f=g(n,o)?.id;if(f===void 0){r.push({code:"no-editor",file:o});continue}c={editor:f}}else if(e.some(f=>f.id===l))c={kind:l};else{r.push({code:"unknown-kind",kind:l,file:o});continue}if(i!==void 0&&!i.has(o)){r.push({code:"missing",file:o});continue}const a="kind"in c?itemIdOf(o):listedFileIdOf(o);u.set(a,[...u.get(a)??[],o]);const x={id:a,dir:k(o),entry:o,...s.title===void 0?{}:{title:s.title},groups:s.groups};d.push({...x,...c})}for(const[s,o]of u)o.length>1&&r.push({code:"same-id",id:s,files:o});const h=new Set,p=d.filter(s=>h.has(s.id)?!1:(h.add(s.id),!0));return{items:p.filter(s=>!isListedFile(s)),files:p.filter(isListedFile),listed:p,problems:r}}export const SHOWN_DATA="\0shown",shownPath=t=>`${t}${SHOWN_DATA}`,shownOf=t=>t.endsWith(SHOWN_DATA)?t.slice(0,-SHOWN_DATA.length):void 0;
2
+ import{listedWork as O}from"./data/work.js";import{fileEditorIn as g}from"./files.js";import{baseOf as m,dirOf as k}from"./layout.js";export function pointEntriesIn(e,n,i){return e.find(t=>t.id===n)?.points?.[i]??[]}export const kindsUsed=(e,n)=>{const i=new Set(n.map(t=>t.kind));return e.filter(t=>i.has(t.id))},USE_FORMS={data:"data",live:"live"},isFileForm=e=>e!==USE_FORMS.data&&e!==USE_FORMS.live,LOCALE_MARK="{locale}";export function listsFile(e,n){return e.some(i=>{const t=i.path.indexOf(LOCALE_MARK);if(t<0)return i.path===n;const r=i.path.slice(0,t),d=i.path.slice(t+LOCALE_MARK.length);return n.length>r.length+d.length&&n.startsWith(r)&&n.endsWith(d)})}export const itemFiles=e=>e.files??[{path:e.entry,role:"entry"}],itemIdOf=e=>{const n=m(e),i=n.lastIndexOf(".");return i<=0?e:e.slice(0,e.length-(n.length-i))},listedFileIdOf=e=>e,itemNameOf=(e,n)=>e.title??n??m(e.id);export function listedPieceByIdOrFormerId(e,n){const i=e.filter(t=>t.kind===void 0);return e.find(t=>t.id===n)??i.find(t=>t.entry===n)??i.find(t=>itemIdOf(t.entry)===n)}export const isListedFile=e=>"editor"in e;export function itemsOf(e,n,i,t){const r=[],d=[],u=new Map;for(const s of O(e)){const o=s.file.replace(/^\.\//u,""),c=s.kind;let l;if(c===void 0){if(t===void 0)continue;const f=g(t,o)?.id;if(f===void 0){r.push({code:"no-editor",file:o});continue}l={editor:f}}else if(n.some(f=>f.id===c))l={kind:c};else{r.push({code:"unknown-kind",kind:c,file:o});continue}if(i!==void 0&&!i.has(o)){r.push({code:"missing",file:o});continue}const a="kind"in l?itemIdOf(o):listedFileIdOf(o);u.set(a,[...u.get(a)??[],o]);const x={id:a,dir:k(o),entry:o,...s.title===void 0?{}:{title:s.title},groups:s.groups};d.push({...x,...l})}for(const[s,o]of u)o.length>1&&r.push({code:"same-id",id:s,files:o});const h=new Set,p=d.filter(s=>h.has(s.id)?!1:(h.add(s.id),!0));return{items:p.filter(s=>!isListedFile(s)),files:p.filter(isListedFile),listed:p,problems:r}}export const SHOWN_DATA="\0shown",shownPath=e=>`${e}${SHOWN_DATA}`,shownOf=e=>e.endsWith(SHOWN_DATA)?e.slice(0,-SHOWN_DATA.length):void 0;