@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,134 @@
1
+ /**
2
+ * The choice New starts from, kept in this browser so a codebase or an issue
3
+ * opened from its own screen is what the composer is holding when it mounts.
4
+ *
5
+ * The key is the one `useKept` in New writes. A merge keeps the mode, the
6
+ * model and the machine; it only replaces the fields the caller names.
7
+ */
8
+ import { type Codebase, type ForgeRepo } from './api/codebases.ts';
9
+ import type { Project } from './merge.ts';
10
+ export interface Choice {
11
+ repo: ForgeRepo | null;
12
+ branch: string;
13
+ place: string;
14
+ mode: string;
15
+ model: string;
16
+ effort: string;
17
+ /** A draft handed over by another screen. New copies it once and clears it. */
18
+ ask: string;
19
+ /** The issue that draft is, by the number the run's pull request closes; 0 for none. Handed over with it. */
20
+ issue: number;
21
+ }
22
+ export declare const boardKey: (org: string | null) => string;
23
+ /**
24
+ * The choice New opens on, field by field: the last layer that says something
25
+ * wins. What was kept here, over the person's coding defaults, over the first
26
+ * run's. A field kept as '' stays '' (the default branch, the sandbox): only a
27
+ * field that is absent falls through, so a codebase or an issue handed over from
28
+ * its own screen — which keeps the codebase and the words alone — still opens on
29
+ * a model, a mode and an effort.
30
+ */
31
+ export declare function settle<T extends object>(first: T, ...layers: (Partial<T> | null | undefined)[]): T;
32
+ /** Point New at a forge codebase, and optionally a first draft. */
33
+ export declare function pinCodebase(org: string | null, c: Codebase, ask?: string): void;
34
+ /** Which board Issues is showing. '' is every board. */
35
+ export declare function pinBoard(org: string | null, key: string): void;
36
+ /**
37
+ * Point New at a project, and optionally a first draft (an issue's ask) and the
38
+ * issue it closes. `where` is where the run works (merge.ts `home`): on the forge
39
+ * it is chosen by its forge name, which is what a run and its environment
40
+ * address; on GitHub by GitHub's address, so the run clones and proposes there.
41
+ * Left out, the forge when the project is there. A project that is neither
42
+ * cannot be worked on, and is refused here rather than handed to the platform.
43
+ */
44
+ export declare function pinRepo(org: string | null, p: Project, ask?: string, issue?: number, where?: 'github' | 'forge' | null): void;
45
+ /**
46
+ * Point New at a repository on GitHub, by GitHub's address: the one Sync just
47
+ * brought in (sync.tsx), so the next run works on it and not on whatever was
48
+ * chosen before. It is GitHub's address and not its forge copy's, because the
49
+ * copy is still on its way there. A draft or an issue handed over with the
50
+ * last choice was that repository's, and goes with it.
51
+ */
52
+ export declare function pinHub(org: string | null, r: {
53
+ owner: string;
54
+ name: string;
55
+ private: boolean;
56
+ branch: string;
57
+ }): void;
58
+ /**
59
+ * A repository on GitHub, chosen from the org's installation: the run works there.
60
+ * Its `full_name` is GitHub's address, `github.com/owner/name` — what the list
61
+ * shows, so a forge codebase of the same name is never mistaken for it, and what
62
+ * a coding run takes to clone, push and propose on GitHub.
63
+ */
64
+ export interface HubRepo {
65
+ owner: string;
66
+ name: string;
67
+ full_name: string;
68
+ private: boolean;
69
+ default_branch: string;
70
+ pushed_at: string;
71
+ installation_id: number;
72
+ github: true;
73
+ /**
74
+ * Given by its address (address.ts), not chosen from a list. It is the
75
+ * person's word for where the run works, so no list is asked whether it is
76
+ * still there: a public repository is on no list, and GitHub admits a run on
77
+ * it all the same.
78
+ */
79
+ given?: boolean;
80
+ }
81
+ export declare const isHub: (repo: {
82
+ github?: boolean;
83
+ full_name?: string;
84
+ } | null) => repo is HubRepo;
85
+ /** A GitHub listing row as the composer offers it. */
86
+ export declare const asHub: (r: Omit<HubRepo, 'github'>) => HubRepo;
87
+ export declare const isForge: (repo: {
88
+ forge?: boolean;
89
+ name?: string;
90
+ } | null) => repo is ForgeRepo;
91
+ /**
92
+ * What New can offer now, read to judge the repository it kept. Each is null
93
+ * when it was not read — refused, let go, or still being read — and null
94
+ * judges nothing.
95
+ */
96
+ export interface Offered {
97
+ /** Every name a run can address on the forge: the forge's own repositories (GET /v1/git/repos) and every linked copy (GET /v1/sync). */
98
+ forge: readonly string[] | null;
99
+ /** A page of GitHub's listing (GET /v1/provider/github/repos), with what it says stands behind it. */
100
+ github: {
101
+ repos: readonly {
102
+ owner: string;
103
+ name: string;
104
+ }[];
105
+ next: string;
106
+ unread: readonly string[];
107
+ } | null;
108
+ }
109
+ /**
110
+ * Whether the repository New kept is gone from what it can offer: a GitHub
111
+ * repository GitHub no longer lists — let go there, or GitHub disconnected,
112
+ * which lists nothing — or a codebase the forge no longer holds. Left kept, it
113
+ * is where every next run would go, whatever was linked or synced since.
114
+ *
115
+ * Only a WHOLE answer says a repository is missing. A GitHub page with another
116
+ * after it, or with an installation it could not read, is not the whole list,
117
+ * and a list that was not read is no list, so a refused or slow read never
118
+ * loses a good choice. An address the person gave is theirs, and no list is
119
+ * asked about it.
120
+ */
121
+ export declare function gone(repo: {
122
+ forge?: boolean;
123
+ github?: boolean;
124
+ name?: string;
125
+ full_name?: string;
126
+ given?: boolean;
127
+ } | null, now: Offered): boolean;
128
+ /** A repository queued onto the forge and not reported landed yet. */
129
+ export interface Pending {
130
+ fullName: string;
131
+ name: string;
132
+ }
133
+ export declare function readPending(org: string | null): Pending[];
134
+ export declare function writePending(org: string | null, rows: Pending[]): void;
@@ -0,0 +1,152 @@
1
+ /**
2
+ * The choice New starts from, kept in this browser so a codebase or an issue
3
+ * opened from its own screen is what the composer is holding when it mounts.
4
+ *
5
+ * The key is the one `useKept` in New writes. A merge keeps the mode, the
6
+ * model and the machine; it only replaces the fields the caller names.
7
+ */
8
+ import { asRepo } from './api/codebases.js';
9
+ const KEY = (org) => `hanzo.build.new.${org ?? 'none'}`;
10
+ export const boardKey = (org) => `hanzo.build.board.${org ?? 'none'}`;
11
+ function read(org) {
12
+ try {
13
+ const raw = window.localStorage.getItem(KEY(org));
14
+ const v = raw ? JSON.parse(raw) : null;
15
+ return v && typeof v === 'object' ? v : {};
16
+ }
17
+ catch {
18
+ return {};
19
+ }
20
+ }
21
+ function write(org, value) {
22
+ try {
23
+ window.localStorage.setItem(KEY(org), JSON.stringify(value));
24
+ }
25
+ catch {
26
+ /* the next New starts empty */
27
+ }
28
+ }
29
+ /**
30
+ * The choice New opens on, field by field: the last layer that says something
31
+ * wins. What was kept here, over the person's coding defaults, over the first
32
+ * run's. A field kept as '' stays '' (the default branch, the sandbox): only a
33
+ * field that is absent falls through, so a codebase or an issue handed over from
34
+ * its own screen — which keeps the codebase and the words alone — still opens on
35
+ * a model, a mode and an effort.
36
+ */
37
+ export function settle(first, ...layers) {
38
+ let out = { ...first };
39
+ for (const layer of layers) {
40
+ if (!layer || typeof layer !== 'object' || Array.isArray(layer))
41
+ continue;
42
+ out = { ...out, ...Object.fromEntries(Object.entries(layer).filter(([, v]) => v !== undefined && v !== null)) };
43
+ }
44
+ return out;
45
+ }
46
+ /** Point New at a forge codebase, and optionally a first draft. */
47
+ export function pinCodebase(org, c, ask = '') {
48
+ const repo = asRepo(c);
49
+ write(org, { ...read(org), repo, branch: repo.default_branch, ask, issue: 0 });
50
+ }
51
+ /** Which board Issues is showing. '' is every board. */
52
+ export function pinBoard(org, key) {
53
+ try {
54
+ window.localStorage.setItem(boardKey(org), JSON.stringify(key));
55
+ }
56
+ catch {
57
+ /* Issues then shows every board */
58
+ }
59
+ window.dispatchEvent(new CustomEvent('hanzo-board', { detail: key }));
60
+ }
61
+ /**
62
+ * Point New at a project, and optionally a first draft (an issue's ask) and the
63
+ * issue it closes. `where` is where the run works (merge.ts `home`): on the forge
64
+ * it is chosen by its forge name, which is what a run and its environment
65
+ * address; on GitHub by GitHub's address, so the run clones and proposes there.
66
+ * Left out, the forge when the project is there. A project that is neither
67
+ * cannot be worked on, and is refused here rather than handed to the platform.
68
+ */
69
+ export function pinRepo(org, p, ask = '', issue = 0, where = p.forge ? 'forge' : p.linked ? 'github' : null) {
70
+ const branch = p.branch || 'main';
71
+ let repo;
72
+ if (where === 'forge' && p.forge) {
73
+ repo = { owner: org ?? '', name: p.forge, full_name: org ? `${org}/${p.forge}` : p.forge, private: p.private ?? true, default_branch: branch, pushed_at: '', installation_id: 0, forge: true, clone: '' };
74
+ }
75
+ else if (where === 'github' && p.linked) {
76
+ repo = asHub({ owner: p.owner, name: p.name, full_name: `${p.owner}/${p.name}`, private: p.private ?? true, default_branch: branch, pushed_at: '', installation_id: 0 });
77
+ }
78
+ else {
79
+ throw new Error(`${p.owner}/${p.name} is neither on the forge nor linked from GitHub`);
80
+ }
81
+ write(org, { ...read(org), repo, branch, ask, issue });
82
+ }
83
+ /**
84
+ * Point New at a repository on GitHub, by GitHub's address: the one Sync just
85
+ * brought in (sync.tsx), so the next run works on it and not on whatever was
86
+ * chosen before. It is GitHub's address and not its forge copy's, because the
87
+ * copy is still on its way there. A draft or an issue handed over with the
88
+ * last choice was that repository's, and goes with it.
89
+ */
90
+ export function pinHub(org, r) {
91
+ const repo = asHub({ owner: r.owner, name: r.name, full_name: `${r.owner}/${r.name}`, private: r.private, default_branch: r.branch, pushed_at: '', installation_id: 0 });
92
+ write(org, { ...read(org), repo, branch: repo.default_branch, ask: '', issue: 0 });
93
+ }
94
+ export const isHub = (repo) => Boolean(repo && repo.github === true && repo.full_name?.startsWith('github.com/'));
95
+ /** A GitHub listing row as the composer offers it. */
96
+ export const asHub = (r) => ({ ...r, full_name: `github.com/${r.owner}/${r.name}`, github: true });
97
+ export const isForge = (repo) => Boolean(repo && repo.forge === true && repo.name);
98
+ /**
99
+ * Whether the repository New kept is gone from what it can offer: a GitHub
100
+ * repository GitHub no longer lists — let go there, or GitHub disconnected,
101
+ * which lists nothing — or a codebase the forge no longer holds. Left kept, it
102
+ * is where every next run would go, whatever was linked or synced since.
103
+ *
104
+ * Only a WHOLE answer says a repository is missing. A GitHub page with another
105
+ * after it, or with an installation it could not read, is not the whole list,
106
+ * and a list that was not read is no list, so a refused or slow read never
107
+ * loses a good choice. An address the person gave is theirs, and no list is
108
+ * asked about it.
109
+ */
110
+ export function gone(repo, now) {
111
+ if (!repo || repo.given)
112
+ return false;
113
+ if (isHub(repo)) {
114
+ const listed = now.github;
115
+ if (!listed || listed.next || listed.unread.length)
116
+ return false;
117
+ // Each row by the address `asHub` gives it, which is the one New keeps.
118
+ const want = repo.full_name.toLowerCase();
119
+ return !listed.repos.some((r) => `github.com/${r.owner}/${r.name}`.toLowerCase() === want);
120
+ }
121
+ if (isForge(repo)) {
122
+ if (!now.forge)
123
+ return false;
124
+ const want = repo.name.toLowerCase();
125
+ return !now.forge.some((n) => n.toLowerCase() === want);
126
+ }
127
+ return false;
128
+ }
129
+ const syncingKey = (org) => `hanzo.build.sync.${org ?? 'none'}`;
130
+ export function readPending(org) {
131
+ try {
132
+ const raw = window.sessionStorage.getItem(syncingKey(org));
133
+ const v = raw ? JSON.parse(raw) : [];
134
+ if (!Array.isArray(v))
135
+ return [];
136
+ return v.filter((p) => Boolean(p) && typeof p === 'object' && typeof p.fullName === 'string' && p.fullName !== '' && typeof p.name === 'string' && p.name !== '');
137
+ }
138
+ catch {
139
+ return [];
140
+ }
141
+ }
142
+ export function writePending(org, rows) {
143
+ try {
144
+ if (rows.length === 0)
145
+ window.sessionStorage.removeItem(syncingKey(org));
146
+ else
147
+ window.sessionStorage.setItem(syncingKey(org), JSON.stringify(rows));
148
+ }
149
+ catch {
150
+ /* the table then omits the in-flight rows */
151
+ }
152
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * What a hanzo.id access token says, read without trusting it for anything the
3
+ * platform does not check again.
4
+ */
5
+ /** The token's claims, or null when it is not a JWT. */
6
+ export declare function claims(token: string | null): Record<string, unknown> | null;
7
+ /**
8
+ * Whether the token says its person administers `org`: owner or admin, read off
9
+ * the token's own `orgs` claim — never the reserved `admin` org, which is
10
+ * platform authority and not what a builder decides anything by. The platform
11
+ * enforces it again; this only decides which controls are offered.
12
+ */
13
+ export declare function administers(token: string | null, org: string | null): boolean;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * What a hanzo.id access token says, read without trusting it for anything the
3
+ * platform does not check again.
4
+ */
5
+ /** The token's claims, or null when it is not a JWT. */
6
+ export function claims(token) {
7
+ if (!token)
8
+ return null;
9
+ try {
10
+ const part = token.split('.')[1];
11
+ if (!part)
12
+ return null;
13
+ return JSON.parse(atob(part.replace(/-/g, '+').replace(/_/g, '/')));
14
+ }
15
+ catch {
16
+ return null;
17
+ }
18
+ }
19
+ /** The coarse IAM roles that administer an org: its owner and its admins. */
20
+ const ADMIN = ['owner', 'admin'];
21
+ /**
22
+ * Whether the token says its person administers `org`: owner or admin, read off
23
+ * the token's own `orgs` claim — never the reserved `admin` org, which is
24
+ * platform authority and not what a builder decides anything by. The platform
25
+ * enforces it again; this only decides which controls are offered.
26
+ */
27
+ export function administers(token, org) {
28
+ if (!org)
29
+ return false;
30
+ const set = claims(token)?.orgs;
31
+ return (Array.isArray(set) ? set : []).some((r) => {
32
+ const m = r;
33
+ return m?.org === org && ADMIN.includes(m.role);
34
+ });
35
+ }
@@ -0,0 +1,2 @@
1
+ /** Copy text; true once it is on the clipboard, false where the browser has none or refuses it (nothing is thrown). */
2
+ export declare const copy: (text: string) => Promise<boolean>;
@@ -0,0 +1,10 @@
1
+ /** Copy text; true once it is on the clipboard, false where the browser has none or refuses it (nothing is thrown). */
2
+ export const copy = async (text) => {
3
+ try {
4
+ await navigator.clipboard.writeText(text);
5
+ return true;
6
+ }
7
+ catch {
8
+ return false;
9
+ }
10
+ };
@@ -0,0 +1,11 @@
1
+ import { type Cast } from '../api/agents.ts';
2
+ import { type Pane } from './ui.tsx';
3
+ /** Categories as Browse offers them: the default agents' first, as listed, then the rest by how many each holds. */
4
+ export declare function kinds(first: readonly Cast[], rest: readonly Cast[]): string[];
5
+ export declare function Agents({ view, q, adding, onAdding, onView, onCount, mode }: Pane & {
6
+ mode?: 'agents' | 'bots';
7
+ }): import("react").JSX.Element;
8
+ /** One agent's page: who it is, what it runs on and reads, what it may call and spend, and what it has done. */
9
+ export declare function Profile({ name }: {
10
+ name: string;
11
+ }): import("react").JSX.Element;