@hanzo/dev 4.0.1 → 4.1.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 (369) 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 +31 -0
  61. package/dist/builder/api/git.js +47 -0
  62. package/dist/builder/api/github.d.ts +176 -0
  63. package/dist/builder/api/github.js +271 -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 +570 -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/gutter.d.ts +17 -0
  185. package/dist/builder/gutter.js +25 -0
  186. package/dist/builder/handoff.d.ts +8 -0
  187. package/dist/builder/handoff.js +22 -0
  188. package/dist/builder/host.d.ts +189 -0
  189. package/dist/builder/host.js +46 -0
  190. package/dist/builder/index.d.ts +108 -0
  191. package/dist/builder/index.js +99 -0
  192. package/dist/builder/landing.d.ts +34 -0
  193. package/dist/builder/landing.js +725 -0
  194. package/dist/builder/library.d.ts +21 -0
  195. package/dist/builder/library.js +526 -0
  196. package/dist/builder/local.d.ts +80 -0
  197. package/dist/builder/local.js +124 -0
  198. package/dist/builder/make.d.ts +10 -0
  199. package/dist/builder/make.js +120 -0
  200. package/dist/builder/markdown.d.ts +49 -0
  201. package/dist/builder/markdown.js +125 -0
  202. package/dist/builder/marks.d.ts +15 -0
  203. package/dist/builder/marks.js +18 -0
  204. package/dist/builder/merge.d.ts +223 -0
  205. package/dist/builder/merge.js +380 -0
  206. package/dist/builder/meter.d.ts +31 -0
  207. package/dist/builder/meter.js +54 -0
  208. package/dist/builder/mind.d.ts +107 -0
  209. package/dist/builder/mind.js +335 -0
  210. package/dist/builder/names.d.ts +40 -0
  211. package/dist/builder/names.js +189 -0
  212. package/dist/builder/nav.d.ts +28 -0
  213. package/dist/builder/nav.js +218 -0
  214. package/dist/builder/out.d.ts +16 -0
  215. package/dist/builder/out.js +24 -0
  216. package/dist/builder/page.d.ts +55 -0
  217. package/dist/builder/page.js +217 -0
  218. package/dist/builder/pane.d.ts +30 -0
  219. package/dist/builder/pane.js +21 -0
  220. package/dist/builder/panel.d.ts +101 -0
  221. package/dist/builder/panel.js +408 -0
  222. package/dist/builder/pdf.d.ts +139 -0
  223. package/dist/builder/pdf.js +847 -0
  224. package/dist/builder/pick.d.ts +10 -0
  225. package/dist/builder/pick.js +38 -0
  226. package/dist/builder/plain.d.ts +59 -0
  227. package/dist/builder/plain.js +209 -0
  228. package/dist/builder/plan.d.ts +63 -0
  229. package/dist/builder/plan.js +155 -0
  230. package/dist/builder/plans.d.ts +1 -0
  231. package/dist/builder/plans.js +157 -0
  232. package/dist/builder/plugin.d.ts +60 -0
  233. package/dist/builder/plugin.js +1 -0
  234. package/dist/builder/plugins/design.d.ts +8 -0
  235. package/dist/builder/plugins/design.js +71 -0
  236. package/dist/builder/plugins/index.d.ts +46 -0
  237. package/dist/builder/plugins/index.js +117 -0
  238. package/dist/builder/plugins/pdf.d.ts +18 -0
  239. package/dist/builder/plugins/pdf.js +83 -0
  240. package/dist/builder/plugins/project.d.ts +5 -0
  241. package/dist/builder/plugins/project.js +68 -0
  242. package/dist/builder/plugins/research.d.ts +24 -0
  243. package/dist/builder/plugins/research.js +147 -0
  244. package/dist/builder/plugins/sketch.d.ts +9 -0
  245. package/dist/builder/plugins/sketch.js +101 -0
  246. package/dist/builder/plugins/slides.d.ts +14 -0
  247. package/dist/builder/plugins/slides.js +55 -0
  248. package/dist/builder/plugins/template.d.ts +13 -0
  249. package/dist/builder/plugins/template.js +95 -0
  250. package/dist/builder/prefs.d.ts +29 -0
  251. package/dist/builder/prefs.js +91 -0
  252. package/dist/builder/preview-url.d.ts +47 -0
  253. package/dist/builder/preview-url.js +107 -0
  254. package/dist/builder/project.d.ts +18 -0
  255. package/dist/builder/project.js +591 -0
  256. package/dist/builder/prose.d.ts +4 -0
  257. package/dist/builder/prose.js +57 -0
  258. package/dist/builder/publish.d.ts +18 -0
  259. package/dist/builder/publish.js +141 -0
  260. package/dist/builder/question.d.ts +33 -0
  261. package/dist/builder/question.js +64 -0
  262. package/dist/builder/redesign.d.ts +32 -0
  263. package/dist/builder/redesign.js +117 -0
  264. package/dist/builder/removal.d.ts +71 -0
  265. package/dist/builder/removal.js +73 -0
  266. package/dist/builder/reply.d.ts +50 -0
  267. package/dist/builder/reply.js +196 -0
  268. package/dist/builder/roles.d.ts +10 -0
  269. package/dist/builder/roles.js +28 -0
  270. package/dist/builder/route.d.ts +85 -0
  271. package/dist/builder/route.js +126 -0
  272. package/dist/builder/run.d.ts +4 -0
  273. package/dist/builder/run.js +804 -0
  274. package/dist/builder/runmeta.d.ts +16 -0
  275. package/dist/builder/runmeta.js +69 -0
  276. package/dist/builder/say.d.ts +2 -0
  277. package/dist/builder/say.js +7 -0
  278. package/dist/builder/scheduled.d.ts +3 -0
  279. package/dist/builder/scheduled.js +328 -0
  280. package/dist/builder/section.d.ts +27 -0
  281. package/dist/builder/section.js +60 -0
  282. package/dist/builder/settings/account.d.ts +1 -0
  283. package/dist/builder/settings/account.js +111 -0
  284. package/dist/builder/settings/billing.d.ts +1 -0
  285. package/dist/builder/settings/billing.js +210 -0
  286. package/dist/builder/settings/capabilities.d.ts +1 -0
  287. package/dist/builder/settings/capabilities.js +66 -0
  288. package/dist/builder/settings/card.d.ts +31 -0
  289. package/dist/builder/settings/card.js +140 -0
  290. package/dist/builder/settings/code.d.ts +1 -0
  291. package/dist/builder/settings/code.js +70 -0
  292. package/dist/builder/settings/credits.d.ts +10 -0
  293. package/dist/builder/settings/credits.js +123 -0
  294. package/dist/builder/settings/environments.d.ts +1 -0
  295. package/dist/builder/settings/environments.js +60 -0
  296. package/dist/builder/settings/general.d.ts +1 -0
  297. package/dist/builder/settings/general.js +58 -0
  298. package/dist/builder/settings/index.d.ts +4 -0
  299. package/dist/builder/settings/index.js +25 -0
  300. package/dist/builder/settings/integrations.d.ts +8 -0
  301. package/dist/builder/settings/integrations.js +138 -0
  302. package/dist/builder/settings/keys.d.ts +1 -0
  303. package/dist/builder/settings/keys.js +114 -0
  304. package/dist/builder/settings/list.d.ts +10 -0
  305. package/dist/builder/settings/list.js +28 -0
  306. package/dist/builder/settings/machines.d.ts +4 -0
  307. package/dist/builder/settings/machines.js +243 -0
  308. package/dist/builder/settings/members.d.ts +1 -0
  309. package/dist/builder/settings/members.js +77 -0
  310. package/dist/builder/settings/memory.d.ts +1 -0
  311. package/dist/builder/settings/memory.js +62 -0
  312. package/dist/builder/settings/notifications.d.ts +1 -0
  313. package/dist/builder/settings/notifications.js +111 -0
  314. package/dist/builder/settings/plan.d.ts +17 -0
  315. package/dist/builder/settings/plan.js +131 -0
  316. package/dist/builder/settings/privacy.d.ts +1 -0
  317. package/dist/builder/settings/privacy.js +76 -0
  318. package/dist/builder/settings/sections.d.ts +16 -0
  319. package/dist/builder/settings/sections.js +34 -0
  320. package/dist/builder/settings/shared.d.ts +6 -0
  321. package/dist/builder/settings/shared.js +58 -0
  322. package/dist/builder/settings/ui.d.ts +50 -0
  323. package/dist/builder/settings/ui.js +53 -0
  324. package/dist/builder/settings/usage.d.ts +1 -0
  325. package/dist/builder/settings/usage.js +24 -0
  326. package/dist/builder/shared.d.ts +26 -0
  327. package/dist/builder/shared.js +15 -0
  328. package/dist/builder/shelf.d.ts +16 -0
  329. package/dist/builder/shelf.js +219 -0
  330. package/dist/builder/side.d.ts +40 -0
  331. package/dist/builder/side.js +208 -0
  332. package/dist/builder/site.d.ts +75 -0
  333. package/dist/builder/site.js +138 -0
  334. package/dist/builder/spend.d.ts +21 -0
  335. package/dist/builder/spend.js +80 -0
  336. package/dist/builder/standing.d.ts +36 -0
  337. package/dist/builder/standing.js +66 -0
  338. package/dist/builder/suggest.d.ts +238 -0
  339. package/dist/builder/suggest.js +463 -0
  340. package/dist/builder/suggestions.d.ts +49 -0
  341. package/dist/builder/suggestions.js +260 -0
  342. package/dist/builder/summary.d.ts +60 -0
  343. package/dist/builder/summary.js +81 -0
  344. package/dist/builder/sync.d.ts +1 -0
  345. package/dist/builder/sync.js +164 -0
  346. package/dist/builder/tabs.d.ts +85 -0
  347. package/dist/builder/tabs.js +288 -0
  348. package/dist/builder/talk.d.ts +5 -0
  349. package/dist/builder/talk.js +108 -0
  350. package/dist/builder/thread.d.ts +60 -0
  351. package/dist/builder/thread.js +302 -0
  352. package/dist/builder/tools.d.ts +22 -0
  353. package/dist/builder/tools.js +52 -0
  354. package/dist/builder/transcript.d.ts +47 -0
  355. package/dist/builder/transcript.js +108 -0
  356. package/dist/builder/voice.d.ts +8 -0
  357. package/dist/builder/voice.js +24 -0
  358. package/dist/{changedFileKind-DqgCCDUs.js → changedFileKind-D6QYvIez.js} +1 -1
  359. package/dist/core.js +1 -0
  360. package/dist/{decodeImagePreview-CesVZYP4.js → decodeImagePreview-DnfFEjhw.js} +1 -1
  361. package/dist/{embed-DYP-OUlb.js → embed-c030vUqM.js} +11 -11
  362. package/dist/index.d.ts +2 -0
  363. package/dist/index.js +2 -1
  364. package/dist/{micromark-util-decode-string-NQjVkmZH.js → micromark-util-decode-string-C-5AXkOV.js} +5 -3
  365. package/dist/{readBinaryPreview-D2X4Uahu.js → readBinaryPreview-BAQ4fFjm.js} +1 -1
  366. package/dist/{useTextFieldSpeech-CyOZZPrV.js → useTextFieldSpeech-COa9XcRx.js} +1 -1
  367. package/package.json +101 -11
  368. /package/{index.d.ts → dist/core.d.ts} +0 -0
  369. /package/{keymap.d.ts → dist/keymap.d.ts} +0 -0
