allyhub 0.9.0 → 0.10.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 (461) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/commands/auth.js +4 -4
  3. package/dist/commands/cloud-tools.js +11 -11
  4. package/dist/commands/frames/compare.js +2 -2
  5. package/dist/commands/frames/piece.js +1 -1
  6. package/dist/commands/frames.js +8 -8
  7. package/dist/commands/index.js +1 -1
  8. package/dist/commands/inspect/common.js +4 -2
  9. package/dist/commands/inspect/facts.js +3 -3
  10. package/dist/commands/inspect/layout.js +1 -1
  11. package/dist/commands/orgs.js +2 -2
  12. package/dist/help.js +4 -4
  13. package/dist/main.js +8 -7
  14. package/dist/node_modules/@allyhub/3d-extension/package.json +34 -2
  15. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  16. package/dist/node_modules/@allyhub/browser/package.json +1 -1
  17. package/dist/node_modules/@allyhub/build/package.json +1 -1
  18. package/dist/node_modules/@allyhub/canvas-extension/package.json +2 -1
  19. package/dist/node_modules/@allyhub/canvas-extension/skills/allyhub/references/canvas.md +4 -24
  20. package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
  21. package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +2 -2
  22. package/dist/node_modules/@allyhub/chart/dist/chart.js +1 -1
  23. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  24. package/dist/node_modules/@allyhub/check/package.json +1 -1
  25. package/dist/node_modules/@allyhub/cloud/dist/client.d.ts +10 -0
  26. package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
  27. package/dist/node_modules/@allyhub/cloud/dist/config.d.ts +9 -0
  28. package/dist/node_modules/@allyhub/cloud/dist/config.js +1 -1
  29. package/dist/node_modules/@allyhub/cloud/dist/credentials.d.ts +4 -4
  30. package/dist/node_modules/@allyhub/cloud/dist/credentials.js +2 -2
  31. package/dist/node_modules/@allyhub/cloud/dist/device.d.ts +12 -0
  32. package/dist/node_modules/@allyhub/cloud/dist/device.js +2 -0
  33. package/dist/node_modules/@allyhub/cloud/package.json +1 -1
  34. package/dist/node_modules/@allyhub/components/package.json +1 -1
  35. package/dist/node_modules/@allyhub/components/r/callout.json +1 -1
  36. package/dist/node_modules/@allyhub/components/src/callout.ts +98 -13
  37. package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
  38. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  39. package/dist/node_modules/@allyhub/doc/dist/captions.js +1 -1
  40. package/dist/node_modules/@allyhub/doc/dist/docx.js +4 -4
  41. package/dist/node_modules/@allyhub/doc/dist/html.js +50 -47
  42. package/dist/node_modules/@allyhub/doc/dist/model.js +1 -1
  43. package/dist/node_modules/@allyhub/doc/dist/page.js +1 -1
  44. package/dist/node_modules/@allyhub/doc/dist/paper.js +1 -1
  45. package/dist/node_modules/@allyhub/doc/dist/table.js +1 -1
  46. package/dist/node_modules/@allyhub/doc/dist/write.js +22 -22
  47. package/dist/node_modules/@allyhub/doc/package.json +1 -1
  48. package/dist/node_modules/@allyhub/doc-extension/dist/export.js +1 -1
  49. package/dist/node_modules/@allyhub/doc-extension/package.json +17 -2
  50. package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
  51. package/dist/node_modules/@allyhub/export/dist/export.js +1 -1
  52. package/dist/node_modules/@allyhub/export/package.json +1 -1
  53. package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
  54. package/dist/node_modules/@allyhub/extension-host/dist/points.js +1 -1
  55. package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
  56. package/dist/node_modules/@allyhub/formats/dist/data/faces.d.ts +1 -1
  57. package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +87 -1
  58. package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
  59. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +89 -0
  60. package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
  61. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +50 -0
  62. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  63. package/dist/node_modules/@allyhub/i18n/package.json +1 -1
  64. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  65. package/dist/node_modules/@allyhub/image-extension/package.json +16 -1
  66. package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +7 -39
  67. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  68. package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
  69. package/dist/node_modules/@allyhub/image-render/package.json +1 -1
  70. package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
  71. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  72. package/dist/node_modules/@allyhub/jobs/package.json +1 -1
  73. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  74. package/dist/node_modules/@allyhub/media/package.json +1 -1
  75. package/dist/node_modules/@allyhub/media-extension/dist/vision/faces.js +1 -1
  76. package/dist/node_modules/@allyhub/media-extension/package.json +7 -4
  77. package/dist/node_modules/@allyhub/model/package.json +1 -1
  78. package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.js +1 -1
  79. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  80. package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +16 -0
  81. package/dist/node_modules/@allyhub/piece/dist/page/locate.js +1 -1
  82. package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +6 -0
  83. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  84. package/dist/node_modules/@allyhub/project/dist/version.js +1 -1
  85. package/dist/node_modules/@allyhub/project/package.json +1 -1
  86. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +132 -0
  87. package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
  88. package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +19 -1
  89. package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
  90. package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.d.ts +337 -0
  91. package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.js +2 -0
  92. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +153 -0
  93. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  94. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +4 -2
  95. package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
  96. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +43 -188
  97. package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
  98. package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +1 -0
  99. package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
  100. package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +1 -0
  101. package/dist/node_modules/@allyhub/protocol/dist/mail.js +1 -1
  102. package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +51 -91
  103. package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
  104. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +3 -3
  105. package/dist/node_modules/@allyhub/protocol/package.json +5 -1
  106. package/dist/node_modules/@allyhub/registry/package.json +1 -1
  107. package/dist/node_modules/@allyhub/render/dist/look.js +1 -1
  108. package/dist/node_modules/@allyhub/render/package.json +1 -1
  109. package/dist/node_modules/@allyhub/runtime/dist/compose.js +1 -1
  110. package/dist/node_modules/@allyhub/runtime/dist/embed.js +1 -1
  111. package/dist/node_modules/@allyhub/runtime/dist/player/clips.js +1 -1
  112. package/dist/node_modules/@allyhub/runtime/package.json +1 -1
  113. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  114. package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
  115. package/dist/node_modules/@allyhub/scenery/dist/index.d.ts +2 -2
  116. package/dist/node_modules/@allyhub/scenery/dist/index.js +1 -1
  117. package/dist/node_modules/@allyhub/scenery/dist/moire.d.ts +45 -5
  118. package/dist/node_modules/@allyhub/scenery/dist/moire.js +2 -2
  119. package/dist/node_modules/@allyhub/scenery/dist/phone.d.ts +4 -3
  120. package/dist/node_modules/@allyhub/scenery/dist/phone.js +1 -1
  121. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  122. package/dist/node_modules/@allyhub/scenery-host/dist/layer/grade.d.ts +7 -0
  123. package/dist/node_modules/@allyhub/scenery-host/dist/layer/grade.js +2 -0
  124. package/dist/node_modules/@allyhub/scenery-host/dist/layer/index.d.ts +4 -3
  125. package/dist/node_modules/@allyhub/scenery-host/dist/layer/index.js +1 -1
  126. package/dist/node_modules/@allyhub/scenery-host/dist/layer/screens.d.ts +1 -1
  127. package/dist/node_modules/@allyhub/scenery-host/dist/layer/screens.js +1 -1
  128. package/dist/node_modules/@allyhub/scenery-host/dist/measure/facts.js +1 -1
  129. package/dist/node_modules/@allyhub/scenery-host/dist/page/screens.d.ts +8 -0
  130. package/dist/node_modules/@allyhub/scenery-host/dist/page/screens.js +1 -1
  131. package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
  132. package/dist/node_modules/@allyhub/sheet/dist/calc/coerce.js +1 -1
  133. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
  134. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.js +1 -1
  135. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/date.js +1 -1
  136. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.js +1 -1
  137. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/info.js +1 -1
  138. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/kernels.js +1 -1
  139. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/lookup.js +1 -1
  140. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/maths.js +1 -1
  141. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
  142. package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.js +1 -1
  143. package/dist/node_modules/@allyhub/sheet/dist/calc/types.js +1 -1
  144. package/dist/node_modules/@allyhub/sheet/dist/chart.js +1 -1
  145. package/dist/node_modules/@allyhub/sheet/dist/formula/move.js +1 -1
  146. package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
  147. package/dist/node_modules/@allyhub/sheet/dist/formula/print.js +1 -1
  148. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  149. package/dist/node_modules/@allyhub/sheet/dist/inspect.js +1 -1
  150. package/dist/node_modules/@allyhub/sheet/dist/printed.js +2 -0
  151. package/dist/node_modules/@allyhub/sheet/dist/values.js +1 -1
  152. package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
  153. package/dist/node_modules/@allyhub/sheet/dist/write.js +15 -15
  154. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  155. package/dist/node_modules/@allyhub/sheet/dist/xlsx/formula.js +2 -2
  156. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
  157. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
  158. package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.js +3 -1
  159. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
  160. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  161. package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.js +3 -2
  162. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  163. package/dist/node_modules/@allyhub/sheet-extension/dist/export.js +4 -4
  164. package/dist/node_modules/@allyhub/sheet-extension/package.json +22 -3
  165. package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
  166. package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
  167. package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
  168. package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
  169. package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
  170. package/dist/node_modules/@allyhub/slides-core/dist/sdk.js +1 -1
  171. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  172. package/dist/node_modules/@allyhub/slides-extension/package.json +20 -1
  173. package/dist/node_modules/@allyhub/slides-pptx/dist/import/code.js +2 -2
  174. package/dist/node_modules/@allyhub/slides-pptx/dist/import/index.js +2 -2
  175. package/dist/node_modules/@allyhub/slides-pptx/dist/read/common.js +1 -1
  176. package/dist/node_modules/@allyhub/slides-pptx/dist/read/shapes.js +1 -1
  177. package/dist/node_modules/@allyhub/slides-pptx/dist/read/text.js +1 -1
  178. package/dist/node_modules/@allyhub/slides-pptx/dist/shapes.js +1 -1
  179. package/dist/node_modules/@allyhub/slides-pptx/dist/text.js +1 -1
  180. package/dist/node_modules/@allyhub/slides-pptx/dist/write.js +2 -2
  181. package/dist/node_modules/@allyhub/slides-pptx/dist/xml.js +1 -1
  182. package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
  183. package/dist/node_modules/@allyhub/slides-runtime/dist/draw.js +2 -2
  184. package/dist/node_modules/@allyhub/slides-runtime/dist/load.js +5 -5
  185. package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
  186. package/dist/node_modules/@allyhub/stage/package.json +1 -1
  187. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400-italic.css +19 -0
  188. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400.css +19 -0
  189. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700-italic.css +19 -0
  190. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700.css +19 -0
  191. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/LICENSE +93 -0
  192. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/cambria.css +76 -0
  193. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-400-italic.woff2 +0 -0
  194. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-400-normal.woff2 +0 -0
  195. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-700-italic.woff2 +0 -0
  196. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-700-normal.woff2 +0 -0
  197. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-400-italic.woff2 +0 -0
  198. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-400-normal.woff2 +0 -0
  199. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-700-italic.woff2 +0 -0
  200. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-700-normal.woff2 +0 -0
  201. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400-italic.css +79 -0
  202. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400.css +79 -0
  203. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700-italic.css +79 -0
  204. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700.css +79 -0
  205. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/LICENSE +93 -0
  206. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/courier-new.css +316 -0
  207. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-400-italic.woff2 +0 -0
  208. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-400-normal.woff2 +0 -0
  209. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-700-italic.woff2 +0 -0
  210. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-700-normal.woff2 +0 -0
  211. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-400-italic.woff2 +0 -0
  212. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-400-normal.woff2 +0 -0
  213. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-700-italic.woff2 +0 -0
  214. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-700-normal.woff2 +0 -0
  215. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-400-italic.woff2 +0 -0
  216. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-400-normal.woff2 +0 -0
  217. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-700-italic.woff2 +0 -0
  218. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-700-normal.woff2 +0 -0
  219. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-400-italic.woff2 +0 -0
  220. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-400-normal.woff2 +0 -0
  221. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-700-italic.woff2 +0 -0
  222. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-700-normal.woff2 +0 -0
  223. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-400-italic.woff2 +0 -0
  224. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-400-normal.woff2 +0 -0
  225. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-700-italic.woff2 +0 -0
  226. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-700-normal.woff2 +0 -0
  227. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-400-italic.woff2 +0 -0
  228. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-400-normal.woff2 +0 -0
  229. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-700-italic.woff2 +0 -0
  230. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-700-normal.woff2 +0 -0
  231. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-400-italic.woff2 +0 -0
  232. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-400-normal.woff2 +0 -0
  233. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-700-italic.woff2 +0 -0
  234. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-700-normal.woff2 +0 -0
  235. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-400-italic.woff2 +0 -0
  236. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-400-normal.woff2 +0 -0
  237. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-700-italic.woff2 +0 -0
  238. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-700-normal.woff2 +0 -0
  239. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400-italic.css +79 -0
  240. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400.css +79 -0
  241. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700-italic.css +79 -0
  242. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700.css +79 -0
  243. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/LICENSE +93 -0
  244. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-400-italic.woff2 +0 -0
  245. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-400-normal.woff2 +0 -0
  246. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-700-italic.woff2 +0 -0
  247. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-700-normal.woff2 +0 -0
  248. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-400-italic.woff2 +0 -0
  249. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-400-normal.woff2 +0 -0
  250. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-700-italic.woff2 +0 -0
  251. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-700-normal.woff2 +0 -0
  252. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-400-italic.woff2 +0 -0
  253. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-400-normal.woff2 +0 -0
  254. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-700-italic.woff2 +0 -0
  255. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-700-normal.woff2 +0 -0
  256. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-400-italic.woff2 +0 -0
  257. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-400-normal.woff2 +0 -0
  258. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-700-italic.woff2 +0 -0
  259. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-700-normal.woff2 +0 -0
  260. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-400-italic.woff2 +0 -0
  261. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-400-normal.woff2 +0 -0
  262. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-700-italic.woff2 +0 -0
  263. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-700-normal.woff2 +0 -0
  264. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-400-italic.woff2 +0 -0
  265. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-400-normal.woff2 +0 -0
  266. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-700-italic.woff2 +0 -0
  267. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-700-normal.woff2 +0 -0
  268. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-400-italic.woff2 +0 -0
  269. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-400-normal.woff2 +0 -0
  270. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-700-italic.woff2 +0 -0
  271. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-700-normal.woff2 +0 -0
  272. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-400-italic.woff2 +0 -0
  273. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-400-normal.woff2 +0 -0
  274. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-700-italic.woff2 +0 -0
  275. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-700-normal.woff2 +0 -0
  276. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/times-new-roman.css +316 -0
  277. package/dist/node_modules/@allyhub/stage-page/dist/host.js +1 -1
  278. package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.html +3 -0
  279. package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
  280. package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +19 -19
  281. package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
  282. package/dist/node_modules/@allyhub/video-core/dist/schema.js +1 -1
  283. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  284. package/dist/node_modules/@allyhub/video-extension/package.json +16 -1
  285. package/dist/node_modules/@allyhub/video-measure/dist/version.js +1 -1
  286. package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
  287. package/dist/node_modules/@allyhub/video-sdk/dist/phone.js +1 -1
  288. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  289. package/dist/node_modules/@allyhub/website/package.json +1 -1
  290. package/dist/node_modules/@allyhub/website-extension/dist/held.js +2 -0
  291. package/dist/node_modules/@allyhub/website-extension/dist/project-tools.js +24 -1
  292. package/dist/node_modules/@allyhub/website-extension/dist/tools.js +1 -1
  293. package/dist/node_modules/@allyhub/website-extension/package.json +49 -2
  294. package/dist/node_modules/@allyhub/x-extension/package.json +34 -4
  295. package/dist/node_modules/@allyhub/x-extension/skills/allyhub/references/x.md +7 -62
  296. package/dist/node_modules/@allyhub/x-model/package.json +1 -1
  297. package/dist/node_modules/@allyhub/x-view/dist/article.js +1 -1
  298. package/dist/node_modules/@allyhub/x-view/dist/index.js +1 -1
  299. package/dist/node_modules/@allyhub/x-view/dist/post.js +2 -2
  300. package/dist/node_modules/@allyhub/x-view/package.json +1 -1
  301. package/dist/package.json +10 -10
  302. package/dist/text/facts-text.js +5 -5
  303. package/dist/text/index.js +1 -1
  304. package/dist/text/long-text.js +4 -0
  305. package/dist/works.js +1 -1
  306. package/editor-web/assets/{abnfDiagram-WEYOIA3C-CN5PiJYY.js → abnfDiagram-WEYOIA3C-CjAmWsNR.js} +1 -1
  307. package/editor-web/assets/alt-DnBZJzEh.js +4 -0
  308. package/editor-web/assets/{architecture-WOLXFQ4H-BnvZtQYk.js → architecture-WOLXFQ4H-DeeKhyhZ.js} +1 -1
  309. package/editor-web/assets/{architectureDiagram-ZHVYKT53-tkcEcFQ8.js → architectureDiagram-ZHVYKT53-b32qTaJg.js} +1 -1
  310. package/editor-web/assets/{arrow-up-DTP2yVSU.js → arrow-up-L4YV_65f.js} +1 -1
  311. package/editor-web/assets/article-DLMjAdbP.js +73 -0
  312. package/editor-web/assets/{audio-lines-Ti8-m7H2.js → audio-lines-BFcM7G2L.js} +1 -1
  313. package/editor-web/assets/{blockDiagram-RJAE7QA3-DhqEIpie.js → blockDiagram-RJAE7QA3-BNbnMNmw.js} +1 -1
  314. package/editor-web/assets/button-Chk675Xu.js +41 -0
  315. package/editor-web/assets/{c4Diagram-XDPPPE54-Bg9G95tl.js → c4Diagram-XDPPPE54-BEuemvMw.js} +1 -1
  316. package/editor-web/assets/calc-worker-D2pGis6e.js +45 -0
  317. package/editor-web/assets/channel-EzYq4r0d.js +1 -0
  318. package/editor-web/assets/chart-Be9Hj5GL.js +1 -0
  319. package/editor-web/assets/choice-BgmBh4yu.js +1 -0
  320. package/editor-web/assets/{chunk-2E7WHVMD-C8Ve9lAa.js → chunk-2E7WHVMD-Zb5nPx_e.js} +1 -1
  321. package/editor-web/assets/{chunk-4EMNKR2T-BDWwPUnT.js → chunk-4EMNKR2T-DSEM2reX.js} +1 -1
  322. package/editor-web/assets/{chunk-55XCU76K-BQiNPKgx.js → chunk-55XCU76K-BOZa_65H.js} +1 -1
  323. package/editor-web/assets/{chunk-7S6XSTFO-QoEt-6jf.js → chunk-7S6XSTFO-DeiGeVpB.js} +1 -1
  324. package/editor-web/assets/{chunk-AQDTSKZB-BeuwIv0-.js → chunk-AQDTSKZB-fPuQFBJc.js} +1 -1
  325. package/editor-web/assets/{chunk-DSNLSHJZ-BHW7sLAz.js → chunk-DSNLSHJZ-5vdnoak2.js} +1 -1
  326. package/editor-web/assets/{chunk-HAGFOTED-bbGED0hu.js → chunk-HAGFOTED-DFF2mZJ1.js} +1 -1
  327. package/editor-web/assets/{chunk-HNE4Q36P-FltWp8yo.js → chunk-HNE4Q36P-g6-ZLbTg.js} +1 -1
  328. package/editor-web/assets/{chunk-NQOKRVIF-NeQzr6kH.js → chunk-NQOKRVIF-o3hNcHMJ.js} +1 -1
  329. package/editor-web/assets/{chunk-UHW7PFBP-eA4-WUhn.js → chunk-UHW7PFBP-BQiDI9dK.js} +1 -1
  330. package/editor-web/assets/{chunk-VQ5W62QI-BPPv325z.js → chunk-VQ5W62QI-CJlMXWWz.js} +1 -1
  331. package/editor-web/assets/{chunk-WQQL4CDK-DOCIz7Te.js → chunk-WQQL4CDK-pNBU8dXv.js} +1 -1
  332. package/editor-web/assets/{chunk-YZO67HFG-Dc_ihQJi.js → chunk-YZO67HFG-2x-BiWd-.js} +1 -1
  333. package/editor-web/assets/{chunk-ZAUX2LTX-CoqwCPSm.js → chunk-ZAUX2LTX-etFStEM8.js} +1 -1
  334. package/editor-web/assets/{chunk-ZCHMQSOR-CZUQPkJx.js → chunk-ZCHMQSOR-B3AYRhIY.js} +1 -1
  335. package/editor-web/assets/{classDiagram-v2-4MYWR3UA-DUh9c50k.js → classDiagram-v2-4MYWR3UA-6y2yX0oq.js} +1 -1
  336. package/editor-web/assets/collaborator-LRd0hELn.js +1 -0
  337. package/editor-web/assets/createLucideIcon-CPS-TrJJ.js +1 -0
  338. package/editor-web/assets/{cynefin-EF2NZ3EQ-DUTZiog0.js → cynefin-EF2NZ3EQ-CX4BTQQe.js} +1 -1
  339. package/editor-web/assets/{cynefinDiagram-WF24UDRP-oAjpfbrU.js → cynefinDiagram-WF24UDRP-LbDkOTy3.js} +1 -1
  340. package/editor-web/assets/{dagre-NK4GIZVX-BrKvKCvb.js → dagre-NK4GIZVX-wCKQk7hi.js} +1 -1
  341. package/editor-web/assets/{diagram-CBK3MWTC-GekVRnmm.js → diagram-CBK3MWTC-a9fofQwk.js} +1 -1
  342. package/editor-web/assets/{diagram-I5XIIV2D-CDd1VFRT.js → diagram-I5XIIV2D-UCLZWch5.js} +1 -1
  343. package/editor-web/assets/{diagram-ODIL2UCW-535RISTn.js → diagram-ODIL2UCW-CAEe88Lp.js} +1 -1
  344. package/editor-web/assets/{diagram-PFBEJUXE-MXzzKCGG.js → diagram-PFBEJUXE-Cp1o45bs.js} +1 -1
  345. package/editor-web/assets/{diagram-RJA3I4VV-vKVwkQxY.js → diagram-RJA3I4VV-c6OVxDyq.js} +1 -1
  346. package/editor-web/assets/{diagram-TYUNFSNR-UwGAiQLx.js → diagram-TYUNFSNR-BVRWslDM.js} +1 -1
  347. package/editor-web/assets/{dist-CKyfo5RM.js → dist--KKyT5zP.js} +1 -1
  348. package/editor-web/assets/dist-1k0MHB3i.js +1 -0
  349. package/editor-web/assets/dist-B9KHJqL5.js +4 -0
  350. package/editor-web/assets/dist-BbJyrhIY.js +1 -0
  351. package/editor-web/assets/dist-CJXCQxQM.js +37 -0
  352. package/editor-web/assets/dist-D9xQGwe9.js +5 -0
  353. package/editor-web/assets/dist-DFiLzbx8.js +219 -0
  354. package/editor-web/assets/{dist-shKo7XVN.js → dist-DIPV6xfF.js} +1 -1
  355. package/editor-web/assets/dist-Dp-fQMtx.js +6 -0
  356. package/editor-web/assets/dist-Duw28VxJ.js +16 -0
  357. package/editor-web/assets/{dist-9ymlIMhr.js → dist-DwGhfliS.js} +1 -1
  358. package/editor-web/assets/dist-OBE2IIYP.js +24 -0
  359. package/editor-web/assets/dist-j6ZLVcgf.js +38 -0
  360. package/editor-web/assets/{ebnfDiagram-V4P3TTPT-73yGokYa.js → ebnfDiagram-V4P3TTPT-KdOTJgFu.js} +1 -1
  361. package/editor-web/assets/{elk-QONTBCTQ-BW6V9y6a.js → elk-QONTBCTQ-Cmlrp7qB.js} +1 -1
  362. package/editor-web/assets/{erDiagram-KYQIGQAA-BPqIJ22h.js → erDiagram-KYQIGQAA-CBM7-aQm.js} +1 -1
  363. package/editor-web/assets/{eventmodeling-K75KTNOO-_VZ8jvuy.js → eventmodeling-K75KTNOO-CEoJkbuW.js} +1 -1
  364. package/editor-web/assets/flowDiagram-IUGLLWBU-Xm2E2ib_.js +1 -0
  365. package/editor-web/assets/{ganttDiagram-R7GPNTJY-DZ157JN2.js → ganttDiagram-R7GPNTJY-D4S6ZSYD.js} +1 -1
  366. package/editor-web/assets/{gitGraph-VSP46ZUC-fmcNL9bq.js → gitGraph-VSP46ZUC-BvkL6RSh.js} +1 -1
  367. package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-DiZDyksR.js → gitGraphDiagram-PDYL7XHY-lTGguloH.js} +1 -1
  368. package/editor-web/assets/hint-BimUgJms.js +1 -0
  369. package/editor-web/assets/index-C-i_iuxN.js +28 -0
  370. package/editor-web/assets/index-Cxh_Shkm.css +2 -0
  371. package/editor-web/assets/{info-OHQRW6UA-V06620kN.js → info-OHQRW6UA-DvKzqNvp.js} +1 -1
  372. package/editor-web/assets/{infoDiagram-MVDRKAX5-CbIgheWX.js → infoDiagram-MVDRKAX5-D7hCpehs.js} +1 -1
  373. package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-D5oJQPkG.js → ishikawaDiagram-HPEHV2GE-Bg93sZQe.js} +1 -1
  374. package/editor-web/assets/{italic-CDhZKo_q.js → italic-BQBwRTe8.js} +1 -1
  375. package/editor-web/assets/{journeyDiagram-BOSHW7O7-BZEv6JI4.js → journeyDiagram-BOSHW7O7-CKm_KONJ.js} +1 -1
  376. package/editor-web/assets/{kanban-definition-FNSA4HC5-CLG1R8y_.js → kanban-definition-FNSA4HC5-BKknnpTR.js} +1 -1
  377. package/editor-web/assets/{mermaid-parser.core-DxDwXM7z.js → mermaid-parser.core-BzqkDnqL.js} +3 -3
  378. package/editor-web/assets/{mermaid.core-tU55ZwVG.js → mermaid.core-CEpvTOAe.js} +4 -4
  379. package/editor-web/assets/{mindmap-definition-6OY57UG3-CYf4zzAh.js → mindmap-definition-6OY57UG3-BJ0qG8Wi.js} +1 -1
  380. package/editor-web/assets/minus-oPj1GxwA.js +1 -0
  381. package/editor-web/assets/{packet-JDAUHWVQ-DsHeKYNL.js → packet-JDAUHWVQ-ew3kvyFm.js} +1 -1
  382. package/editor-web/assets/{pegDiagram-ECIUJNBX-CQyh6TTa.js → pegDiagram-ECIUJNBX-DqUS2xit.js} +1 -1
  383. package/editor-web/assets/{pie-XZMESJXO-3vCIvpNB.js → pie-XZMESJXO-DTIAMPGm.js} +1 -1
  384. package/editor-web/assets/{pieDiagram-GNMPY74T-DF5yGBLn.js → pieDiagram-GNMPY74T-DoKOE02-.js} +1 -1
  385. package/editor-web/assets/progress-CPEbDOoN.js +6 -0
  386. package/editor-web/assets/{quadrantDiagram-D57K4MC3-B7pxlDYP.js → quadrantDiagram-D57K4MC3-DauOpYun.js} +1 -1
  387. package/editor-web/assets/{radar-ABXABTNO-cpEA41mL.js → radar-ABXABTNO-BvMJXUU-.js} +1 -1
  388. package/editor-web/assets/{railroad-I3PHUGI6-BLyy5R2c.js → railroad-I3PHUGI6-D3jdJmhM.js} +1 -1
  389. package/editor-web/assets/{railroad-abnf-LNEFI6M7-Y-oyol19.js → railroad-abnf-LNEFI6M7-Dm8ZpmPj.js} +1 -1
  390. package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-o58wHZsr.js → railroad-ebnf-DWYD2UWJ-oc0Du7Ag.js} +1 -1
  391. package/editor-web/assets/{railroad-peg-JR7BVNR7-CcD3PXZ8.js → railroad-peg-JR7BVNR7-CMrQL_7U.js} +1 -1
  392. package/editor-web/assets/{railroadDiagram-Y72NRBL7-BuCC4eyy.js → railroadDiagram-Y72NRBL7-y99z0C7i.js} +1 -1
  393. package/editor-web/assets/react-DztDSW4P.js +1 -0
  394. package/editor-web/assets/{repeat-2-C5PCbNsg.js → repeat-2-DJi4LW5C.js} +1 -1
  395. package/editor-web/assets/{requirementDiagram-EQYSW5RA-Dp-JFGn4.js → requirementDiagram-EQYSW5RA-jMr_uoF6.js} +1 -1
  396. package/editor-web/assets/row-ClBisiBs.js +1 -0
  397. package/editor-web/assets/{sankeyDiagram-SY24JHO5-rYuCqEvw.js → sankeyDiagram-SY24JHO5-DcUyx03Q.js} +1 -1
  398. package/editor-web/assets/schemas-68mjUjP5.js +1 -0
  399. package/editor-web/assets/{sequenceDiagram-BLEHNHQU-DryW8x6d.js → sequenceDiagram-BLEHNHQU-R4X8wRCd.js} +1 -1
  400. package/editor-web/assets/session-2u9U7koW.js +1 -0
  401. package/editor-web/assets/slides-BByblSSR.js +1 -0
  402. package/editor-web/assets/snapshots-C9KV-Y2_.js +56 -0
  403. package/editor-web/assets/sound-DExlNJbb.js +1 -0
  404. package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-Bnp0XfpT.js → stateDiagram-v2-A6IESKWZ-BqvXKbCA.js} +1 -1
  405. package/editor-web/assets/{strikethrough-DJckA35o.js → strikethrough-CyUBnGTl.js} +1 -1
  406. package/editor-web/assets/{svg-BjM9RazX.js → svg-lBRT-uhy.js} +1 -1
  407. package/editor-web/assets/swatch-1c1uVn1z.js +1 -0
  408. package/editor-web/assets/{swimlanes-B3ENRKFQ-BiRRhhbd.js → swimlanes-B3ENRKFQ-hjTXIc6M.js} +1 -1
  409. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-BLfytmPY.js +8 -0
  410. package/editor-web/assets/switch-D0K-K8-C.js +1 -0
  411. package/editor-web/assets/{syntax-CC6QYhCz.js → syntax-Bih_jv7W.js} +1 -1
  412. package/editor-web/assets/tabs-CxxOnGLR.js +1 -0
  413. package/editor-web/assets/{textarea-BGtPqZdB.js → textarea-Fu93tFO3.js} +1 -1
  414. package/editor-web/assets/{timeline-definition-JXYKGLGB-D-Q5ZtDF.js → timeline-definition-JXYKGLGB-BcSoN4Dq.js} +1 -1
  415. package/editor-web/assets/{trash-2-Bjj6cWzP.js → trash-2-BAKAeziW.js} +1 -1
  416. package/editor-web/assets/{treeView-D4JQ5SDB-B6DDatXq.js → treeView-D4JQ5SDB-CsFN2jrc.js} +1 -1
  417. package/editor-web/assets/{treemap-SAJKECNS-D7j5ZhiI.js → treemap-SAJKECNS-DP1eqXJ2.js} +1 -1
  418. package/editor-web/assets/{undo-2-yOSG766T.js → undo-2-DQ5CBmki.js} +1 -1
  419. package/editor-web/assets/{usecaseDiagram-WPOLBNNX-tkrdKUJB.js → usecaseDiagram-WPOLBNNX-BGxa0osF.js} +1 -1
  420. package/editor-web/assets/{vennDiagram-Q3Y3IDCW-Ch4XbSnD.js → vennDiagram-Q3Y3IDCW-D2XhTF49.js} +1 -1
  421. package/editor-web/assets/video-CDbPX4Cr.js +1 -0
  422. package/editor-web/assets/{wardley-7MLQ67FV-Bynt7qNQ.js → wardley-7MLQ67FV-DM3jMAbZ.js} +1 -1
  423. package/editor-web/assets/{wardleyDiagram-IVAIDKWA-DRuSgm_L.js → wardleyDiagram-IVAIDKWA-Bf-DaZEg.js} +1 -1
  424. package/editor-web/assets/{xychartDiagram-4URNHDU4-DctpvfkL.js → xychartDiagram-4URNHDU4-dp-mdcWd.js} +1 -1
  425. package/editor-web/index.html +6 -5
  426. package/package.json +2 -2
  427. package/editor-web/assets/alt-BOVao_9S.js +0 -4
  428. package/editor-web/assets/article-B6YCzhj8.js +0 -73
  429. package/editor-web/assets/calc-worker-B5-fDWnb.js +0 -45
  430. package/editor-web/assets/channel-C26aBI4o.js +0 -1
  431. package/editor-web/assets/chart-BOnxneyw.js +0 -1
  432. package/editor-web/assets/choice-O5nwc2N0.js +0 -1
  433. package/editor-web/assets/collaborator-BJU5qwHd.js +0 -1
  434. package/editor-web/assets/createLucideIcon-B3B95oX5.js +0 -1
  435. package/editor-web/assets/dist-C6NqUEG4.js +0 -16
  436. package/editor-web/assets/dist-C9UGmCG9.js +0 -6
  437. package/editor-web/assets/dist-CAk5bjBm.js +0 -1
  438. package/editor-web/assets/dist-CRaWqNwq.js +0 -37
  439. package/editor-web/assets/dist-CwIBc7HQ.js +0 -1
  440. package/editor-web/assets/dist-DXRmkezB.js +0 -38
  441. package/editor-web/assets/dist-EKK5i0dG.js +0 -219
  442. package/editor-web/assets/dist-hHJlpLWo.js +0 -5
  443. package/editor-web/assets/dist-oYKcwWUj.js +0 -4
  444. package/editor-web/assets/dist-wrKxBrVu.js +0 -24
  445. package/editor-web/assets/flowDiagram-IUGLLWBU-ouDQYiTr.js +0 -1
  446. package/editor-web/assets/hint-_AQWCDMj.js +0 -1
  447. package/editor-web/assets/index-BsstP-cI.js +0 -28
  448. package/editor-web/assets/index-DQRcmxBO.css +0 -2
  449. package/editor-web/assets/minus-Cgmm6ncD.js +0 -1
  450. package/editor-web/assets/progress-0B_TVsPi.js +0 -6
  451. package/editor-web/assets/react-BP46yLMB.js +0 -1
  452. package/editor-web/assets/react-pgBZqVxJ.js +0 -96
  453. package/editor-web/assets/schemas-Ewwjtbf4.js +0 -1
  454. package/editor-web/assets/session-DiI9KYRI.js +0 -1
  455. package/editor-web/assets/slides-CCwgBcGH.js +0 -1
  456. package/editor-web/assets/sound-CqryteNl.js +0 -1
  457. package/editor-web/assets/swatch-DL3HqIjW.js +0 -1
  458. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-BkOls8Tv.js +0 -8
  459. package/editor-web/assets/switch-DltnKqN-.js +0 -1
  460. package/editor-web/assets/tabs-C-re0Kxn.js +0 -1
  461. package/editor-web/assets/video-DXFiCNGc.js +0 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/audio",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/browser",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/build",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/canvas-extension",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./package.json": "./package.json",
