@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,74 @@
1
+ /**
2
+ * What a run changed, read from the forge it pushed to, as the person asking,
3
+ * and its pull request merged there.
4
+ *
5
+ * GET /v1/agent/coding/{session}/changes commits base..head, each file's patch, the pull request
6
+ * GET /v1/agent/coding/{session}/tree?path= one directory at the run's branch (its base until it pushes)
7
+ * GET /v1/agent/coding/{session}/blob?path= one file there, in /v1/git's blob shape
8
+ * POST /v1/agent/coding/{session}/merge → {number, url, state, base}; 409 with the forge's reason
9
+ *
10
+ * Before the run pushes, changes answers empty, not 404.
11
+ */
12
+ import { type Target } from './call.ts';
13
+ import { type Blob, type Entry } from './git.ts';
14
+ export interface Commit {
15
+ sha: string;
16
+ /** The first line. */
17
+ message: string;
18
+ author: string;
19
+ date: string;
20
+ }
21
+ export interface Change {
22
+ path: string;
23
+ /** The old path of a rename, or ''. */
24
+ from: string;
25
+ status: 'added' | 'modified' | 'deleted' | 'renamed';
26
+ additions: number;
27
+ deletions: number;
28
+ /** The file's unified diff hunks, or '' for a binary file. */
29
+ patch: string;
30
+ truncated: boolean;
31
+ }
32
+ export interface Review {
33
+ author: string;
34
+ state: string;
35
+ body: string;
36
+ at: string;
37
+ }
38
+ export interface Pull {
39
+ number: number;
40
+ url: string;
41
+ title: string;
42
+ state: 'open' | 'closed' | 'merged';
43
+ /** Null when the forge has not worked it out. */
44
+ mergeable: boolean | null;
45
+ reviews: Review[];
46
+ }
47
+ export interface Changes {
48
+ repo: string;
49
+ base: string;
50
+ head: string;
51
+ commits: Commit[];
52
+ files: Change[];
53
+ pull: Pull | null;
54
+ }
55
+ export declare function changes(raw: unknown): Changes;
56
+ export declare function read(t: Target, session: string): Promise<Changes>;
57
+ export declare function tree(t: Target, session: string, path?: string): Promise<Entry[]>;
58
+ export declare function blob(t: Target, session: string, path: string): Promise<Blob>;
59
+ /** A pull request after its merge. */
60
+ export interface Merged {
61
+ number: number;
62
+ url: string;
63
+ /** `merged`. */
64
+ state: string;
65
+ /** The branch it was merged into. */
66
+ base: string;
67
+ }
68
+ /**
69
+ * Merge the run's pull request into its base, at the commit the forge holds
70
+ * now: a push after that is refused, not merged unseen. One already merged
71
+ * answers as it is; a conflict, a closed pull request or a rule on the base is
72
+ * a 409 carrying the forge's reason. Nothing is forced.
73
+ */
74
+ export declare function merge(t: Target, session: string): Promise<Merged>;
@@ -0,0 +1,75 @@
1
+ /**
2
+ * What a run changed, read from the forge it pushed to, as the person asking,
3
+ * and its pull request merged there.
4
+ *
5
+ * GET /v1/agent/coding/{session}/changes commits base..head, each file's patch, the pull request
6
+ * GET /v1/agent/coding/{session}/tree?path= one directory at the run's branch (its base until it pushes)
7
+ * GET /v1/agent/coding/{session}/blob?path= one file there, in /v1/git's blob shape
8
+ * POST /v1/agent/coding/{session}/merge → {number, url, state, base}; 409 with the forge's reason
9
+ *
10
+ * Before the run pushes, changes answers empty, not 404.
11
+ */
12
+ import { call, query, seg } from './call.js';
13
+ import { entries, file } from './git.js';
14
+ const str = (v) => (typeof v === 'string' ? v : '');
15
+ const num = (v) => (typeof v === 'number' && Number.isFinite(v) ? v : 0);
16
+ const obj = (v) => (v && typeof v === 'object' ? v : {});
17
+ const arr = (v) => (Array.isArray(v) ? v : []);
18
+ const STATUS = ['added', 'modified', 'deleted', 'renamed'];
19
+ const PULL = ['open', 'closed', 'merged'];
20
+ export function changes(raw) {
21
+ const o = obj(raw);
22
+ const p = o.pull ? obj(o.pull) : null;
23
+ return {
24
+ repo: str(o.repo),
25
+ base: str(o.base),
26
+ head: str(o.head),
27
+ commits: arr(o.commits)
28
+ .map(obj)
29
+ .map((c) => ({ sha: str(c.sha), message: str(c.message), author: str(c.author), date: str(c.date) }))
30
+ .filter((c) => c.sha),
31
+ files: arr(o.files)
32
+ .map(obj)
33
+ .map((f) => ({
34
+ path: str(f.path),
35
+ from: str(f.from),
36
+ status: STATUS.find((s) => s === f.status) ?? 'modified',
37
+ additions: num(f.additions),
38
+ deletions: num(f.deletions),
39
+ patch: str(f.patch),
40
+ truncated: f.truncated === true,
41
+ }))
42
+ .filter((f) => f.path),
43
+ pull: p && num(p.number)
44
+ ? {
45
+ number: num(p.number),
46
+ url: str(p.url),
47
+ title: str(p.title),
48
+ state: PULL.find((s) => s === p.state) ?? 'open',
49
+ mergeable: typeof p.mergeable === 'boolean' ? p.mergeable : null,
50
+ reviews: arr(p.reviews)
51
+ .map(obj)
52
+ .map((r) => ({ author: str(r.author), state: str(r.state), body: str(r.body), at: str(r.at) })),
53
+ }
54
+ : null,
55
+ };
56
+ }
57
+ export async function read(t, session) {
58
+ return changes(await call(t, 'GET', `/v1/agent/coding/${seg(session)}/changes`));
59
+ }
60
+ export async function tree(t, session, path = '') {
61
+ return entries(await call(t, 'GET', `/v1/agent/coding/${seg(session)}/tree${query({ path })}`));
62
+ }
63
+ export async function blob(t, session, path) {
64
+ return file(await call(t, 'GET', `/v1/agent/coding/${seg(session)}/blob${query({ path })}`), path);
65
+ }
66
+ /**
67
+ * Merge the run's pull request into its base, at the commit the forge holds
68
+ * now: a push after that is refused, not merged unseen. One already merged
69
+ * answers as it is; a conflict, a closed pull request or a rule on the base is
70
+ * a 409 carrying the forge's reason. Nothing is forced.
71
+ */
72
+ export async function merge(t, session) {
73
+ const o = obj(await call(t, 'POST', `/v1/agent/coding/${seg(session)}/merge`, {}));
74
+ return { number: num(o.number), url: str(o.url), state: str(o.state), base: str(o.base) };
75
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * One completion from Hanzo's own models, asked with the person's own bearer so
3
+ * it is attributed to them and metered as theirs.
4
+ *
5
+ * POST /v1/chat/completions {model, messages, max_tokens} → {choices: [{message: {content}}]}
6
+ */
7
+ import { type Target } from './call.ts';
8
+ /** The quick model a plugin thinks with: planning a search, drafting a template. */
9
+ export declare const QUICK = "enso-flash";
10
+ export declare function ask(t: Target, system: string, user: string, signal?: AbortSignal, tokens?: number, model?: string): Promise<string>;
11
+ /** The first JSON object in a model's answer, or null: a model may talk around it. */
12
+ export declare function json(said: string): Record<string, unknown> | null;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * One completion from Hanzo's own models, asked with the person's own bearer so
3
+ * it is attributed to them and metered as theirs.
4
+ *
5
+ * POST /v1/chat/completions {model, messages, max_tokens} → {choices: [{message: {content}}]}
6
+ */
7
+ import { call } from './call.js';
8
+ /** The quick model a plugin thinks with: planning a search, drafting a template. */
9
+ export const QUICK = 'enso-flash';
10
+ export async function ask(t, system, user, signal, tokens = 800, model = QUICK) {
11
+ const raw = await call(t, 'POST', '/v1/chat/completions', { model, max_tokens: tokens, messages: [{ role: 'system', content: system }, { role: 'user', content: user }] }, { signal });
12
+ const said = raw?.choices?.[0]?.message?.content;
13
+ return typeof said === 'string' ? said : '';
14
+ }
15
+ /** The first JSON object in a model's answer, or null: a model may talk around it. */
16
+ export function json(said) {
17
+ const from = said.indexOf('{');
18
+ const to = said.lastIndexOf('}');
19
+ if (from < 0 || to <= from)
20
+ return null;
21
+ try {
22
+ const v = JSON.parse(said.slice(from, to + 1));
23
+ return v && typeof v === 'object' && !Array.isArray(v) ? v : null;
24
+ }
25
+ catch {
26
+ return null;
27
+ }
28
+ }
@@ -0,0 +1,59 @@
1
+ /** One action a command performs, as the agent parses it (exec's `command_actions`). */
2
+ export type Action = {
3
+ type: 'read';
4
+ command: string;
5
+ name: string;
6
+ path: string;
7
+ } | {
8
+ type: 'listFiles';
9
+ command: string;
10
+ path: string | null;
11
+ } | {
12
+ type: 'search';
13
+ command: string;
14
+ query: string | null;
15
+ path: string | null;
16
+ } | {
17
+ type: 'unknown';
18
+ command: string;
19
+ };
20
+ /** One call in an Explored block: what it did, and how it exited (null while it runs). */
21
+ export interface Explore {
22
+ actions: Action[];
23
+ exit: number | null;
24
+ }
25
+ /** One line of an Explored block: the CLI's verb, and what it names. */
26
+ export interface Line {
27
+ title: string;
28
+ text: string;
29
+ }
30
+ /** One file of a patch, with the lines it adds and removes — null from a `dev` too old to count them. */
31
+ export interface Changed {
32
+ path: string;
33
+ kind: 'add' | 'delete' | 'update';
34
+ added: number | null;
35
+ removed: number | null;
36
+ }
37
+ /** A file's line counts as the CLI writes them, "(+a -r)", or nothing when they were not counted. */
38
+ export declare const counted: (f: Pick<Changed, 'added' | 'removed'>) => string;
39
+ /** A command's actions as exec's stream states them; anything it does not name is not one. */
40
+ export declare function actions(raw: unknown): Action[];
41
+ /** Whether a call is exploration: it read, listed or searched, and did nothing else. */
42
+ export declare const explores: (a: Action[]) => boolean;
43
+ /**
44
+ * An Explored block's lines, as the CLI writes them: a call that only read, and the
45
+ * reads that follow it, are one "Read" line naming each file once; any other call
46
+ * says each action on a line of its own. A call that exited non-zero says so on its
47
+ * last line — "(command exit N)" for a compound command.
48
+ */
49
+ export declare function explored(calls: Explore[]): Line[];
50
+ /**
51
+ * A command as the CLI shows it: a shell's own wrapper (`bash -lc '…'`) taken off,
52
+ * the script it ran left. exec's stream joins the argv as a shell would (shlex), so
53
+ * the script is the wrapper's last word, unquoted.
54
+ */
55
+ export declare function shown(command: string): string;
56
+ /** A patch's header, as the CLI writes it: one file named with its verb, or the count of files. */
57
+ export declare function edited(files: Changed[]): string;
58
+ /** An MCP call as the CLI names it: server.tool(arguments), the arguments as compact JSON. */
59
+ export declare const called: (server: string, tool: string, args: unknown) => string;
@@ -0,0 +1,133 @@
1
+ /**
2
+ * A run's tool calls as `dev` prints them in its terminal (hanzoai/dev, the TUI's
3
+ * exec, patch and MCP cells): the run IS `dev exec`, so its transcript reads in
4
+ * the CLI's own words and groups —
5
+ *
6
+ * • Explored reads, listings and searches, consecutive ones in one block
7
+ * └ Search widget in src one line an action
8
+ * Read lib.rs, main.rs consecutive reads, one line, each name once
9
+ * • Ran cargo test any other command, the shell's own wrapper taken off
10
+ * └ ok
11
+ * • Edited lib.rs (+2 -1) a patch: Added / Deleted / Edited, or "Edited N files (+a -r)"
12
+ * • Called hanzo.search({"q":1}) an MCP tool, server.tool(arguments)
13
+ *
14
+ * What a command does is the agent's own parse of it (`command_actions` in exec's
15
+ * stream), and the lines a patch adds and removes are its own count (`added`,
16
+ * `removed`): nothing here parses a command or a diff. Running, a block says
17
+ * Exploring, Running or Calling, as the CLI does.
18
+ */
19
+ import { phrase } from '@hanzo/i18n';
20
+ /** A file's line counts as the CLI writes them, "(+a -r)", or nothing when they were not counted. */
21
+ export const counted = (f) => (f.added === null || f.removed === null ? '' : `(+${f.added} -${f.removed})`);
22
+ const str = (v) => (typeof v === 'string' ? v : '');
23
+ const nullable = (v) => (typeof v === 'string' ? v : null);
24
+ /** A command's actions as exec's stream states them; anything it does not name is not one. */
25
+ export function actions(raw) {
26
+ if (!Array.isArray(raw))
27
+ return [];
28
+ return raw.flatMap((a) => {
29
+ const o = a && typeof a === 'object' ? a : {};
30
+ switch (o.type) {
31
+ case 'read':
32
+ return [{ type: 'read', command: str(o.command), name: str(o.name), path: str(o.path) }];
33
+ case 'listFiles':
34
+ return [{ type: 'listFiles', command: str(o.command), path: nullable(o.path) }];
35
+ case 'search':
36
+ return [{ type: 'search', command: str(o.command), query: nullable(o.query), path: nullable(o.path) }];
37
+ case 'unknown':
38
+ return [{ type: 'unknown', command: str(o.command) }];
39
+ }
40
+ return [];
41
+ });
42
+ }
43
+ /** Whether a call is exploration: it read, listed or searched, and did nothing else. */
44
+ export const explores = (a) => a.length > 0 && a.every((x) => x.type !== 'unknown');
45
+ /**
46
+ * An Explored block's lines, as the CLI writes them: a call that only read, and the
47
+ * reads that follow it, are one "Read" line naming each file once; any other call
48
+ * says each action on a line of its own. A call that exited non-zero says so on its
49
+ * last line — "(command exit N)" for a compound command.
50
+ */
51
+ export function explored(calls) {
52
+ const out = [];
53
+ const failed = (c) => c.exit !== null && c.exit !== 0;
54
+ const reads = (c) => c.actions.every((a) => a.type === 'read');
55
+ for (let i = 0; i < calls.length;) {
56
+ const call = calls[i];
57
+ let n = 1;
58
+ if (reads(call) && !failed(call))
59
+ while (i + n < calls.length && !failed(calls[i + n]) && reads(calls[i + n]))
60
+ n++;
61
+ const group = calls.slice(i, i + n);
62
+ i += n;
63
+ const lines = reads(call)
64
+ ? [{ title: phrase('Read'), text: [...new Set(group.flatMap((c) => c.actions.map((a) => (a.type === 'read' ? a.name : ''))))].join(', ') }]
65
+ : call.actions.map((a) => {
66
+ switch (a.type) {
67
+ case 'read':
68
+ return { title: phrase('Read'), text: a.name };
69
+ case 'listFiles':
70
+ return { title: phrase('List'), text: a.path ?? a.command };
71
+ case 'search':
72
+ return { title: phrase('Search'), text: a.query !== null && a.path !== null ? `${a.query} in ${a.path}` : (a.query ?? a.command) };
73
+ default:
74
+ return { title: phrase('Run'), text: a.command };
75
+ }
76
+ });
77
+ if (failed(call)) {
78
+ const last = lines[lines.length - 1];
79
+ last.text += call.actions.length > 1 ? ` (command exit ${call.exit})` : ` (exit ${call.exit})`;
80
+ }
81
+ out.push(...lines);
82
+ }
83
+ return out;
84
+ }
85
+ /**
86
+ * A command as the CLI shows it: a shell's own wrapper (`bash -lc '…'`) taken off,
87
+ * the script it ran left. exec's stream joins the argv as a shell would (shlex), so
88
+ * the script is the wrapper's last word, unquoted.
89
+ */
90
+ export function shown(command) {
91
+ const m = /^(?:\S*\/)?(?:bash|zsh|sh)\s+-l?c\s+(.+)$/s.exec(command.trim());
92
+ return m ? unquote(m[1]) : command;
93
+ }
94
+ /** One shell word, its quoting taken off: single quotes, double quotes and backslashes. */
95
+ function unquote(word) {
96
+ let out = '';
97
+ for (let i = 0; i < word.length; i++) {
98
+ const c = word[i];
99
+ if (c === "'") {
100
+ const end = word.indexOf("'", i + 1);
101
+ if (end < 0)
102
+ return word;
103
+ out += word.slice(i + 1, end);
104
+ i = end;
105
+ }
106
+ else if (c === '"') {
107
+ let j = i + 1;
108
+ for (; j < word.length && word[j] !== '"'; j++)
109
+ out += word[j] === '\\' && j + 1 < word.length ? word[++j] : word[j];
110
+ i = j;
111
+ }
112
+ else if (c === '\\' && i + 1 < word.length)
113
+ out += word[++i];
114
+ else if (/\s/.test(c))
115
+ return word; // more than one word: not one script
116
+ else
117
+ out += c;
118
+ }
119
+ return out;
120
+ }
121
+ /** A patch's header, as the CLI writes it: one file named with its verb, or the count of files. */
122
+ export function edited(files) {
123
+ if (files.length === 1) {
124
+ const [f] = files;
125
+ const verb = f.kind === 'add' ? 'Added' : f.kind === 'delete' ? 'Deleted' : 'Edited';
126
+ return `${verb} ${f.path} ${counted(f)}`.trim();
127
+ }
128
+ const known = files.every((f) => f.added !== null && f.removed !== null);
129
+ const total = known ? { added: files.reduce((n, f) => n + f.added, 0), removed: files.reduce((n, f) => n + f.removed, 0) } : { added: null, removed: null };
130
+ return `Edited ${files.length} ${files.length === 1 ? 'file' : 'files'} ${counted(total)}`.trim();
131
+ }
132
+ /** An MCP call as the CLI names it: server.tool(arguments), the arguments as compact JSON. */
133
+ export const called = (server, tool, args) => `${server}.${tool}(${args === undefined || args === null ? '' : JSON.stringify(args)})`;
@@ -0,0 +1,46 @@
1
+ import { type Target } from './call.ts';
2
+ export interface Codebase {
3
+ org: string;
4
+ name: string;
5
+ description: string;
6
+ /** HEAD's branch, or 'main' when the forge did not say. */
7
+ branch: string;
8
+ public: boolean;
9
+ /** The https remote `git clone` takes, or ''. */
10
+ clone: string;
11
+ updated: string;
12
+ branches: string[];
13
+ }
14
+ /** What the composer chip stores. `forge` marks a choice made from this list. */
15
+ export interface ForgeRepo {
16
+ owner: string;
17
+ name: string;
18
+ full_name: string;
19
+ private: boolean;
20
+ default_branch: string;
21
+ pushed_at: string;
22
+ installation_id: number;
23
+ forge: true;
24
+ clone: string;
25
+ }
26
+ export declare function codebase(raw: unknown, org?: string): Codebase | null;
27
+ /** A chip row remembered as a forge codebase, when the list had not seen it yet. */
28
+ export declare function chosen(r: {
29
+ owner: string;
30
+ name: string;
31
+ full_name?: string;
32
+ private?: boolean;
33
+ default_branch?: string;
34
+ }): ForgeRepo;
35
+ /** The chip's row for a codebase the forge listed. */
36
+ export declare function asRepo(c: Codebase): ForgeRepo;
37
+ /** Provision an empty repository. The name is the handle and the last path segment. */
38
+ export declare function create(t: Target, name: string, description?: string): Promise<Codebase>;
39
+ export declare function codebases(t: Target, q?: string): Promise<Codebase[]>;
40
+ /** One codebase, so the branch chip can list what HEAD can point at. */
41
+ export declare function one(t: Target, name: string): Promise<Codebase | null>;
42
+ /**
43
+ * Delete a codebase from the forge, and its history with it. Nothing else goes:
44
+ * a link that syncs into it, or a project built from it, is dropped on its own.
45
+ */
46
+ export declare function remove(t: Target, name: string): Promise<void>;
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Codebases on the forge, the org's own git.
3
+ *
4
+ * GET /v1/git/repos {data: [repo]} most recently updated first
5
+ * GET /v1/git/repos/{name} one repo, with its branch names
6
+ * DELETE /v1/git/repos/{name} the repo and its history, gone
7
+ *
8
+ * A coding run addresses a repository by its name. The org is the tenant on
9
+ * the request, so the name is the whole address — `owner/name` is a path the
10
+ * engine refuses.
11
+ */
12
+ import { phrase } from '@hanzo/i18n';
13
+ import { call, seg } from './call.js';
14
+ const str = (v) => (typeof v === 'string' ? v : '');
15
+ const obj = (v) => v && typeof v === 'object' ? v : {};
16
+ export function codebase(raw, org = '') {
17
+ const o = obj(raw);
18
+ const name = str(o.name);
19
+ if (!name)
20
+ return null;
21
+ const branches = (Array.isArray(o.branches) ? o.branches : []).filter((b) => typeof b === 'string' && b !== '');
22
+ const branch = str(o.defaultBranch) || 'main';
23
+ return {
24
+ org: str(o.org) || org,
25
+ name,
26
+ description: str(o.description),
27
+ branch,
28
+ public: o.public === true,
29
+ clone: str(o.cloneUrl),
30
+ updated: str(o.updatedAt),
31
+ branches: branches.length ? branches : [branch],
32
+ };
33
+ }
34
+ /** A chip row remembered as a forge codebase, when the list had not seen it yet. */
35
+ export function chosen(r) {
36
+ return {
37
+ owner: r.owner,
38
+ name: r.name,
39
+ full_name: r.full_name || (r.owner ? `${r.owner}/${r.name}` : r.name),
40
+ private: r.private === true,
41
+ default_branch: r.default_branch || 'main',
42
+ pushed_at: '',
43
+ installation_id: 0,
44
+ forge: true,
45
+ clone: '',
46
+ };
47
+ }
48
+ /** The chip's row for a codebase the forge listed. */
49
+ export function asRepo(c) {
50
+ const owner = c.org;
51
+ return {
52
+ owner,
53
+ name: c.name,
54
+ full_name: owner ? `${owner}/${c.name}` : c.name,
55
+ private: !c.public,
56
+ default_branch: c.branch,
57
+ pushed_at: c.updated,
58
+ installation_id: 0,
59
+ forge: true,
60
+ clone: c.clone,
61
+ };
62
+ }
63
+ function rows(raw) {
64
+ if (Array.isArray(raw))
65
+ return raw;
66
+ const o = obj(raw);
67
+ return Array.isArray(o.data) ? o.data : [];
68
+ }
69
+ const NAME = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;
70
+ /** Provision an empty repository. The name is the handle and the last path segment. */
71
+ export async function create(t, name, description = '') {
72
+ const handle = name.trim().replace(/\.git$/, '');
73
+ if (!NAME.test(handle))
74
+ throw new Error(phrase('A repository name starts with a letter or number, and may contain letters, numbers, dots, underscores and hyphens.'));
75
+ const raw = await call(t, 'POST', '/v1/git/repos', { name: handle, description: description.trim() });
76
+ const row = codebase(raw, t.org ?? '');
77
+ if (!row)
78
+ throw new Error(phrase('The forge created a repository and did not name it'));
79
+ return row;
80
+ }
81
+ export async function codebases(t, q = '') {
82
+ const raw = await call(t, 'GET', '/v1/git/repos');
83
+ const needle = q.trim().toLowerCase();
84
+ return rows(raw)
85
+ .map((r) => codebase(r, t.org ?? ''))
86
+ .filter((c) => c !== null)
87
+ .filter((c) => !needle || `${c.org}/${c.name} ${c.description}`.toLowerCase().includes(needle));
88
+ }
89
+ /** One codebase, so the branch chip can list what HEAD can point at. */
90
+ export async function one(t, name) {
91
+ const raw = await call(t, 'GET', `/v1/git/repos/${seg(name)}`);
92
+ return codebase(raw, t.org ?? '');
93
+ }
94
+ /**
95
+ * Delete a codebase from the forge, and its history with it. Nothing else goes:
96
+ * a link that syncs into it, or a project built from it, is dropped on its own.
97
+ */
98
+ export async function remove(t, name) {
99
+ await call(t, 'DELETE', `/v1/git/repos/${seg(name)}`);
100
+ }
@@ -0,0 +1,117 @@
1
+ import type { Say } from '@hanzo/i18n/react';
2
+ import { type Target } from './call.ts';
3
+ export type Mode = 'build' | 'plan' | 'setup';
4
+ /** Why this mode cannot run where it is sent, in the words of the `t` handed (English without one), or '' when it can. */
5
+ export declare const unhonoured: (mode: Mode | undefined, target?: string, t?: Say) => string;
6
+ export interface Ask {
7
+ /** The task, in the words you would use with a colleague. */
8
+ prompt: string;
9
+ /**
10
+ * The repository: its name in the caller's org, or `owner/name` as a run's
11
+ * record states it, which the engine resolves as it did for that run.
12
+ * Omitted starts something new.
13
+ */
14
+ repo?: string;
15
+ /** The branch to start from. Omitted takes the repository's default. */
16
+ base?: string;
17
+ /** One of the org's machines. Omitted is the sandbox. */
18
+ targetId?: string;
19
+ /** A folder on that machine its owner lets the web use, an absolute path; the run works there instead of in a repository. */
20
+ dir?: string;
21
+ /** The project slug the run works on. */
22
+ project?: string;
23
+ /** An earlier run's session to continue from, on the branch it pushed. */
24
+ after?: string;
25
+ mode?: Mode;
26
+ /** The model the agent thinks with, by the id GET /v1/models lists; Enso is sent as itself. */
27
+ model?: string;
28
+ effort?: string;
29
+ /** The number of the issue on `repo` this run resolves: its pull request says `Closes #<n>`. */
30
+ issue?: number;
31
+ /** Client-generated idempotency key so retries never duplicate a run. */
32
+ requestId?: string;
33
+ /** Out-of-band instructions (skills, memories) kept separate from `prompt`. */
34
+ instructions?: string;
35
+ /** Explicit alias for `instructions` passed via `-c developer_instructions=...`. */
36
+ developerInstructions?: string;
37
+ }
38
+ export interface Run {
39
+ session: string;
40
+ repo: string;
41
+ branch: string;
42
+ routed: boolean;
43
+ target: string;
44
+ }
45
+ /**
46
+ * The request body: only what was asked, with no empty strings sent as values.
47
+ * A run in the sandbox asks for one with a desktop, so its Desktop tab has a
48
+ * screen to show; a machine is whatever it is.
49
+ */
50
+ export declare function body(ask: Ask): Record<string, string | number | boolean>;
51
+ export declare function start(t: Target, ask: Ask): Promise<Run>;
52
+ /**
53
+ * New words for a sandbox run that is working. The run takes its task on its
54
+ * command line and reads nothing after (apps/coding steer.go), so the platform
55
+ * stops it with its work kept on its branch and starts a follow-up from there
56
+ * with the words; the follow-up's session arrives on this run's own stream as
57
+ * its `followed` status (turn.ts `followed`).
58
+ */
59
+ export declare function steer(t: Target, session: string, text: string, requestId?: string): Promise<void>;
60
+ /** A run a follow-up continues, as its record states it. */
61
+ export interface Earlier {
62
+ id: string;
63
+ title: string;
64
+ /** `owner/name`, as the record states it. */
65
+ repo: string;
66
+ /** The branch it started from, or '' for the repository's default. */
67
+ base: string;
68
+ /** 'sandbox', or the id of the machine it ran on. */
69
+ environment: string;
70
+ project: string;
71
+ mode: string;
72
+ /** Its work is on its own branch (turn.ts `settled`). */
73
+ pushed: boolean;
74
+ }
75
+ /**
76
+ * The earlier run's ask, without the codebase its title leads with (`universe:
77
+ * add the widget`), or the `new project:` the platform titles a run that made its
78
+ * codebase with (apps/coding start.go).
79
+ */
80
+ export declare function headline(title: string, repo: string): string;
81
+ /**
82
+ * A new run continuing an earlier one in its mode: what the person said, and
83
+ * which run it follows, because the new run's agent reads nothing else. With
84
+ * nothing said it goes on with the earlier ask, in the words the platform uses
85
+ * when it carries a paused run on (apps/coding steer.go followUp).
86
+ */
87
+ export declare function followUp(e: Earlier, said: string): Ask;
88
+ /** A build of what a plan run answered: its ask as the title, and the plan to carry out. */
89
+ export declare function approve(e: Earlier, plan: string): Ask;
90
+ /**
91
+ * The same ask again, where the earlier run worked and in its mode: what a failed
92
+ * run's Try again starts. `ask` is the person's words as the run recorded them;
93
+ * with none recorded, its title's.
94
+ */
95
+ export declare function retry(e: Earlier, ask: string): Ask;
96
+ /** What a run left: a changed file, the whole change as a patch, or a link. */
97
+ export type Kind = 'file' | 'patch' | 'preview' | 'pull' | 'deploy';
98
+ export interface Artifact {
99
+ /** A changed file's path in the workspace, `changes.patch`, or a link's name. */
100
+ name: string;
101
+ kind: Kind;
102
+ /** A stored artifact's length in bytes; 0 for a link. */
103
+ size: number;
104
+ /** Where a link points: a preview's host, a pull request, a deployment. */
105
+ url: string;
106
+ /** A preview's port in the run's sandbox. */
107
+ port: number;
108
+ }
109
+ export interface Left {
110
+ /** When the artifacts were saved, or '' while the run has saved none. */
111
+ saved: string;
112
+ artifacts: Artifact[];
113
+ }
114
+ /** What a run left, kept after its sandbox is gone. */
115
+ export declare function artifacts(t: Target, session: string): Promise<Left>;
116
+ /** One stored artifact's bytes. */
117
+ export declare function artifact(t: Target, session: string, name: string): Promise<Blob>;