@allyhub/sdk 0.8.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 (497) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/NOTICE +46 -49
  3. package/dist/dom.d.ts +1 -209
  4. package/dist/dom.js +1 -1
  5. package/dist/image.d.ts +2 -0
  6. package/dist/image.js +2 -0
  7. package/dist/index.d.ts +1 -21
  8. package/dist/index.js +1 -1
  9. package/dist/media.d.ts +1 -5
  10. package/dist/media.js +1 -1
  11. package/dist/node_modules/@allyhub/audio/dist/levels.d.ts +4 -5
  12. package/dist/node_modules/@allyhub/audio/dist/levels.js +1 -1
  13. package/dist/node_modules/@allyhub/audio/dist/node/ffmpeg.d.ts +1 -6
  14. package/dist/node_modules/@allyhub/audio/dist/node/ffmpeg.js +1 -1
  15. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  16. package/dist/node_modules/@allyhub/chart/dist/chart-file.js +1 -1
  17. package/dist/node_modules/@allyhub/chart/dist/chart-xml.d.ts +4 -1
  18. package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +2 -2
  19. package/dist/node_modules/@allyhub/chart/dist/chart.d.ts +22 -0
  20. package/dist/node_modules/@allyhub/chart/dist/chart.js +1 -1
  21. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  22. package/dist/node_modules/@allyhub/diagnostics/LICENSE +241 -0
  23. package/dist/node_modules/@allyhub/diagnostics/dist/fact.d.ts +37 -0
  24. package/dist/node_modules/@allyhub/diagnostics/dist/fact.js +2 -0
  25. package/dist/node_modules/@allyhub/diagnostics/dist/index.d.ts +4 -0
  26. package/dist/node_modules/@allyhub/diagnostics/dist/index.js +2 -0
  27. package/dist/node_modules/@allyhub/diagnostics/dist/problem.d.ts +43 -0
  28. package/dist/node_modules/@allyhub/diagnostics/dist/problem.js +2 -0
  29. package/dist/node_modules/@allyhub/diagnostics/dist/rules.d.ts +30 -0
  30. package/dist/node_modules/@allyhub/diagnostics/dist/rules.js +2 -0
  31. package/dist/node_modules/@allyhub/diagnostics/package.json +14 -0
  32. package/dist/node_modules/@allyhub/formats/dist/contributed.d.ts +126 -0
  33. package/dist/node_modules/@allyhub/formats/dist/contributed.js +2 -0
  34. package/dist/node_modules/@allyhub/formats/dist/data/faces.d.ts +1 -1
  35. package/dist/node_modules/@allyhub/formats/dist/data/reference.d.ts +7 -12
  36. package/dist/node_modules/@allyhub/formats/dist/data/reference.js +1 -1
  37. package/dist/node_modules/@allyhub/formats/dist/data/script.d.ts +9 -4
  38. package/dist/node_modules/@allyhub/formats/dist/data/script.js +1 -1
  39. package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +107 -83
  40. package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
  41. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +185 -8
  42. package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
  43. package/dist/node_modules/@allyhub/formats/dist/data/website.d.ts +2 -1
  44. package/dist/node_modules/@allyhub/formats/dist/data/website.js +1 -1
  45. package/dist/node_modules/@allyhub/formats/dist/data/work.d.ts +42 -0
  46. package/dist/node_modules/@allyhub/formats/dist/data/work.js +2 -0
  47. package/dist/node_modules/@allyhub/formats/dist/extension.d.ts +91 -0
  48. package/dist/node_modules/@allyhub/formats/dist/extension.js +2 -0
  49. package/dist/node_modules/@allyhub/formats/dist/files.d.ts +51 -0
  50. package/dist/node_modules/@allyhub/formats/dist/files.js +2 -0
  51. package/dist/node_modules/@allyhub/formats/dist/index.d.ts +5 -1
  52. package/dist/node_modules/@allyhub/formats/dist/index.js +1 -1
  53. package/dist/node_modules/@allyhub/formats/dist/items.d.ts +226 -90
  54. package/dist/node_modules/@allyhub/formats/dist/items.js +1 -1
  55. package/dist/node_modules/@allyhub/formats/dist/layout.d.ts +7 -1
  56. package/dist/node_modules/@allyhub/formats/dist/layout.js +1 -1
  57. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +96 -42
  58. package/dist/node_modules/@allyhub/formats/dist/schemas.js +1 -1
  59. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  60. package/dist/node_modules/@allyhub/image-draw/LICENSE +241 -0
  61. package/dist/node_modules/@allyhub/image-draw/dist/context.d.ts +5 -0
  62. package/dist/node_modules/@allyhub/image-draw/dist/context.js +2 -0
  63. package/dist/node_modules/@allyhub/image-draw/dist/contrast.d.ts +13 -0
  64. package/dist/node_modules/@allyhub/image-draw/dist/contrast.js +2 -0
  65. package/dist/node_modules/@allyhub/image-draw/dist/env.d.ts +112 -0
  66. package/dist/node_modules/@allyhub/image-draw/dist/env.js +2 -0
  67. package/dist/node_modules/@allyhub/image-draw/dist/errors.d.ts +20 -0
  68. package/dist/node_modules/@allyhub/image-draw/dist/errors.js +2 -0
  69. package/dist/node_modules/@allyhub/image-draw/dist/fonts.d.ts +110 -0
  70. package/dist/node_modules/@allyhub/image-draw/dist/fonts.js +2 -0
  71. package/dist/node_modules/@allyhub/image-draw/dist/guards.d.ts +32 -0
  72. package/dist/node_modules/@allyhub/image-draw/dist/guards.js +2 -0
  73. package/dist/node_modules/@allyhub/image-draw/dist/hash.d.ts +3 -0
  74. package/dist/node_modules/@allyhub/image-draw/dist/hash.js +2 -0
  75. package/dist/node_modules/@allyhub/image-draw/dist/inspect.d.ts +113 -0
  76. package/dist/node_modules/@allyhub/image-draw/dist/inspect.js +3 -0
  77. package/dist/node_modules/@allyhub/image-draw/dist/layer-style.d.ts +151 -0
  78. package/dist/node_modules/@allyhub/image-draw/dist/layer-style.js +2 -0
  79. package/dist/node_modules/@allyhub/image-draw/dist/paint.d.ts +29 -0
  80. package/dist/node_modules/@allyhub/image-draw/dist/paint.js +2 -0
  81. package/dist/node_modules/@allyhub/image-draw/dist/pictures.d.ts +39 -0
  82. package/dist/node_modules/@allyhub/image-draw/dist/pictures.js +2 -0
  83. package/dist/node_modules/@allyhub/image-draw/dist/plan.d.ts +52 -0
  84. package/dist/node_modules/@allyhub/image-draw/dist/plan.js +2 -0
  85. package/dist/node_modules/@allyhub/image-draw/dist/reads.d.ts +145 -0
  86. package/dist/node_modules/@allyhub/image-draw/dist/reads.js +2 -0
  87. package/dist/node_modules/@allyhub/image-draw/dist/shape-path.d.ts +26 -0
  88. package/dist/node_modules/@allyhub/image-draw/dist/shape-path.js +2 -0
  89. package/dist/node_modules/@allyhub/image-draw/dist/stage.d.ts +56 -0
  90. package/dist/node_modules/@allyhub/image-draw/dist/stage.js +2 -0
  91. package/dist/node_modules/@allyhub/image-draw/dist/styles.d.ts +35 -0
  92. package/dist/node_modules/@allyhub/image-draw/dist/styles.js +2 -0
  93. package/dist/node_modules/@allyhub/image-draw/dist/tone.d.ts +53 -0
  94. package/dist/node_modules/@allyhub/image-draw/dist/tone.js +2 -0
  95. package/dist/node_modules/@allyhub/image-draw/package.json +14 -0
  96. package/dist/node_modules/@allyhub/image-measure/LICENSE +241 -0
  97. package/dist/node_modules/@allyhub/image-measure/dist/contrast.d.ts +43 -0
  98. package/dist/node_modules/@allyhub/image-measure/dist/contrast.js +2 -0
  99. package/dist/node_modules/@allyhub/image-measure/dist/layout.d.ts +186 -0
  100. package/dist/node_modules/@allyhub/image-measure/dist/layout.js +5 -0
  101. package/dist/node_modules/@allyhub/image-measure/package.json +14 -0
  102. package/dist/node_modules/@allyhub/image-sdk/LICENSE +241 -0
  103. package/dist/node_modules/@allyhub/image-sdk/dist/adjustment.d.ts +13 -0
  104. package/dist/node_modules/@allyhub/image-sdk/dist/adjustment.js +2 -0
  105. package/dist/{define.d.ts → node_modules/@allyhub/image-sdk/dist/define.d.ts} +21 -4
  106. package/dist/node_modules/@allyhub/image-sdk/dist/define.js +2 -0
  107. package/dist/node_modules/@allyhub/image-sdk/dist/dom.d.ts +210 -0
  108. package/dist/node_modules/@allyhub/image-sdk/dist/dom.js +2 -0
  109. package/dist/node_modules/@allyhub/image-sdk/dist/fill.d.ts +21 -0
  110. package/dist/node_modules/@allyhub/image-sdk/dist/fill.js +2 -0
  111. package/dist/node_modules/@allyhub/image-sdk/dist/group.d.ts +17 -0
  112. package/dist/node_modules/@allyhub/image-sdk/dist/group.js +2 -0
  113. package/dist/node_modules/@allyhub/image-sdk/dist/index.d.ts +166 -0
  114. package/dist/node_modules/@allyhub/image-sdk/dist/index.js +2 -0
  115. package/dist/node_modules/@allyhub/image-sdk/dist/media.d.ts +6 -0
  116. package/dist/node_modules/@allyhub/image-sdk/dist/media.js +2 -0
  117. package/dist/{messages.d.ts → node_modules/@allyhub/image-sdk/dist/messages.d.ts} +1 -1
  118. package/dist/node_modules/@allyhub/image-sdk/dist/picture.d.ts +59 -0
  119. package/dist/node_modules/@allyhub/image-sdk/dist/picture.js +2 -0
  120. package/dist/{props.d.ts → node_modules/@allyhub/image-sdk/dist/props.d.ts} +4 -4
  121. package/dist/node_modules/@allyhub/image-sdk/dist/shape.d.ts +34 -0
  122. package/dist/node_modules/@allyhub/image-sdk/dist/shape.js +2 -0
  123. package/dist/node_modules/@allyhub/image-sdk/dist/stack.d.ts +16 -0
  124. package/dist/node_modules/@allyhub/image-sdk/dist/stack.js +2 -0
  125. package/dist/node_modules/@allyhub/image-sdk/dist/text-layer.d.ts +38 -0
  126. package/dist/node_modules/@allyhub/image-sdk/dist/text-layer.js +2 -0
  127. package/dist/{written.js → node_modules/@allyhub/image-sdk/dist/written.js} +1 -1
  128. package/dist/node_modules/@allyhub/image-sdk/package.json +19 -0
  129. package/dist/node_modules/@allyhub/measure/LICENSE +241 -0
  130. package/dist/node_modules/@allyhub/measure/dist/compare.d.ts +195 -0
  131. package/dist/node_modules/@allyhub/measure/dist/compare.js +2 -0
  132. package/dist/node_modules/@allyhub/measure/dist/grain.d.ts +8 -0
  133. package/dist/node_modules/@allyhub/measure/dist/grain.js +2 -0
  134. package/dist/node_modules/@allyhub/measure/dist/image.d.ts +16 -0
  135. package/dist/node_modules/@allyhub/measure/dist/image.js +2 -0
  136. package/dist/node_modules/@allyhub/measure/dist/index.d.ts +4 -0
  137. package/dist/node_modules/@allyhub/measure/dist/index.js +2 -0
  138. package/dist/node_modules/@allyhub/measure/package.json +13 -0
  139. package/dist/node_modules/@allyhub/ooxml/dist/generated/presets.d.ts +4 -1
  140. package/dist/node_modules/@allyhub/ooxml/dist/generated/presets.js +1 -1
  141. package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.d.ts +15 -1
  142. package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.js +1 -1
  143. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  144. package/dist/node_modules/@allyhub/piece/LICENSE +241 -0
  145. package/dist/node_modules/@allyhub/{video-core → piece}/dist/anchors.d.ts +1 -9
  146. package/dist/node_modules/@allyhub/{video-core → piece}/dist/component.js +1 -1
  147. package/dist/node_modules/@allyhub/piece/dist/context.d.ts +39 -0
  148. package/dist/node_modules/@allyhub/piece/dist/context.js +2 -0
  149. package/dist/node_modules/@allyhub/{video-core → piece}/dist/contrast.d.ts +2 -2
  150. package/dist/node_modules/@allyhub/{video-core → piece}/dist/export.d.ts +27 -10
  151. package/dist/node_modules/@allyhub/piece/dist/export.js +2 -0
  152. package/dist/node_modules/@allyhub/{video-core → piece}/dist/formats.d.ts +12 -68
  153. package/dist/node_modules/@allyhub/piece/dist/formats.js +2 -0
  154. package/dist/node_modules/@allyhub/piece/dist/gen.d.ts +104 -0
  155. package/dist/node_modules/@allyhub/piece/dist/index.d.ts +26 -0
  156. package/dist/node_modules/@allyhub/piece/dist/index.js +2 -0
  157. package/dist/node_modules/@allyhub/piece/dist/layer-style.d.ts +1558 -0
  158. package/dist/node_modules/@allyhub/piece/dist/layer-style.js +2 -0
  159. package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +389 -0
  160. package/dist/node_modules/@allyhub/piece/dist/layer.js +2 -0
  161. package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +437 -0
  162. package/dist/node_modules/@allyhub/piece/dist/layout.js +2 -0
  163. package/dist/node_modules/@allyhub/{video-core → piece}/dist/look.d.ts +1 -1
  164. package/dist/node_modules/@allyhub/{video-core → piece}/dist/media.d.ts +39 -9
  165. package/dist/node_modules/@allyhub/{video-core → piece}/dist/media.js +1 -1
  166. package/dist/node_modules/@allyhub/{video-core → piece}/dist/messages.d.ts +6 -0
  167. package/dist/node_modules/@allyhub/piece/dist/names.d.ts +26 -0
  168. package/dist/node_modules/@allyhub/piece/dist/names.js +2 -0
  169. package/dist/node_modules/@allyhub/piece/dist/page/console.d.ts +21 -0
  170. package/dist/node_modules/@allyhub/piece/dist/page/console.js +2 -0
  171. package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +3 -0
  172. package/dist/node_modules/@allyhub/piece/dist/page/index.js +2 -0
  173. package/dist/node_modules/@allyhub/piece/dist/page/locate.d.ts +4 -0
  174. package/dist/node_modules/@allyhub/piece/dist/page/locate.js +2 -0
  175. package/dist/node_modules/@allyhub/piece/dist/picture.d.ts +62 -0
  176. package/dist/node_modules/@allyhub/piece/dist/picture.js +2 -0
  177. package/dist/node_modules/@allyhub/piece/dist/piece.d.ts +15 -0
  178. package/dist/node_modules/@allyhub/piece/dist/piece.js +2 -0
  179. package/dist/node_modules/@allyhub/{video-core → piece}/dist/script.d.ts +9 -4
  180. package/dist/node_modules/@allyhub/piece/dist/script.js +2 -0
  181. package/dist/node_modules/@allyhub/piece/dist/source.d.ts +131 -0
  182. package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +291 -0
  183. package/dist/node_modules/@allyhub/piece/dist/stage.js +2 -0
  184. package/dist/node_modules/@allyhub/piece/dist/version.d.ts +15 -0
  185. package/dist/node_modules/@allyhub/piece/dist/version.js +2 -0
  186. package/dist/node_modules/@allyhub/{video-core → piece}/dist/voice.d.ts +1 -20
  187. package/dist/node_modules/@allyhub/piece/package.json +18 -0
  188. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +271 -0
  189. package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
  190. package/dist/node_modules/@allyhub/protocol/dist/app.d.ts +3 -10
  191. package/dist/node_modules/@allyhub/protocol/dist/app.js +1 -1
  192. package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +19 -1
  193. package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
  194. package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.d.ts +337 -0
  195. package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.js +2 -0
  196. package/dist/node_modules/@allyhub/protocol/dist/cli.d.ts +12 -1
  197. package/dist/node_modules/@allyhub/protocol/dist/cli.js +1 -1
  198. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +155 -0
  199. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  200. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +235 -133
  201. package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
  202. package/dist/node_modules/@allyhub/protocol/dist/files.d.ts +2 -0
  203. package/dist/node_modules/@allyhub/protocol/dist/files.js +1 -1
  204. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +65 -197
  205. package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
  206. package/dist/node_modules/@allyhub/protocol/dist/image.d.ts +8 -0
  207. package/dist/node_modules/@allyhub/protocol/dist/image.js +2 -0
  208. package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +6 -0
  209. package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
  210. package/dist/node_modules/@allyhub/protocol/dist/jobs.d.ts +6 -6
  211. package/dist/node_modules/@allyhub/protocol/dist/kinds.d.ts +98 -0
  212. package/dist/node_modules/@allyhub/protocol/dist/kinds.js +2 -0
  213. package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +274 -0
  214. package/dist/node_modules/@allyhub/protocol/dist/mail.js +2 -0
  215. package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +77 -91
  216. package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
  217. package/dist/node_modules/@allyhub/protocol/dist/peer.d.ts +59 -0
  218. package/dist/node_modules/@allyhub/protocol/dist/peer.js +2 -0
  219. package/dist/node_modules/@allyhub/protocol/dist/place.d.ts +21 -0
  220. package/dist/node_modules/@allyhub/protocol/dist/place.js +2 -0
  221. package/dist/node_modules/@allyhub/protocol/dist/presence.d.ts +125 -0
  222. package/dist/node_modules/@allyhub/protocol/dist/presence.js +2 -0
  223. package/dist/node_modules/@allyhub/protocol/dist/registry.d.ts +1 -1
  224. package/dist/node_modules/@allyhub/protocol/dist/routes.js +1 -1
  225. package/dist/node_modules/@allyhub/protocol/dist/shape.d.ts +35 -0
  226. package/dist/node_modules/@allyhub/protocol/dist/shape.js +2 -0
  227. package/dist/node_modules/@allyhub/protocol/dist/shares.d.ts +2 -8
  228. package/dist/node_modules/@allyhub/protocol/dist/shares.js +1 -1
  229. package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +70 -40
  230. package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
  231. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +224 -177
  232. package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
  233. package/dist/node_modules/@allyhub/protocol/package.json +5 -1
  234. package/dist/node_modules/@allyhub/runtimes/dist/bundled.js +1 -1
  235. package/dist/node_modules/@allyhub/runtimes/dist/declared.d.ts +14 -0
  236. package/dist/node_modules/@allyhub/runtimes/dist/declared.js +2 -0
  237. package/dist/node_modules/@allyhub/runtimes/dist/ffmpeg.d.ts +15 -0
  238. package/dist/node_modules/@allyhub/runtimes/dist/ffmpeg.js +2 -0
  239. package/dist/node_modules/@allyhub/runtimes/dist/index.d.ts +2 -0
  240. package/dist/node_modules/@allyhub/runtimes/dist/index.js +1 -1
  241. package/dist/node_modules/@allyhub/runtimes/dist/packages.js +3 -3
  242. package/dist/node_modules/@allyhub/runtimes/dist/runtimes.d.ts +1 -0
  243. package/dist/node_modules/@allyhub/runtimes/dist/runtimes.js +1 -1
  244. package/dist/node_modules/@allyhub/runtimes/manifest.json +0 -82
  245. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  246. package/dist/node_modules/@allyhub/scenery/dist/define.d.ts +2 -0
  247. package/dist/node_modules/@allyhub/scenery/dist/define.js +1 -1
  248. package/dist/node_modules/@allyhub/scenery/dist/index.d.ts +2 -2
  249. package/dist/node_modules/@allyhub/scenery/dist/index.js +1 -1
  250. package/dist/node_modules/@allyhub/scenery/dist/moire.d.ts +45 -5
  251. package/dist/node_modules/@allyhub/scenery/dist/moire.js +2 -2
  252. package/dist/node_modules/@allyhub/scenery/dist/phone.d.ts +4 -3
  253. package/dist/node_modules/@allyhub/scenery/dist/phone.js +1 -1
  254. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  255. package/dist/node_modules/@allyhub/sheet/dist/api/capabilities.js +1 -1
  256. package/dist/node_modules/@allyhub/sheet/dist/api/code.d.ts +4 -4
  257. package/dist/node_modules/@allyhub/sheet/dist/api/code.js +1 -1
  258. package/dist/node_modules/@allyhub/sheet/dist/api/workbook.d.ts +15 -11
  259. package/dist/node_modules/@allyhub/sheet/dist/api/workbook.js +1 -1
  260. package/dist/node_modules/@allyhub/sheet/dist/calc/coerce.js +1 -1
  261. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.d.ts +70 -0
  262. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
  263. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.d.ts +6 -0
  264. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.js +1 -1
  265. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/date.js +1 -1
  266. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.d.ts +3 -1
  267. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.js +1 -1
  268. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/info.js +1 -1
  269. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/kernels.js +1 -1
  270. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/lookup.js +1 -1
  271. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/maths.js +1 -1
  272. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
  273. package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.d.ts +9 -0
  274. package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.js +1 -1
  275. package/dist/node_modules/@allyhub/sheet/dist/calc/server.d.ts +1 -1
  276. package/dist/node_modules/@allyhub/sheet/dist/calc/types.d.ts +6 -0
  277. package/dist/node_modules/@allyhub/sheet/dist/calc/types.js +1 -1
  278. package/dist/node_modules/@allyhub/sheet/dist/chart.d.ts +9 -0
  279. package/dist/node_modules/@allyhub/sheet/dist/chart.js +1 -1
  280. package/dist/node_modules/@allyhub/sheet/dist/export.js +1 -1
  281. package/dist/node_modules/@allyhub/sheet/dist/file.d.ts +5 -0
  282. package/dist/node_modules/@allyhub/sheet/dist/file.js +1 -1
  283. package/dist/node_modules/@allyhub/sheet/dist/formula/ast.d.ts +12 -1
  284. package/dist/node_modules/@allyhub/sheet/dist/formula/move.d.ts +5 -1
  285. package/dist/node_modules/@allyhub/sheet/dist/formula/move.js +1 -1
  286. package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
  287. package/dist/node_modules/@allyhub/sheet/dist/formula/print.js +1 -1
  288. package/dist/node_modules/@allyhub/sheet/dist/generated.d.ts +5 -19
  289. package/dist/node_modules/@allyhub/sheet/dist/generated.js +1 -1
  290. package/dist/node_modules/@allyhub/sheet/dist/import.d.ts +3 -1
  291. package/dist/node_modules/@allyhub/sheet/dist/import.js +1 -1
  292. package/dist/node_modules/@allyhub/sheet/dist/index.d.ts +5 -5
  293. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  294. package/dist/node_modules/@allyhub/sheet/dist/inspect.d.ts +88 -3
  295. package/dist/node_modules/@allyhub/sheet/dist/inspect.js +1 -1
  296. package/dist/node_modules/@allyhub/sheet/dist/patch.d.ts +1 -1
  297. package/dist/node_modules/@allyhub/sheet/dist/patch.js +1 -1
  298. package/dist/node_modules/@allyhub/sheet/dist/printed.d.ts +19 -0
  299. package/dist/node_modules/@allyhub/sheet/dist/printed.js +2 -0
  300. package/dist/node_modules/@allyhub/sheet/dist/sdk.d.ts +2 -0
  301. package/dist/node_modules/@allyhub/sheet/dist/sdk.js +2 -0
  302. package/dist/node_modules/@allyhub/sheet/dist/values.d.ts +2 -0
  303. package/dist/node_modules/@allyhub/sheet/dist/values.js +1 -1
  304. package/dist/node_modules/@allyhub/sheet/dist/workbook.d.ts +8 -6
  305. package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
  306. package/dist/node_modules/@allyhub/sheet/dist/write.js +15 -15
  307. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.d.ts +6 -2
  308. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  309. package/dist/node_modules/@allyhub/sheet/dist/xlsx/formula.js +2 -2
  310. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.d.ts +2 -1
  311. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
  312. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.d.ts +3 -1
  313. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
  314. package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.d.ts +7 -1
  315. package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.js +3 -1
  316. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.d.ts +6 -0
  317. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
  318. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.d.ts +1 -1
  319. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  320. package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.d.ts +12 -1
  321. package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.js +3 -2
  322. package/dist/node_modules/@allyhub/sheet/package.json +5 -1
  323. package/dist/node_modules/@allyhub/slides-core/dist/animation.d.ts +23 -7
  324. package/dist/node_modules/@allyhub/slides-core/dist/animation.js +1 -1
  325. package/dist/node_modules/@allyhub/slides-core/dist/api.d.ts +101 -11
  326. package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
  327. package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
  328. package/dist/node_modules/@allyhub/slides-core/dist/chart-api.d.ts +18 -1
  329. package/dist/node_modules/@allyhub/slides-core/dist/chart-api.js +1 -1
  330. package/dist/node_modules/@allyhub/slides-core/dist/code.d.ts +1 -1
  331. package/dist/node_modules/@allyhub/slides-core/dist/connect.d.ts +62 -0
  332. package/dist/node_modules/@allyhub/slides-core/dist/connect.js +2 -0
  333. package/dist/node_modules/@allyhub/slides-core/dist/enums.d.ts +24 -0
  334. package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
  335. package/dist/node_modules/@allyhub/slides-core/dist/fact.d.ts +223 -0
  336. package/dist/node_modules/@allyhub/slides-core/dist/fact.js +2 -0
  337. package/dist/node_modules/@allyhub/slides-core/dist/file.d.ts +4 -4
  338. package/dist/node_modules/@allyhub/slides-core/dist/file.js +2 -2
  339. package/dist/node_modules/@allyhub/slides-core/dist/index.d.ts +2 -0
  340. package/dist/node_modules/@allyhub/slides-core/dist/index.js +1 -1
  341. package/dist/node_modules/@allyhub/slides-core/dist/measure.d.ts +4 -2
  342. package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
  343. package/dist/node_modules/@allyhub/slides-core/dist/merge.d.ts +5 -5
  344. package/dist/node_modules/@allyhub/slides-core/dist/merge.js +1 -1
  345. package/dist/node_modules/@allyhub/slides-core/dist/model.d.ts +25 -4
  346. package/dist/node_modules/@allyhub/slides-core/dist/office.d.ts +1 -1
  347. package/dist/node_modules/@allyhub/slides-core/dist/path.d.ts +1 -1
  348. package/dist/node_modules/@allyhub/slides-core/dist/resolve.d.ts +20 -11
  349. package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
  350. package/dist/node_modules/@allyhub/slides-core/dist/sdk.d.ts +18 -0
  351. package/dist/node_modules/@allyhub/slides-core/dist/sdk.js +2 -0
  352. package/dist/node_modules/@allyhub/slides-core/dist/stage.d.ts +28 -11
  353. package/dist/node_modules/@allyhub/slides-core/dist/units.d.ts +3 -6
  354. package/dist/node_modules/@allyhub/slides-core/dist/units.js +1 -1
  355. package/dist/node_modules/@allyhub/slides-core/package.json +5 -1
  356. package/dist/node_modules/@allyhub/video-core/dist/audio-types.d.ts +1 -2
  357. package/dist/node_modules/@allyhub/video-core/dist/captions.d.ts +1 -10
  358. package/dist/node_modules/@allyhub/video-core/dist/captions.js +1 -1
  359. package/dist/node_modules/@allyhub/video-core/dist/check.d.ts +62 -0
  360. package/dist/node_modules/@allyhub/video-core/dist/check.js +2 -0
  361. package/dist/node_modules/@allyhub/video-core/dist/cut-report.d.ts +2 -2
  362. package/dist/node_modules/@allyhub/video-core/dist/cut-report.js +1 -1
  363. package/dist/node_modules/@allyhub/video-core/dist/edits.d.ts +3 -3
  364. package/dist/node_modules/@allyhub/video-core/dist/edits.js +1 -1
  365. package/dist/node_modules/@allyhub/video-core/dist/fact.d.ts +21 -762
  366. package/dist/node_modules/@allyhub/video-core/dist/fact.js +1 -1
  367. package/dist/node_modules/@allyhub/video-core/dist/footage-motion.d.ts +3 -2
  368. package/dist/node_modules/@allyhub/video-core/dist/footage-motion.js +1 -1
  369. package/dist/node_modules/@allyhub/video-core/dist/index.d.ts +3 -17
  370. package/dist/node_modules/@allyhub/video-core/dist/index.js +1 -1
  371. package/dist/node_modules/@allyhub/video-core/dist/measure.d.ts +72 -423
  372. package/dist/node_modules/@allyhub/video-core/dist/measure.js +1 -4
  373. package/dist/node_modules/@allyhub/video-core/dist/mix-plan.d.ts +44 -0
  374. package/dist/node_modules/@allyhub/video-core/dist/mix-plan.js +2 -0
  375. package/dist/node_modules/@allyhub/video-core/dist/motion.d.ts +1 -1
  376. package/dist/node_modules/@allyhub/video-core/dist/piece.d.ts +24 -432
  377. package/dist/node_modules/@allyhub/video-core/dist/piece.js +1 -1
  378. package/dist/node_modules/@allyhub/video-core/dist/placement.d.ts +1 -1
  379. package/dist/node_modules/@allyhub/video-core/dist/schema.d.ts +8 -14
  380. package/dist/node_modules/@allyhub/video-core/dist/schema.js +1 -1
  381. package/dist/node_modules/@allyhub/video-core/dist/script-edit.d.ts +11 -6
  382. package/dist/node_modules/@allyhub/video-core/dist/script-edit.js +1 -1
  383. package/dist/node_modules/@allyhub/video-core/dist/seams.d.ts +2 -3
  384. package/dist/node_modules/@allyhub/video-core/dist/sound-under.d.ts +2 -2
  385. package/dist/node_modules/@allyhub/video-core/dist/sound-under.js +1 -1
  386. package/dist/node_modules/@allyhub/video-core/dist/speech.d.ts +2 -4
  387. package/dist/node_modules/@allyhub/video-core/dist/speech.js +2 -2
  388. package/dist/node_modules/@allyhub/video-core/dist/stage.d.ts +52 -0
  389. package/dist/node_modules/@allyhub/video-core/dist/stage.js +2 -0
  390. package/dist/node_modules/@allyhub/video-core/dist/timeline.d.ts +18 -136
  391. package/dist/node_modules/@allyhub/video-core/dist/timeline.js +1 -1
  392. package/dist/node_modules/@allyhub/video-core/dist/timing.d.ts +3 -3
  393. package/dist/node_modules/@allyhub/video-core/dist/timing.js +1 -1
  394. package/dist/node_modules/@allyhub/video-core/dist/transcript.d.ts +2 -2
  395. package/dist/node_modules/@allyhub/video-core/dist/transcript.js +1 -1
  396. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  397. package/dist/node_modules/@allyhub/video-sdk/LICENSE +241 -0
  398. package/dist/node_modules/@allyhub/video-sdk/NOTICE +118 -0
  399. package/dist/{free.d.ts → node_modules/@allyhub/video-sdk/dist/free.d.ts} +14 -10
  400. package/dist/node_modules/@allyhub/video-sdk/dist/free.js +2 -0
  401. package/dist/node_modules/@allyhub/video-sdk/dist/index.d.ts +28 -0
  402. package/dist/node_modules/@allyhub/video-sdk/dist/index.js +2 -0
  403. package/dist/{input.d.ts → node_modules/@allyhub/video-sdk/dist/input.d.ts} +76 -22
  404. package/dist/node_modules/@allyhub/video-sdk/dist/input.js +2 -0
  405. package/dist/{module.d.ts → node_modules/@allyhub/video-sdk/dist/module.d.ts} +6 -4
  406. package/dist/node_modules/@allyhub/video-sdk/dist/module.js +2 -0
  407. package/dist/{parts.d.ts → node_modules/@allyhub/video-sdk/dist/parts.d.ts} +15 -6
  408. package/dist/node_modules/@allyhub/video-sdk/dist/parts.js +2 -0
  409. package/dist/{phone.d.ts → node_modules/@allyhub/video-sdk/dist/phone.d.ts} +12 -5
  410. package/dist/node_modules/@allyhub/video-sdk/dist/phone.js +2 -0
  411. package/dist/{piece.d.ts → node_modules/@allyhub/video-sdk/dist/piece.d.ts} +26 -16
  412. package/dist/node_modules/@allyhub/video-sdk/dist/piece.js +2 -0
  413. package/dist/node_modules/@allyhub/video-sdk/dist/route.d.ts +46 -0
  414. package/dist/node_modules/@allyhub/video-sdk/dist/route.js +2 -0
  415. package/dist/node_modules/@allyhub/video-sdk/dist/scenery.d.ts +2 -0
  416. package/dist/node_modules/@allyhub/video-sdk/dist/scenery.js +2 -0
  417. package/dist/node_modules/@allyhub/video-sdk/package.json +19 -0
  418. package/dist/scenery.d.ts +1 -1
  419. package/dist/scenery.js +1 -1
  420. package/dist/sheets.d.ts +1 -1
  421. package/dist/sheets.js +1 -1
  422. package/dist/slides.d.ts +1 -9
  423. package/dist/slides.js +1 -1
  424. package/docs/README.md +10 -6
  425. package/docs/batches.md +5 -5
  426. package/docs/canvas.md +28 -0
  427. package/docs/contract.md +2 -2
  428. package/docs/defaults.md +298 -22
  429. package/docs/docs.md +80 -66
  430. package/docs/footage.md +7 -7
  431. package/docs/image.md +165 -0
  432. package/docs/layers.md +22 -13
  433. package/docs/modeling.md +4 -4
  434. package/docs/pictures.md +65 -0
  435. package/docs/project.md +51 -31
  436. package/docs/scenery.md +14 -15
  437. package/docs/sheets.md +46 -28
  438. package/docs/slides.md +121 -67
  439. package/docs/sound.md +3 -3
  440. package/docs/speech.md +8 -8
  441. package/docs/video.md +16 -13
  442. package/docs/websites.md +4 -4
  443. package/docs/x.md +73 -0
  444. package/package.json +7 -2
  445. package/dist/define.js +0 -2
  446. package/dist/free.js +0 -2
  447. package/dist/input.js +0 -2
  448. package/dist/module.js +0 -2
  449. package/dist/node_modules/@allyhub/formats/dist/data/comments.d.ts +0 -94
  450. package/dist/node_modules/@allyhub/formats/dist/data/comments.js +0 -2
  451. package/dist/node_modules/@allyhub/runtimes/pins/onnxruntime-node/package-lock.json +0 -227
  452. package/dist/node_modules/@allyhub/runtimes/pins/onnxruntime-node/package.json +0 -8
  453. package/dist/node_modules/@allyhub/runtimes/pins/sherpa-onnx-node/package-lock.json +0 -105
  454. package/dist/node_modules/@allyhub/runtimes/pins/sherpa-onnx-node/package.json +0 -8
  455. package/dist/node_modules/@allyhub/runtimes/pins/tesseract.js/package-lock.json +0 -128
  456. package/dist/node_modules/@allyhub/runtimes/pins/tesseract.js/package.json +0 -9
  457. package/dist/node_modules/@allyhub/video-core/dist/export.js +0 -2
  458. package/dist/node_modules/@allyhub/video-core/dist/formats.js +0 -2
  459. package/dist/node_modules/@allyhub/video-core/dist/gen.d.ts +0 -37
  460. package/dist/node_modules/@allyhub/video-core/dist/problem.d.ts +0 -278
  461. package/dist/node_modules/@allyhub/video-core/dist/problem.js +0 -2
  462. package/dist/node_modules/@allyhub/video-core/dist/script.js +0 -2
  463. package/dist/node_modules/@allyhub/video-core/dist/source.d.ts +0 -7
  464. package/dist/parts.js +0 -2
  465. package/dist/phone.js +0 -2
  466. package/dist/piece.js +0 -2
  467. /package/dist/node_modules/@allyhub/{sheet → formats}/dist/csv.d.ts +0 -0
  468. /package/dist/node_modules/@allyhub/{sheet → formats}/dist/csv.js +0 -0
  469. /package/dist/{fit.d.ts → node_modules/@allyhub/image-sdk/dist/fit.d.ts} +0 -0
  470. /package/dist/{fit.js → node_modules/@allyhub/image-sdk/dist/fit.js} +0 -0
  471. /package/dist/{messages.js → node_modules/@allyhub/image-sdk/dist/messages.js} +0 -0
  472. /package/dist/{props.js → node_modules/@allyhub/image-sdk/dist/props.js} +0 -0
  473. /package/dist/{text.d.ts → node_modules/@allyhub/image-sdk/dist/text.d.ts} +0 -0
  474. /package/dist/{text.js → node_modules/@allyhub/image-sdk/dist/text.js} +0 -0
  475. /package/dist/{written.d.ts → node_modules/@allyhub/image-sdk/dist/written.d.ts} +0 -0
  476. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/anchors.js +0 -0
  477. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/component.d.ts +0 -0
  478. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/console.d.ts +0 -0
  479. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/console.js +0 -0
  480. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/contrast.js +0 -0
  481. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/gen.js +0 -0
  482. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/look.js +0 -0
  483. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/marks.d.ts +0 -0
  484. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/marks.js +0 -0
  485. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/matrix.d.ts +0 -0
  486. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/matrix.js +0 -0
  487. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/messages.js +0 -0
  488. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/source.js +0 -0
  489. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/voice.js +0 -0
  490. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/words.d.ts +0 -0
  491. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/words.js +0 -0
  492. /package/dist/{anim.d.ts → node_modules/@allyhub/video-sdk/dist/anim.d.ts} +0 -0
  493. /package/dist/{anim.js → node_modules/@allyhub/video-sdk/dist/anim.js} +0 -0
  494. /package/dist/{noise.d.ts → node_modules/@allyhub/video-sdk/dist/noise.d.ts} +0 -0
  495. /package/dist/{noise.js → node_modules/@allyhub/video-sdk/dist/noise.js} +0 -0
  496. /package/dist/{paths.d.ts → node_modules/@allyhub/video-sdk/dist/paths.d.ts} +0 -0
  497. /package/dist/{paths.js → node_modules/@allyhub/video-sdk/dist/paths.js} +0 -0
