@hanzo/dev 4.0.1 → 4.2.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 (371) hide show
  1. package/LICENSE +21 -0
  2. package/dist/{BinaryViewer-qn8xfPZp.js → BinaryViewer-CmFUK4zZ.js} +2 -2
  3. package/dist/{ChatMarkdown-Cyujn3JJ.js → ChatMarkdown-nvEI7iCv.js} +4 -4
  4. package/dist/{DiffCommentAnnotation-BZu1TP6E.js → DiffCommentAnnotation-BPTN_2a6.js} +1 -1
  5. package/dist/{DiffFileTree-CcJ91zOM.js → DiffFileTree-B_br90vY.js} +2 -2
  6. package/dist/{DiffPanel-BXC88NMs.js → DiffPanel-V5R5TPuK.js} +5 -5
  7. package/dist/{ExpandedImageDialog-BZnGRBJR.js → ExpandedImageDialog-CAorLacL.js} +1 -1
  8. package/dist/{FileExplorerPane-vBJS6V75.js → FileExplorerPane-CeHulcPz.js} +1 -1
  9. package/dist/{FilePreviewPanel-jJHWsMzm.js → FilePreviewPanel-BVNLvWOc.js} +8 -8
  10. package/dist/{MermaidDiagram-paNwQY33.js → MermaidDiagram-CTolIzQD.js} +1 -1
  11. package/dist/{MermaidFilePreview-B9KxfnIN.js → MermaidFilePreview-CP2zP4FU.js} +1 -1
  12. package/dist/{MermaidViewer-CAEGpLyD.js → MermaidViewer-BDfYkS9E.js} +2 -2
  13. package/dist/{NotebookPreview-D01mMCpR.js → NotebookPreview-Cybs5uM0.js} +1 -1
  14. package/dist/{OfficeFilePreview-DWaRgfQU.js → OfficeFilePreview-7JsmSoKU.js} +1 -1
  15. package/dist/{OfficeViewer-BudrZbBA.js → OfficeViewer-CJoojlJK.js} +1 -1
  16. package/dist/{OpenInPicker-Dd3ifHa1.js → OpenInPicker-BIMWUxBP.js} +7 -7
  17. package/dist/{OpenXmlOfficeViewer-CXcKdq7k.js → OpenXmlOfficeViewer-C24Kj8DM.js} +1 -1
  18. package/dist/{PreviewImage-C4Ku4z7v.js → PreviewImage-oY5YnuTr.js} +1 -1
  19. package/dist/{PreviewImageContent-BwOB9Lyd.js → PreviewImageContent-n6eLzY99.js} +1 -1
  20. package/dist/{PullRequestCodeTab-BcwyMk7d.js → PullRequestCodeTab-Dv_0kVad.js} +7 -7
  21. package/dist/{PullRequestReviewAnnotation-BU5t_1fC.js → PullRequestReviewAnnotation-LeuwO-iH.js} +4 -4
  22. package/dist/builder/activity.d.ts +16 -0
  23. package/dist/builder/activity.js +51 -0
  24. package/dist/builder/address.d.ts +11 -0
  25. package/dist/builder/address.js +50 -0
  26. package/dist/builder/ago.d.ts +2 -0
  27. package/dist/builder/ago.js +18 -0
  28. package/dist/builder/api/agents.d.ts +139 -0
  29. package/dist/builder/api/agents.js +253 -0
  30. package/dist/builder/api/auto.d.ts +166 -0
  31. package/dist/builder/api/auto.js +300 -0
  32. package/dist/builder/api/billing.d.ts +263 -0
  33. package/dist/builder/api/billing.js +401 -0
  34. package/dist/builder/api/call.d.ts +53 -0
  35. package/dist/builder/api/call.js +123 -0
  36. package/dist/builder/api/capabilities.d.ts +14 -0
  37. package/dist/builder/api/capabilities.js +41 -0
  38. package/dist/builder/api/changes.d.ts +74 -0
  39. package/dist/builder/api/changes.js +75 -0
  40. package/dist/builder/api/chat.d.ts +12 -0
  41. package/dist/builder/api/chat.js +28 -0
  42. package/dist/builder/api/cli.d.ts +59 -0
  43. package/dist/builder/api/cli.js +133 -0
  44. package/dist/builder/api/codebases.d.ts +46 -0
  45. package/dist/builder/api/codebases.js +100 -0
  46. package/dist/builder/api/coding.d.ts +117 -0
  47. package/dist/builder/api/coding.js +222 -0
  48. package/dist/builder/api/connectors.d.ts +76 -0
  49. package/dist/builder/api/connectors.js +111 -0
  50. package/dist/builder/api/consent.d.ts +22 -0
  51. package/dist/builder/api/consent.js +28 -0
  52. package/dist/builder/api/conversations.d.ts +20 -0
  53. package/dist/builder/api/conversations.js +23 -0
  54. package/dist/builder/api/draft.d.ts +38 -0
  55. package/dist/builder/api/draft.js +87 -0
  56. package/dist/builder/api/environment.d.ts +55 -0
  57. package/dist/builder/api/environment.js +126 -0
  58. package/dist/builder/api/gallery.d.ts +32 -0
  59. package/dist/builder/api/gallery.js +85 -0
  60. package/dist/builder/api/git.d.ts +59 -0
  61. package/dist/builder/api/git.js +117 -0
  62. package/dist/builder/api/github.d.ts +230 -0
  63. package/dist/builder/api/github.js +373 -0
  64. package/dist/builder/api/keys.d.ts +35 -0
  65. package/dist/builder/api/keys.js +72 -0
  66. package/dist/builder/api/library.d.ts +116 -0
  67. package/dist/builder/api/library.js +214 -0
  68. package/dist/builder/api/limits.d.ts +69 -0
  69. package/dist/builder/api/limits.js +86 -0
  70. package/dist/builder/api/links.d.ts +51 -0
  71. package/dist/builder/api/links.js +75 -0
  72. package/dist/builder/api/machines.d.ts +122 -0
  73. package/dist/builder/api/machines.js +238 -0
  74. package/dist/builder/api/mcp.d.ts +10 -0
  75. package/dist/builder/api/mcp.js +47 -0
  76. package/dist/builder/api/members.d.ts +35 -0
  77. package/dist/builder/api/members.js +95 -0
  78. package/dist/builder/api/memory.d.ts +14 -0
  79. package/dist/builder/api/memory.js +35 -0
  80. package/dist/builder/api/models.d.ts +17 -0
  81. package/dist/builder/api/models.js +20 -0
  82. package/dist/builder/api/places.d.ts +32 -0
  83. package/dist/builder/api/places.js +29 -0
  84. package/dist/builder/api/platform.d.ts +68 -0
  85. package/dist/builder/api/platform.js +87 -0
  86. package/dist/builder/api/plugins.d.ts +42 -0
  87. package/dist/builder/api/plugins.js +175 -0
  88. package/dist/builder/api/pref.d.ts +77 -0
  89. package/dist/builder/api/pref.js +93 -0
  90. package/dist/builder/api/profile.d.ts +11 -0
  91. package/dist/builder/api/profile.js +41 -0
  92. package/dist/builder/api/projects.d.ts +99 -0
  93. package/dist/builder/api/projects.js +166 -0
  94. package/dist/builder/api/provider.d.ts +49 -0
  95. package/dist/builder/api/provider.js +96 -0
  96. package/dist/builder/api/sandbox.d.ts +90 -0
  97. package/dist/builder/api/sandbox.js +223 -0
  98. package/dist/builder/api/sessions.d.ts +123 -0
  99. package/dist/builder/api/sessions.js +255 -0
  100. package/dist/builder/api/skills.d.ts +82 -0
  101. package/dist/builder/api/skills.js +117 -0
  102. package/dist/builder/api/sse.d.ts +24 -0
  103. package/dist/builder/api/sse.js +68 -0
  104. package/dist/builder/api/studio.d.ts +59 -0
  105. package/dist/builder/api/studio.js +91 -0
  106. package/dist/builder/api/talk.d.ts +48 -0
  107. package/dist/builder/api/talk.js +81 -0
  108. package/dist/builder/api/tools.d.ts +34 -0
  109. package/dist/builder/api/tools.js +37 -0
  110. package/dist/builder/api/turn.d.ts +202 -0
  111. package/dist/builder/api/turn.js +772 -0
  112. package/dist/builder/api/verdict.d.ts +3 -0
  113. package/dist/builder/api/verdict.js +21 -0
  114. package/dist/builder/api/webhooks.d.ts +47 -0
  115. package/dist/builder/api/webhooks.js +82 -0
  116. package/dist/builder/api/work.d.ts +110 -0
  117. package/dist/builder/api/work.js +218 -0
  118. package/dist/builder/ask.d.ts +51 -0
  119. package/dist/builder/ask.js +147 -0
  120. package/dist/builder/automations.d.ts +33 -0
  121. package/dist/builder/automations.js +453 -0
  122. package/dist/builder/awake.d.ts +24 -0
  123. package/dist/builder/awake.js +68 -0
  124. package/dist/builder/back.d.ts +30 -0
  125. package/dist/builder/back.js +105 -0
  126. package/dist/builder/builder.d.ts +12 -0
  127. package/dist/builder/builder.js +162 -0
  128. package/dist/builder/carry.d.ts +48 -0
  129. package/dist/builder/carry.js +278 -0
  130. package/dist/builder/choice.d.ts +134 -0
  131. package/dist/builder/choice.js +152 -0
  132. package/dist/builder/claims.d.ts +13 -0
  133. package/dist/builder/claims.js +35 -0
  134. package/dist/builder/clipboard.d.ts +2 -0
  135. package/dist/builder/clipboard.js +10 -0
  136. package/dist/builder/customize/agents.d.ts +11 -0
  137. package/dist/builder/customize/agents.js +513 -0
  138. package/dist/builder/customize/connectors.d.ts +2 -0
  139. package/dist/builder/customize/connectors.js +319 -0
  140. package/dist/builder/customize/drafted.d.ts +4 -0
  141. package/dist/builder/customize/drafted.js +92 -0
  142. package/dist/builder/customize/index.d.ts +8 -0
  143. package/dist/builder/customize/index.js +127 -0
  144. package/dist/builder/customize/inventory.d.ts +14 -0
  145. package/dist/builder/customize/inventory.js +127 -0
  146. package/dist/builder/customize/load.d.ts +9 -0
  147. package/dist/builder/customize/load.js +22 -0
  148. package/dist/builder/customize/ocean.d.ts +41 -0
  149. package/dist/builder/customize/ocean.js +332 -0
  150. package/dist/builder/customize/plugins.d.ts +2 -0
  151. package/dist/builder/customize/plugins.js +136 -0
  152. package/dist/builder/customize/roles.d.ts +4 -0
  153. package/dist/builder/customize/roles.js +105 -0
  154. package/dist/builder/customize/say.d.ts +13 -0
  155. package/dist/builder/customize/say.js +32 -0
  156. package/dist/builder/customize/skills.d.ts +2 -0
  157. package/dist/builder/customize/skills.js +208 -0
  158. package/dist/builder/customize/ui.d.ts +152 -0
  159. package/dist/builder/customize/ui.js +208 -0
  160. package/dist/builder/data.d.ts +57 -0
  161. package/dist/builder/data.js +322 -0
  162. package/dist/builder/design.d.ts +140 -0
  163. package/dist/builder/design.js +175 -0
  164. package/dist/builder/desk.d.ts +48 -0
  165. package/dist/builder/desk.js +449 -0
  166. package/dist/builder/dev-mode.d.ts +43 -0
  167. package/dist/builder/dev-mode.js +120 -0
  168. package/dist/builder/door.d.ts +11 -0
  169. package/dist/builder/door.js +126 -0
  170. package/dist/builder/environment.d.ts +23 -0
  171. package/dist/builder/environment.js +193 -0
  172. package/dist/builder/files.d.ts +23 -0
  173. package/dist/builder/files.js +175 -0
  174. package/dist/builder/find.d.ts +7 -0
  175. package/dist/builder/find.js +80 -0
  176. package/dist/builder/foot.d.ts +30 -0
  177. package/dist/builder/foot.js +79 -0
  178. package/dist/builder/forge.d.ts +4 -0
  179. package/dist/builder/forge.js +639 -0
  180. package/dist/builder/gear.d.ts +60 -0
  181. package/dist/builder/gear.js +180 -0
  182. package/dist/builder/git.d.ts +21 -0
  183. package/dist/builder/git.js +118 -0
  184. package/dist/builder/github-sync.d.ts +70 -0
  185. package/dist/builder/github-sync.js +435 -0
  186. package/dist/builder/gutter.d.ts +17 -0
  187. package/dist/builder/gutter.js +25 -0
  188. package/dist/builder/handoff.d.ts +8 -0
  189. package/dist/builder/handoff.js +22 -0
  190. package/dist/builder/host.d.ts +189 -0
  191. package/dist/builder/host.js +46 -0
  192. package/dist/builder/index.d.ts +108 -0
  193. package/dist/builder/index.js +99 -0
  194. package/dist/builder/landing.d.ts +34 -0
  195. package/dist/builder/landing.js +725 -0
  196. package/dist/builder/library.d.ts +21 -0
  197. package/dist/builder/library.js +526 -0
  198. package/dist/builder/local.d.ts +80 -0
  199. package/dist/builder/local.js +124 -0
  200. package/dist/builder/make.d.ts +10 -0
  201. package/dist/builder/make.js +120 -0
  202. package/dist/builder/markdown.d.ts +49 -0
  203. package/dist/builder/markdown.js +125 -0
  204. package/dist/builder/marks.d.ts +15 -0
  205. package/dist/builder/marks.js +18 -0
  206. package/dist/builder/merge.d.ts +223 -0
  207. package/dist/builder/merge.js +380 -0
  208. package/dist/builder/meter.d.ts +31 -0
  209. package/dist/builder/meter.js +54 -0
  210. package/dist/builder/mind.d.ts +107 -0
  211. package/dist/builder/mind.js +335 -0
  212. package/dist/builder/names.d.ts +40 -0
  213. package/dist/builder/names.js +189 -0
  214. package/dist/builder/nav.d.ts +28 -0
  215. package/dist/builder/nav.js +218 -0
  216. package/dist/builder/out.d.ts +16 -0
  217. package/dist/builder/out.js +24 -0
  218. package/dist/builder/page.d.ts +55 -0
  219. package/dist/builder/page.js +217 -0
  220. package/dist/builder/pane.d.ts +30 -0
  221. package/dist/builder/pane.js +21 -0
  222. package/dist/builder/panel.d.ts +101 -0
  223. package/dist/builder/panel.js +408 -0
  224. package/dist/builder/pdf.d.ts +139 -0
  225. package/dist/builder/pdf.js +847 -0
  226. package/dist/builder/pick.d.ts +10 -0
  227. package/dist/builder/pick.js +38 -0
  228. package/dist/builder/plain.d.ts +59 -0
  229. package/dist/builder/plain.js +209 -0
  230. package/dist/builder/plan.d.ts +63 -0
  231. package/dist/builder/plan.js +155 -0
  232. package/dist/builder/plans.d.ts +1 -0
  233. package/dist/builder/plans.js +157 -0
  234. package/dist/builder/plugin.d.ts +60 -0
  235. package/dist/builder/plugin.js +1 -0
  236. package/dist/builder/plugins/design.d.ts +8 -0
  237. package/dist/builder/plugins/design.js +71 -0
  238. package/dist/builder/plugins/index.d.ts +46 -0
  239. package/dist/builder/plugins/index.js +117 -0
  240. package/dist/builder/plugins/pdf.d.ts +18 -0
  241. package/dist/builder/plugins/pdf.js +83 -0
  242. package/dist/builder/plugins/project.d.ts +5 -0
  243. package/dist/builder/plugins/project.js +68 -0
  244. package/dist/builder/plugins/research.d.ts +24 -0
  245. package/dist/builder/plugins/research.js +147 -0
  246. package/dist/builder/plugins/sketch.d.ts +9 -0
  247. package/dist/builder/plugins/sketch.js +101 -0
  248. package/dist/builder/plugins/slides.d.ts +14 -0
  249. package/dist/builder/plugins/slides.js +55 -0
  250. package/dist/builder/plugins/template.d.ts +13 -0
  251. package/dist/builder/plugins/template.js +95 -0
  252. package/dist/builder/prefs.d.ts +29 -0
  253. package/dist/builder/prefs.js +91 -0
  254. package/dist/builder/preview-url.d.ts +47 -0
  255. package/dist/builder/preview-url.js +107 -0
  256. package/dist/builder/project.d.ts +18 -0
  257. package/dist/builder/project.js +604 -0
  258. package/dist/builder/prose.d.ts +4 -0
  259. package/dist/builder/prose.js +57 -0
  260. package/dist/builder/publish.d.ts +18 -0
  261. package/dist/builder/publish.js +141 -0
  262. package/dist/builder/question.d.ts +33 -0
  263. package/dist/builder/question.js +64 -0
  264. package/dist/builder/redesign.d.ts +32 -0
  265. package/dist/builder/redesign.js +117 -0
  266. package/dist/builder/removal.d.ts +71 -0
  267. package/dist/builder/removal.js +73 -0
  268. package/dist/builder/reply.d.ts +50 -0
  269. package/dist/builder/reply.js +196 -0
  270. package/dist/builder/roles.d.ts +10 -0
  271. package/dist/builder/roles.js +28 -0
  272. package/dist/builder/route.d.ts +85 -0
  273. package/dist/builder/route.js +126 -0
  274. package/dist/builder/run.d.ts +4 -0
  275. package/dist/builder/run.js +804 -0
  276. package/dist/builder/runmeta.d.ts +16 -0
  277. package/dist/builder/runmeta.js +69 -0
  278. package/dist/builder/say.d.ts +2 -0
  279. package/dist/builder/say.js +7 -0
  280. package/dist/builder/scheduled.d.ts +3 -0
  281. package/dist/builder/scheduled.js +328 -0
  282. package/dist/builder/section.d.ts +27 -0
  283. package/dist/builder/section.js +60 -0
  284. package/dist/builder/settings/account.d.ts +1 -0
  285. package/dist/builder/settings/account.js +111 -0
  286. package/dist/builder/settings/billing.d.ts +1 -0
  287. package/dist/builder/settings/billing.js +210 -0
  288. package/dist/builder/settings/capabilities.d.ts +1 -0
  289. package/dist/builder/settings/capabilities.js +66 -0
  290. package/dist/builder/settings/card.d.ts +31 -0
  291. package/dist/builder/settings/card.js +140 -0
  292. package/dist/builder/settings/code.d.ts +1 -0
  293. package/dist/builder/settings/code.js +70 -0
  294. package/dist/builder/settings/credits.d.ts +10 -0
  295. package/dist/builder/settings/credits.js +123 -0
  296. package/dist/builder/settings/environments.d.ts +1 -0
  297. package/dist/builder/settings/environments.js +60 -0
  298. package/dist/builder/settings/general.d.ts +1 -0
  299. package/dist/builder/settings/general.js +58 -0
  300. package/dist/builder/settings/index.d.ts +4 -0
  301. package/dist/builder/settings/index.js +25 -0
  302. package/dist/builder/settings/integrations.d.ts +8 -0
  303. package/dist/builder/settings/integrations.js +138 -0
  304. package/dist/builder/settings/keys.d.ts +1 -0
  305. package/dist/builder/settings/keys.js +114 -0
  306. package/dist/builder/settings/list.d.ts +10 -0
  307. package/dist/builder/settings/list.js +28 -0
  308. package/dist/builder/settings/machines.d.ts +4 -0
  309. package/dist/builder/settings/machines.js +243 -0
  310. package/dist/builder/settings/members.d.ts +1 -0
  311. package/dist/builder/settings/members.js +77 -0
  312. package/dist/builder/settings/memory.d.ts +1 -0
  313. package/dist/builder/settings/memory.js +62 -0
  314. package/dist/builder/settings/notifications.d.ts +1 -0
  315. package/dist/builder/settings/notifications.js +111 -0
  316. package/dist/builder/settings/plan.d.ts +17 -0
  317. package/dist/builder/settings/plan.js +131 -0
  318. package/dist/builder/settings/privacy.d.ts +1 -0
  319. package/dist/builder/settings/privacy.js +76 -0
  320. package/dist/builder/settings/sections.d.ts +16 -0
  321. package/dist/builder/settings/sections.js +34 -0
  322. package/dist/builder/settings/shared.d.ts +6 -0
  323. package/dist/builder/settings/shared.js +58 -0
  324. package/dist/builder/settings/ui.d.ts +50 -0
  325. package/dist/builder/settings/ui.js +53 -0
  326. package/dist/builder/settings/usage.d.ts +1 -0
  327. package/dist/builder/settings/usage.js +24 -0
  328. package/dist/builder/shared.d.ts +26 -0
  329. package/dist/builder/shared.js +15 -0
  330. package/dist/builder/shelf.d.ts +16 -0
  331. package/dist/builder/shelf.js +219 -0
  332. package/dist/builder/side.d.ts +40 -0
  333. package/dist/builder/side.js +208 -0
  334. package/dist/builder/site.d.ts +75 -0
  335. package/dist/builder/site.js +138 -0
  336. package/dist/builder/spend.d.ts +21 -0
  337. package/dist/builder/spend.js +80 -0
  338. package/dist/builder/standing.d.ts +36 -0
  339. package/dist/builder/standing.js +66 -0
  340. package/dist/builder/suggest.d.ts +238 -0
  341. package/dist/builder/suggest.js +463 -0
  342. package/dist/builder/suggestions.d.ts +49 -0
  343. package/dist/builder/suggestions.js +260 -0
  344. package/dist/builder/summary.d.ts +60 -0
  345. package/dist/builder/summary.js +81 -0
  346. package/dist/builder/sync.d.ts +1 -0
  347. package/dist/builder/sync.js +187 -0
  348. package/dist/builder/tabs.d.ts +85 -0
  349. package/dist/builder/tabs.js +288 -0
  350. package/dist/builder/talk.d.ts +5 -0
  351. package/dist/builder/talk.js +108 -0
  352. package/dist/builder/thread.d.ts +60 -0
  353. package/dist/builder/thread.js +302 -0
  354. package/dist/builder/tools.d.ts +22 -0
  355. package/dist/builder/tools.js +52 -0
  356. package/dist/builder/transcript.d.ts +47 -0
  357. package/dist/builder/transcript.js +108 -0
  358. package/dist/builder/voice.d.ts +8 -0
  359. package/dist/builder/voice.js +24 -0
  360. package/dist/{changedFileKind-DqgCCDUs.js → changedFileKind-D6QYvIez.js} +1 -1
  361. package/dist/core.js +1 -0
  362. package/dist/{decodeImagePreview-CesVZYP4.js → decodeImagePreview-DnfFEjhw.js} +1 -1
  363. package/dist/{embed-DYP-OUlb.js → embed-c030vUqM.js} +11 -11
  364. package/dist/index.d.ts +2 -0
  365. package/dist/index.js +2 -1
  366. package/dist/{micromark-util-decode-string-NQjVkmZH.js → micromark-util-decode-string-C-5AXkOV.js} +5 -3
  367. package/dist/{readBinaryPreview-D2X4Uahu.js → readBinaryPreview-BAQ4fFjm.js} +1 -1
  368. package/dist/{useTextFieldSpeech-CyOZZPrV.js → useTextFieldSpeech-COa9XcRx.js} +1 -1
  369. package/package.json +101 -11
  370. /package/{index.d.ts → dist/core.d.ts} +0 -0
  371. /package/{keymap.d.ts → dist/keymap.d.ts} +0 -0
