@agentuity/core 1.0.33 → 1.0.35

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 (1127) 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 +6 -0
  34. package/dist/services/db/index.d.ts.map +1 -0
  35. package/dist/services/db/index.js +6 -0
  36. package/dist/services/db/index.js.map +1 -0
  37. package/dist/services/db/logs.d.ts.map +1 -0
  38. package/dist/services/db/logs.js.map +1 -0
  39. package/dist/services/db/query.d.ts +40 -0
  40. package/dist/services/db/query.d.ts.map +1 -0
  41. package/dist/services/db/query.js +55 -0
  42. package/dist/services/db/query.js.map +1 -0
  43. package/dist/services/db/stats.d.ts +146 -0
  44. package/dist/services/db/stats.d.ts.map +1 -0
  45. package/dist/services/db/stats.js +94 -0
  46. package/dist/services/db/stats.js.map +1 -0
  47. package/dist/services/db/tables.d.ts +50 -0
  48. package/dist/services/db/tables.d.ts.map +1 -0
  49. package/dist/services/db/tables.js +64 -0
  50. package/dist/services/db/tables.js.map +1 -0
  51. package/dist/services/db/util.d.ts.map +1 -0
  52. package/dist/services/db/util.js.map +1 -0
  53. package/dist/services/email/index.d.ts +2 -0
  54. package/dist/services/email/index.d.ts.map +1 -0
  55. package/dist/services/email/index.js +2 -0
  56. package/dist/services/email/index.js.map +1 -0
  57. package/dist/services/email/service.d.ts +742 -0
  58. package/dist/services/email/service.d.ts.map +1 -0
  59. package/dist/services/email/service.js +1107 -0
  60. package/dist/services/email/service.js.map +1 -0
  61. package/dist/services/env.d.ts.map +1 -0
  62. package/dist/services/env.js.map +1 -0
  63. package/dist/services/eval/events.d.ts +93 -0
  64. package/dist/services/eval/events.d.ts.map +1 -0
  65. package/dist/services/eval/events.js +24 -0
  66. package/dist/services/eval/events.js.map +1 -0
  67. package/dist/services/eval/get.d.ts.map +1 -0
  68. package/dist/services/eval/get.js.map +1 -0
  69. package/dist/services/eval/index.d.ts +6 -0
  70. package/dist/services/eval/index.d.ts.map +1 -0
  71. package/dist/services/eval/index.js +6 -0
  72. package/dist/services/eval/index.js.map +1 -0
  73. package/dist/services/eval/list.d.ts.map +1 -0
  74. package/dist/services/eval/list.js.map +1 -0
  75. package/dist/services/eval/run-get.d.ts.map +1 -0
  76. package/dist/services/eval/run-get.js.map +1 -0
  77. package/dist/services/eval/run-list.d.ts.map +1 -0
  78. package/dist/services/eval/run-list.js.map +1 -0
  79. package/dist/services/exception.d.ts +28 -9
  80. package/dist/services/exception.d.ts.map +1 -1
  81. package/dist/services/exception.js +14 -0
  82. package/dist/services/exception.js.map +1 -1
  83. package/dist/services/index.d.ts +26 -12
  84. package/dist/services/index.d.ts.map +1 -1
  85. package/dist/services/index.js +26 -11
  86. package/dist/services/index.js.map +1 -1
  87. package/dist/services/keyvalue/index.d.ts +2 -0
  88. package/dist/services/keyvalue/index.d.ts.map +1 -0
  89. package/dist/services/keyvalue/index.js +2 -0
  90. package/dist/services/keyvalue/index.js.map +1 -0
  91. package/dist/services/keyvalue/service.d.ts +261 -0
  92. package/dist/services/keyvalue/service.d.ts.map +1 -0
  93. package/dist/services/keyvalue/service.js +475 -0
  94. package/dist/services/keyvalue/service.js.map +1 -0
  95. package/dist/services/logger.d.ts.map +1 -0
  96. package/dist/services/logger.js.map +1 -0
  97. package/dist/services/machine/index.d.ts.map +1 -0
  98. package/dist/services/machine/index.js.map +1 -0
  99. package/dist/services/machine/machine.d.ts.map +1 -0
  100. package/dist/services/machine/machine.js +177 -0
  101. package/dist/services/machine/machine.js.map +1 -0
  102. package/dist/services/machine/util.d.ts.map +1 -0
  103. package/dist/services/machine/util.js.map +1 -0
  104. package/dist/services/org/env-delete.d.ts.map +1 -0
  105. package/dist/services/org/env-delete.js.map +1 -0
  106. package/dist/services/org/env-get.d.ts +33 -0
  107. package/dist/services/org/env-get.d.ts.map +1 -0
  108. package/dist/services/org/env-get.js +33 -0
  109. package/dist/services/org/env-get.js.map +1 -0
  110. package/dist/services/org/env-update.d.ts.map +1 -0
  111. package/dist/services/org/env-update.js.map +1 -0
  112. package/dist/services/org/index.d.ts.map +1 -0
  113. package/dist/services/org/index.js.map +1 -0
  114. package/dist/services/org/list.d.ts.map +1 -0
  115. package/dist/services/org/list.js.map +1 -0
  116. package/dist/services/org/resources.d.ts +150 -0
  117. package/dist/services/org/resources.d.ts.map +1 -0
  118. package/dist/services/org/resources.js +111 -0
  119. package/dist/services/org/resources.js.map +1 -0
  120. package/dist/services/org/util.d.ts.map +1 -0
  121. package/dist/services/org/util.js.map +1 -0
  122. package/dist/services/pagination.d.ts +38 -11
  123. package/dist/services/pagination.d.ts.map +1 -1
  124. package/dist/services/pagination.js +30 -1
  125. package/dist/services/pagination.js.map +1 -1
  126. package/dist/services/project/agent.d.ts.map +1 -0
  127. package/dist/services/project/agent.js.map +1 -0
  128. package/dist/services/project/create.d.ts.map +1 -0
  129. package/dist/services/project/create.js.map +1 -0
  130. package/dist/services/project/delete.d.ts.map +1 -0
  131. package/dist/services/project/delete.js +15 -0
  132. package/dist/services/project/delete.js.map +1 -0
  133. package/dist/services/project/deploy.d.ts +468 -0
  134. package/dist/services/project/deploy.d.ts.map +1 -0
  135. package/dist/services/project/deploy.js.map +1 -0
  136. package/dist/services/project/deployment.d.ts.map +1 -0
  137. package/dist/services/project/deployment.js +180 -0
  138. package/dist/services/project/deployment.js.map +1 -0
  139. package/dist/services/project/env-delete.d.ts.map +1 -0
  140. package/dist/services/project/env-delete.js.map +1 -0
  141. package/dist/services/project/env-update.d.ts.map +1 -0
  142. package/dist/services/project/env-update.js.map +1 -0
  143. package/dist/services/project/exists.d.ts.map +1 -0
  144. package/dist/services/project/exists.js.map +1 -0
  145. package/dist/services/project/get.d.ts.map +1 -0
  146. package/dist/services/project/get.js.map +1 -0
  147. package/dist/services/project/hostname.d.ts.map +1 -0
  148. package/dist/services/project/hostname.js +43 -0
  149. package/dist/services/project/hostname.js.map +1 -0
  150. package/dist/services/project/index.d.ts.map +1 -0
  151. package/dist/services/project/index.js.map +1 -0
  152. package/dist/services/project/list.d.ts.map +1 -0
  153. package/dist/services/project/list.js.map +1 -0
  154. package/dist/services/project/malware.d.ts.map +1 -0
  155. package/dist/services/project/malware.js +57 -0
  156. package/dist/services/project/malware.js.map +1 -0
  157. package/dist/services/project/update-region.d.ts.map +1 -0
  158. package/dist/services/project/update-region.js.map +1 -0
  159. package/dist/services/project/util.d.ts.map +1 -0
  160. package/dist/services/project/util.js.map +1 -0
  161. package/dist/services/queue/analytics.d.ts +261 -0
  162. package/dist/services/queue/analytics.d.ts.map +1 -0
  163. package/dist/services/queue/analytics.js +254 -0
  164. package/dist/services/queue/analytics.js.map +1 -0
  165. package/dist/services/queue/consumers.d.ts +48 -0
  166. package/dist/services/queue/consumers.d.ts.map +1 -0
  167. package/dist/services/queue/consumers.js +43 -0
  168. package/dist/services/queue/consumers.js.map +1 -0
  169. package/dist/services/queue/destinations.d.ts +269 -0
  170. package/dist/services/queue/destinations.d.ts.map +1 -0
  171. package/dist/services/queue/destinations.js +215 -0
  172. package/dist/services/queue/destinations.js.map +1 -0
  173. package/dist/services/queue/dlq.d.ts +170 -0
  174. package/dist/services/queue/dlq.d.ts.map +1 -0
  175. package/dist/services/queue/dlq.js.map +1 -0
  176. package/dist/services/queue/index.d.ts +58 -0
  177. package/dist/services/queue/index.d.ts.map +1 -0
  178. package/dist/services/queue/index.js +98 -0
  179. package/dist/services/queue/index.js.map +1 -0
  180. package/dist/services/queue/messages.d.ts +511 -0
  181. package/dist/services/queue/messages.d.ts.map +1 -0
  182. package/dist/services/queue/messages.js.map +1 -0
  183. package/dist/services/queue/queues.d.ts +228 -0
  184. package/dist/services/queue/queues.d.ts.map +1 -0
  185. package/dist/services/queue/queues.js.map +1 -0
  186. package/dist/services/queue/service.d.ts +309 -0
  187. package/dist/services/queue/service.d.ts.map +1 -0
  188. package/dist/services/queue/service.js +456 -0
  189. package/dist/services/queue/service.js.map +1 -0
  190. package/dist/services/queue/sources.d.ts +252 -0
  191. package/dist/services/queue/sources.d.ts.map +1 -0
  192. package/dist/services/queue/sources.js +249 -0
  193. package/dist/services/queue/sources.js.map +1 -0
  194. package/dist/services/queue/types.d.ts +1335 -0
  195. package/dist/services/queue/types.d.ts.map +1 -0
  196. package/dist/services/queue/types.js +1382 -0
  197. package/dist/services/queue/types.js.map +1 -0
  198. package/dist/services/queue/util.d.ts +278 -0
  199. package/dist/services/queue/util.d.ts.map +1 -0
  200. package/dist/services/queue/util.js +233 -0
  201. package/dist/services/queue/util.js.map +1 -0
  202. package/dist/services/queue/validation.d.ts +218 -0
  203. package/dist/services/queue/validation.d.ts.map +1 -0
  204. package/dist/services/queue/validation.js +498 -0
  205. package/dist/services/queue/validation.js.map +1 -0
  206. package/dist/services/queue/websocket.d.ts +154 -0
  207. package/dist/services/queue/websocket.d.ts.map +1 -0
  208. package/dist/services/queue/websocket.js +491 -0
  209. package/dist/services/queue/websocket.js.map +1 -0
  210. package/dist/services/region/create.d.ts.map +1 -0
  211. package/dist/services/region/create.js.map +1 -0
  212. package/dist/services/region/delete.d.ts.map +1 -0
  213. package/dist/services/region/delete.js.map +1 -0
  214. package/dist/services/region/index.d.ts.map +1 -0
  215. package/dist/services/region/index.js.map +1 -0
  216. package/dist/services/region/list.d.ts.map +1 -0
  217. package/dist/services/region/list.js.map +1 -0
  218. package/dist/services/region/resources.d.ts.map +1 -0
  219. package/dist/services/region/resources.js.map +1 -0
  220. package/dist/services/region/util.d.ts.map +1 -0
  221. package/dist/services/region/util.js.map +1 -0
  222. package/dist/services/sandbox/cli-list.d.ts +103 -0
  223. package/dist/services/sandbox/cli-list.d.ts.map +1 -0
  224. package/dist/services/sandbox/cli-list.js +106 -0
  225. package/dist/services/sandbox/cli-list.js.map +1 -0
  226. package/dist/services/sandbox/client.d.ts +173 -0
  227. package/dist/services/sandbox/client.d.ts.map +1 -0
  228. package/dist/services/sandbox/client.js +302 -0
  229. package/dist/services/sandbox/client.js.map +1 -0
  230. package/dist/services/sandbox/create.d.ts +193 -0
  231. package/dist/services/sandbox/create.d.ts.map +1 -0
  232. package/dist/services/sandbox/create.js +215 -0
  233. package/dist/services/sandbox/create.js.map +1 -0
  234. package/dist/services/sandbox/destroy.d.ts +23 -0
  235. package/dist/services/sandbox/destroy.d.ts.map +1 -0
  236. package/dist/services/sandbox/destroy.js +30 -0
  237. package/dist/services/sandbox/destroy.js.map +1 -0
  238. package/dist/services/sandbox/disk-checkpoint.d.ts +108 -0
  239. package/dist/services/sandbox/disk-checkpoint.d.ts.map +1 -0
  240. package/dist/services/sandbox/disk-checkpoint.js +124 -0
  241. package/dist/services/sandbox/disk-checkpoint.js.map +1 -0
  242. package/dist/services/sandbox/execute.d.ts +96 -0
  243. package/dist/services/sandbox/execute.d.ts.map +1 -0
  244. package/dist/services/sandbox/execute.js +109 -0
  245. package/dist/services/sandbox/execute.js.map +1 -0
  246. package/dist/services/sandbox/execution.d.ts +145 -0
  247. package/dist/services/sandbox/execution.d.ts.map +1 -0
  248. package/dist/services/sandbox/execution.js +113 -0
  249. package/dist/services/sandbox/execution.js.map +1 -0
  250. package/dist/services/sandbox/files.d.ts +269 -0
  251. package/dist/services/sandbox/files.d.ts.map +1 -0
  252. package/dist/services/sandbox/files.js +454 -0
  253. package/dist/services/sandbox/files.js.map +1 -0
  254. package/dist/services/sandbox/get.d.ts +284 -0
  255. package/dist/services/sandbox/get.d.ts.map +1 -0
  256. package/dist/services/sandbox/get.js +231 -0
  257. package/dist/services/sandbox/get.js.map +1 -0
  258. package/dist/services/sandbox/getStatus.d.ts +20 -0
  259. package/dist/services/sandbox/getStatus.d.ts.map +1 -0
  260. package/dist/services/sandbox/getStatus.js +36 -0
  261. package/dist/services/sandbox/getStatus.js.map +1 -0
  262. package/dist/services/sandbox/index.d.ts +40 -0
  263. package/dist/services/sandbox/index.d.ts.map +1 -0
  264. package/dist/services/sandbox/index.js +21 -0
  265. package/dist/services/sandbox/index.js.map +1 -0
  266. package/dist/services/sandbox/list.d.ts +327 -0
  267. package/dist/services/sandbox/list.d.ts.map +1 -0
  268. package/dist/services/sandbox/list.js +204 -0
  269. package/dist/services/sandbox/list.js.map +1 -0
  270. package/dist/services/sandbox/pause.d.ts +23 -0
  271. package/dist/services/sandbox/pause.d.ts.map +1 -0
  272. package/dist/services/sandbox/pause.js +30 -0
  273. package/dist/services/sandbox/pause.js.map +1 -0
  274. package/dist/services/sandbox/resolve.d.ts +75 -0
  275. package/dist/services/sandbox/resolve.d.ts.map +1 -0
  276. package/dist/services/sandbox/resolve.js +76 -0
  277. package/dist/services/sandbox/resolve.js.map +1 -0
  278. package/dist/services/sandbox/resume.d.ts +23 -0
  279. package/dist/services/sandbox/resume.d.ts.map +1 -0
  280. package/dist/services/sandbox/resume.js +30 -0
  281. package/dist/services/sandbox/resume.js.map +1 -0
  282. package/dist/services/sandbox/run.d.ts +71 -0
  283. package/dist/services/sandbox/run.d.ts.map +1 -0
  284. package/dist/services/sandbox/run.js +355 -0
  285. package/dist/services/sandbox/run.js.map +1 -0
  286. package/dist/services/sandbox/runtime.d.ts +94 -0
  287. package/dist/services/sandbox/runtime.d.ts.map +1 -0
  288. package/dist/services/sandbox/runtime.js +82 -0
  289. package/dist/services/sandbox/runtime.js.map +1 -0
  290. package/dist/services/sandbox/snapshot-build.d.ts.map +1 -0
  291. package/dist/services/sandbox/snapshot-build.js.map +1 -0
  292. package/dist/services/sandbox/snapshot.d.ts +596 -0
  293. package/dist/services/sandbox/snapshot.d.ts.map +1 -0
  294. package/dist/services/sandbox/snapshot.js +612 -0
  295. package/dist/services/sandbox/snapshot.js.map +1 -0
  296. package/dist/services/sandbox/types.d.ts +851 -0
  297. package/dist/services/sandbox/types.d.ts.map +1 -0
  298. package/dist/services/sandbox/types.js +674 -0
  299. package/dist/services/sandbox/types.js.map +1 -0
  300. package/dist/services/sandbox/util.d.ts +295 -0
  301. package/dist/services/sandbox/util.d.ts.map +1 -0
  302. package/dist/services/sandbox/util.js +233 -0
  303. package/dist/services/sandbox/util.js.map +1 -0
  304. package/dist/services/schedule/index.d.ts +2 -0
  305. package/dist/services/schedule/index.d.ts.map +1 -0
  306. package/dist/services/schedule/index.js +2 -0
  307. package/dist/services/schedule/index.js.map +1 -0
  308. package/dist/services/schedule/service.d.ts +439 -0
  309. package/dist/services/schedule/service.d.ts.map +1 -0
  310. package/dist/services/schedule/service.js +701 -0
  311. package/dist/services/schedule/service.js.map +1 -0
  312. package/dist/services/session/events.d.ts +127 -0
  313. package/dist/services/session/events.d.ts.map +1 -0
  314. package/dist/services/session/events.js +42 -0
  315. package/dist/services/session/events.js.map +1 -0
  316. package/dist/services/session/get.d.ts +170 -0
  317. package/dist/services/session/get.d.ts.map +1 -0
  318. package/dist/services/session/get.js.map +1 -0
  319. package/dist/services/session/index.d.ts +5 -0
  320. package/dist/services/session/index.d.ts.map +1 -0
  321. package/dist/services/session/index.js +5 -0
  322. package/dist/services/session/index.js.map +1 -0
  323. package/dist/services/session/list.d.ts +150 -0
  324. package/dist/services/session/list.d.ts.map +1 -0
  325. package/dist/services/session/list.js +117 -0
  326. package/dist/services/session/list.js.map +1 -0
  327. package/dist/services/session/logs.d.ts.map +1 -0
  328. package/dist/services/session/logs.js.map +1 -0
  329. package/dist/services/session/util.d.ts.map +1 -0
  330. package/dist/services/session/util.js.map +1 -0
  331. package/dist/services/stats.d.ts +261 -0
  332. package/dist/services/stats.d.ts.map +1 -0
  333. package/dist/services/stats.js +181 -0
  334. package/dist/services/stats.js.map +1 -0
  335. package/dist/services/storage/config.d.ts.map +1 -0
  336. package/dist/services/storage/config.js.map +1 -0
  337. package/dist/services/storage/index.d.ts.map +1 -0
  338. package/dist/services/storage/index.js.map +1 -0
  339. package/dist/services/storage/objects.d.ts +158 -0
  340. package/dist/services/storage/objects.d.ts.map +1 -0
  341. package/dist/services/storage/objects.js +161 -0
  342. package/dist/services/storage/objects.js.map +1 -0
  343. package/dist/services/storage/types.d.ts.map +1 -0
  344. package/dist/services/storage/types.js.map +1 -0
  345. package/dist/services/storage/util.d.ts.map +1 -0
  346. package/dist/services/storage/util.js.map +1 -0
  347. package/dist/services/stream/get.d.ts.map +1 -0
  348. package/dist/services/stream/get.js.map +1 -0
  349. package/dist/services/stream/index.d.ts +5 -0
  350. package/dist/services/stream/index.d.ts.map +1 -0
  351. package/dist/services/stream/index.js +5 -0
  352. package/dist/services/stream/index.js.map +1 -0
  353. package/dist/services/stream/list.d.ts +96 -0
  354. package/dist/services/stream/list.d.ts.map +1 -0
  355. package/dist/services/stream/list.js +92 -0
  356. package/dist/services/stream/list.js.map +1 -0
  357. package/dist/services/stream/service.d.ts +264 -0
  358. package/dist/services/stream/service.d.ts.map +1 -0
  359. package/dist/services/stream/service.js +631 -0
  360. package/dist/services/stream/service.js.map +1 -0
  361. package/dist/services/stream/util.d.ts.map +1 -0
  362. package/dist/services/stream/util.js.map +1 -0
  363. package/dist/services/task/index.d.ts +2 -0
  364. package/dist/services/task/index.d.ts.map +1 -0
  365. package/dist/services/task/index.js +2 -0
  366. package/dist/services/task/index.js.map +1 -0
  367. package/dist/services/task/service.d.ts +1491 -0
  368. package/dist/services/task/service.d.ts.map +1 -0
  369. package/dist/services/task/service.js +1887 -0
  370. package/dist/services/task/service.js.map +1 -0
  371. package/dist/services/thread/delete.d.ts.map +1 -0
  372. package/dist/services/thread/delete.js.map +1 -0
  373. package/dist/services/thread/get.d.ts.map +1 -0
  374. package/dist/services/thread/get.js.map +1 -0
  375. package/dist/services/thread/index.d.ts.map +1 -0
  376. package/dist/services/thread/index.js.map +1 -0
  377. package/dist/services/thread/list.d.ts +75 -0
  378. package/dist/services/thread/list.d.ts.map +1 -0
  379. package/dist/services/thread/list.js +65 -0
  380. package/dist/services/thread/list.js.map +1 -0
  381. package/dist/services/thread/util.d.ts.map +1 -0
  382. package/dist/services/thread/util.js.map +1 -0
  383. package/dist/services/user/index.d.ts.map +1 -0
  384. package/dist/services/user/index.js.map +1 -0
  385. package/dist/services/user/util.d.ts.map +1 -0
  386. package/dist/services/user/util.js.map +1 -0
  387. package/dist/services/user/whoami.d.ts.map +1 -0
  388. package/dist/services/user/whoami.js.map +1 -0
  389. package/dist/services/vector/index.d.ts +2 -0
  390. package/dist/services/vector/index.d.ts.map +1 -0
  391. package/dist/services/vector/index.js +2 -0
  392. package/dist/services/vector/index.js.map +1 -0
  393. package/dist/services/vector/service.d.ts +459 -0
  394. package/dist/services/vector/service.d.ts.map +1 -0
  395. package/dist/services/vector/service.js +707 -0
  396. package/dist/services/vector/service.js.map +1 -0
  397. package/dist/services/webhook/analytics.d.ts +77 -0
  398. package/dist/services/webhook/analytics.d.ts.map +1 -0
  399. package/dist/services/webhook/analytics.js +56 -0
  400. package/dist/services/webhook/analytics.js.map +1 -0
  401. package/dist/services/webhook/deliveries.d.ts +94 -0
  402. package/dist/services/webhook/deliveries.d.ts.map +1 -0
  403. package/dist/services/webhook/deliveries.js.map +1 -0
  404. package/dist/services/webhook/destinations.d.ts +140 -0
  405. package/dist/services/webhook/destinations.d.ts.map +1 -0
  406. package/dist/services/webhook/destinations.js.map +1 -0
  407. package/dist/services/webhook/index.d.ts +43 -0
  408. package/dist/services/webhook/index.d.ts.map +1 -0
  409. package/dist/services/webhook/index.js +64 -0
  410. package/dist/services/webhook/index.js.map +1 -0
  411. package/dist/services/webhook/receipts.d.ts.map +1 -0
  412. package/dist/services/webhook/receipts.js.map +1 -0
  413. package/dist/services/webhook/service.d.ts +374 -0
  414. package/dist/services/webhook/service.d.ts.map +1 -0
  415. package/dist/services/webhook/service.js +663 -0
  416. package/dist/services/webhook/service.js.map +1 -0
  417. package/dist/services/webhook/types.d.ts +182 -0
  418. package/dist/services/webhook/types.d.ts.map +1 -0
  419. package/dist/services/webhook/types.js +188 -0
  420. package/dist/services/webhook/types.js.map +1 -0
  421. package/dist/services/webhook/util.d.ts.map +1 -0
  422. package/dist/services/webhook/util.js.map +1 -0
  423. package/dist/services/webhook/webhooks.d.ts +150 -0
  424. package/dist/services/webhook/webhooks.d.ts.map +1 -0
  425. package/dist/services/webhook/webhooks.js.map +1 -0
  426. package/package.json +59 -7
  427. package/src/index.ts +6 -247
  428. package/src/services/adapter.ts +69 -24
  429. package/src/services/api.ts +951 -0
  430. package/src/services/apikey/create.ts +48 -0
  431. package/src/services/apikey/list.ts +66 -0
  432. package/src/services/config.ts +65 -0
  433. package/src/services/db/index.ts +42 -0
  434. package/src/services/db/query.ts +69 -0
  435. package/src/services/db/stats.ts +121 -0
  436. package/src/services/db/tables.ts +94 -0
  437. package/src/services/email/index.ts +1 -0
  438. package/src/services/email/service.ts +1476 -0
  439. package/src/services/eval/index.ts +29 -0
  440. package/src/services/exception.ts +16 -7
  441. package/src/services/index.ts +29 -28
  442. package/src/services/keyvalue/index.ts +1 -0
  443. package/src/services/keyvalue/service.ts +677 -0
  444. package/src/services/machine/machine.ts +228 -0
  445. package/src/services/org/env-get.ts +48 -0
  446. package/src/services/org/resources.ts +140 -0
  447. package/src/services/pagination.ts +40 -11
  448. package/src/services/project/delete.ts +27 -0
  449. package/src/services/project/deploy.ts +433 -0
  450. package/src/services/project/deployment.ts +250 -0
  451. package/src/services/project/hostname.ts +79 -0
  452. package/src/services/project/malware.ts +85 -0
  453. package/src/services/queue/analytics.ts +343 -0
  454. package/src/services/queue/consumers.ts +56 -0
  455. package/src/services/queue/destinations.ts +329 -0
  456. package/src/services/queue/index.ts +339 -0
  457. package/src/services/queue/service.ts +634 -0
  458. package/src/services/queue/sources.ts +364 -0
  459. package/src/services/queue/types.ts +1666 -0
  460. package/src/services/queue/util.ts +275 -0
  461. package/src/services/queue/validation.ts +541 -0
  462. package/src/services/queue/websocket.ts +578 -0
  463. package/src/services/sandbox/cli-list.ts +117 -0
  464. package/src/services/sandbox/client.ts +435 -0
  465. package/src/services/sandbox/create.ts +249 -0
  466. package/src/services/sandbox/destroy.ts +43 -0
  467. package/src/services/sandbox/disk-checkpoint.ts +184 -0
  468. package/src/services/sandbox/execute.ts +134 -0
  469. package/src/services/sandbox/execution.ts +144 -0
  470. package/src/services/sandbox/files.ts +608 -0
  471. package/src/services/sandbox/get.ts +262 -0
  472. package/src/services/sandbox/getStatus.ts +51 -0
  473. package/src/services/sandbox/index.ts +230 -0
  474. package/src/services/sandbox/list.ts +234 -0
  475. package/src/services/sandbox/pause.ts +41 -0
  476. package/src/services/sandbox/resolve.ts +96 -0
  477. package/src/services/sandbox/resume.ts +41 -0
  478. package/src/services/sandbox/run.ts +441 -0
  479. package/src/services/sandbox/runtime.ts +106 -0
  480. package/src/services/sandbox/snapshot.ts +791 -0
  481. package/src/services/sandbox/types.ts +798 -0
  482. package/src/services/sandbox/util.ts +279 -0
  483. package/src/services/schedule/index.ts +1 -0
  484. package/src/services/schedule/service.ts +814 -0
  485. package/src/services/session/get.ts +108 -0
  486. package/src/services/session/index.ts +4 -0
  487. package/src/services/session/list.ts +143 -0
  488. package/src/services/stats.ts +232 -0
  489. package/src/services/storage/objects.ts +256 -0
  490. package/src/services/stream/index.ts +14 -0
  491. package/src/services/stream/list.ts +105 -0
  492. package/src/services/stream/service.ts +929 -0
  493. package/src/services/task/index.ts +1 -0
  494. package/src/services/task/service.ts +2573 -0
  495. package/src/services/thread/list.ts +81 -0
  496. package/src/services/vector/index.ts +1 -0
  497. package/src/services/vector/service.ts +1242 -0
  498. package/src/services/webhook/analytics.ts +80 -0
  499. package/src/services/webhook/index.ts +160 -0
  500. package/src/services/webhook/service.ts +900 -0
  501. package/src/services/webhook/types.ts +277 -0
  502. package/dist/api/api.d.ts +0 -226
  503. package/dist/api/api.d.ts.map +0 -1
  504. package/dist/api/api.js +0 -635
  505. package/dist/api/api.js.map +0 -1
  506. package/dist/api/apikey/create.d.ts +0 -33
  507. package/dist/api/apikey/create.d.ts.map +0 -1
  508. package/dist/api/apikey/create.js +0 -23
  509. package/dist/api/apikey/create.js.map +0 -1
  510. package/dist/api/apikey/delete.d.ts.map +0 -1
  511. package/dist/api/apikey/delete.js.map +0 -1
  512. package/dist/api/apikey/get.d.ts.map +0 -1
  513. package/dist/api/apikey/get.js.map +0 -1
  514. package/dist/api/apikey/index.d.ts.map +0 -1
  515. package/dist/api/apikey/index.js.map +0 -1
  516. package/dist/api/apikey/list.d.ts +0 -64
  517. package/dist/api/apikey/list.d.ts.map +0 -1
  518. package/dist/api/apikey/list.js +0 -46
  519. package/dist/api/apikey/list.js.map +0 -1
  520. package/dist/api/apikey/util.d.ts.map +0 -1
  521. package/dist/api/apikey/util.js.map +0 -1
  522. package/dist/api/config.d.ts +0 -20
  523. package/dist/api/config.d.ts.map +0 -1
  524. package/dist/api/config.js +0 -43
  525. package/dist/api/config.js.map +0 -1
  526. package/dist/api/db/index.d.ts +0 -5
  527. package/dist/api/db/index.d.ts.map +0 -1
  528. package/dist/api/db/index.js +0 -5
  529. package/dist/api/db/index.js.map +0 -1
  530. package/dist/api/db/logs.d.ts.map +0 -1
  531. package/dist/api/db/logs.js.map +0 -1
  532. package/dist/api/db/query.d.ts +0 -39
  533. package/dist/api/db/query.d.ts.map +0 -1
  534. package/dist/api/db/query.js +0 -49
  535. package/dist/api/db/query.js.map +0 -1
  536. package/dist/api/db/tables.d.ts +0 -49
  537. package/dist/api/db/tables.d.ts.map +0 -1
  538. package/dist/api/db/tables.js +0 -59
  539. package/dist/api/db/tables.js.map +0 -1
  540. package/dist/api/db/util.d.ts.map +0 -1
  541. package/dist/api/db/util.js.map +0 -1
  542. package/dist/api/env.d.ts.map +0 -1
  543. package/dist/api/env.js.map +0 -1
  544. package/dist/api/eval/get.d.ts.map +0 -1
  545. package/dist/api/eval/get.js.map +0 -1
  546. package/dist/api/eval/index.d.ts +0 -5
  547. package/dist/api/eval/index.d.ts.map +0 -1
  548. package/dist/api/eval/index.js +0 -5
  549. package/dist/api/eval/index.js.map +0 -1
  550. package/dist/api/eval/list.d.ts.map +0 -1
  551. package/dist/api/eval/list.js.map +0 -1
  552. package/dist/api/eval/run-get.d.ts.map +0 -1
  553. package/dist/api/eval/run-get.js.map +0 -1
  554. package/dist/api/eval/run-list.d.ts.map +0 -1
  555. package/dist/api/eval/run-list.js.map +0 -1
  556. package/dist/api/index.d.ts +0 -21
  557. package/dist/api/index.d.ts.map +0 -1
  558. package/dist/api/index.js +0 -21
  559. package/dist/api/index.js.map +0 -1
  560. package/dist/api/logger.d.ts.map +0 -1
  561. package/dist/api/logger.js.map +0 -1
  562. package/dist/api/machine/index.d.ts.map +0 -1
  563. package/dist/api/machine/index.js.map +0 -1
  564. package/dist/api/machine/machine.d.ts.map +0 -1
  565. package/dist/api/machine/machine.js +0 -109
  566. package/dist/api/machine/machine.js.map +0 -1
  567. package/dist/api/machine/util.d.ts.map +0 -1
  568. package/dist/api/machine/util.js.map +0 -1
  569. package/dist/api/org/env-delete.d.ts.map +0 -1
  570. package/dist/api/org/env-delete.js.map +0 -1
  571. package/dist/api/org/env-get.d.ts +0 -33
  572. package/dist/api/org/env-get.d.ts.map +0 -1
  573. package/dist/api/org/env-get.js +0 -26
  574. package/dist/api/org/env-get.js.map +0 -1
  575. package/dist/api/org/env-update.d.ts.map +0 -1
  576. package/dist/api/org/env-update.js.map +0 -1
  577. package/dist/api/org/index.d.ts.map +0 -1
  578. package/dist/api/org/index.js.map +0 -1
  579. package/dist/api/org/list.d.ts.map +0 -1
  580. package/dist/api/org/list.js.map +0 -1
  581. package/dist/api/org/resources.d.ts +0 -141
  582. package/dist/api/org/resources.d.ts.map +0 -1
  583. package/dist/api/org/resources.js +0 -97
  584. package/dist/api/org/resources.js.map +0 -1
  585. package/dist/api/org/util.d.ts.map +0 -1
  586. package/dist/api/org/util.js.map +0 -1
  587. package/dist/api/project/agent.d.ts.map +0 -1
  588. package/dist/api/project/agent.js.map +0 -1
  589. package/dist/api/project/create.d.ts.map +0 -1
  590. package/dist/api/project/create.js.map +0 -1
  591. package/dist/api/project/delete.d.ts.map +0 -1
  592. package/dist/api/project/delete.js +0 -13
  593. package/dist/api/project/delete.js.map +0 -1
  594. package/dist/api/project/deploy.d.ts +0 -490
  595. package/dist/api/project/deploy.d.ts.map +0 -1
  596. package/dist/api/project/deploy.js.map +0 -1
  597. package/dist/api/project/deployment.d.ts.map +0 -1
  598. package/dist/api/project/deployment.js +0 -127
  599. package/dist/api/project/deployment.js.map +0 -1
  600. package/dist/api/project/env-delete.d.ts.map +0 -1
  601. package/dist/api/project/env-delete.js.map +0 -1
  602. package/dist/api/project/env-update.d.ts.map +0 -1
  603. package/dist/api/project/env-update.js.map +0 -1
  604. package/dist/api/project/exists.d.ts.map +0 -1
  605. package/dist/api/project/exists.js.map +0 -1
  606. package/dist/api/project/get.d.ts.map +0 -1
  607. package/dist/api/project/get.js.map +0 -1
  608. package/dist/api/project/hostname.d.ts.map +0 -1
  609. package/dist/api/project/hostname.js +0 -37
  610. package/dist/api/project/hostname.js.map +0 -1
  611. package/dist/api/project/index.d.ts.map +0 -1
  612. package/dist/api/project/index.js.map +0 -1
  613. package/dist/api/project/list.d.ts.map +0 -1
  614. package/dist/api/project/list.js.map +0 -1
  615. package/dist/api/project/malware.d.ts.map +0 -1
  616. package/dist/api/project/malware.js +0 -42
  617. package/dist/api/project/malware.js.map +0 -1
  618. package/dist/api/project/update-region.d.ts.map +0 -1
  619. package/dist/api/project/update-region.js.map +0 -1
  620. package/dist/api/project/util.d.ts.map +0 -1
  621. package/dist/api/project/util.js.map +0 -1
  622. package/dist/api/queue/analytics.d.ts +0 -250
  623. package/dist/api/queue/analytics.d.ts.map +0 -1
  624. package/dist/api/queue/analytics.js +0 -233
  625. package/dist/api/queue/analytics.js.map +0 -1
  626. package/dist/api/queue/destinations.d.ts +0 -202
  627. package/dist/api/queue/destinations.d.ts.map +0 -1
  628. package/dist/api/queue/destinations.js +0 -168
  629. package/dist/api/queue/destinations.js.map +0 -1
  630. package/dist/api/queue/dlq.d.ts +0 -168
  631. package/dist/api/queue/dlq.d.ts.map +0 -1
  632. package/dist/api/queue/dlq.js.map +0 -1
  633. package/dist/api/queue/index.d.ts +0 -56
  634. package/dist/api/queue/index.d.ts.map +0 -1
  635. package/dist/api/queue/index.js +0 -90
  636. package/dist/api/queue/index.js.map +0 -1
  637. package/dist/api/queue/messages.d.ts +0 -503
  638. package/dist/api/queue/messages.d.ts.map +0 -1
  639. package/dist/api/queue/messages.js.map +0 -1
  640. package/dist/api/queue/queues.d.ts +0 -226
  641. package/dist/api/queue/queues.d.ts.map +0 -1
  642. package/dist/api/queue/queues.js.map +0 -1
  643. package/dist/api/queue/sources.d.ts +0 -202
  644. package/dist/api/queue/sources.d.ts.map +0 -1
  645. package/dist/api/queue/sources.js +0 -202
  646. package/dist/api/queue/sources.js.map +0 -1
  647. package/dist/api/queue/types.d.ts +0 -1218
  648. package/dist/api/queue/types.d.ts.map +0 -1
  649. package/dist/api/queue/types.js +0 -1002
  650. package/dist/api/queue/types.js.map +0 -1
  651. package/dist/api/queue/util.d.ts +0 -278
  652. package/dist/api/queue/util.d.ts.map +0 -1
  653. package/dist/api/queue/util.js +0 -233
  654. package/dist/api/queue/util.js.map +0 -1
  655. package/dist/api/queue/validation.d.ts +0 -247
  656. package/dist/api/queue/validation.d.ts.map +0 -1
  657. package/dist/api/queue/validation.js +0 -513
  658. package/dist/api/queue/validation.js.map +0 -1
  659. package/dist/api/queue/websocket.d.ts +0 -172
  660. package/dist/api/queue/websocket.d.ts.map +0 -1
  661. package/dist/api/queue/websocket.js +0 -396
  662. package/dist/api/queue/websocket.js.map +0 -1
  663. package/dist/api/region/create.d.ts.map +0 -1
  664. package/dist/api/region/create.js.map +0 -1
  665. package/dist/api/region/delete.d.ts.map +0 -1
  666. package/dist/api/region/delete.js.map +0 -1
  667. package/dist/api/region/index.d.ts.map +0 -1
  668. package/dist/api/region/index.js.map +0 -1
  669. package/dist/api/region/list.d.ts.map +0 -1
  670. package/dist/api/region/list.js.map +0 -1
  671. package/dist/api/region/resources.d.ts.map +0 -1
  672. package/dist/api/region/resources.js.map +0 -1
  673. package/dist/api/region/util.d.ts.map +0 -1
  674. package/dist/api/region/util.js.map +0 -1
  675. package/dist/api/sandbox/cli-list.d.ts +0 -114
  676. package/dist/api/sandbox/cli-list.d.ts.map +0 -1
  677. package/dist/api/sandbox/cli-list.js +0 -71
  678. package/dist/api/sandbox/cli-list.js.map +0 -1
  679. package/dist/api/sandbox/client.d.ts +0 -192
  680. package/dist/api/sandbox/client.d.ts.map +0 -1
  681. package/dist/api/sandbox/client.js +0 -262
  682. package/dist/api/sandbox/client.js.map +0 -1
  683. package/dist/api/sandbox/create.d.ts +0 -118
  684. package/dist/api/sandbox/create.d.ts.map +0 -1
  685. package/dist/api/sandbox/create.js +0 -211
  686. package/dist/api/sandbox/create.js.map +0 -1
  687. package/dist/api/sandbox/destroy.d.ts +0 -22
  688. package/dist/api/sandbox/destroy.d.ts.map +0 -1
  689. package/dist/api/sandbox/destroy.js +0 -25
  690. package/dist/api/sandbox/destroy.js.map +0 -1
  691. package/dist/api/sandbox/disk-checkpoint.d.ts +0 -104
  692. package/dist/api/sandbox/disk-checkpoint.d.ts.map +0 -1
  693. package/dist/api/sandbox/disk-checkpoint.js +0 -104
  694. package/dist/api/sandbox/disk-checkpoint.js.map +0 -1
  695. package/dist/api/sandbox/execute.d.ts +0 -69
  696. package/dist/api/sandbox/execute.d.ts.map +0 -1
  697. package/dist/api/sandbox/execute.js +0 -103
  698. package/dist/api/sandbox/execute.js.map +0 -1
  699. package/dist/api/sandbox/execution.d.ts +0 -169
  700. package/dist/api/sandbox/execution.d.ts.map +0 -1
  701. package/dist/api/sandbox/execution.js +0 -118
  702. package/dist/api/sandbox/execution.js.map +0 -1
  703. package/dist/api/sandbox/files.d.ts +0 -261
  704. package/dist/api/sandbox/files.d.ts.map +0 -1
  705. package/dist/api/sandbox/files.js +0 -386
  706. package/dist/api/sandbox/files.js.map +0 -1
  707. package/dist/api/sandbox/get.d.ts +0 -283
  708. package/dist/api/sandbox/get.d.ts.map +0 -1
  709. package/dist/api/sandbox/get.js +0 -215
  710. package/dist/api/sandbox/get.js.map +0 -1
  711. package/dist/api/sandbox/getStatus.d.ts +0 -16
  712. package/dist/api/sandbox/getStatus.d.ts.map +0 -1
  713. package/dist/api/sandbox/getStatus.js +0 -32
  714. package/dist/api/sandbox/getStatus.js.map +0 -1
  715. package/dist/api/sandbox/index.d.ts +0 -39
  716. package/dist/api/sandbox/index.d.ts.map +0 -1
  717. package/dist/api/sandbox/index.js +0 -20
  718. package/dist/api/sandbox/index.js.map +0 -1
  719. package/dist/api/sandbox/list.d.ts +0 -293
  720. package/dist/api/sandbox/list.d.ts.map +0 -1
  721. package/dist/api/sandbox/list.js +0 -191
  722. package/dist/api/sandbox/list.js.map +0 -1
  723. package/dist/api/sandbox/pause.d.ts +0 -22
  724. package/dist/api/sandbox/pause.d.ts.map +0 -1
  725. package/dist/api/sandbox/pause.js +0 -25
  726. package/dist/api/sandbox/pause.js.map +0 -1
  727. package/dist/api/sandbox/resolve.d.ts +0 -82
  728. package/dist/api/sandbox/resolve.d.ts.map +0 -1
  729. package/dist/api/sandbox/resolve.js +0 -71
  730. package/dist/api/sandbox/resolve.js.map +0 -1
  731. package/dist/api/sandbox/resume.d.ts +0 -22
  732. package/dist/api/sandbox/resume.d.ts.map +0 -1
  733. package/dist/api/sandbox/resume.js +0 -25
  734. package/dist/api/sandbox/resume.js.map +0 -1
  735. package/dist/api/sandbox/run.d.ts +0 -28
  736. package/dist/api/sandbox/run.d.ts.map +0 -1
  737. package/dist/api/sandbox/run.js +0 -342
  738. package/dist/api/sandbox/run.js.map +0 -1
  739. package/dist/api/sandbox/runtime.d.ts +0 -83
  740. package/dist/api/sandbox/runtime.d.ts.map +0 -1
  741. package/dist/api/sandbox/runtime.js +0 -78
  742. package/dist/api/sandbox/runtime.js.map +0 -1
  743. package/dist/api/sandbox/snapshot-build.d.ts.map +0 -1
  744. package/dist/api/sandbox/snapshot-build.js.map +0 -1
  745. package/dist/api/sandbox/snapshot.d.ts +0 -595
  746. package/dist/api/sandbox/snapshot.d.ts.map +0 -1
  747. package/dist/api/sandbox/snapshot.js +0 -598
  748. package/dist/api/sandbox/snapshot.js.map +0 -1
  749. package/dist/api/sandbox/util.d.ts +0 -284
  750. package/dist/api/sandbox/util.d.ts.map +0 -1
  751. package/dist/api/sandbox/util.js +0 -210
  752. package/dist/api/sandbox/util.js.map +0 -1
  753. package/dist/api/services/index.d.ts +0 -2
  754. package/dist/api/services/index.d.ts.map +0 -1
  755. package/dist/api/services/index.js +0 -2
  756. package/dist/api/services/index.js.map +0 -1
  757. package/dist/api/services/stats.d.ts +0 -263
  758. package/dist/api/services/stats.d.ts.map +0 -1
  759. package/dist/api/services/stats.js +0 -144
  760. package/dist/api/services/stats.js.map +0 -1
  761. package/dist/api/session/get.d.ts +0 -169
  762. package/dist/api/session/get.d.ts.map +0 -1
  763. package/dist/api/session/get.js.map +0 -1
  764. package/dist/api/session/index.d.ts +0 -4
  765. package/dist/api/session/index.d.ts.map +0 -1
  766. package/dist/api/session/index.js +0 -4
  767. package/dist/api/session/index.js.map +0 -1
  768. package/dist/api/session/list.d.ts +0 -143
  769. package/dist/api/session/list.d.ts.map +0 -1
  770. package/dist/api/session/list.js +0 -91
  771. package/dist/api/session/list.js.map +0 -1
  772. package/dist/api/session/logs.d.ts.map +0 -1
  773. package/dist/api/session/logs.js.map +0 -1
  774. package/dist/api/session/util.d.ts.map +0 -1
  775. package/dist/api/session/util.js.map +0 -1
  776. package/dist/api/storage/config.d.ts.map +0 -1
  777. package/dist/api/storage/config.js.map +0 -1
  778. package/dist/api/storage/index.d.ts.map +0 -1
  779. package/dist/api/storage/index.js.map +0 -1
  780. package/dist/api/storage/objects.d.ts +0 -155
  781. package/dist/api/storage/objects.d.ts.map +0 -1
  782. package/dist/api/storage/objects.js +0 -148
  783. package/dist/api/storage/objects.js.map +0 -1
  784. package/dist/api/storage/types.d.ts.map +0 -1
  785. package/dist/api/storage/types.js.map +0 -1
  786. package/dist/api/storage/util.d.ts.map +0 -1
  787. package/dist/api/storage/util.js.map +0 -1
  788. package/dist/api/stream/get.d.ts.map +0 -1
  789. package/dist/api/stream/get.js.map +0 -1
  790. package/dist/api/stream/index.d.ts +0 -4
  791. package/dist/api/stream/index.d.ts.map +0 -1
  792. package/dist/api/stream/index.js +0 -4
  793. package/dist/api/stream/index.js.map +0 -1
  794. package/dist/api/stream/list.d.ts +0 -120
  795. package/dist/api/stream/list.d.ts.map +0 -1
  796. package/dist/api/stream/list.js +0 -77
  797. package/dist/api/stream/list.js.map +0 -1
  798. package/dist/api/stream/util.d.ts.map +0 -1
  799. package/dist/api/stream/util.js.map +0 -1
  800. package/dist/api/thread/delete.d.ts.map +0 -1
  801. package/dist/api/thread/delete.js.map +0 -1
  802. package/dist/api/thread/get.d.ts.map +0 -1
  803. package/dist/api/thread/get.js.map +0 -1
  804. package/dist/api/thread/index.d.ts.map +0 -1
  805. package/dist/api/thread/index.js.map +0 -1
  806. package/dist/api/thread/list.d.ts +0 -69
  807. package/dist/api/thread/list.d.ts.map +0 -1
  808. package/dist/api/thread/list.js +0 -51
  809. package/dist/api/thread/list.js.map +0 -1
  810. package/dist/api/thread/util.d.ts.map +0 -1
  811. package/dist/api/thread/util.js.map +0 -1
  812. package/dist/api/user/index.d.ts.map +0 -1
  813. package/dist/api/user/index.js.map +0 -1
  814. package/dist/api/user/util.d.ts.map +0 -1
  815. package/dist/api/user/util.js.map +0 -1
  816. package/dist/api/user/whoami.d.ts.map +0 -1
  817. package/dist/api/user/whoami.js.map +0 -1
  818. package/dist/api/webhook/deliveries.d.ts +0 -94
  819. package/dist/api/webhook/deliveries.d.ts.map +0 -1
  820. package/dist/api/webhook/deliveries.js.map +0 -1
  821. package/dist/api/webhook/destinations.d.ts +0 -136
  822. package/dist/api/webhook/destinations.d.ts.map +0 -1
  823. package/dist/api/webhook/destinations.js.map +0 -1
  824. package/dist/api/webhook/index.d.ts +0 -41
  825. package/dist/api/webhook/index.d.ts.map +0 -1
  826. package/dist/api/webhook/index.js +0 -59
  827. package/dist/api/webhook/index.js.map +0 -1
  828. package/dist/api/webhook/receipts.d.ts.map +0 -1
  829. package/dist/api/webhook/receipts.js.map +0 -1
  830. package/dist/api/webhook/types.d.ts +0 -249
  831. package/dist/api/webhook/types.d.ts.map +0 -1
  832. package/dist/api/webhook/types.js +0 -221
  833. package/dist/api/webhook/types.js.map +0 -1
  834. package/dist/api/webhook/util.d.ts.map +0 -1
  835. package/dist/api/webhook/util.js.map +0 -1
  836. package/dist/api/webhook/webhooks.d.ts +0 -146
  837. package/dist/api/webhook/webhooks.d.ts.map +0 -1
  838. package/dist/api/webhook/webhooks.js.map +0 -1
  839. package/dist/services/email.d.ts +0 -901
  840. package/dist/services/email.d.ts.map +0 -1
  841. package/dist/services/email.js +0 -722
  842. package/dist/services/email.js.map +0 -1
  843. package/dist/services/evalrun.d.ts +0 -93
  844. package/dist/services/evalrun.d.ts.map +0 -1
  845. package/dist/services/evalrun.js +0 -24
  846. package/dist/services/evalrun.js.map +0 -1
  847. package/dist/services/keyvalue.d.ts +0 -283
  848. package/dist/services/keyvalue.d.ts.map +0 -1
  849. package/dist/services/keyvalue.js +0 -305
  850. package/dist/services/keyvalue.js.map +0 -1
  851. package/dist/services/queue.d.ts +0 -361
  852. package/dist/services/queue.d.ts.map +0 -1
  853. package/dist/services/queue.js +0 -308
  854. package/dist/services/queue.js.map +0 -1
  855. package/dist/services/sandbox.d.ts +0 -1241
  856. package/dist/services/sandbox.d.ts.map +0 -1
  857. package/dist/services/sandbox.js +0 -6
  858. package/dist/services/sandbox.js.map +0 -1
  859. package/dist/services/schedule.d.ts +0 -501
  860. package/dist/services/schedule.d.ts.map +0 -1
  861. package/dist/services/schedule.js +0 -425
  862. package/dist/services/schedule.js.map +0 -1
  863. package/dist/services/session.d.ts +0 -127
  864. package/dist/services/session.d.ts.map +0 -1
  865. package/dist/services/session.js +0 -42
  866. package/dist/services/session.js.map +0 -1
  867. package/dist/services/stream.d.ts +0 -293
  868. package/dist/services/stream.d.ts.map +0 -1
  869. package/dist/services/stream.js +0 -500
  870. package/dist/services/stream.js.map +0 -1
  871. package/dist/services/task.d.ts +0 -1337
  872. package/dist/services/task.d.ts.map +0 -1
  873. package/dist/services/task.js +0 -1397
  874. package/dist/services/task.js.map +0 -1
  875. package/dist/services/vector.d.ts +0 -498
  876. package/dist/services/vector.d.ts.map +0 -1
  877. package/dist/services/vector.js +0 -381
  878. package/dist/services/vector.js.map +0 -1
  879. package/dist/services/webhook.d.ts +0 -454
  880. package/dist/services/webhook.d.ts.map +0 -1
  881. package/dist/services/webhook.js +0 -589
  882. package/dist/services/webhook.js.map +0 -1
  883. package/src/api/api.ts +0 -931
  884. package/src/api/apikey/create.ts +0 -41
  885. package/src/api/apikey/list.ts +0 -64
  886. package/src/api/config.ts +0 -60
  887. package/src/api/db/index.ts +0 -27
  888. package/src/api/db/query.ts +0 -67
  889. package/src/api/db/tables.ts +0 -92
  890. package/src/api/eval/index.ts +0 -28
  891. package/src/api/index.ts +0 -20
  892. package/src/api/machine/machine.ts +0 -160
  893. package/src/api/org/env-get.ts +0 -43
  894. package/src/api/org/resources.ts +0 -140
  895. package/src/api/project/delete.ts +0 -25
  896. package/src/api/project/deploy.ts +0 -458
  897. package/src/api/project/deployment.ts +0 -195
  898. package/src/api/project/hostname.ts +0 -73
  899. package/src/api/project/malware.ts +0 -68
  900. package/src/api/queue/analytics.ts +0 -311
  901. package/src/api/queue/destinations.ts +0 -259
  902. package/src/api/queue/index.ts +0 -308
  903. package/src/api/queue/sources.ts +0 -294
  904. package/src/api/queue/types.ts +0 -1325
  905. package/src/api/queue/util.ts +0 -275
  906. package/src/api/queue/validation.ts +0 -560
  907. package/src/api/queue/websocket.ts +0 -521
  908. package/src/api/sandbox/cli-list.ts +0 -127
  909. package/src/api/sandbox/client.ts +0 -460
  910. package/src/api/sandbox/create.ts +0 -256
  911. package/src/api/sandbox/destroy.ts +0 -41
  912. package/src/api/sandbox/disk-checkpoint.ts +0 -179
  913. package/src/api/sandbox/execute.ts +0 -132
  914. package/src/api/sandbox/execution.ts +0 -183
  915. package/src/api/sandbox/files.ts +0 -596
  916. package/src/api/sandbox/get.ts +0 -249
  917. package/src/api/sandbox/getStatus.ts +0 -54
  918. package/src/api/sandbox/index.ts +0 -211
  919. package/src/api/sandbox/list.ts +0 -224
  920. package/src/api/sandbox/pause.ts +0 -39
  921. package/src/api/sandbox/resolve.ts +0 -98
  922. package/src/api/sandbox/resume.ts +0 -39
  923. package/src/api/sandbox/run.ts +0 -439
  924. package/src/api/sandbox/runtime.ts +0 -104
  925. package/src/api/sandbox/snapshot.ts +0 -781
  926. package/src/api/sandbox/util.ts +0 -275
  927. package/src/api/services/index.ts +0 -1
  928. package/src/api/services/stats.ts +0 -213
  929. package/src/api/session/get.ts +0 -106
  930. package/src/api/session/index.ts +0 -3
  931. package/src/api/session/list.ts +0 -136
  932. package/src/api/storage/objects.ts +0 -250
  933. package/src/api/stream/index.ts +0 -3
  934. package/src/api/stream/list.ts +0 -127
  935. package/src/api/thread/list.ts +0 -76
  936. package/src/api/webhook/index.ts +0 -133
  937. package/src/api/webhook/types.ts +0 -309
  938. package/src/services/email.ts +0 -1410
  939. package/src/services/keyvalue.ts +0 -620
  940. package/src/services/queue.ts +0 -603
  941. package/src/services/sandbox.ts +0 -1466
  942. package/src/services/schedule.ts +0 -763
  943. package/src/services/stream.ts +0 -886
  944. package/src/services/task.ts +0 -2611
  945. package/src/services/vector.ts +0 -1119
  946. package/src/services/webhook.ts +0 -921
  947. /package/dist/{api → services}/apikey/delete.d.ts +0 -0
  948. /package/dist/{api → services}/apikey/delete.js +0 -0
  949. /package/dist/{api → services}/apikey/get.d.ts +0 -0
  950. /package/dist/{api → services}/apikey/get.js +0 -0
  951. /package/dist/{api → services}/apikey/index.d.ts +0 -0
  952. /package/dist/{api → services}/apikey/index.js +0 -0
  953. /package/dist/{api → services}/apikey/util.d.ts +0 -0
  954. /package/dist/{api → services}/apikey/util.js +0 -0
  955. /package/dist/{api → services}/db/logs.d.ts +0 -0
  956. /package/dist/{api → services}/db/logs.js +0 -0
  957. /package/dist/{api → services}/db/util.d.ts +0 -0
  958. /package/dist/{api → services}/db/util.js +0 -0
  959. /package/dist/{api → services}/env.d.ts +0 -0
  960. /package/dist/{api → services}/env.js +0 -0
  961. /package/dist/{api → services}/eval/get.d.ts +0 -0
  962. /package/dist/{api → services}/eval/get.js +0 -0
  963. /package/dist/{api → services}/eval/list.d.ts +0 -0
  964. /package/dist/{api → services}/eval/list.js +0 -0
  965. /package/dist/{api → services}/eval/run-get.d.ts +0 -0
  966. /package/dist/{api → services}/eval/run-get.js +0 -0
  967. /package/dist/{api → services}/eval/run-list.d.ts +0 -0
  968. /package/dist/{api → services}/eval/run-list.js +0 -0
  969. /package/dist/{api → services}/logger.d.ts +0 -0
  970. /package/dist/{api → services}/logger.js +0 -0
  971. /package/dist/{api → services}/machine/index.d.ts +0 -0
  972. /package/dist/{api → services}/machine/index.js +0 -0
  973. /package/dist/{api → services}/machine/machine.d.ts +0 -0
  974. /package/dist/{api → services}/machine/util.d.ts +0 -0
  975. /package/dist/{api → services}/machine/util.js +0 -0
  976. /package/dist/{api → services}/org/env-delete.d.ts +0 -0
  977. /package/dist/{api → services}/org/env-delete.js +0 -0
  978. /package/dist/{api → services}/org/env-update.d.ts +0 -0
  979. /package/dist/{api → services}/org/env-update.js +0 -0
  980. /package/dist/{api → services}/org/index.d.ts +0 -0
  981. /package/dist/{api → services}/org/index.js +0 -0
  982. /package/dist/{api → services}/org/list.d.ts +0 -0
  983. /package/dist/{api → services}/org/list.js +0 -0
  984. /package/dist/{api → services}/org/util.d.ts +0 -0
  985. /package/dist/{api → services}/org/util.js +0 -0
  986. /package/dist/{api → services}/project/agent.d.ts +0 -0
  987. /package/dist/{api → services}/project/agent.js +0 -0
  988. /package/dist/{api → services}/project/create.d.ts +0 -0
  989. /package/dist/{api → services}/project/create.js +0 -0
  990. /package/dist/{api → services}/project/delete.d.ts +0 -0
  991. /package/dist/{api → services}/project/deploy.js +0 -0
  992. /package/dist/{api → services}/project/deployment.d.ts +0 -0
  993. /package/dist/{api → services}/project/env-delete.d.ts +0 -0
  994. /package/dist/{api → services}/project/env-delete.js +0 -0
  995. /package/dist/{api → services}/project/env-update.d.ts +0 -0
  996. /package/dist/{api → services}/project/env-update.js +0 -0
  997. /package/dist/{api → services}/project/exists.d.ts +0 -0
  998. /package/dist/{api → services}/project/exists.js +0 -0
  999. /package/dist/{api → services}/project/get.d.ts +0 -0
  1000. /package/dist/{api → services}/project/get.js +0 -0
  1001. /package/dist/{api → services}/project/hostname.d.ts +0 -0
  1002. /package/dist/{api → services}/project/index.d.ts +0 -0
  1003. /package/dist/{api → services}/project/index.js +0 -0
  1004. /package/dist/{api → services}/project/list.d.ts +0 -0
  1005. /package/dist/{api → services}/project/list.js +0 -0
  1006. /package/dist/{api → services}/project/malware.d.ts +0 -0
  1007. /package/dist/{api → services}/project/update-region.d.ts +0 -0
  1008. /package/dist/{api → services}/project/update-region.js +0 -0
  1009. /package/dist/{api → services}/project/util.d.ts +0 -0
  1010. /package/dist/{api → services}/project/util.js +0 -0
  1011. /package/dist/{api → services}/queue/dlq.js +0 -0
  1012. /package/dist/{api → services}/queue/messages.js +0 -0
  1013. /package/dist/{api → services}/queue/queues.js +0 -0
  1014. /package/dist/{api → services}/region/create.d.ts +0 -0
  1015. /package/dist/{api → services}/region/create.js +0 -0
  1016. /package/dist/{api → services}/region/delete.d.ts +0 -0
  1017. /package/dist/{api → services}/region/delete.js +0 -0
  1018. /package/dist/{api → services}/region/index.d.ts +0 -0
  1019. /package/dist/{api → services}/region/index.js +0 -0
  1020. /package/dist/{api → services}/region/list.d.ts +0 -0
  1021. /package/dist/{api → services}/region/list.js +0 -0
  1022. /package/dist/{api → services}/region/resources.d.ts +0 -0
  1023. /package/dist/{api → services}/region/resources.js +0 -0
  1024. /package/dist/{api → services}/region/util.d.ts +0 -0
  1025. /package/dist/{api → services}/region/util.js +0 -0
  1026. /package/dist/{api → services}/sandbox/snapshot-build.d.ts +0 -0
  1027. /package/dist/{api → services}/sandbox/snapshot-build.js +0 -0
  1028. /package/dist/{api → services}/session/get.js +0 -0
  1029. /package/dist/{api → services}/session/logs.d.ts +0 -0
  1030. /package/dist/{api → services}/session/logs.js +0 -0
  1031. /package/dist/{api → services}/session/util.d.ts +0 -0
  1032. /package/dist/{api → services}/session/util.js +0 -0
  1033. /package/dist/{api → services}/storage/config.d.ts +0 -0
  1034. /package/dist/{api → services}/storage/config.js +0 -0
  1035. /package/dist/{api → services}/storage/index.d.ts +0 -0
  1036. /package/dist/{api → services}/storage/index.js +0 -0
  1037. /package/dist/{api → services}/storage/types.d.ts +0 -0
  1038. /package/dist/{api → services}/storage/types.js +0 -0
  1039. /package/dist/{api → services}/storage/util.d.ts +0 -0
  1040. /package/dist/{api → services}/storage/util.js +0 -0
  1041. /package/dist/{api → services}/stream/get.d.ts +0 -0
  1042. /package/dist/{api → services}/stream/get.js +0 -0
  1043. /package/dist/{api → services}/stream/util.d.ts +0 -0
  1044. /package/dist/{api → services}/stream/util.js +0 -0
  1045. /package/dist/{api → services}/thread/delete.d.ts +0 -0
  1046. /package/dist/{api → services}/thread/delete.js +0 -0
  1047. /package/dist/{api → services}/thread/get.d.ts +0 -0
  1048. /package/dist/{api → services}/thread/get.js +0 -0
  1049. /package/dist/{api → services}/thread/index.d.ts +0 -0
  1050. /package/dist/{api → services}/thread/index.js +0 -0
  1051. /package/dist/{api → services}/thread/util.d.ts +0 -0
  1052. /package/dist/{api → services}/thread/util.js +0 -0
  1053. /package/dist/{api → services}/user/index.d.ts +0 -0
  1054. /package/dist/{api → services}/user/index.js +0 -0
  1055. /package/dist/{api → services}/user/util.d.ts +0 -0
  1056. /package/dist/{api → services}/user/util.js +0 -0
  1057. /package/dist/{api → services}/user/whoami.d.ts +0 -0
  1058. /package/dist/{api → services}/user/whoami.js +0 -0
  1059. /package/dist/{api → services}/webhook/deliveries.js +0 -0
  1060. /package/dist/{api → services}/webhook/destinations.js +0 -0
  1061. /package/dist/{api → services}/webhook/receipts.d.ts +0 -0
  1062. /package/dist/{api → services}/webhook/receipts.js +0 -0
  1063. /package/dist/{api → services}/webhook/util.d.ts +0 -0
  1064. /package/dist/{api → services}/webhook/util.js +0 -0
  1065. /package/dist/{api → services}/webhook/webhooks.js +0 -0
  1066. /package/src/{api → services}/api-example.md +0 -0
  1067. /package/src/{api → services}/apikey/delete.ts +0 -0
  1068. /package/src/{api → services}/apikey/get.ts +0 -0
  1069. /package/src/{api → services}/apikey/index.ts +0 -0
  1070. /package/src/{api → services}/apikey/util.ts +0 -0
  1071. /package/src/{api → services}/db/logs.ts +0 -0
  1072. /package/src/{api → services}/db/util.ts +0 -0
  1073. /package/src/{api → services}/env.ts +0 -0
  1074. /package/src/services/{evalrun.ts → eval/events.ts} +0 -0
  1075. /package/src/{api → services}/eval/get.ts +0 -0
  1076. /package/src/{api → services}/eval/list.ts +0 -0
  1077. /package/src/{api → services}/eval/run-get.ts +0 -0
  1078. /package/src/{api → services}/eval/run-list.ts +0 -0
  1079. /package/src/{api → services}/logger.ts +0 -0
  1080. /package/src/{api → services}/machine/index.ts +0 -0
  1081. /package/src/{api → services}/machine/util.ts +0 -0
  1082. /package/src/{api → services}/org/env-delete.ts +0 -0
  1083. /package/src/{api → services}/org/env-update.ts +0 -0
  1084. /package/src/{api → services}/org/index.ts +0 -0
  1085. /package/src/{api → services}/org/list.ts +0 -0
  1086. /package/src/{api → services}/org/util.ts +0 -0
  1087. /package/src/{api → services}/project/agent.ts +0 -0
  1088. /package/src/{api → services}/project/create.ts +0 -0
  1089. /package/src/{api → services}/project/env-delete.ts +0 -0
  1090. /package/src/{api → services}/project/env-update.ts +0 -0
  1091. /package/src/{api → services}/project/exists.ts +0 -0
  1092. /package/src/{api → services}/project/get.ts +0 -0
  1093. /package/src/{api → services}/project/index.ts +0 -0
  1094. /package/src/{api → services}/project/list.ts +0 -0
  1095. /package/src/{api → services}/project/update-region.ts +0 -0
  1096. /package/src/{api → services}/project/util.ts +0 -0
  1097. /package/src/{api → services}/queue/dlq.ts +0 -0
  1098. /package/src/{api → services}/queue/messages.ts +0 -0
  1099. /package/src/{api → services}/queue/queues.ts +0 -0
  1100. /package/src/{api → services}/region/create.ts +0 -0
  1101. /package/src/{api → services}/region/delete.ts +0 -0
  1102. /package/src/{api → services}/region/index.ts +0 -0
  1103. /package/src/{api → services}/region/list.ts +0 -0
  1104. /package/src/{api → services}/region/resources.ts +0 -0
  1105. /package/src/{api → services}/region/util.ts +0 -0
  1106. /package/src/{api → services}/sandbox/snapshot-build.ts +0 -0
  1107. /package/src/services/{session.ts → session/events.ts} +0 -0
  1108. /package/src/{api → services}/session/logs.ts +0 -0
  1109. /package/src/{api → services}/session/util.ts +0 -0
  1110. /package/src/{api → services}/storage/config.ts +0 -0
  1111. /package/src/{api → services}/storage/index.ts +0 -0
  1112. /package/src/{api → services}/storage/types.ts +0 -0
  1113. /package/src/{api → services}/storage/util.ts +0 -0
  1114. /package/src/{api → services}/stream/get.ts +0 -0
  1115. /package/src/{api → services}/stream/util.ts +0 -0
  1116. /package/src/{api → services}/thread/delete.ts +0 -0
  1117. /package/src/{api → services}/thread/get.ts +0 -0
  1118. /package/src/{api → services}/thread/index.ts +0 -0
  1119. /package/src/{api → services}/thread/util.ts +0 -0
  1120. /package/src/{api → services}/user/index.ts +0 -0
  1121. /package/src/{api → services}/user/util.ts +0 -0
  1122. /package/src/{api → services}/user/whoami.ts +0 -0
  1123. /package/src/{api → services}/webhook/deliveries.ts +0 -0
  1124. /package/src/{api → services}/webhook/destinations.ts +0 -0
  1125. /package/src/{api → services}/webhook/receipts.ts +0 -0
  1126. /package/src/{api → services}/webhook/util.ts +0 -0
  1127. /package/src/{api → services}/webhook/webhooks.ts +0 -0