@@ -42,6 +42,7 @@
42
42
  "icon": "layout-dashboard",
43
43
  "color": "kind-ochre",
44
44
  "module": "@allyhub/canvas-editor",
45
+ "markup": "./markup",
45
46
  "check": "./dist/check.js",
46
47
  "place": {
47
48
  "type": "object",
@@ -1,27 +1,7 @@
1
1
  # references/canvas.md
2
2
 
3
- A canvas lays a project's work out to be seen together, compared and talked over: a launch's outputs side by side, two cuts of a video, a mood board, candidates with your reasons beside them. It draws nothing of its own and exports nothing. It is a `.canvas` file anywhere in the project, in JSON Canvas 1.0 (jsoncanvas.org, as Obsidian writes it), listed in `allyhub.yaml` with no kind (`- file: boards/launch.canvas`) for the person to see it. Write it by hand.
3
+ A canvas lays a project's work out to be seen together, compared and talked over: a launch's outputs side by side, two cuts of a video, a mood board, candidates with your reasons beside them. It draws nothing of its own and exports nothing. It is a `.canvas` file (JSON Canvas, as Obsidian writes it) anywhere in the project, written by hand and listed in `allyhub.yaml` for the person to see it.
4
4
 
5
- <!-- prettier-ignore -->
6
- ```json
7
- {
8
- "nodes":[
9
- {"id":"7d1f0c3a9b2e4f60","type":"group","label":"Share pictures","x":-40,"y":-80,"width":1360,"height":520},
10
- {"id":"2b9e81c04d7f3a15","type":"file","file":"launch/og/og.ts","x":0,"y":0,"width":600,"height":340},
11
- {"id":"c04d7f3a152b9e81","type":"text","text":"**Why this plate**: the river reads at 400 px.","x":640,"y":0,"width":320,"height":160,"color":"4"},
12
- {"id":"9a6e2f10b3c84d57","type":"link","url":"https://x.com/allyhub","x":640,"y":200,"width":320,"height":120}
13
- ],
14
- "edges":[
15
- {"id":"5e3a9c1d7b0f2846","fromNode":"c04d7f3a152b9e81","fromSide":"left","toNode":"2b9e81c04d7f3a15","toSide":"right","label":"chosen"}
16
- ]
17
- }
18
- ```
19
-
20
- - **Paths are from the project's folder**, wherever the canvas is.
21
- - **A file node points at an item by its file**, as `allyhub.yaml` lists it (`launch/og/og.ts`, `launch/film/film.ts`); it shows the item's own preview, live: an image's boards, a deck's slide, a video's still, a doc's first words. Any other file (`assets/media/plate.webp`, a clip, a sound) shows itself.
22
- - **Nodes**: `text` (Markdown), `file`, `link` (`url`) and `group` (`label`), each with whole-pixel `x`, `y`, `width` and `height`; y grows down. The first node is drawn at the back, so a group comes before what it holds. A group holds the nodes whose boxes are inside its box.
23
- - **Edges** join two nodes by id, from a side (`top`, `right`, `bottom`, `left`) to a side, with a `label`; `toEnd` is an arrow unless `"none"`.
24
- - **Colours** are `"1"` red, `"2"` orange, `"3"` yellow, `"4"` green, `"5"` cyan, `"6"` purple, or a hex colour.
25
- - **Ids** are unique across nodes and edges: 16 hex digits, as Obsidian makes them.
26
- - **The person's changes** (moves, notes, edges) are written to the same file: read it before you change it, and keep the ids and the fields you do not know.
27
- - `allyhub check` reports a duplicate id, a file node at a missing file and an edge at a missing node (AK-C001 to AK-C004). `allyhub inspect canvas <file>` lists the nodes with their boxes and what they point at, what each group holds and each edge's ends. `allyhub dev <file>` opens it for the person.
5
+ - `allyhub help canvases` lists the commands and prints where the SDK's `canvas.md` is. Read it before writing a canvas.
6
+ - **The person moves things and adds notes and edges in the same file.** Read it before you change it, and keep what they put there.
7
+ - `allyhub inspect canvas <file>` lists what it holds and where, without drawing it; `allyhub dev <file>` opens it for the person.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/canvas-model",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,3 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{lumOf as X}from"@allyhub/ooxml/brightness";import{accentOf as j,CHART_DEFAULTS as d,chartDrawing as D,groupingOf as z,hasLines as E,hasMarkers as U,isArea as R,isBar as C,isHorizontal as T,isLine as P,isRound as h,isScatter as k,labelPositionOf as V,variesOf as w}from"./chart.js";const B="http://schemas.openxmlformats.org/drawingml/2006/chart",W="http://schemas.openxmlformats.org/drawingml/2006/main",H="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Z=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
3
- `,y="2118791784",x="2140495176",q={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},K=e=>{const n=e.charCodeAt(0);return n<32&&n!==9&&n!==10&&n!==13||n===65534||n===65535},l=e=>Array.from(e,n=>K(n)?"":q[n]??n).join("");function r(e,n={},...c){const o=Object.entries(n).filter(([,s])=>s!==void 0).map(([s,i])=>` ${s}="${l(typeof i=="boolean"?i?"1":"0":String(i))}"`).join(""),a=c.join("");return a===""?`<${e}${o}/>`:`<${e}${o}>${a}</${e}>`}const Y=e=>{if(typeof e=="string")return r("a:schemeClr",{val:e});if("rgb"in e)return r("a:srgbClr",{val:e.rgb.replace("#","").toUpperCase()});const{lumMod:n,lumOff:c}=X(e.brightness);return r("a:schemeClr",{val:e.theme_color},t("a:lumMod",n),...c===void 0?[]:[t("a:lumOff",c)])},p=e=>e===null?r("a:noFill"):r("a:solidFill",{},Y(e)),t=(e,n)=>r(e,{val:typeof n=="boolean"?n?1:0:n}),m=(e,n)=>r("a:ln",n===void 0?{}:{w:Math.round(n*12700)},p(e)),F=(e,n)=>r("c:txPr",{},r("a:bodyPr"),r("a:lstStyle"),r("a:p",{},r("a:pPr",{},r("a:defRPr",e===void 0?{}:{sz:Math.round(e*100)},n===void 0?"":p(n))),r("a:endParaRPr",{lang:"en-US"}))),S=e=>r("c:strCache",{},t("c:ptCount",e.length),...e.map((n,c)=>r("c:pt",{idx:c},`<c:v>${l(n)}</c:v>`))),A=(e,n)=>r("c:numCache",{},`<c:formatCode>${l(e??"General")}</c:formatCode>`,t("c:ptCount",n.length),...n.flatMap((c,o)=>c===null?[]:[r("c:pt",{idx:o},`<c:v>${String(c)}</c:v>`)])),J=(e,n)=>r("c:tx",{},n===void 0?`<c:v>${l(e.name)}</c:v>`:r("c:strRef",{},`<c:f>${l(n)}</c:f>`,S([e.name]))),Q=(e,n)=>n===void 0?"":r("c:xVal",{},r("c:numRef",{},`<c:f>${l(n)}</c:f>`,A("General",e.x??[])));function ee(e,n,c,o){const a=n.color??j(c),s=h(e.type),i=k(e.type),u=P(e.type)||i,g=U(e.type),N=u?r("c:spPr",{},E(e.type)?m(a,n.line_width??d.lineWidth):r("a:ln",{w:19050},p(null))):r("c:spPr",{},p(a),s?m("lt1",1):""),_=o.categories;return r("c:ser",{},t("c:idx",c),t("c:order",c),J(n,o.name(c)),N,C(e.type)?t("c:invertIfNegative",!1):"",u?r("c:marker",{},t("c:symbol",g?"circle":"none"),g?t("c:size",n.marker_size??d.marker):"",g?r("c:spPr",{},p(a),m(a)):""):"",...w(e)&&!u&&!R(e.type)?e.categories.map((v,f)=>r("c:dPt",{},t("c:idx",f),C(e.type)?t("c:invertIfNegative",!1):"",t("c:bubble3D",!1),r("c:spPr",{},p(e.category_colors?.[f]??j(f)),s?m("lt1",1):""))):[],i?Q(n,o.x?.(c)):_===void 0?"":r("c:cat",{},o.numeric===!0?r("c:numRef",{},`<c:f>${l(_)}</c:f>`,A("General",e.categories.map(v=>{const f=Number(v);return v===""||!Number.isFinite(f)?null:f}))):r("c:strRef",{},`<c:f>${l(_)}</c:f>`,S(e.categories))),r(i?"c:yVal":"c:val",{},r("c:numRef",{},`<c:f>${l(o.values(c))}</c:f>`,A(n.number_format,n.values))),u?t("c:smooth",n.smooth===!0||e.type==="scatter-smooth"):"")}function b(e){const n=e.labels;if(!n)return"";const c=n.show_percentage===!0,o=V(e);return r("c:dLbls",{},n.number_format===void 0?"":r("c:numFmt",{formatCode:n.number_format,sourceLinked:0}),n.size===void 0&&n.color===void 0&&!h(e.type)?"":F(n.size,n.color??(h(e.type)?"lt1":void 0)),o===void 0?"":t("c:dLblPos",o),t("c:showLegendKey",!1),t("c:showVal",n.show_value??!c),t("c:showCatName",n.show_category_name===!0),t("c:showSerName",n.show_series_name===!0),t("c:showPercent",c),t("c:showBubbleSize",!1))}function te(e,n){const c=e.series.map((s,i)=>ee(e,s,i,n)).join(""),o=z(e.type),a=t("c:axId",y)+t("c:axId",x);if(h(e.type)){const s=e.type==="pie";return r(s?"c:pieChart":"c:doughnutChart",{},t("c:varyColors",w(e)),c,b(e),t("c:firstSliceAng",0),s?"":t("c:holeSize",e.hole_size??50))}if(k(e.type))return r("c:scatterChart",{},t("c:scatterStyle","lineMarker"),t("c:varyColors",!1),c,b(e),a);if(C(e.type)){const s=o!=="clustered";return r("c:barChart",{},t("c:barDir",T(e.type)?"bar":"col"),t("c:grouping",o),t("c:varyColors",w(e)),c,b(e),t("c:gapWidth",e.gap_width??150),e.overlap!==void 0||s?t("c:overlap",e.overlap??100):"",a)}return r(P(e.type)?"c:lineChart":"c:areaChart",{},t("c:grouping",o),t("c:varyColors",!1),c,b(e),P(e.type)?t("c:marker",!0):"",a)}const L=e=>r("c:scaling",{},t("c:orientation",e.reverse_order===!0?"maxMin":"minMax"),e.maximum_scale===void 0?"":t("c:max",e.maximum_scale),e.minimum_scale===void 0?"":t("c:min",e.minimum_scale)),O=e=>r("c:spPr",{},m(e.line_color??{rgb:d.axisLine},d.gridWidth)),M=e=>e.has_major_gridlines===!0?r("c:majorGridlines",{},r("c:spPr",{},m(e.gridline_color??{rgb:d.gridline},d.gridWidth))):"",I=(e,n)=>r("c:rich",{},r("a:bodyPr"),r("a:lstStyle"),r("a:p",{},r("a:pPr",{},r("a:defRPr",{sz:n,b:0})),r("a:r",{},r("a:rPr",{lang:"en-US",sz:n,b:0}),`<a:t>${l(e)}</a:t>`))),$=(e,n)=>e===void 0||e===""?"":r("c:title",{},r("c:tx",{},I(e,n)),t("c:overlay",!1));function ne(e){if(h(e.type))return"";const n=k(e.type),c=T(e.type),o=e.category_axis??{},a={has_major_gridlines:!0,...e.value_axis},s=z(e.type)==="percentStacked",i=a.number_format??(s?"0%":e.series[0]?.number_format??"General"),u=Math.round((e.font_size??d.fontSize)*100);return(n?r("c:valAx",{},t("c:axId",y),L(o),t("c:delete",o.visible===!1),t("c:axPos","b"),M(o),$(o.title,u),r("c:numFmt",{formatCode:o.number_format??"General",sourceLinked:o.number_format===void 0?1:0}),t("c:majorTickMark","none"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),O(o),t("c:crossAx",x),t("c:crosses","autoZero"),t("c:crossBetween","midCat"),o.major_unit===void 0?"":t("c:majorUnit",o.major_unit)):r("c:catAx",{},t("c:axId",y),L(o),t("c:delete",o.visible===!1),t("c:axPos",c?"l":"b"),M(o),$(o.title,u),r("c:numFmt",{formatCode:"General",sourceLinked:0}),t("c:majorTickMark","none"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),O(o),t("c:crossAx",x),t("c:crosses","autoZero"),t("c:auto",!0),t("c:lblAlgn","ctr"),t("c:lblOffset",100),t("c:noMultiLvlLbl",!1)))+r("c:valAx",{},t("c:axId",x),L(a),t("c:delete",a.visible===!1),t("c:axPos",c?"b":"l"),M(a),$(a.title,u),r("c:numFmt",{formatCode:i,sourceLinked:a.number_format===void 0&&!s?1:0}),t("c:majorTickMark","none"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),r("c:spPr",{},m(null)),t("c:crossAx",y),t("c:crosses","autoZero"),t("c:crossBetween",R(e.type)||n?"midCat":"between"),a.major_unit===void 0?"":t("c:majorUnit",a.major_unit))}const re={bottom:"b",top:"t",left:"l",right:"r"};function oe(e,n){const c=n.width,o=n.height,{plot:a}=D(e,c,o),s=i=>Number(i.toFixed(5));return r("c:layout",{},r("c:manualLayout",{},t("c:layoutTarget","inner"),t("c:xMode","edge"),t("c:yMode","edge"),t("c:x",s(a.x/c)),t("c:y",s(a.y/o)),t("c:w",s(a.width/c)),t("c:h",s(a.height/o))))}const G=r("c:spPr",{},r("a:noFill"),r("a:ln",{},r("a:noFill")));export function chartSpaceXml(e,n){const c=e.title!==void 0&&e.title!==""?e.title:void 0,o=e.font_size??d.fontSize,a=Math.round((e.title_size??o*d.titleScale)*100);return Z+r("c:chartSpace",{"xmlns:c":B,"xmlns:a":W,"xmlns:r":H},t("c:date1904",!1),t("c:roundedCorners",!1),r("c:chart",{},c===void 0?"":r("c:title",{},r("c:tx",{},n.titleRef===void 0?I(c,a):r("c:strRef",{},`<c:f>${l(n.titleRef)}</c:f>`,S([c]))),t("c:overlay",!1)),t("c:autoTitleDeleted",c===void 0),r("c:plotArea",{},n.frame?oe(e,n.frame):r("c:layout"),te(e,n.refs),ne(e),n.frameless===!0?G:""),e.legend===void 0?"":r("c:legend",{},t("c:legendPos",re[e.legend]),t("c:overlay",e.legend_overlay===!0)),t("c:plotVisOnly",n.plotVisible??!0),t("c:dispBlanksAs","gap")),n.frameless===!0?G:"",F(o,e.font_color??"dk1"),n.tail??"")}
2
+ import{lumOf as V}from"@allyhub/ooxml/brightness";import{accentOf as I,CHART_DEFAULTS as m,chartDrawing as B,groupingOf as A,groupsOf as R,hasLines as W,hasMarkers as Z,isArea as O,isBar as L,isHorizontal as G,isLine as S,isRound as g,isScatter as w,labelPositionOf as H,variesOf as M}from"./chart.js";const Y="http://schemas.openxmlformats.org/drawingml/2006/chart",q="http://schemas.openxmlformats.org/drawingml/2006/main",K="http://schemas.openxmlformats.org/officeDocument/2006/relationships",J=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
3
+ `,b="2118791784",y="2140495176",j="2118791785",T="2140495177",Q={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},ee=e=>{const n=e.charCodeAt(0);return n<32&&n!==9&&n!==10&&n!==13||n===65534||n===65535},d=e=>Array.from(e,n=>ee(n)?"":Q[n]??n).join("");function r(e,n={},...c){const a=Object.entries(n).filter(([,s])=>s!==void 0).map(([s,i])=>` ${s}="${d(typeof i=="boolean"?i?"1":"0":String(i))}"`).join(""),o=c.join("");return o===""?`<${e}${a}/>`:`<${e}${a}>${o}</${e}>`}const te=e=>{if(typeof e=="string")return r("a:schemeClr",{val:e});if("rgb"in e)return r("a:srgbClr",{val:e.rgb.replace("#","").toUpperCase()});const{lumMod:n,lumOff:c}=V(e.brightness);return r("a:schemeClr",{val:e.theme_color},t("a:lumMod",n),...c===void 0?[]:[t("a:lumOff",c)])},h=e=>e===null?r("a:noFill"):r("a:solidFill",{},te(e)),t=(e,n)=>r(e,{val:typeof n=="boolean"?n?1:0:n}),f=(e,n)=>r("a:ln",n===void 0?{}:{w:Math.round(n*12700)},h(e)),X=(e,n)=>r("c:txPr",{},r("a:bodyPr"),r("a:lstStyle"),r("a:p",{},r("a:pPr",{},r("a:defRPr",e===void 0?{}:{sz:Math.round(e*100)},n===void 0?"":h(n))),r("a:endParaRPr",{lang:"en-US"}))),$=e=>r("c:strCache",{},t("c:ptCount",e.length),...e.map((n,c)=>r("c:pt",{idx:c},`<c:v>${d(n)}</c:v>`))),F=(e,n)=>r("c:numCache",{},`<c:formatCode>${d(e??"General")}</c:formatCode>`,t("c:ptCount",n.length),...n.flatMap((c,a)=>c===null?[]:[r("c:pt",{idx:a},`<c:v>${String(c)}</c:v>`)])),ne=(e,n)=>r("c:tx",{},n===void 0?`<c:v>${d(e.name)}</c:v>`:r("c:strRef",{},`<c:f>${d(n)}</c:f>`,$([e.name]))),re=(e,n)=>n===void 0?"":r("c:xVal",{},r("c:numRef",{},`<c:f>${d(n)}</c:f>`,F("General",e.x??[])));function oe(e,n,c,a){const o=n.color??I(c),s=g(e.type),i=w(e.type),l=S(e.type)||i,u=Z(e.type),z=l?r("c:spPr",{},W(e.type)?f(o,n.line_width??m.lineWidth):r("a:ln",{w:19050},h(null))):r("c:spPr",{},h(o),s?f("lt1",1):""),v=a.categories;return r("c:ser",{},t("c:idx",c),t("c:order",c),ne(n,a.name(c)),z,L(e.type)?t("c:invertIfNegative",!1):"",l?r("c:marker",{},t("c:symbol",u?"circle":"none"),u?t("c:size",n.marker_size??m.marker):"",u?r("c:spPr",{},h(o),f(o)):""):"",...M(e)&&!l&&!O(e.type)?e.categories.map((P,p)=>r("c:dPt",{},t("c:idx",p),L(e.type)?t("c:invertIfNegative",!1):"",t("c:bubble3D",!1),r("c:spPr",{},h(e.category_colors?.[p]??I(p)),s?f("lt1",1):""))):[],i?re(n,a.x?.(c)):v===void 0?"":r("c:cat",{},a.numeric===!0?r("c:numRef",{},`<c:f>${d(v)}</c:f>`,F(a.categoryFormat??"General",a.categoryNumbers??e.categories.map(P=>{const p=Number(P);return P===""||!Number.isFinite(p)?null:p}))):r("c:strRef",{},`<c:f>${d(v)}</c:f>`,$(e.categories))),r(i?"c:yVal":"c:val",{},r("c:numRef",{},`<c:f>${d(a.values(c))}</c:f>`,F(n.number_format,n.values))),l?t("c:smooth",n.smooth===!0||e.type==="scatter-smooth"):"")}function _(e){const n=e.labels;if(!n)return"";const c=n.show_percentage===!0,a=H(e);return r("c:dLbls",{},n.number_format===void 0?"":r("c:numFmt",{formatCode:n.number_format,sourceLinked:0}),n.size===void 0&&n.color===void 0&&!g(e.type)?"":X(n.size,n.color??(g(e.type)?"lt1":void 0)),a===void 0?"":t("c:dLblPos",a),t("c:showLegendKey",!1),t("c:showVal",n.show_value??!c),t("c:showCatName",n.show_category_name===!0),t("c:showSerName",n.show_series_name===!0),t("c:showPercent",c),t("c:showBubbleSize",!1))}function ce(e,n){const c=R(e),[a]=c;return c.length<=1&&a?.secondary!==!0?E(e,e.series.map((o,s)=>s),n,!1):c.map(o=>E({...e,type:o.kind},o.series,n,o.secondary)).join("")}function E(e,n,c,a){const o=n.map(l=>{const u=e.series[l];return u?oe(e,u,l,c):""}).join(""),s=A(e.type),i=a?t("c:axId",j)+t("c:axId",T):t("c:axId",b)+t("c:axId",y);if(g(e.type)){const l=e.type==="pie";return r(l?"c:pieChart":"c:doughnutChart",{},t("c:varyColors",M(e)),o,_(e),t("c:firstSliceAng",0),l?"":t("c:holeSize",e.hole_size??50))}if(w(e.type))return r("c:scatterChart",{},t("c:scatterStyle","lineMarker"),t("c:varyColors",!1),o,_(e),i);if(L(e.type)){const l=s!=="clustered";return r("c:barChart",{},t("c:barDir",G(e.type)?"bar":"col"),t("c:grouping",s),t("c:varyColors",M(e)),o,_(e),t("c:gapWidth",e.gap_width??150),e.overlap!==void 0||l?t("c:overlap",e.overlap??100):"",i)}return r(S(e.type)?"c:lineChart":"c:areaChart",{},t("c:grouping",s),t("c:varyColors",!1),o,_(e),S(e.type)?t("c:marker",!0):"",i)}const x=e=>r("c:scaling",{},t("c:orientation",e.reverse_order===!0?"maxMin":"minMax"),e.maximum_scale===void 0?"":t("c:max",e.maximum_scale),e.minimum_scale===void 0?"":t("c:min",e.minimum_scale)),N=e=>r("c:spPr",{},f(e.line_color??{rgb:m.axisLine},m.gridWidth)),k=e=>e.has_major_gridlines===!0?r("c:majorGridlines",{},r("c:spPr",{},f(e.gridline_color??{rgb:m.gridline},m.gridWidth))):"",U=(e,n)=>r("c:rich",{},r("a:bodyPr"),r("a:lstStyle"),r("a:p",{},r("a:pPr",{},r("a:defRPr",{sz:n,b:0})),r("a:r",{},r("a:rPr",{lang:"en-US",sz:n,b:0}),`<a:t>${d(e)}</a:t>`))),C=(e,n)=>e===void 0||e===""?"":r("c:title",{},r("c:tx",{},U(e,n)),t("c:overlay",!1));function ae(e,n){if(g(e.type))return"";const c=w(e.type),a=G(e.type),o=e.category_axis??{},s={has_major_gridlines:!0,...e.value_axis},i=A(e.type)==="percentStacked",l=s.number_format??(i?"0%":e.series[0]?.number_format??"General"),u=Math.round((e.font_size??m.fontSize)*100);return(c?r("c:valAx",{},t("c:axId",b),x(o),t("c:delete",o.visible===!1),t("c:axPos","b"),k(o),C(o.title,u),r("c:numFmt",{formatCode:o.number_format??"General",sourceLinked:o.number_format===void 0?1:0}),t("c:majorTickMark","none"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),N(o),t("c:crossAx",y),t("c:crosses","autoZero"),t("c:crossBetween","midCat"),o.major_unit===void 0?"":t("c:majorUnit",o.major_unit)):r("c:catAx",{},t("c:axId",b),x(o),t("c:delete",o.visible===!1),t("c:axPos",a?"l":"b"),k(o),C(o.title,u),n?.numeric===!0?r("c:numFmt",{formatCode:o.number_format??n.categoryFormat??"General",sourceLinked:o.number_format===void 0?1:0}):r("c:numFmt",{formatCode:"General",sourceLinked:0}),t("c:majorTickMark","none"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),N(o),t("c:crossAx",y),t("c:crosses","autoZero"),t("c:auto",!0),t("c:lblAlgn","ctr"),t("c:lblOffset",100),t("c:noMultiLvlLbl",!1)))+r("c:valAx",{},t("c:axId",y),x(s),t("c:delete",s.visible===!1),t("c:axPos",a?"b":"l"),k(s),C(s.title,u),r("c:numFmt",{formatCode:l,sourceLinked:s.number_format===void 0&&!i?1:0}),t("c:majorTickMark","none"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),r("c:spPr",{},f(null)),t("c:crossAx",b),t("c:crosses","autoZero"),t("c:crossBetween",O(e.type)||c?"midCat":"between"),s.major_unit===void 0?"":t("c:majorUnit",s.major_unit))+se(e,u)}function se(e,n){const c=R(e).find(i=>i.secondary);if(!c)return"";const a=e.secondary_axis??{},o=A(c.kind)==="percentStacked",s=a.number_format??(o?"0%":e.series[c.series[0]??0]?.number_format??"General");return r("c:catAx",{},t("c:axId",j),x({}),t("c:delete",!0),t("c:axPos","b"),r("c:numFmt",{formatCode:"General",sourceLinked:1}),t("c:majorTickMark","out"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),t("c:crossAx",T),t("c:crosses","autoZero"),t("c:auto",!0),t("c:lblAlgn","ctr"),t("c:lblOffset",100),t("c:noMultiLvlLbl",!1))+r("c:valAx",{},t("c:axId",T),x(a),t("c:delete",a.visible===!1),t("c:axPos","r"),k(a),C(a.title,n),r("c:numFmt",{formatCode:s,sourceLinked:a.number_format===void 0&&!o?1:0}),t("c:majorTickMark","none"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),r("c:spPr",{},f(null)),t("c:crossAx",j),t("c:crosses","max"),t("c:crossBetween","between"),a.major_unit===void 0?"":t("c:majorUnit",a.major_unit))}const ie={bottom:"b",top:"t",left:"l",right:"r"};function le(e,n){const c=n.width,a=n.height,{plot:o}=B(e,c,a),s=i=>Number(i.toFixed(5));return r("c:layout",{},r("c:manualLayout",{},t("c:layoutTarget","inner"),t("c:xMode","edge"),t("c:yMode","edge"),t("c:x",s(o.x/c)),t("c:y",s(o.y/a)),t("c:w",s(o.width/c)),t("c:h",s(o.height/a))))}const D=r("c:spPr",{},r("a:noFill"),r("a:ln",{},r("a:noFill")));export function chartSpaceXml(e,n){const c=e.title!==void 0&&e.title!==""?e.title:void 0,a=e.font_size??m.fontSize,o=Math.round((e.title_size??a*m.titleScale)*100);return J+r("c:chartSpace",{"xmlns:c":Y,"xmlns:a":q,"xmlns:r":K},t("c:date1904",!1),t("c:roundedCorners",!1),r("c:chart",{},c===void 0?"":r("c:title",{},r("c:tx",{},n.titleRef===void 0?U(c,o):r("c:strRef",{},`<c:f>${d(n.titleRef)}</c:f>`,$([c]))),t("c:overlay",!1)),t("c:autoTitleDeleted",c===void 0),r("c:plotArea",{},n.frame?le(e,n.frame):r("c:layout"),ce(e,n.refs),ae(e,n.refs),n.frameless===!0?D:""),e.legend===void 0?"":r("c:legend",{},t("c:legendPos",ie[e.legend]),t("c:overlay",e.legend_overlay===!0)),t("c:plotVisOnly",n.plotVisible??!0),t("c:dispBlanksAs","gap")),n.frameless===!0?D:"",X(a,e.font_color??"dk1"),n.tail??"")}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{format as Ct,isValidFormat as Lt}from"numfmt";import{brightened as jt}from"@allyhub/ooxml/brightness";export const themeColor=(t,s=0)=>s===0?t:{theme_color:t,brightness:s},themeColorOf=t=>typeof t=="string"?t:"theme_color"in t?t.theme_color:void 0;export function colorRgb(t,s){return typeof t=="string"?s[t]:"rgb"in t?t.rgb:jt(s[t.theme_color],t.brightness)}export const CHART_DEFAULTS={fontSize:12,titleScale:1.2,gapWidth:150,holeSize:50,margin:6,gridline:"#D9D9D9",axisLine:"#BFBFBF",letter:.55,lineWidth:2.25,gridWidth:.75,marker:5};const vt=["accent1","accent2","accent3","accent4","accent5","accent6"];export const accentOf=t=>vt[t%vt.length]??"accent1",isBar=t=>t.startsWith("column")||t.startsWith("bar"),isHorizontal=t=>t.startsWith("bar"),isLine=t=>t.startsWith("line"),isArea=t=>t.startsWith("area"),isRound=t=>t==="pie"||t==="doughnut",isScatter=t=>t.startsWith("scatter"),hasLines=t=>!isScatter(t)||t!=="scatter",hasMarkers=t=>t==="line-markers"||t==="scatter"||t==="scatter-lines",groupingOf=t=>t.endsWith("-100")?"percentStacked":t.endsWith("-stacked")?"stacked":isBar(t)?"clustered":"standard";export function labelPositionsOf(t){return isArea(t)||t==="doughnut"?[]:t==="pie"?["bestFit","outEnd","inEnd","ctr"]:isLine(t)||isScatter(t)?["t","b","l","r","ctr"]:groupingOf(t)==="clustered"?["outEnd","inEnd","ctr","inBase"]:["inEnd","ctr","inBase"]}export function labelPositionOf(t){const s=labelPositionsOf(t.type),l=t.labels?.position;if(l!==void 0&&s.includes(l))return l;if(s.length!==0)return t.type==="pie"?"ctr":isLine(t.type)||isScatter(t.type)?"t":groupingOf(t.type)==="clustered"?"outEnd":"ctr"}export const variesOf=t=>t.vary_by_categories??isRound(t.type);export function formatValue(t,s="General"){return s==="General"||!Lt(s)?String(Number(t.toPrecision(10))):Ct(s,t)}const Ft=[1,2,5,10];export function chartScale(t,s,l,r,e={}){const h=t>0&&(s-t)/s<.16666666666666666?t:Math.min(t,0),a=s<=0&&t<0?0:s,o=e.minimum_scale??h,j=e.maximum_scale??a,b=j>o?j-o:1,F=Math.max(1,Math.floor(l/r)),w=b/F,P=10**Math.floor(Math.log10(w)),O=e.major_unit??(Ft.find(E=>E*P>=w)??10)*P,B=(E,C)=>Number((C(Number((E/O).toFixed(9)))*O).toPrecision(12)),Z=a>0?a+b*.05:a===h?b:a,g=e.maximum_scale??B(Z,Math.ceil),R=h<0?h-b*.05:h,W=e.minimum_scale??B(R,Math.floor),N=[],x=Math.round((g-W)/O);for(let E=0;E<=x;E++)N.push(Number((W+E*O).toPrecision(12)));return{min:W,max:g,major:O,ticks:N}}const it=(t,s)=>{let l=0;for(const r of t)l+=(r.codePointAt(0)??0)>11903?1:CHART_DEFAULTS.letter;return l*s},m=t=>String(Number(t.toFixed(3)));function kt(t){const s=l=>t[Math.max(0,Math.min(t.length-1,l))]??[0,0];return t.map(([l,r],e)=>{if(e===0)return`M${m(l)} ${m(r)}`;const[h,a]=s(e-2),[o,j]=s(e-1),[b,F]=s(e+1),w=`${m(o+(l-h)/6)} ${m(j+(r-a)/6)}`,P=`${m(l-(b-o)/6)} ${m(r-(F-j)/6)}`;return`C${w} ${P} ${m(l)} ${m(r)}`}).join(" ")}const lt=t=>t.map(([s,l],r)=>`${r===0?"M":"L"}${m(s)} ${m(l)}`).join(" ");function Ot(t,s,l,r,e,h){const a=(F,w)=>`${m(t+F*Math.sin(w))} ${m(s-F*Math.cos(w))}`,o=h-e>=Math.PI*2?e+Math.PI*2-1e-4:h,j=o-e>Math.PI?1:0,b=`M${a(l,e)} A${m(l)} ${m(l)} 0 ${String(j)} 1 ${a(l,o)}`;return r<=0?`${b} L${m(t)} ${m(s)} Z`:`${b} L${a(r,o)} A${m(r)} ${m(r)} 0 ${String(j)} 0 ${a(r,e)} Z`}function Wt(t,s,l,r){const e=r*1.5;return s!==void 0&&s!==""&&(t.bottom-=e),l!==void 0&&l!==""&&(t.left+=e),{x:t.left-e/2,y:t.bottom+e/2}}function Et(t,s,l,r,e,h,a){r!==void 0&&r!==""&&t.words.push({x:s.x+s.width/2,y:l.y,text:r,size:h,anchor:"middle",color:a}),e!==void 0&&e!==""&&t.words.push({x:l.x,y:s.y+s.height/2,text:e,size:h,anchor:"middle",color:a,rotate:-90})}const ht=(t,s,l,r,e)=>{const h=t.labels;if(!h)return"";const a=isRound(t.type),o=[];return h.show_series_name&&o.push(r.name),h.show_category_name&&o.push(e),(h.show_value??!(h.show_percentage??!1))&&o.push(formatValue(s,h.number_format??r.number_format)),h.show_percentage&&a&&o.push(formatValue(l,h.number_format??"0%")),o.join(", ")};function Bt(t,s,l,r,e){const h=CHART_DEFAULTS,a=t.category_axis??{},o=t.value_axis??{},j=Wt(l,a.title,o.title,r),b=t.series.map(c=>c.values.flatMap(($,H)=>{const I=c.x?.[H]??(c.x?null:H+1);return I===null||$===null?[]:[[I,$]]})),F=b.flat().map(c=>c[0]),w=b.flat().map(c=>c[1]),P=c=>c.length>0?Math.min(...c):0,O=c=>c.length>0?Math.max(...c):1,B=o.number_format??t.series[0]?.number_format??"General",Z=a.number_format??"General",g=r*.5,R=chartScale(P(w),O(w),l.bottom-l.top,r*2.4,o),W=o.visible===!1?0:Math.max(0,...R.ticks.map(c=>it(formatValue(c,B),r)))+g,N=a.visible===!1?0:r*1.2+g,x={x:l.left+W,y:l.top,width:l.right-l.left-W,height:l.bottom-l.top-N};s.plot=x,Et(s,x,j,a.title,o.title,r,e);const E=chartScale(P(F),O(F),x.width,r*5,a),C=chartScale(P(w),O(w),x.height,r*2.4,o),z=c=>x.x+(Math.min(E.max,Math.max(E.min,c))-E.min)/(E.max-E.min)*x.width,D=c=>x.y+x.height-(Math.min(C.max,Math.max(C.min,c))-C.min)/(C.max-C.min)*x.height;for(const c of C.ticks){const $=D(c);(o.has_major_gridlines??!0)&&s.grid.push({d:`M${m(x.x)} ${m($)} H${m(x.x+x.width)}`,color:o.gridline_color??{rgb:h.gridline},width:h.gridWidth}),o.visible!==!1&&s.words.push({x:x.x-g,y:$,text:formatValue(c,B),size:r,anchor:"end",color:e})}for(const c of E.ticks){const $=z(c);a.has_major_gridlines===!0&&s.grid.push({d:`M${m($)} ${m(x.y)} V${m(x.y+x.height)}`,color:a.gridline_color??{rgb:h.gridline},width:h.gridWidth}),a.visible!==!1&&s.words.push({x:$,y:x.y+x.height+g+r*.6,text:formatValue(c,Z),size:r,anchor:"middle",color:e})}s.axes.push({d:`M${m(x.x)} ${m(D(Math.max(C.min,Math.min(C.max,0))))} H${m(x.x+x.width)}`,color:a.line_color??{rgb:h.axisLine},width:h.gridWidth}),t.series.forEach((c,$)=>{const H=c.color??accentOf($),I=(b[$]??[]).map(([U,Y])=>[z(U),D(Y)]);if(I.length!==0&&(hasLines(t.type)&&s.lines.push({d:t.type==="scatter-smooth"||c.smooth===!0?kt(I):lt(I),color:H,width:c.line_width??h.lineWidth,series:$}),hasMarkers(t.type)))for(const[U,Y]of I)s.dots.push({x:U,y:Y,r:(c.marker_size??h.marker)/2,color:H})})}export function chartDrawing(t,s,l){const r=CHART_DEFAULTS,e=t.font_size??r.fontSize,h=t.font_color??"dk1",a={grid:[],shapes:[],boxes:[],lines:[],axes:[],dots:[],keys:[],words:[],plot:{x:0,y:0,width:0,height:0}},o={left:r.margin,top:r.margin,right:s-r.margin,bottom:l-r.margin};if(t.title!==void 0&&t.title!==""){const n=t.title_size??e*r.titleScale;a.words.push({x:s/2,y:o.top+n*.7,text:t.title,size:n,anchor:"middle",color:h}),o.top+=n*1.6}const j=isRound(t.type),b=variesOf(t),F=(n,d)=>b?t.category_colors?.[d]??accentOf(d):t.series[n]?.color??accentOf(n);if(t.legend!==void 0){const n=b?t.categories:t.series.map(p=>p.name),d=e*.6,f=e*.4,i=e*1.5,y=n.map(p=>d+f+it(p,e)),S=(p,M,_)=>{a.keys.push({x:M,y:_-d/2,width:d,height:d,color:b?t.category_colors?.[p]??accentOf(p):t.series[p]?.color??accentOf(p),series:b?0:p,category:b?p:0}),a.words.push({x:M+d+f,y:_,text:n[p]??"",size:e,anchor:"start",color:h})};if(t.legend==="top"||t.legend==="bottom"){const p=y.reduce((A,v)=>A+v,0)+e*(n.length-1),M=t.legend==="top"?o.top+i/2:o.bottom-i/2;let _=(s-p)/2;n.forEach((A,v)=>{S(v,_,M),_+=(y[v]??0)+e}),t.legend_overlay!==!0&&(t.legend==="top"?o.top+=i:o.bottom-=i)}else{const p=Math.max(0,...y),M=t.legend==="left"?o.left:o.right-p,_=(o.top+o.bottom-i*n.length)/2+i/2;n.forEach((A,v)=>{S(v,M,_+v*i)}),t.legend_overlay!==!0&&(t.legend==="left"?o.left+=p+e:o.right-=p+e)}}const w=t.labels,P=w?.size??e,O=w?.color??h,B=(n,d,f,i,y=O)=>{f!==""&&a.words.push({x:n,y:d,text:f,size:P,anchor:i,color:y})};if(j){const n=t.series[0],d=(n?.values??[]).map(_=>Math.max(0,_??0)),f=d.reduce((_,A)=>_+A,0),i=Math.max(0,Math.min(o.right-o.left,o.bottom-o.top)/2),y=(o.left+o.right)/2,S=(o.top+o.bottom)/2,p=t.type==="doughnut"?i*((t.hole_size??r.holeSize)/100):0;a.plot={x:y-i,y:S-i,width:i*2,height:i*2};let M=0;return d.forEach((_,A)=>{const v=f>0?_/f:0,V=M+v*Math.PI*2;if(v>0){a.shapes.push({d:Ot(y,S,i,p,M,V),color:"lt1",width:1,fill:F(0,A),series:0,category:A});const L=(M+V)/2,k=p>0?(i+p)/2:labelPositionOf(t)==="inEnd"?i*.85:i*.6;n&&B(y+k*Math.sin(L),S-k*Math.cos(L),ht(t,_,v,n,t.categories[A]??""),"middle",w?.color??"lt1")}M=V}),a}if(isScatter(t.type))return Bt(t,a,o,e,h),a;const Z=Math.max(1,t.categories.length),g=isHorizontal(t.type),R=groupingOf(t.type),W=R!=="clustered"&&R!=="standard",N=R==="percentStacked",x=t.series.map(n=>t.categories.map((d,f)=>n.values[f]??null)),E=t.categories.map((n,d)=>x.reduce((f,i)=>f+Math.abs(i[d]??0),0)),C=(n,d)=>{const f=x[n]?.[d];if(f==null)return null;const i=E[d]??0;return N?i>0?f/i:0:f};let z=0,D=0;if(t.categories.forEach((n,d)=>{let f=0,i=0;t.series.forEach((y,S)=>{const p=C(S,d)??0;W?p>=0?f+=p:i+=p:(f=Math.max(f,p),i=Math.min(i,p))}),D=Math.max(D,f),z=Math.min(z,i)}),!W){const n=x.flat().filter(d=>d!==null);n.length>0&&Math.min(...n)>0&&(z=Math.min(...n))}N&&(D=1,z=Math.min(z,0));const c=t.value_axis??{},$=t.category_axis??{},H=c.number_format??(N?"0%":t.series[0]?.number_format??"General"),I=g?o.right-o.left:o.bottom-o.top,U=g?e*5:e*2.4,Y=chartScale(z,D,I,U,{...c,...N?{maximum_scale:c.maximum_scale??1}:{}}),dt=c.visible===!1?[]:Y.ticks.map(n=>formatValue(n,H)),mt=Math.max(0,...dt.map(n=>it(n,e))),ot=$.visible!==!1,ft=ot?Math.max(0,...t.categories.map(n=>it(n,e))):0,T=e*.5,ut=g?c.title:$.title,pt=g?$.title:c.title,St=Wt(o,ut,pt,e),u=g?{x:o.left+(ot?ft+T:0),y:o.top,width:0,height:o.bottom-o.top-(c.visible===!1?0:e*1.2+T)}:{x:o.left+(c.visible===!1?0:mt+T),y:o.top,width:0,height:o.bottom-o.top-(ot?e*1.2+T:0)};u.width=o.right-u.x-(g&&dt.length>0?mt/2:0),a.plot=u,Et(a,u,St,ut,pt,e,h);const G=chartScale(z,D,g?u.width:u.height,U,{...c,...N?{maximum_scale:c.maximum_scale??1}:{}}),gt=n=>(Math.min(G.max,Math.max(G.min,n))-G.min)/(G.max-G.min)*(g?u.width:u.height),q=n=>g?u.x+gt(n):u.y+u.height-gt(n),xt=isArea(t.type),yt=$.reverse_order===!0,Mt=g?!yt:yt,at=(g?u.height:u.width)/Z,_t=xt?(g?u.height:u.width)/Math.max(1,Z-1):at,ct=n=>{const d=xt?n*_t:(n+.5)*at,f=g?u.height:u.width,i=Mt?f-d:d;return(g?u.y:u.x)+i},bt=q(Math.max(G.min,Math.min(G.max,0)));for(const n of G.ticks){const d=q(n);(c.has_major_gridlines??!0)&&a.grid.push({d:g?`M${m(d)} ${m(u.y)} V${m(u.y+u.height)}`:`M${m(u.x)} ${m(d)} H${m(u.x+u.width)}`,color:c.gridline_color??{rgb:r.gridline},width:r.gridWidth}),c.visible!==!1&&a.words.push(g?{x:d,y:u.y+u.height+T+e*.6,text:formatValue(n,H),size:e,anchor:"middle",color:h}:{x:u.x-T,y:d,text:formatValue(n,H),size:e,anchor:"end",color:h})}if(a.axes.push({d:g?`M${m(bt)} ${m(u.y)} V${m(u.y+u.height)}`:`M${m(u.x)} ${m(bt)} H${m(u.x+u.width)}`,color:$.line_color??{rgb:r.axisLine},width:r.gridWidth}),ot){const n=g?e*1.3:ft+e,d=Math.max(1,Math.ceil(n/Math.max(1,_t)));t.categories.forEach((f,i)=>{if(i%d!==0)return;const y=ct(i);a.words.push(g?{x:u.x-T,y,text:f,size:e,anchor:"end",color:h}:{x:y,y:u.y+u.height+T+e*.6,text:f,size:e,anchor:"middle",color:h})})}if(isBar(t.type)){const n=(t.gap_width??r.gapWidth)/100,d=W?1:t.series.length,f=W?1:(t.overlap??0)/100,i=at/(Math.max(1,d-(d-1)*f)+n),y=i*(1-f),S=i+y*(d-1);t.categories.forEach((p,M)=>{const _=ct(M);let A=0,v=0;t.series.forEach((V,L)=>{const k=C(L,M);if(k===null)return;const nt=W?k>=0?A:v:0,tt=nt+k;W&&(k>=0?A=tt:v=tt);const J=q(nt),K=q(tt),st=(W?_-i/2:_-S/2+L*y)+(g&&Mt&&!W?S-i-2*L*y:0),Pt=g?{x:Math.min(J,K),y:st,width:Math.abs(K-J),height:i}:{x:st,y:Math.min(J,K),width:i,height:Math.abs(K-J)};if(a.boxes.push({...Pt,color:F(L,M),series:L,category:M}),!w)return;const wt=ht(t,x[L]?.[M]??0,0,V,t.categories[M]??""),rt=labelPositionOf(t),Q=P*.8,At=k>=0?1:-1,$t=(et,X)=>rt==="ctr"?(et+X)/2:rt==="inBase"?et+(X>et?Q:-Q):rt==="inEnd"?X-(X>et?Q:-Q):X+(X>=et?Q:-Q);g?B($t(J,K),st+i/2,wt,rt==="outEnd"?At>0?"start":"end":"middle"):B(st+i/2,$t(J,K),wt,"middle")})})}else{const n=t.categories.map(()=>0),d=t.series.map((f,i)=>{const y=[],S=[];return t.categories.forEach((p,M)=>{const _=C(i,M);if(_===null)return;const A=W?n[M]??0:0,v=A+_;W&&(n[M]=v);const V=ct(M),L=k=>g?[q(k),V]:[V,q(k)];if(y.push(L(v)),S.push(L(A)),isLine(t.type)&&w){const k=labelPositionOf(t),[nt,tt]=L(v);B(nt+(k==="r"?P:k==="l"?-P:0),tt+(k==="t"?-P:k==="b"?P:0),ht(t,x[i]?.[M]??0,0,f,t.categories[M]??""),k==="r"?"start":k==="l"?"end":"middle")}}),{series:f,s:i,points:y,base:S}});for(const{series:f,s:i,points:y,base:S}of d){const p=f.color??accentOf(i);if(isArea(t.type)&&y.length>0)a.shapes.push({d:`${lt([...y,...[...S].reverse()])} Z`,color:p,width:0,fill:p,series:i});else if(y.length>0&&(a.lines.push({d:f.smooth===!0?kt(y):lt(y),color:p,width:f.line_width??r.lineWidth,series:i}),hasMarkers(t.type)))for(const[M,_]of y)a.dots.push({x:M,y:_,r:(f.marker_size??r.marker)/2,color:p})}a.shapes.reverse()}return a}
2
+ import{format as Vt,isValidFormat as Rt}from"numfmt";import{brightened as Zt}from"@allyhub/ooxml/brightness";export const themeColor=(t,s=0)=>s===0?t:{theme_color:t,brightness:s},themeColorOf=t=>typeof t=="string"?t:"theme_color"in t?t.theme_color:void 0;export function colorRgb(t,s){return typeof t=="string"?s[t]:"rgb"in t?t.rgb:Zt(s[t.theme_color],t.brightness)}export const CHART_DEFAULTS={fontSize:12,titleScale:1.2,gapWidth:150,holeSize:50,margin:6,gridline:"#D9D9D9",axisLine:"#BFBFBF",letter:.55,lineWidth:2.25,gridWidth:.75,marker:5};const Ft=["accent1","accent2","accent3","accent4","accent5","accent6"];export const accentOf=t=>Ft[t%Ft.length]??"accent1",isBar=t=>t.startsWith("column")||t.startsWith("bar"),isHorizontal=t=>t.startsWith("bar"),isLine=t=>t.startsWith("line"),isArea=t=>t.startsWith("area"),isRound=t=>t==="pie"||t==="doughnut",isScatter=t=>t.startsWith("scatter"),hasLines=t=>!isScatter(t)||t!=="scatter",hasMarkers=t=>t==="line-markers"||t==="scatter"||t==="scatter-lines",groupingOf=t=>t.endsWith("-100")?"percentStacked":t.endsWith("-stacked")?"stacked":isBar(t)?"clustered":"standard";export function labelPositionsOf(t){return isArea(t)||t==="doughnut"?[]:t==="pie"?["bestFit","outEnd","inEnd","ctr"]:isLine(t)||isScatter(t)?["t","b","l","r","ctr"]:groupingOf(t)==="clustered"?["outEnd","inEnd","ctr","inBase"]:["inEnd","ctr","inBase"]}export function labelPositionOf(t){const s=labelPositionsOf(t.type),h=t.labels?.position;if(h!==void 0&&s.includes(h))return h;if(s.length!==0)return t.type==="pie"?"ctr":isLine(t.type)||isScatter(t.type)?"t":groupingOf(t.type)==="clustered"?"outEnd":"ctr"}export const isCombinable=t=>t.startsWith("column")||isLine(t)||isArea(t);export function groupsOf(t){const s=isCombinable(t.type),h=[];t.series.forEach((o,c)=>{const n=o.type!==void 0&&s&&isCombinable(o.type)?o.type??t.type:t.type,S=s&&o.secondary===!0,_=h.find(O=>O.kind===n&&O.secondary===S);_?_.series.push(c):h.push({kind:n,secondary:S,series:[c]})});const r=o=>(o.secondary?3:0)+(isArea(o.kind)?0:isBar(o.kind)?1:2);return h.sort((o,c)=>r(o)-r(c))}export const variesOf=t=>t.vary_by_categories??isRound(t.type);export function formatValue(t,s="General"){return s==="General"||!Rt(s)?String(Number(t.toPrecision(10))):Vt(s,t)}const Ut=[1,2,5,10];export function chartScale(t,s,h,r,o={}){const c=t>0&&(s-t)/s<.16666666666666666?t:Math.min(t,0),a=s<=0&&t<0?0:s,n=o.minimum_scale??c,S=o.maximum_scale??a,_=S>n?S-n:1,O=Math.max(1,Math.floor(h/r)),k=_/O,P=10**Math.floor(Math.log10(k)),N=o.major_unit??(Ut.find(v=>v*P>=k)??10)*P,z=(v,j)=>Number((j(Number((v/N).toFixed(9)))*N).toPrecision(12)),q=a>0?a+_*.05:a===c?_:a,x=o.maximum_scale??z(q,Math.ceil),Z=c<0?c-_*.05:c,V=o.minimum_scale??z(Z,Math.floor),D=[],y=Math.round((x-V)/N);for(let v=0;v<=y;v++)D.push(Number((V+v*N).toPrecision(12)));return{min:V,max:x,major:N,ticks:D}}const it=(t,s)=>{let h=0;for(const r of t)h+=(r.codePointAt(0)??0)>11903?1:CHART_DEFAULTS.letter;return h*s},m=t=>String(Number(t.toFixed(3)));function jt(t){const s=h=>t[Math.max(0,Math.min(t.length-1,h))]??[0,0];return t.map(([h,r],o)=>{if(o===0)return`M${m(h)} ${m(r)}`;const[c,a]=s(o-2),[n,S]=s(o-1),[_,O]=s(o+1),k=`${m(n+(h-c)/6)} ${m(S+(r-a)/6)}`,P=`${m(h-(_-n)/6)} ${m(r-(O-S)/6)}`;return`C${k} ${P} ${m(h)} ${m(r)}`}).join(" ")}const gt=t=>t.map(([s,h],r)=>`${r===0?"M":"L"}${m(s)} ${m(h)}`).join(" ");function qt(t,s,h,r,o,c){const a=(O,k)=>`${m(t+O*Math.sin(k))} ${m(s-O*Math.cos(k))}`,n=c-o>=Math.PI*2?o+Math.PI*2-1e-4:c,S=n-o>Math.PI?1:0,_=`M${a(h,o)} A${m(h)} ${m(h)} 0 ${String(S)} 1 ${a(h,n)}`;return r<=0?`${_} L${m(t)} ${m(s)} Z`:`${_} L${a(r,n)} A${m(r)} ${m(r)} 0 ${String(S)} 0 ${a(r,o)} Z`}function Nt(t,s,h,r){const o=r*1.5;return s!==void 0&&s!==""&&(t.bottom-=o),h!==void 0&&h!==""&&(t.left+=o),{x:t.left-o/2,y:t.bottom+o/2}}function Bt(t,s,h,r,o,c,a){r!==void 0&&r!==""&&t.words.push({x:s.x+s.width/2,y:h.y,text:r,size:c,anchor:"middle",color:a}),o!==void 0&&o!==""&&t.words.push({x:h.x,y:s.y+s.height/2,text:o,size:c,anchor:"middle",color:a,rotate:-90})}const xt=(t,s,h,r,o)=>{const c=t.labels;if(!c)return"";const a=isRound(t.type),n=[];return c.show_series_name&&n.push(r.name),c.show_category_name&&n.push(o),(c.show_value??!(c.show_percentage??!1))&&n.push(formatValue(s,c.number_format??r.number_format)),c.show_percentage&&a&&n.push(formatValue(h,c.number_format??"0%")),n.join(", ")};function Jt(t,s,h,r,o){const c=CHART_DEFAULTS,a=t.category_axis??{},n=t.value_axis??{},S=Nt(h,a.title,n.title,r),_=t.series.map(f=>f.values.flatMap((W,B)=>{const I=f.x?.[B]??(f.x?null:B+1);return I===null||W===null?[]:[[I,W]]})),O=_.flat().map(f=>f[0]),k=_.flat().map(f=>f[1]),P=f=>f.length>0?Math.min(...f):0,N=f=>f.length>0?Math.max(...f):1,z=n.number_format??t.series[0]?.number_format??"General",q=a.number_format??"General",x=r*.5,Z=chartScale(P(k),N(k),h.bottom-h.top,r*2.4,n),V=n.visible===!1?0:Math.max(0,...Z.ticks.map(f=>it(formatValue(f,z),r)))+x,D=a.visible===!1?0:r*1.2+x,y={x:h.left+V,y:h.top,width:h.right-h.left-V,height:h.bottom-h.top-D};s.plot=y,Bt(s,y,S,a.title,n.title,r,o);const v=chartScale(P(O),N(O),y.width,r*5,a),j=chartScale(P(k),N(k),y.height,r*2.4,n),U=f=>y.x+(Math.min(v.max,Math.max(v.min,f))-v.min)/(v.max-v.min)*y.width,G=f=>y.y+y.height-(Math.min(j.max,Math.max(j.min,f))-j.min)/(j.max-j.min)*y.height;for(const f of j.ticks){const W=G(f);(n.has_major_gridlines??!0)&&s.grid.push({d:`M${m(y.x)} ${m(W)} H${m(y.x+y.width)}`,color:n.gridline_color??{rgb:c.gridline},width:c.gridWidth}),n.visible!==!1&&s.words.push({x:y.x-x,y:W,text:formatValue(f,z),size:r,anchor:"end",color:o})}for(const f of v.ticks){const W=U(f);a.has_major_gridlines===!0&&s.grid.push({d:`M${m(W)} ${m(y.y)} V${m(y.y+y.height)}`,color:a.gridline_color??{rgb:c.gridline},width:c.gridWidth}),a.visible!==!1&&s.words.push({x:W,y:y.y+y.height+x+r*.6,text:formatValue(f,q),size:r,anchor:"middle",color:o})}s.axes.push({d:`M${m(y.x)} ${m(G(Math.max(j.min,Math.min(j.max,0))))} H${m(y.x+y.width)}`,color:a.line_color??{rgb:c.axisLine},width:c.gridWidth}),t.series.forEach((f,W)=>{const B=f.color??accentOf(W),I=(_[W]??[]).map(([J,R])=>[U(J),G(R)]);if(I.length!==0&&(hasLines(t.type)&&s.lines.push({d:t.type==="scatter-smooth"||f.smooth===!0?jt(I):gt(I),color:B,width:f.line_width??c.lineWidth,series:W}),hasMarkers(t.type)))for(const[J,R]of I)s.dots.push({x:J,y:R,r:(f.marker_size??c.marker)/2,color:B})})}export function chartDrawing(t,s,h){const r=CHART_DEFAULTS,o=t.font_size??r.fontSize,c=t.font_color??"dk1",a={grid:[],shapes:[],boxes:[],lines:[],axes:[],dots:[],keys:[],words:[],plot:{x:0,y:0,width:0,height:0}},n={left:r.margin,top:r.margin,right:s-r.margin,bottom:h-r.margin};if(t.title!==void 0&&t.title!==""){const e=t.title_size??o*r.titleScale;a.words.push({x:s/2,y:n.top+e*.7,text:t.title,size:e,anchor:"middle",color:c}),n.top+=e*1.6}const S=isRound(t.type),_=variesOf(t),O=(e,i)=>_?t.category_colors?.[i]??accentOf(i):t.series[e]?.color??accentOf(e);if(t.legend!==void 0){const e=_?t.categories:t.series.map(d=>d.name),i=o*.6,g=o*.4,l=o*1.5,b=e.map(d=>i+g+it(d,o)),F=(d,w,u)=>{a.keys.push({x:w,y:u-i/2,width:i,height:i,color:_?t.category_colors?.[d]??accentOf(d):t.series[d]?.color??accentOf(d),series:_?0:d,category:_?d:0}),a.words.push({x:w+i+g,y:u,text:e[d]??"",size:o,anchor:"start",color:c})};if(t.legend==="top"||t.legend==="bottom"){const d=b.reduce((E,M)=>E+M,0)+o*(e.length-1),w=t.legend==="top"?n.top+l/2:n.bottom-l/2;let u=(s-d)/2;e.forEach((E,M)=>{F(M,u,w),u+=(b[M]??0)+o}),t.legend_overlay!==!0&&(t.legend==="top"?n.top+=l:n.bottom-=l)}else{const d=Math.max(0,...b),w=t.legend==="left"?n.left:n.right-d,u=(n.top+n.bottom-l*e.length)/2+l/2;e.forEach((E,M)=>{F(M,w,u+M*l)}),t.legend_overlay!==!0&&(t.legend==="left"?n.left+=d+o:n.right-=d+o)}}const k=t.labels,P=k?.size??o,N=k?.color??c,z=(e,i,g,l,b=N)=>{g!==""&&a.words.push({x:e,y:i,text:g,size:P,anchor:l,color:b})};if(S){const e=t.series[0],i=(e?.values??[]).map(u=>Math.max(0,u??0)),g=i.reduce((u,E)=>u+E,0),l=Math.max(0,Math.min(n.right-n.left,n.bottom-n.top)/2),b=(n.left+n.right)/2,F=(n.top+n.bottom)/2,d=t.type==="doughnut"?l*((t.hole_size??r.holeSize)/100):0;a.plot={x:b-l,y:F-l,width:l*2,height:l*2};let w=0;return i.forEach((u,E)=>{const M=g>0?u/g:0,$=w+M*Math.PI*2;if(M>0){a.shapes.push({d:qt(b,F,l,d,w,$),color:"lt1",width:1,fill:O(0,E),series:0,category:E});const A=(w+$)/2,T=d>0?(l+d)/2:labelPositionOf(t)==="inEnd"?l*.85:l*.6;e&&z(b+T*Math.sin(A),F-T*Math.cos(A),xt(t,u,M,e,t.categories[E]??""),"middle",k?.color??"lt1")}w=$}),a}if(isScatter(t.type))return Jt(t,a,n,o,c),a;const q=Math.max(1,t.categories.length),x=isHorizontal(t.type),Z=groupsOf(t),V=Z.every(e=>e.secondary)?Z.map(e=>({...e,secondary:!1})):Z,D=t.series.map(e=>t.categories.map((i,g)=>e.values[g]??null)),y=V.map(e=>{const i=groupingOf(e.kind),g=i!=="clustered"&&i!=="standard",l=i==="percentStacked",b=t.categories.map((F,d)=>e.series.reduce((w,u)=>w+Math.abs(D[u]?.[d]??0),0));return{...e,stacked:g,percent:l,totals:b}}),v=(e,i,g)=>{const l=D[i]?.[g];if(l==null)return null;const b=e.totals[g]??0;return e.percent?b>0?l/b:0:l},j=e=>{let i=0,g=0,l=1/0,b=!1;for(const u of y)if(u.secondary===e&&(b||=u.percent,t.categories.forEach((E,M)=>{let $=0,A=0;for(const T of u.series){const C=v(u,T,M)??0;u.stacked?C>=0?$+=C:A+=C:($=Math.max($,C),A=Math.min(A,C))}g=Math.max(g,$),i=Math.min(i,A)}),!u.stacked))for(const E of u.series)for(const M of D[E]??[])M!==null&&(l=Math.min(l,M));y.every(u=>u.secondary!==e||!u.stacked)&&Number.isFinite(l)&&l>0&&(i=l),b&&(g=1,i=Math.min(i,0));const d=y.find(u=>u.secondary===e),w=d===void 0?void 0:d.series[0];return{low:i,high:g,percent:b,format:w===void 0?void 0:t.series[w]?.number_format}},U=j(!1),G=y.some(e=>e.secondary)?j(!0):void 0,f=t.value_axis??{},W=t.secondary_axis??{},B=t.category_axis??{},I=f.number_format??(U.percent?"0%":U.format??"General"),J=W.number_format??(G?.percent===!0?"0%":G?.format??"General"),R=(e,i,g,l)=>chartScale(e.low,e.high,g,l,{...i,...e.percent?{maximum_scale:i.maximum_scale??1}:{}}),yt=x?n.right-n.left:n.bottom-n.top,at=x?o*5:o*2.4,It=R(U,f,yt,at),bt=f.visible===!1?[]:It.ticks.map(e=>formatValue(e,I)),Mt=Math.max(0,...bt.map(e=>it(e,o))),wt=G===void 0||W.visible===!1?0:Math.max(0,...R(G,W,yt,at).ticks.map(e=>it(formatValue(e,J),o))),ct=B.visible!==!1,_t=ct?Math.max(0,...t.categories.map(e=>it(e,o))):0,H=o*.5,$t=x?f.title:B.title,kt=x?B.title:f.title,zt=Nt(n,$t,kt,o),p=x?{x:n.left+(ct?_t+H:0),y:n.top,width:0,height:n.bottom-n.top-(f.visible===!1?0:o*1.2+H)}:{x:n.left+(f.visible===!1?0:Mt+H),y:n.top,width:0,height:n.bottom-n.top-(ct?o*1.2+H:0)};p.width=n.right-p.x-(x&&bt.length>0?Mt/2:0)-(wt>0?wt+H:0),a.plot=p,Bt(a,p,zt,$t,kt,o,c);const ft=x?p.width:p.height,et=R(U,f,ft,at),ot=G===void 0?void 0:R(G,W,ft,at),vt=(e,i)=>(Math.min(e.max,Math.max(e.min,i))-e.min)/(e.max-e.min)*ft,ut=(e,i)=>x?p.x+vt(e,i):p.y+p.height-vt(e,i),Wt=e=>ut(et,e),Et=y.every(e=>isArea(e.kind)),St=B.reverse_order===!0,Ot=x?!St:St,mt=(x?p.height:p.width)/q,Pt=Et?(x?p.height:p.width)/Math.max(1,q-1):mt,pt=e=>{const i=Et?e*Pt:(e+.5)*mt,g=x?p.height:p.width,l=Ot?g-i:i;return(x?p.y:p.x)+l},At=Wt(Math.max(et.min,Math.min(et.max,0)));for(const e of et.ticks){const i=Wt(e);(f.has_major_gridlines??!0)&&a.grid.push({d:x?`M${m(i)} ${m(p.y)} V${m(p.y+p.height)}`:`M${m(p.x)} ${m(i)} H${m(p.x+p.width)}`,color:f.gridline_color??{rgb:r.gridline},width:r.gridWidth}),f.visible!==!1&&a.words.push(x?{x:i,y:p.y+p.height+H+o*.6,text:formatValue(e,I),size:o,anchor:"middle",color:c}:{x:p.x-H,y:i,text:formatValue(e,I),size:o,anchor:"end",color:c})}if(ot&&W.visible!==!1)for(const e of ot.ticks)a.words.push({x:p.x+p.width+H,y:ut(ot,e),text:formatValue(e,J),size:o,anchor:"start",color:c});if(a.axes.push({d:x?`M${m(At)} ${m(p.y)} V${m(p.y+p.height)}`:`M${m(p.x)} ${m(At)} H${m(p.x+p.width)}`,color:B.line_color??{rgb:r.axisLine},width:r.gridWidth}),ct){const e=x?o*1.3:_t+o,i=Math.max(1,Math.ceil(e/Math.max(1,Pt)));t.categories.forEach((g,l)=>{if(l%i!==0)return;const b=pt(l);a.words.push(x?{x:p.x-H,y:b,text:g,size:o,anchor:"end",color:c}:{x:b,y:p.y+p.height+H+o*.6,text:g,size:o,anchor:"middle",color:c})})}for(const e of y){const i=e.secondary&&ot?ot:et,g=b=>ut(i,b),l={type:e.kind,...t.labels===void 0?{}:{labels:t.labels}};isBar(e.kind)?Dt(e,g,l):Gt(e,g,l)}return a;function Dt(e,i,g){const l=(t.gap_width??r.gapWidth)/100,b=e.stacked?1:e.series.length,F=e.stacked?1:(t.overlap??0)/100,d=mt/(Math.max(1,b-(b-1)*F)+l),w=d*(1-F),u=d+w*(b-1);t.categories.forEach((E,M)=>{const $=pt(M);let A=0,T=0;e.series.forEach((C,nt)=>{const K=t.series[C],L=v(e,C,M);if(L===null||!K)return;const lt=e.stacked?L>=0?A:T:0,st=lt+L;e.stacked&&(L>=0?A=st:T=st);const Q=i(lt),X=i(st),ht=(e.stacked?$-d/2:$-u/2+nt*w)+(x&&Ot&&!e.stacked?u-d-2*nt*w:0),Ht=x?{x:Math.min(Q,X),y:ht,width:Math.abs(X-Q),height:d}:{x:ht,y:Math.min(Q,X),width:d,height:Math.abs(X-Q)};if(a.boxes.push({...Ht,color:O(C,M),series:C,category:M}),!k)return;const Ct=xt(t,D[C]?.[M]??0,0,K,t.categories[M]??""),dt=labelPositionOf(g),Y=P*.8,Tt=L>=0?1:-1,Lt=(rt,tt)=>dt==="ctr"?(rt+tt)/2:dt==="inBase"?rt+(tt>rt?Y:-Y):dt==="inEnd"?tt-(tt>rt?Y:-Y):tt+(tt>=rt?Y:-Y);x?z(Lt(Q,X),ht+d/2,Ct,dt==="outEnd"?Tt>0?"start":"end":"middle"):z(ht+d/2,Lt(Q,X),Ct,"middle")})})}function Gt(e,i,g){const l=t.categories.map(()=>0),b=e.series.map(d=>{const w=t.series[d],u=[],E=[];return t.categories.forEach((M,$)=>{const A=v(e,d,$);if(A===null||!w)return;const T=e.stacked?l[$]??0:0,C=T+A;e.stacked&&(l[$]=C);const nt=pt($),K=L=>x?[i(L),nt]:[nt,i(L)];if(u.push(K(C)),E.push(K(T)),isLine(e.kind)&&k){const L=labelPositionOf(g),[lt,st]=K(C);z(lt+(L==="r"?P:L==="l"?-P:0),st+(L==="t"?-P:L==="b"?P:0),xt(t,D[d]?.[$]??0,0,w,t.categories[$]??""),L==="r"?"start":L==="l"?"end":"middle")}}),{series:w,s:d,points:u,base:E}}),F=[];for(const{series:d,s:w,points:u,base:E}of b){if(!d)continue;const M=d.color??accentOf(w);if(isArea(e.kind)&&u.length>0)F.push({d:`${gt([...u,...[...E].reverse()])} Z`,color:M,width:0,fill:M,series:w});else if(u.length>0&&(a.lines.push({d:d.smooth===!0?jt(u):gt(u),color:M,width:d.line_width??r.lineWidth,series:w}),hasMarkers(e.kind)))for(const[$,A]of u)a.dots.push({x:$,y:A,r:(d.marker_size??r.marker)/2,color:M})}a.shapes.push(...F.reverse())}}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/chart",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/check",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -8,12 +8,20 @@ export interface Key {
8
8
  account: string;
9
9
  /** When it stops working (ISO 8601); a key from the environment does not say. */
10
10
  expiresAt?: string;
11
+ /** The sign-in's id, sent as DEVICE_HEADER so AllyHub knows which computer asks. */
12
+ device?: string;
11
13
  }
12
14
  /** Removes anything key-shaped from text that may reach the screen. */
13
15
  export declare function scrub(text: string, key?: string): string;
14
16
  export declare class Cloud {
15
17
  readonly config: CloudConfig;
16
18
  constructor(config: CloudConfig);
19
+ /**
20
+ * Run by an agent in Studio, Studio is told a call was refused for
21
+ * credits, and offers the person to buy them. Never fails the command:
22
+ * a Host that does not answer in a second is left.
23
+ */
24
+ private tellStudio;
17
25
  get url(): string;
18
26
  /**
19
27
  * The key to use, or undefined when this computer is not signed in;
@@ -38,6 +46,8 @@ export declare class Cloud {
38
46
  body?: unknown;
39
47
  auth?: boolean;
40
48
  signal?: AbortSignal;
49
+ /** The team it acts in, when not the one this computer works in. */
50
+ organization?: string;
41
51
  }): Promise<unknown>;
