@hanzo/dev 4.0.1 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (371) hide show
  1. package/LICENSE +21 -0
  2. package/dist/{BinaryViewer-qn8xfPZp.js → BinaryViewer-CmFUK4zZ.js} +2 -2
  3. package/dist/{ChatMarkdown-Cyujn3JJ.js → ChatMarkdown-nvEI7iCv.js} +4 -4
  4. package/dist/{DiffCommentAnnotation-BZu1TP6E.js → DiffCommentAnnotation-BPTN_2a6.js} +1 -1
  5. package/dist/{DiffFileTree-CcJ91zOM.js → DiffFileTree-B_br90vY.js} +2 -2
  6. package/dist/{DiffPanel-BXC88NMs.js → DiffPanel-V5R5TPuK.js} +5 -5
  7. package/dist/{ExpandedImageDialog-BZnGRBJR.js → ExpandedImageDialog-CAorLacL.js} +1 -1
  8. package/dist/{FileExplorerPane-vBJS6V75.js → FileExplorerPane-CeHulcPz.js} +1 -1
  9. package/dist/{FilePreviewPanel-jJHWsMzm.js → FilePreviewPanel-BVNLvWOc.js} +8 -8
  10. package/dist/{MermaidDiagram-paNwQY33.js → MermaidDiagram-CTolIzQD.js} +1 -1
  11. package/dist/{MermaidFilePreview-B9KxfnIN.js → MermaidFilePreview-CP2zP4FU.js} +1 -1
  12. package/dist/{MermaidViewer-CAEGpLyD.js → MermaidViewer-BDfYkS9E.js} +2 -2
  13. package/dist/{NotebookPreview-D01mMCpR.js → NotebookPreview-Cybs5uM0.js} +1 -1
  14. package/dist/{OfficeFilePreview-DWaRgfQU.js → OfficeFilePreview-7JsmSoKU.js} +1 -1
  15. package/dist/{OfficeViewer-BudrZbBA.js → OfficeViewer-CJoojlJK.js} +1 -1
  16. package/dist/{OpenInPicker-Dd3ifHa1.js → OpenInPicker-BIMWUxBP.js} +7 -7
  17. package/dist/{OpenXmlOfficeViewer-CXcKdq7k.js → OpenXmlOfficeViewer-C24Kj8DM.js} +1 -1
  18. package/dist/{PreviewImage-C4Ku4z7v.js → PreviewImage-oY5YnuTr.js} +1 -1
  19. package/dist/{PreviewImageContent-BwOB9Lyd.js → PreviewImageContent-n6eLzY99.js} +1 -1
  20. package/dist/{PullRequestCodeTab-BcwyMk7d.js → PullRequestCodeTab-Dv_0kVad.js} +7 -7
  21. package/dist/{PullRequestReviewAnnotation-BU5t_1fC.js → PullRequestReviewAnnotation-LeuwO-iH.js} +4 -4
  22. package/dist/builder/activity.d.ts +16 -0
  23. package/dist/builder/activity.js +51 -0
  24. package/dist/builder/address.d.ts +11 -0
  25. package/dist/builder/address.js +50 -0
  26. package/dist/builder/ago.d.ts +2 -0
  27. package/dist/builder/ago.js +18 -0
  28. package/dist/builder/api/agents.d.ts +139 -0
  29. package/dist/builder/api/agents.js +253 -0
  30. package/dist/builder/api/auto.d.ts +166 -0
  31. package/dist/builder/api/auto.js +300 -0
  32. package/dist/builder/api/billing.d.ts +263 -0
  33. package/dist/builder/api/billing.js +401 -0
  34. package/dist/builder/api/call.d.ts +53 -0
  35. package/dist/builder/api/call.js +123 -0
  36. package/dist/builder/api/capabilities.d.ts +14 -0
  37. package/dist/builder/api/capabilities.js +41 -0
  38. package/dist/builder/api/changes.d.ts +74 -0
  39. package/dist/builder/api/changes.js +75 -0
  40. package/dist/builder/api/chat.d.ts +12 -0
  41. package/dist/builder/api/chat.js +28 -0
  42. package/dist/builder/api/cli.d.ts +59 -0
  43. package/dist/builder/api/cli.js +133 -0
  44. package/dist/builder/api/codebases.d.ts +46 -0
  45. package/dist/builder/api/codebases.js +100 -0
  46. package/dist/builder/api/coding.d.ts +117 -0
  47. package/dist/builder/api/coding.js +222 -0
  48. package/dist/builder/api/connectors.d.ts +76 -0
  49. package/dist/builder/api/connectors.js +111 -0
  50. package/dist/builder/api/consent.d.ts +22 -0
  51. package/dist/builder/api/consent.js +28 -0
  52. package/dist/builder/api/conversations.d.ts +20 -0
  53. package/dist/builder/api/conversations.js +23 -0
  54. package/dist/builder/api/draft.d.ts +38 -0
  55. package/dist/builder/api/draft.js +87 -0
  56. package/dist/builder/api/environment.d.ts +55 -0
  57. package/dist/builder/api/environment.js +126 -0
  58. package/dist/builder/api/gallery.d.ts +32 -0
  59. package/dist/builder/api/gallery.js +85 -0
  60. package/dist/builder/api/git.d.ts +59 -0
  61. package/dist/builder/api/git.js +117 -0
  62. package/dist/builder/api/github.d.ts +230 -0
  63. package/dist/builder/api/github.js +373 -0
  64. package/dist/builder/api/keys.d.ts +35 -0
  65. package/dist/builder/api/keys.js +72 -0
  66. package/dist/builder/api/library.d.ts +116 -0
  67. package/dist/builder/api/library.js +214 -0
  68. package/dist/builder/api/limits.d.ts +69 -0
  69. package/dist/builder/api/limits.js +86 -0
  70. package/dist/builder/api/links.d.ts +51 -0
  71. package/dist/builder/api/links.js +75 -0
  72. package/dist/builder/api/machines.d.ts +122 -0
  73. package/dist/builder/api/machines.js +238 -0
  74. package/dist/builder/api/mcp.d.ts +10 -0
  75. package/dist/builder/api/mcp.js +47 -0
  76. package/dist/builder/api/members.d.ts +35 -0
  77. package/dist/builder/api/members.js +95 -0
  78. package/dist/builder/api/memory.d.ts +14 -0
  79. package/dist/builder/api/memory.js +35 -0
  80. package/dist/builder/api/models.d.ts +17 -0
  81. package/dist/builder/api/models.js +20 -0
  82. package/dist/builder/api/places.d.ts +32 -0
  83. package/dist/builder/api/places.js +29 -0
  84. package/dist/builder/api/platform.d.ts +68 -0
  85. package/dist/builder/api/platform.js +87 -0
  86. package/dist/builder/api/plugins.d.ts +42 -0
  87. package/dist/builder/api/plugins.js +175 -0
  88. package/dist/builder/api/pref.d.ts +77 -0
  89. package/dist/builder/api/pref.js +93 -0
  90. package/dist/builder/api/profile.d.ts +11 -0
  91. package/dist/builder/api/profile.js +41 -0
  92. package/dist/builder/api/projects.d.ts +99 -0
  93. package/dist/builder/api/projects.js +166 -0
  94. package/dist/builder/api/provider.d.ts +49 -0
  95. package/dist/builder/api/provider.js +96 -0
  96. package/dist/builder/api/sandbox.d.ts +90 -0
  97. package/dist/builder/api/sandbox.js +223 -0
  98. package/dist/builder/api/sessions.d.ts +123 -0
  99. package/dist/builder/api/sessions.js +255 -0
  100. package/dist/builder/api/skills.d.ts +82 -0
  101. package/dist/builder/api/skills.js +117 -0
  102. package/dist/builder/api/sse.d.ts +24 -0
  103. package/dist/builder/api/sse.js +68 -0
  104. package/dist/builder/api/studio.d.ts +59 -0
  105. package/dist/builder/api/studio.js +91 -0
  106. package/dist/builder/api/talk.d.ts +48 -0
  107. package/dist/builder/api/talk.js +81 -0
  108. package/dist/builder/api/tools.d.ts +34 -0
  109. package/dist/builder/api/tools.js +37 -0
  110. package/dist/builder/api/turn.d.ts +202 -0
  111. package/dist/builder/api/turn.js +772 -0
  112. package/dist/builder/api/verdict.d.ts +3 -0
  113. package/dist/builder/api/verdict.js +21 -0
  114. package/dist/builder/api/webhooks.d.ts +47 -0
  115. package/dist/builder/api/webhooks.js +82 -0
  116. package/dist/builder/api/work.d.ts +110 -0
  117. package/dist/builder/api/work.js +218 -0
  118. package/dist/builder/ask.d.ts +51 -0
  119. package/dist/builder/ask.js +147 -0
  120. package/dist/builder/automations.d.ts +33 -0
  121. package/dist/builder/automations.js +453 -0
  122. package/dist/builder/awake.d.ts +24 -0
  123. package/dist/builder/awake.js +68 -0
  124. package/dist/builder/back.d.ts +30 -0
  125. package/dist/builder/back.js +105 -0
  126. package/dist/builder/builder.d.ts +12 -0
  127. package/dist/builder/builder.js +162 -0
  128. package/dist/builder/carry.d.ts +48 -0
  129. package/dist/builder/carry.js +278 -0
  130. package/dist/builder/choice.d.ts +134 -0
  131. package/dist/builder/choice.js +152 -0
  132. package/dist/builder/claims.d.ts +13 -0
  133. package/dist/builder/claims.js +35 -0
  134. package/dist/builder/clipboard.d.ts +2 -0
  135. package/dist/builder/clipboard.js +10 -0
  136. package/dist/builder/customize/agents.d.ts +11 -0
  137. package/dist/builder/customize/agents.js +513 -0
  138. package/dist/builder/customize/connectors.d.ts +2 -0
  139. package/dist/builder/customize/connectors.js +319 -0
  140. package/dist/builder/customize/drafted.d.ts +4 -0
  141. package/dist/builder/customize/drafted.js +92 -0
  142. package/dist/builder/customize/index.d.ts +8 -0
  143. package/dist/builder/customize/index.js +127 -0
  144. package/dist/builder/customize/inventory.d.ts +14 -0
  145. package/dist/builder/customize/inventory.js +127 -0
  146. package/dist/builder/customize/load.d.ts +9 -0
  147. package/dist/builder/customize/load.js +22 -0
  148. package/dist/builder/customize/ocean.d.ts +41 -0
  149. package/dist/builder/customize/ocean.js +332 -0
  150. package/dist/builder/customize/plugins.d.ts +2 -0
  151. package/dist/builder/customize/plugins.js +136 -0
  152. package/dist/builder/customize/roles.d.ts +4 -0
  153. package/dist/builder/customize/roles.js +105 -0
  154. package/dist/builder/customize/say.d.ts +13 -0
  155. package/dist/builder/customize/say.js +32 -0
  156. package/dist/builder/customize/skills.d.ts +2 -0
  157. package/dist/builder/customize/skills.js +208 -0
  158. package/dist/builder/customize/ui.d.ts +152 -0
  159. package/dist/builder/customize/ui.js +208 -0
  160. package/dist/builder/data.d.ts +57 -0
  161. package/dist/builder/data.js +322 -0
  162. package/dist/builder/design.d.ts +140 -0
  163. package/dist/builder/design.js +175 -0
  164. package/dist/builder/desk.d.ts +48 -0
  165. package/dist/builder/desk.js +449 -0
  166. package/dist/builder/dev-mode.d.ts +43 -0
  167. package/dist/builder/dev-mode.js +120 -0
  168. package/dist/builder/door.d.ts +11 -0
  169. package/dist/builder/door.js +126 -0
  170. package/dist/builder/environment.d.ts +23 -0
  171. package/dist/builder/environment.js +193 -0
  172. package/dist/builder/files.d.ts +23 -0
  173. package/dist/builder/files.js +175 -0
  174. package/dist/builder/find.d.ts +7 -0
  175. package/dist/builder/find.js +80 -0
  176. package/dist/builder/foot.d.ts +30 -0
  177. package/dist/builder/foot.js +79 -0
  178. package/dist/builder/forge.d.ts +4 -0
  179. package/dist/builder/forge.js +639 -0
  180. package/dist/builder/gear.d.ts +60 -0
  181. package/dist/builder/gear.js +180 -0
  182. package/dist/builder/git.d.ts +21 -0
  183. package/dist/builder/git.js +118 -0
  184. package/dist/builder/github-sync.d.ts +70 -0
  185. package/dist/builder/github-sync.js +435 -0
  186. package/dist/builder/gutter.d.ts +17 -0
  187. package/dist/builder/gutter.js +25 -0
  188. package/dist/builder/handoff.d.ts +8 -0
  189. package/dist/builder/handoff.js +22 -0
  190. package/dist/builder/host.d.ts +189 -0
  191. package/dist/builder/host.js +46 -0
  192. package/dist/builder/index.d.ts +108 -0
  193. package/dist/builder/index.js +99 -0
  194. package/dist/builder/landing.d.ts +34 -0
  195. package/dist/builder/landing.js +725 -0
  196. package/dist/builder/library.d.ts +21 -0
  197. package/dist/builder/library.js +526 -0
  198. package/dist/builder/local.d.ts +80 -0
  199. package/dist/builder/local.js +124 -0
  200. package/dist/builder/make.d.ts +10 -0
  201. package/dist/builder/make.js +120 -0
  202. package/dist/builder/markdown.d.ts +49 -0
  203. package/dist/builder/markdown.js +125 -0
  204. package/dist/builder/marks.d.ts +15 -0
  205. package/dist/builder/marks.js +18 -0
  206. package/dist/builder/merge.d.ts +223 -0
  207. package/dist/builder/merge.js +380 -0
  208. package/dist/builder/meter.d.ts +31 -0
  209. package/dist/builder/meter.js +54 -0
  210. package/dist/builder/mind.d.ts +107 -0
  211. package/dist/builder/mind.js +335 -0
  212. package/dist/builder/names.d.ts +40 -0
  213. package/dist/builder/names.js +189 -0
  214. package/dist/builder/nav.d.ts +28 -0
  215. package/dist/builder/nav.js +218 -0
  216. package/dist/builder/out.d.ts +16 -0
  217. package/dist/builder/out.js +24 -0
  218. package/dist/builder/page.d.ts +55 -0
  219. package/dist/builder/page.js +217 -0
  220. package/dist/builder/pane.d.ts +30 -0
  221. package/dist/builder/pane.js +21 -0
  222. package/dist/builder/panel.d.ts +101 -0
  223. package/dist/builder/panel.js +408 -0
  224. package/dist/builder/pdf.d.ts +139 -0
  225. package/dist/builder/pdf.js +847 -0
  226. package/dist/builder/pick.d.ts +10 -0
  227. package/dist/builder/pick.js +38 -0
  228. package/dist/builder/plain.d.ts +59 -0
  229. package/dist/builder/plain.js +209 -0
  230. package/dist/builder/plan.d.ts +63 -0
  231. package/dist/builder/plan.js +155 -0
  232. package/dist/builder/plans.d.ts +1 -0
  233. package/dist/builder/plans.js +157 -0
  234. package/dist/builder/plugin.d.ts +60 -0
  235. package/dist/builder/plugin.js +1 -0
  236. package/dist/builder/plugins/design.d.ts +8 -0
  237. package/dist/builder/plugins/design.js +71 -0
  238. package/dist/builder/plugins/index.d.ts +46 -0
  239. package/dist/builder/plugins/index.js +117 -0
  240. package/dist/builder/plugins/pdf.d.ts +18 -0
  241. package/dist/builder/plugins/pdf.js +83 -0
  242. package/dist/builder/plugins/project.d.ts +5 -0
  243. package/dist/builder/plugins/project.js +68 -0
  244. package/dist/builder/plugins/research.d.ts +24 -0
  245. package/dist/builder/plugins/research.js +147 -0
  246. package/dist/builder/plugins/sketch.d.ts +9 -0
  247. package/dist/builder/plugins/sketch.js +101 -0
  248. package/dist/builder/plugins/slides.d.ts +14 -0
  249. package/dist/builder/plugins/slides.js +55 -0
  250. package/dist/builder/plugins/template.d.ts +13 -0
  251. package/dist/builder/plugins/template.js +95 -0
  252. package/dist/builder/prefs.d.ts +29 -0
  253. package/dist/builder/prefs.js +91 -0
  254. package/dist/builder/preview-url.d.ts +47 -0
  255. package/dist/builder/preview-url.js +107 -0
  256. package/dist/builder/project.d.ts +18 -0
  257. package/dist/builder/project.js +604 -0
  258. package/dist/builder/prose.d.ts +4 -0
  259. package/dist/builder/prose.js +57 -0
  260. package/dist/builder/publish.d.ts +18 -0
  261. package/dist/builder/publish.js +141 -0
  262. package/dist/builder/question.d.ts +33 -0
  263. package/dist/builder/question.js +64 -0
  264. package/dist/builder/redesign.d.ts +32 -0
  265. package/dist/builder/redesign.js +117 -0
  266. package/dist/builder/removal.d.ts +71 -0
  267. package/dist/builder/removal.js +73 -0
  268. package/dist/builder/reply.d.ts +50 -0
  269. package/dist/builder/reply.js +196 -0
  270. package/dist/builder/roles.d.ts +10 -0
  271. package/dist/builder/roles.js +28 -0
  272. package/dist/builder/route.d.ts +85 -0
  273. package/dist/builder/route.js +126 -0
  274. package/dist/builder/run.d.ts +4 -0
  275. package/dist/builder/run.js +804 -0
  276. package/dist/builder/runmeta.d.ts +16 -0
  277. package/dist/builder/runmeta.js +69 -0
  278. package/dist/builder/say.d.ts +2 -0
  279. package/dist/builder/say.js +7 -0
  280. package/dist/builder/scheduled.d.ts +3 -0
  281. package/dist/builder/scheduled.js +328 -0
  282. package/dist/builder/section.d.ts +27 -0
  283. package/dist/builder/section.js +60 -0
  284. package/dist/builder/settings/account.d.ts +1 -0
  285. package/dist/builder/settings/account.js +111 -0
  286. package/dist/builder/settings/billing.d.ts +1 -0
  287. package/dist/builder/settings/billing.js +210 -0
  288. package/dist/builder/settings/capabilities.d.ts +1 -0
  289. package/dist/builder/settings/capabilities.js +66 -0
  290. package/dist/builder/settings/card.d.ts +31 -0
  291. package/dist/builder/settings/card.js +140 -0
  292. package/dist/builder/settings/code.d.ts +1 -0
  293. package/dist/builder/settings/code.js +70 -0
  294. package/dist/builder/settings/credits.d.ts +10 -0
  295. package/dist/builder/settings/credits.js +123 -0
  296. package/dist/builder/settings/environments.d.ts +1 -0
  297. package/dist/builder/settings/environments.js +60 -0
  298. package/dist/builder/settings/general.d.ts +1 -0
  299. package/dist/builder/settings/general.js +58 -0
  300. package/dist/builder/settings/index.d.ts +4 -0
  301. package/dist/builder/settings/index.js +25 -0
  302. package/dist/builder/settings/integrations.d.ts +8 -0
  303. package/dist/builder/settings/integrations.js +138 -0
  304. package/dist/builder/settings/keys.d.ts +1 -0
  305. package/dist/builder/settings/keys.js +114 -0
  306. package/dist/builder/settings/list.d.ts +10 -0
  307. package/dist/builder/settings/list.js +28 -0
  308. package/dist/builder/settings/machines.d.ts +4 -0
  309. package/dist/builder/settings/machines.js +243 -0
  310. package/dist/builder/settings/members.d.ts +1 -0
  311. package/dist/builder/settings/members.js +77 -0
  312. package/dist/builder/settings/memory.d.ts +1 -0
  313. package/dist/builder/settings/memory.js +62 -0
  314. package/dist/builder/settings/notifications.d.ts +1 -0
  315. package/dist/builder/settings/notifications.js +111 -0
  316. package/dist/builder/settings/plan.d.ts +17 -0
  317. package/dist/builder/settings/plan.js +131 -0
  318. package/dist/builder/settings/privacy.d.ts +1 -0
  319. package/dist/builder/settings/privacy.js +76 -0
  320. package/dist/builder/settings/sections.d.ts +16 -0
  321. package/dist/builder/settings/sections.js +34 -0
  322. package/dist/builder/settings/shared.d.ts +6 -0
  323. package/dist/builder/settings/shared.js +58 -0
  324. package/dist/builder/settings/ui.d.ts +50 -0
  325. package/dist/builder/settings/ui.js +53 -0
  326. package/dist/builder/settings/usage.d.ts +1 -0
  327. package/dist/builder/settings/usage.js +24 -0
  328. package/dist/builder/shared.d.ts +26 -0
  329. package/dist/builder/shared.js +15 -0
  330. package/dist/builder/shelf.d.ts +16 -0
  331. package/dist/builder/shelf.js +219 -0
  332. package/dist/builder/side.d.ts +40 -0
  333. package/dist/builder/side.js +208 -0
  334. package/dist/builder/site.d.ts +75 -0
  335. package/dist/builder/site.js +138 -0
  336. package/dist/builder/spend.d.ts +21 -0
  337. package/dist/builder/spend.js +80 -0
  338. package/dist/builder/standing.d.ts +36 -0
  339. package/dist/builder/standing.js +66 -0
  340. package/dist/builder/suggest.d.ts +238 -0
  341. package/dist/builder/suggest.js +463 -0
  342. package/dist/builder/suggestions.d.ts +49 -0
  343. package/dist/builder/suggestions.js +260 -0
  344. package/dist/builder/summary.d.ts +60 -0
  345. package/dist/builder/summary.js +81 -0
  346. package/dist/builder/sync.d.ts +1 -0
  347. package/dist/builder/sync.js +187 -0
  348. package/dist/builder/tabs.d.ts +85 -0
  349. package/dist/builder/tabs.js +288 -0
  350. package/dist/builder/talk.d.ts +5 -0
  351. package/dist/builder/talk.js +108 -0
  352. package/dist/builder/thread.d.ts +60 -0
  353. package/dist/builder/thread.js +302 -0
  354. package/dist/builder/tools.d.ts +22 -0
  355. package/dist/builder/tools.js +52 -0
  356. package/dist/builder/transcript.d.ts +47 -0
  357. package/dist/builder/transcript.js +108 -0
  358. package/dist/builder/voice.d.ts +8 -0
  359. package/dist/builder/voice.js +24 -0
  360. package/dist/{changedFileKind-DqgCCDUs.js → changedFileKind-D6QYvIez.js} +1 -1
  361. package/dist/core.js +1 -0
  362. package/dist/{decodeImagePreview-CesVZYP4.js → decodeImagePreview-DnfFEjhw.js} +1 -1
  363. package/dist/{embed-DYP-OUlb.js → embed-c030vUqM.js} +11 -11
  364. package/dist/index.d.ts +2 -0
  365. package/dist/index.js +2 -1
  366. package/dist/{micromark-util-decode-string-NQjVkmZH.js → micromark-util-decode-string-C-5AXkOV.js} +5 -3
  367. package/dist/{readBinaryPreview-D2X4Uahu.js → readBinaryPreview-BAQ4fFjm.js} +1 -1
  368. package/dist/{useTextFieldSpeech-CyOZZPrV.js → useTextFieldSpeech-COa9XcRx.js} +1 -1
  369. package/package.json +101 -11
  370. /package/{index.d.ts → dist/core.d.ts} +0 -0
  371. /package/{keymap.d.ts → dist/keymap.d.ts} +0 -0