@@ -1,1410 +0,0 @@
1
- import { FetchAdapter } from './adapter.ts';
2
- import { buildUrl, toServiceException } from './_util.ts';
3
- import { safeStringify } from '../json.ts';
4
-
5
- /**
6
- * An email address registered with the Agentuity email service.
7
- *
8
- * Email addresses are created under the `@agentuity.email` domain and can receive
9
- * inbound emails (forwarded to configured destinations) and send outbound emails.
10
- */
11
- export interface EmailAddress {
12
- /**
13
- * Unique identifier for the email address.
14
- *
15
- * @remarks Prefixed with `eaddr_`.
16
- */
17
- id: string;
18
-
19
- /**
20
- * The full email address (e.g., `support@agentuity.email`).
21
- */
22
- email: string;
23
-
24
- /**
25
- * Provider-specific configuration (e.g., inbound routing config).
26
- *
27
- * @remarks Opaque to callers — the structure is managed by the platform.
28
- */
29
- config?: Record<string, unknown>;
30
-
31
- /**
32
- * ID of the user who registered this address.
33
- */
34
- created_by?: string;
35
-
36
- /**
37
- * ISO 8601 timestamp when the address was created.
38
- */
39
- created_at: string;
40
-
41
- /**
42
- * ISO 8601 timestamp when the address was last updated.
43
- */
44
- updated_at?: string;
45
-
46
- /**
47
- * Total number of inbound emails received at this address.
48
- */
49
- inbound_count?: number;
50
-
51
- /**
52
- * Total number of outbound emails sent from this address.
53
- */
54
- outbound_count?: number;
55
-
56
- /**
57
- * ISO 8601 timestamp of the most recent inbound or outbound email activity.
58
- */
59
- last_activity?: string;
60
- }
61
-
62
- /**
63
- * A destination configuration for an email address.
64
- *
65
- * When an inbound email is received at the parent address, the platform forwards
66
- * it to each configured destination via an HTTP request.
67
- */
68
- export interface EmailDestination {
69
- /**
70
- * Unique identifier for the destination.
71
- *
72
- * @remarks Prefixed with `edst_`.
73
- */
74
- id: string;
75
-
76
- /**
77
- * The destination type. Currently only `'url'` is supported.
78
- */
79
- type: string;
80
-
81
- /**
82
- * Destination-specific configuration.
83
- *
84
- * @remarks
85
- * For `'url'` type the shape is:
86
- * ```typescript
87
- * {
88
- * url: string; // Must use http or https; must not point to private/loopback addresses
89
- * headers?: Record<string, string>;
90
- * method?: 'POST' | 'PUT' | 'PATCH';
91
- * }
92
- * ```
93
- */
94
- config?: Record<string, unknown>;
95
-
96
- /**
97
- * ISO 8601 timestamp when the destination was created.
98
- */
99
- created_at: string;
100
-
101
- /**
102
- * ISO 8601 timestamp when the destination was last updated.
103
- */
104
- updated_at?: string;
105
- }
106
-
107
- /**
108
- * Connection settings for an email protocol (IMAP or POP3).
109
- *
110
- * Used to configure a mail client for accessing an Agentuity email address
111
- * via standard mail protocols.
112
- */
113
- export interface EmailProtocolConfig {
114
- /**
115
- * The mail server hostname.
116
- */
117
- host: string;
118
-
119
- /**
120
- * The mail server port number.
121
- */
122
- port: number;
123
-
124
- /**
125
- * TLS mode (e.g., `'starttls'`, `'ssl'`, `'none'`).
126
- */
127
- tls: string;
128
-
129
- /**
130
- * The authentication username (typically the address ID).
131
- */
132
- username: string;
133
-
134
- /**
135
- * The authentication password.
136
- */
137
- password: string;
138
- }
139
-
140
- /**
141
- * Full connection configuration for accessing an email address via IMAP and POP3 protocols.
142
- *
143
- * Returned by {@link EmailService.getConnectionConfig} to allow external mail clients
144
- * to connect to an Agentuity email address.
145
- */
146
- export interface EmailConnectionConfig {
147
- /**
148
- * The full email address these settings are for.
149
- */
150
- email: string;
151
-
152
- /**
153
- * IMAP protocol connection settings.
154
- */
155
- imap: EmailProtocolConfig;
156
-
157
- /**
158
- * POP3 protocol connection settings.
159
- */
160
- pop3: EmailProtocolConfig;
161
- }
162
-
163
- /**
164
- * An inbound email message received at an Agentuity email address.
165
- */
166
- export interface EmailInbound {
167
- /**
168
- * Unique identifier for the inbound email.
169
- *
170
- * @remarks Prefixed with `einb_`.
171
- */
172
- id: string;
173
-
174
- /**
175
- * The sender's email address.
176
- */
177
- from: string;
178
-
179
- /**
180
- * The recipient email address (comma-separated if multiple).
181
- */
182
- to: string;
183
-
184
- /**
185
- * The email subject line.
186
- */
187
- subject?: string;
188
-
189
- /**
190
- * Plain text body of the email.
191
- */
192
- text?: string;
193
-
194
- /**
195
- * HTML body of the email.
196
- */
197
- html?: string;
198
-
199
- /**
200
- * ISO 8601 timestamp when the email was received.
201
- */
202
- received_at?: string;
203
-
204
- /**
205
- * Raw email headers as key-value pairs.
206
- */
207
- headers?: Record<string, unknown>;
208
-
209
- /**
210
- * Array of stored attachment metadata with S3 locations.
211
- */
212
- attachments?: EmailStoredAttachment[];
213
- }
214
-
215
- /**
216
- * An outbound email message sent from an Agentuity email address.
217
- */
218
- export interface EmailOutbound {
219
- /**
220
- * Unique identifier for the outbound email.
221
- *
222
- * @remarks Prefixed with `eout_`.
223
- */
224
- id: string;
225
-
226
- /**
227
- * The sender's email address (must be owned by the organization).
228
- */
229
- from: string;
230
-
231
- /**
232
- * The recipient email addresses (comma-separated).
233
- */
234
- to: string;
235
-
236
- /**
237
- * The email subject line.
238
- */
239
- subject?: string;
240
-
241
- /**
242
- * Plain text body of the email.
243
- */
244
- text?: string;
245
-
246
- /**
247
- * HTML body of the email.
248
- */
249
- html?: string;
250
-
251
- /**
252
- * Delivery status: `'pending'`, `'success'`, or `'failed'`.
253
- *
254
- * @remarks Emails are sent asynchronously, so the initial status is always `'pending'`.
255
- */
256
- status?: string;
257
-
258
- /**
259
- * Error message if the delivery failed.
260
- */
261
- error?: string;
262
-
263
- /**
264
- * ISO 8601 timestamp when the send was initiated.
265
- */
266
- created_at?: string;
267
-
268
- /**
269
- * Custom email headers that were included.
270
- */
271
- headers?: Record<string, unknown>;
272
-
273
- /**
274
- * Array of stored attachment metadata with S3 locations.
275
- */
276
- attachments?: EmailStoredAttachment[];
277
- }
278
-
279
- /**
280
- * An email attachment to include when sending an outbound email.
281
- */
282
- export interface EmailAttachment {
283
- /**
284
- * The filename for the attachment
285
- */
286
- filename: string;
287
-
288
- /**
289
- * The base64-encoded content of the attachment
290
- */
291
- content: string;
292
-
293
- /**
294
- * The MIME content type of the attachment
295
- */
296
- contentType?: string;
297
- }
298
-
299
- /**
300
- * A stored email attachment with S3 location metadata.
301
- * Returned by inbound/outbound email queries — different from EmailAttachment used for sending.
302
- */
303
- export interface EmailStoredAttachment {
304
- /** The original filename */
305
- filename: string;
306
- /** The MIME content type */
307
- content_type?: string;
308
- /** File size in bytes */
309
- size: number;
310
- /** The S3 bucket name where the attachment is stored */
311
- bucket: string;
312
- /** The S3 object key */
313
- key: string;
314
- /** Optional pre-signed download URL */
315
- url?: string;
316
- }
317
-
318
- /**
319
- * Parameters for sending an email
320
- */
321
- export interface EmailSendParams {
322
- /**
323
- * The sender email address (must be owned by the organization)
324
- */
325
- from: string;
326
-
327
- /**
328
- * The recipient email addresses
329
- */
330
- to: string[];
331
-
332
- /**
333
- * The email subject
334
- */
335
- subject: string;
336
-
337
- /**
338
- * Plain text email body
339
- */
340
- text?: string;
341
-
342
- /**
343
- * HTML email body
344
- */
345
- html?: string;
346
-
347
- /**
348
- * File attachments
349
- */
350
- attachments?: EmailAttachment[];
351
-
352
- /**
353
- * Custom email headers (e.g., In-Reply-To, References for threading)
354
- */
355
- headers?: Record<string, string>;
356
- }
357
-
358
- /**
359
- * Parameters for querying email activity time-series data.
360
- */
361
- export interface EmailActivityParams {
362
- /**
363
- * Number of days of activity to retrieve.
364
- *
365
- * @remarks Values below 7 are clamped to 7; values above 365 are clamped to 365.
366
- *
367
- * @default 7
368
- */
369
- days?: number; // min 7, max 365, default 7
370
- }
371
-
372
- /**
373
- * A single data point in the email activity time-series.
374
- */
375
- export interface EmailActivityDataPoint {
376
- /**
377
- * The date in `YYYY-MM-DD` format.
378
- */
379
- date: string; // "2026-02-28"
380
-
381
- /**
382
- * Number of inbound emails received on this date.
383
- */
384
- inbound: number;
385
-
386
- /**
387
- * Number of outbound emails sent on this date.
388
- */
389
- outbound: number;
390
- }
391
-
392
- /**
393
- * Result of an email activity query containing daily time-series data.
394
- */
395
- export interface EmailActivityResult {
396
- /**
397
- * Array of daily activity data points, ordered chronologically.
398
- */
399
- activity: EmailActivityDataPoint[];
400
-
401
- /**
402
- * The number of days of data returned.
403
- */
404
- days: number;
405
- }
406
-
407
- /**
408
- * Email service for managing email addresses, destinations, and sending/receiving emails
409
- */
410
- export interface EmailService {
411
- /**
412
- * Create a new email address
413
- *
414
- * @param localPart - the local part of the email address (before the @)
415
- * @returns the created email address
416
- *
417
- * @example
418
- * ```typescript
419
- * const address = await email.createAddress('support');
420
- * console.log('Created:', address.email);
421
- * ```
422
- */
423
- createAddress(localPart: string): Promise<EmailAddress>;
424
-
425
- /**
426
- * List all email addresses
427
- *
428
- * @returns array of email addresses
429
- *
430
- * @example
431
- * ```typescript
432
- * const addresses = await email.listAddresses();
433
- * for (const addr of addresses) {
434
- * console.log(addr.email);
435
- * }
436
- * ```
437
- */
438
- listAddresses(): Promise<EmailAddress[]>;
439
-
440
- /**
441
- * Get an email address by ID
442
- *
443
- * @param id - the email address ID
444
- * @returns the email address or null if not found
445
- *
446
- * @example
447
- * ```typescript
448
- * const address = await email.getAddress('addr_123');
449
- * if (address) {
450
- * console.log('Found:', address.email);
451
- * }
452
- * ```
453
- */
454
- getAddress(id: string): Promise<EmailAddress | null>;
455
-
456
- /**
457
- * Get email connection settings (IMAP/POP3) for an address
458
- *
459
- * @param id - the email address ID
460
- * @returns the connection configuration or null if not found
461
- */
462
- getConnectionConfig(id: string): Promise<EmailConnectionConfig | null>;
463
-
464
- /**
465
- * Delete an email address
466
- *
467
- * @param id - the email address ID
468
- *
469
- * @example
470
- * ```typescript
471
- * await email.deleteAddress('addr_123');
472
- * ```
473
- */
474
- deleteAddress(id: string): Promise<void>;
475
-
476
- /**
477
- * Create a destination for an email address
478
- *
479
- * @param addressId - the email address ID
480
- * @param type - the destination type (e.g., 'url', 'agent')
481
- * @param config - the destination configuration
482
- * @returns the created destination
483
- *
484
- * @example
485
- * ```typescript
486
- * const dest = await email.createDestination('addr_123', 'url', {
487
- * url: 'https://example.com/webhook',
488
- * });
489
- * console.log('Created destination:', dest.id);
490
- * ```
491
- */
492
- createDestination(
493
- addressId: string,
494
- type: string,
495
- config: Record<string, unknown>
496
- ): Promise<EmailDestination>;
497
-
498
- /**
499
- * List destinations for an email address
500
- *
501
- * @param addressId - the email address ID
502
- * @returns array of destinations
503
- *
504
- * @example
505
- * ```typescript
506
- * const destinations = await email.listDestinations('addr_123');
507
- * for (const dest of destinations) {
508
- * console.log(`${dest.type}: ${dest.id}`);
509
- * }
510
- * ```
511
- */
512
- listDestinations(addressId: string): Promise<EmailDestination[]>;
513
-
514
- /**
515
- * Delete a destination from an email address
516
- *
517
- * @param addressId - the email address ID
518
- * @param destinationId - the destination ID
519
- *
520
- * @example
521
- * ```typescript
522
- * await email.deleteDestination('addr_123', 'dest_456');
523
- * ```
524
- */
525
- deleteDestination(addressId: string, destinationId: string): Promise<void>;
526
-
527
- /**
528
- * Send an email
529
- *
530
- * @param params - the send parameters
531
- * @returns the outbound email record
532
- *
533
- * @example
534
- * ```typescript
535
- * const result = await email.send({
536
- * from: 'support@myapp.agentuity.email',
537
- * to: ['user@example.com'],
538
- * subject: 'Welcome!',
539
- * text: 'Welcome to our platform.',
540
- * html: '<h1>Welcome!</h1><p>Welcome to our platform.</p>',
541
- * });
542
- * console.log('Sent:', result.id, 'Status:', result.status);
543
- * ```
544
- */
545
- send(params: EmailSendParams): Promise<EmailOutbound>;
546
-
547
- /**
548
- * List inbound emails
549
- *
550
- * @param addressId - optional email address ID to filter by
551
- * @returns array of inbound emails
552
- *
553
- * @example
554
- * ```typescript
555
- * const inbound = await email.listInbound('addr_123');
556
- * for (const msg of inbound) {
557
- * console.log(`From: ${msg.from}, Subject: ${msg.subject}`);
558
- * }
559
- * ```
560
- */
561
- listInbound(addressId?: string): Promise<EmailInbound[]>;
562
-
563
- /**
564
- * Get an inbound email by ID
565
- *
566
- * @param id - the inbound email ID
567
- * @returns the inbound email or null if not found
568
- *
569
- * @example
570
- * ```typescript
571
- * const msg = await email.getInbound('inb_123');
572
- * if (msg) {
573
- * console.log('Subject:', msg.subject);
574
- * }
575
- * ```
576
- */
577
- getInbound(id: string): Promise<EmailInbound | null>;
578
-
579
- /**
580
- * Delete an inbound email by ID
581
- *
582
- * @param id - the inbound email ID
583
- *
584
- * @example
585
- * ```typescript
586
- * await email.deleteInbound('inb_abc123');
587
- * ```
588
- */
589
- deleteInbound(id: string): Promise<void>;
590
-
591
- /**
592
- * List outbound emails
593
- *
594
- * @param addressId - optional email address ID to filter by
595
- * @returns array of outbound emails
596
- *
597
- * @example
598
- * ```typescript
599
- * const outbound = await email.listOutbound('addr_123');
600
- * for (const msg of outbound) {
601
- * console.log(`To: ${msg.to}, Status: ${msg.status}`);
602
- * }
603
- * ```
604
- */
605
- listOutbound(addressId?: string): Promise<EmailOutbound[]>;
606
-
607
- /**
608
- * Get an outbound email by ID
609
- *
610
- * @param id - the outbound email ID
611
- * @returns the outbound email or null if not found
612
- *
613
- * @example
614
- * ```typescript
615
- * const msg = await email.getOutbound('out_123');
616
- * if (msg) {
617
- * console.log('Status:', msg.status);
618
- * }
619
- * ```
620
- */
621
- getOutbound(id: string): Promise<EmailOutbound | null>;
622
-
623
- /**
624
- * Delete an outbound email by ID
625
- *
626
- * @param id - the outbound email ID
627
- *
628
- * @example
629
- * ```typescript
630
- * await email.deleteOutbound('out_abc123');
631
- * ```
632
- */
633
- deleteOutbound(id: string): Promise<void>;
634
-
635
- /**
636
- * Get email activity time-series data
637
- *
638
- * @param params - optional parameters (days defaults to 7)
639
- * @returns activity data points and the number of days queried
640
- *
641
- * @example
642
- * ```typescript
643
- * const activity = await email.getActivity({ days: 30 });
644
- * for (const point of activity.activity) {
645
- * console.log(`${point.date}: ${point.inbound} in, ${point.outbound} out`);
646
- * }
647
- * ```
648
- */
649
- getActivity(params?: EmailActivityParams): Promise<EmailActivityResult>;
650
- }
651
-
652
- /**
653
- * Unwrap a Catalyst API response payload.
654
- *
655
- * The Catalyst API may return data in one of two envelope formats:
656
- * - `{ key: data }` — the key maps directly to the data
657
- * - `{ data: { key: data } }` — the data is nested inside a `data` wrapper
658
- *
659
- * This helper normalises both shapes so callers always receive the inner value.
660
- *
661
- * @param payload - The raw JSON-parsed response body from the API
662
- * @param key - The property name to extract from the payload (e.g., `'address'`, `'destinations'`)
663
- * @returns The extracted value cast to type `T`
664
- *
665
- * @remarks
666
- * If neither envelope format matches, the raw payload is returned as-is.
667
- * This function does not throw — it always returns a value.
668
- */
669
- function unwrap<T>(payload: unknown, key: string): T {
670
- if (typeof payload === 'object' && payload !== null) {
671
- const obj = payload as Record<string, unknown>;
672
- if (key in obj) {
673
- return obj[key] as T;
674
- }
675
- if ('data' in obj && typeof obj.data === 'object' && obj.data !== null) {
676
- const data = obj.data as Record<string, unknown>;
677
- if (key in data) {
678
- return data[key] as T;
679
- }
680
- return data as T;
681
- }
682
- }
683
- return payload as T;
684
- }
685
-
686
- const EMAIL_ACTIVITY_API_VERSION = '2026-02-28';
687
-
688
- /**
689
- * Client for the Agentuity Email service.
690
- *
691
- * Provides methods for managing email addresses, configuring inbound email
692
- * destinations, sending outbound emails, and querying email history.
693
- *
694
- * Email addresses are created under the `@agentuity.email` domain. Inbound emails
695
- * can be forwarded to URL destinations. Outbound emails are sent asynchronously
696
- * and support attachments up to 25 MB total.
697
- *
698
- * All methods are instrumented with OpenTelemetry spans for observability.
699
- *
700
- * @example
701
- * ```typescript
702
- * const email = new EmailStorageService(baseUrl, adapter);
703
- *
704
- * // Create an address
705
- * const addr = await email.createAddress('notifications');
706
- *
707
- * // Send an email
708
- * await email.send({
709
- * from: addr.email,
710
- * to: ['user@example.com'],
711
- * subject: 'Hello',
712
- * text: 'Hello from Agentuity!',
713
- * });
714
- * ```
715
- */
716
- export class EmailStorageService implements EmailService {
717
- #adapter: FetchAdapter;
718
- #baseUrl: string;
719
-
720
- /**
721
- * Create a new EmailStorageService instance.
722
- *
723
- * @param baseUrl - The base URL for the Agentuity Email API (e.g., `https://api.agentuity.com`)
724
- * @param adapter - The HTTP fetch adapter used for making API requests
725
- */
726
- constructor(baseUrl: string, adapter: FetchAdapter) {
727
- this.#adapter = adapter;
728
- this.#baseUrl = baseUrl;
729
- }
730
-
731
- /**
732
- * Create a new email address under the `@agentuity.email` domain.
733
- *
734
- * @param localPart - The local part of the email address (the part before the `@`).
735
- * For example, passing `'support'` creates `support@agentuity.email`.
736
- * @returns The newly created email address record
737
- * @throws ServiceException on API errors (e.g., duplicate address, invalid local part)
738
- *
739
- * @example
740
- * ```typescript
741
- * const addr = await email.createAddress('support');
742
- * console.log('Created:', addr.email); // support@agentuity.email
743
- * ```
744
- */
745
- async createAddress(localPart: string): Promise<EmailAddress> {
746
- const url = buildUrl(this.#baseUrl, '/email/addresses');
747
- const signal = AbortSignal.timeout(30_000);
748
- const res = await this.#adapter.invoke<unknown>(url, {
749
- method: 'POST',
750
- body: safeStringify({ local_part: localPart }),
751
- contentType: 'application/json',
752
- signal,
753
- telemetry: {
754
- name: 'agentuity.email.createAddress',
755
- attributes: {
756
- localPart,
757
- },
758
- },
759
- });
760
- if (res.ok) {
761
- return unwrap<EmailAddress>(res.data, 'address');
762
- }
763
- throw await toServiceException('POST', url, res.response);
764
- }
765
-
766
- /**
767
- * List all email addresses owned by the current organization.
768
- *
769
- * @returns An array of email address records. Returns an empty array if none exist.
770
- * @throws ServiceException on API errors
771
- *
772
- * @example
773
- * ```typescript
774
- * const addresses = await email.listAddresses();
775
- * for (const addr of addresses) {
776
- * console.log(`${addr.email} — ${addr.inbound_count ?? 0} received`);
777
- * }
778
- * ```
779
- */
780
- async listAddresses(): Promise<EmailAddress[]> {
781
- const url = buildUrl(this.#baseUrl, '/email/addresses');
782
- const signal = AbortSignal.timeout(30_000);
783
- const res = await this.#adapter.invoke<unknown>(url, {
784
- method: 'GET',
785
- signal,
786
- telemetry: {
787
- name: 'agentuity.email.listAddresses',
788
- attributes: {},
789
- },
790
- });
791
- if (res.response.status === 404) {
792
- return [];
793
- }
794
- if (res.ok) {
795
- const items = unwrap<unknown>(res.data, 'addresses');
796
- return Array.isArray(items) ? (items as EmailAddress[]) : [];
797
- }
798
- throw await toServiceException('GET', url, res.response);
799
- }
800
-
801
- /**
802
- * Get an email address by its ID.
803
- *
804
- * @param id - The email address ID (prefixed with `eaddr_`)
805
- * @returns The email address record, or `null` if no address with the given ID exists
806
- * @throws ServiceException on API errors (other than 404)
807
- *
808
- * @example
809
- * ```typescript
810
- * const addr = await email.getAddress('eaddr_abc123');
811
- * if (addr) {
812
- * console.log('Found:', addr.email);
813
- * }
814
- * ```
815
- */
816
- async getAddress(id: string): Promise<EmailAddress | null> {
817
- const url = buildUrl(this.#baseUrl, `/email/addresses/${encodeURIComponent(id)}`);
818
- const signal = AbortSignal.timeout(30_000);
819
- const res = await this.#adapter.invoke<unknown>(url, {
820
- method: 'GET',
821
- signal,
822
- telemetry: {
823
- name: 'agentuity.email.getAddress',
824
- attributes: {
825
- id,
826
- },
827
- },
828
- });
829
- if (res.response.status === 404) {
830
- return null;
831
- }
832
- if (res.ok) {
833
- return unwrap<EmailAddress>(res.data, 'address');
834
- }
835
- throw await toServiceException('GET', url, res.response);
836
- }
837
-
838
- /**
839
- * Get IMAP and POP3 connection settings for an email address.
840
- *
841
- * These settings can be used to configure an external mail client (e.g., Thunderbird, Outlook)
842
- * to access the mailbox associated with the given address.
843
- *
844
- * @param id - The email address ID (prefixed with `eaddr_`)
845
- * @returns The connection configuration with IMAP and POP3 settings, or `null` if the address is not found
846
- * @throws ServiceException on API errors (other than 404)
847
- *
848
- * @example
849
- * ```typescript
850
- * const config = await email.getConnectionConfig('eaddr_abc123');
851
- * if (config) {
852
- * console.log('IMAP host:', config.imap.host);
853
- * console.log('POP3 host:', config.pop3.host);
854
- * }
855
- * ```
856
- */
857
- async getConnectionConfig(id: string): Promise<EmailConnectionConfig | null> {
858
- const url = buildUrl(this.#baseUrl, `/email/addresses/${encodeURIComponent(id)}/connection`);
859
- const signal = AbortSignal.timeout(30_000);
860
- const res = await this.#adapter.invoke<unknown>(url, {
861
- method: 'GET',
862
- signal,
863
- telemetry: {
864
- name: 'agentuity.email.getConnectionConfig',
865
- attributes: {
866
- id,
867
- },
868
- },
869
- });
870
- if (res.response.status === 404) {
871
- return null;
872
- }
873
- if (res.ok) {
874
- return unwrap<EmailConnectionConfig>(res.data, 'connection');
875
- }
876
- throw await toServiceException('GET', url, res.response);
877
- }
878
-
879
- /**
880
- * Delete an email address and all associated destinations.
881
- *
882
- * @remarks This operation is idempotent — deleting a non-existent address does not throw.
883
- *
884
- * @param id - The email address ID (prefixed with `eaddr_`)
885
- * @throws ServiceException on API errors (other than 404)
886
- *
887
- * @example
888
- * ```typescript
889
- * await email.deleteAddress('eaddr_abc123');
890
- * ```
891
- */
892
- async deleteAddress(id: string): Promise<void> {
893
- const url = buildUrl(this.#baseUrl, `/email/addresses/${encodeURIComponent(id)}`);
894
- const signal = AbortSignal.timeout(30_000);
895
- const res = await this.#adapter.invoke<unknown>(url, {
896
- method: 'DELETE',
897
- signal,
898
- telemetry: {
899
- name: 'agentuity.email.deleteAddress',
900
- attributes: {
901
- id,
902
- },
903
- },
904
- });
905
- if (res.ok || res.response.status === 404) {
906
- return;
907
- }
908
- throw await toServiceException('DELETE', url, res.response);
909
- }
910
-
911
- /**
912
- * Create a new destination for an email address.
913
- *
914
- * Destinations determine where inbound emails are forwarded when they arrive
915
- * at the parent address.
916
- *
917
- * @param addressId - The email address ID (prefixed with `eaddr_`)
918
- * @param type - The destination type (currently only `'url'` is supported)
919
- * @param config - Type-specific destination configuration. For `'url'`:
920
- * `{ url: string, headers?: Record<string, string>, method?: 'POST' | 'PUT' | 'PATCH' }`
921
- * @returns The newly created destination record
922
- * @throws ServiceException on API errors (e.g., invalid URL, address not found)
923
- *
924
- * @example
925
- * ```typescript
926
- * const dest = await email.createDestination('eaddr_abc123', 'url', {
927
- * url: 'https://example.com/webhook',
928
- * headers: { 'X-Secret': 'my-token' },
929
- * });
930
- * console.log('Destination created:', dest.id);
931
- * ```
932
- */
933
- async createDestination(
934
- addressId: string,
935
- type: string,
936
- config: Record<string, unknown>
937
- ): Promise<EmailDestination> {
938
- const url = buildUrl(
939
- this.#baseUrl,
940
- `/email/addresses/${encodeURIComponent(addressId)}/destinations`
941
- );
942
- const signal = AbortSignal.timeout(30_000);
943
- const res = await this.#adapter.invoke<unknown>(url, {
944
- method: 'POST',
945
- body: safeStringify({ type, config }),
946
- contentType: 'application/json',
947
- signal,
948
- telemetry: {
949
- name: 'agentuity.email.createDestination',
950
- attributes: {
951
- addressId,
952
- type,
953
- },
954
- },
955
- });
956
- if (res.ok) {
957
- return unwrap<EmailDestination>(res.data, 'destination');
958
- }
959
- throw await toServiceException('POST', url, res.response);
960
- }
961
-
962
- /**
963
- * List all destinations configured for an email address.
964
- *
965
- * @param addressId - The email address ID (prefixed with `eaddr_`)
966
- * @returns An array of destination records. Returns an empty array if none exist.
967
- * @throws ServiceException on API errors
968
- *
969
- * @example
970
- * ```typescript
971
- * const destinations = await email.listDestinations('eaddr_abc123');
972
- * for (const dest of destinations) {
973
- * console.log(`${dest.type}: ${dest.id}`);
974
- * }
975
- * ```
976
- */
977
- async listDestinations(addressId: string): Promise<EmailDestination[]> {
978
- const url = buildUrl(
979
- this.#baseUrl,
980
- `/email/addresses/${encodeURIComponent(addressId)}/destinations`
981
- );
982
- const signal = AbortSignal.timeout(30_000);
983
- const res = await this.#adapter.invoke<unknown>(url, {
984
- method: 'GET',
985
- signal,
986
- telemetry: {
987
- name: 'agentuity.email.listDestinations',
988
- attributes: {
989
- addressId,
990
- },
991
- },
992
- });
993
- if (res.response.status === 404) {
994
- return [];
995
- }
996
- if (res.ok) {
997
- const items = unwrap<unknown>(res.data, 'destinations');
998
- return Array.isArray(items) ? (items as EmailDestination[]) : [];
999
- }
1000
- throw await toServiceException('GET', url, res.response);
1001
- }
1002
-
1003
- /**
1004
- * Delete a destination from an email address.
1005
- *
1006
- * @remarks This operation is idempotent — deleting a non-existent destination does not throw.
1007
- *
1008
- * @param addressId - The email address ID (prefixed with `eaddr_`)
1009
- * @param destinationId - The destination ID (prefixed with `edst_`)
1010
- * @throws ServiceException on API errors (other than 404)
1011
- *
1012
- * @example
1013
- * ```typescript
1014
- * await email.deleteDestination('eaddr_abc123', 'edst_xyz789');
1015
- * ```
1016
- */
1017
- async deleteDestination(addressId: string, destinationId: string): Promise<void> {
1018
- const url = buildUrl(
1019
- this.#baseUrl,
1020
- `/email/addresses/${encodeURIComponent(addressId)}/destinations/${encodeURIComponent(destinationId)}`
1021
- );
1022
- const signal = AbortSignal.timeout(30_000);
1023
- const res = await this.#adapter.invoke<unknown>(url, {
1024
- method: 'DELETE',
1025
- signal,
1026
- telemetry: {
1027
- name: 'agentuity.email.deleteDestination',
1028
- attributes: {
1029
- addressId,
1030
- destinationId,
1031
- },
1032
- },
1033
- });
1034
- if (res.ok || res.response.status === 404) {
1035
- return;
1036
- }
1037
- throw await toServiceException('DELETE', url, res.response);
1038
- }
1039
-
1040
- /**
1041
- * Send an outbound email from an Agentuity email address.
1042
- *
1043
- * Emails are sent asynchronously — this method returns immediately with an outbound
1044
- * record whose status is `'pending'`. Use {@link getOutbound} to poll for delivery status.
1045
- *
1046
- * @remarks
1047
- * - The `from` address must be owned by the current organization.
1048
- * - Maximum 50 recipients per send.
1049
- * - Maximum 25 MB for the full RFC 822 body (including attachments).
1050
- *
1051
- * @param params - The email send parameters including from, to, subject, and body
1052
- * @returns The outbound email record with initial status `'pending'`
1053
- * @throws ServiceException on API errors (e.g., invalid sender, too many recipients)
1054
- *
1055
- * @example
1056
- * ```typescript
1057
- * const result = await email.send({
1058
- * from: 'notifications@agentuity.email',
1059
- * to: ['user@example.com'],
1060
- * subject: 'Welcome!',
1061
- * text: 'Welcome to our platform.',
1062
- * html: '<h1>Welcome!</h1>',
1063
- * attachments: [{
1064
- * filename: 'guide.pdf',
1065
- * content: base64EncodedPdf,
1066
- * contentType: 'application/pdf',
1067
- * }],
1068
- * });
1069
- * console.log('Email queued:', result.id);
1070
- * ```
1071
- */
1072
- async send(params: EmailSendParams): Promise<EmailOutbound> {
1073
- const url = buildUrl(this.#baseUrl, '/email/outbound/send');
1074
- const signal = AbortSignal.timeout(30_000);
1075
-
1076
- // Transform attachments to API format (snake_case)
1077
- const body: Record<string, unknown> = {
1078
- from: params.from,
1079
- to: params.to,
1080
- subject: params.subject,
1081
- };
1082
- if (params.text !== undefined) {
1083
- body.text = params.text;
1084
- }
1085
- if (params.html !== undefined) {
1086
- body.html = params.html;
1087
- }
1088
- if (params.attachments && params.attachments.length > 0) {
1089
- body.attachments = params.attachments.map((a) => ({
1090
- filename: a.filename,
1091
- content: a.content,
1092
- ...(a.contentType && { content_type: a.contentType }),
1093
- }));
1094
- }
1095
- if (params.headers && Object.keys(params.headers).length > 0) {
1096
- body.headers = params.headers;
1097
- }
1098
-
1099
- const res = await this.#adapter.invoke<unknown>(url, {
1100
- method: 'POST',
1101
- body: safeStringify(body),
1102
- contentType: 'application/json',
1103
- signal,
1104
- telemetry: {
1105
- name: 'agentuity.email.send',
1106
- attributes: {
1107
- from: params.from,
1108
- toCount: String(params.to.length),
1109
- },
1110
- },
1111
- });
1112
- if (res.ok) {
1113
- return unwrap<EmailOutbound>(res.data, 'outbound');
1114
- }
1115
- throw await toServiceException('POST', url, res.response);
1116
- }
1117
-
1118
- /**
1119
- * List inbound emails, optionally filtered by email address.
1120
- *
1121
- * @param addressId - Optional email address ID (prefixed with `eaddr_`) to filter results.
1122
- * When omitted, returns inbound emails across all addresses in the organization.
1123
- * @returns An array of inbound email records. Returns an empty array if none exist.
1124
- * @throws ServiceException on API errors
1125
- *
1126
- * @example
1127
- * ```typescript
1128
- * // List all inbound emails
1129
- * const all = await email.listInbound();
1130
- *
1131
- * // List inbound for a specific address
1132
- * const filtered = await email.listInbound('eaddr_abc123');
1133
- * for (const msg of filtered) {
1134
- * console.log(`From: ${msg.from}, Subject: ${msg.subject}`);
1135
- * }
1136
- * ```
1137
- */
1138
- async listInbound(addressId?: string): Promise<EmailInbound[]> {
1139
- const queryParams = new URLSearchParams();
1140
- if (addressId) {
1141
- queryParams.set('address_id', addressId);
1142
- }
1143
- const queryString = queryParams.toString();
1144
- const url = buildUrl(this.#baseUrl, `/email/inbound${queryString ? `?${queryString}` : ''}`);
1145
- const signal = AbortSignal.timeout(30_000);
1146
- const res = await this.#adapter.invoke<unknown>(url, {
1147
- method: 'GET',
1148
- signal,
1149
- telemetry: {
1150
- name: 'agentuity.email.listInbound',
1151
- attributes: {
1152
- ...(addressId && { addressId }),
1153
- },
1154
- },
1155
- });
1156
- if (res.response.status === 404) {
1157
- return [];
1158
- }
1159
- if (res.ok) {
1160
- const items = unwrap<unknown>(res.data, 'inbound');
1161
- return Array.isArray(items) ? (items as EmailInbound[]) : [];
1162
- }
1163
- throw await toServiceException('GET', url, res.response);
1164
- }
1165
-
1166
- /**
1167
- * Get an inbound email by its ID.
1168
- *
1169
- * @param id - The inbound email ID (prefixed with `einb_`)
1170
- * @returns The inbound email record, or `null` if not found
1171
- * @throws ServiceException on API errors (other than 404)
1172
- *
1173
- * @example
1174
- * ```typescript
1175
- * const msg = await email.getInbound('einb_abc123');
1176
- * if (msg) {
1177
- * console.log('Subject:', msg.subject);
1178
- * console.log('Attachments:', msg.attachments?.length ?? 0);
1179
- * }
1180
- * ```
1181
- */
1182
- async getInbound(id: string): Promise<EmailInbound | null> {
1183
- const url = buildUrl(this.#baseUrl, `/email/inbound/${encodeURIComponent(id)}`);
1184
- const signal = AbortSignal.timeout(30_000);
1185
- const res = await this.#adapter.invoke<unknown>(url, {
1186
- method: 'GET',
1187
- signal,
1188
- telemetry: {
1189
- name: 'agentuity.email.getInbound',
1190
- attributes: {
1191
- id,
1192
- },
1193
- },
1194
- });
1195
- if (res.response.status === 404) {
1196
- return null;
1197
- }
1198
- if (res.ok) {
1199
- return unwrap<EmailInbound>(res.data, 'inbound');
1200
- }
1201
- throw await toServiceException('GET', url, res.response);
1202
- }
1203
-
1204
- /**
1205
- * Delete an inbound email by its ID.
1206
- *
1207
- * @remarks This operation is idempotent — deleting a non-existent email does not throw.
1208
- *
1209
- * @param id - The inbound email ID (prefixed with `einb_`)
1210
- * @throws ServiceException on API errors (other than 404)
1211
- *
1212
- * @example
1213
- * ```typescript
1214
- * await email.deleteInbound('einb_abc123');
1215
- * ```
1216
- */
1217
- async deleteInbound(id: string): Promise<void> {
1218
- const url = buildUrl(this.#baseUrl, `/email/inbound/${encodeURIComponent(id)}`);
1219
- const signal = AbortSignal.timeout(30_000);
1220
- const res = await this.#adapter.invoke<unknown>(url, {
1221
- method: 'DELETE',
1222
- signal,
1223
- telemetry: {
1224
- name: 'agentuity.email.deleteInbound',
1225
- attributes: {
1226
- id,
1227
- },
1228
- },
1229
- });
1230
- if (res.ok || res.response.status === 404) {
1231
- return;
1232
- }
1233
- throw await toServiceException('DELETE', url, res.response);
1234
- }
1235
-
1236
- /**
1237
- * List outbound emails, optionally filtered by email address.
1238
- *
1239
- * @param addressId - Optional email address ID (prefixed with `eaddr_`) to filter results.
1240
- * When omitted, returns outbound emails across all addresses in the organization.
1241
- * @returns An array of outbound email records. Returns an empty array if none exist.
1242
- * @throws ServiceException on API errors
1243
- *
1244
- * @example
1245
- * ```typescript
1246
- * // List all outbound emails
1247
- * const all = await email.listOutbound();
1248
- *
1249
- * // List outbound for a specific address
1250
- * const filtered = await email.listOutbound('eaddr_abc123');
1251
- * for (const msg of filtered) {
1252
- * console.log(`To: ${msg.to}, Status: ${msg.status}`);
1253
- * }
1254
- * ```
1255
- */
1256
- async listOutbound(addressId?: string): Promise<EmailOutbound[]> {
1257
- const queryParams = new URLSearchParams();
1258
- if (addressId) {
1259
- queryParams.set('address_id', addressId);
1260
- }
1261
- const queryString = queryParams.toString();
1262
- const url = buildUrl(this.#baseUrl, `/email/outbound${queryString ? `?${queryString}` : ''}`);
1263
- const signal = AbortSignal.timeout(30_000);
1264
- const res = await this.#adapter.invoke<unknown>(url, {
1265
- method: 'GET',
1266
- signal,
1267
- telemetry: {
1268
- name: 'agentuity.email.listOutbound',
1269
- attributes: {
1270
- ...(addressId && { addressId }),
1271
- },
1272
- },
1273
- });
1274
- if (res.response.status === 404) {
1275
- return [];
1276
- }
1277
- if (res.ok) {
1278
- const items = unwrap<unknown>(res.data, 'outbound');
1279
- return Array.isArray(items) ? (items as EmailOutbound[]) : [];
1280
- }
1281
- throw await toServiceException('GET', url, res.response);
1282
- }
1283
-
1284
- /**
1285
- * Get an outbound email by its ID.
1286
- *
1287
- * @param id - The outbound email ID (prefixed with `eout_`)
1288
- * @returns The outbound email record, or `null` if not found
1289
- * @throws ServiceException on API errors (other than 404)
1290
- *
1291
- * @example
1292
- * ```typescript
1293
- * const msg = await email.getOutbound('eout_abc123');
1294
- * if (msg) {
1295
- * console.log('Status:', msg.status);
1296
- * if (msg.error) {
1297
- * console.error('Delivery failed:', msg.error);
1298
- * }
1299
- * }
1300
- * ```
1301
- */
1302
- async getOutbound(id: string): Promise<EmailOutbound | null> {
1303
- const url = buildUrl(this.#baseUrl, `/email/outbound/${encodeURIComponent(id)}`);
1304
- const signal = AbortSignal.timeout(30_000);
1305
- const res = await this.#adapter.invoke<unknown>(url, {
1306
- method: 'GET',
1307
- signal,
1308
- telemetry: {
1309
- name: 'agentuity.email.getOutbound',
1310
- attributes: {
1311
- id,
1312
- },
1313
- },
1314
- });
1315
- if (res.response.status === 404) {
1316
- return null;
1317
- }
1318
- if (res.ok) {
1319
- return unwrap<EmailOutbound>(res.data, 'outbound');
1320
- }
1321
- throw await toServiceException('GET', url, res.response);
1322
- }
1323
-
1324
- /**
1325
- * Delete an outbound email by its ID.
1326
- *
1327
- * @remarks This operation is idempotent — deleting a non-existent email does not throw.
1328
- *
1329
- * @param id - The outbound email ID (prefixed with `eout_`)
1330
- * @throws ServiceException on API errors (other than 404)
1331
- *
1332
- * @example
1333
- * ```typescript
1334
- * await email.deleteOutbound('eout_abc123');
1335
- * ```
1336
- */
1337
- async deleteOutbound(id: string): Promise<void> {
1338
- const url = buildUrl(this.#baseUrl, `/email/outbound/${encodeURIComponent(id)}`);
1339
- const signal = AbortSignal.timeout(30_000);
1340
- const res = await this.#adapter.invoke<unknown>(url, {
1341
- method: 'DELETE',
1342
- signal,
1343
- telemetry: {
1344
- name: 'agentuity.email.deleteOutbound',
1345
- attributes: {
1346
- id,
1347
- },
1348
- },
1349
- });
1350
- if (res.ok || res.response.status === 404) {
1351
- return;
1352
- }
1353
- throw await toServiceException('DELETE', url, res.response);
1354
- }
1355
-
1356
- /**
1357
- * Get email activity time-series data showing inbound and outbound counts per day.
1358
- *
1359
- * @param params - Optional query parameters. `days` controls the lookback window
1360
- * (minimum 7, maximum 365, server default 7).
1361
- * @returns An {@link EmailActivityResult} with daily data points ordered chronologically
1362
- * and the total number of days returned
1363
- * @throws ServiceException on API errors
1364
- *
1365
- * @example
1366
- * ```typescript
1367
- * // Get last 30 days of activity
1368
- * const result = await email.getActivity({ days: 30 });
1369
- * console.log(`Activity over ${result.days} days:`);
1370
- * for (const point of result.activity) {
1371
- * console.log(` ${point.date}: ${point.inbound} in, ${point.outbound} out`);
1372
- * }
1373
- * ```
1374
- */
1375
- async getActivity(params?: EmailActivityParams): Promise<EmailActivityResult> {
1376
- const queryParams = new URLSearchParams();
1377
- if (params?.days !== undefined) {
1378
- const raw = Number(params.days);
1379
- if (Number.isFinite(raw)) {
1380
- const clamped = Math.max(7, Math.min(365, Math.trunc(raw)));
1381
- queryParams.set('days', String(clamped));
1382
- }
1383
- }
1384
-
1385
- const queryString = queryParams.toString();
1386
- const url = buildUrl(
1387
- this.#baseUrl,
1388
- `/email/activity/${EMAIL_ACTIVITY_API_VERSION}${queryString ? `?${queryString}` : ''}`
1389
- );
1390
- const signal = AbortSignal.timeout(30_000);
1391
-
1392
- const days = queryParams.get('days');
1393
- const res = await this.#adapter.invoke<EmailActivityResult>(url, {
1394
- method: 'GET',
1395
- signal,
1396
- telemetry: {
1397
- name: 'agentuity.email.activity',
1398
- attributes: {
1399
- ...(days ? { days } : {}),
1400
- },
1401
- },
1402
- });
1403
-
1404
- if (res.ok) {
1405
- // Email endpoints return data directly (no success wrapper)
1406
- return res.data as EmailActivityResult;
1407
- }
1408
- throw await toServiceException('GET', url, res.response);
1409
- }
1410
- }