@@ -0,0 +1,337 @@
1
+ import { z } from "zod";
2
+ /** The version of these messages; `bridge/hello` carries each end's. */
3
+ export declare const BRIDGE_PROTOCOL = 1;
4
+ /** The native messaging host Studio installs, by the name Chrome knows it. */
5
+ export declare const BRIDGE_NATIVE_HOST = "com.allyhub.browser";
6
+ /**
7
+ * What an agent names the person's own browser by when it does not care
8
+ * which (`ALLYHUB_BROWSER=person`): their default one if it is connected,
9
+ * else the one connected.
10
+ */
11
+ export declare const PERSON_BROWSER = "person";
12
+ /** Where a Host's door takes the extension's WebSocket (behind a cloud Studio's gateway, with a ticket). */
13
+ export declare const BRIDGE_PATH = "/browser";
14
+ /**
15
+ * The extension's IDs: the store's (v1's listing, which carries the
16
+ * bridge beside v1's features) and the development build's, fixed by the
17
+ * `key` in its manifest. A native host's manifest names both; a Host's
18
+ * door lets in only their origins.
19
+ */
20
+ export declare const BRIDGE_EXTENSION_IDS: {
21
+ readonly store: "pmckbhaedjblcbkbkcbmmogpealiaeol";
22
+ readonly development: "dbmenjkebdgjkhjdcicplkaakmjcjhdp";
23
+ };
24
+ /** Where a person installs the extension (Chrome's store; Edge, Brave, Arc and the others install from it too). */
25
+ export declare const BRIDGE_STORE_URL: string;
26
+ /** The origins a Host's door accepts the extension's WebSocket from. */
27
+ export declare const BRIDGE_EXTENSION_ORIGINS: readonly string[];
28
+ /**
29
+ * The pages that may hand the extension a ticket to a cloud Studio (its
30
+ * `externally_connectable`): AllyHub's window, production's and staging's.
31
+ * Never `*.allyhub.studio`, which serves projects' code.
32
+ */
33
+ export declare const BRIDGE_WINDOW_ORIGINS: readonly ["https://app.allyhub.com", "https://app.allyhub-staging.com"];
34
+ /** The domains a cloud Studio's Host is reached under (its gateway's), production's and staging's. */
35
+ export declare const BRIDGE_STUDIO_DOMAINS: readonly ["allyhub.studio", "allyhub-studio-staging.com"];
36
+ /** What AllyHub's window asks the extension (`chrome.runtime.sendMessage` to it). */
37
+ export declare const BridgeWindowMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
38
+ type: z.ZodLiteral<"allyhub/bridge/status">;
39
+ }, z.core.$strip>, z.ZodObject<{
40
+ type: z.ZodLiteral<"allyhub/bridge/connect">;
41
+ url: z.ZodString;
42
+ }, z.core.$strip>], "type">;
43
+ export type BridgeWindowMessage = z.infer<typeof BridgeWindowMessageSchema>;
44
+ /** The extension's answer to the window. */
45
+ export declare const BridgeWindowAnswerSchema: z.ZodObject<{
46
+ version: z.ZodString;
47
+ connected: z.ZodArray<z.ZodString>;
48
+ error: z.ZodOptional<z.ZodString>;
49
+ }, z.core.$strip>;
50
+ export type BridgeWindowAnswer = z.infer<typeof BridgeWindowAnswerSchema>;
51
+ /**
52
+ * The address the extension may connect to, a window gave it: a cloud
53
+ * Studio's door (`wss://<sandbox>.allyhub.studio/browser`), never another
54
+ * server; a development build, a Host on this computer too, named
55
+ * `localhost`, `127.0.0.1` or any `*.localhost` (`cloud:local` reaches a
56
+ * Host as `<sandbox>.studio.localhost`). `undefined` for any other.
57
+ *
58
+ * Read by the URL parser, not a pattern: what it returns is the address
59
+ * the extension connects to, so a spelling a pattern reads apart from the
60
+ * parser (a backslash, an encoded slash) cannot reach another server.
61
+ */
62
+ export declare function bridgeTarget(url: string, development: boolean): URL | undefined;
63
+ /**
64
+ * The largest message Chrome passes from a native host to its extension
65
+ * is 1 MB; the other way, 64 MiB. A Host splits what it sends over native
66
+ * messaging into parts well under that (`splitNative`), and the extension
67
+ * puts them together again (`NativeParts`).
68
+ */
69
+ export declare const NATIVE_PART_CHARS: number;
70
+ /** Browsers the extension runs in, by their product. */
71
+ export declare const BROWSER_PRODUCTS: readonly ["chrome", "edge", "brave", "arc", "opera", "vivaldi", "chromium"];
72
+ export declare const BrowserProductSchema: z.ZodUnion<readonly [z.ZodEnum<{
73
+ chrome: "chrome";
74
+ edge: "edge";
75
+ brave: "brave";
76
+ arc: "arc";
77
+ opera: "opera";
78
+ vivaldi: "vivaldi";
79
+ chromium: "chromium";
80
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
81
+ export type BrowserProduct = z.infer<typeof BrowserProductSchema>;
82
+ /** How a browser is called to a person. */
83
+ export declare const BROWSER_PRODUCT_NAMES: Record<(typeof BROWSER_PRODUCTS)[number], string>;
84
+ /** A browser's name for a person: its product's, or the word itself for one this version does not know. */
85
+ export declare const browserName: (product: string) => string;
86
+ /** The extension says who it is, first, on every connection. */
87
+ export declare const BridgeHelloSchema: z.ZodObject<{
88
+ protocol: z.ZodInt;
89
+ extension: z.ZodObject<{
90
+ id: z.ZodString;
91
+ version: z.ZodString;
92
+ }, z.core.$strip>;
93
+ browser: z.ZodObject<{
94
+ id: z.ZodString;
95
+ product: z.ZodUnion<readonly [z.ZodEnum<{
96
+ chrome: "chrome";
97
+ edge: "edge";
98
+ brave: "brave";
99
+ arc: "arc";
100
+ opera: "opera";
101
+ vivaldi: "vivaldi";
102
+ chromium: "chromium";
103
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
104
+ version: z.ZodString;
105
+ userAgent: z.ZodString;
106
+ }, z.core.$strip>;
107
+ }, z.core.$strip>;
108
+ export type BridgeHello = z.infer<typeof BridgeHelloSchema>;
109
+ /** The Host's answer: who it is, so the extension can name it. */
110
+ export declare const BridgeWelcomeSchema: z.ZodObject<{
111
+ protocol: z.ZodInt;
112
+ host: z.ZodObject<{
113
+ name: z.ZodString;
114
+ remote: z.ZodBoolean;
115
+ }, z.core.$strip>;
116
+ }, z.core.$strip>;
117
+ export type BridgeWelcome = z.infer<typeof BridgeWelcomeSchema>;
118
+ /** A tab, as `chrome.tabs` describes it, and only what the Host uses. */
119
+ export declare const BridgeTabSchema: z.ZodObject<{
120
+ tabId: z.ZodInt;
121
+ windowId: z.ZodOptional<z.ZodInt>;
122
+ url: z.ZodOptional<z.ZodString>;
123
+ title: z.ZodOptional<z.ZodString>;
124
+ openerTabId: z.ZodOptional<z.ZodInt>;
125
+ active: z.ZodOptional<z.ZodBoolean>;
126
+ status: z.ZodOptional<z.ZodString>;
127
+ }, z.core.$strip>;
128
+ export type BridgeTab = z.infer<typeof BridgeTabSchema>;
129
+ /**
130
+ * A group of the agent's tabs: a Chrome tab group per project, named for
131
+ * it. `key` is the Host's, the same for the same project.
132
+ */
133
+ export declare const BridgeGroupSchema: z.ZodObject<{
134
+ key: z.ZodString;
135
+ title: z.ZodString;
136
+ }, z.core.$strip>;
137
+ export type BridgeGroup = z.infer<typeof BridgeGroupSchema>;
138
+ /** Why Chrome let go of a tab (`chrome.debugger.onDetach`'s reasons, and the extension's own). */
139
+ export declare const DETACH_REASONS: readonly ["target_closed", "canceled_by_user", "not_allowed", "released"];
140
+ export declare const DetachReasonSchema: z.ZodUnion<readonly [z.ZodEnum<{
141
+ target_closed: "target_closed";
142
+ canceled_by_user: "canceled_by_user";
143
+ not_allowed: "not_allowed";
144
+ released: "released";
145
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
146
+ /** A CDP command for a tab: the tab's own session, or a child's (a frame in another process, a worker). */
147
+ export declare const BridgeCdpSchema: z.ZodObject<{
148
+ tabId: z.ZodInt;
149
+ sessionId: z.ZodOptional<z.ZodString>;
150
+ method: z.ZodString;
151
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
152
+ }, z.core.$strip>;
153
+ /** What the Host asks of the extension. */
154
+ export declare const BRIDGE_EXTENSION_METHODS: {
155
+ readonly "tabs/create": import("./jsonrpc.js").MethodSpec<z.ZodObject<{
156
+ group: z.ZodObject<{
157
+ key: z.ZodString;
158
+ title: z.ZodString;
159
+ }, z.core.$strip>;
160
+ url: z.ZodOptional<z.ZodString>;
161
+ }, z.core.$strip>, z.ZodObject<{
162
+ tabId: z.ZodInt;
163
+ windowId: z.ZodOptional<z.ZodInt>;
164
+ url: z.ZodOptional<z.ZodString>;
165
+ title: z.ZodOptional<z.ZodString>;
166
+ openerTabId: z.ZodOptional<z.ZodInt>;
167
+ active: z.ZodOptional<z.ZodBoolean>;
168
+ status: z.ZodOptional<z.ZodString>;
169
+ }, z.core.$strip>>;
170
+ readonly "tabs/close": import("./jsonrpc.js").MethodSpec<z.ZodObject<{
171
+ tabId: z.ZodInt;
172
+ }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>;
173
+ readonly "tabs/activate": import("./jsonrpc.js").MethodSpec<z.ZodObject<{
174
+ tabId: z.ZodInt;
175
+ }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>;
176
+ readonly "debugger/attach": import("./jsonrpc.js").MethodSpec<z.ZodObject<{
177
+ tabId: z.ZodInt;
178
+ group: z.ZodObject<{
179
+ key: z.ZodString;
180
+ title: z.ZodString;
181
+ }, z.core.$strip>;
182
+ }, z.core.$strip>, z.ZodObject<{
183
+ targetInfo: z.ZodRecord<z.ZodString, z.ZodUnknown>;
184
+ }, z.core.$strip>>;
185
+ readonly "debugger/detach": import("./jsonrpc.js").MethodSpec<z.ZodObject<{
186
+ tabId: z.ZodInt;
187
+ }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>;
188
+ readonly "debugger/send": import("./jsonrpc.js").MethodSpec<z.ZodObject<{
189
+ tabId: z.ZodInt;
190
+ sessionId: z.ZodOptional<z.ZodString>;
191
+ method: z.ZodString;
192
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
193
+ }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>>;
194
+ readonly "groups/release": import("./jsonrpc.js").MethodSpec<z.ZodObject<{
195
+ key: z.ZodString;
196
+ }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>;
197
+ };
198
+ /** What the extension asks of the Host. */
199
+ export declare const BRIDGE_HOST_METHODS: {
200
+ readonly "bridge/hello": import("./jsonrpc.js").MethodSpec<z.ZodObject<{
201
+ protocol: z.ZodInt;
202
+ extension: z.ZodObject<{
203
+ id: z.ZodString;
204
+ version: z.ZodString;
205
+ }, z.core.$strip>;
206
+ browser: z.ZodObject<{
207
+ id: z.ZodString;
208
+ product: z.ZodUnion<readonly [z.ZodEnum<{
209
+ chrome: "chrome";
210
+ edge: "edge";
211
+ brave: "brave";
212
+ arc: "arc";
213
+ opera: "opera";
214
+ vivaldi: "vivaldi";
215
+ chromium: "chromium";
216
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
217
+ version: z.ZodString;
218
+ userAgent: z.ZodString;
219
+ }, z.core.$strip>;
220
+ }, z.core.$strip>, z.ZodObject<{
221
+ protocol: z.ZodInt;
222
+ host: z.ZodObject<{
223
+ name: z.ZodString;
224
+ remote: z.ZodBoolean;
225
+ }, z.core.$strip>;
226
+ }, z.core.$strip>>;
227
+ };
228
+ /** What the extension tells the Host. */
229
+ export declare const BRIDGE_HOST_NOTIFICATIONS: {
230
+ readonly "tabs/added": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{
231
+ key: z.ZodString;
232
+ tab: z.ZodObject<{
233
+ tabId: z.ZodInt;
234
+ windowId: z.ZodOptional<z.ZodInt>;
235
+ url: z.ZodOptional<z.ZodString>;
236
+ title: z.ZodOptional<z.ZodString>;
237
+ openerTabId: z.ZodOptional<z.ZodInt>;
238
+ active: z.ZodOptional<z.ZodBoolean>;
239
+ status: z.ZodOptional<z.ZodString>;
240
+ }, z.core.$strip>;
241
+ }, z.core.$strip>>;
242
+ readonly "tabs/updated": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{
243
+ tab: z.ZodObject<{
244
+ tabId: z.ZodInt;
245
+ windowId: z.ZodOptional<z.ZodInt>;
246
+ url: z.ZodOptional<z.ZodString>;
247
+ title: z.ZodOptional<z.ZodString>;
248
+ openerTabId: z.ZodOptional<z.ZodInt>;
249
+ active: z.ZodOptional<z.ZodBoolean>;
250
+ status: z.ZodOptional<z.ZodString>;
251
+ }, z.core.$strip>;
252
+ }, z.core.$strip>>;
253
+ readonly "tabs/removed": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{
254
+ tabId: z.ZodInt;
255
+ }, z.core.$strip>>;
256
+ readonly "debugger/event": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{
257
+ tabId: z.ZodInt;
258
+ sessionId: z.ZodOptional<z.ZodString>;
259
+ method: z.ZodString;
260
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
261
+ }, z.core.$strip>>;
262
+ readonly "debugger/detached": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{
263
+ tabId: z.ZodInt;
264
+ reason: z.ZodUnion<readonly [z.ZodEnum<{
265
+ target_closed: "target_closed";
266
+ canceled_by_user: "canceled_by_user";
267
+ not_allowed: "not_allowed";
268
+ released: "released";
269
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
270
+ }, z.core.$strip>>;
271
+ readonly "bridge/stopped": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{}, z.core.$strip>>;
272
+ readonly "bridge/ping": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{}, z.core.$strip>>;
273
+ };
274
+ /** Why a CDP command is refused, or undefined when it is relayed. */
275
+ export declare function refusedCdp(cdpMethod: string): string | undefined;
276
+ /** Pages no agent may use: the browser's own, other extensions', the store. */
277
+ export declare function usableUrl(url: string | undefined): boolean;
278
+ /** One part of a message too large for native messaging. */
279
+ export declare const NativePartSchema: z.ZodObject<{
280
+ part: z.ZodObject<{
281
+ id: z.ZodInt;
282
+ index: z.ZodInt;
283
+ count: z.ZodInt;
284
+ text: z.ZodString;
285
+ }, z.core.$strip>;
286
+ }, z.core.$strip>;
287
+ /** A message as native messaging carries it to the extension: whole, or in parts. */
288
+ export declare function splitNative(text: string, nextId: () => number, max?: number): string[];
289
+ /** Puts a message sent in parts together again: undefined until its last part. */
290
+ export declare class NativeParts {
291
+ private readonly pending;
292
+ /** A message received: itself when whole, its text once its last part came, or undefined. */
293
+ take(message: unknown): unknown;
294
+ }
295
+ /** An error the other end answered with. */
296
+ export declare class BridgeError extends Error {
297
+ readonly code: number;
298
+ constructor(code: number, message: string);
299
+ }
300
+ export interface BridgePeerOptions {
301
+ /** Sends one message to the other end. */
302
+ send(message: unknown): void;
303
+ /** Answers a request: its result, or throws (a `BridgeError` keeps its code). */
304
+ request?(method: string, params: unknown): Promise<unknown>;
305
+ /** Hears a notification. */
306
+ notify?(method: string, params: unknown): void;
307
+ /** How long a request waits for its answer, by method; default 30 s. */
308
+ timeoutMs?(method: string): number;
309
+ }
310
+ /**
311
+ * One end of the bridge: requests both ways, notifications both ways, over
312
+ * any transport that carries a message at a time. An answer is handed to
313
+ * its caller as it arrives, before any message after it is read, so a CDP
314
+ * client sees a command's answer and the events after it in Chrome's
315
+ * order (Browser MCP's ordering fix).
316
+ */
317
+ export declare class BridgePeer {
318
+ private readonly o;
319
+ private readonly pending;
320
+ private next;
321
+ private closed;
322
+ constructor(options: BridgePeerOptions);
323
+ request(method: string, params: unknown): Promise<unknown>;
324
+ /**
325
+ * A request whose answer is handed to `done` as it is read, before any
326
+ * message after it: what a relay uses to keep a command's answer ahead
327
+ * of the events Chrome sent after it.
328
+ */
329
+ call(method: string, params: unknown, done: (error: Error | undefined, result: unknown) => void): void;
330
+ notify(method: string, params: unknown): void;
331
+ /** A message from the other end. */
332
+ receive(message: unknown): void;
333
+ /** The transport ended: every request waiting fails. */
334
+ close(reason: string): void;
335
+ get isClosed(): boolean;
336
+ }
337
+ //# sourceMappingURL=browser-bridge.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{z as e}from"zod";import{method as d,notification as g}from"./jsonrpc.js";import{known as b,openEnum as l}from"./open.js";export const BRIDGE_PROTOCOL=1,BRIDGE_NATIVE_HOST="com.allyhub.browser",PERSON_BROWSER="person",BRIDGE_PATH="/browser",BRIDGE_EXTENSION_IDS={store:"pmckbhaedjblcbkbkcbmmogpealiaeol",development:"dbmenjkebdgjkhjdcicplkaakmjcjhdp"},BRIDGE_STORE_URL=`https://chromewebstore.google.com/detail/${BRIDGE_EXTENSION_IDS.store}`,BRIDGE_EXTENSION_ORIGINS=Object.values(BRIDGE_EXTENSION_IDS).map(r=>`chrome-extension://${r}`),BRIDGE_WINDOW_ORIGINS=["https://app.allyhub.com","https://app.allyhub-staging.com"],BRIDGE_STUDIO_DOMAINS=["allyhub.studio","allyhub-studio-staging.com"],BridgeWindowMessageSchema=e.discriminatedUnion("type",[e.object({type:e.literal("allyhub/bridge/status")}),e.object({type:e.literal("allyhub/bridge/connect"),url:e.string()})]),BridgeWindowAnswerSchema=e.object({version:e.string(),connected:e.array(e.string()),error:e.string().optional()});export function bridgeTarget(r,o){let t;try{t=new URL(r)}catch{return}if(t.username!==""||t.password!==""||t.pathname!==BRIDGE_PATH||t.hash!=="")return;const n=t.protocol.toLowerCase(),s=t.hostname.toLowerCase();if(n==="wss:"&&BRIDGE_STUDIO_DOMAINS.some(a=>s.endsWith(`.${a}`))||o&&(n==="ws:"||n==="wss:")&&(s==="127.0.0.1"||s==="localhost"||s.endsWith(".localhost")))return t}export const NATIVE_PART_CHARS=128*1024,BROWSER_PRODUCTS=["chrome","edge","brave","arc","opera","vivaldi","chromium"],BrowserProductSchema=l(BROWSER_PRODUCTS),BROWSER_PRODUCT_NAMES={chrome:"Google Chrome",edge:"Microsoft Edge",brave:"Brave",arc:"Arc",opera:"Opera",vivaldi:"Vivaldi",chromium:"Chromium"},browserName=r=>b(BROWSER_PRODUCTS,r)?BROWSER_PRODUCT_NAMES[r]:r,BridgeHelloSchema=e.object({protocol:e.int().min(1),extension:e.object({id:e.string(),version:e.string()}),browser:e.object({id:e.string().min(1).max(100),product:BrowserProductSchema,version:e.string(),userAgent:e.string()})}),BridgeWelcomeSchema=e.object({protocol:e.int().min(1),host:e.object({name:e.string(),remote:e.boolean()})}),BridgeTabSchema=e.object({tabId:e.int(),windowId:e.int().optional(),url:e.string().optional(),title:e.string().optional(),openerTabId:e.int().optional(),active:e.boolean().optional(),status:e.string().optional()}),BridgeGroupSchema=e.object({key:e.string().min(1).max(200),title:e.string().min(1).max(80)}),DETACH_REASONS=["target_closed","canceled_by_user","not_allowed","released"],DetachReasonSchema=l(DETACH_REASONS),BridgeCdpSchema=e.object({tabId:e.int(),sessionId:e.string().optional(),method:e.string().min(1),params:e.record(e.string(),e.unknown()).optional()});const p=e.object({});export const BRIDGE_EXTENSION_METHODS={"tabs/create":d(e.object({group:BridgeGroupSchema,url:e.string().optional()}),BridgeTabSchema,"Opens a tab in the background, in the group, and attaches the debugger to it."),"tabs/close":d(e.object({tabId:e.int()}),p,"Closes a tab."),"tabs/activate":d(e.object({tabId:e.int()}),p,"Shows a tab to the person (a handoff: something only they can do)."),"debugger/attach":d(e.object({tabId:e.int(),group:BridgeGroupSchema}),e.object({targetInfo:e.record(e.string(),e.unknown())}),"Attaches the debugger to a tab and keeps it in the group: its Target.getTargetInfo."),"debugger/detach":d(e.object({tabId:e.int()}),p,"Lets go of a tab; it stays open, in its group."),"debugger/send":d(BridgeCdpSchema,e.record(e.string(),e.unknown()),"Sends a CDP command to an attached tab, refused when it reaches past the tab."),"groups/release":d(e.object({key:e.string()}),p,"Lets go of every tab of a group and ungroups them; they stay open for the person.")},BRIDGE_HOST_METHODS={"bridge/hello":d(BridgeHelloSchema,BridgeWelcomeSchema,"The extension says who it is; the Host who it is.")},BRIDGE_HOST_NOTIFICATIONS={"tabs/added":g(e.object({key:e.string(),tab:BridgeTabSchema}),"A tab joined a group: the person dragged it in, or one of the group's pages opened it."),"tabs/updated":g(e.object({tab:BridgeTabSchema}),"A tab of a group changed: its address, title or loading."),"tabs/removed":g(e.object({tabId:e.int()}),"A tab of a group closed or left it."),"debugger/event":g(BridgeCdpSchema,"A CDP event from an attached tab."),"debugger/detached":g(e.object({tabId:e.int(),reason:DetachReasonSchema}),"Chrome let go of a tab, or the extension did."),"bridge/stopped":g(e.object({}),"The person stopped the agents (Cancel on Chrome's debugging bar): every tab was let go."),"bridge/ping":g(e.object({}),"Keeps a WebSocket, and so the extension's service worker, alive.")};const m=new Set(["Network.getAllCookies","Network.getCookies","Network.setCookie","Network.setCookies","Network.deleteCookies","Network.clearBrowserCookies","Network.clearBrowserCache","Network.loadNetworkResource","Page.setDownloadBehavior","Security.setIgnoreCertificateErrors","Target.attachToTarget","Target.attachToBrowserTarget","Target.activateTarget","Target.closeTarget","Target.createTarget","Target.createBrowserContext","Target.disposeBrowserContext","Target.exposeDevToolsProtocol","Target.getTargets","Target.sendMessageToTarget","Target.setDiscoverTargets","Target.setRemoteLocations"]),f=new Set(["Storage","IndexedDB","CacheStorage","DOMStorage","Browser","SystemInfo"]);export function refusedCdp(r){const o=r.split(".")[0]??"";if(m.has(r)||f.has(o))return`AllyHub's extension does not allow ${r} in the person's browser: it reaches past the tab (other sites, other tabs, or the browser itself).`}export function usableUrl(r){if(r===void 0||r===""||r==="about:blank")return!0;const o=/^https?:\/\/(?:[^@/?#]*@)?(\[[^\]]*\]|[^:/?#]+)(?::\d*)?([^?#]*)/iu.exec(r);if(!o)return!1;const t=(o[1]??"").toLowerCase(),n=o[2]===void 0||o[2]===""?"/":o[2];return!w.some(s=>t===s.host&&n.startsWith(s.path))}const w=[{host:"chromewebstore.google.com",path:"/"},{host:"chrome.google.com",path:"/webstore"},{host:"microsoftedge.microsoft.com",path:"/addons"}];export const NativePartSchema=e.object({part:e.object({id:e.int(),index:e.int().min(0),count:e.int().min(1),text:e.string()})});export function splitNative(r,o,t=NATIVE_PART_CHARS){if(r.length<=t)return[r];const n=o(),s=Math.ceil(r.length/t),a=[];for(let i=0;i<s;i++)a.push(JSON.stringify({part:{id:n,index:i,count:s,text:r.slice(i*t,(i+1)*t)}}));return a}export class NativeParts{pending=new Map;take(o){const t=NativePartSchema.safeParse(o);if(!t.success)return o;const{id:n,index:s,count:a,text:i}=t.data.part;let c=this.pending.get(n);if(c||(c=[],this.pending.set(n,c)),c[s]=i,!(c.filter(u=>typeof u=="string").length<a))return this.pending.delete(n),JSON.parse(c.join(""))}}export class BridgeError extends Error{code;constructor(o,t){super(t),this.name="BridgeError",this.code=o}}const h=globalThis;export class BridgePeer{o;pending=new Map;next=1;closed;constructor(o){this.o=o}request(o,t){return new Promise((n,s)=>{this.call(o,t,(a,i)=>{a?s(a):n(i)})})}call(o,t,n){if(this.closed){n(this.closed,void 0);return}const s=this.next++,a=this.o.timeoutMs?.(o)??3e4,i=h.setTimeout(()=>{this.pending.delete(s),n(new BridgeError(-32005,`${o} had no answer in ${String(a/1e3)} s.`),void 0)},a);this.pending.set(s,{method:o,done:n,timer:i});try{this.o.send({jsonrpc:"2.0",id:s,method:o,params:t})}catch(c){h.clearTimeout(i),this.pending.delete(s),n(c instanceof Error?c:new Error(String(c)),void 0)}}notify(o,t){this.closed||this.o.send({jsonrpc:"2.0",method:o,params:t})}receive(o){if(typeof o!="object"||o===null)return;const t=o;if(typeof t.method=="string"){if(typeof t.id=="number"||typeof t.id=="string"){const s=t.id;(this.o.request?this.o.request(t.method,t.params??{}):Promise.reject(new BridgeError(-32601,`There is no method "${t.method}".`))).then(i=>{this.closed||this.o.send({jsonrpc:"2.0",id:s,result:i??{}})},i=>{this.closed||this.o.send({jsonrpc:"2.0",id:s,error:{code:i instanceof BridgeError?i.code:-32603,message:i instanceof Error?i.message:String(i)}})})}else this.o.notify?.(t.method,t.params??{});return}if(typeof t.id!="number")return;const n=this.pending.get(t.id);n&&(this.pending.delete(t.id),h.clearTimeout(n.timer),t.error!==void 0?n.done(new BridgeError(typeof t.error.code=="number"?t.error.code:-32603,typeof t.error.message=="string"?t.error.message:n.method),void 0):n.done(void 0,t.result))}close(o){if(!this.closed){this.closed=new BridgeError(-32005,o);for(const t of this.pending.values())h.clearTimeout(t.timer),t.done(this.closed,void 0);this.pending.clear()}}get isClosed(){return this.closed!==void 0}}
@@ -43,7 +43,7 @@ export interface CommandSpec<I extends z.ZodObject = z.ZodObject, O extends z.Zo
43
43
  }
44
44
  /** A command's spec, checked: its name's form, and that each positional is a field. */
45
45
  export declare function command<I extends z.ZodObject, O extends z.ZodType>(spec: CommandSpec<I, O>): CommandSpec<I, O>;
46
- /** A command as data: what `allyhub help --json` and an MCP tool listing give. */
46
+ /** A command as data: what `allyhub help --json` gives. */
47
47
  export declare function describeCommand(spec: CommandSpec): {
48
48
  name: string;
49
49
  summary: string;
@@ -52,4 +52,15 @@ export declare function describeCommand(spec: CommandSpec): {
52
52
  output: Record<string, unknown>;
53
53
  examples: string[];
54
54
  };
55
+ /** A failure a command reports: a stable code, what happened, what to do, and how it exits. */
56
+ export declare class CommandError extends Error {
57
+ readonly code: string;
58
+ readonly hint: string | undefined;
59
+ readonly exit: ExitCode;
60
+ constructor(code: string, message: string, options?: {
61
+ hint?: string;
62
+ exit?: ExitCode;
63
+ cause?: unknown;
64
+ });
65
+ }
55
66
  //# sourceMappingURL=cli.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{z as o}from"zod";export const EXIT={ok:0,failed:1,usage:2,conflict:3,auth:4,platform:5,notFound:6,interrupted:130},CliErrorSchema=o.strictObject({error:o.strictObject({code:o.string().regex(/^[a-z][a-z0-9-]*$/u),message:o.string().min(1),hint:o.string().optional()})}),COMMAND_NAME=/^[a-z0-9][a-z0-9-]*(?: [a-z0-9][a-z0-9-]*)*$/u;export function command(t){if(!COMMAND_NAME.test(t.name))throw new Error(`"${t.name}" is not a command name.`);const e=Object.keys(t.input.shape);for(const n of t.positional??[])if(!e.includes(n))throw new Error(`${t.name}: positional "${n}" is not a field of its input.`);for(const[n,r]of Object.entries(t.input.shape))if(!r.description)throw new Error(`${t.name}: "${n}" has no description.`);return t}export function describeCommand(t){return{name:t.name,summary:t.summary,positional:[...t.positional??[]],input:o.toJSONSchema(t.input,{io:"input",unrepresentable:"any"}),output:o.toJSONSchema(t.output,{io:"output",unrepresentable:"any"}),examples:[...t.examples??[]]}}
2
+ import{z as e}from"zod";export const EXIT={ok:0,failed:1,usage:2,conflict:3,auth:4,platform:5,notFound:6,interrupted:130},CliErrorSchema=e.strictObject({error:e.strictObject({code:e.string().regex(/^[a-z][a-z0-9-]*$/u),message:e.string().min(1),hint:e.string().optional()})}),COMMAND_NAME=/^[a-z0-9][a-z0-9-]*(?: [a-z0-9][a-z0-9-]*)*$/u;export function command(t){if(!COMMAND_NAME.test(t.name))throw new Error(`"${t.name}" is not a command name.`);const r=Object.keys(t.input.shape);for(const n of t.positional??[])if(!r.includes(n))throw new Error(`${t.name}: positional "${n}" is not a field of its input.`);for(const[n,o]of Object.entries(t.input.shape))if(!o.description)throw new Error(`${t.name}: "${n}" has no description.`);return t}export function describeCommand(t){return{name:t.name,summary:t.summary,positional:[...t.positional??[]],input:e.toJSONSchema(t.input,{io:"input",unrepresentable:"any"}),output:e.toJSONSchema(t.output,{io:"output",unrepresentable:"any"}),examples:[...t.examples??[]]}}export class CommandError extends Error{code;hint;exit;constructor(r,n,o={}){super(n,o.cause===void 0?void 0:{cause:o.cause}),this.name="CommandError",this.code=r,this.hint=o.hint,this.exit=o.exit??EXIT.failed}}
@@ -104,6 +104,29 @@ export declare const BillingUsageSchema: z.ZodObject<{
104
104
  }, z.core.$strip>>;
105
105
  }, z.core.$strip>;
106
106
  export type BillingUsage = z.infer<typeof BillingUsageSchema>;
107
+ /**
108
+ * `GET ?days=30&limit=500`: each spend of the last days, the latest first:
109
+ * an owner or an admin reads the team's, a member their own. `more` when
110
+ * there were more than `limit`.
111
+ */
112
+ export declare const BILLING_SPENDS_PATH = "/api/billing/spends";
113
+ export declare const BillingSpendsSchema: z.ZodObject<{
114
+ spends: z.ZodArray<z.ZodObject<{
115
+ at: z.ZodString;
116
+ kind: z.ZodUnion<readonly [z.ZodEnum<{
117
+ models: "models";
118
+ tools: "tools";
119
+ studio: "studio";
120
+ other: "other";
121
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
122
+ what: z.ZodNullable<z.ZodString>;
123
+ seconds: z.ZodNullable<z.ZodNumber>;
124
+ member: z.ZodNullable<z.ZodString>;
125
+ credits: z.ZodNumber;
126
+ }, z.core.$strip>>;
127
+ more: z.ZodBoolean;
128
+ }, z.core.$strip>;
129
+ export type BillingSpends = z.infer<typeof BillingSpendsSchema>;
107
130
  /** `POST`, an owner's or an admin's: Stripe Checkout for a plan or a top-up; answers `{ url }`. */
108
131
  export declare const BILLING_CHECKOUT_PATH = "/api/billing/checkout";
109
132
  export declare const CheckoutRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
@@ -150,6 +173,25 @@ export declare const BillingPaymentSchema: z.ZodObject<{
150
173
  email: z.ZodNullable<z.ZodString>;
151
174
  }, z.core.$strip>;
152
175
  export type BillingPayment = z.infer<typeof BillingPaymentSchema>;
176
+ /** `GET`, an owner's or an admin's: the organization's invoices, the latest first (Stripe's, with their PDFs). */
177
+ export declare const BILLING_INVOICES_PATH = "/api/billing/invoices";
178
+ export declare const BillingInvoicesSchema: z.ZodObject<{
179
+ invoices: z.ZodArray<z.ZodObject<{
180
+ id: z.ZodString;
181
+ number: z.ZodNullable<z.ZodString>;
182
+ createdAt: z.ZodString;
183
+ kind: z.ZodUnion<readonly [z.ZodEnum<{
184
+ credits: "credits";
185
+ plan: "plan";
186
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
187
+ totalCents: z.ZodNumber;
188
+ currency: z.ZodString;
189
+ status: z.ZodString;
190
+ pdf: z.ZodNullable<z.ZodString>;
191
+ url: z.ZodNullable<z.ZodString>;
192
+ }, z.core.$strip>>;
193
+ }, z.core.$strip>;
194
+ export type BillingInvoices = z.infer<typeof BillingInvoicesSchema>;
153
195
  /** `POST { topUpCents }`, an owner's or an admin's: credits bought with the saved card at once; answers `{ credits }`, what was added. */
154
196
  export declare const BILLING_TOP_UP_PATH = "/api/billing/top-up";
155
197
  export declare const TopUpRequestSchema: z.ZodObject<{
@@ -222,10 +264,21 @@ export type ModelCatalog = z.infer<typeof ModelCatalogSchema>;
222
264
  /** A JSON Schema document of a tool's input or output. */
223
265
  export declare const JsonSchemaSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
224
266
  export declare const CATALOG_PATH = "/api/catalog";
267
+ /** The units the console lists a tool's price in. */
268
+ export declare const PRICE_UNITS: readonly ["call", "result", "page", "second", "minute", "thousand_characters", "image", "frame", "megapixel", "question", "phrase"];
269
+ /** The console's sections of AI tools; a data work's tools are research. */
270
+ export declare const TOOL_SECTIONS: readonly ["video", "image", "voice", "music"];
271
+ /** What a work is, for the console's capabilities: data from many sources (switched as one), or AI models (each tool switched on its own). */
272
+ export declare const WORK_KINDS: readonly ["data", "ai"];
225
273
  export declare const CatalogWorkSchema: z.ZodObject<{
226
274
  id: z.ZodString;
227
275
  title: z.ZodString;
228
276
  description: z.ZodString;
277
+ kind: z.ZodDefault<z.ZodUnion<readonly [z.ZodEnum<{
278
+ data: "data";
279
+ ai: "ai";
280
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>>;
281
+ line: z.ZodOptional<z.ZodString>;
229
282
  }, z.core.$strip>;
230
283
  export type CatalogWork = z.infer<typeof CatalogWorkSchema>;
231
284
  export declare const CatalogToolSchema: z.ZodObject<{
@@ -236,6 +289,34 @@ export declare const CatalogToolSchema: z.ZodObject<{
236
289
  input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
237
290
  output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
238
291
  long: z.ZodBoolean;
292
+ example: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
293
+ price: z.ZodOptional<z.ZodObject<{
294
+ credits: z.ZodNumber;
295
+ per: z.ZodUnion<readonly [z.ZodEnum<{
296
+ call: "call";
297
+ result: "result";
298
+ page: "page";
299
+ second: "second";
300
+ minute: "minute";
301
+ thousand_characters: "thousand_characters";
302
+ image: "image";
303
+ frame: "frame";
304
+ megapixel: "megapixel";
305
+ question: "question";
306
+ phrase: "phrase";
307
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
308
+ varies: z.ZodBoolean;
309
+ }, z.core.$strip>>;
310
+ shown: z.ZodOptional<z.ZodObject<{
311
+ name: z.ZodString;
312
+ line: z.ZodString;
313
+ section: z.ZodUnion<readonly [z.ZodEnum<{
314
+ image: "image";
315
+ video: "video";
316
+ voice: "voice";
317
+ music: "music";
318
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
319
+ }, z.core.$strip>>;
239
320
  }, z.core.$strip>;
240
321
  export type CatalogTool = z.infer<typeof CatalogToolSchema>;
241
322
  export declare const CatalogSchema: z.ZodObject<{
@@ -244,6 +325,11 @@ export declare const CatalogSchema: z.ZodObject<{
244
325
  id: z.ZodString;
245
326
  title: z.ZodString;
246
327
  description: z.ZodString;
328
+ kind: z.ZodDefault<z.ZodUnion<readonly [z.ZodEnum<{
329
+ data: "data";
330
+ ai: "ai";
331
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>>;
332
+ line: z.ZodOptional<z.ZodString>;
247
333
  }, z.core.$strip>>;
248
334
  tools: z.ZodArray<z.ZodObject<{
249
335
  name: z.ZodString;
@@ -253,9 +339,78 @@ export declare const CatalogSchema: z.ZodObject<{
253
339
  input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
254
340
  output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
255
341
  long: z.ZodBoolean;
342
+ example: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
343
+ price: z.ZodOptional<z.ZodObject<{
344
+ credits: z.ZodNumber;
345
+ per: z.ZodUnion<readonly [z.ZodEnum<{
346
+ call: "call";
347
+ result: "result";
348
+ page: "page";
349
+ second: "second";
350
+ minute: "minute";
351
+ thousand_characters: "thousand_characters";
352
+ image: "image";
353
+ frame: "frame";
354
+ megapixel: "megapixel";
355
+ question: "question";
356
+ phrase: "phrase";
357
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
358
+ varies: z.ZodBoolean;
359
+ }, z.core.$strip>>;
360
+ shown: z.ZodOptional<z.ZodObject<{
361
+ name: z.ZodString;
362
+ line: z.ZodString;
363
+ section: z.ZodUnion<readonly [z.ZodEnum<{
364
+ image: "image";
365
+ video: "video";
366
+ voice: "voice";
367
+ music: "music";
368
+ }>, z.core.$ZodBranded<z.ZodString, "Unknown", "out">]>;
369
+ }, z.core.$strip>>;
256
370
  }, z.core.$strip>>;
257
371
  }, z.core.$strip>;
258
372
  export type Catalog = z.infer<typeof CatalogSchema>;
373
+ /**
374
+ * `GET`: the cloud tools the organization turned off, anyone in it reads;
375
+ * `PUT { work, on }` or `PUT { tool, on }`, an owner's or an admin's: one
376
+ * switched, answering what is off now. A data work is switched as one
377
+ * (its tools added later too), an AI work's tools each on its own. A
378
+ * tool turned off is refused to every call in the organization (403
379
+ * `tool_off`): the CLI's, Studio's, an agent's.
380
+ */
381
+ export declare const CAPABILITIES_PATH = "/api/capabilities";
382
+ export declare const CapabilitiesSchema: z.ZodObject<{
383
+ off: z.ZodObject<{
384
+ works: z.ZodArray<z.ZodString>;
385
+ tools: z.ZodArray<z.ZodString>;
386
+ }, z.core.$strip>;
387
+ }, z.core.$strip>;
388
+ export type Capabilities = z.infer<typeof CapabilitiesSchema>;
389
+ export declare const CapabilityRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
390
+ work: z.ZodString;
391
+ on: z.ZodBoolean;
392
+ }, z.core.$strict>, z.ZodObject<{
393
+ tool: z.ZodString;
394
+ on: z.ZodBoolean;
395
+ }, z.core.$strict>]>;
396
+ export type CapabilityRequest = z.infer<typeof CapabilityRequestSchema>;
397
+ /**
398
+ * `GET`: the editors the console lists, free in every product: each kind
399
+ * the built-in extensions contribute with how the console shows it, in its
400
+ * order; open to anyone.
401
+ */
402
+ export declare const EDITORS_PATH = "/api/editors";
403
+ export declare const EditorsSchema: z.ZodObject<{
404
+ editors: z.ZodArray<z.ZodObject<{
405
+ id: z.ZodString;
406
+ name: z.ZodRecord<z.ZodString, z.ZodString>;
407
+ plural: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
408
+ line: z.ZodRecord<z.ZodString, z.ZodString>;
409
+ icon: z.ZodOptional<z.ZodString>;
410
+ color: z.ZodOptional<z.ZodString>;
411
+ }, z.core.$strip>>;
412
+ }, z.core.$strip>;
413
+ export type Editors = z.infer<typeof EditorsSchema>;
259
414
  /** Where a tool's calls are made (POST). */
260
415
  export declare const toolCallsPath: (tool: string) => string;
261
416
  /** Where a call is read again (GET). */
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{z as t}from"zod";import{openEnum as o}from"./open.js";export const API_KEY_ENV="ALLYHUB_API_KEY",BILLING_SUMMARY_PATH="/api/billing/summary",AUTO_TOP_UP_STOPS=["no_card","saving_card","not_a_card","declined","needs_authentication","not_charged","under_line","refunded","disputed","monthly_limit"],BILLING_INTERVALS=["month","year"],BillingSummarySchema=t.object({credits:t.number(),held:t.number(),owed:t.number(),frozen:t.string().nullable().default(null),plan:t.object({id:t.string(),name:t.string(),interval:o(BILLING_INTERVALS),status:t.string(),renewsAt:t.iso.datetime().nullable(),endsAt:t.iso.datetime().nullable(),monthlyCredits:t.number().default(0),price:t.object({amountCents:t.number(),currency:t.string()}).nullable().default(null)}).nullable(),allowance:t.object({total:t.number(),used:t.number(),renewsAt:t.iso.datetime()}).nullable().default(null),bought:t.number().default(0),customer:t.boolean().default(!1),autoTopUp:t.object({below:t.number(),amountCents:t.number(),monthlyLimitCents:t.number().nullable().default(null),chargedThisMonthCents:t.number().default(0),stopped:o(AUTO_TOP_UP_STOPS).nullable()}).nullable()}),BILLING_PLANS_PATH="/api/billing/plans",BillingPlansSchema=t.object({plans:t.array(t.object({id:t.string(),name:t.string(),family:t.string().nullable().default(null),recommended:t.boolean().default(!1),monthlyCredits:t.number(),prices:t.array(t.object({interval:o(BILLING_INTERVALS),amountCents:t.number(),currency:t.string()}))})),topUp:t.object({currency:t.string(),creditsPerDollar:t.number(),minCents:t.number(),maxCents:t.number(),presetsCents:t.array(t.number()).default([])}),welcomeCredits:t.number().optional()}),BILLING_USAGE_PATH="/api/billing/usage",SPEND_KINDS=["models","tools","studio","other"],BillingUsageSchema=t.object({days:t.array(t.object({day:t.iso.date(),credits:t.number(),byKind:t.record(t.string(),t.number()).default({})}))}),BILLING_CHECKOUT_PATH="/api/billing/checkout",CheckoutRequestSchema=t.union([t.strictObject({plan:t.string(),interval:t.enum(BILLING_INTERVALS)}),t.strictObject({topUpCents:t.number().int()})]),BILLING_PORTAL_PATH="/api/billing/portal",PortalRequestSchema=t.union([t.strictObject({flow:t.enum(["home","payment_method","cancel"])}),t.strictObject({flow:t.literal("change_plan"),plan:t.string(),interval:t.enum(BILLING_INTERVALS)})]).default({flow:"home"}),BILLING_RESUME_PATH="/api/billing/resume",BILLING_PAYMENT_PATH="/api/billing/payment",BillingPaymentSchema=t.object({card:t.object({brand:t.string(),last4:t.string(),expMonth:t.number(),expYear:t.number()}).nullable(),email:t.string().nullable()}),BILLING_TOP_UP_PATH="/api/billing/top-up",TopUpRequestSchema=t.strictObject({topUpCents:t.number().int()}),BILLING_REQUEST_PATH="/api/billing/request",AUTO_TOP_UP_PATH="/api/billing/auto-top-up",AutoTopUpRequestSchema=t.strictObject({below:t.number().nonnegative(),amountCents:t.number().int().positive(),monthlyLimitCents:t.number().int().positive().nullable().optional(),newCard:t.boolean().optional()}),BILLING_REFUSALS=["top_up_amount","monthly_limit","has_plan","no_plan","no_such_plan","not_customer","no_card","frozen","not_charged","asked_today"],BILLING_PAGE_PATH="/settings/plan",BILLING_PAID_PATH="/settings/plan?paid=1",LLM_MODELS_PATH="/api/llm/models",LLM_MESSAGES_PATH="/api/llm/v1/messages",MODEL_TIERS=["premium","standard","efficient"];const a={tier:o(MODEL_TIERS).optional(),maker:t.string().min(1).optional()};export const ModelCatalogSchema=t.object({models:t.array(t.looseObject({id:t.string().min(1),name:t.string().min(1),...a,reasoning:t.boolean().optional(),input:t.array(t.string()).optional(),contextWindow:t.number().int().positive().optional(),maxOutput:t.number().int().positive().optional()})).min(1),defaultModel:t.string().min(1),needPlan:t.array(t.looseObject({id:t.string().min(1),name:t.string().min(1),...a})).default([])}),JsonSchemaSchema=t.record(t.string(),t.unknown()),CATALOG_PATH="/api/catalog",CatalogWorkSchema=t.object({id:t.string().min(1),title:t.string().min(1),description:t.string().min(1)}),CatalogToolSchema=t.object({name:t.string().min(1),work:t.string().min(1),title:t.string().min(1),description:t.string().min(1),input:JsonSchemaSchema,output:JsonSchemaSchema,long:t.boolean()}),CatalogSchema=t.object({version:t.string().min(1),works:t.array(CatalogWorkSchema),tools:t.array(CatalogToolSchema)}),toolCallsPath=e=>`/api/tools/${encodeURIComponent(e)}/calls`,callPath=e=>`/api/calls/${encodeURIComponent(e)}`,ToolCallRequestSchema=t.strictObject({input:t.record(t.string(),t.unknown())}),CALL_STATUS=["working","completed","failed"],ToolCallSchema=t.object({id:t.string().min(1),tool:t.string().min(1),status:o(CALL_STATUS),output:t.unknown().optional(),error:t.object({kind:t.string().min(1),message:t.string().min(1)}).optional(),credits:t.number().nonnegative().optional(),pollAfterMs:t.number().int().nonnegative().optional(),createdAt:t.string(),endedAt:t.string().optional()});const i="ally://data-tool-results/";export const allyFilePath=(e,n)=>`${i}${encodeURIComponent(e)}/${encodeURIComponent(n)}`;export function parseAllyFilePath(e){if(!e.startsWith(i))return;const[n,r,...l]=e.slice(i.length).split("/");if(!(!n||!r||l.length>0))try{return{id:decodeURIComponent(n),name:decodeURIComponent(r)}}catch{return}}export const FILE_MAX_BYTES=1024*1024*1024,FILES_PATH="/api/files",FileCreateRequestSchema=t.strictObject({name:t.string().min(1).max(255),size:t.int().positive().max(FILE_MAX_BYTES),sha256:t.string().regex(/^[0-9a-f]{64}$/u),contentType:t.string().min(1).max(255)}),FileCreatedSchema=t.object({id:t.string().min(1),upload:t.object({url:t.url(),headers:t.record(t.string(),t.string())}).nullable()}),fileDonePath=e=>`${FILES_PATH}/${encodeURIComponent(e)}/done`,UploadedFileSchema=t.object({id:t.string().min(1),name:t.string()}),FileContentResponseSchema=t.object({url:t.url()}),fileContentPath=(e,n)=>`${FILES_PATH}/${encodeURIComponent(e)}/content?disposition=${n}`;
2
+ import{z as t}from"zod";import{openEnum as n}from"./open.js";export const API_KEY_ENV="ALLYHUB_API_KEY",BILLING_SUMMARY_PATH="/api/billing/summary",AUTO_TOP_UP_STOPS=["no_card","saving_card","not_a_card","declined","needs_authentication","not_charged","under_line","refunded","disputed","monthly_limit"],BILLING_INTERVALS=["month","year"],BillingSummarySchema=t.object({credits:t.number(),held:t.number(),owed:t.number(),frozen:t.string().nullable().default(null),plan:t.object({id:t.string(),name:t.string(),interval:n(BILLING_INTERVALS),status:t.string(),renewsAt:t.iso.datetime().nullable(),endsAt:t.iso.datetime().nullable(),monthlyCredits:t.number().default(0),price:t.object({amountCents:t.number(),currency:t.string()}).nullable().default(null)}).nullable(),allowance:t.object({total:t.number(),used:t.number(),renewsAt:t.iso.datetime()}).nullable().default(null),bought:t.number().default(0),customer:t.boolean().default(!1),autoTopUp:t.object({below:t.number(),amountCents:t.number(),monthlyLimitCents:t.number().nullable().default(null),chargedThisMonthCents:t.number().default(0),stopped:n(AUTO_TOP_UP_STOPS).nullable()}).nullable()}),BILLING_PLANS_PATH="/api/billing/plans",BillingPlansSchema=t.object({plans:t.array(t.object({id:t.string(),name:t.string(),family:t.string().nullable().default(null),recommended:t.boolean().default(!1),monthlyCredits:t.number(),prices:t.array(t.object({interval:n(BILLING_INTERVALS),amountCents:t.number(),currency:t.string()}))})),topUp:t.object({currency:t.string(),creditsPerDollar:t.number(),minCents:t.number(),maxCents:t.number(),presetsCents:t.array(t.number()).default([])}),welcomeCredits:t.number().optional()}),BILLING_USAGE_PATH="/api/billing/usage",SPEND_KINDS=["models","tools","studio","other"],BillingUsageSchema=t.object({days:t.array(t.object({day:t.iso.date(),credits:t.number(),byKind:t.record(t.string(),t.number()).default({})}))}),BILLING_SPENDS_PATH="/api/billing/spends",BillingSpendsSchema=t.object({spends:t.array(t.object({at:t.string(),kind:n(SPEND_KINDS),what:t.string().nullable(),seconds:t.number().nullable(),member:t.string().nullable(),credits:t.number()})),more:t.boolean()}),BILLING_CHECKOUT_PATH="/api/billing/checkout",CheckoutRequestSchema=t.union([t.strictObject({plan:t.string(),interval:t.enum(BILLING_INTERVALS)}),t.strictObject({topUpCents:t.number().int()})]),BILLING_PORTAL_PATH="/api/billing/portal",PortalRequestSchema=t.union([t.strictObject({flow:t.enum(["home","payment_method","cancel"])}),t.strictObject({flow:t.literal("change_plan"),plan:t.string(),interval:t.enum(BILLING_INTERVALS)})]).default({flow:"home"}),BILLING_RESUME_PATH="/api/billing/resume",BILLING_PAYMENT_PATH="/api/billing/payment",BillingPaymentSchema=t.object({card:t.object({brand:t.string(),last4:t.string(),expMonth:t.number(),expYear:t.number()}).nullable(),email:t.string().nullable()}),BILLING_INVOICES_PATH="/api/billing/invoices",BillingInvoicesSchema=t.object({invoices:t.array(t.object({id:t.string(),number:t.string().nullable(),createdAt:t.string(),kind:n(["plan","credits"]),totalCents:t.number(),currency:t.string(),status:t.string(),pdf:t.string().nullable(),url:t.string().nullable()}))}),BILLING_TOP_UP_PATH="/api/billing/top-up",TopUpRequestSchema=t.strictObject({topUpCents:t.number().int()}),BILLING_REQUEST_PATH="/api/billing/request",AUTO_TOP_UP_PATH="/api/billing/auto-top-up",AutoTopUpRequestSchema=t.strictObject({below:t.number().nonnegative(),amountCents:t.number().int().positive(),monthlyLimitCents:t.number().int().positive().nullable().optional(),newCard:t.boolean().optional()}),BILLING_REFUSALS=["top_up_amount","monthly_limit","has_plan","no_plan","no_such_plan","not_customer","no_card","frozen","not_charged","asked_today"],BILLING_PAGE_PATH="/settings/plan",BILLING_PAID_PATH="/settings/plan?paid=1",LLM_MODELS_PATH="/api/llm/models",LLM_MESSAGES_PATH="/api/llm/v1/messages",MODEL_TIERS=["premium","standard","efficient"];const a={tier:n(MODEL_TIERS).optional(),maker:t.string().min(1).optional()};export const ModelCatalogSchema=t.object({models:t.array(t.looseObject({id:t.string().min(1),name:t.string().min(1),...a,reasoning:t.boolean().optional(),input:t.array(t.string()).optional(),contextWindow:t.number().int().positive().optional(),maxOutput:t.number().int().positive().optional()})).min(1),defaultModel:t.string().min(1),needPlan:t.array(t.looseObject({id:t.string().min(1),name:t.string().min(1),...a})).default([])}),JsonSchemaSchema=t.record(t.string(),t.unknown()),CATALOG_PATH="/api/catalog",PRICE_UNITS=["call","result","page","second","minute","thousand_characters","image","frame","megapixel","question","phrase"],TOOL_SECTIONS=["video","image","voice","music"],WORK_KINDS=["data","ai"],CatalogWorkSchema=t.object({id:t.string().min(1),title:t.string().min(1),description:t.string().min(1),kind:n(WORK_KINDS).default("data"),line:t.string().optional()}),CatalogToolSchema=t.object({name:t.string().min(1),work:t.string().min(1),title:t.string().min(1),description:t.string().min(1),input:JsonSchemaSchema,output:JsonSchemaSchema,long:t.boolean(),example:t.record(t.string(),t.unknown()).optional(),price:t.object({credits:t.number().nonnegative(),per:n(PRICE_UNITS),varies:t.boolean()}).optional(),shown:t.object({name:t.string(),line:t.string(),section:n(TOOL_SECTIONS)}).optional()}),CatalogSchema=t.object({version:t.string().min(1),works:t.array(CatalogWorkSchema),tools:t.array(CatalogToolSchema)}),CAPABILITIES_PATH="/api/capabilities",CapabilitiesSchema=t.object({off:t.object({works:t.array(t.string()),tools:t.array(t.string())})}),CapabilityRequestSchema=t.union([t.strictObject({work:t.string().min(1),on:t.boolean()}),t.strictObject({tool:t.string().min(1),on:t.boolean()})]),EDITORS_PATH="/api/editors",EditorsSchema=t.object({editors:t.array(t.object({id:t.string().min(1),name:t.record(t.string(),t.string()),plural:t.record(t.string(),t.string()).optional(),line:t.record(t.string(),t.string()),icon:t.string().optional(),color:t.string().optional()}))}),toolCallsPath=e=>`/api/tools/${encodeURIComponent(e)}/calls`,callPath=e=>`/api/calls/${encodeURIComponent(e)}`,ToolCallRequestSchema=t.strictObject({input:t.record(t.string(),t.unknown())}),CALL_STATUS=["working","completed","failed"],ToolCallSchema=t.object({id:t.string().min(1),tool:t.string().min(1),status:n(CALL_STATUS),output:t.unknown().optional(),error:t.object({kind:t.string().min(1),message:t.string().min(1)}).optional(),credits:t.number().nonnegative().optional(),pollAfterMs:t.number().int().nonnegative().optional(),createdAt:t.string(),endedAt:t.string().optional()});const i="ally://data-tool-results/";export const allyFilePath=(e,o)=>`${i}${encodeURIComponent(e)}/${encodeURIComponent(o)}`;export function parseAllyFilePath(e){if(!e.startsWith(i))return;const[o,r,...s]=e.slice(i.length).split("/");if(!(!o||!r||s.length>0))try{return{id:decodeURIComponent(o),name:decodeURIComponent(r)}}catch{return}}export const FILE_MAX_BYTES=1024*1024*1024,FILES_PATH="/api/files",FileCreateRequestSchema=t.strictObject({name:t.string().min(1).max(255),size:t.int().positive().max(FILE_MAX_BYTES),sha256:t.string().regex(/^[0-9a-f]{64}$/u),contentType:t.string().min(1).max(255)}),FileCreatedSchema=t.object({id:t.string().min(1),upload:t.object({url:t.url(),headers:t.record(t.string(),t.string())}).nullable()}),fileDonePath=e=>`${FILES_PATH}/${encodeURIComponent(e)}/done`,UploadedFileSchema=t.object({id:t.string().min(1),name:t.string()}),FileContentResponseSchema=t.object({url:t.url()}),fileContentPath=(e,o)=>`${FILES_PATH}/${encodeURIComponent(e)}/content?disposition=${o}`;