@@ -0,0 +1,10 @@
1
+ import { type Model } from './api/models.ts';
2
+ /**
3
+ * What a run starts on with nothing picked on this screen: Enso when Enso is
4
+ * kept — the router serves every ask whether or not a catalog lists it — else
5
+ * the kept model while the catalog still offers it (or has not answered yet),
6
+ * else the catalog's own default for a conversation, else Enso. Never '' — an
7
+ * empty chooser reads "Choose a model" and the run would name nothing on purpose.
8
+ */
9
+ export declare function standing(kept: string, catalog: readonly Model[]): string;
10
+ export declare function usePick(kept: string, keep: (id: string) => void, catalog: readonly Model[]): readonly [string, (id: string) => void];
@@ -0,0 +1,38 @@
1
+ /**
2
+ * The model a surface starts its next run on, and how a pick changes it.
3
+ *
4
+ * A premium pick holds HERE, for the runs started from this screen, and is
5
+ * never kept as the default — the next New opens on what was kept, Enso unless
6
+ * the person kept another. Any other pick is kept. A kept premium model (from
7
+ * before this rule) is not a default either, so Enso stands in for it.
8
+ */
9
+ import { useState } from 'react';
10
+ import { defaultModel } from '@hanzo/ui/models/catalog';
11
+ import { ENSO } from './api/models.js';
12
+ /**
13
+ * What a run starts on with nothing picked on this screen: Enso when Enso is
14
+ * kept — the router serves every ask whether or not a catalog lists it — else
15
+ * the kept model while the catalog still offers it (or has not answered yet),
16
+ * else the catalog's own default for a conversation, else Enso. Never '' — an
17
+ * empty chooser reads "Choose a model" and the run would name nothing on purpose.
18
+ */
19
+ export function standing(kept, catalog) {
20
+ if (kept === ENSO)
21
+ return ENSO;
22
+ const premium = catalog.find((m) => m.id === kept)?.class === 'premium';
23
+ const offered = catalog.length === 0 || catalog.some((m) => m.id === kept);
24
+ if (kept && !premium && offered)
25
+ return kept;
26
+ return defaultModel(catalog, 'chat') || ENSO;
27
+ }
28
+ export function usePick(kept, keep, catalog) {
29
+ const [once, setOnce] = useState(null);
30
+ const premium = (id) => catalog.find((m) => m.id === id)?.class === 'premium';
31
+ const pick = (id) => {
32
+ if (premium(id))
33
+ return setOnce(id);
34
+ setOnce(null);
35
+ keep(id);
36
+ };
37
+ return [once ?? standing(kept, catalog), pick];
38
+ }
@@ -0,0 +1,59 @@
1
+ /**
2
+ * THE RESULT FIRST (hanzo-inc/app issues 317 and 321).
3
+ *
4
+ * With Developer mode off, a run reads as what was asked, what the agent said
5
+ * and how it ended. Everything it did on the way there — the commands it ran,
6
+ * the files it read and changed, the sandbox it leased, its reasoning — folds
7
+ * into one line between the turns, saying in plain words what the work was
8
+ * ("Set up the workspace, read 4 files, changed index.html"). That line opens
9
+ * onto the very cards Developer mode draws, so the process stays one press away
10
+ * and nobody has to read a shell line to know what happened.
11
+ *
12
+ * A path a person might still read there is said in words: `~` is "your home
13
+ * folder", `/work` is "your project".
14
+ */
15
+ import type { Say } from '@hanzo/i18n/react';
16
+ import type { Card, Ran } from './api/turn.ts';
17
+ /** A run of process cards between two things a person reads. */
18
+ export interface Work {
19
+ kind: 'work';
20
+ /** The first card's key: a run of work keeps its key, and its open state, as it grows. */
21
+ key: string;
22
+ cards: Card[];
23
+ }
24
+ /**
25
+ * Whether a card is the process — how the agent got there — rather than what a
26
+ * person reads: what was asked, what the agent said, its plan, its question, a
27
+ * coding run it started, how the run ended, and the reason it failed.
28
+ */
29
+ export declare function isProcess(c: Card): boolean;
30
+ /** The transcript with each run of process cards gathered into one `Work`. */
31
+ export declare function fold(cards: readonly Card[]): (Card | Work)[];
32
+ /**
33
+ * How a run of work went: still going while any of it is, cut off when a step
34
+ * was, otherwise done. The kept sandbox is left out: it stays "running" for as
35
+ * long as the sandbox is kept, which is not the work still going.
36
+ */
37
+ export declare function ranOf(cards: readonly Card[], state?: (r: Ran) => Ran): Ran;
38
+ /**
39
+ * A line with the paths in it said in words: `~` is "your home folder",
40
+ * `~/notes/todo.md` is "notes/todo.md in your home folder", `/work` is "your
41
+ * project" and `/work/src/app.ts` is "src/app.ts". Anything else is left as written.
42
+ */
43
+ export declare function plainPath(text: string, say?: Say): string;
44
+ /**
45
+ * What an agent said after working in a folder, said in words. Paths inside the folder are named by it
46
+ * ("checkout.html in shop"), the folder's own path by its name, and the home folder and the sandbox's `/work`
47
+ * as `plainPath` says them. Anything else is left as it was written.
48
+ */
49
+ export declare function plainAnswer(text: string, folder: {
50
+ path: string;
51
+ name: string;
52
+ }, say?: Say): string;
53
+ /** What one card was doing, in plain words, for the line while the work goes on. */
54
+ export declare function doing(c: Card, say?: Say): string;
55
+ /**
56
+ * What a run of work did, said in one line: "Set up the workspace, read 4
57
+ * files, changed index.html". Counts, never commands or paths.
58
+ */
59
+ export declare function worked(cards: readonly Card[], say?: Say): string;
@@ -0,0 +1,209 @@
1
+ import { english } from './say.js';
2
+ /** The run's own steps that set it up, by the names turn.ts gives them. */
3
+ const SETUP = new Set(['Sandbox', 'Workspace', 'Clone', 'Branch', 'Secrets', 'Install', 'Start', 'Skills']);
4
+ /** The sandbox kept for its screen and previews once the run is done: housekeeping, said nowhere. */
5
+ const KEPT = 'Keep the sandbox';
6
+ /**
7
+ * Whether a card is the process — how the agent got there — rather than what a
8
+ * person reads: what was asked, what the agent said, its plan, its question, a
9
+ * coding run it started, how the run ended, and the reason it failed.
10
+ */
11
+ export function isProcess(c) {
12
+ switch (c.kind) {
13
+ case 'think':
14
+ case 'shell':
15
+ case 'explore':
16
+ case 'edit':
17
+ return true;
18
+ case 'step':
19
+ return c.name !== 'Error';
20
+ case 'note':
21
+ return c.step === true;
22
+ }
23
+ return false;
24
+ }
25
+ /** The transcript with each run of process cards gathered into one `Work`. */
26
+ export function fold(cards) {
27
+ const out = [];
28
+ for (const c of cards) {
29
+ if (!isProcess(c)) {
30
+ out.push(c);
31
+ continue;
32
+ }
33
+ const last = out[out.length - 1];
34
+ if (last?.kind === 'work')
35
+ last.cards.push(c);
36
+ else
37
+ out.push({ kind: 'work', key: `work:${c.key}`, cards: [c] });
38
+ }
39
+ return out;
40
+ }
41
+ /**
42
+ * How a run of work went: still going while any of it is, cut off when a step
43
+ * was, otherwise done. The kept sandbox is left out: it stays "running" for as
44
+ * long as the sandbox is kept, which is not the work still going.
45
+ */
46
+ export function ranOf(cards, state = (r) => r) {
47
+ const ran = cards.filter((c) => !(c.kind === 'step' && c.name === KEPT)).map((c) => ('ran' in c ? state(c.ran) : 'done'));
48
+ if (ran.includes('running'))
49
+ return 'running';
50
+ if (ran.includes('cancelled'))
51
+ return 'cancelled';
52
+ return 'done';
53
+ }
54
+ // Paths as a shell writes them, at a word's start: the home folder (`~`, `$HOME`,
55
+ // `/home/<user>`, `/Users/<user>`, `/root`) and the sandbox's working directory (`/work`).
56
+ const HOME = /(^|[\s'"`(=:,])(?:~|\$HOME|\/home\/[\w.-]+|\/Users\/[\w.-]+|\/root)(\/[^\s'"`),;]*)?(?=$|[\s'"`),;:.])/g;
57
+ const WORK = /(^|[\s'"`(=:,])\/work(\/[^\s'"`),;]*)?(?=$|[\s'"`),;:.])/g;
58
+ /**
59
+ * A line with the paths in it said in words: `~` is "your home folder",
60
+ * `~/notes/todo.md` is "notes/todo.md in your home folder", `/work` is "your
61
+ * project" and `/work/src/app.ts` is "src/app.ts". Anything else is left as written.
62
+ */
63
+ export function plainPath(text, say = english) {
64
+ // The path inside a tail, and the sentence's own punctuation after it, which stays where it was written.
65
+ const split = (tail) => {
66
+ const written = (tail ?? '').replace(/^\/+/, '');
67
+ const stop = /[.!?:]*$/.exec(written)?.[0] ?? '';
68
+ return [written.slice(0, written.length - stop.length).replace(/\/+$/, ''), stop];
69
+ };
70
+ return text
71
+ .replace(HOME, (_, lead, tail) => {
72
+ const [inside, stop] = split(tail);
73
+ return lead + (inside ? say('{path} in your home folder', { path: inside }) : say('your home folder')) + stop;
74
+ })
75
+ .replace(WORK, (_, lead, tail) => {
76
+ const [inside, stop] = split(tail);
77
+ return lead + (inside || say('your project')) + stop;
78
+ });
79
+ }
80
+ /** A text as a pattern that matches it literally. */
81
+ const literal = (text) => text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
82
+ /**
83
+ * What an agent said after working in a folder, said in words. Paths inside the folder are named by it
84
+ * ("checkout.html in shop"), the folder's own path by its name, and the home folder and the sandbox's `/work`
85
+ * as `plainPath` says them. Anything else is left as it was written.
86
+ */
87
+ export function plainAnswer(text, folder, say = english) {
88
+ const root = folder.path.replace(/[/\\]+$/, '');
89
+ if (!root)
90
+ return plainPath(text, say);
91
+ const own = new RegExp(`(^|[\\s'"\`(=:,])${root.split(/[/\\]+/).map(literal).join('[/\\\\]+')}([/\\\\][^\\s'"\`),;]*)?(?=$|[\\s'"\`),;:.!?])`, 'g');
92
+ const inside = text.replace(own, (_, lead, tail) => {
93
+ const written = (tail ?? '').replace(/^[/\\]+/, '');
94
+ const stop = /[.!?:]*$/.exec(written)?.[0] ?? '';
95
+ const rest = written.slice(0, written.length - stop.length).replace(/[/\\]+$/, '');
96
+ return lead + (rest ? say('{path} in {folder}', { path: rest, folder: folder.name }) : folder.name) + stop;
97
+ });
98
+ return plainPath(inside, say);
99
+ }
100
+ /** A file's name as a person reads it: the last part of its path, said in words. */
101
+ const fileName = (path, say) => {
102
+ const plain = plainPath(path, say);
103
+ return plain === path ? path.split('/').filter(Boolean).pop() || path : plain;
104
+ };
105
+ /** What one card was doing, in plain words, for the line while the work goes on. */
106
+ export function doing(c, say = english) {
107
+ switch (c.kind) {
108
+ case 'think':
109
+ return say('Thinking it through');
110
+ case 'shell':
111
+ return say('Running a command');
112
+ case 'explore':
113
+ return say('Looking through the files');
114
+ case 'edit':
115
+ return c.files.length === 1 ? say('Changing {file}', { file: fileName(c.files[0].path, say) }) : say('Changing files');
116
+ case 'note':
117
+ return say('Starting');
118
+ case 'step':
119
+ if (SETUP.has(c.name))
120
+ return say('Setting up the workspace');
121
+ if (c.name === 'Search')
122
+ return say('Searching the web');
123
+ if (c.name === 'Called' || c.name === 'Calling')
124
+ return say('Using a tool');
125
+ if (c.name === 'Push' || c.name === 'Save artifacts')
126
+ return say('Saving the work');
127
+ if (c.name === KEPT)
128
+ return say('Keeping the workspace');
129
+ return say('Checking the work');
130
+ }
131
+ return say('Working');
132
+ }
133
+ /**
134
+ * What a run of work did, said in one line: "Set up the workspace, read 4
135
+ * files, changed index.html". Counts, never commands or paths.
136
+ */
137
+ export function worked(cards, say = english) {
138
+ let setup = false;
139
+ let thought = false;
140
+ let commands = 0;
141
+ const read = new Set();
142
+ let looked = false;
143
+ const changed = new Set();
144
+ let searched = false;
145
+ let tools = 0;
146
+ let saved = false;
147
+ let checked = false;
148
+ for (const c of cards) {
149
+ switch (c.kind) {
150
+ case 'think':
151
+ thought = true;
152
+ break;
153
+ case 'shell':
154
+ commands++;
155
+ break;
156
+ case 'explore':
157
+ for (const call of c.calls)
158
+ for (const a of call.actions) {
159
+ if (a.type === 'read')
160
+ read.add(a.name);
161
+ else
162
+ looked = true;
163
+ }
164
+ break;
165
+ case 'edit':
166
+ for (const f of c.files)
167
+ changed.add(f.path);
168
+ break;
169
+ case 'note':
170
+ setup = true;
171
+ break;
172
+ case 'step':
173
+ if (SETUP.has(c.name))
174
+ setup = true;
175
+ else if (c.name === 'Search')
176
+ searched = true;
177
+ else if (c.name === 'Called' || c.name === 'Calling')
178
+ tools++;
179
+ else if (c.name === 'Push' || c.name === 'Save artifacts')
180
+ saved = true;
181
+ else if (c.name !== KEPT)
182
+ checked = true;
183
+ break;
184
+ }
185
+ }
186
+ const parts = [];
187
+ if (setup)
188
+ parts.push(say('Set up the workspace'));
189
+ if (thought && !commands && !read.size && !changed.size)
190
+ parts.push(say('thought it through'));
191
+ if (read.size)
192
+ parts.push(read.size === 1 ? say('read a file') : say('read {n} files', { n: read.size }));
193
+ else if (looked)
194
+ parts.push(say('looked through the files'));
195
+ if (commands)
196
+ parts.push(commands === 1 ? say('ran a command') : say('ran {n} commands', { n: commands }));
197
+ if (searched)
198
+ parts.push(say('searched the web'));
199
+ if (tools)
200
+ parts.push(tools === 1 ? say('used a tool') : say('used {n} tools', { n: tools }));
201
+ if (changed.size)
202
+ parts.push(changed.size === 1 ? say('changed {file}', { file: fileName([...changed][0], say) }) : say('changed {n} files', { n: changed.size }));
203
+ if (saved)
204
+ parts.push(say('saved the work'));
205
+ if (checked && !parts.length)
206
+ parts.push(say('checked the work'));
207
+ const line = parts.join(', ');
208
+ return line ? line.charAt(0).toUpperCase() + line.slice(1) : '';
209
+ }
@@ -0,0 +1,63 @@
1
+ import type { Say } from '@hanzo/i18n/react';
2
+ export interface Label {
3
+ /** The family: `Max`. */
4
+ name: string;
5
+ /** The rung inside it, drawn small beside the name: `20x`; '' for none. */
6
+ tag: string;
7
+ }
8
+ /**
9
+ * A plan as a person reads it: the plan's display name where billing gives one
10
+ * (`Unlimited`), else from the slug billing serves (`max-20x`) and the tier
11
+ * class beside it (`pro`). Null where none names a plan: no name, no slug and a
12
+ * free or trial tier, which is no plan at all.
13
+ */
14
+ export declare function label(slug?: string | null, tier?: string | null, name?: string | null): Label | null;
15
+ /** A label as a sentence says it: `Max 20x`. */
16
+ export declare const said: (l: Label | null) => string;
17
+ export type State = 'ok' | 'near' | 'limited';
18
+ /** One window, as a share used. */
19
+ export interface Share {
20
+ /** Used, 0 to 100. */
21
+ percent: number;
22
+ state: State;
23
+ /** When it starts over, RFC 3339; '' for a session not running, which starts with the next request. */
24
+ resets: string;
25
+ }
26
+ /**
27
+ * One window off the wire, or null for a window that bounds nothing. The
28
+ * server states a window's state only when the plan sets it a limit
29
+ * (limits_ops.go `window`), so a window with no state is unbounded and not drawn.
30
+ */
31
+ export declare function share(v: unknown): Share | null;
32
+ /** Which meter an account reads. */
33
+ export type Kind = 'plan' | 'free' | 'credits';
34
+ /**
35
+ * The meter for a plan slug (billing's or the limits', `free` or '' for none),
36
+ * the prepaid balance in cents (null where it could not be read) and the tier
37
+ * class billing serves the account under: a paid plan's windows — a rung, or a
38
+ * paid class with no rung (a plan recorded outside checkout, a partner org) —
39
+ * and with no plan, the balance where there is money in it, else the free
40
+ * allowance.
41
+ */
42
+ export declare function kind(plan: string | null | undefined, balance: number | null, tier?: string | null): Kind;
43
+ /**
44
+ * When something starts over, as a sentence says it: a time for within a day
45
+ * (`5:00 PM`), else a date (`Nov 1`), periods ending on UTC days. '' for none.
46
+ */
47
+ export declare function when(iso: string, now?: number): string;
48
+ /**
49
+ * What a reader whose plan's included usage is used is told: the plan, which
50
+ * models, and when they come back — `Your Max 20x plan’s included premium model
51
+ * usage is used until 5:00 PM.` In the language of `t`.
52
+ */
53
+ export declare function spent(l: Label | null, classes: readonly string[], resets: string, now?: number, t?: Say): string;
54
+ /**
55
+ * The ways past a spent allowance, in this order and two at most: keep going
56
+ * on credits — or, with none the server would let pay, add some — then the
57
+ * upgrade; and a switch to another model where the server offers one. Taken
58
+ * from what the server sent, so nothing is offered that it would refuse.
59
+ */
60
+ export declare function ways<A extends {
61
+ kind: string;
62
+ label: string;
63
+ }>(actions: readonly A[], t?: Say): A[];
@@ -0,0 +1,155 @@
1
+ /**
2
+ * A plan as a person reads it, and how much of it is used.
3
+ *
4
+ * NAMED BY FAMILY. A slug is the catalog's rung (`max-20x`); a person reads the
5
+ * family — Free, Go, Pro, Max, Team, Agency, Enterprise — with the rung inside
6
+ * it as a small tag (`20x`). A slug outside the families reads as words
7
+ * (`growth-plus` is Growth Plus); one that is an id is never printed, and reads
8
+ * as the tier it is served under. Where billing names the plan the subscription
9
+ * is on (`GET /v1/billing/tier` `planName`, `Unlimited`), that name is the
10
+ * label, whatever the slug.
11
+ *
12
+ * MEASURED IN SHARES. `GET /v1/ai/limits` (cloud apps/ai/limits_ops.go) answers
13
+ * every window as a percent used, its state and when it starts over — the
14
+ * session, the UTC day, and each class's billing period — never an amount.
15
+ *
16
+ * THREE KINDS OF ACCOUNT, three meters: on a PLAN its windows are the meter, on
17
+ * FREE the free allowance left today is, and with CREDITS and no plan (pay as
18
+ * you go) the balance is. A plan's meter never shows money.
19
+ *
20
+ * WORDS in English: a family's name is a name, the rest is marked (`phrase`)
21
+ * or takes the caller's @hanzo/i18n `t`, so a surface says it in the reader's
22
+ * language.
23
+ */
24
+ import { phrase } from '@hanzo/i18n';
25
+ import { english } from './say.js';
26
+ /** The families, by the slug's first word. `dev` is the slug Pro is sold under. */
27
+ const FAMILY = {
28
+ free: phrase('Free'),
29
+ go: 'Go',
30
+ dev: 'Pro',
31
+ pro: 'Pro',
32
+ max: 'Max',
33
+ team: 'Team',
34
+ agency: 'Agency',
35
+ advisory: 'Agency',
36
+ dedicated: 'Agency',
37
+ pod: 'Agency',
38
+ enterprise: 'Enterprise',
39
+ };
40
+ /** The tier classes billing serves a rung under (`GET /v1/billing/tier` `tier.name`) that name a plan. */
41
+ const TIER = { pro: 'Pro', enterprise: 'Enterprise' };
42
+ /** A slug that is an id rather than a name: a UUID, a run of hex, a prefixed id, or digits. */
43
+ const ID = /^[0-9a-f]{8}-[0-9a-f]{4}-|[0-9a-f]{12,}|^[a-z]+_[0-9a-z]{6,}$|^\d+$/i;
44
+ /** A word as a title reads it; a multiple (`2x`) stays as it is. */
45
+ const word = (w) => (/^\d+x$/.test(w) ? w : w.charAt(0).toUpperCase() + w.slice(1));
46
+ /**
47
+ * A plan as a person reads it: the plan's display name where billing gives one
48
+ * (`Unlimited`), else from the slug billing serves (`max-20x`) and the tier
49
+ * class beside it (`pro`). Null where none names a plan: no name, no slug and a
50
+ * free or trial tier, which is no plan at all.
51
+ */
52
+ export function label(slug, tier, name) {
53
+ const named = (name ?? '').trim();
54
+ if (named)
55
+ return { name: named, tag: '' };
56
+ const raw = (slug ?? '').trim().toLowerCase();
57
+ const fallback = () => {
58
+ const t = TIER[(tier ?? '').trim().toLowerCase()];
59
+ return t ? { name: t, tag: '' } : null;
60
+ };
61
+ if (!raw)
62
+ return fallback();
63
+ // A rung that is an id still IS a rung: the account is on a plan, so it reads as one.
64
+ if (ID.test(raw))
65
+ return fallback() ?? { name: phrase('Paid plan'), tag: '' };
66
+ const s = raw.replace(/[\s_]+/g, '-');
67
+ const [head, ...rest] = s.split('-').filter(Boolean);
68
+ const family = FAMILY[head];
69
+ if (!family)
70
+ return { name: s.split('-').filter(Boolean).map(word).join(' '), tag: '' };
71
+ const tail = rest.join('-');
72
+ const tag = /^\d+x$/.test(tail) ? tail : /^(annual|yearly|year)$/.test(tail) ? phrase('Annual') : tail ? rest.map(word).join(' ') : '';
73
+ return { name: family, tag };
74
+ }
75
+ /** A label as a sentence says it: `Max 20x`. */
76
+ export const said = (l) => (l ? (l.tag ? `${l.name} ${l.tag}` : l.name) : '');
77
+ const STATES = ['ok', 'near', 'limited'];
78
+ const obj = (v) => (v && typeof v === 'object' && !Array.isArray(v) ? v : null);
79
+ /**
80
+ * One window off the wire, or null for a window that bounds nothing. The
81
+ * server states a window's state only when the plan sets it a limit
82
+ * (limits_ops.go `window`), so a window with no state is unbounded and not drawn.
83
+ */
84
+ export function share(v) {
85
+ const o = obj(v);
86
+ const state = STATES.find((s) => s === o?.state);
87
+ if (!o || !state || typeof o.percent !== 'number' || !Number.isFinite(o.percent))
88
+ return null;
89
+ return {
90
+ percent: Math.min(100, Math.max(0, Math.round(o.percent))),
91
+ state,
92
+ resets: typeof o.resets_at === 'string' ? o.resets_at : '',
93
+ };
94
+ }
95
+ /**
96
+ * The meter for a plan slug (billing's or the limits', `free` or '' for none),
97
+ * the prepaid balance in cents (null where it could not be read) and the tier
98
+ * class billing serves the account under: a paid plan's windows — a rung, or a
99
+ * paid class with no rung (a plan recorded outside checkout, a partner org) —
100
+ * and with no plan, the balance where there is money in it, else the free
101
+ * allowance.
102
+ */
103
+ export function kind(plan, balance, tier) {
104
+ const p = (plan ?? '').trim().toLowerCase();
105
+ if ((p && p !== 'free') || TIER[(tier ?? '').trim().toLowerCase()])
106
+ return 'plan';
107
+ return balance !== null && balance > 0 ? 'credits' : 'free';
108
+ }
109
+ /**
110
+ * When something starts over, as a sentence says it: a time for within a day
111
+ * (`5:00 PM`), else a date (`Nov 1`), periods ending on UTC days. '' for none.
112
+ */
113
+ export function when(iso, now = Date.now()) {
114
+ const t = iso ? Date.parse(iso) : NaN;
115
+ if (Number.isNaN(t))
116
+ return '';
117
+ const d = new Date(t);
118
+ return t - now < 86_400_000
119
+ ? d.toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit' })
120
+ : d.toLocaleDateString('en-US', { timeZone: 'UTC', month: 'short', day: 'numeric' });
121
+ }
122
+ /** A class of model as a sentence names it. */
123
+ const CLASS = { premium: 'premium', ours: 'Hanzo' };
124
+ /** What was used, by the classes that used it, as one phrase each. */
125
+ const USED = {
126
+ '': phrase('usage'),
127
+ premium: phrase('premium model usage'),
128
+ Hanzo: phrase('Hanzo model usage'),
129
+ 'premium and Hanzo': phrase('premium and Hanzo model usage'),
130
+ };
131
+ /**
132
+ * What a reader whose plan's included usage is used is told: the plan, which
133
+ * models, and when they come back — `Your Max 20x plan’s included premium model
134
+ * usage is used until 5:00 PM.` In the language of `t`.
135
+ */
136
+ export function spent(l, classes, resets, now = Date.now(), t = english) {
137
+ const names = classes.map((c) => CLASS[c]).filter(Boolean).join(' and ');
138
+ const what = USED[names] !== undefined ? t(USED[names]) : `${names} model usage`;
139
+ const at = when(resets, now);
140
+ if (!l)
141
+ return at ? t('Your plan’s included {what} is used until {time}.', { what, time: at }) : t('Your plan’s included {what} is used.', { what });
142
+ const plan = said({ name: t(l.name), tag: l.tag ? t(l.tag) : '' });
143
+ return at ? t('Your {plan} plan’s included {what} is used until {time}.', { plan, what, time: at }) : t('Your {plan} plan’s included {what} is used.', { plan, what });
144
+ }
145
+ /**
146
+ * The ways past a spent allowance, in this order and two at most: keep going
147
+ * on credits — or, with none the server would let pay, add some — then the
148
+ * upgrade; and a switch to another model where the server offers one. Taken
149
+ * from what the server sent, so nothing is offered that it would refuse.
150
+ */
151
+ export function ways(actions, t = english) {
152
+ const pick = (kind) => actions.find((a) => a.kind === kind);
153
+ const topup = pick('topup');
154
+ return [pick('credits') ?? (topup ? { ...topup, label: t('Add credits') } : undefined), pick('upgrade'), pick('switch')].filter((a) => a !== undefined);
155
+ }
@@ -0,0 +1 @@
1
+ export declare function Plans(): import("react").JSX.Element;