@agentuity/core 1.0.33 → 1.0.34

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 (1112) hide show
  1. package/dist/index.d.ts +2 -17
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +2 -15
  4. package/dist/index.js.map +1 -1
  5. package/dist/services/adapter.d.ts +57 -22
  6. package/dist/services/adapter.d.ts.map +1 -1
  7. package/dist/services/adapter.js +52 -1
  8. package/dist/services/adapter.js.map +1 -1
  9. package/dist/services/api.d.ts +222 -0
  10. package/dist/services/api.d.ts.map +1 -0
  11. package/dist/services/api.js +662 -0
  12. package/dist/services/api.js.map +1 -0
  13. package/dist/services/apikey/create.d.ts +34 -0
  14. package/dist/services/apikey/create.d.ts.map +1 -0
  15. package/dist/services/apikey/create.js +29 -0
  16. package/dist/services/apikey/create.js.map +1 -0
  17. package/dist/services/apikey/delete.d.ts.map +1 -0
  18. package/dist/services/apikey/delete.js.map +1 -0
  19. package/dist/services/apikey/get.d.ts.map +1 -0
  20. package/dist/services/apikey/get.js.map +1 -0
  21. package/dist/services/apikey/index.d.ts.map +1 -0
  22. package/dist/services/apikey/index.js.map +1 -0
  23. package/dist/services/apikey/list.d.ts +65 -0
  24. package/dist/services/apikey/list.d.ts.map +1 -0
  25. package/dist/services/apikey/list.js +50 -0
  26. package/dist/services/apikey/list.js.map +1 -0
  27. package/dist/services/apikey/util.d.ts.map +1 -0
  28. package/dist/services/apikey/util.js.map +1 -0
  29. package/dist/services/config.d.ts +22 -0
  30. package/dist/services/config.d.ts.map +1 -0
  31. package/dist/services/config.js +55 -0
  32. package/dist/services/config.js.map +1 -0
  33. package/dist/services/db/index.d.ts.map +1 -0
  34. package/dist/services/db/index.js.map +1 -0
  35. package/dist/services/db/logs.d.ts.map +1 -0
  36. package/dist/services/db/logs.js.map +1 -0
  37. package/dist/services/db/query.d.ts +40 -0
  38. package/dist/services/db/query.d.ts.map +1 -0
  39. package/dist/services/db/query.js +55 -0
  40. package/dist/services/db/query.js.map +1 -0
  41. package/dist/services/db/tables.d.ts +50 -0
  42. package/dist/services/db/tables.d.ts.map +1 -0
  43. package/dist/services/db/tables.js +64 -0
  44. package/dist/services/db/tables.js.map +1 -0
  45. package/dist/services/db/util.d.ts.map +1 -0
  46. package/dist/services/db/util.js.map +1 -0
  47. package/dist/services/email/index.d.ts +2 -0
  48. package/dist/services/email/index.d.ts.map +1 -0
  49. package/dist/services/email/index.js +2 -0
  50. package/dist/services/email/index.js.map +1 -0
  51. package/dist/services/email/service.d.ts +742 -0
  52. package/dist/services/email/service.d.ts.map +1 -0
  53. package/dist/services/email/service.js +1107 -0
  54. package/dist/services/email/service.js.map +1 -0
  55. package/dist/services/env.d.ts.map +1 -0
  56. package/dist/services/env.js.map +1 -0
  57. package/dist/services/eval/events.d.ts +93 -0
  58. package/dist/services/eval/events.d.ts.map +1 -0
  59. package/dist/services/eval/events.js +24 -0
  60. package/dist/services/eval/events.js.map +1 -0
  61. package/dist/services/eval/get.d.ts.map +1 -0
  62. package/dist/services/eval/get.js.map +1 -0
  63. package/dist/services/eval/index.d.ts +6 -0
  64. package/dist/services/eval/index.d.ts.map +1 -0
  65. package/dist/services/eval/index.js +6 -0
  66. package/dist/services/eval/index.js.map +1 -0
  67. package/dist/services/eval/list.d.ts.map +1 -0
  68. package/dist/services/eval/list.js.map +1 -0
  69. package/dist/services/eval/run-get.d.ts.map +1 -0
  70. package/dist/services/eval/run-get.js.map +1 -0
  71. package/dist/services/eval/run-list.d.ts.map +1 -0
  72. package/dist/services/eval/run-list.js.map +1 -0
  73. package/dist/services/exception.d.ts +28 -9
  74. package/dist/services/exception.d.ts.map +1 -1
  75. package/dist/services/exception.js +14 -0
  76. package/dist/services/exception.js.map +1 -1
  77. package/dist/services/index.d.ts +26 -12
  78. package/dist/services/index.d.ts.map +1 -1
  79. package/dist/services/index.js +26 -11
  80. package/dist/services/index.js.map +1 -1
  81. package/dist/services/keyvalue/index.d.ts +2 -0
  82. package/dist/services/keyvalue/index.d.ts.map +1 -0
  83. package/dist/services/keyvalue/index.js +2 -0
  84. package/dist/services/keyvalue/index.js.map +1 -0
  85. package/dist/services/keyvalue/service.d.ts +261 -0
  86. package/dist/services/keyvalue/service.d.ts.map +1 -0
  87. package/dist/services/keyvalue/service.js +475 -0
  88. package/dist/services/keyvalue/service.js.map +1 -0
  89. package/dist/services/logger.d.ts.map +1 -0
  90. package/dist/services/logger.js.map +1 -0
  91. package/dist/services/machine/index.d.ts.map +1 -0
  92. package/dist/services/machine/index.js.map +1 -0
  93. package/dist/services/machine/machine.d.ts.map +1 -0
  94. package/dist/services/machine/machine.js +177 -0
  95. package/dist/services/machine/machine.js.map +1 -0
  96. package/dist/services/machine/util.d.ts.map +1 -0
  97. package/dist/services/machine/util.js.map +1 -0
  98. package/dist/services/org/env-delete.d.ts.map +1 -0
  99. package/dist/services/org/env-delete.js.map +1 -0
  100. package/dist/services/org/env-get.d.ts +33 -0
  101. package/dist/services/org/env-get.d.ts.map +1 -0
  102. package/dist/services/org/env-get.js +33 -0
  103. package/dist/services/org/env-get.js.map +1 -0
  104. package/dist/services/org/env-update.d.ts.map +1 -0
  105. package/dist/services/org/env-update.js.map +1 -0
  106. package/dist/services/org/index.d.ts.map +1 -0
  107. package/dist/services/org/index.js.map +1 -0
  108. package/dist/services/org/list.d.ts.map +1 -0
  109. package/dist/services/org/list.js.map +1 -0
  110. package/dist/services/org/resources.d.ts +150 -0
  111. package/dist/services/org/resources.d.ts.map +1 -0
  112. package/dist/services/org/resources.js +111 -0
  113. package/dist/services/org/resources.js.map +1 -0
  114. package/dist/services/org/util.d.ts.map +1 -0
  115. package/dist/services/org/util.js.map +1 -0
  116. package/dist/services/pagination.d.ts +38 -11
  117. package/dist/services/pagination.d.ts.map +1 -1
  118. package/dist/services/pagination.js +30 -1
  119. package/dist/services/pagination.js.map +1 -1
  120. package/dist/services/project/agent.d.ts.map +1 -0
  121. package/dist/services/project/agent.js.map +1 -0
  122. package/dist/services/project/create.d.ts.map +1 -0
  123. package/dist/services/project/create.js.map +1 -0
  124. package/dist/services/project/delete.d.ts.map +1 -0
  125. package/dist/services/project/delete.js +15 -0
  126. package/dist/services/project/delete.js.map +1 -0
  127. package/dist/services/project/deploy.d.ts +468 -0
  128. package/dist/services/project/deploy.d.ts.map +1 -0
  129. package/dist/services/project/deploy.js.map +1 -0
  130. package/dist/services/project/deployment.d.ts.map +1 -0
  131. package/dist/services/project/deployment.js +180 -0
  132. package/dist/services/project/deployment.js.map +1 -0
  133. package/dist/services/project/env-delete.d.ts.map +1 -0
  134. package/dist/services/project/env-delete.js.map +1 -0
  135. package/dist/services/project/env-update.d.ts.map +1 -0
  136. package/dist/services/project/env-update.js.map +1 -0
  137. package/dist/services/project/exists.d.ts.map +1 -0
  138. package/dist/services/project/exists.js.map +1 -0
  139. package/dist/services/project/get.d.ts.map +1 -0
  140. package/dist/services/project/get.js.map +1 -0
  141. package/dist/services/project/hostname.d.ts.map +1 -0
  142. package/dist/services/project/hostname.js +43 -0
  143. package/dist/services/project/hostname.js.map +1 -0
  144. package/dist/services/project/index.d.ts.map +1 -0
  145. package/dist/services/project/index.js.map +1 -0
  146. package/dist/services/project/list.d.ts.map +1 -0
  147. package/dist/services/project/list.js.map +1 -0
  148. package/dist/services/project/malware.d.ts.map +1 -0
  149. package/dist/services/project/malware.js +57 -0
  150. package/dist/services/project/malware.js.map +1 -0
  151. package/dist/services/project/update-region.d.ts.map +1 -0
  152. package/dist/services/project/update-region.js.map +1 -0
  153. package/dist/services/project/util.d.ts.map +1 -0
  154. package/dist/services/project/util.js.map +1 -0
  155. package/dist/services/queue/analytics.d.ts +261 -0
  156. package/dist/services/queue/analytics.d.ts.map +1 -0
  157. package/dist/services/queue/analytics.js +254 -0
  158. package/dist/services/queue/analytics.js.map +1 -0
  159. package/dist/services/queue/consumers.d.ts +48 -0
  160. package/dist/services/queue/consumers.d.ts.map +1 -0
  161. package/dist/services/queue/consumers.js +43 -0
  162. package/dist/services/queue/consumers.js.map +1 -0
  163. package/dist/services/queue/destinations.d.ts +269 -0
  164. package/dist/services/queue/destinations.d.ts.map +1 -0
  165. package/dist/services/queue/destinations.js +215 -0
  166. package/dist/services/queue/destinations.js.map +1 -0
  167. package/dist/services/queue/dlq.d.ts +170 -0
  168. package/dist/services/queue/dlq.d.ts.map +1 -0
  169. package/dist/services/queue/dlq.js.map +1 -0
  170. package/dist/services/queue/index.d.ts +58 -0
  171. package/dist/services/queue/index.d.ts.map +1 -0
  172. package/dist/services/queue/index.js +98 -0
  173. package/dist/services/queue/index.js.map +1 -0
  174. package/dist/services/queue/messages.d.ts +511 -0
  175. package/dist/services/queue/messages.d.ts.map +1 -0
  176. package/dist/services/queue/messages.js.map +1 -0
  177. package/dist/services/queue/queues.d.ts +228 -0
  178. package/dist/services/queue/queues.d.ts.map +1 -0
  179. package/dist/services/queue/queues.js.map +1 -0
  180. package/dist/services/queue/service.d.ts +309 -0
  181. package/dist/services/queue/service.d.ts.map +1 -0
  182. package/dist/services/queue/service.js +456 -0
  183. package/dist/services/queue/service.js.map +1 -0
  184. package/dist/services/queue/sources.d.ts +252 -0
  185. package/dist/services/queue/sources.d.ts.map +1 -0
  186. package/dist/services/queue/sources.js +249 -0
  187. package/dist/services/queue/sources.js.map +1 -0
  188. package/dist/services/queue/types.d.ts +1335 -0
  189. package/dist/services/queue/types.d.ts.map +1 -0
  190. package/dist/services/queue/types.js +1376 -0
  191. package/dist/services/queue/types.js.map +1 -0
  192. package/dist/services/queue/util.d.ts +278 -0
  193. package/dist/services/queue/util.d.ts.map +1 -0
  194. package/dist/services/queue/util.js +233 -0
  195. package/dist/services/queue/util.js.map +1 -0
  196. package/dist/services/queue/validation.d.ts +218 -0
  197. package/dist/services/queue/validation.d.ts.map +1 -0
  198. package/dist/services/queue/validation.js +498 -0
  199. package/dist/services/queue/validation.js.map +1 -0
  200. package/dist/services/queue/websocket.d.ts +154 -0
  201. package/dist/services/queue/websocket.d.ts.map +1 -0
  202. package/dist/services/queue/websocket.js +472 -0
  203. package/dist/services/queue/websocket.js.map +1 -0
  204. package/dist/services/region/create.d.ts.map +1 -0
  205. package/dist/services/region/create.js.map +1 -0
  206. package/dist/services/region/delete.d.ts.map +1 -0
  207. package/dist/services/region/delete.js.map +1 -0
  208. package/dist/services/region/index.d.ts.map +1 -0
  209. package/dist/services/region/index.js.map +1 -0
  210. package/dist/services/region/list.d.ts.map +1 -0
  211. package/dist/services/region/list.js.map +1 -0
  212. package/dist/services/region/resources.d.ts.map +1 -0
  213. package/dist/services/region/resources.js.map +1 -0
  214. package/dist/services/region/util.d.ts.map +1 -0
  215. package/dist/services/region/util.js.map +1 -0
  216. package/dist/services/sandbox/cli-list.d.ts +103 -0
  217. package/dist/services/sandbox/cli-list.d.ts.map +1 -0
  218. package/dist/services/sandbox/cli-list.js +106 -0
  219. package/dist/services/sandbox/cli-list.js.map +1 -0
  220. package/dist/services/sandbox/client.d.ts +173 -0
  221. package/dist/services/sandbox/client.d.ts.map +1 -0
  222. package/dist/services/sandbox/client.js +302 -0
  223. package/dist/services/sandbox/client.js.map +1 -0
  224. package/dist/services/sandbox/create.d.ts +193 -0
  225. package/dist/services/sandbox/create.d.ts.map +1 -0
  226. package/dist/services/sandbox/create.js +215 -0
  227. package/dist/services/sandbox/create.js.map +1 -0
  228. package/dist/services/sandbox/destroy.d.ts +23 -0
  229. package/dist/services/sandbox/destroy.d.ts.map +1 -0
  230. package/dist/services/sandbox/destroy.js +30 -0
  231. package/dist/services/sandbox/destroy.js.map +1 -0
  232. package/dist/services/sandbox/disk-checkpoint.d.ts +108 -0
  233. package/dist/services/sandbox/disk-checkpoint.d.ts.map +1 -0
  234. package/dist/services/sandbox/disk-checkpoint.js +124 -0
  235. package/dist/services/sandbox/disk-checkpoint.js.map +1 -0
  236. package/dist/services/sandbox/execute.d.ts +96 -0
  237. package/dist/services/sandbox/execute.d.ts.map +1 -0
  238. package/dist/services/sandbox/execute.js +109 -0
  239. package/dist/services/sandbox/execute.js.map +1 -0
  240. package/dist/services/sandbox/execution.d.ts +145 -0
  241. package/dist/services/sandbox/execution.d.ts.map +1 -0
  242. package/dist/services/sandbox/execution.js +113 -0
  243. package/dist/services/sandbox/execution.js.map +1 -0
  244. package/dist/services/sandbox/files.d.ts +269 -0
  245. package/dist/services/sandbox/files.d.ts.map +1 -0
  246. package/dist/services/sandbox/files.js +454 -0
  247. package/dist/services/sandbox/files.js.map +1 -0
  248. package/dist/services/sandbox/get.d.ts +284 -0
  249. package/dist/services/sandbox/get.d.ts.map +1 -0
  250. package/dist/services/sandbox/get.js +231 -0
  251. package/dist/services/sandbox/get.js.map +1 -0
  252. package/dist/services/sandbox/getStatus.d.ts +20 -0
  253. package/dist/services/sandbox/getStatus.d.ts.map +1 -0
  254. package/dist/services/sandbox/getStatus.js +36 -0
  255. package/dist/services/sandbox/getStatus.js.map +1 -0
  256. package/dist/services/sandbox/index.d.ts +40 -0
  257. package/dist/services/sandbox/index.d.ts.map +1 -0
  258. package/dist/services/sandbox/index.js +21 -0
  259. package/dist/services/sandbox/index.js.map +1 -0
  260. package/dist/services/sandbox/list.d.ts +327 -0
  261. package/dist/services/sandbox/list.d.ts.map +1 -0
  262. package/dist/services/sandbox/list.js +204 -0
  263. package/dist/services/sandbox/list.js.map +1 -0
  264. package/dist/services/sandbox/pause.d.ts +23 -0
  265. package/dist/services/sandbox/pause.d.ts.map +1 -0
  266. package/dist/services/sandbox/pause.js +30 -0
  267. package/dist/services/sandbox/pause.js.map +1 -0
  268. package/dist/services/sandbox/resolve.d.ts +75 -0
  269. package/dist/services/sandbox/resolve.d.ts.map +1 -0
  270. package/dist/services/sandbox/resolve.js +76 -0
  271. package/dist/services/sandbox/resolve.js.map +1 -0
  272. package/dist/services/sandbox/resume.d.ts +23 -0
  273. package/dist/services/sandbox/resume.d.ts.map +1 -0
  274. package/dist/services/sandbox/resume.js +30 -0
  275. package/dist/services/sandbox/resume.js.map +1 -0
  276. package/dist/services/sandbox/run.d.ts +71 -0
  277. package/dist/services/sandbox/run.d.ts.map +1 -0
  278. package/dist/services/sandbox/run.js +355 -0
  279. package/dist/services/sandbox/run.js.map +1 -0
  280. package/dist/services/sandbox/runtime.d.ts +94 -0
  281. package/dist/services/sandbox/runtime.d.ts.map +1 -0
  282. package/dist/services/sandbox/runtime.js +82 -0
  283. package/dist/services/sandbox/runtime.js.map +1 -0
  284. package/dist/services/sandbox/snapshot-build.d.ts.map +1 -0
  285. package/dist/services/sandbox/snapshot-build.js.map +1 -0
  286. package/dist/services/sandbox/snapshot.d.ts +596 -0
  287. package/dist/services/sandbox/snapshot.d.ts.map +1 -0
  288. package/dist/services/sandbox/snapshot.js +612 -0
  289. package/dist/services/sandbox/snapshot.js.map +1 -0
  290. package/dist/services/sandbox/types.d.ts +851 -0
  291. package/dist/services/sandbox/types.d.ts.map +1 -0
  292. package/dist/services/sandbox/types.js +674 -0
  293. package/dist/services/sandbox/types.js.map +1 -0
  294. package/dist/services/sandbox/util.d.ts +295 -0
  295. package/dist/services/sandbox/util.d.ts.map +1 -0
  296. package/dist/services/sandbox/util.js +233 -0
  297. package/dist/services/sandbox/util.js.map +1 -0
  298. package/dist/services/schedule/index.d.ts +2 -0
  299. package/dist/services/schedule/index.d.ts.map +1 -0
  300. package/dist/services/schedule/index.js +2 -0
  301. package/dist/services/schedule/index.js.map +1 -0
  302. package/dist/services/schedule/service.d.ts +439 -0
  303. package/dist/services/schedule/service.d.ts.map +1 -0
  304. package/dist/services/schedule/service.js +701 -0
  305. package/dist/services/schedule/service.js.map +1 -0
  306. package/dist/services/session/events.d.ts +127 -0
  307. package/dist/services/session/events.d.ts.map +1 -0
  308. package/dist/services/session/events.js +42 -0
  309. package/dist/services/session/events.js.map +1 -0
  310. package/dist/services/session/get.d.ts +170 -0
  311. package/dist/services/session/get.d.ts.map +1 -0
  312. package/dist/services/session/get.js.map +1 -0
  313. package/dist/services/session/index.d.ts +5 -0
  314. package/dist/services/session/index.d.ts.map +1 -0
  315. package/dist/services/session/index.js +5 -0
  316. package/dist/services/session/index.js.map +1 -0
  317. package/dist/services/session/list.d.ts +150 -0
  318. package/dist/services/session/list.d.ts.map +1 -0
  319. package/dist/services/session/list.js +117 -0
  320. package/dist/services/session/list.js.map +1 -0
  321. package/dist/services/session/logs.d.ts.map +1 -0
  322. package/dist/services/session/logs.js.map +1 -0
  323. package/dist/services/session/util.d.ts.map +1 -0
  324. package/dist/services/session/util.js.map +1 -0
  325. package/dist/services/stats.d.ts +261 -0
  326. package/dist/services/stats.d.ts.map +1 -0
  327. package/dist/services/stats.js +181 -0
  328. package/dist/services/stats.js.map +1 -0
  329. package/dist/services/storage/config.d.ts.map +1 -0
  330. package/dist/services/storage/config.js.map +1 -0
  331. package/dist/services/storage/index.d.ts.map +1 -0
  332. package/dist/services/storage/index.js.map +1 -0
  333. package/dist/services/storage/objects.d.ts +158 -0
  334. package/dist/services/storage/objects.d.ts.map +1 -0
  335. package/dist/services/storage/objects.js +161 -0
  336. package/dist/services/storage/objects.js.map +1 -0
  337. package/dist/services/storage/types.d.ts.map +1 -0
  338. package/dist/services/storage/types.js.map +1 -0
  339. package/dist/services/storage/util.d.ts.map +1 -0
  340. package/dist/services/storage/util.js.map +1 -0
  341. package/dist/services/stream/get.d.ts.map +1 -0
  342. package/dist/services/stream/get.js.map +1 -0
  343. package/dist/services/stream/index.d.ts +5 -0
  344. package/dist/services/stream/index.d.ts.map +1 -0
  345. package/dist/services/stream/index.js +5 -0
  346. package/dist/services/stream/index.js.map +1 -0
  347. package/dist/services/stream/list.d.ts +96 -0
  348. package/dist/services/stream/list.d.ts.map +1 -0
  349. package/dist/services/stream/list.js +92 -0
  350. package/dist/services/stream/list.js.map +1 -0
  351. package/dist/services/stream/service.d.ts +264 -0
  352. package/dist/services/stream/service.d.ts.map +1 -0
  353. package/dist/services/stream/service.js +631 -0
  354. package/dist/services/stream/service.js.map +1 -0
  355. package/dist/services/stream/util.d.ts.map +1 -0
  356. package/dist/services/stream/util.js.map +1 -0
  357. package/dist/services/task/index.d.ts +2 -0
  358. package/dist/services/task/index.d.ts.map +1 -0
  359. package/dist/services/task/index.js +2 -0
  360. package/dist/services/task/index.js.map +1 -0
  361. package/dist/services/task/service.d.ts +1491 -0
  362. package/dist/services/task/service.d.ts.map +1 -0
  363. package/dist/services/task/service.js +1887 -0
  364. package/dist/services/task/service.js.map +1 -0
  365. package/dist/services/thread/delete.d.ts.map +1 -0
  366. package/dist/services/thread/delete.js.map +1 -0
  367. package/dist/services/thread/get.d.ts.map +1 -0
  368. package/dist/services/thread/get.js.map +1 -0
  369. package/dist/services/thread/index.d.ts.map +1 -0
  370. package/dist/services/thread/index.js.map +1 -0
  371. package/dist/services/thread/list.d.ts +75 -0
  372. package/dist/services/thread/list.d.ts.map +1 -0
  373. package/dist/services/thread/list.js +65 -0
  374. package/dist/services/thread/list.js.map +1 -0
  375. package/dist/services/thread/util.d.ts.map +1 -0
  376. package/dist/services/thread/util.js.map +1 -0
  377. package/dist/services/user/index.d.ts.map +1 -0
  378. package/dist/services/user/index.js.map +1 -0
  379. package/dist/services/user/util.d.ts.map +1 -0
  380. package/dist/services/user/util.js.map +1 -0
  381. package/dist/services/user/whoami.d.ts.map +1 -0
  382. package/dist/services/user/whoami.js.map +1 -0
  383. package/dist/services/vector/index.d.ts +2 -0
  384. package/dist/services/vector/index.d.ts.map +1 -0
  385. package/dist/services/vector/index.js +2 -0
  386. package/dist/services/vector/index.js.map +1 -0
  387. package/dist/services/vector/service.d.ts +459 -0
  388. package/dist/services/vector/service.d.ts.map +1 -0
  389. package/dist/services/vector/service.js +707 -0
  390. package/dist/services/vector/service.js.map +1 -0
  391. package/dist/services/webhook/deliveries.d.ts +94 -0
  392. package/dist/services/webhook/deliveries.d.ts.map +1 -0
  393. package/dist/services/webhook/deliveries.js.map +1 -0
  394. package/dist/services/webhook/destinations.d.ts.map +1 -0
  395. package/dist/services/webhook/destinations.js.map +1 -0
  396. package/dist/services/webhook/index.d.ts +42 -0
  397. package/dist/services/webhook/index.d.ts.map +1 -0
  398. package/dist/services/webhook/index.js +60 -0
  399. package/dist/services/webhook/index.js.map +1 -0
  400. package/dist/services/webhook/receipts.d.ts.map +1 -0
  401. package/dist/services/webhook/receipts.js.map +1 -0
  402. package/dist/services/webhook/service.d.ts +332 -0
  403. package/dist/services/webhook/service.d.ts.map +1 -0
  404. package/dist/services/webhook/service.js +589 -0
  405. package/dist/services/webhook/service.js.map +1 -0
  406. package/dist/services/webhook/types.d.ts +103 -0
  407. package/dist/services/webhook/types.d.ts.map +1 -0
  408. package/dist/services/webhook/types.js +126 -0
  409. package/dist/services/webhook/types.js.map +1 -0
  410. package/dist/services/webhook/util.d.ts.map +1 -0
  411. package/dist/services/webhook/util.js.map +1 -0
  412. package/dist/services/webhook/webhooks.d.ts.map +1 -0
  413. package/dist/services/webhook/webhooks.js.map +1 -0
  414. package/package.json +59 -7
  415. package/src/index.ts +6 -247
  416. package/src/services/adapter.ts +69 -24
  417. package/src/services/api.ts +951 -0
  418. package/src/services/apikey/create.ts +48 -0
  419. package/src/services/apikey/list.ts +66 -0
  420. package/src/services/config.ts +65 -0
  421. package/src/services/db/query.ts +69 -0
  422. package/src/services/db/tables.ts +94 -0
  423. package/src/services/email/index.ts +1 -0
  424. package/src/services/email/service.ts +1476 -0
  425. package/src/services/eval/index.ts +29 -0
  426. package/src/services/exception.ts +16 -7
  427. package/src/services/index.ts +29 -28
  428. package/src/services/keyvalue/index.ts +1 -0
  429. package/src/services/keyvalue/service.ts +677 -0
  430. package/src/services/machine/machine.ts +228 -0
  431. package/src/services/org/env-get.ts +48 -0
  432. package/src/services/org/resources.ts +140 -0
  433. package/src/services/pagination.ts +40 -11
  434. package/src/services/project/delete.ts +27 -0
  435. package/src/services/project/deploy.ts +433 -0
  436. package/src/services/project/deployment.ts +250 -0
  437. package/src/services/project/hostname.ts +79 -0
  438. package/src/services/project/malware.ts +85 -0
  439. package/src/services/queue/analytics.ts +343 -0
  440. package/src/services/queue/consumers.ts +56 -0
  441. package/src/services/queue/destinations.ts +329 -0
  442. package/src/services/queue/index.ts +339 -0
  443. package/src/services/queue/service.ts +634 -0
  444. package/src/services/queue/sources.ts +364 -0
  445. package/src/services/queue/types.ts +1656 -0
  446. package/src/services/queue/util.ts +275 -0
  447. package/src/services/queue/validation.ts +541 -0
  448. package/src/services/queue/websocket.ts +554 -0
  449. package/src/services/sandbox/cli-list.ts +117 -0
  450. package/src/services/sandbox/client.ts +435 -0
  451. package/src/services/sandbox/create.ts +249 -0
  452. package/src/services/sandbox/destroy.ts +43 -0
  453. package/src/services/sandbox/disk-checkpoint.ts +184 -0
  454. package/src/services/sandbox/execute.ts +134 -0
  455. package/src/services/sandbox/execution.ts +144 -0
  456. package/src/services/sandbox/files.ts +608 -0
  457. package/src/services/sandbox/get.ts +262 -0
  458. package/src/services/sandbox/getStatus.ts +51 -0
  459. package/src/services/sandbox/index.ts +230 -0
  460. package/src/services/sandbox/list.ts +234 -0
  461. package/src/services/sandbox/pause.ts +41 -0
  462. package/src/services/sandbox/resolve.ts +96 -0
  463. package/src/services/sandbox/resume.ts +41 -0
  464. package/src/services/sandbox/run.ts +441 -0
  465. package/src/services/sandbox/runtime.ts +106 -0
  466. package/src/services/sandbox/snapshot.ts +791 -0
  467. package/src/services/sandbox/types.ts +799 -0
  468. package/src/services/sandbox/util.ts +279 -0
  469. package/src/services/schedule/index.ts +1 -0
  470. package/src/services/schedule/service.ts +814 -0
  471. package/src/services/session/get.ts +108 -0
  472. package/src/services/session/index.ts +4 -0
  473. package/src/services/session/list.ts +143 -0
  474. package/src/services/stats.ts +232 -0
  475. package/src/services/storage/objects.ts +256 -0
  476. package/src/services/stream/index.ts +14 -0
  477. package/src/services/stream/list.ts +105 -0
  478. package/src/services/stream/service.ts +929 -0
  479. package/src/services/task/index.ts +1 -0
  480. package/src/services/task/service.ts +2573 -0
  481. package/src/services/thread/list.ts +81 -0
  482. package/src/services/vector/index.ts +1 -0
  483. package/src/services/vector/service.ts +1242 -0
  484. package/src/services/webhook/index.ts +135 -0
  485. package/src/services/webhook/service.ts +776 -0
  486. package/src/services/webhook/types.ts +185 -0
  487. package/dist/api/api.d.ts +0 -226
  488. package/dist/api/api.d.ts.map +0 -1
  489. package/dist/api/api.js +0 -635
  490. package/dist/api/api.js.map +0 -1
  491. package/dist/api/apikey/create.d.ts +0 -33
  492. package/dist/api/apikey/create.d.ts.map +0 -1
  493. package/dist/api/apikey/create.js +0 -23
  494. package/dist/api/apikey/create.js.map +0 -1
  495. package/dist/api/apikey/delete.d.ts.map +0 -1
  496. package/dist/api/apikey/delete.js.map +0 -1
  497. package/dist/api/apikey/get.d.ts.map +0 -1
  498. package/dist/api/apikey/get.js.map +0 -1
  499. package/dist/api/apikey/index.d.ts.map +0 -1
  500. package/dist/api/apikey/index.js.map +0 -1
  501. package/dist/api/apikey/list.d.ts +0 -64
  502. package/dist/api/apikey/list.d.ts.map +0 -1
  503. package/dist/api/apikey/list.js +0 -46
  504. package/dist/api/apikey/list.js.map +0 -1
  505. package/dist/api/apikey/util.d.ts.map +0 -1
  506. package/dist/api/apikey/util.js.map +0 -1
  507. package/dist/api/config.d.ts +0 -20
  508. package/dist/api/config.d.ts.map +0 -1
  509. package/dist/api/config.js +0 -43
  510. package/dist/api/config.js.map +0 -1
  511. package/dist/api/db/index.d.ts.map +0 -1
  512. package/dist/api/db/index.js.map +0 -1
  513. package/dist/api/db/logs.d.ts.map +0 -1
  514. package/dist/api/db/logs.js.map +0 -1
  515. package/dist/api/db/query.d.ts +0 -39
  516. package/dist/api/db/query.d.ts.map +0 -1
  517. package/dist/api/db/query.js +0 -49
  518. package/dist/api/db/query.js.map +0 -1
  519. package/dist/api/db/tables.d.ts +0 -49
  520. package/dist/api/db/tables.d.ts.map +0 -1
  521. package/dist/api/db/tables.js +0 -59
  522. package/dist/api/db/tables.js.map +0 -1
  523. package/dist/api/db/util.d.ts.map +0 -1
  524. package/dist/api/db/util.js.map +0 -1
  525. package/dist/api/env.d.ts.map +0 -1
  526. package/dist/api/env.js.map +0 -1
  527. package/dist/api/eval/get.d.ts.map +0 -1
  528. package/dist/api/eval/get.js.map +0 -1
  529. package/dist/api/eval/index.d.ts +0 -5
  530. package/dist/api/eval/index.d.ts.map +0 -1
  531. package/dist/api/eval/index.js +0 -5
  532. package/dist/api/eval/index.js.map +0 -1
  533. package/dist/api/eval/list.d.ts.map +0 -1
  534. package/dist/api/eval/list.js.map +0 -1
  535. package/dist/api/eval/run-get.d.ts.map +0 -1
  536. package/dist/api/eval/run-get.js.map +0 -1
  537. package/dist/api/eval/run-list.d.ts.map +0 -1
  538. package/dist/api/eval/run-list.js.map +0 -1
  539. package/dist/api/index.d.ts +0 -21
  540. package/dist/api/index.d.ts.map +0 -1
  541. package/dist/api/index.js +0 -21
  542. package/dist/api/index.js.map +0 -1
  543. package/dist/api/logger.d.ts.map +0 -1
  544. package/dist/api/logger.js.map +0 -1
  545. package/dist/api/machine/index.d.ts.map +0 -1
  546. package/dist/api/machine/index.js.map +0 -1
  547. package/dist/api/machine/machine.d.ts.map +0 -1
  548. package/dist/api/machine/machine.js +0 -109
  549. package/dist/api/machine/machine.js.map +0 -1
  550. package/dist/api/machine/util.d.ts.map +0 -1
  551. package/dist/api/machine/util.js.map +0 -1
  552. package/dist/api/org/env-delete.d.ts.map +0 -1
  553. package/dist/api/org/env-delete.js.map +0 -1
  554. package/dist/api/org/env-get.d.ts +0 -33
  555. package/dist/api/org/env-get.d.ts.map +0 -1
  556. package/dist/api/org/env-get.js +0 -26
  557. package/dist/api/org/env-get.js.map +0 -1
  558. package/dist/api/org/env-update.d.ts.map +0 -1
  559. package/dist/api/org/env-update.js.map +0 -1
  560. package/dist/api/org/index.d.ts.map +0 -1
  561. package/dist/api/org/index.js.map +0 -1
  562. package/dist/api/org/list.d.ts.map +0 -1
  563. package/dist/api/org/list.js.map +0 -1
  564. package/dist/api/org/resources.d.ts +0 -141
  565. package/dist/api/org/resources.d.ts.map +0 -1
  566. package/dist/api/org/resources.js +0 -97
  567. package/dist/api/org/resources.js.map +0 -1
  568. package/dist/api/org/util.d.ts.map +0 -1
  569. package/dist/api/org/util.js.map +0 -1
  570. package/dist/api/project/agent.d.ts.map +0 -1
  571. package/dist/api/project/agent.js.map +0 -1
  572. package/dist/api/project/create.d.ts.map +0 -1
  573. package/dist/api/project/create.js.map +0 -1
  574. package/dist/api/project/delete.d.ts.map +0 -1
  575. package/dist/api/project/delete.js +0 -13
  576. package/dist/api/project/delete.js.map +0 -1
  577. package/dist/api/project/deploy.d.ts +0 -490
  578. package/dist/api/project/deploy.d.ts.map +0 -1
  579. package/dist/api/project/deploy.js.map +0 -1
  580. package/dist/api/project/deployment.d.ts.map +0 -1
  581. package/dist/api/project/deployment.js +0 -127
  582. package/dist/api/project/deployment.js.map +0 -1
  583. package/dist/api/project/env-delete.d.ts.map +0 -1
  584. package/dist/api/project/env-delete.js.map +0 -1
  585. package/dist/api/project/env-update.d.ts.map +0 -1
  586. package/dist/api/project/env-update.js.map +0 -1
  587. package/dist/api/project/exists.d.ts.map +0 -1
  588. package/dist/api/project/exists.js.map +0 -1
  589. package/dist/api/project/get.d.ts.map +0 -1
  590. package/dist/api/project/get.js.map +0 -1
  591. package/dist/api/project/hostname.d.ts.map +0 -1
  592. package/dist/api/project/hostname.js +0 -37
  593. package/dist/api/project/hostname.js.map +0 -1
  594. package/dist/api/project/index.d.ts.map +0 -1
  595. package/dist/api/project/index.js.map +0 -1
  596. package/dist/api/project/list.d.ts.map +0 -1
  597. package/dist/api/project/list.js.map +0 -1
  598. package/dist/api/project/malware.d.ts.map +0 -1
  599. package/dist/api/project/malware.js +0 -42
  600. package/dist/api/project/malware.js.map +0 -1
  601. package/dist/api/project/update-region.d.ts.map +0 -1
  602. package/dist/api/project/update-region.js.map +0 -1
  603. package/dist/api/project/util.d.ts.map +0 -1
  604. package/dist/api/project/util.js.map +0 -1
  605. package/dist/api/queue/analytics.d.ts +0 -250
  606. package/dist/api/queue/analytics.d.ts.map +0 -1
  607. package/dist/api/queue/analytics.js +0 -233
  608. package/dist/api/queue/analytics.js.map +0 -1
  609. package/dist/api/queue/destinations.d.ts +0 -202
  610. package/dist/api/queue/destinations.d.ts.map +0 -1
  611. package/dist/api/queue/destinations.js +0 -168
  612. package/dist/api/queue/destinations.js.map +0 -1
  613. package/dist/api/queue/dlq.d.ts +0 -168
  614. package/dist/api/queue/dlq.d.ts.map +0 -1
  615. package/dist/api/queue/dlq.js.map +0 -1
  616. package/dist/api/queue/index.d.ts +0 -56
  617. package/dist/api/queue/index.d.ts.map +0 -1
  618. package/dist/api/queue/index.js +0 -90
  619. package/dist/api/queue/index.js.map +0 -1
  620. package/dist/api/queue/messages.d.ts +0 -503
  621. package/dist/api/queue/messages.d.ts.map +0 -1
  622. package/dist/api/queue/messages.js.map +0 -1
  623. package/dist/api/queue/queues.d.ts +0 -226
  624. package/dist/api/queue/queues.d.ts.map +0 -1
  625. package/dist/api/queue/queues.js.map +0 -1
  626. package/dist/api/queue/sources.d.ts +0 -202
  627. package/dist/api/queue/sources.d.ts.map +0 -1
  628. package/dist/api/queue/sources.js +0 -202
  629. package/dist/api/queue/sources.js.map +0 -1
  630. package/dist/api/queue/types.d.ts +0 -1218
  631. package/dist/api/queue/types.d.ts.map +0 -1
  632. package/dist/api/queue/types.js +0 -1002
  633. package/dist/api/queue/types.js.map +0 -1
  634. package/dist/api/queue/util.d.ts +0 -278
  635. package/dist/api/queue/util.d.ts.map +0 -1
  636. package/dist/api/queue/util.js +0 -233
  637. package/dist/api/queue/util.js.map +0 -1
  638. package/dist/api/queue/validation.d.ts +0 -247
  639. package/dist/api/queue/validation.d.ts.map +0 -1
  640. package/dist/api/queue/validation.js +0 -513
  641. package/dist/api/queue/validation.js.map +0 -1
  642. package/dist/api/queue/websocket.d.ts +0 -172
  643. package/dist/api/queue/websocket.d.ts.map +0 -1
  644. package/dist/api/queue/websocket.js +0 -396
  645. package/dist/api/queue/websocket.js.map +0 -1
  646. package/dist/api/region/create.d.ts.map +0 -1
  647. package/dist/api/region/create.js.map +0 -1
  648. package/dist/api/region/delete.d.ts.map +0 -1
  649. package/dist/api/region/delete.js.map +0 -1
  650. package/dist/api/region/index.d.ts.map +0 -1
  651. package/dist/api/region/index.js.map +0 -1
  652. package/dist/api/region/list.d.ts.map +0 -1
  653. package/dist/api/region/list.js.map +0 -1
  654. package/dist/api/region/resources.d.ts.map +0 -1
  655. package/dist/api/region/resources.js.map +0 -1
  656. package/dist/api/region/util.d.ts.map +0 -1
  657. package/dist/api/region/util.js.map +0 -1
  658. package/dist/api/sandbox/cli-list.d.ts +0 -114
  659. package/dist/api/sandbox/cli-list.d.ts.map +0 -1
  660. package/dist/api/sandbox/cli-list.js +0 -71
  661. package/dist/api/sandbox/cli-list.js.map +0 -1
  662. package/dist/api/sandbox/client.d.ts +0 -192
  663. package/dist/api/sandbox/client.d.ts.map +0 -1
  664. package/dist/api/sandbox/client.js +0 -262
  665. package/dist/api/sandbox/client.js.map +0 -1
  666. package/dist/api/sandbox/create.d.ts +0 -118
  667. package/dist/api/sandbox/create.d.ts.map +0 -1
  668. package/dist/api/sandbox/create.js +0 -211
  669. package/dist/api/sandbox/create.js.map +0 -1
  670. package/dist/api/sandbox/destroy.d.ts +0 -22
  671. package/dist/api/sandbox/destroy.d.ts.map +0 -1
  672. package/dist/api/sandbox/destroy.js +0 -25
  673. package/dist/api/sandbox/destroy.js.map +0 -1
  674. package/dist/api/sandbox/disk-checkpoint.d.ts +0 -104
  675. package/dist/api/sandbox/disk-checkpoint.d.ts.map +0 -1
  676. package/dist/api/sandbox/disk-checkpoint.js +0 -104
  677. package/dist/api/sandbox/disk-checkpoint.js.map +0 -1
  678. package/dist/api/sandbox/execute.d.ts +0 -69
  679. package/dist/api/sandbox/execute.d.ts.map +0 -1
  680. package/dist/api/sandbox/execute.js +0 -103
  681. package/dist/api/sandbox/execute.js.map +0 -1
  682. package/dist/api/sandbox/execution.d.ts +0 -169
  683. package/dist/api/sandbox/execution.d.ts.map +0 -1
  684. package/dist/api/sandbox/execution.js +0 -118
  685. package/dist/api/sandbox/execution.js.map +0 -1
  686. package/dist/api/sandbox/files.d.ts +0 -261
  687. package/dist/api/sandbox/files.d.ts.map +0 -1
  688. package/dist/api/sandbox/files.js +0 -386
  689. package/dist/api/sandbox/files.js.map +0 -1
  690. package/dist/api/sandbox/get.d.ts +0 -283
  691. package/dist/api/sandbox/get.d.ts.map +0 -1
  692. package/dist/api/sandbox/get.js +0 -215
  693. package/dist/api/sandbox/get.js.map +0 -1
  694. package/dist/api/sandbox/getStatus.d.ts +0 -16
  695. package/dist/api/sandbox/getStatus.d.ts.map +0 -1
  696. package/dist/api/sandbox/getStatus.js +0 -32
  697. package/dist/api/sandbox/getStatus.js.map +0 -1
  698. package/dist/api/sandbox/index.d.ts +0 -39
  699. package/dist/api/sandbox/index.d.ts.map +0 -1
  700. package/dist/api/sandbox/index.js +0 -20
  701. package/dist/api/sandbox/index.js.map +0 -1
  702. package/dist/api/sandbox/list.d.ts +0 -293
  703. package/dist/api/sandbox/list.d.ts.map +0 -1
  704. package/dist/api/sandbox/list.js +0 -191
  705. package/dist/api/sandbox/list.js.map +0 -1
  706. package/dist/api/sandbox/pause.d.ts +0 -22
  707. package/dist/api/sandbox/pause.d.ts.map +0 -1
  708. package/dist/api/sandbox/pause.js +0 -25
  709. package/dist/api/sandbox/pause.js.map +0 -1
  710. package/dist/api/sandbox/resolve.d.ts +0 -82
  711. package/dist/api/sandbox/resolve.d.ts.map +0 -1
  712. package/dist/api/sandbox/resolve.js +0 -71
  713. package/dist/api/sandbox/resolve.js.map +0 -1
  714. package/dist/api/sandbox/resume.d.ts +0 -22
  715. package/dist/api/sandbox/resume.d.ts.map +0 -1
  716. package/dist/api/sandbox/resume.js +0 -25
  717. package/dist/api/sandbox/resume.js.map +0 -1
  718. package/dist/api/sandbox/run.d.ts +0 -28
  719. package/dist/api/sandbox/run.d.ts.map +0 -1
  720. package/dist/api/sandbox/run.js +0 -342
  721. package/dist/api/sandbox/run.js.map +0 -1
  722. package/dist/api/sandbox/runtime.d.ts +0 -83
  723. package/dist/api/sandbox/runtime.d.ts.map +0 -1
  724. package/dist/api/sandbox/runtime.js +0 -78
  725. package/dist/api/sandbox/runtime.js.map +0 -1
  726. package/dist/api/sandbox/snapshot-build.d.ts.map +0 -1
  727. package/dist/api/sandbox/snapshot-build.js.map +0 -1
  728. package/dist/api/sandbox/snapshot.d.ts +0 -595
  729. package/dist/api/sandbox/snapshot.d.ts.map +0 -1
  730. package/dist/api/sandbox/snapshot.js +0 -598
  731. package/dist/api/sandbox/snapshot.js.map +0 -1
  732. package/dist/api/sandbox/util.d.ts +0 -284
  733. package/dist/api/sandbox/util.d.ts.map +0 -1
  734. package/dist/api/sandbox/util.js +0 -210
  735. package/dist/api/sandbox/util.js.map +0 -1
  736. package/dist/api/services/index.d.ts +0 -2
  737. package/dist/api/services/index.d.ts.map +0 -1
  738. package/dist/api/services/index.js +0 -2
  739. package/dist/api/services/index.js.map +0 -1
  740. package/dist/api/services/stats.d.ts +0 -263
  741. package/dist/api/services/stats.d.ts.map +0 -1
  742. package/dist/api/services/stats.js +0 -144
  743. package/dist/api/services/stats.js.map +0 -1
  744. package/dist/api/session/get.d.ts +0 -169
  745. package/dist/api/session/get.d.ts.map +0 -1
  746. package/dist/api/session/get.js.map +0 -1
  747. package/dist/api/session/index.d.ts +0 -4
  748. package/dist/api/session/index.d.ts.map +0 -1
  749. package/dist/api/session/index.js +0 -4
  750. package/dist/api/session/index.js.map +0 -1
  751. package/dist/api/session/list.d.ts +0 -143
  752. package/dist/api/session/list.d.ts.map +0 -1
  753. package/dist/api/session/list.js +0 -91
  754. package/dist/api/session/list.js.map +0 -1
  755. package/dist/api/session/logs.d.ts.map +0 -1
  756. package/dist/api/session/logs.js.map +0 -1
  757. package/dist/api/session/util.d.ts.map +0 -1
  758. package/dist/api/session/util.js.map +0 -1
  759. package/dist/api/storage/config.d.ts.map +0 -1
  760. package/dist/api/storage/config.js.map +0 -1
  761. package/dist/api/storage/index.d.ts.map +0 -1
  762. package/dist/api/storage/index.js.map +0 -1
  763. package/dist/api/storage/objects.d.ts +0 -155
  764. package/dist/api/storage/objects.d.ts.map +0 -1
  765. package/dist/api/storage/objects.js +0 -148
  766. package/dist/api/storage/objects.js.map +0 -1
  767. package/dist/api/storage/types.d.ts.map +0 -1
  768. package/dist/api/storage/types.js.map +0 -1
  769. package/dist/api/storage/util.d.ts.map +0 -1
  770. package/dist/api/storage/util.js.map +0 -1
  771. package/dist/api/stream/get.d.ts.map +0 -1
  772. package/dist/api/stream/get.js.map +0 -1
  773. package/dist/api/stream/index.d.ts +0 -4
  774. package/dist/api/stream/index.d.ts.map +0 -1
  775. package/dist/api/stream/index.js +0 -4
  776. package/dist/api/stream/index.js.map +0 -1
  777. package/dist/api/stream/list.d.ts +0 -120
  778. package/dist/api/stream/list.d.ts.map +0 -1
  779. package/dist/api/stream/list.js +0 -77
  780. package/dist/api/stream/list.js.map +0 -1
  781. package/dist/api/stream/util.d.ts.map +0 -1
  782. package/dist/api/stream/util.js.map +0 -1
  783. package/dist/api/thread/delete.d.ts.map +0 -1
  784. package/dist/api/thread/delete.js.map +0 -1
  785. package/dist/api/thread/get.d.ts.map +0 -1
  786. package/dist/api/thread/get.js.map +0 -1
  787. package/dist/api/thread/index.d.ts.map +0 -1
  788. package/dist/api/thread/index.js.map +0 -1
  789. package/dist/api/thread/list.d.ts +0 -69
  790. package/dist/api/thread/list.d.ts.map +0 -1
  791. package/dist/api/thread/list.js +0 -51
  792. package/dist/api/thread/list.js.map +0 -1
  793. package/dist/api/thread/util.d.ts.map +0 -1
  794. package/dist/api/thread/util.js.map +0 -1
  795. package/dist/api/user/index.d.ts.map +0 -1
  796. package/dist/api/user/index.js.map +0 -1
  797. package/dist/api/user/util.d.ts.map +0 -1
  798. package/dist/api/user/util.js.map +0 -1
  799. package/dist/api/user/whoami.d.ts.map +0 -1
  800. package/dist/api/user/whoami.js.map +0 -1
  801. package/dist/api/webhook/deliveries.d.ts +0 -94
  802. package/dist/api/webhook/deliveries.d.ts.map +0 -1
  803. package/dist/api/webhook/deliveries.js.map +0 -1
  804. package/dist/api/webhook/destinations.d.ts.map +0 -1
  805. package/dist/api/webhook/destinations.js.map +0 -1
  806. package/dist/api/webhook/index.d.ts +0 -41
  807. package/dist/api/webhook/index.d.ts.map +0 -1
  808. package/dist/api/webhook/index.js +0 -59
  809. package/dist/api/webhook/index.js.map +0 -1
  810. package/dist/api/webhook/receipts.d.ts.map +0 -1
  811. package/dist/api/webhook/receipts.js.map +0 -1
  812. package/dist/api/webhook/types.d.ts +0 -249
  813. package/dist/api/webhook/types.d.ts.map +0 -1
  814. package/dist/api/webhook/types.js +0 -221
  815. package/dist/api/webhook/types.js.map +0 -1
  816. package/dist/api/webhook/util.d.ts.map +0 -1
  817. package/dist/api/webhook/util.js.map +0 -1
  818. package/dist/api/webhook/webhooks.d.ts.map +0 -1
  819. package/dist/api/webhook/webhooks.js.map +0 -1
  820. package/dist/services/email.d.ts +0 -901
  821. package/dist/services/email.d.ts.map +0 -1
  822. package/dist/services/email.js +0 -722
  823. package/dist/services/email.js.map +0 -1
  824. package/dist/services/evalrun.d.ts +0 -93
  825. package/dist/services/evalrun.d.ts.map +0 -1
  826. package/dist/services/evalrun.js +0 -24
  827. package/dist/services/evalrun.js.map +0 -1
  828. package/dist/services/keyvalue.d.ts +0 -283
  829. package/dist/services/keyvalue.d.ts.map +0 -1
  830. package/dist/services/keyvalue.js +0 -305
  831. package/dist/services/keyvalue.js.map +0 -1
  832. package/dist/services/queue.d.ts +0 -361
  833. package/dist/services/queue.d.ts.map +0 -1
  834. package/dist/services/queue.js +0 -308
  835. package/dist/services/queue.js.map +0 -1
  836. package/dist/services/sandbox.d.ts +0 -1241
  837. package/dist/services/sandbox.d.ts.map +0 -1
  838. package/dist/services/sandbox.js +0 -6
  839. package/dist/services/sandbox.js.map +0 -1
  840. package/dist/services/schedule.d.ts +0 -501
  841. package/dist/services/schedule.d.ts.map +0 -1
  842. package/dist/services/schedule.js +0 -425
  843. package/dist/services/schedule.js.map +0 -1
  844. package/dist/services/session.d.ts +0 -127
  845. package/dist/services/session.d.ts.map +0 -1
  846. package/dist/services/session.js +0 -42
  847. package/dist/services/session.js.map +0 -1
  848. package/dist/services/stream.d.ts +0 -293
  849. package/dist/services/stream.d.ts.map +0 -1
  850. package/dist/services/stream.js +0 -500
  851. package/dist/services/stream.js.map +0 -1
  852. package/dist/services/task.d.ts +0 -1337
  853. package/dist/services/task.d.ts.map +0 -1
  854. package/dist/services/task.js +0 -1397
  855. package/dist/services/task.js.map +0 -1
  856. package/dist/services/vector.d.ts +0 -498
  857. package/dist/services/vector.d.ts.map +0 -1
  858. package/dist/services/vector.js +0 -381
  859. package/dist/services/vector.js.map +0 -1
  860. package/dist/services/webhook.d.ts +0 -454
  861. package/dist/services/webhook.d.ts.map +0 -1
  862. package/dist/services/webhook.js +0 -589
  863. package/dist/services/webhook.js.map +0 -1
  864. package/src/api/api.ts +0 -931
  865. package/src/api/apikey/create.ts +0 -41
  866. package/src/api/apikey/list.ts +0 -64
  867. package/src/api/config.ts +0 -60
  868. package/src/api/db/query.ts +0 -67
  869. package/src/api/db/tables.ts +0 -92
  870. package/src/api/eval/index.ts +0 -28
  871. package/src/api/index.ts +0 -20
  872. package/src/api/machine/machine.ts +0 -160
  873. package/src/api/org/env-get.ts +0 -43
  874. package/src/api/org/resources.ts +0 -140
  875. package/src/api/project/delete.ts +0 -25
  876. package/src/api/project/deploy.ts +0 -458
  877. package/src/api/project/deployment.ts +0 -195
  878. package/src/api/project/hostname.ts +0 -73
  879. package/src/api/project/malware.ts +0 -68
  880. package/src/api/queue/analytics.ts +0 -311
  881. package/src/api/queue/destinations.ts +0 -259
  882. package/src/api/queue/index.ts +0 -308
  883. package/src/api/queue/sources.ts +0 -294
  884. package/src/api/queue/types.ts +0 -1325
  885. package/src/api/queue/util.ts +0 -275
  886. package/src/api/queue/validation.ts +0 -560
  887. package/src/api/queue/websocket.ts +0 -521
  888. package/src/api/sandbox/cli-list.ts +0 -127
  889. package/src/api/sandbox/client.ts +0 -460
  890. package/src/api/sandbox/create.ts +0 -256
  891. package/src/api/sandbox/destroy.ts +0 -41
  892. package/src/api/sandbox/disk-checkpoint.ts +0 -179
  893. package/src/api/sandbox/execute.ts +0 -132
  894. package/src/api/sandbox/execution.ts +0 -183
  895. package/src/api/sandbox/files.ts +0 -596
  896. package/src/api/sandbox/get.ts +0 -249
  897. package/src/api/sandbox/getStatus.ts +0 -54
  898. package/src/api/sandbox/index.ts +0 -211
  899. package/src/api/sandbox/list.ts +0 -224
  900. package/src/api/sandbox/pause.ts +0 -39
  901. package/src/api/sandbox/resolve.ts +0 -98
  902. package/src/api/sandbox/resume.ts +0 -39
  903. package/src/api/sandbox/run.ts +0 -439
  904. package/src/api/sandbox/runtime.ts +0 -104
  905. package/src/api/sandbox/snapshot.ts +0 -781
  906. package/src/api/sandbox/util.ts +0 -275
  907. package/src/api/services/index.ts +0 -1
  908. package/src/api/services/stats.ts +0 -213
  909. package/src/api/session/get.ts +0 -106
  910. package/src/api/session/index.ts +0 -3
  911. package/src/api/session/list.ts +0 -136
  912. package/src/api/storage/objects.ts +0 -250
  913. package/src/api/stream/index.ts +0 -3
  914. package/src/api/stream/list.ts +0 -127
  915. package/src/api/thread/list.ts +0 -76
  916. package/src/api/webhook/index.ts +0 -133
  917. package/src/api/webhook/types.ts +0 -309
  918. package/src/services/email.ts +0 -1410
  919. package/src/services/keyvalue.ts +0 -620
  920. package/src/services/queue.ts +0 -603
  921. package/src/services/sandbox.ts +0 -1466
  922. package/src/services/schedule.ts +0 -763
  923. package/src/services/stream.ts +0 -886
  924. package/src/services/task.ts +0 -2611
  925. package/src/services/vector.ts +0 -1119
  926. package/src/services/webhook.ts +0 -921
  927. /package/dist/{api → services}/apikey/delete.d.ts +0 -0
  928. /package/dist/{api → services}/apikey/delete.js +0 -0
  929. /package/dist/{api → services}/apikey/get.d.ts +0 -0
  930. /package/dist/{api → services}/apikey/get.js +0 -0
  931. /package/dist/{api → services}/apikey/index.d.ts +0 -0
  932. /package/dist/{api → services}/apikey/index.js +0 -0
  933. /package/dist/{api → services}/apikey/util.d.ts +0 -0
  934. /package/dist/{api → services}/apikey/util.js +0 -0
  935. /package/dist/{api → services}/db/index.d.ts +0 -0
  936. /package/dist/{api → services}/db/index.js +0 -0
  937. /package/dist/{api → services}/db/logs.d.ts +0 -0
  938. /package/dist/{api → services}/db/logs.js +0 -0
  939. /package/dist/{api → services}/db/util.d.ts +0 -0
  940. /package/dist/{api → services}/db/util.js +0 -0
  941. /package/dist/{api → services}/env.d.ts +0 -0
  942. /package/dist/{api → services}/env.js +0 -0
  943. /package/dist/{api → services}/eval/get.d.ts +0 -0
  944. /package/dist/{api → services}/eval/get.js +0 -0
  945. /package/dist/{api → services}/eval/list.d.ts +0 -0
  946. /package/dist/{api → services}/eval/list.js +0 -0
  947. /package/dist/{api → services}/eval/run-get.d.ts +0 -0
  948. /package/dist/{api → services}/eval/run-get.js +0 -0
  949. /package/dist/{api → services}/eval/run-list.d.ts +0 -0
  950. /package/dist/{api → services}/eval/run-list.js +0 -0
  951. /package/dist/{api → services}/logger.d.ts +0 -0
  952. /package/dist/{api → services}/logger.js +0 -0
  953. /package/dist/{api → services}/machine/index.d.ts +0 -0
  954. /package/dist/{api → services}/machine/index.js +0 -0
  955. /package/dist/{api → services}/machine/machine.d.ts +0 -0
  956. /package/dist/{api → services}/machine/util.d.ts +0 -0
  957. /package/dist/{api → services}/machine/util.js +0 -0
  958. /package/dist/{api → services}/org/env-delete.d.ts +0 -0
  959. /package/dist/{api → services}/org/env-delete.js +0 -0
  960. /package/dist/{api → services}/org/env-update.d.ts +0 -0
  961. /package/dist/{api → services}/org/env-update.js +0 -0
  962. /package/dist/{api → services}/org/index.d.ts +0 -0
  963. /package/dist/{api → services}/org/index.js +0 -0
  964. /package/dist/{api → services}/org/list.d.ts +0 -0
  965. /package/dist/{api → services}/org/list.js +0 -0
  966. /package/dist/{api → services}/org/util.d.ts +0 -0
  967. /package/dist/{api → services}/org/util.js +0 -0
  968. /package/dist/{api → services}/project/agent.d.ts +0 -0
  969. /package/dist/{api → services}/project/agent.js +0 -0
  970. /package/dist/{api → services}/project/create.d.ts +0 -0
  971. /package/dist/{api → services}/project/create.js +0 -0
  972. /package/dist/{api → services}/project/delete.d.ts +0 -0
  973. /package/dist/{api → services}/project/deploy.js +0 -0
  974. /package/dist/{api → services}/project/deployment.d.ts +0 -0
  975. /package/dist/{api → services}/project/env-delete.d.ts +0 -0
  976. /package/dist/{api → services}/project/env-delete.js +0 -0
  977. /package/dist/{api → services}/project/env-update.d.ts +0 -0
  978. /package/dist/{api → services}/project/env-update.js +0 -0
  979. /package/dist/{api → services}/project/exists.d.ts +0 -0
  980. /package/dist/{api → services}/project/exists.js +0 -0
  981. /package/dist/{api → services}/project/get.d.ts +0 -0
  982. /package/dist/{api → services}/project/get.js +0 -0
  983. /package/dist/{api → services}/project/hostname.d.ts +0 -0
  984. /package/dist/{api → services}/project/index.d.ts +0 -0
  985. /package/dist/{api → services}/project/index.js +0 -0
  986. /package/dist/{api → services}/project/list.d.ts +0 -0
  987. /package/dist/{api → services}/project/list.js +0 -0
  988. /package/dist/{api → services}/project/malware.d.ts +0 -0
  989. /package/dist/{api → services}/project/update-region.d.ts +0 -0
  990. /package/dist/{api → services}/project/update-region.js +0 -0
  991. /package/dist/{api → services}/project/util.d.ts +0 -0
  992. /package/dist/{api → services}/project/util.js +0 -0
  993. /package/dist/{api → services}/queue/dlq.js +0 -0
  994. /package/dist/{api → services}/queue/messages.js +0 -0
  995. /package/dist/{api → services}/queue/queues.js +0 -0
  996. /package/dist/{api → services}/region/create.d.ts +0 -0
  997. /package/dist/{api → services}/region/create.js +0 -0
  998. /package/dist/{api → services}/region/delete.d.ts +0 -0
  999. /package/dist/{api → services}/region/delete.js +0 -0
  1000. /package/dist/{api → services}/region/index.d.ts +0 -0
  1001. /package/dist/{api → services}/region/index.js +0 -0
  1002. /package/dist/{api → services}/region/list.d.ts +0 -0
  1003. /package/dist/{api → services}/region/list.js +0 -0
  1004. /package/dist/{api → services}/region/resources.d.ts +0 -0
  1005. /package/dist/{api → services}/region/resources.js +0 -0
  1006. /package/dist/{api → services}/region/util.d.ts +0 -0
  1007. /package/dist/{api → services}/region/util.js +0 -0
  1008. /package/dist/{api → services}/sandbox/snapshot-build.d.ts +0 -0
  1009. /package/dist/{api → services}/sandbox/snapshot-build.js +0 -0
  1010. /package/dist/{api → services}/session/get.js +0 -0
  1011. /package/dist/{api → services}/session/logs.d.ts +0 -0
  1012. /package/dist/{api → services}/session/logs.js +0 -0
  1013. /package/dist/{api → services}/session/util.d.ts +0 -0
  1014. /package/dist/{api → services}/session/util.js +0 -0
  1015. /package/dist/{api → services}/storage/config.d.ts +0 -0
  1016. /package/dist/{api → services}/storage/config.js +0 -0
  1017. /package/dist/{api → services}/storage/index.d.ts +0 -0
  1018. /package/dist/{api → services}/storage/index.js +0 -0
  1019. /package/dist/{api → services}/storage/types.d.ts +0 -0
  1020. /package/dist/{api → services}/storage/types.js +0 -0
  1021. /package/dist/{api → services}/storage/util.d.ts +0 -0
  1022. /package/dist/{api → services}/storage/util.js +0 -0
  1023. /package/dist/{api → services}/stream/get.d.ts +0 -0
  1024. /package/dist/{api → services}/stream/get.js +0 -0
  1025. /package/dist/{api → services}/stream/util.d.ts +0 -0
  1026. /package/dist/{api → services}/stream/util.js +0 -0
  1027. /package/dist/{api → services}/thread/delete.d.ts +0 -0
  1028. /package/dist/{api → services}/thread/delete.js +0 -0
  1029. /package/dist/{api → services}/thread/get.d.ts +0 -0
  1030. /package/dist/{api → services}/thread/get.js +0 -0
  1031. /package/dist/{api → services}/thread/index.d.ts +0 -0
  1032. /package/dist/{api → services}/thread/index.js +0 -0
  1033. /package/dist/{api → services}/thread/util.d.ts +0 -0
  1034. /package/dist/{api → services}/thread/util.js +0 -0
  1035. /package/dist/{api → services}/user/index.d.ts +0 -0
  1036. /package/dist/{api → services}/user/index.js +0 -0
  1037. /package/dist/{api → services}/user/util.d.ts +0 -0
  1038. /package/dist/{api → services}/user/util.js +0 -0
  1039. /package/dist/{api → services}/user/whoami.d.ts +0 -0
  1040. /package/dist/{api → services}/user/whoami.js +0 -0
  1041. /package/dist/{api → services}/webhook/deliveries.js +0 -0
  1042. /package/dist/{api → services}/webhook/destinations.d.ts +0 -0
  1043. /package/dist/{api → services}/webhook/destinations.js +0 -0
  1044. /package/dist/{api → services}/webhook/receipts.d.ts +0 -0
  1045. /package/dist/{api → services}/webhook/receipts.js +0 -0
  1046. /package/dist/{api → services}/webhook/util.d.ts +0 -0
  1047. /package/dist/{api → services}/webhook/util.js +0 -0
  1048. /package/dist/{api → services}/webhook/webhooks.d.ts +0 -0
  1049. /package/dist/{api → services}/webhook/webhooks.js +0 -0
  1050. /package/src/{api → services}/api-example.md +0 -0
  1051. /package/src/{api → services}/apikey/delete.ts +0 -0
  1052. /package/src/{api → services}/apikey/get.ts +0 -0
  1053. /package/src/{api → services}/apikey/index.ts +0 -0
  1054. /package/src/{api → services}/apikey/util.ts +0 -0
  1055. /package/src/{api → services}/db/index.ts +0 -0
  1056. /package/src/{api → services}/db/logs.ts +0 -0
  1057. /package/src/{api → services}/db/util.ts +0 -0
  1058. /package/src/{api → services}/env.ts +0 -0
  1059. /package/src/services/{evalrun.ts → eval/events.ts} +0 -0
  1060. /package/src/{api → services}/eval/get.ts +0 -0
  1061. /package/src/{api → services}/eval/list.ts +0 -0
  1062. /package/src/{api → services}/eval/run-get.ts +0 -0
  1063. /package/src/{api → services}/eval/run-list.ts +0 -0
  1064. /package/src/{api → services}/logger.ts +0 -0
  1065. /package/src/{api → services}/machine/index.ts +0 -0
  1066. /package/src/{api → services}/machine/util.ts +0 -0
  1067. /package/src/{api → services}/org/env-delete.ts +0 -0
  1068. /package/src/{api → services}/org/env-update.ts +0 -0
  1069. /package/src/{api → services}/org/index.ts +0 -0
  1070. /package/src/{api → services}/org/list.ts +0 -0
  1071. /package/src/{api → services}/org/util.ts +0 -0
  1072. /package/src/{api → services}/project/agent.ts +0 -0
  1073. /package/src/{api → services}/project/create.ts +0 -0
  1074. /package/src/{api → services}/project/env-delete.ts +0 -0
  1075. /package/src/{api → services}/project/env-update.ts +0 -0
  1076. /package/src/{api → services}/project/exists.ts +0 -0
  1077. /package/src/{api → services}/project/get.ts +0 -0
  1078. /package/src/{api → services}/project/index.ts +0 -0
  1079. /package/src/{api → services}/project/list.ts +0 -0
  1080. /package/src/{api → services}/project/update-region.ts +0 -0
  1081. /package/src/{api → services}/project/util.ts +0 -0
  1082. /package/src/{api → services}/queue/dlq.ts +0 -0
  1083. /package/src/{api → services}/queue/messages.ts +0 -0
  1084. /package/src/{api → services}/queue/queues.ts +0 -0
  1085. /package/src/{api → services}/region/create.ts +0 -0
  1086. /package/src/{api → services}/region/delete.ts +0 -0
  1087. /package/src/{api → services}/region/index.ts +0 -0
  1088. /package/src/{api → services}/region/list.ts +0 -0
  1089. /package/src/{api → services}/region/resources.ts +0 -0
  1090. /package/src/{api → services}/region/util.ts +0 -0
  1091. /package/src/{api → services}/sandbox/snapshot-build.ts +0 -0
  1092. /package/src/services/{session.ts → session/events.ts} +0 -0
  1093. /package/src/{api → services}/session/logs.ts +0 -0
  1094. /package/src/{api → services}/session/util.ts +0 -0
  1095. /package/src/{api → services}/storage/config.ts +0 -0
  1096. /package/src/{api → services}/storage/index.ts +0 -0
  1097. /package/src/{api → services}/storage/types.ts +0 -0
  1098. /package/src/{api → services}/storage/util.ts +0 -0
  1099. /package/src/{api → services}/stream/get.ts +0 -0
  1100. /package/src/{api → services}/stream/util.ts +0 -0
  1101. /package/src/{api → services}/thread/delete.ts +0 -0
  1102. /package/src/{api → services}/thread/get.ts +0 -0
  1103. /package/src/{api → services}/thread/index.ts +0 -0
  1104. /package/src/{api → services}/thread/util.ts +0 -0
  1105. /package/src/{api → services}/user/index.ts +0 -0
  1106. /package/src/{api → services}/user/util.ts +0 -0
  1107. /package/src/{api → services}/user/whoami.ts +0 -0
  1108. /package/src/{api → services}/webhook/deliveries.ts +0 -0
  1109. /package/src/{api → services}/webhook/destinations.ts +0 -0
  1110. /package/src/{api → services}/webhook/receipts.ts +0 -0
  1111. /package/src/{api → services}/webhook/util.ts +0 -0
  1112. /package/src/{api → services}/webhook/webhooks.ts +0 -0
