@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,48 @@
1
+ import { type DropdownMenuProps } from '@hanzo/ui';
2
+ import type { Event } from './api/sessions.ts';
3
+ import type { Deck, Tabs } from './tabs.ts';
4
+ /** A run's panel before anyone has arranged it: Preview chosen first so live output opens immediately. */
5
+ export declare const SEED: Tabs;
6
+ export declare function Desk({ id, repo, branch, base, environment, mode, pr, title, project, sandbox, site, published, events, live, menu, refused, retry, onRetry, side, sheet, onHide, envColumn, splitPanes, onCloseSplitPane, onExpandSplitPane, sessionStatus, onPublish, topRightInset, }: {
7
+ id: string;
8
+ repo: string;
9
+ branch: string;
10
+ base: string;
11
+ environment: string;
12
+ mode: string;
13
+ pr: {
14
+ href: string;
15
+ label: string;
16
+ };
17
+ title: string;
18
+ project: string;
19
+ /** The sandbox the run leased, or '' before it leases one and on a machine. */
20
+ sandbox: string;
21
+ /** Where the run's work is published, or '' before it is. */
22
+ site: string;
23
+ /** The run's latest publish, which loads the page again. */
24
+ published: number;
25
+ events: Event[];
26
+ live: boolean;
27
+ /** What can be done to the run — rename, share, copy its id — as its header offers it. */
28
+ menu: NonNullable<DropdownMenuProps['items']>;
29
+ refused: string;
30
+ /** The refusal's one action: Retry, or Sign in when nobody is. */
31
+ retry: string;
32
+ onRetry: () => void;
33
+ side: Deck;
34
+ sheet: boolean;
35
+ onHide: () => void;
36
+ /** Show the Environment inspection column beside the dock panes. */
37
+ envColumn?: boolean;
38
+ /** Active split panes in the 2x2 multi-pane dock grid ('terminal' | 'preview' | 'diff' | 'files'). */
39
+ splitPanes?: string[];
40
+ onCloseSplitPane?: (paneId: string) => void;
41
+ onExpandSplitPane?: (paneId: string) => void;
42
+ /** Current session lifecycle status, used to trigger Preview refresh on completion. */
43
+ sessionStatus?: string;
44
+ /** 1-click Publish handler surfaced from the Preview toolbar. */
45
+ onPublish?: () => void;
46
+ /** Reserve space for the host shell's top-right corner buttons. */
47
+ topRightInset?: boolean;
48
+ }): import("react").JSX.Element;
@@ -0,0 +1,449 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * The run's side panel: Dev's kinds of tab in the one panel (panel.tsx) — the
4
+ * Preview of what the run's sandbox serves (or where it is published), its
5
+ * Artifacts, Files, Diff and Terminal, and on asking its Desktop and its
6
+ * codebase's Environment.
7
+ *
8
+ * The sandbox outlives the run: kept when the run ends, parked while nobody
9
+ * watches, retired a day after it parks. The bar under the tabs says which and
10
+ * suspends or resumes it; a tab that needs it running resumes it (sandbox.ts).
11
+ *
12
+ * Its words are the reader's language (@hanzo/i18n `t`); a repository, branch,
13
+ * port, address, command and the sandbox's own error are drawn as given.
14
+ */
15
+ import { SizableText, XStack, YStack } from '@hanzo/gui';
16
+ import { useI18n } from '@hanzo/i18n/react';
17
+ import { Check, Circle, ExternalLink, Folder, GitBranch, GitPullRequest, Globe, Info, Laptop, Maximize2, MoreHorizontal, Play, RefreshCcw, Square, SquareTerminal, Upload, X } from '@hanzogui/lucide-icons-2';
18
+ import { Button, DropdownMenu, Switch } from '@hanzo/ui';
19
+ import { Console, DEVICES, PreviewFrame, Views } from '@hanzo/ui/agents';
20
+ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
21
+ import { RING } from './pane.js';
22
+ import { cacheBustUrl, hasUnpublishedEdits, previewRevision, resolvePreviewSource } from './preview-url.js';
23
+ import { read as readChanges } from './api/changes.js';
24
+ import { read as readEnvironment } from './api/environment.js';
25
+ import { park, ports as listening, preview, sandbox as look, serve, served, stay, wake } from './api/sandbox.js';
26
+ import { cards, failure, shell, steps } from './api/turn.js';
27
+ import { useKept, useRead } from './data.js';
28
+ import { formatDeviceLabel, useDevMode } from './dev-mode.js';
29
+ import { Door } from './door.js';
30
+ import { Environment } from './environment.js';
31
+ import { Artifacts, Files } from './files.js';
32
+ import { Git } from './git.js';
33
+ import { useHost, useTarget } from './host.js';
34
+ import { useWake } from './spend.js';
35
+ import { away, Out } from './out.js';
36
+ import { Panel } from './panel.js';
37
+ /** A run's panel before anyone has arranged it: Preview chosen first so live output opens immediately. */
38
+ export const SEED = {
39
+ tabs: [
40
+ { id: 'preview', kind: 'preview', title: 'Preview' },
41
+ { id: 'artifacts', kind: 'artifacts', title: 'Artifacts' },
42
+ { id: 'files', kind: 'files', title: 'Files' },
43
+ { id: 'diff', kind: 'diff', title: 'Diff' },
44
+ { id: 'terminal', kind: 'terminal', title: 'Terminal' },
45
+ ],
46
+ at: 'preview',
47
+ };
48
+ /** How often the sandbox's state, and what it serves, is read while the panel is open. */
49
+ const EVERY = 10_000;
50
+ const PORTS = 5_000;
51
+ export function Desk({ id, repo, branch, base, environment, mode, pr, title, project, sandbox, site, published, events, live, menu, refused, retry, onRetry, side, sheet, onHide, envColumn = false, splitPanes = [], onCloseSplitPane, onExpandSplitPane, sessionStatus = '', onPublish, topRightInset, }) {
52
+ const { t: say } = useI18n();
53
+ const [devMode] = useDevMode();
54
+ const name = repo.split('/').filter(Boolean).pop() || repo;
55
+ const lines = shell(events);
56
+ const failed = failure(events, say);
57
+ const box = useBox(sandbox);
58
+ // Nothing is said of the sandbox until it has been read.
59
+ const held = box.value?.state ?? '';
60
+ const environ = () => side.open({ kind: 'environment', title: say('Environment') });
61
+ const unpublished = useMemo(() => hasUnpublishedEdits(events, published), [events, published]);
62
+ const kinds = [
63
+ {
64
+ id: 'preview',
65
+ label: say('Preview'),
66
+ bleed: true,
67
+ render: () => (_jsx(Browser, { sandbox: sandbox, held: held, site: site, live: live, repo: repo, events: events, published: published, sessionStatus: sessionStatus, hasChanges: unpublished, onPublish: onPublish, onEnvironment: environ })),
68
+ },
69
+ {
70
+ id: 'artifacts',
71
+ label: say('Artifacts'),
72
+ render: () => _jsx(Artifacts, { session: id, sandbox: sandbox, repo: repo, branch: branch, mode: mode, project: project, site: site, pr: pr, onEnvironment: environ }),
73
+ },
74
+ { id: 'files', label: say('Files'), render: () => _jsx(Files, { session: id, repo: repo, branch: branch, sandbox: sandbox, live: held === 'running' }) },
75
+ { id: 'diff', label: devMode ? say('Diff') : say('Changes'), render: () => _jsx(Git, { session: id, title: title, live: live }) },
76
+ {
77
+ id: 'terminal',
78
+ label: devMode ? say('Terminal') : say('Activity'),
79
+ bleed: true,
80
+ render: () => (_jsx(Terminal, { id: id, sandbox: sandbox, held: held, lines: lines, live: live, failed: failed, refused: refused, retry: retry, onRetry: onRetry, devMode: devMode })),
81
+ },
82
+ { id: 'desktop', label: say('Desktop'), bleed: true, render: () => _jsx(Door, { which: "screen", sandbox: sandbox, held: held, session: id }) },
83
+ {
84
+ id: 'environment',
85
+ label: say('Environment'),
86
+ render: () => (_jsxs(YStack, { gap: "$2", children: [_jsx(Environment, { repo: name, busy: live && mode === 'setup' }), _jsx(SizableText, { size: "$2", color: "$ink", pt: "$4", children: say('This session') }), _jsx(Fact, { label: say('Session'), value: id }), _jsx(Fact, { label: say('Repository'), value: name || '—' }), _jsx(Fact, { label: say('Branch'), value: branch || '—' }), _jsx(Fact, { label: say('Base'), value: base || '—' }), _jsx(Fact, { label: say('Runs on'), value: environment || 'sandbox' }), _jsx(Fact, { label: say('Sandbox'), value: sandbox || '—' }), _jsx(Fact, { label: say('Mode'), value: mode || 'build' })] })),
87
+ },
88
+ ];
89
+ const panelNode = splitPanes.length >= 2 && !sheet ? (_jsx(YStack, { flex: 1, minW: 0, minH: 0, display: "grid", gridTemplateColumns: splitPanes.length > 1 ? 'repeat(2, minmax(0, 1fr))' : 'minmax(0, 1fr)', "$max-lg": { gridTemplateColumns: 'minmax(0, 1fr)' }, gridTemplateRows: splitPanes.length > 2 ? 'repeat(2, minmax(0, 1fr))' : 'minmax(0, 1fr)', bg: "$background", children: splitPanes.map((pid, idx) => {
90
+ const k = kinds.find((x) => x.id === pid);
91
+ if (!k)
92
+ return null;
93
+ const headerTitle = pid === 'diff'
94
+ ? devMode
95
+ ? `${base || 'main'} → ${branch || 'HEAD'}`
96
+ : say('Changes')
97
+ : pid === 'terminal'
98
+ ? devMode
99
+ ? `${say('Terminal')} ${name || 'workspace'}`
100
+ : say('Activity')
101
+ : pid === 'preview'
102
+ ? say('Preview')
103
+ : k.label;
104
+ return (_jsxs(YStack, { minW: 0, minH: 0, borderLeftWidth: idx % 2 === 1 ? 1 : 0, borderTopWidth: idx >= 2 ? 1 : 0, "$max-lg": { borderLeftWidth: 0, borderTopWidth: idx > 0 ? 1 : 0 }, borderColor: "$borderColor", display: "grid", gridTemplateRows: "auto minmax(0, 1fr)", children: [_jsxs(XStack, { px: "$2.5", py: "$1.5", gap: "$1.5", items: "center", borderBottomWidth: 1, borderColor: "$borderColor", minH: 36, style: idx === 1 && (topRightInset ?? !sheet) ? { paddingInlineEnd: 'calc(10px + var(--hanzo-shell-top-right-inset, 0px))' } : undefined, children: [_jsx(SizableText, { flex: 1, minW: 0, size: "$2", color: "$ink", numberOfLines: 1, children: headerTitle }), onExpandSplitPane ? (_jsx(XStack, { render: "button", "aria-label": say('Expand {pane}', { pane: k.label }), ...{ title: say('Expand {pane}', { pane: k.label }) }, onClick: () => onExpandSplitPane(pid), minW: 30, minH: 30, items: "center", justify: "center", rounded: "$2", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: _jsx(Maximize2, { size: 13, opacity: 0.7 }) })) : null, onCloseSplitPane ? (_jsx(XStack, { render: "button", "aria-label": say('Close {pane}', { pane: k.label }), ...{ title: say('Close {pane}', { pane: k.label }) }, onClick: () => onCloseSplitPane(pid), minW: 30, minH: 30, items: "center", justify: "center", rounded: "$2", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: _jsx(X, { size: 14, opacity: 0.7 }) })) : null] }), _jsx(YStack, { flex: 1, minH: 0, overflow: k.bleed ? 'hidden' : 'scroll', ...(k.bleed ? null : { p: '$3' }), children: k.render() })] }, pid));
105
+ }) })) : (_jsx(Panel, { side: side, kinds: kinds, sheet: sheet, topRightInset: topRightInset, onHide: onHide, label: say('Session details'),
106
+ // An empty tab offers what this session made: its site and its pull request.
107
+ suggested: [...(site ? [{ title: name || site, url: site }] : []), ...(pr.href ? [{ title: say('Pull request {pr}', { pr: pr.label }), url: pr.href }] : [])], bar: sandbox ? _jsx(Held, { box: box, live: live, devMode: devMode }) : null, menu: _jsx(DropdownMenu, { trigger: _jsx(XStack, { render: "button", "aria-label": say('Session actions'), p: "$1.5", rounded: "$2", hoverStyle: { bg: '$hover' }, children: _jsx(MoreHorizontal, { size: 16 }) }), items: [...menu, { key: 'details', label: say('Details'), icon: _jsx(Info, { size: 16 }), onSelect: environ }] }) }));
108
+ if (envColumn && !sheet) {
109
+ return (_jsxs(XStack, { flex: 1, minW: 0, minH: 0, width: "100%", height: "100%", children: [_jsx(EnvironmentInspection, { id: id, repo: repo, name: name, branch: branch, environment: environment, pr: pr, title: title, events: events, live: live, devMode: devMode, onOpenEnvironment: environ, onOpenDiff: () => side.open({ kind: 'diff', title: devMode ? say('Diff') : say('Changes') }) }), _jsx(YStack, { flex: 1, minW: 0, minH: 0, borderLeftWidth: 1, borderColor: "$borderColor", children: panelNode })] }));
110
+ }
111
+ return panelNode;
112
+ }
113
+ /**
114
+ * The run's sandbox as it stands, and what moves it. It is read while the pane is
115
+ * open and the page is in view, and no more once it has ended or failed.
116
+ */
117
+ function useBox(id) {
118
+ const t = useTarget();
119
+ const [value, setValue] = useState(null);
120
+ const [busy, setBusy] = useState(false);
121
+ const [note, setNote] = useState('');
122
+ useEffect(() => {
123
+ setValue(null);
124
+ if (!id)
125
+ return;
126
+ let gone = false;
127
+ let every;
128
+ const read = () => {
129
+ if (document.hidden)
130
+ return;
131
+ look(t, id).then((b) => {
132
+ if (gone)
133
+ return;
134
+ setValue(b);
135
+ if (b.state === 'gone' || b.state === 'error')
136
+ clearInterval(every);
137
+ }, (e) => !gone && setNote(e.message));
138
+ };
139
+ read();
140
+ every = setInterval(read, EVERY);
141
+ return () => {
142
+ gone = true;
143
+ clearInterval(every);
144
+ };
145
+ }, [t, id]);
146
+ const act = useCallback((how) => {
147
+ setBusy(true);
148
+ setNote('');
149
+ (how === 'park' ? park(t, id) : wake(t, id)).then(setValue, (e) => setNote(e.message)).finally(() => setBusy(false));
150
+ }, [t, id]);
151
+ return { value, busy, note, act };
152
+ }
153
+ /** When a parked sandbox is retired, as a person reads it. */
154
+ const until = (ms) => new Date(ms).toLocaleString(undefined, { weekday: 'short', hour: 'numeric', minute: '2-digit' });
155
+ /**
156
+ * The sandbox's line under the tabs: where it is, and the one thing to do to it.
157
+ * A sandbox a run is working in is not suspended from here.
158
+ */
159
+ function Held({ box, live, devMode }) {
160
+ const { t } = useI18n();
161
+ const { wake: agree, dialog } = useWake();
162
+ const b = box.value;
163
+ // Waking gives the run its cloud computer back, billed again from then: asked first (spend.tsx `useWake`).
164
+ const wake = async () => {
165
+ if (await agree())
166
+ box.act('wake');
167
+ };
168
+ const state = b?.state ?? 'pending';
169
+ const says = devMode
170
+ ? state === 'running'
171
+ ? t('Sandbox running')
172
+ : state === 'parked'
173
+ ? b?.ends
174
+ ? t('Sandbox suspended · its files are kept until {time}', { time: until(b.ends) })
175
+ : t('Sandbox suspended · its files are kept')
176
+ : state === 'pending'
177
+ ? t('Sandbox starting…')
178
+ : state === 'gone'
179
+ ? t('Sandbox ended')
180
+ : b?.error
181
+ ? t('Sandbox unavailable · {error}', { error: b.error })
182
+ : t('Sandbox unavailable')
183
+ : state === 'running'
184
+ ? t('Cloud workspace ready')
185
+ : state === 'parked'
186
+ ? t('Cloud workspace sleeping · files saved')
187
+ : state === 'pending'
188
+ ? t('Starting cloud workspace…')
189
+ : state === 'gone'
190
+ ? t('Cloud workspace closed')
191
+ : b?.error
192
+ ? t('Cloud workspace unavailable · {error}', { error: b.error })
193
+ : t('Cloud workspace unavailable');
194
+ return (_jsxs(XStack, { px: "$3", py: "$1.5", gap: "$2", rowGap: "$1.5", items: "center", flexWrap: "wrap", borderBottomWidth: 1, borderColor: "$borderColor", "aria-label": devMode ? t('Sandbox') : t('Workspace status'), children: [dialog, _jsx(YStack, { width: 7, height: 7, rounded: 99, bg: state === 'running' ? 'var(--state-online)' : state === 'parked' ? '$soft' : '$borderColor', shrink: 0 }), _jsx(SizableText, { flex: 1, minW: 120, size: "$1", color: "$soft", numberOfLines: 1, children: box.note || says }), state === 'running' && !live ? (_jsx(Button, { size: "sm", variant: "ghost", disabled: box.busy, onPress: () => box.act('park'), children: t('Suspend') })) : state === 'parked' ? (_jsx(Button, { size: "sm", variant: "outline", borderColor: "var(--border-strong)", disabled: box.busy, onPress: () => void wake(), children: box.busy ? t('Resuming…') : devMode ? t('Resume') : t('Wake') })) : null] }));
195
+ }
196
+ /** What a preview page says of itself, when it cannot serve. */
197
+ const mono = { fontFamily: 'var(--f-mono, ui-monospace, monospace)', whiteSpace: 'pre' };
198
+ const PREVIEW = 'hanzo-preview';
199
+ /** How often a preview is opened again on its own before Retry is the person's to press. */
200
+ const REMINTS = 2;
201
+ const REMINT = 30_000;
202
+ /** What a preview page's status means to the person looking at it, when it is not reopened, in the language of `say`. */
203
+ const SAYS = {
204
+ 401: (_, say) => `${say('This browser keeps the preview’s cookie out of a frame.')} ${say('Open it in a new tab.')}`,
205
+ 502: (port, say) => `${say('Nothing answered on port {port}.', { port })} ${say('Start the server, then Retry.')}`,
206
+ };
207
+ /**
208
+ * The Browser tab: what the run's sandbox serves, one port at a time, framed at
209
+ * its own origin; or, with nothing serving, where the run is published. Only a
210
+ * running sandbox is shown: a suspended one is resumed from the bar, never by
211
+ * looking. A preview that lost its sandbox (409) is opened again, at most twice
212
+ * in a while; any other status is said, and Retry is the person's.
213
+ */
214
+ function Browser({ sandbox, held, site, live, repo, events, published, sessionStatus, hasChanges, onPublish, onEnvironment, }) {
215
+ const { t: say } = useI18n();
216
+ const t = useTarget();
217
+ const [open, setOpen] = useState([]);
218
+ const [port, setPort] = useState(0);
219
+ const [src, setSrc] = useState('');
220
+ const [why, setWhy] = useState('');
221
+ const [attempt, setAttempt] = useState(0);
222
+ const [rev, setRev] = useState(0);
223
+ const [preferLive, setPreferLive] = useState(false);
224
+ const [serving, setServing] = useState(null);
225
+ const reopened = useRef([]);
226
+ const frame = useRef(null);
227
+ // A suspended sandbox is woken only by a press (Open in a new tab, Start dev server) and only on a yes.
228
+ const { wake, dialog } = useWake();
229
+ const running = Boolean(sandbox) && held === 'running';
230
+ // A server the session started ended with the session, so once it has, the person can
231
+ // start one again here, in the sandbox kept for its previews — a suspended one
232
+ // is resumed for it. While the session works, its server is the agent's to start.
233
+ const startable = Boolean(sandbox) && !live && (held === 'running' || held === 'parked');
234
+ // Track turn completions, file edits, pushes, and publishes so Preview refreshes automatically.
235
+ const revision = useMemo(() => previewRevision(events, sessionStatus, published), [events, sessionStatus, published]);
236
+ const lastRevision = useRef(revision);
237
+ const wasLive = useRef(live);
238
+ useEffect(() => {
239
+ const completed = wasLive.current && !live;
240
+ wasLive.current = live;
241
+ if (lastRevision.current !== revision || completed) {
242
+ lastRevision.current = revision;
243
+ setRev((n) => n + 1);
244
+ if (port)
245
+ setAttempt((a) => a + 1);
246
+ }
247
+ }, [revision, live, port]);
248
+ // What listens, read again while the sandbox runs: a dev server appears once it listens.
249
+ // Also re-polls immediately whenever `rev` advances (e.g. a turn finished or edits landed).
250
+ useEffect(() => {
251
+ if (!running) {
252
+ setOpen([]);
253
+ setPort(0);
254
+ return;
255
+ }
256
+ let gone = false;
257
+ const read = () => listening(t, sandbox).then((ps) => {
258
+ if (gone)
259
+ return;
260
+ setOpen(ps);
261
+ setPort((p) => (ps.some((x) => x.port === p) ? p : (ps[0]?.port ?? 0)));
262
+ }, () => undefined);
263
+ void read();
264
+ const every = setInterval(read, PORTS);
265
+ return () => {
266
+ gone = true;
267
+ clearInterval(every);
268
+ };
269
+ }, [t, sandbox, running, rev]);
270
+ // One address per port and attempt: its ticket is spent when the page opens it.
271
+ useEffect(() => {
272
+ setSrc('');
273
+ setWhy('');
274
+ if (!port || !sandbox)
275
+ return;
276
+ let gone = false;
277
+ // Opened by the page (and again after the sandbox stopped), so it never wakes it; only a press does.
278
+ preview(t, sandbox, port, stay).then((u) => !gone && setSrc(u), (e) => !gone && setWhy(e.message));
279
+ return () => {
280
+ gone = true;
281
+ };
282
+ }, [t, sandbox, port, attempt]);
283
+ // A preview that can no longer serve says so; one whose sandbox stopped is opened again, a little.
284
+ useEffect(() => {
285
+ if (!src)
286
+ return;
287
+ const origin = new URL(src).origin;
288
+ const hear = (e) => {
289
+ if (e.origin !== origin || e.source !== frame.current?.contentWindow)
290
+ return;
291
+ const m = e.data;
292
+ if (m?.source !== PREVIEW || typeof m.status !== 'number')
293
+ return;
294
+ const now = Date.now();
295
+ reopened.current = reopened.current.filter((at) => now - at < REMINT);
296
+ if (m.status === 409 && reopened.current.length < REMINTS) {
297
+ reopened.current.push(now);
298
+ setAttempt((a) => a + 1);
299
+ return;
300
+ }
301
+ const words = SAYS[m.status];
302
+ if (words || m.status === 409)
303
+ setWhy(words ? words(port, say) : `${say('The sandbox stopped serving.')} ${say('Retry to open it again.')}`);
304
+ };
305
+ window.addEventListener('message', hear);
306
+ return () => window.removeEventListener('message', hear);
307
+ }, [src, port, say]);
308
+ const tab = () => away(preview(t, sandbox, port, wake)).catch((e) => setWhy(e.message));
309
+ /**
310
+ * Start the app's server: the codebase's start command when its environment
311
+ * names one, else its package's dev script. The page opens once it listens,
312
+ * because what listens is read every few seconds anyway.
313
+ */
314
+ const start = async () => {
315
+ setPreferLive(false);
316
+ setServing({ command: '', up: true, log: '', why: '' });
317
+ try {
318
+ const named = repo ? await readEnvironment(t, repo).then((e) => e.start, () => '') : '';
319
+ setServing({ command: await serve(t, sandbox, wake, named), up: true, log: '', why: '' });
320
+ }
321
+ catch (e) {
322
+ setServing({ command: '', up: false, log: '', why: e.message });
323
+ }
324
+ };
325
+ // While a server started here comes up, whether it is still running and what it
326
+ // says; one that exits says why. Read for a while, never for as long as the page is open.
327
+ const coming = Boolean(serving?.command && serving.up && !port);
328
+ useEffect(() => {
329
+ if (!coming)
330
+ return;
331
+ let gone = false;
332
+ const until = Date.now() + WATCH;
333
+ const check = () => {
334
+ if (Date.now() > until) {
335
+ clearInterval(every);
336
+ setServing((v) => v && { ...v, why: say('It is running, and nothing listens on a port yet.') });
337
+ return;
338
+ }
339
+ served(t, sandbox).then((s) => {
340
+ if (gone)
341
+ return;
342
+ setServing((v) => v && { ...v, up: s.up, log: s.log, why: s.up ? '' : say('The dev server stopped.') });
343
+ }, () => undefined);
344
+ };
345
+ const every = setInterval(check, WATCHING);
346
+ return () => {
347
+ gone = true;
348
+ clearInterval(every);
349
+ };
350
+ }, [t, sandbox, coming, say]);
351
+ const hasSandboxPreview = running && Boolean(port);
352
+ const resolved = resolvePreviewSource({
353
+ sandboxUrl: hasSandboxPreview ? src || `https://sandbox.local:${port}` : '',
354
+ liveUrl: site,
355
+ preferLive,
356
+ });
357
+ const showingSandbox = hasSandboxPreview && resolved.kind === 'sandbox';
358
+ if (!showingSandbox) {
359
+ return (_jsxs(_Fragment, { children: [dialog, _jsx(Site, { site: site, rev: rev, onReload: () => setRev((n) => n + 1), live: live, held: held, serving: serving, events: events, hasChanges: hasChanges, hasSandboxPreview: hasSandboxPreview, onUseSandbox: hasSandboxPreview ? () => setPreferLive(false) : undefined, onStart: startable ? () => void start() : undefined, onPublish: onPublish, onEnvironment: repo ? onEnvironment : undefined })] }));
360
+ }
361
+ const host = open.find((p) => p.port === port)?.host ?? '';
362
+ const framedSrc = src ? cacheBustUrl(src, rev) : '';
363
+ return (_jsxs(YStack, { flex: 1, minH: 0, children: [dialog, _jsxs(XStack, { px: "$2", py: "$1.5", gap: "$1.5", items: "center", borderBottomWidth: 1, borderColor: "$borderColor", minW: 0, children: [_jsx(XStack, { render: "button", "aria-label": say('Reload the page'), ...{ title: say('Reload the page') }, onPress: () => {
364
+ setRev((n) => n + 1);
365
+ setAttempt((a) => a + 1);
366
+ }, p: "$1.5", rounded: "$2", shrink: 0, hoverStyle: { bg: '$hover' }, children: _jsx(RefreshCcw, { size: 14 }) }), _jsxs(XStack, { "data-slot": "preview-mode", "data-kind": "sandbox", items: "center", gap: "$1", px: "$2", py: "$0.5", rounded: 999, bg: "$edge", borderWidth: 1, borderColor: "$borderColor", shrink: 0, children: [_jsx(YStack, { width: 6, height: 6, rounded: 99, bg: "var(--state-online)", shrink: 0 }), _jsx(SizableText, { size: "$1", color: "$ink", numberOfLines: 1, children: say('Sandbox preview') })] }), open.length > 1 ? (_jsx(XStack, { gap: "$1", shrink: 0, children: open.map((p) => (_jsx(XStack, { render: "button", "aria-label": say('Port {port}', { port: p.port }), ...{ title: say('Port {port}', { port: p.port }) }, onPress: () => setPort(p.port), px: "$2", py: "$1", rounded: "$2", bg: p.port === port ? '$hover' : 'transparent', children: _jsx(SizableText, { size: "$1", color: p.port === port ? '$ink' : '$soft', children: String(p.port) }) }, p.port))) })) : null, _jsx(SizableText, { flex: 1, minW: 0, size: "$1", color: "$soft", numberOfLines: 1, style: mono, children: host || say('port {port}', { port }) }), site ? (_jsx(XStack, { render: "button", "aria-label": say('Live site'), onPress: () => setPreferLive(true), px: "$2", height: 28, items: "center", rounded: "$2", shrink: 0, hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: say('Live site') }) })) : null, onPublish ? (_jsxs(Button, { size: "sm", variant: "primary", onPress: onPublish, shrink: 0, children: [_jsx(Upload, { size: 13 }), _jsx(SizableText, { size: "$1", color: "inherit", children: say('Publish') })] })) : null, _jsx(OpenOut, { label: say('Open in browser'), onPress: () => void tab() })] }), why ? (_jsxs(YStack, { flex: 1, items: "center", justify: "center", gap: "$2", p: "$6", children: [_jsx(SizableText, { size: "$2", color: "$soft", style: { textAlign: 'center' }, children: why }), _jsxs(XStack, { gap: "$2", children: [_jsx(Button, { size: "sm", variant: "outline", onPress: () => setAttempt((a) => a + 1), children: say('Retry') }), _jsx(Button, { size: "sm", variant: "outline", onPress: () => void tab(), children: say('Open in browser') })] })] })) : framedSrc ? (_jsx("iframe", { ref: frame, src: framedSrc, title: say('What the session serves on port {port}', { port }), sandbox: "allow-scripts allow-same-origin allow-forms allow-popups", style: { border: 0, width: '100%', height: '100%', display: 'block', background: '#fff' } }, `${port}-${attempt}`)) : (_jsx(YStack, { flex: 1, items: "center", justify: "center", children: _jsx(SizableText, { size: "$2", color: "$soft", children: say('Opening port {port}…', { port }) }) }))] }));
367
+ }
368
+ /**
369
+ * The Preview's way out to the person's own browser (Chrome, or whichever they use; Hanzo Desktop hands it to
370
+ * the system's browser): the live page at its own address, beside the work. Said in words, not an icon alone
371
+ * (hanzo-inc/app issue 312). With `onPress` it is a button; without, the face of the link around it.
372
+ */
373
+ function OpenOut({ label, onPress }) {
374
+ return (_jsxs(XStack, { ...(onPress ? { render: 'button', 'aria-label': label, onPress } : {}), items: "center", gap: "$1.5", px: "$2", height: 28, rounded: "$2", borderWidth: 1, borderColor: "var(--border-strong)", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, "data-slot": "open-in-browser", children: [_jsx(ExternalLink, { size: 13 }), _jsx(SizableText, { size: "$1", color: "$ink", numberOfLines: 1, children: label })] }));
375
+ }
376
+ /** How long, and how often, a server started here is watched while it comes up. */
377
+ const WATCH = 120_000;
378
+ const WATCHING = 3_000;
379
+ /**
380
+ * Where the run published its work, framed, with its address, a reload and the
381
+ * page in a tab of its own; or what keeps its sandbox from serving, and the
382
+ * server the person can start in it.
383
+ */
384
+ function Site({ site, rev, onReload, live, held, serving, events, hasChanges, hasSandboxPreview, onUseSandbox, onStart, onPublish, onEnvironment, }) {
385
+ const { t } = useI18n();
386
+ const progress = live ? steps(events) : [];
387
+ const frame = useRef(null);
388
+ const [device, setDevice] = useState('desktop');
389
+ const [dock, setDock] = useKept('hanzo.build.dock', 36);
390
+ const [lines, setLines] = useState([]);
391
+ const onBridge = (e) => {
392
+ if (e.type === 'preview:console')
393
+ setLines((was) => [...was.slice(-400), { id: `p${was.length}-${Date.now()}`, level: e.level, text: e.text, source: 'page' }]);
394
+ };
395
+ const framedSite = site ? cacheBustUrl(site, rev) : '';
396
+ return (_jsxs(YStack, { flex: 1, minH: 0, children: [_jsxs(XStack, { px: "$2", py: "$1.5", gap: "$1.5", items: "center", borderBottomWidth: 1, borderColor: "$borderColor", minW: 0, children: [_jsx(XStack, { render: "button", "aria-label": t('Reload the page'), ...{ title: t('Reload the page') }, onPress: () => {
397
+ onReload();
398
+ frame.current?.reload();
399
+ }, p: "$1.5", rounded: "$2", shrink: 0, hoverStyle: { bg: '$hover' }, children: _jsx(RefreshCcw, { size: 14 }) }), site ? (_jsxs(XStack, { "data-slot": "preview-mode", "data-kind": "live", items: "center", gap: "$1", px: "$2", py: "$0.5", rounded: 999, bg: "$edge", borderWidth: 1, borderColor: "$borderColor", shrink: 0, children: [_jsx(Globe, { size: 11, opacity: 0.75 }), _jsx(SizableText, { size: "$1", color: "$ink", numberOfLines: 1, children: t('Live site') })] })) : null, _jsx(SizableText, { flex: 1, minW: 0, size: "$1", color: "$soft", numberOfLines: 1, style: mono, children: site || t('Nothing is serving yet') }), onUseSandbox ? (_jsx(Button, { size: "sm", variant: "outline", onPress: onUseSandbox, shrink: 0, children: t('Sandbox preview') })) : onStart && site ? (_jsxs(XStack, { render: "button", "aria-label": t('Start sandbox preview'), onPress: onStart, items: "center", gap: "$1", px: "$2", height: 28, rounded: "$2", borderWidth: 1, borderColor: "var(--border-strong)", shrink: 0, hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: [_jsx(Play, { size: 12 }), _jsx(SizableText, { size: "$1", color: "$ink", numberOfLines: 1, children: serving?.up ? t('Starting…') : t('Sandbox preview') })] })) : null, onPublish ? (_jsxs(Button, { size: "sm", variant: "primary", onPress: onPublish, shrink: 0, children: [_jsx(Upload, { size: 13 }), _jsx(SizableText, { size: "$1", color: "inherit", children: t('Publish') })] })) : null, _jsx(Views, { views: DEVICES, value: device, onChange: (d) => setDevice(d), label: t('Device'), labels: "none" }), site ? (_jsx(Out, { href: site, label: t('Open in browser'), children: _jsx(OpenOut, { label: t('Open in browser') }) })) : null] }), site && hasChanges && !live && !hasSandboxPreview ? (_jsxs(XStack, { "data-slot": "preview-stale-banner", px: "$2.5", py: "$1.5", gap: "$2", items: "center", bg: "$sunken", borderBottomWidth: 1, borderColor: "$borderColor", flexWrap: "wrap", children: [_jsx(SizableText, { size: "$1", color: "$soft", flex: 1, minW: 140, children: t('Showing the deployed live site — edits in this session are not published yet.') }), onStart ? (_jsx(Button, { size: "sm", variant: "outline", onPress: onStart, children: t('Start preview') })) : null, onPublish ? (_jsx(Button, { size: "sm", variant: "primary", onPress: onPublish, children: t('Publish changes') })) : null] })) : null, _jsx(PreviewFrame, { ref: frame, src: framedSite, title: t('Where this session is published'), device: device, onBridge: onBridge, empty: _jsxs(YStack, { items: "center", gap: "$2.5", p: "$6", children: [_jsx(Globe, { size: 28, opacity: 0.45 }), _jsx(SizableText, { size: "$3", color: "$ink", children: t('Nothing is serving yet') }), _jsx(SizableText, { size: "$2", color: "$soft", style: { textAlign: 'center', maxWidth: 280 }, children: held === 'parked'
400
+ ? `${t('This session’s sandbox is suspended.')} ${t('Resume it to see what it serves.')}`
401
+ : live
402
+ ? t('When the session starts a server in its sandbox, the page opens here.')
403
+ : `${t('Nothing listens in this session’s sandbox, and it published no site.')} ${t('A server the session started stopped when the session ended.')}` }), progress.length ? (_jsx(YStack, { render: "ol", "aria-label": t('Live session steps'), gap: "$2", m: 0, p: 0, width: "100%", maxW: 340, children: progress.map((step) => (_jsxs(XStack, { render: "li", borderWidth: 1, borderColor: "$borderColor", bg: "$sunken", rounded: "$3", p: "$2.5", gap: "$2", items: "center", children: [step.done ? _jsx(Check, { size: 15, "aria-hidden": true }) : _jsx(Circle, { size: 15, "aria-hidden": true }), _jsx(SizableText, { size: "$2", flex: 1, children: step.name }), _jsx(SizableText, { size: "$1", color: "$soft", children: step.done ? t('Finished') : t('Running') })] }, step.name))) })) : null, serving ? (_jsxs(YStack, { items: "center", gap: "$2", width: "100%", children: [_jsx(SizableText, { size: "$2", color: "$ink", role: "status", style: { textAlign: 'center', maxWidth: 320 }, children: serving.why || (serving.command ? t('Starting {command}…', { command: serving.command }) : t('Starting the dev server…')) }), serving.log ? _jsx(Tail, { log: serving.log }) : null, serving.why ? (_jsxs(XStack, { gap: "$2", flexWrap: "wrap", justify: "center", children: [onStart ? (_jsx(Button, { size: "sm", variant: "outline", onPress: onStart, children: t('Try again') })) : null, onEnvironment ? (_jsx(Button, { size: "sm", variant: "outline", onPress: onEnvironment, children: t('Set a start command') })) : null] })) : null] })) : onStart ? (_jsx(Button, { size: "sm", onPress: onStart, children: t('Start dev server') })) : null] }) }), site ? _jsx(Console, { lines: lines, height: dock, onHeight: setDock, onClear: () => setLines([]), label: t('Console') }) : null] }));
404
+ }
405
+ /** The last lines a server wrote, as it wrote them. */
406
+ function Tail({ log }) {
407
+ return (_jsx(YStack, { width: "100%", maxW: 460, maxH: 200, overflow: "scroll", rounded: "$2", borderWidth: 1, borderColor: "$borderColor", p: "$2", children: _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", "$platform-web": { whiteSpace: 'pre-wrap', wordBreak: 'break-word' }, children: log.split('\n').slice(-12).join('\n') }) }));
408
+ }
409
+ function EnvironmentInspection({ id, repo, name, branch, environment, pr, title, events, live, devMode, onOpenEnvironment, onOpenDiff, }) {
410
+ const { t } = useI18n();
411
+ const host = useHost();
412
+ const target = useTarget();
413
+ const signed = Boolean(host.person);
414
+ const [remoteControl, setRemoteControl] = useKept('hanzo.build.remote.control', true);
415
+ const changes = useRead(signed ? () => readChanges(target, id) : null, null, [target, id, signed]);
416
+ const allCards = cards(events, '', t);
417
+ const shellCards = allCards.filter((c) => c.kind === 'shell');
418
+ const runningTasks = shellCards.filter((c) => c.ran === 'running' && live);
419
+ const finishedCount = shellCards.filter((c) => c.ran !== 'running' || !live).length + steps(events).filter((s) => s.done).length;
420
+ const totalChars = events.reduce((sum, e) => sum + JSON.stringify(e.payload ?? '').length, 0);
421
+ const estTokens = Math.max(1, Math.round(totalChars / 4));
422
+ const contextPct = Math.min(100, Math.max(1, Math.round((estTokens / 128_000) * 100)));
423
+ const added = changes.value?.files.reduce((n, f) => n + f.additions, 0) ?? 0;
424
+ const removed = changes.value?.files.reduce((n, f) => n + f.deletions, 0) ?? 0;
425
+ const envDisplay = formatDeviceLabel(environment || 'sandbox', { devMode, say: t });
426
+ return (_jsxs(YStack, { width: 264, shrink: 0, minH: 0, overflow: "scroll", bg: "$background", px: "$3", py: "$2.5", gap: "$3", children: [_jsx(SizableText, { size: "$2", color: "$ink", fontWeight: "600", children: devMode ? t('Environment') : t('Workspace') }), _jsxs(YStack, { gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Laptop, { size: 14, opacity: 0.7 }), _jsx(SizableText, { flex: 1, size: "$2", color: "$ink", numberOfLines: 1, children: envDisplay.title }), _jsx(XStack, { render: "button", onPress: onOpenEnvironment, px: "$1.5", py: "$0.5", minH: 28, items: "center", focusVisibleStyle: RING, children: _jsx(SizableText, { size: "$1", color: "$ink", textDecorationLine: "underline", children: t('Save') }) })] }), _jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Folder, { size: 14, opacity: 0.7 }), _jsx(SizableText, { size: "$2", color: "$ink", numberOfLines: 1, children: name || 'workspace' }), _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: "\u00B7 ~/work" })] }), repo ? (_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Folder, { size: 14, opacity: 0.7 }), _jsx(SizableText, { size: "$2", color: "$ink", numberOfLines: 1, children: repo })] })) : null, branch ? (_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(GitBranch, { size: 14, opacity: 0.7 }), _jsx(SizableText, { size: "$2", color: "$ink", numberOfLines: 1, children: branch })] })) : null, _jsxs(XStack, { items: "center", gap: "$2", pt: "$1", children: [_jsx(SizableText, { flex: 1, size: "$2", color: "$ink", children: t('Remote Control') }), _jsx(Switch, { checked: remoteControl, onCheckedChange: setRemoteControl, size: "sm", "aria-label": t('Remote Control') })] })] }), _jsx(YStack, { borderTopWidth: 1, borderColor: "$borderColor", pt: "$2.5", gap: "$2", children: _jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(SizableText, { size: "$2", color: "$ink", fontWeight: "500", children: t('Context') }), _jsx(SizableText, { flex: 1, size: "$1", color: "$soft", text: "end", fontVariant: ['tabular-nums'], children: `${contextPct}%` }), _jsx(YStack, { width: 28, height: 6, rounded: 99, bg: "$borderColor", overflow: "hidden", children: _jsx(YStack, { width: `${contextPct}%`, height: "100%", bg: "$blue10" }) })] }) }), _jsx(YStack, { borderTopWidth: 1, borderColor: "$borderColor", pt: "$2.5", gap: "$2", children: _jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(SizableText, { size: "$2", color: "$ink", fontWeight: "500", children: t('Connectors') }), _jsx(SizableText, { flex: 1, size: "$1", color: "$soft", text: "end", children: t('Connected') })] }) }), _jsxs(YStack, { borderTopWidth: 1, borderColor: "$borderColor", pt: "$2.5", gap: "$1.5", children: [_jsx(SizableText, { size: "$2", color: "$ink", fontWeight: "500", children: t('Changes') }), _jsxs(XStack, { render: "button", onPress: onOpenDiff, items: "flex-start", gap: "$2", py: "$1", rounded: "$2", hoverStyle: { bg: '$hover' }, children: [_jsx(GitPullRequest, { size: 14, color: "$green10" }), _jsxs(YStack, { flex: 1, minW: 0, gap: "$0.5", children: [_jsx(SizableText, { size: "$2", color: "$ink", numberOfLines: 1, text: "start", children: title || branch || (devMode ? t('Working tree') : t('Latest changes')) }), _jsxs(XStack, { gap: "$1.5", items: "center", children: [pr.label ? (_jsx(SizableText, { size: "$1", color: "$soft", children: pr.label })) : null, _jsx(SizableText, { size: "$1", color: "var(--state-success)", fontVariant: ['tabular-nums'], children: `+${added}` }), _jsx(SizableText, { size: "$1", color: "var(--state-error)", fontVariant: ['tabular-nums'], children: `−${removed}` })] })] })] })] }), _jsxs(YStack, { borderTopWidth: 1, borderColor: "$borderColor", pt: "$2.5", gap: "$2", children: [_jsx(SizableText, { size: "$2", color: "$ink", fontWeight: "500", children: t('Background tasks') }), runningTasks.map((task) => (_jsxs(XStack, { items: "center", gap: "$2", py: "$1", children: [_jsx(SquareTerminal, { size: 14, opacity: 0.7 }), _jsx(SizableText, { flex: 1, minW: 0, size: "$2", color: "$ink", numberOfLines: 1, children: task.command }), _jsx(Square, { size: 10, fill: "currentColor" })] }, task.key))), _jsx(XStack, { items: "center", gap: "$2", py: "$0.5", children: _jsx(SizableText, { size: "$1", color: "$soft", children: t('{n} finished', { n: finishedCount }) }) })] })] }));
427
+ }
428
+ function Fact({ label, value }) {
429
+ return (_jsxs(XStack, { gap: "$3", items: "baseline", children: [_jsx(SizableText, { size: "$1", color: "$soft", width: 96, children: label }), _jsx(SizableText, { flex: 1, size: "$2", color: "$ink", numberOfLines: 2, children: value })] }));
430
+ }
431
+ /**
432
+ * The Terminal tab: a shell in the run's sandbox, in the same working tree as the
433
+ * agent, while the sandbox is kept; and the agent's log, which outlives it. The
434
+ * shell is a tmux session named for the run, so a reopened tab reattaches to it.
435
+ */
436
+ function Terminal({ id, sandbox, held, lines, live, failed, refused, retry, onRetry, devMode, }) {
437
+ const { t } = useI18n();
438
+ const reachable = Boolean(sandbox) && held === 'running';
439
+ // The agent log is the tab it opens on; the shell is one press away for everyone whenever the sandbox is reachable.
440
+ const [log, setLog] = useState(true);
441
+ const showShell = reachable && !log;
442
+ return (_jsxs(YStack, { flex: 1, minH: 0, bg: "$background", children: [_jsxs(XStack, { px: "$2", py: "$1.5", gap: "$1", rowGap: "$1", flexWrap: "wrap", borderBottomWidth: 1, borderColor: "$borderColor", items: "center", children: [reachable ? (_jsx(XStack, { render: "button", "aria-label": t('Shell'), "aria-pressed": showShell, onPress: () => setLog(false), px: "$2.5", py: "$1", minH: 30, items: "center", focusVisibleStyle: RING, children: _jsx(SizableText, { size: "$1", color: showShell ? '$ink' : '$soft', children: t('Shell') }) })) : null, _jsx(XStack, { render: "button", "aria-label": t('Agent log'), "aria-pressed": !showShell, onPress: () => setLog(true), px: "$2.5", py: "$1", minH: 30, items: "center", focusVisibleStyle: RING, children: _jsx(SizableText, { size: "$1", color: showShell ? '$soft' : '$ink', children: t('Agent log') }) })] }), showShell ? _jsx(Door, { which: "terminal", sandbox: sandbox, held: held, session: `run-${id.replace(/^sess_/, '').slice(0, 12)}` }) : _jsx(Log, { lines: lines, live: live, failed: failed, refused: refused, retry: retry, onRetry: onRetry })] }));
443
+ }
444
+ function Log({ lines, live, failed, refused, retry, onRetry, }) {
445
+ const { t } = useI18n();
446
+ const prompt = 'workspace';
447
+ const idle = lines.length === 0 && !live;
448
+ return (_jsxs(YStack, { flex: 1, minH: 0, children: [_jsxs(YStack, { flex: 1, minH: 0, overflow: "scroll", px: "$3", py: "$3", gap: "$1", children: [idle ? (_jsxs(YStack, { flex: 1, items: "center", justify: "center", gap: "$3", py: "$8", children: [_jsx(SizableText, { size: "$2", color: "$soft", text: "center", children: refused || (failed ? t('This session stopped before its first command: {reason}', { reason: failed }) : t('This session finished without writing a command.')) }), refused ? (_jsx(Button, { size: "sm", variant: "outline", onPress: onRetry, children: retry })) : null] })) : (lines.map((line, i) => line.role === 'cmd' ? (_jsxs(XStack, { gap: "$2", children: [_jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", "$platform-web": { whiteSpace: 'pre' }, children: `${prompt} $` }), _jsx(SizableText, { flex: 1, size: "$1", color: "$ink", fontFamily: "$mono", "$platform-web": { whiteSpace: 'pre' }, children: line.text })] }, i)) : (_jsx(SizableText, { size: "$1", color: "$ink", fontFamily: "$mono", "$platform-web": { whiteSpace: 'pre' }, children: line.text }, i)))), live ? (_jsxs(XStack, { gap: "$2", items: "center", children: [_jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", "$platform-web": { whiteSpace: 'pre' }, children: `${prompt} $` }), _jsx(YStack, { width: 7, height: 14, bg: "$ink" })] })) : null] }), _jsx(XStack, { px: "$3", py: "$2", borderTopWidth: 1, borderColor: "$borderColor", children: _jsx(SizableText, { size: "$1", color: "$soft", children: t('Commands appear here as the run writes them.') }) })] }));
449
+ }
@@ -0,0 +1,43 @@
1
+ import type { Say } from '@hanzo/i18n/react';
2
+ export declare const DEV_MODE_KEY = "hanzo.dev_mode";
3
+ export declare const DEV_MODE_EVENT = "hanzo:dev-mode";
4
+ /** What Developer mode does, in one line, wherever its switch is drawn (English, marked; drawn through `t`). */
5
+ export declare const DEV_MODE_NOTE: string;
6
+ /**
7
+ * DEVELOPER MODE IS OFF FOR A NEW PERSON, and the result is what they see
8
+ * (hanzo-inc/app issues 317 and 321). Someone who has worked with the process
9
+ * on this device keeps seeing it: the first time the choice is read where it
10
+ * was never made, it is made once from what this device shows of them, and kept.
11
+ *
12
+ * - Tabs listed a machine or a cloud workspace of theirs (`hanzo.tabs.fleet`):
13
+ * they opened a terminal, or linked a computer with the CLI.
14
+ * - Dev's transcript view is Thinking or Verbose: they asked to see more of it.
15
+ *
16
+ * Anyone else, including someone who has only built with Dev, starts with the
17
+ * result. The switch (Settings › General, the account menu, a run's menu, ⌘⇧D)
18
+ * changes it either way.
19
+ */
20
+ export declare function adopt(store: Pick<Storage, 'getItem'>): boolean;
21
+ export declare function getDevMode(): boolean;
22
+ export declare function setDevMode(next: boolean): void;
23
+ export declare function useDevMode(): [boolean, (next: boolean) => void];
24
+ export interface DeviceLabelOptions {
25
+ hardware?: string | null;
26
+ host?: string | null;
27
+ /** The name the person gave it (names.ts): it wins, for a developer too. */
28
+ name?: string | null;
29
+ devMode?: boolean;
30
+ /** The reader's `t`; English where none is given. */
31
+ say?: Say;
32
+ }
33
+ /**
34
+ * A device as a person reads it. A name the person gave it wins. Otherwise a
35
+ * developer sees the name the machine reports, and anyone else sees it as a
36
+ * person says it (`Alexs-MacBook-Pro.local` → "Alex's MacBook Pro", names.ts
37
+ * `friendly`), with the hardware and the hostname beneath, and the cloud
38
+ * workspace in plain words.
39
+ */
40
+ export declare function formatDeviceLabel(raw: string | null | undefined, opts?: DeviceLabelOptions): {
41
+ title: string;
42
+ detail?: string;
43
+ };