@@ -0,0 +1,120 @@
1
+ import { phrase } from '@hanzo/i18n';
2
+ import { useCallback, useSyncExternalStore } from 'react';
3
+ import { friendly } from './names.js';
4
+ import { english } from './say.js';
5
+ export const DEV_MODE_KEY = 'hanzo.dev_mode';
6
+ export const DEV_MODE_EVENT = 'hanzo:dev-mode';
7
+ /** What Developer mode does, in one line, wherever its switch is drawn (English, marked; drawn through `t`). */
8
+ export const DEV_MODE_NOTE = phrase('Shows the process: the terminal, the commands Hanzo runs and each step. Off, Hanzo shows the result.');
9
+ /**
10
+ * DEVELOPER MODE IS OFF FOR A NEW PERSON, and the result is what they see
11
+ * (hanzo-inc/app issues 317 and 321). Someone who has worked with the process
12
+ * on this device keeps seeing it: the first time the choice is read where it
13
+ * was never made, it is made once from what this device shows of them, and kept.
14
+ *
15
+ * - Tabs listed a machine or a cloud workspace of theirs (`hanzo.tabs.fleet`):
16
+ * they opened a terminal, or linked a computer with the CLI.
17
+ * - Dev's transcript view is Thinking or Verbose: they asked to see more of it.
18
+ *
19
+ * Anyone else, including someone who has only built with Dev, starts with the
20
+ * result. The switch (Settings › General, the account menu, a run's menu, ⌘⇧D)
21
+ * changes it either way.
22
+ */
23
+ export function adopt(store) {
24
+ try {
25
+ const view = store.getItem('hanzo.build.transcript.view');
26
+ if (view === '"thinking"' || view === '"verbose"')
27
+ return true;
28
+ const fleet = JSON.parse(store.getItem('hanzo.tabs.fleet') || '[]');
29
+ return Array.isArray(fleet) && fleet.length > 0;
30
+ }
31
+ catch {
32
+ return false;
33
+ }
34
+ }
35
+ export function getDevMode() {
36
+ if (typeof window === 'undefined')
37
+ return false;
38
+ try {
39
+ const kept = window.localStorage.getItem(DEV_MODE_KEY);
40
+ if (kept !== null)
41
+ return kept === 'true';
42
+ const chosen = adopt(window.localStorage);
43
+ window.localStorage.setItem(DEV_MODE_KEY, chosen ? 'true' : 'false');
44
+ return chosen;
45
+ }
46
+ catch {
47
+ return false;
48
+ }
49
+ }
50
+ export function setDevMode(next) {
51
+ if (typeof window === 'undefined')
52
+ return;
53
+ try {
54
+ window.localStorage.setItem(DEV_MODE_KEY, next ? 'true' : 'false');
55
+ }
56
+ catch {
57
+ /* ignore storage errors */
58
+ }
59
+ window.dispatchEvent(new CustomEvent(DEV_MODE_EVENT, { detail: { enabled: next } }));
60
+ }
61
+ function subscribeDevMode(onChange) {
62
+ if (typeof window === 'undefined')
63
+ return () => { };
64
+ const handler = () => onChange();
65
+ const onStorage = (e) => {
66
+ if (e.key === DEV_MODE_KEY)
67
+ onChange();
68
+ };
69
+ window.addEventListener(DEV_MODE_EVENT, handler);
70
+ window.addEventListener('storage', onStorage);
71
+ return () => {
72
+ window.removeEventListener(DEV_MODE_EVENT, handler);
73
+ window.removeEventListener('storage', onStorage);
74
+ };
75
+ }
76
+ export function useDevMode() {
77
+ const enabled = useSyncExternalStore(subscribeDevMode, getDevMode, () => false);
78
+ const update = useCallback((next) => setDevMode(next), []);
79
+ return [enabled, update];
80
+ }
81
+ function mergeDetail(...parts) {
82
+ const seen = new Set();
83
+ const out = [];
84
+ for (const p of parts) {
85
+ for (const seg of (p ?? '').trim().split(/\s*·\s*/)) {
86
+ const key = seg.trim().toLowerCase();
87
+ if (key && !seen.has(key)) {
88
+ seen.add(key);
89
+ out.push(seg.trim());
90
+ }
91
+ }
92
+ }
93
+ return out.length ? out.join(' · ') : undefined;
94
+ }
95
+ /**
96
+ * A device as a person reads it. A name the person gave it wins. Otherwise a
97
+ * developer sees the name the machine reports, and anyone else sees it as a
98
+ * person says it (`Alexs-MacBook-Pro.local` → "Alex's MacBook Pro", names.ts
99
+ * `friendly`), with the hardware and the hostname beneath, and the cloud
100
+ * workspace in plain words.
101
+ */
102
+ export function formatDeviceLabel(raw, opts = {}) {
103
+ const say = opts.say ?? english;
104
+ const name = (raw ?? '').trim();
105
+ const own = (opts.name ?? '').trim();
106
+ if (own)
107
+ return { title: own, detail: mergeDetail(opts.hardware, opts.host, name !== own ? name : undefined) };
108
+ if (opts.devMode)
109
+ return name ? { title: name, detail: mergeDetail(opts.hardware, opts.host && opts.host !== name ? opts.host : undefined) } : { title: 'Cloud' };
110
+ const lower = name.toLowerCase();
111
+ if (!name || /^(hanzo sandbox|sandbox|cloud|cloud workspace)$/.test(lower) || /^cloud-\d+(\s|·|$)/.test(lower)) {
112
+ return { title: say('Cloud workspace'), detail: !name || !lower.startsWith('cloud-') ? say('Managed Hanzo cloud workspace') : name };
113
+ }
114
+ const tidy = name
115
+ .split(/\s*·\s*/)[0]
116
+ .replace(/\s*\((?:shell|desk|tmux|tty)[^)]*\)\s*$/i, '')
117
+ .trim();
118
+ const title = friendly(tidy) || name;
119
+ return { title, detail: mergeDetail(opts.hardware, opts.host, name !== title ? name : undefined) };
120
+ }
@@ -0,0 +1,11 @@
1
+ import { type Door as Which, type State as Held } from './api/sandbox.ts';
2
+ /**
3
+ * `held` is where the run's sandbox is in its life, '' until it has been read. Only
4
+ * a running sandbox has an open door.
5
+ */
6
+ export declare function Door({ which, sandbox, held, session }: {
7
+ which: Which;
8
+ sandbox: string;
9
+ held: Held | '';
10
+ session: string;
11
+ }): import("react").JSX.Element;
@@ -0,0 +1,126 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * One door into a run's sandbox — its screen or its shell — framed from cloud's
4
+ * own page with a fresh ticket in its address, while the sandbox runs. A
5
+ * suspended sandbox is resumed from the pane's bar, never by looking at it.
6
+ *
7
+ * The page says when its socket is up. A page that says it failed, or silence
8
+ * past the deadline, is a failed connection, and Retry mints a new ticket: a
9
+ * ticket is spent the moment its socket opens, so reloading the old address can
10
+ * only fail again.
11
+ *
12
+ * What a door says is the reader's language (@hanzo/i18n `t`), one sentence
13
+ * per door; the page's own reason for a failed connection is drawn as given.
14
+ */
15
+ import { SizableText, YStack } from '@hanzo/gui';
16
+ import { phrase } from '@hanzo/i18n';
17
+ import { useI18n } from '@hanzo/i18n/react';
18
+ import { Button } from '@hanzo/ui';
19
+ import { useEffect, useRef, useState } from 'react';
20
+ import { door, stay } from './api/sandbox.js';
21
+ import { useTarget } from './host.js';
22
+ /** What each page signs its messages to the window that frames it with. */
23
+ const SOURCE = { screen: 'hanzo-screen', terminal: 'hanzo-term' };
24
+ const DEADLINE = 20_000;
25
+ /** What each door says of itself, one sentence per door, marked (`phrase`) and drawn through `t`. */
26
+ const SAYS = {
27
+ screen: {
28
+ starting: phrase('The desktop opens once the run’s sandbox is up.'),
29
+ parked: phrase('This run’s sandbox is suspended with its files kept. Resume it from the bar above to open its desktop.'),
30
+ error: phrase('This run’s sandbox could not start, so it has no desktop.'),
31
+ unreachable: phrase('Unable to reach the desktop. The run may have stopped.'),
32
+ title: phrase('The run’s desktop'),
33
+ connecting: phrase('Connecting to the desktop…'),
34
+ },
35
+ terminal: {
36
+ starting: phrase('The terminal opens once the run’s sandbox is up.'),
37
+ parked: phrase('This run’s sandbox is suspended with its files kept. Resume it from the bar above to open its terminal.'),
38
+ error: phrase('This run’s sandbox could not start, so it has no terminal.'),
39
+ unreachable: phrase('Unable to reach the terminal. The run may have stopped.'),
40
+ title: phrase('The run’s terminal'),
41
+ connecting: phrase('Connecting to the terminal…'),
42
+ },
43
+ };
44
+ /**
45
+ * `held` is where the run's sandbox is in its life, '' until it has been read. Only
46
+ * a running sandbox has an open door.
47
+ */
48
+ export function Door({ which, sandbox, held, session }) {
49
+ const target = useTarget();
50
+ const { t } = useI18n();
51
+ const says = SAYS[which];
52
+ const frame = useRef(null);
53
+ const [src, setSrc] = useState('');
54
+ const [state, setState] = useState('opening');
55
+ const [why, setWhy] = useState('');
56
+ const [attempt, setAttempt] = useState(0);
57
+ const up = Boolean(sandbox) && held === 'running';
58
+ useEffect(() => {
59
+ if (!up)
60
+ return;
61
+ let gone = false;
62
+ setSrc('');
63
+ setState('opening');
64
+ setWhy('');
65
+ // Opened by the page, so it never wakes the sandbox: the bar's Wake does, on a press.
66
+ door(target, sandbox, which, stay, session).then((u) => {
67
+ if (!gone)
68
+ setSrc(u);
69
+ }, (e) => {
70
+ if (gone)
71
+ return;
72
+ setState('failed');
73
+ setWhy(e.message);
74
+ });
75
+ return () => {
76
+ gone = true;
77
+ };
78
+ }, [target, sandbox, which, session, up, attempt]);
79
+ useEffect(() => {
80
+ if (!src)
81
+ return;
82
+ const origin = new URL(src, window.location.href).origin;
83
+ const hear = (e) => {
84
+ if (e.origin !== origin || e.source !== frame.current?.contentWindow)
85
+ return;
86
+ const m = e.data;
87
+ if (!m || m.source !== SOURCE[which])
88
+ return;
89
+ if (m.retry === true) {
90
+ setAttempt((a) => a + 1);
91
+ }
92
+ else if (m.ready === true) {
93
+ setState('open');
94
+ }
95
+ else if (m.ready === false) {
96
+ setState('failed');
97
+ setWhy(typeof m.why === 'string' ? m.why : '');
98
+ }
99
+ };
100
+ window.addEventListener('message', hear);
101
+ const late = setTimeout(() => setState((s) => (s === 'opening' ? 'failed' : s)), DEADLINE);
102
+ return () => {
103
+ window.removeEventListener('message', hear);
104
+ clearTimeout(late);
105
+ };
106
+ }, [src, which]);
107
+ if (!sandbox || held === '' || held === 'pending') {
108
+ return _jsx(Shut, { title: t('Starting'), body: t(says.starting) });
109
+ }
110
+ if (held === 'parked') {
111
+ return _jsx(Shut, { title: t('Suspended'), body: t(says.parked) });
112
+ }
113
+ if (held === 'gone') {
114
+ return _jsx(Shut, { title: t('Ended'), body: t('This run’s sandbox has ended. Its work is on its branch and in its artifacts.') });
115
+ }
116
+ if (held === 'error') {
117
+ return _jsx(Shut, { title: t('Unavailable'), body: t(says.error) });
118
+ }
119
+ if (state === 'failed') {
120
+ return (_jsx(Shut, { title: t('Failed to connect'), body: why || t(says.unreachable), children: _jsx(Button, { size: "sm", variant: "outline", onPress: () => setAttempt((a) => a + 1), children: t('Retry') }) }));
121
+ }
122
+ return (_jsxs(YStack, { flex: 1, minH: 0, position: "relative", bg: "#000", children: [src ? (_jsx("iframe", { ref: frame, src: src, title: t(says.title), allow: "clipboard-read; clipboard-write", style: { border: 0, width: '100%', height: '100%', display: 'block', background: '#000' } })) : null, state === 'opening' ? (_jsx(YStack, { position: "absolute", t: 0, l: 0, r: 0, b: 0, items: "center", justify: "center", pointerEvents: "none", children: _jsx(SizableText, { size: "$2", color: "$soft", children: t(says.connecting) }) })) : null] }));
123
+ }
124
+ function Shut({ title, body, children }) {
125
+ return (_jsxs(YStack, { flex: 1, items: "center", justify: "center", gap: "$2", px: "$6", py: "$8", children: [_jsx(SizableText, { size: "$3", color: "$ink", children: title }), _jsx(SizableText, { size: "$2", color: "$soft", style: { textAlign: 'center', maxWidth: 360 }, children: body }), children] }));
126
+ }
@@ -0,0 +1,23 @@
1
+ import type { Home, Homes } from './api/work.ts';
2
+ import { type Read } from './data.ts';
3
+ export declare function Environment({ repo, busy }: {
4
+ repo: string;
5
+ busy: boolean;
6
+ }): import("react").JSX.Element;
7
+ /**
8
+ * New's offer to set a codebase up. An agent onboards it, or an org admin saves
9
+ * it empty and writes the scripts by hand beside the next run.
10
+ *
11
+ * The repository is chosen from the org's own (the forge's, and every linked
12
+ * repository's copy there), never typed: a name that is not one of them — a
13
+ * board's key handed over as a codebase — is said so and cannot be set up.
14
+ */
15
+ export declare function SetupDialog({ repo, homes, open, onOpenChange, onStart, onSaved, onRepo, }: {
16
+ repo: string;
17
+ homes: Read<Homes>;
18
+ open: boolean;
19
+ onOpenChange: (o: boolean) => void;
20
+ onStart: (repo: string) => Promise<void>;
21
+ onSaved: (repo: string) => void;
22
+ onRepo: (home: Home) => void;
23
+ }): import("react").JSX.Element;
@@ -0,0 +1,193 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * A codebase's environment: the install script, the start command and the
4
+ * secrets a run exports, as /v1/environment holds them.
5
+ *
6
+ * A setup run's proposal is drawn in the editors until it is saved — saving is
7
+ * the review. While a setup run on the codebase is still working the scripts are
8
+ * its to find, so they cannot be edited. A member reads; an org admin saves and
9
+ * sets secrets, which is the platform's rule and not a choice made here.
10
+ *
11
+ * Its words are the reader's language (@hanzo/i18n `t`); a codebase's name, a
12
+ * secret's, the scripts and what the setup agent wrote are drawn as given.
13
+ */
14
+ import { SizableText, XStack, YStack } from '@hanzo/gui';
15
+ import { Plus, X } from '@hanzogui/lucide-icons-2';
16
+ import { useI18n } from '@hanzo/i18n/react';
17
+ import { Button, Dialog, DialogContent, DialogTitle, Input, Textarea } from '@hanzo/ui';
18
+ import { useEffect, useState } from 'react';
19
+ import { start } from './api/coding.js';
20
+ import { plain, read, refuse, removeSecret, save, setSecret, SETUP } from './api/environment.js';
21
+ import { useRead } from './data.js';
22
+ import { matches } from './merge.js';
23
+ import { useHost, useTarget } from './host.js';
24
+ import { useSpend } from './spend.js';
25
+ /** The question before a setup run starts, from the Environment tab and from New's dialog alike: it runs in a cloud sandbox. */
26
+ const setting = (repo, t) => ({
27
+ kind: 'run',
28
+ title: t('Set up {repo} with an agent?', { repo }),
29
+ what: t('This starts a run that explores the codebase, installs and checks it, and proposes its environment.'),
30
+ yes: t('Start setup'),
31
+ uses: 'computer',
32
+ });
33
+ const mono = { fontFamily: 'var(--f-mono, ui-monospace, monospace)' };
34
+ export function Environment({ repo, busy }) {
35
+ const { t } = useI18n();
36
+ const host = useHost();
37
+ const target = useTarget();
38
+ const signed = Boolean(host.person);
39
+ // Read again when a setup run on it stops, which is when its proposal lands.
40
+ const env = useRead(signed && repo ? () => read(target, repo) : null, null, [target, repo, signed, busy]);
41
+ const [install, setInstall] = useState('');
42
+ const [startCmd, setStart] = useState('');
43
+ const [adding, setAdding] = useState(false);
44
+ const [name, setName] = useState('');
45
+ const [value, setValue] = useState('');
46
+ const spend = useSpend();
47
+ const [note, setNote] = useState('');
48
+ const [working, setWorking] = useState(false);
49
+ const shown = env.value;
50
+ useEffect(() => {
51
+ if (!shown)
52
+ return;
53
+ setInstall(shown.proposal?.install ?? shown.install);
54
+ setStart(shown.proposal?.start ?? shown.start);
55
+ }, [shown]);
56
+ if (!signed) {
57
+ return _jsx(Soft, { children: t('Sign in to view project environment settings.') });
58
+ }
59
+ if (!repo) {
60
+ return _jsx(Soft, { children: t('This session uses an automatic workspace — no custom setup needed.') });
61
+ }
62
+ if (env.error) {
63
+ return _jsx(Soft, { children: t('{repo}’s environment could not be read right now.', { repo }) });
64
+ }
65
+ if (!shown) {
66
+ return _jsx(Soft, { children: t('Loading environment…') });
67
+ }
68
+ const changed = install !== shown.install || startCmd !== shown.start || shown.proposal !== null;
69
+ const needed = (shown.proposal?.secrets ?? []).filter((n) => !shown.secrets.includes(n));
70
+ const status = busy ? t('Setting up') : shown.state === 'proposed' ? t('Proposed') : shown.state === 'ready' ? t('Ready') : t('Not set up');
71
+ /** One write, then the record read again. Answers whether it took. */
72
+ const act = async (what, done = '') => {
73
+ setWorking(true);
74
+ setNote('');
75
+ try {
76
+ await what();
77
+ env.reload();
78
+ setNote(done);
79
+ return true;
80
+ }
81
+ catch (e) {
82
+ setNote(plain(e, repo, 'save', t));
83
+ return false;
84
+ }
85
+ finally {
86
+ setWorking(false);
87
+ }
88
+ };
89
+ const setup = async () => {
90
+ if (!(await spend.ask(setting(repo, t))))
91
+ return;
92
+ setWorking(true);
93
+ setNote('');
94
+ try {
95
+ const run = await start(target, { prompt: SETUP, repo, mode: 'setup' });
96
+ host.go(run.session);
97
+ }
98
+ catch (e) {
99
+ setNote(plain(e, repo, 'start', t));
100
+ setWorking(false);
101
+ }
102
+ };
103
+ const add = () => {
104
+ const n = name.trim();
105
+ const why = refuse(n, t) || (value ? '' : t('A secret needs a value'));
106
+ if (why) {
107
+ setNote(why);
108
+ return;
109
+ }
110
+ void act(() => setSecret(target, repo, n, value), t('{name} is set', { name: n })).then((took) => {
111
+ if (!took)
112
+ return;
113
+ setAdding(false);
114
+ setName('');
115
+ setValue('');
116
+ });
117
+ };
118
+ return (_jsxs(YStack, { gap: "$4", children: [spend.dialog, _jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(SizableText, { flex: 1, size: "$4", color: "$ink", numberOfLines: 1, children: repo }), _jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(YStack, { width: 6, height: 6, rounded: 999, bg: busy ? '$ink' : shown.state === 'ready' ? '$ink' : '$soft', opacity: busy ? 1 : 0.7 }), _jsx(SizableText, { size: "$1", color: "$soft", children: status })] }), host.admin ? (_jsx(Button, { size: "sm", variant: "outline", disabled: busy || working || !changed, onPress: () => void act(() => save(target, repo, { install, start: startCmd }), t('Saved')), children: t('Save') })) : null] }), shown.proposal?.note ? (_jsxs(YStack, { gap: "$1", px: "$3", py: "$2", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: t('What the setup agent found') }), _jsx(SizableText, { size: "$2", color: "$ink", numberOfLines: 8, children: shown.proposal.note })] })) : null, _jsx(Script, { label: t('Install Script'), value: install, onChange: setInstall, locked: busy || !host.admin, hint: busy ? t('Install script editing will be available when the agent stops running') : 'pnpm install --frozen-lockfile' }), _jsx(Script, { label: t('Start Script'), value: startCmd, onChange: setStart, locked: busy || !host.admin, hint: busy ? t('Start script editing will be available when the agent stops running') : 'pnpm dev' }), _jsxs(YStack, { gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(SizableText, { size: "$2", color: "$ink", flex: 1, children: t('Secrets') }), host.admin ? (_jsxs(Button, { size: "sm", variant: "outline", disabled: working, onPress: () => setAdding(true), children: [_jsx(Plus, { size: 14 }), t('New Secret')] })) : null] }), _jsxs(YStack, { borderWidth: 1, borderColor: "$borderColor", rounded: "$3", overflow: "hidden", children: [shown.secrets.length === 0 && needed.length === 0 && !adding ? (_jsx(YStack, { py: "$5", items: "center", children: _jsx(SizableText, { size: "$2", color: "$soft", children: t('No secrets yet') }) })) : null, shown.secrets.map((s, i) => (_jsxs(XStack, { items: "center", gap: "$2", px: "$3", py: "$2", borderTopWidth: i ? 1 : 0, borderColor: "$borderColor", children: [_jsx(SizableText, { flex: 1, size: "$2", color: "$ink", style: mono, children: s }), _jsx(SizableText, { size: "$1", color: "$soft", children: t('set') }), host.admin ? (_jsx(XStack, { render: "button", "aria-label": t('Remove {name}', { name: s }), px: "$1", onPress: () => void act(() => removeSecret(target, repo, s), t('{name} is removed', { name: s })), children: _jsx(X, { size: 14 }) })) : null] }, s))), needed.map((s) => (_jsxs(XStack, { items: "center", gap: "$2", px: "$3", py: "$2", borderTopWidth: 1, borderColor: "$borderColor", children: [_jsx(SizableText, { flex: 1, size: "$2", color: "$ink", style: mono, children: s }), _jsx(SizableText, { size: "$1", color: "$soft", children: t('needed, not set') }), host.admin ? (_jsx(XStack, { render: "button", "aria-label": t('Set {name}', { name: s }), px: "$1", onPress: () => { setAdding(true); setName(s); }, children: _jsx(Plus, { size: 14 }) })) : null] }, s))), adding ? (_jsxs(YStack, { gap: "$2", px: "$3", py: "$3", borderTopWidth: shown.secrets.length || needed.length ? 1 : 0, borderColor: "$borderColor", children: [_jsx(Input, { value: name, onChangeText: setName, placeholder: t('NAME'), "aria-label": t('Secret name'), autoCapitalize: "characters" }), _jsx(Input, { value: value, onChangeText: setValue, placeholder: t('Value'), "aria-label": t('Secret value'), secureTextEntry: true }), _jsxs(XStack, { gap: "$2", justify: "flex-end", children: [_jsx(Button, { size: "sm", variant: "ghost", onPress: () => { setAdding(false); setName(''); setValue(''); }, children: t('Cancel') }), _jsx(Button, { size: "sm", disabled: working, onPress: add, children: t('Add secret') })] })] })) : null] }), _jsx(SizableText, { size: "$1", color: "$soft", children: t('Values are sealed in KMS and exported to every run on this codebase. They are never shown again.') })] }), shown.state === 'none' && !busy ? (_jsxs(YStack, { gap: "$2", items: "flex-start", children: [_jsx(Button, { size: "sm", disabled: working, onPress: () => void setup(), children: t('Set up with an agent') }), _jsx(SizableText, { size: "$1", color: "$soft", children: t('An agent explores the codebase, installs and checks it, and proposes the scripts for you to review and save.') })] })) : null, !host.admin ? (_jsx(SizableText, { size: "$1", color: "$soft", children: t('An org admin saves the environment and sets its secrets.') })) : null, note ? (_jsx(SizableText, { size: "$1", color: "$soft", role: "status", children: note })) : null] }));
119
+ }
120
+ /**
121
+ * New's offer to set a codebase up. An agent onboards it, or an org admin saves
122
+ * it empty and writes the scripts by hand beside the next run.
123
+ *
124
+ * The repository is chosen from the org's own (the forge's, and every linked
125
+ * repository's copy there), never typed: a name that is not one of them — a
126
+ * board's key handed over as a codebase — is said so and cannot be set up.
127
+ */
128
+ export function SetupDialog({ repo, homes, open, onOpenChange, onStart, onSaved, onRepo, }) {
129
+ const { t } = useI18n();
130
+ const host = useHost();
131
+ const target = useTarget();
132
+ const [chosen, setChosen] = useState(repo);
133
+ const [q, setQ] = useState('');
134
+ const [working, setWorking] = useState('');
135
+ const [note, setNote] = useState('');
136
+ const [last, setLast] = useState('');
137
+ const spend = useSpend();
138
+ useEffect(() => {
139
+ if (!open)
140
+ return;
141
+ setChosen(repo);
142
+ setQ('');
143
+ setNote('');
144
+ setLast('');
145
+ }, [open, repo]);
146
+ const list = homes.value.homes;
147
+ const home = list.find((h) => h.name.toLowerCase() === chosen.toLowerCase()) ?? null;
148
+ // A name the whole list does not hold is not the org's; with part of the list unread, the platform decides.
149
+ const stranger = Boolean(chosen) && !home && homes.value.whole && !homes.loading;
150
+ const ready = Boolean(chosen) && !stranger && !homes.loading;
151
+ const shown = list.filter((h) => matches(q, h.label, h.name)).slice(0, 6);
152
+ const run = async (what) => {
153
+ if (!ready)
154
+ return;
155
+ // The org's own spelling of the name, when the list holds it.
156
+ const repo = home?.name ?? chosen;
157
+ setWorking(what);
158
+ setLast(what);
159
+ setNote('');
160
+ try {
161
+ if (what === 'save') {
162
+ await save(target, repo, { install: '', start: '' });
163
+ onSaved(repo);
164
+ }
165
+ else {
166
+ if (!(await spend.ask(setting(repo, t))))
167
+ return;
168
+ await onStart(repo);
169
+ onOpenChange(false);
170
+ }
171
+ }
172
+ catch (e) {
173
+ setNote(plain(e, repo, what, t));
174
+ }
175
+ finally {
176
+ setWorking('');
177
+ }
178
+ };
179
+ return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { maxW: 480, showCloseButton: false, children: [spend.dialog, _jsxs(XStack, { items: "center", justify: "space-between", gap: "$2", children: [_jsx(DialogTitle, { children: t('Set up an environment') }), _jsx(XStack, { render: "button", "aria-label": t('Close'), p: "$1", onPress: () => onOpenChange(false), children: _jsx(X, { size: 16 }) })] }), _jsxs(YStack, { gap: "$3", children: [_jsxs(YStack, { gap: "$1.5", children: [_jsx(SizableText, { size: "$2", color: "$soft", children: t('Repository') }), _jsx(XStack, { px: "$3", py: "$2", rounded: "$3", borderWidth: 1, borderColor: stranger ? '$ink' : '$borderColor', items: "center", gap: "$2", "aria-label": t('Chosen repository'), children: _jsx(SizableText, { size: "$2", color: home || (chosen && !stranger) ? '$ink' : '$soft', numberOfLines: 1, flex: 1, minW: 0, children: home ? home.label : chosen || t('Choose a repository') }) }), stranger ? (_jsx(SizableText, { size: "$1", color: "$ink", role: "alert", children: t('{repo} is not one of this organization’s repositories. Choose one below.', { repo: chosen }) })) : null, _jsx(Input, { value: q, onChangeText: setQ, placeholder: t('Find a repository…'), "aria-label": t('Find a repository') }), _jsx(YStack, { gap: 2, "aria-label": t('Repositories'), children: homes.loading && !list.length ? (_jsx(SizableText, { size: "$1", color: "$soft", children: t('Loading projects…') })) : homes.error && !list.length ? (_jsxs(XStack, { items: "center", gap: "$2", flexWrap: "wrap", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: t('The project list could not be loaded right now.') }), _jsx(Button, { size: "sm", variant: "outline", onPress: homes.reload, children: t('Try again') })] })) : shown.length === 0 ? (_jsx(SizableText, { size: "$1", color: "$soft", children: list.length ? t('Nothing matches.') : t('This organization has no repositories on the forge yet.') })) : (shown.map((h) => {
180
+ const on = h.name.toLowerCase() === chosen.toLowerCase();
181
+ return (_jsx(XStack, { render: "button", "aria-pressed": on, "aria-label": t('Choose {repo}', { repo: h.label }), onPress: () => {
182
+ setChosen(h.name);
183
+ setNote('');
184
+ onRepo(h);
185
+ }, px: "$2.5", py: "$1.5", rounded: "$2", bg: on ? '$hover' : 'transparent', hoverStyle: { bg: '$hover' }, children: _jsx(SizableText, { size: "$2", color: on ? '$ink' : '$soft', numberOfLines: 1, children: h.label }) }, h.name));
186
+ })) })] }), _jsx(SizableText, { size: "$2", color: "$soft", children: t('An agent onboards the codebase: it explores it, writes the install and start scripts, and names the secrets it needs. It takes several minutes. Interrupt it anytime, or take over in the terminal.') }), note ? (_jsxs(XStack, { items: "center", gap: "$2", flexWrap: "wrap", children: [_jsx(SizableText, { size: "$1", color: "$ink", role: "status", flex: 1, minW: 200, children: note }), last ? (_jsx(Button, { size: "sm", variant: "outline", disabled: working !== '', onPress: () => void run(last), children: t('Try again') })) : null] })) : null, _jsxs(XStack, { gap: "$2", justify: "space-between", items: "center", children: [host.admin ? (_jsx(Button, { size: "sm", variant: "secondary", disabled: working !== '' || !ready, onPress: () => void run('save'), children: working === 'save' ? t('Saving…') : t('Skip & save') })) : (_jsx(YStack, {})), _jsx(Button, { size: "sm", variant: "primary", disabled: working !== '' || !ready, onPress: () => void run('start'), children: working === 'start' ? t('Starting the agent…') : t('Start agent') })] })] })] }) }));
187
+ }
188
+ function Script({ label, value, onChange, locked, hint }) {
189
+ return (_jsxs(YStack, { gap: "$2", children: [_jsx(SizableText, { size: "$2", color: "$ink", children: label }), _jsx(Textarea, { value: value, onChangeText: onChange, disabled: locked, placeholder: hint, "aria-label": label, rows: 3, style: mono })] }));
190
+ }
191
+ function Soft({ children }) {
192
+ return (_jsx(YStack, { py: "$6", items: "center", children: _jsx(SizableText, { size: "$2", color: "$soft", style: { textAlign: 'center' }, children: children }) }));
193
+ }
@@ -0,0 +1,23 @@
1
+ export declare function Files({ session, repo, branch, sandbox, live, }: {
2
+ session: string;
3
+ repo: string;
4
+ branch: string;
5
+ sandbox: string;
6
+ live: boolean;
7
+ }): import("react").JSX.Element;
8
+ export declare function Artifacts({ session, sandbox, repo, branch, mode, project, site, pr, onEnvironment, }: {
9
+ session: string;
10
+ /** The run's sandbox, which serves its previews while it is kept. */
11
+ sandbox: string;
12
+ repo: string;
13
+ branch: string;
14
+ mode: string;
15
+ project: string;
16
+ /** Where the run's work is published, or ''. */
17
+ site: string;
18
+ pr: {
19
+ href: string;
20
+ label: string;
21
+ };
22
+ onEnvironment: () => void;
23
+ }): import("react").JSX.Element;