@@ -1,921 +0,0 @@
1
- import { FetchAdapter } from './adapter.ts';
2
- import { buildUrl, toServiceException } from './_util.ts';
3
- import { StructuredError } from '../error.ts';
4
-
5
- /**
6
- * Creates an {@link AbortSignal} that will abort after the specified timeout.
7
- *
8
- * @remarks
9
- * Falls back to a manual `AbortController` + `setTimeout` if `AbortSignal.timeout`
10
- * is not available in the runtime.
11
- *
12
- * @param ms - Timeout in milliseconds
13
- * @returns An abort signal that triggers after `ms` milliseconds
14
- *
15
- * @default 30000
16
- */
17
- function createTimeoutSignal(ms = 30_000): AbortSignal {
18
- if (typeof AbortSignal.timeout === 'function') {
19
- return AbortSignal.timeout(ms);
20
- }
21
- const controller = new AbortController();
22
- const timer = setTimeout(() => controller.abort(), ms);
23
- controller.signal.addEventListener('abort', () => clearTimeout(timer), { once: true });
24
- return controller.signal;
25
- }
26
-
27
- /**
28
- * A webhook endpoint that can receive HTTP requests. Each webhook has a unique
29
- * ingest URL and can forward received payloads to configured destinations.
30
- */
31
- export interface Webhook {
32
- /** Unique identifier for the webhook. */
33
- id: string;
34
-
35
- /** ISO 8601 timestamp when the webhook was created. */
36
- created_at: string;
37
-
38
- /** ISO 8601 timestamp when the webhook was last modified. */
39
- updated_at: string;
40
-
41
- /** ID of the user who created the webhook. */
42
- created_by: string;
43
-
44
- /** Human-readable name for the webhook. */
45
- name: string;
46
-
47
- /** Optional description of the webhook's purpose. */
48
- description: string | null;
49
-
50
- /**
51
- * The fully-qualified ingest URL where HTTP requests should be sent.
52
- * Only present when the webhook is first created.
53
- *
54
- * @remarks Format: `https://<catalyst-url>/webhook/<orgId>-<webhookId>`
55
- */
56
- url?: string;
57
- }
58
-
59
- /**
60
- * A delivery target for a webhook. When an HTTP request is received at the
61
- * webhook's ingest URL, the payload is forwarded to each of its destinations.
62
- */
63
- export interface WebhookDestination {
64
- /** Unique identifier for the destination. */
65
- id: string;
66
-
67
- /** The ID of the parent webhook. */
68
- webhook_id: string;
69
-
70
- /** ISO 8601 timestamp when the destination was created. */
71
- created_at: string;
72
-
73
- /** ISO 8601 timestamp when the destination was last modified. */
74
- updated_at: string;
75
-
76
- /** ID of the user who created the destination. */
77
- created_by: string;
78
-
79
- /**
80
- * The destination type.
81
- *
82
- * @remarks Currently only `'url'` is supported.
83
- */
84
- type: string;
85
-
86
- /**
87
- * Destination-specific configuration.
88
- *
89
- * @remarks For `'url'` type: `{ url: string, headers?: Record<string, string> }`.
90
- * The URL must use http or https.
91
- */
92
- config: Record<string, unknown>;
93
- }
94
-
95
- /**
96
- * A record of an HTTP request received at a webhook's ingest URL. Each receipt
97
- * captures the request headers and payload for auditing and replay.
98
- */
99
- export interface WebhookReceipt {
100
- /** Unique identifier for the receipt. */
101
- id: string;
102
-
103
- /** ISO 8601 timestamp when the request was received. */
104
- date: string;
105
-
106
- /** The ID of the webhook that received the request. */
107
- webhook_id: string;
108
-
109
- /** HTTP headers from the incoming request. */
110
- headers: Record<string, string>;
111
-
112
- /** The request body/payload, preserved in its original form. */
113
- payload: unknown;
114
- }
115
-
116
- /**
117
- * A record of a delivery attempt from a webhook receipt to a destination.
118
- * Tracks the forwarding status and supports retries for failed deliveries.
119
- */
120
- export interface WebhookDelivery {
121
- /** Unique identifier for the delivery attempt. */
122
- id: string;
123
-
124
- /** ISO 8601 timestamp when the delivery was attempted. */
125
- date: string;
126
-
127
- /** The ID of the parent webhook. */
128
- webhook_id: string;
129
-
130
- /** The ID of the destination this delivery was sent to. */
131
- webhook_destination_id: string;
132
-
133
- /** The ID of the receipt that triggered this delivery. */
134
- webhook_receipt_id: string;
135
-
136
- /**
137
- * Delivery status.
138
- *
139
- * - `'pending'` — Queued for delivery.
140
- * - `'success'` — Successfully delivered.
141
- * - `'failed'` — Delivery error occurred.
142
- */
143
- status: 'pending' | 'success' | 'failed';
144
-
145
- /** Number of retry attempts made. */
146
- retries: number;
147
-
148
- /** Error message if delivery failed, `null` on success. */
149
- error: string | null;
150
-
151
- /** The response received from the destination endpoint, or `null`. */
152
- response: Record<string, unknown> | null;
153
- }
154
-
155
- /**
156
- * Parameters for creating a new webhook.
157
- */
158
- export interface CreateWebhookParams {
159
- /** Human-readable name for the webhook (required). */
160
- name: string;
161
-
162
- /** Optional description of the webhook's purpose. */
163
- description?: string;
164
- }
165
-
166
- /**
167
- * Parameters for updating a webhook. Only provided fields are modified.
168
- */
169
- export interface UpdateWebhookParams {
170
- /** Updated name. */
171
- name?: string;
172
-
173
- /** Updated description. */
174
- description?: string;
175
- }
176
-
177
- /**
178
- * Parameters for creating a new webhook destination.
179
- */
180
- export interface CreateWebhookDestinationParams {
181
- /**
182
- * The destination type.
183
- *
184
- * @remarks Currently only `'url'` is supported.
185
- */
186
- type: string;
187
-
188
- /**
189
- * Type-specific configuration.
190
- *
191
- * @remarks For `'url'` type: `{ url: string, headers?: Record<string, string> }`.
192
- */
193
- config: Record<string, unknown>;
194
- }
195
-
196
- /**
197
- * Paginated list of webhooks.
198
- */
199
- export interface WebhookListResult {
200
- /** Array of webhooks. */
201
- webhooks: Webhook[];
202
-
203
- /** Total number of webhooks. */
204
- total: number;
205
- }
206
-
207
- /**
208
- * Result of fetching a single webhook, including its configured destinations.
209
- */
210
- export interface WebhookGetResult {
211
- /** The requested webhook. */
212
- webhook: Webhook;
213
-
214
- /** Array of destinations configured for this webhook. */
215
- destinations: WebhookDestination[];
216
- }
217
-
218
- /**
219
- * Result of creating a webhook.
220
- */
221
- export interface WebhookCreateResult {
222
- /** The newly created webhook. */
223
- webhook: Webhook;
224
- }
225
-
226
- /**
227
- * Result of updating a webhook.
228
- */
229
- export interface UpdateWebhookResult {
230
- /** The updated webhook. */
231
- webhook: Webhook;
232
- }
233
-
234
- /**
235
- * Result of creating a webhook destination.
236
- */
237
- export interface CreateDestinationResult {
238
- /** The newly created destination. */
239
- destination: WebhookDestination;
240
- }
241
-
242
- /**
243
- * List of destinations for a webhook.
244
- */
245
- export interface ListDestinationsResult {
246
- /** Array of destinations. */
247
- destinations: WebhookDestination[];
248
- }
249
-
250
- /**
251
- * List of receipts (incoming requests) for a webhook.
252
- */
253
- export interface WebhookReceiptListResult {
254
- /** Array of receipt records. */
255
- receipts: WebhookReceipt[];
256
- }
257
-
258
- /**
259
- * List of delivery attempts for a webhook.
260
- */
261
- export interface WebhookDeliveryListResult {
262
- /** Array of delivery records. */
263
- deliveries: WebhookDelivery[];
264
- }
265
-
266
- /**
267
- * Internal API success response envelope for webhook operations.
268
- */
269
- interface WebhookSuccessResponse<T> {
270
- success: true;
271
- data: T;
272
- }
273
-
274
- /**
275
- * Internal API error response envelope for webhook operations.
276
- */
277
- interface WebhookErrorResponse {
278
- success: false;
279
- message: string;
280
- }
281
-
282
- /**
283
- * Discriminated union of API success and error responses for webhook operations.
284
- */
285
- type WebhookResponse<T> = WebhookSuccessResponse<T> | WebhookErrorResponse;
286
-
287
- /**
288
- * Thrown when the API returns a success HTTP status but the response body indicates failure.
289
- */
290
- const WebhookResponseError = StructuredError('WebhookResponseError')<{
291
- status: number;
292
- }>();
293
-
294
- /**
295
- * Client for the Agentuity Webhook service.
296
- *
297
- * Provides methods for creating and managing webhook endpoints that can receive
298
- * HTTP requests and forward them to configured destinations. The service supports:
299
- *
300
- * - **Webhooks**: Named endpoints with unique ingest URLs
301
- * - **Destinations**: URL-based targets that receive forwarded payloads
302
- * - **Receipts**: Records of incoming HTTP requests for auditing
303
- * - **Deliveries**: Records of forwarding attempts with retry support
304
- *
305
- * When an HTTP request hits a webhook's ingest URL, it is recorded as a receipt
306
- * and then delivered to all configured destinations. Failed deliveries can be
307
- * retried via {@link WebhookService.retryDelivery}.
308
- *
309
- * All methods are instrumented with OpenTelemetry spans for observability.
310
- *
311
- * @example
312
- * ```typescript
313
- * const webhooks = new WebhookService(baseUrl, adapter);
314
- *
315
- * // Create a webhook
316
- * const { webhook } = await webhooks.create({ name: 'GitHub Events' });
317
- * console.log('Ingest URL:', webhook.url);
318
- *
319
- * // Add a destination
320
- * await webhooks.createDestination(webhook.id, {
321
- * type: 'url',
322
- * config: { url: 'https://example.com/handle-github' },
323
- * });
324
- *
325
- * // Check delivery history
326
- * const { deliveries } = await webhooks.listDeliveries(webhook.id);
327
- * ```
328
- */
329
- export class WebhookService {
330
- #adapter: FetchAdapter;
331
- #baseUrl: string;
332
-
333
- /**
334
- * Creates a new WebhookService instance.
335
- *
336
- * @param baseUrl - The base URL of the webhook API
337
- * @param adapter - The HTTP fetch adapter used for making API requests
338
- */
339
- constructor(baseUrl: string, adapter: FetchAdapter) {
340
- this.#adapter = adapter;
341
- this.#baseUrl = baseUrl;
342
- }
343
-
344
- /**
345
- * Unwrap a potentially nested response envelope. Some API responses wrap the data
346
- * in an additional `{ data: T }` layer; this method normalizes both shapes.
347
- *
348
- * @param raw - The raw response data to unwrap
349
- * @returns The unwrapped data of type `T`
350
- */
351
- #unwrap<T>(raw: unknown): T {
352
- if (raw !== null && typeof raw === 'object' && 'data' in raw) {
353
- return (raw as Record<string, unknown>).data as T;
354
- }
355
- return raw as T;
356
- }
357
-
358
- /**
359
- * Create a new webhook endpoint.
360
- *
361
- * @param params - The webhook creation parameters including name and optional description
362
- * @returns The newly created webhook with its unique ingest URL
363
- * @throws {@link ServiceException} if the API request fails
364
- *
365
- * @example
366
- * ```typescript
367
- * const { webhook } = await webhooks.create({
368
- * name: 'Stripe Events',
369
- * description: 'Receives payment webhooks from Stripe',
370
- * });
371
- * console.log('Ingest URL:', webhook.url);
372
- * ```
373
- */
374
- async create(params: CreateWebhookParams): Promise<WebhookCreateResult> {
375
- const url = buildUrl(this.#baseUrl, '/webhook/create');
376
- const signal = createTimeoutSignal();
377
- const res = await this.#adapter.invoke<WebhookResponse<Webhook>>(url, {
378
- method: 'POST',
379
- signal,
380
- body: JSON.stringify(params),
381
- contentType: 'application/json',
382
- telemetry: {
383
- name: 'agentuity.webhook.create',
384
- attributes: {
385
- name: params.name,
386
- },
387
- },
388
- });
389
-
390
- if (res.ok) {
391
- if (res.data.success) {
392
- return { webhook: res.data.data };
393
- }
394
- throw new WebhookResponseError({ status: res.response.status, message: res.data.message });
395
- }
396
-
397
- throw await toServiceException('POST', url, res.response);
398
- }
399
-
400
- /**
401
- * List all webhooks with optional pagination.
402
- *
403
- * @param params - Optional pagination parameters
404
- * @returns Paginated list of webhooks with total count
405
- * @throws {@link ServiceException} if the API request fails
406
- *
407
- * @example
408
- * ```typescript
409
- * const { webhooks, total } = await webhooks.list({ limit: 10, offset: 0 });
410
- * console.log(`Showing ${webhooks.length} of ${total} webhooks`);
411
- * for (const wh of webhooks) {
412
- * console.log(`${wh.name}: ${wh.url}`);
413
- * }
414
- * ```
415
- */
416
- async list(params?: { limit?: number; offset?: number }): Promise<WebhookListResult> {
417
- const qs = new URLSearchParams();
418
- if (params?.limit !== undefined) {
419
- qs.set('limit', String(params.limit));
420
- }
421
- if (params?.offset !== undefined) {
422
- qs.set('offset', String(params.offset));
423
- }
424
-
425
- const path = qs.toString() ? `/webhook/list?${qs.toString()}` : '/webhook/list';
426
- const url = buildUrl(this.#baseUrl, path);
427
- const signal = createTimeoutSignal();
428
- const res = await this.#adapter.invoke<WebhookResponse<Webhook[]>>(url, {
429
- method: 'GET',
430
- signal,
431
- telemetry: {
432
- name: 'agentuity.webhook.list',
433
- attributes: {
434
- limit: String(params?.limit ?? ''),
435
- offset: String(params?.offset ?? ''),
436
- },
437
- },
438
- });
439
-
440
- if (res.ok) {
441
- if (res.data.success) {
442
- const unwrapped = this.#unwrap<Webhook[] | { data: Webhook[]; total: number }>(
443
- res.data.data
444
- );
445
- if (Array.isArray(unwrapped)) {
446
- return { webhooks: unwrapped, total: unwrapped.length };
447
- }
448
- const arr = Array.isArray(unwrapped.data) ? unwrapped.data : [];
449
- return { webhooks: arr, total: unwrapped.total ?? arr.length };
450
- }
451
- throw new WebhookResponseError({ status: res.response.status, message: res.data.message });
452
- }
453
-
454
- throw await toServiceException('GET', url, res.response);
455
- }
456
-
457
- /**
458
- * Get a webhook by its ID, including its configured destinations.
459
- *
460
- * @param webhookId - The unique webhook identifier
461
- * @returns The webhook and its list of destinations
462
- * @throws {@link ServiceException} if the API request fails
463
- *
464
- * @example
465
- * ```typescript
466
- * const { webhook, destinations } = await webhooks.get('wh_abc123');
467
- * console.log(`${webhook.name} has ${destinations.length} destination(s)`);
468
- * ```
469
- */
470
- async get(webhookId: string): Promise<WebhookGetResult> {
471
- const url = buildUrl(this.#baseUrl, `/webhook/get/${encodeURIComponent(webhookId)}`);
472
- const signal = createTimeoutSignal();
473
- const res = await this.#adapter.invoke<WebhookResponse<Webhook>>(url, {
474
- method: 'GET',
475
- signal,
476
- telemetry: {
477
- name: 'agentuity.webhook.get',
478
- attributes: {
479
- webhookId,
480
- },
481
- },
482
- });
483
-
484
- if (res.ok) {
485
- if (res.data.success) {
486
- const { destinations } = await this.listDestinations(webhookId);
487
- return { webhook: res.data.data, destinations };
488
- }
489
- throw new WebhookResponseError({ status: res.response.status, message: res.data.message });
490
- }
491
-
492
- throw await toServiceException('GET', url, res.response);
493
- }
494
-
495
- /**
496
- * Update a webhook's name and/or description.
497
- *
498
- * @param webhookId - The unique webhook identifier
499
- * @param params - Fields to update; only provided fields are changed
500
- * @returns The updated webhook
501
- * @throws {@link ServiceException} if the API request fails
502
- *
503
- * @example
504
- * ```typescript
505
- * const { webhook } = await webhooks.update('wh_abc123', {
506
- * name: 'GitHub Events (Production)',
507
- * description: 'Production webhook for GitHub push events',
508
- * });
509
- * console.log('Updated:', webhook.name);
510
- * ```
511
- */
512
- async update(webhookId: string, params: UpdateWebhookParams): Promise<UpdateWebhookResult> {
513
- const url = buildUrl(this.#baseUrl, `/webhook/update/${encodeURIComponent(webhookId)}`);
514
- const signal = createTimeoutSignal();
515
- const res = await this.#adapter.invoke<WebhookResponse<Webhook>>(url, {
516
- method: 'PUT',
517
- signal,
518
- body: JSON.stringify(params),
519
- contentType: 'application/json',
520
- telemetry: {
521
- name: 'agentuity.webhook.update',
522
- attributes: {
523
- webhookId,
524
- },
525
- },
526
- });
527
-
528
- if (res.ok) {
529
- if (res.data.success) {
530
- return { webhook: res.data.data };
531
- }
532
- throw new WebhookResponseError({ status: res.response.status, message: res.data.message });
533
- }
534
-
535
- throw await toServiceException('PUT', url, res.response);
536
- }
537
-
538
- /**
539
- * Delete a webhook and all its associated destinations, receipts, and deliveries.
540
- *
541
- * @param webhookId - The unique webhook identifier
542
- * @throws {@link ServiceException} if the API request fails
543
- *
544
- * @example
545
- * ```typescript
546
- * await webhooks.delete('wh_abc123');
547
- * console.log('Webhook deleted');
548
- * ```
549
- */
550
- async delete(webhookId: string): Promise<void> {
551
- const url = buildUrl(this.#baseUrl, `/webhook/delete/${encodeURIComponent(webhookId)}`);
552
- const signal = createTimeoutSignal();
553
- const res = await this.#adapter.invoke<WebhookResponse<null>>(url, {
554
- method: 'DELETE',
555
- signal,
556
- telemetry: {
557
- name: 'agentuity.webhook.delete',
558
- attributes: {
559
- webhookId,
560
- },
561
- },
562
- });
563
-
564
- if (res.ok) {
565
- if (res.data?.success !== false) {
566
- return;
567
- }
568
- throw new WebhookResponseError({
569
- status: res.response.status,
570
- message: res.data?.message ?? 'Delete failed',
571
- });
572
- }
573
-
574
- throw await toServiceException('DELETE', url, res.response);
575
- }
576
-
577
- /**
578
- * Create a new destination for a webhook. When the webhook receives a request,
579
- * the payload will be forwarded to this destination.
580
- *
581
- * @param webhookId - The ID of the parent webhook
582
- * @param params - Destination configuration including type and type-specific config
583
- * @returns The newly created destination
584
- * @throws {@link ServiceException} if the API request fails
585
- *
586
- * @example
587
- * ```typescript
588
- * const { destination } = await webhooks.createDestination('wh_abc123', {
589
- * type: 'url',
590
- * config: {
591
- * url: 'https://example.com/webhook-handler',
592
- * headers: { 'X-Custom-Header': 'my-value' },
593
- * },
594
- * });
595
- * console.log('Destination created:', destination.id);
596
- * ```
597
- */
598
- async createDestination(
599
- webhookId: string,
600
- params: CreateWebhookDestinationParams
601
- ): Promise<CreateDestinationResult> {
602
- const url = buildUrl(
603
- this.#baseUrl,
604
- `/webhook/destination-create/${encodeURIComponent(webhookId)}`
605
- );
606
- const signal = createTimeoutSignal();
607
- const res = await this.#adapter.invoke<WebhookResponse<WebhookDestination>>(url, {
608
- method: 'POST',
609
- signal,
610
- body: JSON.stringify(params),
611
- contentType: 'application/json',
612
- telemetry: {
613
- name: 'agentuity.webhook.createDestination',
614
- attributes: {
615
- webhookId,
616
- type: params.type,
617
- },
618
- },
619
- });
620
-
621
- if (res.ok) {
622
- if (res.data.success) {
623
- return { destination: res.data.data };
624
- }
625
- throw new WebhookResponseError({ status: res.response.status, message: res.data.message });
626
- }
627
-
628
- throw await toServiceException('POST', url, res.response);
629
- }
630
-
631
- /**
632
- * List all destinations configured for a webhook.
633
- *
634
- * @param webhookId - The ID of the webhook
635
- * @returns List of destinations
636
- * @throws {@link ServiceException} if the API request fails
637
- *
638
- * @example
639
- * ```typescript
640
- * const { destinations } = await webhooks.listDestinations('wh_abc123');
641
- * for (const dest of destinations) {
642
- * console.log(`${dest.type}: ${JSON.stringify(dest.config)}`);
643
- * }
644
- * ```
645
- */
646
- async listDestinations(webhookId: string): Promise<ListDestinationsResult> {
647
- const url = buildUrl(
648
- this.#baseUrl,
649
- `/webhook/destination-list/${encodeURIComponent(webhookId)}`
650
- );
651
- const signal = createTimeoutSignal();
652
- const res = await this.#adapter.invoke<WebhookResponse<WebhookDestination[]>>(url, {
653
- method: 'GET',
654
- signal,
655
- telemetry: {
656
- name: 'agentuity.webhook.listDestinations',
657
- attributes: {
658
- webhookId,
659
- },
660
- },
661
- });
662
-
663
- if (res.ok) {
664
- if (res.data.success) {
665
- return { destinations: Array.isArray(res.data.data) ? res.data.data : [] };
666
- }
667
- throw new WebhookResponseError({ status: res.response.status, message: res.data.message });
668
- }
669
-
670
- throw await toServiceException('GET', url, res.response);
671
- }
672
-
673
- /**
674
- * Delete a destination from a webhook.
675
- *
676
- * @param webhookId - The ID of the parent webhook
677
- * @param destinationId - The ID of the destination to delete
678
- * @throws {@link ServiceException} if the API request fails
679
- *
680
- * @example
681
- * ```typescript
682
- * await webhooks.deleteDestination('wh_abc123', 'dest_xyz789');
683
- * console.log('Destination deleted');
684
- * ```
685
- */
686
- async deleteDestination(webhookId: string, destinationId: string): Promise<void> {
687
- const url = buildUrl(
688
- this.#baseUrl,
689
- `/webhook/destination-delete/${encodeURIComponent(webhookId)}/${encodeURIComponent(destinationId)}`
690
- );
691
- const signal = createTimeoutSignal();
692
- const res = await this.#adapter.invoke<WebhookResponse<null>>(url, {
693
- method: 'DELETE',
694
- signal,
695
- telemetry: {
696
- name: 'agentuity.webhook.deleteDestination',
697
- attributes: {
698
- webhookId,
699
- destinationId,
700
- },
701
- },
702
- });
703
-
704
- if (res.ok) {
705
- if (res.data?.success !== false) {
706
- return;
707
- }
708
- throw new WebhookResponseError({
709
- status: res.response.status,
710
- message: res.data?.message ?? 'Delete destination failed',
711
- });
712
- }
713
-
714
- throw await toServiceException('DELETE', url, res.response);
715
- }
716
-
717
- /**
718
- * List receipts (records of incoming HTTP requests) for a webhook.
719
- *
720
- * @param webhookId - The ID of the webhook
721
- * @param params - Optional pagination parameters
722
- * @returns List of receipt records
723
- * @throws {@link ServiceException} if the API request fails
724
- *
725
- * @example
726
- * ```typescript
727
- * const { receipts } = await webhooks.listReceipts('wh_abc123', {
728
- * limit: 50,
729
- * });
730
- * for (const receipt of receipts) {
731
- * console.log(`${receipt.date}: ${JSON.stringify(receipt.headers)}`);
732
- * }
733
- * ```
734
- */
735
- async listReceipts(
736
- webhookId: string,
737
- params?: { limit?: number; offset?: number }
738
- ): Promise<WebhookReceiptListResult> {
739
- const qs = new URLSearchParams();
740
- if (params?.limit !== undefined) {
741
- qs.set('limit', String(params.limit));
742
- }
743
- if (params?.offset !== undefined) {
744
- qs.set('offset', String(params.offset));
745
- }
746
-
747
- const basePath = `/webhook/receipt-list/${encodeURIComponent(webhookId)}`;
748
- const path = qs.toString() ? `${basePath}?${qs.toString()}` : basePath;
749
- const url = buildUrl(this.#baseUrl, path);
750
- const signal = createTimeoutSignal();
751
- const res = await this.#adapter.invoke<WebhookResponse<WebhookReceipt[]>>(url, {
752
- method: 'GET',
753
- signal,
754
- telemetry: {
755
- name: 'agentuity.webhook.listReceipts',
756
- attributes: {
757
- webhookId,
758
- limit: String(params?.limit ?? ''),
759
- offset: String(params?.offset ?? ''),
760
- },
761
- },
762
- });
763
-
764
- if (res.ok) {
765
- if (res.data.success) {
766
- return { receipts: Array.isArray(res.data.data) ? res.data.data : [] };
767
- }
768
- throw new WebhookResponseError({ status: res.response.status, message: res.data.message });
769
- }
770
-
771
- throw await toServiceException('GET', url, res.response);
772
- }
773
-
774
- /**
775
- * Get a single receipt by its ID, including the full payload.
776
- *
777
- * @param webhookId - The ID of the webhook
778
- * @param receiptId - The unique receipt identifier
779
- * @returns The receipt record with headers and payload
780
- * @throws {@link ServiceException} if the API request fails
781
- *
782
- * @example
783
- * ```typescript
784
- * const receipt = await webhooks.getReceipt('wh_abc123', 'rcpt_def456');
785
- * console.log('Payload:', receipt.payload);
786
- * console.log('Headers:', receipt.headers);
787
- * ```
788
- */
789
- async getReceipt(webhookId: string, receiptId: string): Promise<WebhookReceipt> {
790
- const url = buildUrl(
791
- this.#baseUrl,
792
- `/webhook/receipt-get/${encodeURIComponent(webhookId)}/${encodeURIComponent(receiptId)}`
793
- );
794
- const signal = createTimeoutSignal();
795
- const res = await this.#adapter.invoke<WebhookResponse<WebhookReceipt>>(url, {
796
- method: 'GET',
797
- signal,
798
- telemetry: {
799
- name: 'agentuity.webhook.getReceipt',
800
- attributes: {
801
- webhookId,
802
- receiptId,
803
- },
804
- },
805
- });
806
-
807
- if (res.ok) {
808
- if (res.data.success) {
809
- return res.data.data;
810
- }
811
- throw new WebhookResponseError({ status: res.response.status, message: res.data.message });
812
- }
813
-
814
- throw await toServiceException('GET', url, res.response);
815
- }
816
-
817
- /**
818
- * List delivery attempts for a webhook with optional pagination.
819
- *
820
- * @param webhookId - The ID of the webhook
821
- * @param params - Optional pagination parameters
822
- * @returns List of delivery records showing forwarding status
823
- * @throws {@link ServiceException} if the API request fails
824
- *
825
- * @example
826
- * ```typescript
827
- * const { deliveries } = await webhooks.listDeliveries('wh_abc123');
828
- * for (const d of deliveries) {
829
- * console.log(`${d.status} → dest ${d.webhook_destination_id} (retries: ${d.retries})`);
830
- * }
831
- * ```
832
- */
833
- async listDeliveries(
834
- webhookId: string,
835
- params?: { limit?: number; offset?: number }
836
- ): Promise<WebhookDeliveryListResult> {
837
- const qs = new URLSearchParams();
838
- if (params?.limit !== undefined) {
839
- qs.set('limit', String(params.limit));
840
- }
841
- if (params?.offset !== undefined) {
842
- qs.set('offset', String(params.offset));
843
- }
844
-
845
- const basePath = `/webhook/delivery-list/${encodeURIComponent(webhookId)}`;
846
- const path = qs.toString() ? `${basePath}?${qs.toString()}` : basePath;
847
- const url = buildUrl(this.#baseUrl, path);
848
- const signal = createTimeoutSignal();
849
- const res = await this.#adapter.invoke<WebhookResponse<WebhookDelivery[]>>(url, {
850
- method: 'GET',
851
- signal,
852
- telemetry: {
853
- name: 'agentuity.webhook.listDeliveries',
854
- attributes: {
855
- webhookId,
856
- limit: String(params?.limit ?? ''),
857
- offset: String(params?.offset ?? ''),
858
- },
859
- },
860
- });
861
-
862
- if (res.ok) {
863
- if (res.data.success) {
864
- return { deliveries: Array.isArray(res.data.data) ? res.data.data : [] };
865
- }
866
- throw new WebhookResponseError({ status: res.response.status, message: res.data.message });
867
- }
868
-
869
- throw await toServiceException('GET', url, res.response);
870
- }
871
-
872
- /**
873
- * Retry a failed delivery attempt. Only deliveries with `'failed'` status can be retried.
874
- *
875
- * @param webhookId - The ID of the parent webhook
876
- * @param deliveryId - The ID of the failed delivery to retry
877
- * @throws {@link ServiceException} if the API request fails
878
- *
879
- * @example
880
- * ```typescript
881
- * // Find and retry failed deliveries
882
- * const { deliveries } = await webhooks.listDeliveries('wh_abc123');
883
- * for (const d of deliveries) {
884
- * if (d.status === 'failed') {
885
- * await webhooks.retryDelivery('wh_abc123', d.id);
886
- * console.log('Retrying delivery:', d.id);
887
- * }
888
- * }
889
- * ```
890
- */
891
- async retryDelivery(webhookId: string, deliveryId: string): Promise<void> {
892
- const url = buildUrl(
893
- this.#baseUrl,
894
- `/webhook/delivery-retry/${encodeURIComponent(webhookId)}/${encodeURIComponent(deliveryId)}`
895
- );
896
- const signal = createTimeoutSignal();
897
- const res = await this.#adapter.invoke<WebhookResponse<null>>(url, {
898
- method: 'POST',
899
- signal,
900
- telemetry: {
901
- name: 'agentuity.webhook.retryDelivery',
902
- attributes: {
903
- webhookId,
904
- deliveryId,
905
- },
906
- },
907
- });
908
-
909
- if (res.ok) {
910
- if (res.data?.success !== false) {
911
- return;
912
- }
913
- throw new WebhookResponseError({
914
- status: res.response.status,
915
- message: res.data?.message ?? 'Retry delivery failed',
916
- });
917
- }
918
-
919
- throw await toServiceException('POST', url, res.response);
920
- }
921
- }