@@ -0,0 +1,175 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * A run's Files tab: its working tree, live from the sandbox while the run holds
4
+ * one — every edit the agent has made, committed or not — and its branch on the
5
+ * forge otherwise. And its Artifacts tab: what the run left — every file it added
6
+ * or changed and the whole change as a patch, kept after its sandbox is gone; its
7
+ * previews, pull request and deployments — then its published site, its branch,
8
+ * its environment proposal and its project.
9
+ *
10
+ * Its words are the reader's language (@hanzo/i18n `t`); names, paths and a
11
+ * file's contents are drawn as given.
12
+ */
13
+ import { SizableText, XStack, YStack } from '@hanzo/gui';
14
+ import { useI18n } from '@hanzo/i18n/react';
15
+ import { Download, ExternalLink, File, FileDiff, Folder, Globe, GitBranch, GitPullRequest, Layers, MonitorPlay, Rocket, Search, Settings2 } from '@hanzogui/lucide-icons-2';
16
+ import { Input } from '@hanzo/ui';
17
+ import { useState } from 'react';
18
+ import { blob, tree } from './api/changes.js';
19
+ import { artifact, artifacts } from './api/coding.js';
20
+ import { preview, read as look } from './api/sandbox.js';
21
+ import { useRead } from './data.js';
22
+ import { useHost, useTarget } from './host.js';
23
+ import { useWake } from './spend.js';
24
+ import { away, Out } from './out.js';
25
+ const monoWrap = { whiteSpace: 'pre-wrap', fontFamily: 'var(--f-mono, ui-monospace, monospace)' };
26
+ export function Files({ session, repo, branch, sandbox, live, }) {
27
+ const { t } = useI18n();
28
+ const reachable = live && Boolean(sandbox);
29
+ // Live once the sandbox is reachable, unless the branch was picked.
30
+ const [source, setSource] = useState(null);
31
+ const from = reachable ? (source ?? 'live') : 'branch';
32
+ return (_jsxs(YStack, { gap: "$3", children: [reachable ? (_jsxs(XStack, { gap: "$1", items: "center", flexWrap: "wrap", children: [_jsx(Pick, { on: from === 'live', onPress: () => setSource('live'), children: t('Live') }), _jsx(Pick, { on: from === 'branch', onPress: () => setSource('branch'), children: t('Branch') })] })) : null, from === 'live' ? _jsx(Live, { sandbox: sandbox }) : _jsx(Branch, { session: session, label: `${repo}${branch ? `@${branch}` : ''}` })] }));
33
+ }
34
+ /** The sandbox's working tree, as it is right now. */
35
+ function Live({ sandbox }) {
36
+ const target = useTarget();
37
+ const { t } = useI18n();
38
+ const [dir, setDir] = useState('');
39
+ const [file, setFile] = useState('');
40
+ const list = useRead(() => look(target, sandbox, dir), null, [target, sandbox, dir]);
41
+ const body = useRead(file ? () => look(target, sandbox, file) : null, null, [target, sandbox, file]);
42
+ const at = (name) => (dir ? `${dir}/${name}` : name);
43
+ // A name is only a name until it is read: the answer says whether it was a directory.
44
+ const open = async (name) => {
45
+ const path = at(name);
46
+ try {
47
+ const n = await look(target, sandbox, path);
48
+ if (n.dir) {
49
+ setDir(path);
50
+ setFile('');
51
+ }
52
+ else {
53
+ setFile(path);
54
+ }
55
+ }
56
+ catch {
57
+ setFile(path);
58
+ }
59
+ };
60
+ return (_jsx(Listing, { where: `/work${dir ? `/${dir}` : ''}`, up: dir ? () => (setDir(dir.includes('/') ? dir.slice(0, dir.lastIndexOf('/')) : ''), setFile('')) : undefined, error: list.error?.message ?? '', loading: list.loading && !list.value, rows: (list.value?.names ?? []).map((name) => ({ key: name, name, dir: null, onPress: () => void open(name) })), file: file, body: body.error
61
+ ? body.error.message
62
+ : body.value
63
+ ? body.value.binary
64
+ ? t('Binary file')
65
+ : body.value.truncated
66
+ ? t('Too large to show')
67
+ : body.value.text || t('Empty file')
68
+ : '' }));
69
+ }
70
+ /** The run's branch on the forge; its base until it has pushed. */
71
+ function Branch({ session, label }) {
72
+ const host = useHost();
73
+ const target = useTarget();
74
+ const { t } = useI18n();
75
+ const signed = Boolean(host.person);
76
+ const [dir, setDir] = useState('');
77
+ const [file, setFile] = useState('');
78
+ const list = useRead(signed ? () => tree(target, session, dir) : null, [], [target, session, dir, signed]);
79
+ const body = useRead(file ? () => blob(target, session, file) : null, null, [target, session, file]);
80
+ if (!signed)
81
+ return _jsx(Soft, { children: t('Sign in to read this run’s files.') });
82
+ return (_jsx(Listing, { where: `${label}${dir ? `/${dir}` : ''}`, up: dir ? () => (setDir(dir.includes('/') ? dir.slice(0, dir.lastIndexOf('/')) : ''), setFile('')) : undefined, error: list.error?.message ?? '', loading: list.loading && list.value.length === 0, rows: list.value.map((e) => ({
83
+ key: e.path,
84
+ name: e.name,
85
+ dir: e.dir,
86
+ onPress: () => (e.dir ? (setDir(e.path), setFile('')) : setFile(e.path)),
87
+ })), file: file, body: body.error
88
+ ? body.error.message
89
+ : body.value
90
+ ? body.value.binary
91
+ ? t('Binary file')
92
+ : body.value.truncated
93
+ ? t('Too large to show')
94
+ : body.value.text || t('Empty file')
95
+ : '' }));
96
+ }
97
+ function Listing({ where, up, error, loading, rows, file, body, }) {
98
+ const { t } = useI18n();
99
+ const [filter, setFilter] = useState('');
100
+ const needle = filter.replace(/^\?/, '').trim().toLowerCase();
101
+ const shown = needle ? rows.filter((r) => r.name.toLowerCase().includes(needle)) : rows;
102
+ return (_jsxs(YStack, { gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$1.5", px: "$2.5", py: "$1", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", children: [_jsx(Search, { size: 13, opacity: 0.6 }), _jsx(Input, { unstyled: true, flex: 1, minW: 0, value: filter, onChangeText: setFilter, placeholder: t('Filter, or ? to search in files'), "aria-label": t('Filter, or ? to search in files'), style: { fontSize: 12, outlineStyle: 'none', background: 'transparent' } })] }), _jsxs(XStack, { gap: "$2", items: "center", children: [up ? (_jsx(XStack, { render: "button", "aria-label": t('Up one directory'), onPress: up, px: "$1", py: "$1", children: _jsx(SizableText, { size: "$1", color: "$soft", children: t('Up') }) })) : null, _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: where })] }), error ? (_jsx(SizableText, { size: "$2", color: "$soft", children: error })) : loading ? (_jsx(SizableText, { size: "$2", color: "$soft", children: t('Reading…') })) : shown.length === 0 ? (_jsx(SizableText, { size: "$2", color: "$soft", children: needle ? t('No matching files.') : t('This directory is empty.') })) : (shown.map((r) => (_jsxs(XStack, { render: "button", "aria-label": r.dir === false ? t('Read {name}', { name: r.name }) : t('Open {name}', { name: r.name }), onPress: r.onPress, items: "center", gap: "$2", py: "$1", hoverStyle: { bg: '$hover' }, children: [r.dir === false ? _jsx(File, { size: 14 }) : r.dir ? _jsx(Folder, { size: 14 }) : _jsx(File, { size: 14, opacity: 0.6 }), _jsx(SizableText, { size: "$2", color: "$ink", numberOfLines: 1, text: "start", children: r.name })] }, r.key)))), file && body ? (_jsxs(YStack, { gap: "$1", pt: "$2", borderTopWidth: 1, borderColor: "$borderColor", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: file }), _jsx(SizableText, { size: "$1", color: "$ink", style: monoWrap, children: body })] })) : null] }));
103
+ }
104
+ /** A stored artifact's size, as a person reads it. */
105
+ const size = (n) => (n < 1024 ? `${n} B` : n < 1 << 20 ? `${(n / 1024).toFixed(1)} KB` : `${(n / (1 << 20)).toFixed(1)} MB`);
106
+ /** What each kind of artifact is drawn with, and says it is, in the reader's language. */
107
+ const KIND = {
108
+ file: { icon: _jsx(File, { size: 16 }), note: (a, t) => t('Changed file · {size}', { size: size(a.size) }) },
109
+ patch: { icon: _jsx(FileDiff, { size: 16 }), note: (a, t) => t('The whole change as a patch · {size}', { size: size(a.size) }) },
110
+ preview: { icon: _jsx(MonitorPlay, { size: 16 }), note: (a, t) => t('What the run served on port {port}', { port: a.port }) },
111
+ pull: { icon: _jsx(GitPullRequest, { size: 16 }), note: (_, t) => t('Pull request') },
112
+ deploy: { icon: _jsx(Rocket, { size: 16 }), note: (_, t) => t('Deployment') },
113
+ };
114
+ export function Artifacts({ session, sandbox, repo, branch, mode, project, site, pr, onEnvironment, }) {
115
+ const host = useHost();
116
+ const target = useTarget();
117
+ const { t } = useI18n();
118
+ const { wake, dialog } = useWake();
119
+ const left = useRead(host.person ? () => artifacts(target, session) : null, { saved: '', artifacts: [] }, [target, session, host.person]);
120
+ const [note, setNote] = useState('');
121
+ // Bytes come with the person's bearer, so a stored artifact is fetched, then saved.
122
+ const save = async (a) => {
123
+ try {
124
+ const url = URL.createObjectURL(await artifact(target, session, a.name));
125
+ const link = document.createElement('a');
126
+ link.href = url;
127
+ link.download = a.name.split('/').pop() || a.name;
128
+ link.click();
129
+ setTimeout(() => URL.revokeObjectURL(url), 10_000);
130
+ }
131
+ catch (e) {
132
+ setNote(e.message);
133
+ }
134
+ };
135
+ // A preview is opened with a fresh ticket, in a tab of its own.
136
+ const open = (a) => away(preview(target, sandbox, a.port, wake)).catch((e) => setNote(e.message));
137
+ const items = [];
138
+ for (const a of left.value.artifacts) {
139
+ const stored = a.kind === 'file' || a.kind === 'patch';
140
+ const link = a.kind === 'pull' || a.kind === 'deploy';
141
+ if ((a.kind === 'preview' && !sandbox) || (link && !/^https:\/\//.test(a.url)))
142
+ continue;
143
+ items.push({
144
+ key: `${a.kind}:${a.name}`,
145
+ icon: KIND[a.kind].icon,
146
+ title: link ? a.url.replace(/^https:\/\//, '') : a.name,
147
+ note: KIND[a.kind].note(a, t),
148
+ href: link ? a.url : undefined,
149
+ onPress: stored ? () => void save(a) : a.kind === 'preview' ? () => void open(a) : undefined,
150
+ action: stored ? _jsx(Download, { size: 14 }) : a.kind === 'preview' ? _jsx(ExternalLink, { size: 14 }) : undefined,
151
+ });
152
+ }
153
+ if (site)
154
+ items.push({ key: 'site', icon: _jsx(Globe, { size: 16 }), title: site.replace(/^https:\/\//, ''), note: t('Where this session is published'), href: site });
155
+ if (pr.href)
156
+ items.push({ key: 'pr', icon: _jsx(GitPullRequest, { size: 16 }), title: t('Pull request {pr}', { pr: pr.label }), note: t('Opened on the forge'), href: pr.href });
157
+ if (branch)
158
+ items.push({ key: 'branch', icon: _jsx(GitBranch, { size: 16 }), title: branch, note: repo ? t('The branch this session pushes to in {repo}', { repo }) : t('The branch this session pushes to') });
159
+ if (mode === 'setup')
160
+ items.push({ key: 'environment', icon: _jsx(Settings2, { size: 16 }), title: t('Environment proposal'), note: t('The install and start scripts this session found'), onPress: onEnvironment });
161
+ if (project)
162
+ items.push({ key: 'project', icon: _jsx(Layers, { size: 16 }), title: project, note: t('The project this session builds'), onPress: () => host.go(project) });
163
+ if (!items.length)
164
+ return _jsx(Soft, { children: left.error?.message || (left.loading ? t('Reading what this session left…') : t('This session has produced no artifacts yet.')) });
165
+ return (_jsxs(YStack, { gap: "$2", children: [dialog, note ? (_jsx(SizableText, { size: "$1", color: "$soft", role: "status", children: note })) : null, _jsx(YStack, { borderWidth: 1, borderColor: "$borderColor", rounded: "$3", overflow: "hidden", children: items.map((a, i) => {
166
+ const row = (_jsxs(XStack, { items: "center", gap: "$3", px: "$3", py: "$2.5", borderTopWidth: i ? 1 : 0, borderColor: "$borderColor", hoverStyle: a.href || a.onPress ? { bg: '$hover' } : undefined, children: [a.icon, _jsxs(YStack, { flex: 1, minW: 0, "$platform-web": { textAlign: 'start' }, children: [_jsx(SizableText, { size: "$2", color: "$ink", numberOfLines: 1, children: a.title }), _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: a.note })] }), a.action ?? (a.href ? _jsx(ExternalLink, { size: 14 }) : null)] }));
167
+ return a.href ? (_jsx(Out, { href: a.href, label: a.title, children: _jsx(YStack, { width: "100%", children: row }) }, a.key)) : a.onPress ? (_jsx(YStack, { render: "button", "aria-label": a.title, onPress: a.onPress, children: row }, a.key)) : (_jsx(YStack, { children: row }, a.key));
168
+ }) })] }));
169
+ }
170
+ function Pick({ on, onPress, children }) {
171
+ return (_jsx(XStack, { render: "button", "aria-label": children, onPress: onPress, px: "$2.5", py: "$1", rounded: "$2", bg: on ? '$hover' : 'transparent', children: _jsx(SizableText, { size: "$2", color: on ? '$ink' : '$soft', children: children }) }));
172
+ }
173
+ function Soft({ children }) {
174
+ return (_jsx(YStack, { py: "$6", items: "center", children: _jsx(SizableText, { size: "$2", color: "$soft", style: { textAlign: 'center' }, children: children }) }));
175
+ }
@@ -0,0 +1,7 @@
1
+ import type { RailSession } from '@hanzo/ui/chat';
2
+ export declare function Find({ open, onOpenChange, recents, onOpen, }: {
3
+ open: boolean;
4
+ onOpenChange: (o: boolean) => void;
5
+ recents: RailSession[];
6
+ onOpen: (id: string) => void;
7
+ }): import("react").JSX.Element;
@@ -0,0 +1,80 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Finding a run: the rail's search icon. The org's coding runs as the platform
4
+ * lists them, newest first, filtered by status and paged back as far as they
5
+ * go; what is typed narrows the runs read so far by name and codebase. Until
6
+ * the first page lands it searches the rail's own recents.
7
+ */
8
+ import { ScrollView, SizableText, XStack, YStack } from '@hanzo/gui';
9
+ import { phrase } from '@hanzo/i18n';
10
+ import { useI18n } from '@hanzo/i18n/react';
11
+ import { Button, Dialog, DialogContent, DialogTitle, Input } from '@hanzo/ui';
12
+ import { useEffect, useMemo, useRef, useState } from 'react';
13
+ import { page } from './api/sessions.js';
14
+ import { useHost, useTarget } from './host.js';
15
+ /** The statuses the platform filters on, and every run. */
16
+ const FILTERS = [
17
+ { id: '', label: phrase('All') },
18
+ { id: 'running', label: phrase('Running') },
19
+ { id: 'paused', label: phrase('Paused') },
20
+ { id: 'done', label: phrase('Done') },
21
+ { id: 'error', label: phrase('Error') },
22
+ ];
23
+ const PAGE = 50;
24
+ export function Find({ open, onOpenChange, recents, onOpen, }) {
25
+ const { t: say } = useI18n();
26
+ const host = useHost();
27
+ const t = useTarget();
28
+ const signed = Boolean(host.person);
29
+ const [q, setQ] = useState('');
30
+ const [status, setStatus] = useState('');
31
+ const [rows, setRows] = useState(null);
32
+ const [next, setNext] = useState('');
33
+ const [loading, setLoading] = useState(false);
34
+ const [error, setError] = useState('');
35
+ // A page asked for under another status or an earlier opening lands on nothing.
36
+ const asked = useRef(0);
37
+ const read = (after) => {
38
+ const mine = after ? asked.current : ++asked.current;
39
+ setLoading(true);
40
+ setError('');
41
+ return page(t, { kind: 'coding', status, limit: PAGE, after })
42
+ .then((p) => {
43
+ if (mine !== asked.current)
44
+ return;
45
+ setRows((prev) => (after && prev ? [...prev, ...p.sessions.filter((s) => !prev.some((r) => r.id === s.id))] : p.sessions));
46
+ setNext(p.next);
47
+ })
48
+ .catch((e) => {
49
+ if (mine === asked.current)
50
+ setError(e.message);
51
+ })
52
+ .finally(() => {
53
+ if (mine === asked.current)
54
+ setLoading(false);
55
+ });
56
+ };
57
+ // Opening, or another status, reads from the newest again.
58
+ useEffect(() => {
59
+ if (!open || !signed)
60
+ return;
61
+ setRows(null);
62
+ setNext('');
63
+ void read('');
64
+ // `read` closes over the status and target this effect is keyed on.
65
+ // eslint-disable-next-line react-hooks/exhaustive-deps
66
+ }, [open, signed, status, t]);
67
+ const hits = useMemo(() => {
68
+ const n = q.trim().toLowerCase();
69
+ const all = rows
70
+ ? rows.map((s) => ({ id: s.id, title: s.title || say('Untitled session'), line: [s.repo, s.status].filter(Boolean).join(' · ') }))
71
+ : status
72
+ ? []
73
+ : recents.map((r) => ({ id: r.id, title: r.title, line: '' }));
74
+ return n ? all.filter((h) => `${h.title} ${h.line}`.toLowerCase().includes(n)) : all;
75
+ }, [q, rows, recents, status, say]);
76
+ return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { maxW: 520, children: [_jsx(DialogTitle, { children: say('Find a session') }), _jsx(Input, { autoFocus: true, value: q, onChangeText: setQ, placeholder: say('Search sessions…'), "aria-label": say('Search sessions'), onKeyDown: (e) => {
77
+ if (e.key === 'Enter' && hits[0])
78
+ onOpen(hits[0].id);
79
+ } }), _jsx(XStack, { gap: "$1", flexWrap: "wrap", role: "group", "aria-label": say('Status'), children: FILTERS.map((f) => (_jsx(XStack, { render: "button", "aria-label": say(f.label), "aria-pressed": status === f.id, onPress: () => setStatus(f.id), px: "$2.5", py: "$1", rounded: "$10", borderWidth: 1, borderColor: status === f.id ? '$ink' : '$borderColor', bg: status === f.id ? '$hover' : 'transparent', hoverStyle: { bg: '$hover' }, children: _jsx(SizableText, { size: "$1", color: status === f.id ? '$ink' : '$soft', children: say(f.label) }) }, f.id || 'all'))) }), _jsx(ScrollView, { maxH: 360, children: _jsxs(YStack, { gap: "$1", role: "list", children: [hits.map((h) => (_jsxs(XStack, { role: "listitem", render: "button", "aria-label": h.title, onPress: () => onOpen(h.id), px: "$2", py: "$1.5", rounded: "$3", hoverStyle: { bg: '$hover' }, items: "center", gap: "$3", children: [_jsx(SizableText, { flex: 1, minW: 0, size: "$2", color: "$ink", numberOfLines: 1, style: { textAlign: 'left' }, children: h.title }), h.line ? (_jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, shrink: 0, maxW: "45%", children: h.line })) : null] }, h.id))), !loading && !error && hits.length === 0 ? (_jsx(SizableText, { size: "$2", color: "$soft", px: "$2", children: rows && next ? say('No session read so far matches.') : say('No session matches.') })) : null] }) }), error ? (_jsx(SizableText, { size: "$1", color: "$soft", role: "status", children: error })) : null, loading ? (_jsx(SizableText, { size: "$1", color: "$soft", role: "status", children: say('Reading sessions…') })) : next ? (_jsx(XStack, { children: _jsx(Button, { size: "sm", variant: "outline", onPress: () => void read(next), children: say('Older sessions') }) })) : null] }) }));
80
+ }
@@ -0,0 +1,30 @@
1
+ export declare const DOCS = "https://docs.hanzo.ai/docs/dev";
2
+ /** Hanzo in Slack is set up under Settings; the card goes there, and once dismissed stays gone. */
3
+ export declare function Slack({ onOpen, onDismiss }: {
4
+ onOpen: () => void;
5
+ onDismiss: () => void;
6
+ }): import("react").JSX.Element;
7
+ /**
8
+ * The account menu's open state, for whatever row opens it.
9
+ *
10
+ * The row that opens the menu lies outside it, so a press on the row while the
11
+ * menu is open reaches the popover first as a press outside, which closes it —
12
+ * and a row that then simply opened it put it straight back, a flicker instead
13
+ * of a close. So the open state is noted as each press BEGINS, before the popover
14
+ * acts on it, and `toggle` (the row's press) closes a menu that was open then.
15
+ */
16
+ export declare function useWho(): {
17
+ open: boolean;
18
+ onOpenChange: (o: boolean) => void;
19
+ toggle: () => void;
20
+ };
21
+ /**
22
+ * The account menu. The rail draws the account row and says when it was pressed,
23
+ * so the menu hangs off an anchor laid over the rail's foot: above it on the
24
+ * open rail, beside it on the collapsed one.
25
+ */
26
+ export declare function Who({ open, onOpenChange, narrow }: {
27
+ open: boolean;
28
+ onOpenChange: (o: boolean) => void;
29
+ narrow: boolean;
30
+ }): import("react").JSX.Element;
@@ -0,0 +1,79 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * The rail's foot: the card that offers Hanzo in Slack, and the menu the account
4
+ * row opens — who is signed in, the plan and its meter (`Meter`), the
5
+ * organization they act in, Settings, Usage, Billing, the plans, help and
6
+ * logging out.
7
+ * Everything it opens is an address of this page, but help, which is the
8
+ * documentation.
9
+ */
10
+ import { useCallback, useEffect, useRef, useState } from 'react';
11
+ import { Popover, SizableText, XStack, YStack } from '@hanzo/gui';
12
+ import { useI18n } from '@hanzo/i18n/react';
13
+ import { CreditCard, Gauge, LifeBuoy, LogOut, Settings, Slack as Mark, Sparkles, X } from '@hanzogui/lucide-icons-2';
14
+ import { MenuLabel, MenuRow, MenuRule } from '@hanzo/ui/product';
15
+ import { useHost, useTarget } from './host.js';
16
+ import { Meter } from './meter.js';
17
+ import { useStanding } from './standing.js';
18
+ import { path } from './route.js';
19
+ export const DOCS = 'https://docs.hanzo.ai/docs/dev';
20
+ /** Hanzo in Slack is set up under Settings; the card goes there, and once dismissed stays gone. */
21
+ export function Slack({ onOpen, onDismiss }) {
22
+ const { t } = useI18n();
23
+ return (_jsxs(XStack, { items: "center", gap: "$2.5", px: "$3", py: "$2.5", rounded: "var(--radius-lg)", borderWidth: 1, borderColor: "$borderColor", bg: "var(--glass)", children: [_jsx(Mark, { size: 16 }), _jsxs(YStack, { flex: 1, minW: 0, gap: "$0.5", children: [_jsx(SizableText, { size: "$2", color: "$ink", numberOfLines: 1, children: t('Try Hanzo in Slack') }), _jsx(XStack, { render: "button", "aria-label": t('Set up Hanzo in Slack'), onPress: onOpen, cursor: "pointer", children: _jsx(SizableText, { size: "$1", color: "$soft", textDecorationLine: "underline", children: t('Set up') }) })] }), _jsx(XStack, { render: "button", "aria-label": t('Dismiss'), onPress: onDismiss, p: "$1", rounded: "$2", hoverStyle: { bg: '$hover' }, children: _jsx(X, { size: 14 }) })] }));
24
+ }
25
+ /**
26
+ * The account menu's open state, for whatever row opens it.
27
+ *
28
+ * The row that opens the menu lies outside it, so a press on the row while the
29
+ * menu is open reaches the popover first as a press outside, which closes it —
30
+ * and a row that then simply opened it put it straight back, a flicker instead
31
+ * of a close. So the open state is noted as each press BEGINS, before the popover
32
+ * acts on it, and `toggle` (the row's press) closes a menu that was open then.
33
+ */
34
+ export function useWho() {
35
+ const [open, setOpen] = useState(false);
36
+ const shown = useRef(open);
37
+ shown.current = open;
38
+ const began = useRef(false);
39
+ useEffect(() => {
40
+ const down = () => {
41
+ began.current = shown.current;
42
+ };
43
+ document.addEventListener('pointerdown', down, true);
44
+ return () => document.removeEventListener('pointerdown', down, true);
45
+ }, []);
46
+ const toggle = useCallback(() => {
47
+ const was = began.current || shown.current;
48
+ began.current = false;
49
+ setOpen(!was);
50
+ }, []);
51
+ return { open, onOpenChange: setOpen, toggle };
52
+ }
53
+ /**
54
+ * The account menu. The rail draws the account row and says when it was pressed,
55
+ * so the menu hangs off an anchor laid over the rail's foot: above it on the
56
+ * open rail, beside it on the collapsed one.
57
+ */
58
+ export function Who({ open, onOpenChange, narrow }) {
59
+ const { t } = useI18n();
60
+ const host = useHost();
61
+ const standing = useStanding(useTarget(), open);
62
+ // The organizations this person acts in; choosing one reloads the page scoped to it.
63
+ const orgs = host.memberships ?? (host.org ? [host.org] : []);
64
+ const go = (p) => {
65
+ onOpenChange(false);
66
+ host.go(p);
67
+ };
68
+ return (_jsxs(Popover, { open: open, onOpenChange: onOpenChange, placement: narrow ? 'right-end' : 'top-start', allowFlip: true, stayInFrame: true, offset: 6, children: [_jsx(Popover.Anchor, { position: "absolute", l: 8, b: 8, width: narrow ? 48 : 256, height: 36, pointerEvents: "none" }), _jsx(Popover.Content, { role: "menu", "aria-label": t('Account'), items: "stretch", borderWidth: 1, elevation: "$2", px: "$1", py: "$1", width: 260, bg: "$panel", borderColor: "$borderColor", children: _jsxs(YStack, { gap: "$1", children: [_jsx(SizableText, { size: "$2", color: "$soft", px: "$2", py: "$1.5", numberOfLines: 1, children: host.person?.email || host.person?.name || '' }), _jsx(MenuRule, {}), _jsx(Meter, { read: standing, onPlans: () => go(path({ kind: 'screen', screen: 'plans' })), onBilling: () => go(path({ kind: 'settings', section: 'billing' })) }), orgs.length ? (_jsxs(_Fragment, { children: [_jsx(MenuRule, {}), _jsx(MenuLabel, { children: t('Organization') }), _jsx(YStack, { role: "radiogroup", "aria-label": t('Organizations'), gap: "$1", children: orgs.map((o) => (_jsx(MenuRow, { label: o, active: o === host.org, onPress: () => {
69
+ onOpenChange(false);
70
+ if (o !== host.org)
71
+ host.chooseOrg?.(o);
72
+ } }, o))) })] })) : null, _jsx(MenuRule, {}), _jsx(MenuRow, { label: t('Settings'), icon: _jsx(Settings, { size: 16 }), onPress: () => go(path({ kind: 'settings', section: 'general' })) }), _jsx(MenuRow, { label: t('Usage'), icon: _jsx(Gauge, { size: 16 }), onPress: () => go(path({ kind: 'settings', section: 'usage' })) }), _jsx(MenuRow, { label: t('Billing'), icon: _jsx(CreditCard, { size: 16 }), onPress: () => go(path({ kind: 'settings', section: 'billing' })) }), _jsx(MenuRow, { label: t('View all plans'), icon: _jsx(Sparkles, { size: 16 }), onPress: () => go(path({ kind: 'screen', screen: 'plans' })) }), _jsx(MenuRow, { label: t('Get help'), icon: _jsx(LifeBuoy, { size: 16 }), onPress: () => {
73
+ onOpenChange(false);
74
+ window.open(DOCS, '_blank', 'noopener,noreferrer');
75
+ } }), host.signOut ? (_jsxs(_Fragment, { children: [_jsx(MenuRule, {}), _jsx(MenuRow, { label: t('Log out'), icon: _jsx(LogOut, { size: 16 }), onPress: () => {
76
+ onOpenChange(false);
77
+ host.signOut?.();
78
+ } })] })) : null] }) })] }));
79
+ }
@@ -0,0 +1,4 @@
1
+ import type { Screen } from './route.ts';
2
+ export declare function Forge({ screen }: {
3
+ screen: Exclude<Screen, 'artifacts' | 'templates'>;
4
+ }): import("react").JSX.Element;