@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,111 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Notifications: the organization's webhooks. Each is an https address that
4
+ * every matching event is POSTed to, signed with a secret shown once, when the
5
+ * webhook is added. A test sends one signed event now; the log says what each
6
+ * delivery got back.
7
+ *
8
+ * Its words are the reader's language (@hanzo/i18n `t`); an address, an event
9
+ * pattern, a description and what an endpoint answered are drawn as given.
10
+ */
11
+ import { SizableText, XStack, YStack } from '@hanzo/gui';
12
+ import { useI18n } from '@hanzo/i18n/react';
13
+ import { Copy, Plus, Webhook, X } from '@hanzogui/lucide-icons-2';
14
+ import { Button, Input } from '@hanzo/ui';
15
+ import { useState } from 'react';
16
+ import { told } from '../api/call.js';
17
+ import { add, deliveries, endpoints, patterns, refuse, remove, test } from '../api/webhooks.js';
18
+ import { useRead } from '../data.js';
19
+ import { copy } from '../clipboard.js';
20
+ import { useHost, useTarget } from '../host.js';
21
+ import { Card, day, Field, Group, Heading, Note, Row, Soft } from './ui.js';
22
+ const mono = { fontFamily: 'var(--f-mono, ui-monospace, monospace)' };
23
+ export function Notifications() {
24
+ const { t } = useI18n();
25
+ const host = useHost();
26
+ const target = useTarget();
27
+ const signed = Boolean(host.person);
28
+ const list = useRead(signed ? () => endpoints(target) : null, [], [target, signed]);
29
+ const [adding, setAdding] = useState(false);
30
+ const [url, setUrl] = useState('');
31
+ const [events, setEvents] = useState('');
32
+ const [description, setDescription] = useState('');
33
+ const [secret, setSecret] = useState('');
34
+ const [log, setLog] = useState(null);
35
+ const [working, setWorking] = useState(false);
36
+ const [note, setNote] = useState('');
37
+ if (!signed) {
38
+ return (_jsxs(YStack, { gap: "$5", children: [_jsx(Heading, { title: t('Notifications') }), _jsx(Soft, { children: t('Sign in to see this organization’s webhooks.') })] }));
39
+ }
40
+ const act = async (what) => {
41
+ setWorking(true);
42
+ setNote('');
43
+ try {
44
+ setNote(await what());
45
+ }
46
+ catch (e) {
47
+ setNote(told(e, t));
48
+ }
49
+ finally {
50
+ setWorking(false);
51
+ }
52
+ };
53
+ const create = () => {
54
+ const draft = { url, events: patterns(events), description };
55
+ const why = refuse(draft);
56
+ if (why) {
57
+ setNote(t(why));
58
+ return;
59
+ }
60
+ void act(async () => {
61
+ const e = await add(target, draft);
62
+ setSecret(e.secret);
63
+ setAdding(false);
64
+ setUrl('');
65
+ setEvents('');
66
+ setDescription('');
67
+ list.reload();
68
+ return t('{url} is added', { url: e.url });
69
+ });
70
+ };
71
+ const trial = (e) => void act(async () => {
72
+ const r = await test(target, e.id);
73
+ if (log?.id === e.id)
74
+ setLog({ id: e.id, rows: await deliveries(target, e.id) });
75
+ // What the endpoint answered is its own; the sentence around it is ours.
76
+ return r.delivered
77
+ ? t('The test reached {url}: {status} in {ms} ms', { url: e.url, status: r.status, ms: r.ms })
78
+ : r.error
79
+ ? t('The test did not reach {url}: {error}', { url: e.url, error: r.error })
80
+ : r.status
81
+ ? t('The test did not reach {url}: it answered {status}', { url: e.url, status: r.status })
82
+ : t('The test did not reach {url}: no answer', { url: e.url });
83
+ });
84
+ const drop = (e) => void act(async () => {
85
+ await remove(target, e.id);
86
+ if (log?.id === e.id)
87
+ setLog(null);
88
+ list.reload();
89
+ return t('{url} is deleted', { url: e.url });
90
+ });
91
+ const show = (e) => {
92
+ if (log?.id === e.id) {
93
+ setLog(null);
94
+ return;
95
+ }
96
+ void act(async () => {
97
+ setLog({ id: e.id, rows: await deliveries(target, e.id) });
98
+ return '';
99
+ });
100
+ };
101
+ return (_jsxs(YStack, { gap: "$6", children: [_jsx(Heading, { title: t('Notifications'), detail: host.org
102
+ ? t('Webhooks: events in {org}, POSTed and signed to an address you run.', { org: host.org })
103
+ : t('Webhooks: events in this organization, POSTed and signed to an address you run.'), action: adding || !host.admin ? undefined : (_jsxs(Button, { size: "sm", variant: "outline", onPress: () => setAdding(true), children: [_jsx(Plus, { size: 14 }), " ", t('Add webhook')] })) }), adding ? (_jsxs(YStack, { gap: "$3", p: "$4", borderWidth: 1, borderColor: "$borderColor", rounded: "$3", children: [_jsx(Field, { label: t('Endpoint URL'), hint: t('https only.'), children: _jsx(Input, { value: url, onChangeText: setUrl, placeholder: "https://example.com/hooks/hanzo", "aria-label": t('Endpoint URL'), autoCapitalize: "none", inputMode: "url" }) }), _jsx(Field, { label: t('Events'), hint: t('Subject patterns, comma separated, such as {example} — leave empty for every event.', { example: 'commerce.order.>' }), children: _jsx(Input, { value: events, onChangeText: setEvents, placeholder: "commerce.order.>, event.>", "aria-label": t('Events'), autoCapitalize: "none" }) }), _jsx(Field, { label: t('Description'), children: _jsx(Input, { value: description, onChangeText: setDescription, placeholder: t('What this endpoint is for'), "aria-label": t('Description') }) }), _jsxs(XStack, { gap: "$2", justify: "flex-end", children: [_jsx(Button, { size: "sm", variant: "ghost", onPress: () => setAdding(false), children: t('Cancel') }), _jsx(Button, { size: "sm", disabled: working || !url.trim(), onPress: create, children: t('Add webhook') })] })] })) : null, secret ? (_jsxs(YStack, { gap: "$2", p: "$4", borderWidth: 1, borderColor: "$ink", rounded: "$3", children: [_jsx(SizableText, { size: "$2", color: "$ink", children: t('Signing secret') }), _jsx(SizableText, { size: "$1", color: "$soft", children: t('Shown this once. Keep it where your endpoint checks each delivery’s signature.') }), _jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(SizableText, { flex: 1, size: "$2", color: "$ink", fontFamily: "$mono", "$platform-web": { wordBreak: 'break-all' }, "aria-label": t('Signing secret'), children: secret }), _jsxs(Button, { size: "sm", variant: "outline", onPress: () => void copy(secret).then((ok) => ok && setNote(t('The secret is copied'))), children: [_jsx(Copy, { size: 14 }), " ", t('Copy')] }), _jsx(XStack, { render: "button", "aria-label": t('Hide the secret'), p: "$1", onPress: () => setSecret(''), children: _jsx(X, { size: 14 }) })] })] })) : null, _jsx(Group, { title: t('Webhooks'), children: list.error ? (_jsx(Soft, { children: told(list.error, t) })) : list.loading && !list.value.length ? (_jsx(Soft, { children: t('Reading webhooks…') })) : list.value.length === 0 ? (_jsx(Card, { children: _jsx(Soft, { children: t('No webhooks yet.') }) })) : (_jsx(Card, { children: list.value.map((e, i) => (_jsxs(YStack, { borderTopWidth: i ? 1 : 0, borderColor: "$borderColor", children: [_jsx(Row, { first: true, mono: true, leading: _jsx(Webhook, { size: 16 }), title: e.url, detail: [
104
+ e.description,
105
+ e.events.length ? e.events.join(', ') : t('every event'),
106
+ e.status === 'disabled' ? t('disabled') : '',
107
+ t('{delivered} delivered, {failed} failed this week', { delivered: e.deliveries, failed: e.failures }),
108
+ ]
109
+ .filter(Boolean)
110
+ .join(' · '), trailing: host.admin ? (_jsx(XStack, { render: "button", "aria-label": t('Delete {url}', { url: e.url }), p: "$1", onPress: () => drop(e), children: _jsx(X, { size: 14 }) })) : undefined }), _jsxs(XStack, { gap: "$2", px: "$3", pb: "$2.5", flexWrap: "wrap", children: [host.admin ? (_jsx(Button, { size: "sm", variant: "outline", disabled: working, "aria-label": t('Send a test to {url}', { url: e.url }), onPress: () => trial(e), children: t('Send test') })) : null, _jsx(Button, { size: "sm", variant: "ghost", disabled: working, "aria-label": t('Deliveries to {url}', { url: e.url }), onPress: () => show(e), children: log?.id === e.id ? t('Hide deliveries') : t('Deliveries') })] }), log?.id === e.id ? (_jsx(YStack, { px: "$3", pb: "$3", gap: "$1.5", children: log.rows.length === 0 ? (_jsx(SizableText, { size: "$1", color: "$soft", children: t('Nothing delivered yet.') })) : (log.rows.map((a, n) => (_jsxs(XStack, { gap: "$3", items: "baseline", children: [_jsx(SizableText, { size: "$1", color: a.status === 'ok' ? '$ink' : '$soft', width: 64, children: a.status === 'ok' ? t('OK') : a.status === 'failed' ? t('Failed') : t('Retrying') }), _jsx(SizableText, { flex: 1, size: "$1", color: "$soft", numberOfLines: 1, style: mono, children: `${a.subject}${a.code ? ` → ${a.code}` : ''}${a.error ? ` · ${a.error}` : ''}` }), _jsx(SizableText, { size: "$1", color: "$soft", "$max-sm": { display: 'none' }, children: day(a.at) })] }, `${a.at}-${n}`)))) })) : null] }, e.id))) })) }), _jsx(Note, { children: note })] }));
111
+ }
@@ -0,0 +1,17 @@
1
+ import { type Target } from '../api/call.ts';
2
+ import { type Standing } from '../standing.ts';
3
+ /** The view, once read. */
4
+ export declare function Reading({ s, target, onPlans, onBilling, now, }: {
5
+ s: Standing;
6
+ target: Target;
7
+ onPlans?: () => void;
8
+ onBilling: () => void;
9
+ now?: number;
10
+ }): import("react").JSX.Element;
11
+ /** The plan's usage, read as `target`. */
12
+ export declare function Plan({ target, onPlans, onBilling, now }: {
13
+ target: Target;
14
+ onPlans?: () => void;
15
+ onBilling: () => void;
16
+ now?: number;
17
+ }): import("react").JSX.Element;
@@ -0,0 +1,131 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * The plan's usage, as the one view every Usage page draws: Dev's Settings,
4
+ * the rooms' Settings and hanzo.ai's organization settings.
5
+ *
6
+ * On a PLAN: its name, its period, the request windows (session, day) and each
7
+ * class of model's share of the period with its shorter window — shares only,
8
+ * never money — and the choice of what happens when the allowance runs out:
9
+ * `Use credits when my plan's allowance runs out` (PUT /v1/ai/limits), off
10
+ * until the payer turns it on, and saying what it spends. Once a class is used
11
+ * up it leads with that, its reset, and the two ways on.
12
+ *
13
+ * On FREE: the share of today's free allowance left and the shared pool's
14
+ * state, and Upgrade. With CREDITS and no plan: the balance, because it is
15
+ * what the account spends.
16
+ *
17
+ * It reads as `target`, so it needs no host: a host says where the plans and
18
+ * Billing are (`onPlans`, `onBilling`).
19
+ *
20
+ * Its words are the reader's language (@hanzo/i18n `t`); a plan's name, a
21
+ * model's and the ways on the server offers are drawn as given.
22
+ */
23
+ import { SizableText, XStack, YStack } from '@hanzo/gui';
24
+ import { phrase } from '@hanzo/i18n';
25
+ import { useI18n } from '@hanzo/i18n/react';
26
+ import { Button, Switch } from '@hanzo/ui';
27
+ import { useState } from 'react';
28
+ import { money } from '../api/billing.js';
29
+ import { told } from '../api/call.js';
30
+ import { allow, CLASSES } from '../api/limits.js';
31
+ import { INK, Title } from '../meter.js';
32
+ import { spent, ways, when } from '../plan.js';
33
+ import { left, useStanding } from '../standing.js';
34
+ import { Card, day, Group, Note, Row, Soft } from './ui.js';
35
+ const NAME = { premium: phrase('Premium models'), ours: phrase('Hanzo models') };
36
+ const FILL = { ok: '$ink', near: '$yellow10', limited: '$red10' };
37
+ /** A thin bar of a share used. */
38
+ function Bar({ percent, state }) {
39
+ return (_jsx(YStack, { height: 6, rounded: 999, bg: "$hover", overflow: "hidden", role: "progressbar", "aria-valuenow": percent, "aria-valuemin": 0, "aria-valuemax": 100, children: _jsx(YStack, { height: 6, width: `${percent}%`, rounded: 999, bg: FILL[state] }) }));
40
+ }
41
+ /** One measured row: what, how much of it is used, when it starts over, its bar, and what hangs under it. */
42
+ function Gauge({ title, w, first, says, now, children }) {
43
+ const { t } = useI18n();
44
+ const at = when(w.resets, now);
45
+ return (_jsxs(YStack, { gap: "$2", px: "$3", py: "$3", borderTopWidth: first ? 0 : 1, borderColor: "$borderColor", "data-slot": "plan-window", "data-state": w.state, children: [_jsxs(XStack, { items: "baseline", justify: "space-between", flexWrap: "wrap", columnGap: "$3", rowGap: "$1", children: [_jsx(SizableText, { size: "$2", color: "$ink", children: title }), _jsx(SizableText, { size: "$1", color: INK[w.state], style: { fontVariantNumeric: 'tabular-nums' }, children: [says ?? t('{n}% used', { n: w.percent }), at ? t('Resets {time}', { time: at }) : ''].filter(Boolean).join(' · ') })] }), _jsx(Bar, { percent: w.percent, state: w.state }), children] }));
46
+ }
47
+ /** The view, once read. */
48
+ export function Reading({ s, target, onPlans, onBilling, now, }) {
49
+ const { t } = useI18n();
50
+ const [after, setAfter] = useState(null);
51
+ const [busy, setBusy] = useState(false);
52
+ const [note, setNote] = useState('');
53
+ const l = after ?? s.limits;
54
+ const upgrade = l?.actions.find((a) => a.kind === 'upgrade');
55
+ const choose = async (on) => {
56
+ setBusy(true);
57
+ setNote('');
58
+ try {
59
+ setAfter(await allow(target, on));
60
+ }
61
+ catch (e) {
62
+ setNote(told(e, t));
63
+ }
64
+ finally {
65
+ setBusy(false);
66
+ }
67
+ };
68
+ const go = (a) => {
69
+ if (a.kind === 'credits')
70
+ return void choose(true);
71
+ if (a.kind === 'upgrade' && onPlans)
72
+ return onPlans();
73
+ if (a.kind === 'topup')
74
+ return onBilling();
75
+ if (a.url)
76
+ window.location.assign(a.url);
77
+ };
78
+ // On a plan: a class used up, or one model paused, leads with its ways on, the upgrade among them.
79
+ const used = s.kind === 'plan' && l ? CLASSES.filter((c) => l.classes[c]?.state === 'limited') : [];
80
+ const capped = s.kind === 'plan' ? (l?.paused[0] ?? null) : null;
81
+ const resets = used.map((c) => l.classes[c].resets).sort()[0] ?? '';
82
+ const until = capped ? when(capped.resets, now) : '';
83
+ const model = capped ? capped.model.replace(/\*$/, '') : '';
84
+ const notice = used.length
85
+ ? spent(s.label, used, resets, now, t)
86
+ : capped
87
+ ? capped.fallback
88
+ ? until
89
+ ? t('{model} is paused until {time}; chat continues on {fallback}.', { model, time: until, fallback: capped.fallback })
90
+ : t('{model} is paused; chat continues on {fallback}.', { model, fallback: capped.fallback })
91
+ : until
92
+ ? t('{model} is paused until {time}.', { model, time: until })
93
+ : t('{model} is paused.', { model })
94
+ : '';
95
+ const head = (_jsxs(XStack, { items: "center", gap: "$3", flexWrap: "wrap", "data-slot": "plan-head", children: [_jsxs(YStack, { flex: 1, minW: 200, gap: "$1", children: [s.label ? _jsx(Title, { label: s.label, size: "$5" }) : null, _jsx(SizableText, { size: "$2", color: "$soft", children: s.kind === 'plan'
96
+ ? l?.start && l.end
97
+ ? t('Current period {start} – {end}', { start: day(l.start), end: day(l.end) })
98
+ : t('Your plan')
99
+ : s.kind === 'free'
100
+ ? t('Limited usage of free models, from a pool every free account shares.')
101
+ : t('No plan. Usage is paid from your credits.') })] }), (upgrade && !notice) || (s.kind !== 'plan' && onPlans) ? (_jsx(Button, { size: "sm", variant: s.kind === 'plan' ? 'outline' : 'primary', onPress: () => (upgrade ? go(upgrade) : onPlans?.()), children: upgrade?.label || t('Upgrade') })) : null] }));
102
+ if (s.kind === 'free') {
103
+ const share = left(s.allowance);
104
+ const a = s.allowance;
105
+ return (_jsxs(YStack, { gap: "$5", "data-slot": "plan-usage", "data-kind": "free", children: [head, a && share !== null ? (_jsxs(Card, { children: [_jsx(Gauge, { first: true, title: a.window === 'hour' ? t('This hour') : t('Today'), w: { percent: 100 - share, state: share === 0 ? 'limited' : share <= 20 ? 'near' : 'ok', resets: a.resets }, says: t('{n}% left', { n: share }), now: now }), a.pool ? (_jsx(Row, { title: t('Shared pool'), detail: a.pool.state === 'exhausted'
106
+ ? when(a.pool.resets, now)
107
+ ? t('Used up until {time}', { time: when(a.pool.resets, now) })
108
+ : t('Used up')
109
+ : a.pool.state === 'busy'
110
+ ? t('Busy. Try again in a minute.')
111
+ : t('Every free request is being served.') })) : null] })) : (_jsx(Soft, { children: t('The free allowance could not be read.') })), _jsxs(XStack, { items: "center", gap: "$3", flexWrap: "wrap", children: [_jsx(SizableText, { size: "$2", color: "$soft", flex: 1, minW: 200, children: t('Credits pay as you go for any model, with or without a plan.') }), _jsx(Button, { size: "sm", variant: "outline", onPress: onBilling, children: t('Add credits') })] })] }));
112
+ }
113
+ if (s.kind === 'credits') {
114
+ return (_jsxs(YStack, { gap: "$5", "data-slot": "plan-usage", "data-kind": "credits", children: [head, _jsx(Card, { children: _jsx(Row, { first: true, title: t('Credits'), detail: t('What your usage is paid from, at each model’s list price.'), trailing: _jsx(SizableText, { size: "$2", color: "$ink", "data-slot": "plan-balance", children: s.balance === null ? t('Unavailable') : money(s.balance) }) }) }), _jsx(XStack, { children: _jsx(Button, { size: "sm", variant: "outline", onPress: onBilling, children: t('Add funds') }) })] }));
115
+ }
116
+ const on = l?.credits ?? false;
117
+ return (_jsxs(YStack, { gap: "$5", "data-slot": "plan-usage", "data-kind": "plan", children: [head, notice ? (_jsxs(XStack, { items: "center", gap: "$2.5", flexWrap: "wrap", px: "$3", py: "$2.5", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", "data-slot": "plan-spent", children: [_jsx(YStack, { width: 8, height: 8, rounded: 4, bg: "$red10", shrink: 0, "aria-hidden": true }), _jsx(SizableText, { size: "$2", color: "$ink", flex: 1, minW: 200, children: notice }), _jsx(XStack, { gap: "$2", flexWrap: "wrap", children: ways(l?.actions ?? [], t).map((a, i) => (_jsx(Button, { size: "sm", variant: i === 0 ? 'primary' : 'outline', disabled: busy, "data-kind": a.kind, onPress: () => go(a), children: a.label }, a.kind))) })] })) : null, !l ? (_jsx(Soft, { children: t('The plan’s usage could not be read.') })) : !l.session && !l.day && !Object.keys(l.classes).length ? (_jsx(Soft, { children: t('This plan sets no usage limits.') })) : (_jsxs(_Fragment, { children: [l.session || l.day ? (_jsx(Group, { title: t('Requests'), detail: t('Every request the plan covers counts in both.'), children: _jsxs(Card, { children: [l.session ? (_jsx(Gauge, { first: true, title: t('Session'), w: l.session, says: l.session.resets ? undefined : [t('{n}% used', { n: l.session.percent }), t('Starts with your next request')].join(' · '), now: now })) : null, l.day ? _jsx(Gauge, { first: !l.session, title: t('Today'), w: l.day, now: now }) : null] }) })) : null, Object.keys(l.classes).length ? (_jsx(Group, { title: t('By model class'), detail: t('Each class’s share of the billing period, and of its shorter window where the plan sets one.'), children: _jsx(Card, { children: CLASSES.filter((c) => l.classes[c]).map((c, i) => {
118
+ const k = l.classes[c];
119
+ return (_jsx(YStack, { "data-class": c, children: _jsx(Gauge, { first: i === 0, title: t(NAME[c]), w: k, says: k.paying === 'credits' ? [t('{n}% used', { n: k.percent }), t('Paying from credits')].join(' · ') : undefined, now: now, children: k.window ? (_jsxs(XStack, { gap: "$2", items: "center", "data-slot": "plan-short", children: [_jsx(SizableText, { size: "$1", color: "$soft", shrink: 0, children: t('Shorter window') }), _jsx(YStack, { flex: 1, children: _jsx(Bar, { percent: k.window.percent, state: k.window.state }) }), _jsx(SizableText, { size: "$1", color: "$soft", shrink: 0, children: [`${k.window.percent}%`, when(k.window.resets, now) ? t('Resets {time}', { time: when(k.window.resets, now) }) : ''].filter(Boolean).join(' · ') })] })) : null }) }, c));
120
+ }) }) })) : null, _jsx(Group, { title: t('When the allowance runs out'), detail: t('Credits are separate from your plan’s usage allowance. They live in Billing.'), children: _jsxs(Card, { children: [_jsx(Row, { first: true, title: t('Use credits when my plan’s allowance runs out'), detail: on
121
+ ? t('On. A model whose included usage is used keeps working, paid from credits — prepaid first, then granted credit where the model takes it — at its list price.')
122
+ : t('Off. Chat continues on a free model, and other requests wait for the plan to reset.'), trailing: _jsx(Switch, { "aria-label": t('Use credits when my plan’s allowance runs out'), checked: on, disabled: busy, onCheckedChange: (next) => void choose(next) }) }), _jsx(Row, { title: t('Credits'), detail: s.balance === 0 ? t('There are no credits to spend yet.') : t('The balance, top-ups and auto-reload.'), trailing: _jsx(Button, { size: "sm", variant: "ghost", onPress: onBilling, children: s.balance === 0 ? t('Add credits') : t('Billing') }) })] }) })] })), _jsx(Note, { children: note })] }));
123
+ }
124
+ /** The plan's usage, read as `target`. */
125
+ export function Plan({ target, onPlans, onBilling, now }) {
126
+ const { t } = useI18n();
127
+ const read = useStanding(target);
128
+ if (read.value)
129
+ return _jsx(Reading, { s: read.value, target: target, onPlans: onPlans, onBilling: onBilling, now: now });
130
+ return _jsx(Soft, { children: read.error ? told(read.error, t) : t('Reading the plan…') });
131
+ }
@@ -0,0 +1 @@
1
+ export declare function Privacy(): import("react").JSX.Element;
@@ -0,0 +1,76 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Privacy: the two data-sharing answers IAM records for the person — whether
4
+ * Hanzo may train on their data, and whether anonymous usage is counted — and
5
+ * who can see the organization's projects: a public one is in the community
6
+ * catalogue with its source readable by anyone, until it is made private.
7
+ *
8
+ * Its words are the reader's language (@hanzo/i18n `t`); a project's name is
9
+ * drawn as given.
10
+ */
11
+ import { YStack } from '@hanzo/gui';
12
+ import { useI18n } from '@hanzo/i18n/react';
13
+ import { Button, Switch } from '@hanzo/ui';
14
+ import { useState } from 'react';
15
+ import { told } from '../api/call.js';
16
+ import { consent, setConsent } from '../api/consent.js';
17
+ import { change, projects } from '../api/projects.js';
18
+ import { useRead } from '../data.js';
19
+ import { useHost, useTarget } from '../host.js';
20
+ import { Card, Group, Heading, Note, Row, Soft } from './ui.js';
21
+ export function Privacy() {
22
+ const { t } = useI18n();
23
+ const host = useHost();
24
+ const target = useTarget();
25
+ const signed = Boolean(host.person);
26
+ const answers = useRead(signed ? () => consent(target) : null, null, [target, signed]);
27
+ const published = useRead(signed ? () => projects(target) : null, [], [target, signed]);
28
+ const [shown, setShown] = useState(null);
29
+ const [busy, setBusy] = useState('');
30
+ const [note, setNote] = useState('');
31
+ if (!signed) {
32
+ return (_jsxs(YStack, { gap: "$5", children: [_jsx(Heading, { title: t('Privacy') }), _jsx(Soft, { children: t('Sign in to see your privacy settings.') })] }));
33
+ }
34
+ const now = shown ?? answers.value;
35
+ const answer = async (change) => {
36
+ setBusy('consent');
37
+ setNote('');
38
+ try {
39
+ setShown(await setConsent(target, change));
40
+ }
41
+ catch (e) {
42
+ setNote(told(e, t));
43
+ }
44
+ finally {
45
+ setBusy('');
46
+ }
47
+ };
48
+ const flip = async (p) => {
49
+ setBusy(p.slug);
50
+ setNote('');
51
+ try {
52
+ const saved = await change(target, p.slug, { visibility: p.visibility === 'private' ? 'public' : 'private' });
53
+ published.reload();
54
+ // The two visibilities this page offers are said in words; any other is the platform's, as given.
55
+ setNote(saved.visibility === 'public'
56
+ ? t('{name} is public', { name: saved.name })
57
+ : saved.visibility === 'private'
58
+ ? t('{name} is private', { name: saved.name })
59
+ : saved.visibility
60
+ ? t('{name} is {visibility}', { name: saved.name, visibility: saved.visibility })
61
+ : t('{name} is saved', { name: saved.name }));
62
+ }
63
+ catch (e) {
64
+ setNote(told(e, t));
65
+ }
66
+ finally {
67
+ setBusy('');
68
+ }
69
+ };
70
+ const training = now?.training ?? '';
71
+ return (_jsxs(YStack, { gap: "$6", children: [_jsx(Heading, { title: t('Privacy'), detail: t('What Hanzo may do with your data, and what your organization shows the world.') }), _jsx(Group, { title: t('Your data'), detail: t('Recorded on your Hanzo account and honoured by every Hanzo surface.'), children: answers.error && !now ? (_jsx(Soft, { children: told(answers.error, t) })) : !now ? (_jsx(Soft, { children: t('Reading your answers…') })) : (_jsxs(Card, { children: [_jsx(Row, { first: true, title: t('Help improve Hanzo models'), detail: training === 'granted'
72
+ ? t('Hanzo may train on your prompts and runs.')
73
+ : training === 'refused'
74
+ ? t('Hanzo does not train on your data.')
75
+ : t('Not answered yet. Until you say yes, Hanzo does not train on your data.'), trailing: _jsx(Switch, { "aria-label": t('Help improve Hanzo models'), checked: training === 'granted', disabled: busy === 'consent', onCheckedChange: (on) => void answer({ training: on ? 'granted' : 'refused' }) }) }), _jsx(Row, { title: t('Usage insights'), detail: t('Anonymous counts of how the product is used. No prompts, code or answers.'), trailing: _jsx(Switch, { "aria-label": t('Usage insights'), checked: now.insights, disabled: busy === 'consent', onCheckedChange: (on) => void answer({ insights: on }) }) })] })) }), _jsx(Group, { title: t('Projects'), detail: t('A public project is listed in the community catalogue, and anyone can read its source. Keeping one private needs a paid plan.'), children: published.error ? (_jsx(Soft, { children: told(published.error, t) })) : published.loading && !published.value.length ? (_jsx(Soft, { children: t('Reading projects…') })) : !published.value.length ? (_jsx(Soft, { children: t('Your organization has no projects yet.') })) : (_jsx(Card, { children: published.value.map((p, i) => (_jsx(Row, { first: i === 0, title: p.name, detail: p.visibility === 'private' ? t('Private') : p.visibility === 'public' ? t('Public') : t('Visibility not reported'), trailing: p.visibility ? (_jsx(Button, { size: "sm", variant: "outline", disabled: busy === p.slug, onPress: () => void flip(p), children: p.visibility === 'private' ? t('Make public') : t('Make private') })) : null }, p.slug))) })) }), _jsx(Note, { children: note })] }));
76
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The sections of Settings, in the order the page lists them. A section is one
3
+ * file under settings/ and one entry here; the route grammar names every
4
+ * section there can be (route.ts SECTIONS), and this lists the ones built.
5
+ */
6
+ import type { ReactNode } from 'react';
7
+ import type { Section } from '../route.ts';
8
+ import { type Group } from './list.ts';
9
+ export { GROUPS, type Group } from './list.ts';
10
+ export interface Entry {
11
+ id: Section;
12
+ label: string;
13
+ group: Group;
14
+ body: () => ReactNode;
15
+ }
16
+ export declare const ENTRIES: Entry[];
@@ -0,0 +1,34 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { LIST } from './list.js';
3
+ import { Account } from './account.js';
4
+ import { Billing } from './billing.js';
5
+ import { Capabilities } from './capabilities.js';
6
+ import { Code } from './code.js';
7
+ import { Environments } from './environments.js';
8
+ import { General } from './general.js';
9
+ import { Integrations } from './integrations.js';
10
+ import { Keys } from './keys.js';
11
+ import { Machines } from './machines.js';
12
+ import { Members } from './members.js';
13
+ import { Memory } from './memory.js';
14
+ import { Notifications } from './notifications.js';
15
+ import { Privacy } from './privacy.js';
16
+ import { Usage } from './usage.js';
17
+ export { GROUPS } from './list.js';
18
+ const BODY = {
19
+ general: () => _jsx(General, {}),
20
+ account: () => _jsx(Account, {}),
21
+ privacy: () => _jsx(Privacy, {}),
22
+ billing: () => _jsx(Billing, {}),
23
+ usage: () => _jsx(Usage, {}),
24
+ capabilities: () => _jsx(Capabilities, {}),
25
+ memory: () => _jsx(Memory, {}),
26
+ code: () => _jsx(Code, {}),
27
+ environments: () => _jsx(Environments, {}),
28
+ machines: () => _jsx(Machines, {}),
29
+ keys: () => _jsx(Keys, {}),
30
+ members: () => _jsx(Members, {}),
31
+ integrations: () => _jsx(Integrations, {}),
32
+ notifications: () => _jsx(Notifications, {}),
33
+ };
34
+ export const ENTRIES = LIST.map((e) => ({ ...e, body: BODY[e.id] }));
@@ -0,0 +1,6 @@
1
+ import { type Machine } from '../api/machines.ts';
2
+ export declare function Shared({ m, here, onChanged }: {
3
+ m: Machine;
4
+ here: boolean;
5
+ onChanged: () => void;
6
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,58 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * The folders a machine shares with the web (hanzo-inc/app issue 310), under its row in Settings → Machines.
4
+ *
5
+ * A run started from the web works in a folder of the machine only inside one its owner granted. Each is listed here
6
+ * with Stop sharing. On Hanzo Desktop the machine that is this computer (`here`, found by its hostname) also has Let the
7
+ * web use a folder…, which opens the computer's own folder dialog and grants the folder chosen. Granting and revoking
8
+ * are the machine's owner's alone: the platform refuses anyone else, an org admin included, and its sentence is shown
9
+ * as said.
10
+ *
11
+ * Its words are the reader's language (@hanzo/i18n `t`); a folder's path is drawn as given.
12
+ */
13
+ import { SizableText, XStack, YStack } from '@hanzo/gui';
14
+ import { useI18n } from '@hanzo/i18n/react';
15
+ import { FolderOpen, FolderPlus } from '@hanzogui/lucide-icons-2';
16
+ import { Button } from '@hanzo/ui';
17
+ import { useState } from 'react';
18
+ import { told } from '../api/call.js';
19
+ import { grant, revoke } from '../api/machines.js';
20
+ import { useLocal, useTarget } from '../host.js';
21
+ import { Note } from './ui.js';
22
+ export function Shared({ m, here, onChanged }) {
23
+ const { t } = useI18n();
24
+ const target = useTarget();
25
+ const local = useLocal();
26
+ // The folder being granted or revoked ('+' while the dialog is open), so one change is out at a time.
27
+ const [busy, setBusy] = useState('');
28
+ const [note, setNote] = useState('');
29
+ const sharing = here && local !== null;
30
+ if (!sharing && m.folders.length === 0)
31
+ return null;
32
+ const act = async (what, run) => {
33
+ setBusy(what);
34
+ setNote('');
35
+ try {
36
+ if (await run())
37
+ onChanged();
38
+ }
39
+ catch (e) {
40
+ setNote(told(e, t));
41
+ }
42
+ finally {
43
+ setBusy('');
44
+ }
45
+ };
46
+ const share = () => act('+', async () => {
47
+ const f = await local?.pick();
48
+ if (!f)
49
+ return false;
50
+ await grant(target, m.id, f.path);
51
+ return true;
52
+ });
53
+ const stop = (folder) => act(folder, async () => {
54
+ await revoke(target, m.id, folder);
55
+ return true;
56
+ });
57
+ return (_jsxs(YStack, { px: "$4", pb: "$3", gap: "$2", "data-slot": "shared", "aria-label": t('Folders the web may use'), children: [_jsx(SizableText, { size: "$1", color: "$soft", fontWeight: "500", children: t('Folders the web may use') }), m.folders.length === 0 ? (_jsx(SizableText, { size: "$1", color: "$soft", children: t('None yet. A run sent here from the web works in a new folder.') })) : (m.folders.map((f) => (_jsxs(XStack, { items: "center", justify: "space-between", gap: "$2", minW: 0, children: [_jsxs(XStack, { items: "center", gap: "$1.5", minW: 0, flex: 1, children: [_jsx(FolderOpen, { size: 13, color: "$soft" }), _jsx(SizableText, { size: "$2", color: "$ink", fontFamily: "$mono", numberOfLines: 1, 'data-i18n-ltr': '', children: f })] }), _jsx(Button, { size: "sm", variant: "ghost", disabled: busy !== '', "aria-label": t('Stop sharing {folder}', { folder: f }), onPress: () => void stop(f), children: t('Stop sharing') })] }, f)))), sharing ? (_jsx(XStack, { children: _jsxs(Button, { size: "sm", variant: "outline", disabled: busy !== '', onPress: () => void share(), children: [_jsx(FolderPlus, { size: 14 }), " ", t('Let the web use a folder…')] }) })) : null, _jsx(Note, { children: note })] }));
58
+ }
@@ -0,0 +1,50 @@
1
+ import type { ReactNode } from 'react';
2
+ /** A section's title, what it is for, and its one action. */
3
+ export declare function Heading({ title, detail, action }: {
4
+ title: string;
5
+ detail?: string;
6
+ action?: ReactNode;
7
+ }): import("react").JSX.Element;
8
+ /** A group inside a section: a small title over what it holds. */
9
+ export declare function Group({ title, detail, action, children }: {
10
+ title: string;
11
+ detail?: string;
12
+ action?: ReactNode;
13
+ children: ReactNode;
14
+ }): import("react").JSX.Element;
15
+ /** A bordered list. Its rows draw their own dividers. */
16
+ export declare function Card({ children }: {
17
+ children: ReactNode;
18
+ }): import("react").JSX.Element;
19
+ /** One row of a Card: what it is, a line about it, and what can be done to it. */
20
+ export declare function Row({ title, detail, leading, trailing, first, mono, }: {
21
+ title: string;
22
+ detail?: string;
23
+ leading?: ReactNode;
24
+ trailing?: ReactNode;
25
+ first?: boolean;
26
+ mono?: boolean;
27
+ }): import("react").JSX.Element;
28
+ /** A labelled control, with a line under it when there is more to say. */
29
+ export declare function Field({ label, hint, children }: {
30
+ label: string;
31
+ hint?: string;
32
+ children: ReactNode;
33
+ }): import("react").JSX.Element;
34
+ /** The quiet line for empty, loading, signed-out and refused. */
35
+ export declare function Soft({ children }: {
36
+ children: string;
37
+ }): import("react").JSX.Element;
38
+ /** `Sep 27, 2026` from an RFC 3339 instant, or '' when there is none. UTC, the calendar the platform bills and resets on. */
39
+ export declare function day(iso: string): string;
40
+ /** A credential the platform answers once: the value to copy, what it is, and what its copy control says. */
41
+ export declare function Once({ value, label, copy, children }: {
42
+ value: string;
43
+ label: string;
44
+ copy: string;
45
+ children?: ReactNode;
46
+ }): import("react").JSX.Element;
47
+ /** What the last action did, said once, where it was done. */
48
+ export declare function Note({ children }: {
49
+ children: string;
50
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,53 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * What every Settings section is drawn from, so they read as one page: a
4
+ * heading with its action, bordered lists of rows, labelled fields, and the
5
+ * quiet lines for empty, loading and refused.
6
+ *
7
+ * What a section hands them comes already said in the reader's language
8
+ * (@hanzo/i18n `t`), since a row's title may be a name drawn as given; their
9
+ * own few words they say themselves.
10
+ */
11
+ import { SizableText, XStack, YStack } from '@hanzo/gui';
12
+ import { useI18n } from '@hanzo/i18n/react';
13
+ import { CopyButton } from '@hanzo/ui/product';
14
+ /** A section's title, what it is for, and its one action. */
15
+ export function Heading({ title, detail, action }) {
16
+ return (_jsxs(XStack, { items: "flex-start", gap: "$3", children: [_jsxs(YStack, { flex: 1, minW: 0, gap: "$1", children: [_jsx(SizableText, { size: "$6", color: "$ink", children: title }), detail ? (_jsx(SizableText, { size: "$2", color: "$soft", children: detail })) : null] }), action] }));
17
+ }
18
+ /** A group inside a section: a small title over what it holds. */
19
+ export function Group({ title, detail, action, children }) {
20
+ return (_jsxs(YStack, { gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsxs(YStack, { flex: 1, minW: 0, gap: "$0.5", children: [_jsx(SizableText, { size: "$3", color: "$ink", children: title }), detail ? (_jsx(SizableText, { size: "$1", color: "$soft", children: detail })) : null] }), action] }), children] }));
21
+ }
22
+ /** A bordered list. Its rows draw their own dividers. */
23
+ export function Card({ children }) {
24
+ return (_jsx(YStack, { borderWidth: 1, borderColor: "$borderColor", rounded: "$3", overflow: "hidden", children: children }));
25
+ }
26
+ /** One row of a Card: what it is, a line about it, and what can be done to it. */
27
+ export function Row({ title, detail, leading, trailing, first, mono, }) {
28
+ return (_jsxs(XStack, { items: "center", gap: "$3", px: "$3", py: "$2.5", borderTopWidth: first ? 0 : 1, borderColor: "$borderColor", children: [leading, _jsxs(YStack, { flex: 1, minW: 0, gap: "$0.5", children: [_jsx(SizableText, { size: "$2", color: "$ink", numberOfLines: 1, style: mono ? { fontFamily: 'var(--f-mono, ui-monospace, monospace)' } : undefined, children: title }), detail ? (_jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 2, children: detail })) : null] }), trailing] }));
29
+ }
30
+ /** A labelled control, with a line under it when there is more to say. */
31
+ export function Field({ label, hint, children }) {
32
+ return (_jsxs(YStack, { gap: "$1.5", children: [_jsx(SizableText, { size: "$2", color: "$ink", children: label }), children, hint ? (_jsx(SizableText, { size: "$1", color: "$soft", children: hint })) : null] }));
33
+ }
34
+ /** The quiet line for empty, loading, signed-out and refused. */
35
+ export function Soft({ children }) {
36
+ return (_jsx(YStack, { py: "$5", items: "center", children: _jsx(SizableText, { size: "$2", color: "$soft", style: { textAlign: 'center' }, children: children }) }));
37
+ }
38
+ /** `Sep 27, 2026` from an RFC 3339 instant, or '' when there is none. UTC, the calendar the platform bills and resets on. */
39
+ export function day(iso) {
40
+ const d = iso ? new Date(iso) : null;
41
+ return d && !Number.isNaN(d.getTime()) ? d.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric', timeZone: 'UTC' }) : '';
42
+ }
43
+ /** A credential the platform answers once: the value to copy, what it is, and what its copy control says. */
44
+ export function Once({ value, label, copy, children }) {
45
+ const { t } = useI18n();
46
+ return (_jsxs(YStack, { gap: "$2", px: "$3", py: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", bg: "$raised", children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(SizableText, { flex: 1, minW: 0, size: "$2", color: "$ink", "aria-label": label, style: { fontFamily: 'var(--f-mono, ui-monospace, monospace)', wordBreak: 'break-all' }, children: value }), _jsx(CopyButton, { value: value, label: copy })] }), _jsx(SizableText, { size: "$1", color: "$soft", children: t('Copy it now. It is not shown again.') }), children] }));
47
+ }
48
+ /** What the last action did, said once, where it was done. */
49
+ export function Note({ children }) {
50
+ if (!children)
51
+ return null;
52
+ return (_jsx(SizableText, { size: "$1", color: "$soft", role: "status", children: children }));
53
+ }
@@ -0,0 +1 @@
1
+ export declare function Usage(): import("react").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Usage: the plan's windows and what each class of model has used of it, as
4
+ * shares; the free allowance on Free; the balance with no plan. What happens
5
+ * when a plan's allowance runs out is chosen here. Credits themselves — the
6
+ * balance, top-ups, auto-reload, spend and its limit — are Billing's.
7
+ * Its words are the reader's language (@hanzo/i18n `t`); the org's name is its own.
8
+ */
9
+ import { YStack } from '@hanzo/gui';
10
+ import { useI18n } from '@hanzo/i18n/react';
11
+ import { told } from '../api/call.js';
12
+ import { useHost, useTarget } from '../host.js';
13
+ import { path } from '../route.js';
14
+ import { useStanding } from '../standing.js';
15
+ import { Reading } from './plan.js';
16
+ import { Heading, Soft } from './ui.js';
17
+ export function Usage() {
18
+ const { t } = useI18n();
19
+ const host = useHost();
20
+ const target = useTarget();
21
+ const signed = Boolean(host.person);
22
+ const read = useStanding(target, signed);
23
+ return (_jsxs(YStack, { gap: "$6", children: [_jsx(Heading, { title: t('Usage'), detail: host.org ? t('What {org}’s plan includes, and how much of it is used.', { org: host.org }) : t('What this organization’s plan includes, and how much of it is used.') }), !signed ? (_jsx(Soft, { children: t('Sign in to see this organization’s usage.') })) : read.value ? (_jsx(Reading, { s: read.value, target: target, onPlans: () => host.go(path({ kind: 'screen', screen: 'plans' })), onBilling: () => host.go(path({ kind: 'settings', section: 'billing' })) })) : (_jsx(Soft, { children: read.error ? told(read.error, t) : t('Reading the plan…') }))] }));
24
+ }