@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,139 @@
1
+ import { type Target } from './call.ts';
2
+ export type Period = 'day' | 'week' | 'month';
3
+ export declare const PERIODS: readonly Period[];
4
+ export type Mode = 'one-shot' | 'long-running';
5
+ export declare const MODES: readonly Mode[];
6
+ export type Trigger = 'webhook' | 'git' | 'channel' | 'watch';
7
+ export declare const TRIGGERS: readonly Trigger[];
8
+ export declare const SCHEDULES: readonly {
9
+ cron: string;
10
+ label: string;
11
+ }[];
12
+ export interface Agent {
13
+ id: string;
14
+ name: string;
15
+ model: string;
16
+ description: string;
17
+ /** Only a single agent's read carries it; the list withholds it. */
18
+ instructions: string;
19
+ tools: string[];
20
+ status: string;
21
+ runs: number;
22
+ /** Micro-USD per period, per run, and spent this period. */
23
+ cap: number;
24
+ task: number;
25
+ spent: number;
26
+ period: Period | '';
27
+ /** Its picture: an https link or a data URL; '' draws its emoji or initial. */
28
+ avatar: string;
29
+ emoji: string;
30
+ /** How the agent runs: 'long-running' runs autonomously 24/7 on its schedule and triggers. */
31
+ executionMode?: Mode;
32
+ /** 5-field cron schedule for proactive execution (required when executionMode is 'long-running'). */
33
+ schedule?: string;
34
+ /** Event-driven triggers that wake the agent proactively. */
35
+ triggers?: Trigger[];
36
+ }
37
+ /** The fields a person edits. Money is in dollars here and micro-USD on the wire. */
38
+ export interface Draft {
39
+ name: string;
40
+ description: string;
41
+ model: string;
42
+ instructions: string;
43
+ tools: string[];
44
+ cap: string;
45
+ task: string;
46
+ period: Period;
47
+ /** Sent on create only: an https link or a data URL. */
48
+ avatar: string;
49
+ /** Sent on create only, and only when there is no avatar: one emoji. */
50
+ emoji?: string;
51
+ executionMode?: Mode;
52
+ schedule?: string;
53
+ triggers?: Trigger[];
54
+ }
55
+ /** An agent's name, as the handler takes it. */
56
+ export declare const NAME: RegExp;
57
+ /** The most instructions the handler keeps. */
58
+ export declare const MAX: number;
59
+ /** Every tool the fleet's MCP server serves. */
60
+ export declare const ALL = "*";
61
+ export declare const micros: (dollars: string) => number;
62
+ export declare const dollars: (m: number) => string;
63
+ export declare function agent(raw: unknown): Agent;
64
+ /** A draft of an agent as it stands, to edit. */
65
+ export declare function draft(a: Agent): Draft;
66
+ export declare const EMPTY: Draft;
67
+ /** Why a draft cannot be saved as it stands, or '' when it can: English, marked (`phrase`), so a screen says it through `t`. */
68
+ export declare function refuse(d: Draft): string;
69
+ export declare function agents(t: Target): Promise<Agent[]>;
70
+ export declare function one(t: Target, ref: string): Promise<Agent>;
71
+ /** One run of an agent, as its profile lists it: ok or error, what it was given and what it said. */
72
+ export interface Run {
73
+ id: string;
74
+ status: string;
75
+ model: string;
76
+ input: string;
77
+ output: string;
78
+ error: string;
79
+ ms: number;
80
+ at: string;
81
+ }
82
+ export declare function run(raw: unknown): Run;
83
+ /** An agent with its instructions and its 20 latest runs, newest first (`recentRuns`). */
84
+ export declare function profile(t: Target, ref: string): Promise<{
85
+ agent: Agent;
86
+ runs: Run[];
87
+ }>;
88
+ /** An agent to start from: a default agent or a persona. */
89
+ export interface Cast {
90
+ /** The name it is made under. */
91
+ name: string;
92
+ /** What Browse calls it. */
93
+ title: string;
94
+ description: string;
95
+ /** What Browse lists it under. */
96
+ category: string;
97
+ model: string;
98
+ instructions: string;
99
+ /** Reads the instructions, where they are a file the host serves. */
100
+ read?: () => Promise<string>;
101
+ /** Its face, an address of the host. */
102
+ avatar?: string;
103
+ /** Who it is drawn from, by the names Browse prints: "Ogilvy", "Bernbach", "Burnett". */
104
+ after?: readonly string[];
105
+ tools?: string[];
106
+ /** How the preset runs when elected (e.g. 'long-running' for 24/7 autonomous bots). */
107
+ executionMode?: Mode;
108
+ /** Default 5-field cron schedule for proactive execution. */
109
+ schedule?: string;
110
+ /** Default event-driven triggers. */
111
+ triggers?: Trigger[];
112
+ }
113
+ /** What an agent made from a template may spend until its owner says otherwise, in dollars: each month, and one run. */
114
+ export declare const CAST_CAP = "10";
115
+ export declare const CAST_TASK = "1";
116
+ /**
117
+ * A name the API takes: accents dropped, any other run of characters a dash,
118
+ * from a letter or digit, up to 64. "Spärck Jones" is Sparck-Jones.
119
+ */
120
+ export declare const handle: (name: string) => string;
121
+ /** `name`, or `name-2`, `name-3`… : the first the org has no agent called, in any case. */
122
+ export declare function free(name: string, have: readonly {
123
+ name: string;
124
+ }[]): string;
125
+ /** An address of the page as an https link the API keeps, or '' (a page served over http has none). */
126
+ export declare const link: (at: string | undefined, base: string) => string;
127
+ /**
128
+ * Make the org's own agent from a template: under the first name the org has
129
+ * free (read now, so it is never one that exists), with its instructions read
130
+ * and its face linked. The template is not touched.
131
+ */
132
+ export declare function use(t: Target, c: Cast, base: string, overrides?: Partial<Pick<Draft, 'executionMode' | 'schedule' | 'triggers' | 'model' | 'tools' | 'cap' | 'task' | 'period'>>): Promise<Agent>;
133
+ /** Anyone as a template: their name, who they are, how they think and write (ocean.ts `nature`), and writing of theirs to take the voice from. */
134
+ export declare function person(name: string, about: string, writing: string, avatar?: string, nature?: string): Cast;
135
+ export declare function create(t: Target, d: Draft): Promise<Agent>;
136
+ /** The fields that differ from `was`, and nothing else: an omitted field keeps its value. */
137
+ export declare function changes(was: Agent, d: Draft): Record<string, unknown>;
138
+ export declare function update(t: Target, was: Agent, d: Draft): Promise<Agent>;
139
+ export declare function remove(t: Target, ref: string): Promise<void>;
@@ -0,0 +1,253 @@
1
+ /**
2
+ * Agents: the org's own — a model, instructions, the tools it may call, a
3
+ * budget and a face — and how one is made from a template.
4
+ *
5
+ * GET /v1/agent {agents: [agent]}, without instructions
6
+ * POST /v1/agent create → 201 agent
7
+ * GET /v1/agent/{ref} one, with its instructions
8
+ * PATCH /v1/agent/{ref} the fields sent change, the rest stay → agent
9
+ * DELETE /v1/agent/{ref} removes it and every run recorded against it → 204
10
+ *
11
+ * A ref is the agent's id or its name. A budget is required: the most it may
12
+ * spend in a period and in one run, in micro-USD, and the period — day, week or
13
+ * month. Tools are names from the tool plane; none grants none, and `*` is
14
+ * whatever the fleet's MCP server serves when it runs. An omitted model is the
15
+ * deployment's default.
16
+ */
17
+ import { phrase } from '@hanzo/i18n';
18
+ import { call, seg } from './call.js';
19
+ export const PERIODS = ['day', 'week', 'month'];
20
+ export const MODES = ['one-shot', 'long-running'];
21
+ export const TRIGGERS = ['webhook', 'git', 'channel', 'watch'];
22
+ export const SCHEDULES = [
23
+ { cron: '*/5 * * * *', label: phrase('Every 5 min') },
24
+ { cron: '*/15 * * * *', label: phrase('Every 15 min') },
25
+ { cron: '0 * * * *', label: phrase('Hourly') },
26
+ { cron: '0 9 * * *', label: phrase('Daily 9am') },
27
+ { cron: '0 9 * * 1-5', label: phrase('Weekdays 9am') },
28
+ { cron: '0 9 * * 1', label: phrase('Weekly Mon 9am') },
29
+ ];
30
+ /** An agent's name, as the handler takes it. */
31
+ export const NAME = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;
32
+ /** The most instructions the handler keeps. */
33
+ export const MAX = 32 << 10;
34
+ /** Every tool the fleet's MCP server serves. */
35
+ export const ALL = '*';
36
+ const str = (v) => (typeof v === 'string' ? v : '');
37
+ const num = (v) => (typeof v === 'number' && Number.isFinite(v) ? v : 0);
38
+ const obj = (v) => (v && typeof v === 'object' ? v : {});
39
+ const rows = (v) => (Array.isArray(v) ? v : []);
40
+ export const micros = (dollars) => Math.round(Number(dollars) * 1_000_000);
41
+ export const dollars = (m) => (m ? String(m / 1_000_000) : '');
42
+ export function agent(raw) {
43
+ const o = obj(raw);
44
+ const period = str(o.period);
45
+ const mode = str(o.executionMode || o.execution_mode);
46
+ const schedule = str(o.schedule);
47
+ const triggers = rows(o.triggers).map(str).filter((x) => TRIGGERS.includes(x));
48
+ return {
49
+ id: str(o.id),
50
+ name: str(o.name),
51
+ model: str(o.model),
52
+ description: str(o.description),
53
+ instructions: str(o.instructions),
54
+ tools: rows(o.tools).map(str).filter(Boolean),
55
+ status: str(o.status),
56
+ runs: num(o.runs),
57
+ cap: num(o.cap_micro_usd),
58
+ task: num(o.max_task_micro_usd),
59
+ spent: num(o.consumed_micro_usd),
60
+ period: PERIODS.includes(period) ? period : '',
61
+ avatar: str(o.avatar),
62
+ emoji: str(o.emoji),
63
+ ...(MODES.includes(mode) ? { executionMode: mode } : {}),
64
+ ...(schedule ? { schedule } : {}),
65
+ ...(triggers.length ? { triggers } : {}),
66
+ };
67
+ }
68
+ /** A draft of an agent as it stands, to edit. */
69
+ export function draft(a) {
70
+ return {
71
+ name: a.name,
72
+ description: a.description,
73
+ model: a.model,
74
+ instructions: a.instructions,
75
+ tools: a.tools,
76
+ cap: dollars(a.cap),
77
+ task: dollars(a.task),
78
+ period: a.period || 'month',
79
+ avatar: a.avatar,
80
+ ...(a.executionMode ? { executionMode: a.executionMode } : {}),
81
+ ...(a.schedule ? { schedule: a.schedule } : {}),
82
+ ...(a.triggers?.length ? { triggers: a.triggers } : {}),
83
+ };
84
+ }
85
+ export const EMPTY = { name: '', description: '', model: '', instructions: '', tools: [], cap: '', task: '', period: 'month', avatar: '' };
86
+ /** What a budget left unset says, and one run that outspends its period, by the period: whole sentences, so a language says the period its own way. */
87
+ const UNSET = { day: phrase('Set what it may spend each day'), week: phrase('Set what it may spend each week'), month: phrase('Set what it may spend each month') };
88
+ const OVER = {
89
+ day: phrase('One run cannot spend more than the whole day'),
90
+ week: phrase('One run cannot spend more than the whole week'),
91
+ month: phrase('One run cannot spend more than the whole month'),
92
+ };
93
+ /** Why a draft cannot be saved as it stands, or '' when it can: English, marked (`phrase`), so a screen says it through `t`. */
94
+ export function refuse(d) {
95
+ if (!NAME.test(d.name))
96
+ return phrase('A name is letters, digits, . _ or -, starting with a letter or digit');
97
+ if (new TextEncoder().encode(d.instructions).length > MAX)
98
+ return phrase('Instructions are at most 32 KB');
99
+ if (d.executionMode === 'long-running' && !d.schedule?.trim())
100
+ return phrase('A 24/7 autonomous agent requires a schedule (5-field cron)');
101
+ const cap = micros(d.cap);
102
+ const task = micros(d.task);
103
+ if (!(cap > 0))
104
+ return UNSET[d.period];
105
+ if (!(task > 0))
106
+ return phrase('Set what one run may spend');
107
+ if (task > cap)
108
+ return OVER[d.period];
109
+ return '';
110
+ }
111
+ export async function agents(t) {
112
+ return rows(obj(await call(t, 'GET', '/v1/agent')).agents).map(agent).filter((a) => a.name);
113
+ }
114
+ export async function one(t, ref) {
115
+ return agent(await call(t, 'GET', `/v1/agent/${seg(ref)}`));
116
+ }
117
+ export function run(raw) {
118
+ const o = obj(raw);
119
+ return { id: str(o.id), status: str(o.status), model: str(o.model), input: str(o.input), output: str(o.output), error: str(o.error), ms: num(o.durationMs), at: str(o.createdAt) };
120
+ }
121
+ /** An agent with its instructions and its 20 latest runs, newest first (`recentRuns`). */
122
+ export async function profile(t, ref) {
123
+ const raw = await call(t, 'GET', `/v1/agent/${seg(ref)}`);
124
+ return { agent: agent(raw), runs: rows(obj(raw).recentRuns).map(run).filter((r) => r.id) };
125
+ }
126
+ /** What an agent made from a template may spend until its owner says otherwise, in dollars: each month, and one run. */
127
+ export const CAST_CAP = '10';
128
+ export const CAST_TASK = '1';
129
+ /**
130
+ * A name the API takes: accents dropped, any other run of characters a dash,
131
+ * from a letter or digit, up to 64. "Spärck Jones" is Sparck-Jones.
132
+ */
133
+ export const handle = (name) => name
134
+ .normalize('NFD')
135
+ .replace(/[\u0300-\u036f]/g, '')
136
+ .replace(/[^A-Za-z0-9._-]+/g, '-')
137
+ .replace(/^[^A-Za-z0-9]+/, '')
138
+ .slice(0, 64)
139
+ .replace(/-+$/, '');
140
+ /** `name`, or `name-2`, `name-3`… : the first the org has no agent called, in any case. */
141
+ export function free(name, have) {
142
+ const taken = new Set(have.map((a) => a.name.toLowerCase()));
143
+ if (!taken.has(name.toLowerCase()))
144
+ return name;
145
+ for (let i = 2;; i++) {
146
+ const next = `${name.slice(0, 63 - String(i).length)}-${i}`;
147
+ if (!taken.has(next.toLowerCase()))
148
+ return next;
149
+ }
150
+ }
151
+ /** An address of the page as an https link the API keeps, or '' (a page served over http has none). */
152
+ export const link = (at, base) => {
153
+ if (!at)
154
+ return '';
155
+ const url = new URL(at, base).href;
156
+ return url.startsWith('https://') || url.startsWith('data:') ? url : '';
157
+ };
158
+ /**
159
+ * Make the org's own agent from a template: under the first name the org has
160
+ * free (read now, so it is never one that exists), with its instructions read
161
+ * and its face linked. The template is not touched.
162
+ */
163
+ export async function use(t, c, base, overrides) {
164
+ const [have, instructions] = await Promise.all([agents(t), c.read ? c.read() : c.instructions]);
165
+ const executionMode = overrides?.executionMode ?? c.executionMode;
166
+ const schedule = overrides?.schedule ?? c.schedule;
167
+ const triggers = overrides?.triggers ?? c.triggers;
168
+ return create(t, {
169
+ ...EMPTY,
170
+ name: free(handle(c.name), have),
171
+ description: c.description,
172
+ model: overrides?.model ?? c.model,
173
+ instructions,
174
+ tools: overrides?.tools ?? c.tools ?? [],
175
+ cap: overrides?.cap ?? CAST_CAP,
176
+ task: overrides?.task ?? CAST_TASK,
177
+ period: overrides?.period ?? 'month',
178
+ avatar: link(c.avatar, base),
179
+ ...(executionMode ? { executionMode } : {}),
180
+ ...(schedule ? { schedule } : {}),
181
+ ...(triggers?.length ? { triggers } : {}),
182
+ });
183
+ }
184
+ /** Anyone as a template: their name, who they are, how they think and write (ocean.ts `nature`), and writing of theirs to take the voice from. */
185
+ export function person(name, about, writing, avatar = '', nature = '') {
186
+ const who = name.trim();
187
+ const lines = [`You are ${who}.`, about.trim(), nature, writing.trim() && `Writing by ${who}:\n\n${writing.trim()}`];
188
+ return { name: who, title: who, description: about.trim(), category: phrase('Person'), model: '', instructions: lines.filter(Boolean).join('\n\n'), avatar };
189
+ }
190
+ export async function create(t, d) {
191
+ const why = refuse(d);
192
+ if (why)
193
+ throw new Error(why);
194
+ const body = {
195
+ name: d.name.trim(),
196
+ description: d.description.trim(),
197
+ instructions: d.instructions,
198
+ tools: d.tools,
199
+ cap_micro_usd: micros(d.cap),
200
+ max_task_micro_usd: micros(d.task),
201
+ period: d.period,
202
+ };
203
+ if (d.model)
204
+ body.model = d.model;
205
+ if (d.avatar)
206
+ body.avatar = d.avatar;
207
+ else if (d.emoji)
208
+ body.emoji = d.emoji;
209
+ if (d.executionMode)
210
+ body.executionMode = d.executionMode;
211
+ if (d.schedule?.trim())
212
+ body.schedule = d.schedule.trim();
213
+ if (d.triggers?.length)
214
+ body.triggers = d.triggers;
215
+ return agent(await call(t, 'POST', '/v1/agent', body));
216
+ }
217
+ /** The fields that differ from `was`, and nothing else: an omitted field keeps its value. */
218
+ export function changes(was, d) {
219
+ const out = {};
220
+ if (d.model && d.model !== was.model)
221
+ out.model = d.model;
222
+ if (d.description.trim() !== was.description)
223
+ out.description = d.description.trim();
224
+ if (d.instructions !== was.instructions)
225
+ out.instructions = d.instructions;
226
+ if (d.tools.join('\n') !== was.tools.join('\n'))
227
+ out.tools = d.tools;
228
+ if (micros(d.cap) !== was.cap)
229
+ out.cap_micro_usd = micros(d.cap);
230
+ if (micros(d.task) !== was.task)
231
+ out.max_task_micro_usd = micros(d.task);
232
+ if (d.period !== was.period)
233
+ out.period = d.period;
234
+ if ((d.executionMode ?? '') !== (was.executionMode ?? '') && d.executionMode)
235
+ out.executionMode = d.executionMode;
236
+ if ((d.schedule ?? '').trim() !== (was.schedule ?? ''))
237
+ out.schedule = (d.schedule ?? '').trim();
238
+ if ((d.triggers ?? []).join('\n') !== (was.triggers ?? []).join('\n'))
239
+ out.triggers = d.triggers ?? [];
240
+ return out;
241
+ }
242
+ export async function update(t, was, d) {
243
+ const why = refuse({ ...d, name: was.name });
244
+ if (why)
245
+ throw new Error(why);
246
+ const body = changes(was, d);
247
+ if (!Object.keys(body).length)
248
+ return was;
249
+ return agent(await call(t, 'PATCH', `/v1/agent/${seg(was.id || was.name)}`, body));
250
+ }
251
+ export async function remove(t, ref) {
252
+ await call(t, 'DELETE', `/v1/agent/${seg(ref)}`);
253
+ }
@@ -0,0 +1,166 @@
1
+ import type { Say } from '@hanzo/i18n/react';
2
+ import { type Target } from './call.ts';
3
+ import { type Source } from './library.ts';
4
+ export type { Source };
5
+ export type Kind = 'manual' | 'once' | 'hourly' | 'daily' | 'weekdays' | 'weekly' | 'cron';
6
+ export type Permissions = 'ask' | 'auto';
7
+ /** When it runs, in the person's own words and zone. */
8
+ export interface Schedule {
9
+ kind: Kind;
10
+ /** HH:MM, 24-hour, for daily, weekdays and weekly; 00:MM for hourly; YYYY-MM-DDTHH:MM for once, absent to run now. */
11
+ at?: string;
12
+ /** mon … sun, for weekly. */
13
+ day?: string;
14
+ /** Five fields, for cron. */
15
+ cron?: string;
16
+ /** An IANA zone; the platform reads an absent one as UTC. */
17
+ tz?: string;
18
+ }
19
+ /** What an automation is: what the editor holds and the platform keeps. */
20
+ export interface Draft {
21
+ name: string;
22
+ instructions: string;
23
+ /** A model id, or null for Enso, the default. */
24
+ model: string | null;
25
+ schedule: Schedule;
26
+ permissions: Permissions;
27
+ notify: boolean;
28
+ /** The connected accounts each run's answer is posted to: x, linkedin, facebook. */
29
+ postTo: string[];
30
+ enabled: boolean;
31
+ /** The product that made it: chat, dev, studio or workflow. */
32
+ source: Source;
33
+ }
34
+ export interface Last {
35
+ id: string;
36
+ status: string;
37
+ at: string;
38
+ summary: string;
39
+ }
40
+ export interface Automation extends Draft {
41
+ id: string;
42
+ project: string | null;
43
+ /** Named and not yet told what to do: it never runs until its instructions are saved. */
44
+ draft: boolean;
45
+ /** When it runs next, RFC 3339, or null when it runs only when asked or is off. */
46
+ next: string | null;
47
+ last: Last | null;
48
+ created: string;
49
+ updated: string;
50
+ }
51
+ /** Where one post went: its link, or the platform's reason it did not go. */
52
+ export interface Posted {
53
+ to: string;
54
+ url: string;
55
+ error: string;
56
+ }
57
+ /** One run: succeeded, failed, running, queued, review (a post waiting for you), skipped or refused. */
58
+ export interface Run {
59
+ id: string;
60
+ status: string;
61
+ at: string;
62
+ finished: string | null;
63
+ summary: string;
64
+ /** The Dev run it started, or null when it started none. */
65
+ session: string | null;
66
+ /** The post its agent wrote, for an automation that posts. */
67
+ draft: string;
68
+ posts: Posted[];
69
+ /** The Library items it made. */
70
+ outputs: string[];
71
+ }
72
+ /** One automation as the platform answers it, or null for a row with no id. */
73
+ export declare function read(raw: unknown): Automation | null;
74
+ export declare function automations(t: Target): Promise<Automation[]>;
75
+ export declare function automation(t: Target, id: string): Promise<Automation>;
76
+ export declare function create(t: Target, d: Draft): Promise<Automation>;
77
+ /** What changed between two drafts, field by field: what a save sends. */
78
+ export declare function changes(was: Draft, now: Draft): Partial<Draft>;
79
+ /** Change an automation. A change to anything but `enabled` makes the caller the person it runs as. */
80
+ export declare function save(t: Target, id: string, change: Partial<Draft>): Promise<Automation>;
81
+ export declare function remove(t: Target, id: string): Promise<void>;
82
+ /** Start one run now. While one is going, the platform records this start as skipped. */
83
+ export declare function start(t: Target, id: string): Promise<{
84
+ id: string;
85
+ status: string;
86
+ }>;
87
+ export declare function runs(t: Target, id: string): Promise<Run[]>;
88
+ /** Post a held post to the automation's accounts, or discard it. */
89
+ export declare function review(t: Target, id: string, runId: string, post: boolean): Promise<Run>;
90
+ /** A schedule the way a person says it, in the words of the `t` handed (English without one). */
91
+ export declare function words(s: Schedule, t?: Say): string;
92
+ /** A ready-made automation to start a new one from. Its schedule names no zone: the page fills in the person's. */
93
+ export interface Starter {
94
+ key: string;
95
+ name: string;
96
+ description: string;
97
+ instructions: string;
98
+ schedule: Schedule;
99
+ }
100
+ /** The starters, from GET /v1/auto/templates. */
101
+ export declare function starters(t: Target): Promise<Starter[]>;
102
+ /** What a person's words mean as a schedule: the schedule, how the platform says it back, and its next run. */
103
+ export interface Parsed {
104
+ schedule: Schedule;
105
+ says: string;
106
+ /** RFC 3339, or null for one that runs only when asked. */
107
+ next: string | null;
108
+ }
109
+ /** A schedule from a person's own words ("every monday at 9am"), read in `tz`. */
110
+ export declare function cron(t: Target, text: string, tz: string, init?: {
111
+ signal?: AbortSignal;
112
+ }): Promise<Parsed>;
113
+ /** What a job is doing, in the five words every product shares. */
114
+ export type State = 'scheduled' | 'running' | 'succeeded' | 'failed' | 'cancelled';
115
+ export declare const STATES: readonly State[];
116
+ /** One run of anything that runs without its person watching. */
117
+ export interface Job {
118
+ id: string;
119
+ product: Source;
120
+ kind: string;
121
+ title: string;
122
+ state: State;
123
+ /** The product's own word for it: queued, review, skipped… */
124
+ status: string;
125
+ /** 0 to 1, or null when the product does not say. */
126
+ progress: number | null;
127
+ automation: string | null;
128
+ /** The Dev run it started, whose transcript is its log. */
129
+ session: string | null;
130
+ ref: string;
131
+ origin: string;
132
+ summary: string;
133
+ error: string;
134
+ /** The Library items it made. */
135
+ outputs: string[];
136
+ /** Cents, or null while unknown. */
137
+ cost: number | null;
138
+ started: string;
139
+ finished: string | null;
140
+ updated: string;
141
+ }
142
+ /** One job as the platform answers it, or null for a row with no id. */
143
+ export declare function job(raw: unknown): Job | null;
144
+ export interface JobFilter {
145
+ product?: Source | '';
146
+ state?: State | '';
147
+ limit?: number;
148
+ }
149
+ export declare function jobs(t: Target, f?: JobFilter): Promise<Job[]>;
150
+ export declare function one(t: Target, id: string): Promise<Job>;
151
+ /** What the events stream says: a job or an automation, as it stands now. */
152
+ export type Heard = {
153
+ kind: 'job';
154
+ job: Job;
155
+ } | {
156
+ kind: 'automation';
157
+ automation: Automation;
158
+ };
159
+ /** One frame of /v1/auto/events, or null for one this page does not read. */
160
+ export declare function heard(event: string, data: string): Heard | null;
161
+ /**
162
+ * Read /v1/auto/events until `signal` ends it or the stream closes, calling `on`
163
+ * for each job and automation it names. A fetch, because EventSource cannot
164
+ * carry the bearer.
165
+ */
166
+ export declare function events(t: Target, on: (h: Heard) => void, signal: AbortSignal, opened?: () => void): Promise<void>;