42
52
  }
43
53
  //# sourceMappingURL=client.d.ts.map
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{createHash as l}from"node:crypto";import{EXIT as a,ORGANIZATION_HEADER as y}from"@allyhub/protocol";import{accessOf as g,SignedOut as w}from"./credentials.js";import{CloudError as u,notSignedIn as f,unreachable as h}from"./errors.js";export function scrub(d,i){let e=d.replace(/(authorization)\s*[:=]\s*[^\r\n]+/giu,"$1: <redacted>");return e=e.replace(/\bahk_[A-Za-z0-9_-]+/gu,"<api-key>"),e=e.replace(/\beyJ[\w-]+\.[\w-]+\.[\w-]+/gu,"<token>"),i&&(e=e.split(i).join("<key>")),e}export class Cloud{config;constructor(i){this.config=i}get url(){return this.config.url}async key(i={}){const e=this.config.apiKey;if(e)return{key:e,source:"env",account:l("sha256").update(e).digest("hex")};try{const r=await g(this.config,i);if(!r)return;const t=r.credentials.account.organization?.id;return{key:r.token,source:"oauth",account:r.credentials.account.id,expiresAt:r.expiresAt,...t===void 0?{}:{organization:t}}}catch(r){if(r instanceof w)return;throw h(this.url,r)}}async requireKey(){const i=await this.key();if(!i)throw f();return i}keyedFetch=async(i,e)=>{const r=c=>{const o=new Headers(e?.headers);return o.set("authorization",`Bearer ${c.key}`),c.organization!==void 0&&o.set(y,c.organization),this.config.fetch(i,{...e,headers:o})},t=await this.requireKey(),n=await r(t);if(n.status!==401||t.source!=="oauth"||e?.body instanceof ReadableStream||i instanceof Request)return n;const s=await this.key({refused:t.key});return s===void 0?n:(await n.body?.cancel(),r(s))};async json(i,e={}){const r=e.auth!==!1,t=r?(await this.requireKey()).key:void 0;let n;try{n=await(r?this.keyedFetch:this.config.fetch)(`${this.url}${i}`,{redirect:"error",signal:e.signal??AbortSignal.timeout(3e4),method:e.method??"GET",headers:{accept:"application/json",...e.body===void 0?{}:{"content-type":"application/json"}},...e.body===void 0?{}:{body:JSON.stringify(e.body)}})}catch(o){throw o instanceof u?o:h(this.url,o)}const s=await n.text(),c=n.ok?void 0:b(s,n.status,t);if(c&&n.status!==401)throw c;if(n.status===403)throw new u("forbidden","This AllyHub account does not have access to this operation.",{exit:a.auth,status:403});if(n.status===401)throw f(r?"This computer's AllyHub sign-in is not valid any more.":void 0);if(!n.ok)throw new u("api-error",`${this.url}${i} answered ${String(n.status)}: ${scrub(s.slice(0,300),t)}`,{exit:n.status>=500?a.platform:a.usage,status:n.status});try{return JSON.parse(s)}catch{throw new u("api-error",`${this.url}${i} did not answer JSON.`,{exit:a.platform,status:n.status})}}}const p={bad_input:a.usage,insufficient_credits:a.auth,limit_reached:a.auth,forbidden:a.auth,not_found:a.notFound,conflict:a.conflict,worked_elsewhere:a.conflict};function b(d,i,e){let r;try{r=JSON.parse(d)}catch{return}const t=r?.error;if(typeof t?.code!="string"||typeof t.message!="string")return;const n=typeof t.hint=="string"?t.hint:t.code==="insufficient_credits"?"Add credits to the AllyHub account.":void 0;return new u(t.code.replaceAll("_","-"),scrub(t.message,e),{exit:p[t.code]??a.platform,status:i,...n===void 0?{}:{hint:n},...typeof t.data=="object"&&t.data!==null?{data:t.data}:{}})}
2
+ import{createHash as g}from"node:crypto";import{BILLING_PAGE_PATH as h,DEVICE_HEADER as w,EXIT as o,ORGANIZATION_HEADER as f}from"@allyhub/protocol";import{accessOf as p,SignedOut as m}from"./credentials.js";import{CloudError as d,notSignedIn as l,unreachable as y}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}export class Cloud{config;constructor(n){this.config=n}async tellStudio(){const n=this.config.studioHost;n!==void 0&&await fetch(`${n}/out-of-credits`,{method:"POST",signal:AbortSignal.timeout(1e3)}).then(t=>t.body?.cancel(),()=>{})}get url(){return this.config.url}async key(n={}){const t=this.config.apiKey;if(t)return{key:t,source:"env",account:g("sha256").update(t).digest("hex")};try{const i=await p(this.config,n);if(!i)return;const a=i.credentials.account.organization?.id,e=i.credentials.device;return{key:i.token,source:"oauth",account:i.credentials.account.id,expiresAt:i.expiresAt,...a===void 0?{}:{organization:a},...e===void 0?{}:{device:e}}}catch(i){if(i instanceof m)return;throw y(this.url,i)}}async requireKey(){const n=await this.key();if(!n)throw l();return n}keyedFetch=async(n,t)=>{const i=s=>{const c=new Headers(t?.headers);return c.set("authorization",`Bearer ${s.key}`),s.organization!==void 0&&!c.has(f)&&c.set(f,s.organization),s.device!==void 0&&c.set(w,s.device),this.config.fetch(n,{...t,headers:c})},a=await this.requireKey(),e=await i(a);if(e.status!==401||a.source!=="oauth"||t?.body instanceof ReadableStream||n instanceof Request)return e;const r=await this.key({refused:a.key});return r===void 0?e:(await e.body?.cancel(),i(r))};async json(n,t={}){const i=t.auth!==!1,a=i?(await this.requireKey()).key:void 0;let e;try{e=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?{}:{[f]:t.organization}},...t.body===void 0?{}:{body:JSON.stringify(t.body)}})}catch(c){throw c instanceof d?c:y(this.url,c)}const r=await e.text(),s=e.ok?void 0:_(r,e.status,a,this.url);if(s?.code==="insufficient-credits"&&await this.tellStudio(),s&&e.status!==401)throw s;if(e.status===403)throw new d("forbidden","This AllyHub account does not have access to this operation.",{exit:o.auth,status:403});if(e.status===401)throw l(i?"This computer's AllyHub sign-in is not valid any more.":void 0);if(!e.ok)throw new d("api-error",`${this.url}${n} answered ${String(e.status)}: ${scrub(r.slice(0,300),a)}`,{exit:e.status>=500?o.platform:o.usage,status:e.status});try{return JSON.parse(r)}catch{throw new d("api-error",`${this.url}${n} did not answer JSON.`,{exit:o.platform,status:e.status})}}}const b={bad_input:o.usage,insufficient_credits:o.auth,plan_required:o.auth,tool_off:o.auth,limit_reached:o.auth,forbidden:o.auth,not_found:o.notFound,conflict:o.conflict,worked_elsewhere:o.conflict};function _(u,n,t,i){let a;try{a=JSON.parse(u)}catch{return}const e=a?.error;if(typeof e?.code!="string"||typeof e.message!="string")return;const r=e.code==="insufficient_credits"?`Buy credits at ${i}${h}, or ask an owner or admin of the team to.`:e.code==="plan_required"?`Subscribe at ${i}${h}, 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 d(e.code.replaceAll("_","-"),scrub(e.message,t),{exit:b[e.code]??o.platform,status:n,...r===void 0?{}:{hint:r},...typeof e.data=="object"&&e.data!==null?{data:e.data}:{}})}
@@ -15,9 +15,18 @@ export interface CloudConfig {
15
15
  apiKey?: string;
16
16
  /** The fetch every request goes through (a test's own). */
17
17
  fetch: typeof fetch;
18
+ /** The program, as its User-Agent's product names it ("AllyHub-Studio/0.9.1"): told to AllyHub as it signs in. */
19
+ client?: string;
20
+ /**
21
+ * Studio's Host, when an agent in Studio runs this (`ALLYHUB_STUDIO_HOST`,
22
+ * a loopback address with its token): told when a call is refused for
23
+ * credits, so Studio offers to buy them.
24
+ */
25
+ studioHost?: string;
18
26
  }
19
27
  export declare function cloudConfig(env: Readonly<Record<string, string | undefined>>, options?: {
20
28
  fetch?: typeof fetch;
29
+ client?: string;
21
30
  }): CloudConfig;
22
31
  /** "https://…", marked when a variable set it: a test box is never taken for production. */
23
32
  export declare function hostsText(c: CloudConfig): string;
@@ -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 s}from"node:os";import{join as f}from"node:path";import{API_KEY_ENV as l,CREDENTIALS_FILE as L}from"@allyhub/protocol";import{cacheHome as h}from"@allyhub/runtimes";import{osKeychain as d}from"./keychain.js";const p="https://app.allyhub.com",a=["ALLYHUB_URL"],E=o=>o.replace(/\/+$/u,"");export function cloudConfig(o,m={}){const r=o[l]?.trim(),t=E(o.ALLYHUB_URL??p),e=o.ALLYHUB_HOME,i=f(e??s(),L),n=o.ALLYHUB_CREDENTIALS_STORE,c=n==="keychain"||n!=="file"&&e===void 0?d({service:"AllyHub",account:e===void 0?t:`${t} ${i}`}):void 0;return{url:t,from:a.filter(u=>o[u]!==void 0),credentialsFile:i,...c?{keychain:c}:{},cacheDir:f(h(o),"cloud"),...r?{apiKey:r}:{},fetch:m.fetch??fetch}}export function hostsText(o){return o.from.length>0?`${o.url} (from ${o.from.join(", ")})`:o.url}
2
+ import{homedir as s}from"node:os";import{join as m}from"node:path";import{API_KEY_ENV as l,CREDENTIALS_FILE as d}from"@allyhub/protocol";import{cacheHome as _}from"@allyhub/runtimes";import{osKeychain as h}from"./keychain.js";const H="https://app.allyhub.com",U=["ALLYHUB_URL"],A=o=>o.replace(/\/+$/u,"");export function cloudConfig(o,r={}){const i=o[l]?.trim(),t=A(o.ALLYHUB_URL??H),e=o.ALLYHUB_HOME,c=r.client??o.ALLYHUB_CLIENT,n=m(e??s(),d),f=o.ALLYHUB_CREDENTIALS_STORE,L=f==="keychain"||f!=="file"&&e===void 0?h({service:"AllyHub",account:e===void 0?t:`${t} ${n}`}):void 0;return{url:t,from:U.filter(u=>o[u]!==void 0),credentialsFile:n,...L?{keychain:L}:{},cacheDir:m(_(o),"cloud"),...i?{apiKey:i}:{},fetch:r.fetch??fetch,...c===void 0?{}:{client:c},...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}
@@ -28,7 +28,7 @@ export declare function forgetCredentials(c: Where, refreshToken?: string): Prom
28
28
  /** Who an access token is, and the organization it acts in. */
29
29
  export declare function accountOf(c: Pick<CloudConfig, "url" | "fetch">, token: string): Promise<Account>;
30
30
  /** A code from the authorization endpoint, with its PKCE verifier, made this computer's sign-in. */
31
- export declare function signInWithCode(c: Pick<CloudConfig, "url" | "fetch" | "credentialsFile" | "keychain">, exchange: {
31
+ export declare function signInWithCode(c: Pick<CloudConfig, "url" | "fetch" | "credentialsFile" | "keychain" | "client">, exchange: {
32
32
  code: string;
33
33
  codeVerifier: string;
34
34
  redirectUri: string;
@@ -38,7 +38,7 @@ export declare function signInWithCode(c: Pick<CloudConfig, "url" | "fetch" | "c
38
38
  * with no browser: `show` is given the code and the address to enter it
39
39
  * at, then this waits, polling as the server asks, until the person has.
40
40
  */
41
- export declare function signInWithDevice(c: Pick<CloudConfig, "url" | "fetch" | "credentialsFile" | "keychain">, show: (device: DeviceAuthorization) => void, signal?: AbortSignal): Promise<Credentials>;
41
+ export declare function signInWithDevice(c: Pick<CloudConfig, "url" | "fetch" | "credentialsFile" | "keychain" | "client">, show: (device: DeviceAuthorization) => void, signal?: AbortSignal): Promise<Credentials>;
42
42
  /**
43
43
  * An access token from the computer's sign-in: the one kept while it has
44
44
  * more than a minute left, else a new one made with the refresh token
@@ -50,7 +50,7 @@ export declare function signInWithDevice(c: Pick<CloudConfig, "url" | "fetch" |
50
50
  * sign-in another version kept in its file moves its tokens to the
51
51
  * system's store, where there is one.
52
52
  */
53
- export declare function accessOf(c: Pick<CloudConfig, "url" | "fetch" | "credentialsFile" | "keychain">, o?: {
53
+ export declare function accessOf(c: Pick<CloudConfig, "url" | "fetch" | "credentialsFile" | "keychain" | "client">, o?: {
54
54
  refused?: string;
55
55
  }): Promise<{
56
56
  token: string;
@@ -62,7 +62,7 @@ export declare function accessOf(c: Pick<CloudConfig, "url" | "fetch" | "credent
62
62
  * 7009), every program here with it, and the file and the store's entry forgotten. The file goes
63
63
  * even when AllyHub cannot be reached; that it was not revoked is thrown after.
64
64
  */
65
- export declare function signOut(c: Pick<CloudConfig, "url" | "fetch" | "credentialsFile" | "keychain">, credentials: Credentials): Promise<void>;
65
+ export declare function signOut(c: Pick<CloudConfig, "url" | "fetch" | "credentialsFile" | "keychain" | "client">, credentials: Credentials): Promise<void>;
66
66
  /**
67
67
  * The organization this computer's requests act in from now on (and pay
68
68
  * from): kept in the credentials file, under its lock, so a refresh at the
@@ -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 S}from"node:crypto";import{chmod as $,mkdir as p,readFile as x,rename as E,rm as w,stat as D,writeFile as F}from"node:fs/promises";import{dirname as A}from"node:path";import*as k from"zod";import{ACCOUNT_PATH as H,AccountSchema as M,AuthServerSchema as C,CLIENT_ID as d,CredentialsFileSchema as T,DeviceAuthorizationSchema as P,METADATA_PATH as z,OAuthErrorSchema as j,SCOPES as I,TokenResponseSchema as N}from"@allyhub/protocol";import{notSignedIn as R}from"./errors.js";export class SignedOut extends Error{}const J=6e4,l={waitMs:15e3,staleMs:3e4,stepMs:50},m=new Map;export function authServer(e){let r=m.get(e.url);return r||(r=(async()=>{const t=await e.fetch(`${e.url}${z}`,{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 C.parse(await t.json())})(),r.catch(()=>m.delete(e.url)),m.set(e.url,r)),r}const L=k.object({revision:k.string().min(1),refreshToken:k.string().min(1),access:T.shape.access}),h=new Map;async function U(e,r,t){const n=h.get(e.credentialsFile);if(!t&&n?.revision===r)return n;if(e.keychain)try{const o=await e.keychain.get(),i=L.safeParse(o===void 0?void 0:JSON.parse(o));return!i.success||i.data.revision!==r?void 0:(h.set(e.credentialsFile,i.data),i.data)}catch{return}}export async function readCredentials(e,r=!1){for(let t=0;t<3;t+=1){let n;try{const i=T.safeParse(JSON.parse(await x(e.credentialsFile,"utf8")));if(!i.success||i.data.url!==e.url)return;n=i.data}catch{return}if(n.keychain===void 0)return n.refreshToken===void 0?void 0:{...n,refreshToken:n.refreshToken};const o=await U(e,n.keychain,r||t>0);if(o){const{access:i,refreshToken:a}=o;return{...n,refreshToken:a,...i?{access:i}:{}}}await new Promise(i=>setTimeout(i,l.stepMs))}}export async function writeCredentials(e,r){const{refreshToken:t,access:n,...o}=r,i={version:o.version,url:o.url,issuer:o.issuer,account:o.account,since:o.since};let a={...i,refreshToken:t,...n?{access:n}:{}};if(e.keychain){const c={revision:S(9).toString("base64url"),refreshToken:t,...n?{access:n}:{}},_=JSON.stringify(c);try{if(await e.keychain.set(_),await e.keychain.get()!==_)throw new Error(`${e.keychain.name} did not keep the sign-in.`);h.set(e.credentialsFile,c),a={...i,keychain:c.revision}}catch{}}const u=e.credentialsFile;await p(A(u),{recursive:!0,mode:448});const s=`${u}.${S(6).toString("hex")}.tmp`;try{await F(s,`${JSON.stringify(a,null,2)}
3
- `,{mode:384}),await $(s,384),await E(s,u)}finally{await w(s,{force:!0})}}export async function forgetCredentials(e,r){if(r!==void 0){const t=await readCredentials(e,!0);if(t!==void 0&&t.refreshToken!==r)return}await w(e.credentialsFile,{force:!0}),h.delete(e.credentialsFile),await e.keychain?.delete().catch(()=>{})}async function y(e,r){const t=`${e}.lock`;await p(A(e),{recursive:!0,mode:448});const n=Date.now()+l.waitMs;for(;;)try{await p(t);break}catch{const o=await D(t).catch(()=>{});if(o&&Date.now()-o.mtimeMs>l.staleMs){await w(t,{recursive:!0,force:!0});continue}if(Date.now()>n)throw new Error("Another AllyHub program holds the sign-in's lock.");await new Promise(i=>setTimeout(i,l.stepMs))}try{return await r()}finally{await w(t,{recursive:!0,force:!0})}}async function f(e,r,t,n){return e.fetch(r,{method:"POST",redirect:"error",headers:{"content-type":"application/x-www-form-urlencoded",accept:"application/json"},body:new URLSearchParams(t).toString(),signal:n??AbortSignal.timeout(3e4)})}async function g(e){const r=await e.json().catch(()=>({}));if(e.ok)return N.parse(r);const t=j.safeParse(r);return{error:t.success?t.data.error:`http_${String(e.status)}`}}const v=e=>({token:e.access_token,expiresAt:new Date(Date.now()+e.expires_in*1e3).toISOString()});export async function accountOf(e,r){const t=await e.fetch(`${e.url}${H}`,{redirect:"error",headers:{authorization:`Bearer ${r}`,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 n=await t.json();return M.parse({id:n.id,email:n.email,...n.name?{name:n.name}:{},...n.organization?{organization:n.organization}:{}})}async function b(e,r){if(r.refresh_token===void 0)throw new Error("AllyHub gave no refresh token.");const t=await authServer(e),n={version:1,url:e.url,issuer:t.issuer,account:await accountOf(e,r.access_token),refreshToken:r.refresh_token,access:v(r),since:new Date().toISOString()},o=await readCredentials(e).catch(()=>{});return await writeCredentials(e,n),o!==void 0&&o.refreshToken!==n.refreshToken&&await O(e,t.revocation_endpoint,o.refreshToken).then(i=>i.body?.cancel()).catch(()=>{}),n}const O=(e,r,t)=>f(e,r,{token:t,token_type_hint:"refresh_token",client_id:d});export async function signInWithCode(e,r){const t=await authServer(e),n=await g(await f(e,t.token_endpoint,{grant_type:"authorization_code",client_id:d,code:r.code,redirect_uri:r.redirectUri,code_verifier:r.codeVerifier,resource:e.url}));if("error"in n)throw new Error(`Signing in: AllyHub refused the code (${n.error}).`);return b(e,n)}export async function signInWithDevice(e,r,t){const n=await authServer(e),o=await f(e,n.device_authorization_endpoint,{client_id:d,scope:I,resource:e.url});if(!o.ok)throw new Error(`Asking for a device's code: AllyHub answered ${String(o.status)}.`);const i=P.parse(await o.json());r(i);let a=(i.interval??5)*1e3;const u=Date.now()+i.expires_in*1e3;for(;Date.now()<u;){if(await new Promise(c=>setTimeout(c,a)),t?.aborted===!0)throw new Error("Signing in was stopped.");const s=await g(await f(e,n.token_endpoint,{grant_type:"urn:ietf:params:oauth:grant-type:device_code",client_id:d,device_code:i.device_code,resource:e.url}));if(!("error"in s))return b(e,s);if(s.error!=="authorization_pending"){if(s.error==="slow_down"){a+=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,r={}){const t=a=>a?.access!==void 0&&a.access.token!==r.refused&&Date.parse(a.access.expiresAt)-J>Date.now()?{token:a.access.token,expiresAt:a.access.expiresAt,credentials:a}:void 0;let n=await readCredentials(e);if(!n||(e.keychain&&n.keychain===void 0&&(n=await y(e.credentialsFile,async()=>{const a=await readCredentials(e,!0);return a&&a.keychain===void 0&&await writeCredentials(e,a),a})),!n))return;const o=t(n);if(o)return o;const i=await authServer(e);return y(e.credentialsFile,async()=>{const a=await readCredentials(e,!0);if(!a)return;const u=t(a);if(u)return u;const s=await g(await f(e,i.token_endpoint,{grant_type:"refresh_token",client_id:d,refresh_token:a.refreshToken,resource:e.url}));if("error"in s)throw s.error==="invalid_grant"?(await forgetCredentials(e,a.refreshToken),new SignedOut("This computer is signed out of AllyHub.")):new Error(`Renewing the sign-in: AllyHub answered ${s.error}.`);const c={...a,refreshToken:s.refresh_token??a.refreshToken,access:v(s)};return await writeCredentials(e,c),{token:c.access?.token??s.access_token,expiresAt:c.access?.expiresAt??"",credentials:c}})}export async function signOut(e,r){await forgetCredentials(e,r.refreshToken);const t=await authServer(e),n=await O(e,t.revocation_endpoint,r.refreshToken);if(await n.body?.cancel(),!n.ok&&n.status!==400)throw new Error(`Signing out: AllyHub answered ${String(n.status)}.`)}export async function chooseOrganization(e,r){await y(e.credentialsFile,async()=>{const t=await readCredentials(e,!0);if(!t)throw R();await writeCredentials(e,{...t,account:{...t.account,organization:r}})})}
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};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
+ `,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 S(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",v=(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.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 S(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 v(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 v(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 S(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 S(await l(e,a.token_endpoint,{grant_type:"refresh_token",client_id:w,refresh_token:o.refreshToken,resource:e.url},void 0,await v(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}})})}
@@ -0,0 +1,12 @@
1
+ /** The computer's name and system. */
2
+ export interface Computer {
3
+ name: string;
4
+ os: string;
5
+ }
6
+ /** This computer, read once per process. */
7
+ export declare function thisComputer(): Promise<Computer>;
8
+ /** A new sign-in's id (DEVICE_HEADER). */
9
+ export declare const newDeviceId: () => string;
10
+ /** What a token request says of the computer, for the sign-in `device`, from the program `client` ("AllyHub-Studio/0.9.1"). */
11
+ export declare function deviceHeaders(client: string, device: string): Promise<Record<string, string>>;
12
+ //# sourceMappingURL=device.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{execFile as u}from"node:child_process";import{randomBytes as l}from"node:crypto";import{arch as p,hostname as d,platform as s,release as r}from"node:os";import{DEVICE_HEADER as w,DEVICE_NAME_HEADER as f}from"@allyhub/protocol";const a=(e,t)=>new Promise(n=>{u(e,t,{timeout:2e3},(m,c)=>{const o=c.trim();n(m===null&&o!==""?o:void 0)})});let i;export function thisComputer(){return i??=(async()=>{const e=d().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 deviceHeaders(e,t){const n=await thisComputer();return{"user-agent":`${e} (${n.os}; ${p()})`,[w]:t,[f]:encodeURIComponent(n.name)}}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/cloud",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/components",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.ts",
@@ -12,7 +12,7 @@
12
12
  {
13
13
  "path": "src/callout.ts",
14
14
  "target": "{dir}/callout.ts",
15
- "sha256": "97b10557993e74692626dd569d5d05a9df834da79fa645b641d821174714e6e4"
15
+ "sha256": "c1dc30bcbe0766d05c60215af16a4f82548b465d7948fadb203182737a01e610"
16
16
  }
17
17
  ],
18
18
  "categories": []