@zavudev/sdk 0.55.0 → 0.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (371) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/client.d.mts +25 -13
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +25 -13
  5. package/client.d.ts.map +1 -1
  6. package/client.js +15 -3
  7. package/client.js.map +1 -1
  8. package/client.mjs +15 -3
  9. package/client.mjs.map +1 -1
  10. package/internal/qs/formats.d.mts +7 -0
  11. package/internal/qs/formats.d.mts.map +1 -0
  12. package/internal/qs/formats.d.ts +7 -0
  13. package/internal/qs/formats.d.ts.map +1 -0
  14. package/internal/qs/formats.js +13 -0
  15. package/internal/qs/formats.js.map +1 -0
  16. package/internal/qs/formats.mjs +9 -0
  17. package/internal/qs/formats.mjs.map +1 -0
  18. package/internal/qs/index.d.mts +10 -0
  19. package/internal/qs/index.d.mts.map +1 -0
  20. package/internal/qs/index.d.ts +10 -0
  21. package/internal/qs/index.d.ts.map +1 -0
  22. package/internal/qs/index.js +14 -0
  23. package/internal/qs/index.js.map +1 -0
  24. package/internal/qs/index.mjs +10 -0
  25. package/internal/qs/index.mjs.map +1 -0
  26. package/internal/qs/stringify.d.mts +3 -0
  27. package/internal/qs/stringify.d.mts.map +1 -0
  28. package/internal/qs/stringify.d.ts +3 -0
  29. package/internal/qs/stringify.d.ts.map +1 -0
  30. package/internal/qs/stringify.js +277 -0
  31. package/internal/qs/stringify.js.map +1 -0
  32. package/internal/qs/stringify.mjs +274 -0
  33. package/internal/qs/stringify.mjs.map +1 -0
  34. package/internal/qs/types.d.mts +57 -0
  35. package/internal/qs/types.d.mts.map +1 -0
  36. package/internal/qs/types.d.ts +57 -0
  37. package/internal/qs/types.d.ts.map +1 -0
  38. package/internal/qs/types.js +3 -0
  39. package/internal/qs/types.js.map +1 -0
  40. package/internal/qs/types.mjs +2 -0
  41. package/internal/qs/types.mjs.map +1 -0
  42. package/internal/qs/utils.d.mts +15 -0
  43. package/internal/qs/utils.d.mts.map +1 -0
  44. package/internal/qs/utils.d.ts +15 -0
  45. package/internal/qs/utils.d.ts.map +1 -0
  46. package/internal/qs/utils.js +230 -0
  47. package/internal/qs/utils.js.map +1 -0
  48. package/internal/qs/utils.mjs +217 -0
  49. package/internal/qs/utils.mjs.map +1 -0
  50. package/internal/tslib.js +17 -17
  51. package/internal/utils/query.d.mts +0 -3
  52. package/internal/utils/query.d.mts.map +1 -1
  53. package/internal/utils/query.d.ts +0 -3
  54. package/internal/utils/query.d.ts.map +1 -1
  55. package/internal/utils/query.js +3 -16
  56. package/internal/utils/query.js.map +1 -1
  57. package/internal/utils/query.mjs +2 -16
  58. package/internal/utils/query.mjs.map +1 -1
  59. package/package.json +1 -1
  60. package/resources/agent-templates.d.mts +97 -0
  61. package/resources/agent-templates.d.mts.map +1 -0
  62. package/resources/agent-templates.d.ts +97 -0
  63. package/resources/agent-templates.d.ts.map +1 -0
  64. package/resources/agent-templates.js +39 -0
  65. package/resources/agent-templates.js.map +1 -0
  66. package/resources/agent-templates.mjs +35 -0
  67. package/resources/agent-templates.mjs.map +1 -0
  68. package/resources/agents/agents.d.mts +462 -0
  69. package/resources/agents/agents.d.mts.map +1 -0
  70. package/resources/agents/agents.d.ts +462 -0
  71. package/resources/agents/agents.d.ts.map +1 -0
  72. package/resources/agents/agents.js +129 -0
  73. package/resources/agents/agents.js.map +1 -0
  74. package/resources/agents/agents.mjs +124 -0
  75. package/resources/agents/agents.mjs.map +1 -0
  76. package/resources/agents/index.d.mts +3 -0
  77. package/resources/agents/index.d.mts.map +1 -0
  78. package/resources/agents/index.d.ts +3 -0
  79. package/resources/agents/index.d.ts.map +1 -0
  80. package/resources/agents/index.js +9 -0
  81. package/resources/agents/index.js.map +1 -0
  82. package/resources/agents/index.mjs +4 -0
  83. package/resources/agents/index.mjs.map +1 -0
  84. package/resources/agents/senders.d.mts +54 -0
  85. package/resources/agents/senders.d.mts.map +1 -0
  86. package/resources/agents/senders.d.ts +54 -0
  87. package/resources/agents/senders.d.ts.map +1 -0
  88. package/resources/agents/senders.js +45 -0
  89. package/resources/agents/senders.js.map +1 -0
  90. package/resources/agents/senders.mjs +41 -0
  91. package/resources/agents/senders.mjs.map +1 -0
  92. package/resources/agents.d.mts +2 -0
  93. package/resources/agents.d.mts.map +1 -0
  94. package/resources/agents.d.ts +2 -0
  95. package/resources/agents.d.ts.map +1 -0
  96. package/resources/agents.js +6 -0
  97. package/resources/agents.js.map +1 -0
  98. package/resources/agents.mjs +3 -0
  99. package/resources/agents.mjs.map +1 -0
  100. package/resources/broadcasts/broadcasts.d.mts +16 -9
  101. package/resources/broadcasts/broadcasts.d.mts.map +1 -1
  102. package/resources/broadcasts/broadcasts.d.ts +16 -9
  103. package/resources/broadcasts/broadcasts.d.ts.map +1 -1
  104. package/resources/broadcasts/broadcasts.js +16 -9
  105. package/resources/broadcasts/broadcasts.js.map +1 -1
  106. package/resources/broadcasts/broadcasts.mjs +16 -9
  107. package/resources/broadcasts/broadcasts.mjs.map +1 -1
  108. package/resources/calls.d.mts +539 -0
  109. package/resources/calls.d.mts.map +1 -0
  110. package/resources/calls.d.ts +539 -0
  111. package/resources/calls.d.ts.map +1 -0
  112. package/resources/calls.js +85 -0
  113. package/resources/calls.js.map +1 -0
  114. package/resources/calls.mjs +81 -0
  115. package/resources/calls.mjs.map +1 -0
  116. package/resources/contacts/contacts.d.mts +32 -13
  117. package/resources/contacts/contacts.d.mts.map +1 -1
  118. package/resources/contacts/contacts.d.ts +32 -13
  119. package/resources/contacts/contacts.d.ts.map +1 -1
  120. package/resources/contacts/contacts.js +0 -14
  121. package/resources/contacts/contacts.js.map +1 -1
  122. package/resources/contacts/contacts.mjs +0 -14
  123. package/resources/contacts/contacts.mjs.map +1 -1
  124. package/resources/conversations.d.mts +360 -0
  125. package/resources/conversations.d.mts.map +1 -0
  126. package/resources/conversations.d.ts +360 -0
  127. package/resources/conversations.d.ts.map +1 -0
  128. package/resources/conversations.js +47 -0
  129. package/resources/conversations.js.map +1 -0
  130. package/resources/conversations.mjs +43 -0
  131. package/resources/conversations.mjs.map +1 -0
  132. package/resources/email-domains.d.mts +260 -0
  133. package/resources/email-domains.d.mts.map +1 -0
  134. package/resources/email-domains.d.ts +260 -0
  135. package/resources/email-domains.d.ts.map +1 -0
  136. package/resources/email-domains.js +77 -0
  137. package/resources/email-domains.js.map +1 -0
  138. package/resources/email-domains.mjs +73 -0
  139. package/resources/email-domains.mjs.map +1 -0
  140. package/resources/functions/functions.d.mts +122 -1
  141. package/resources/functions/functions.d.mts.map +1 -1
  142. package/resources/functions/functions.d.ts +122 -1
  143. package/resources/functions/functions.d.ts.map +1 -1
  144. package/resources/functions/functions.js +53 -0
  145. package/resources/functions/functions.js.map +1 -1
  146. package/resources/functions/functions.mjs +53 -0
  147. package/resources/functions/functions.mjs.map +1 -1
  148. package/resources/functions/git-link.d.mts +295 -0
  149. package/resources/functions/git-link.d.mts.map +1 -0
  150. package/resources/functions/git-link.d.ts +295 -0
  151. package/resources/functions/git-link.d.ts.map +1 -0
  152. package/resources/functions/git-link.js +97 -0
  153. package/resources/functions/git-link.js.map +1 -0
  154. package/resources/functions/git-link.mjs +93 -0
  155. package/resources/functions/git-link.mjs.map +1 -0
  156. package/resources/functions/index.d.mts +3 -1
  157. package/resources/functions/index.d.mts.map +1 -1
  158. package/resources/functions/index.d.ts +3 -1
  159. package/resources/functions/index.d.ts.map +1 -1
  160. package/resources/functions/index.js +5 -1
  161. package/resources/functions/index.js.map +1 -1
  162. package/resources/functions/index.mjs +2 -0
  163. package/resources/functions/index.mjs.map +1 -1
  164. package/resources/functions/triggers.d.mts +164 -0
  165. package/resources/functions/triggers.d.mts.map +1 -0
  166. package/resources/functions/triggers.d.ts +164 -0
  167. package/resources/functions/triggers.d.ts.map +1 -0
  168. package/resources/functions/triggers.js +74 -0
  169. package/resources/functions/triggers.js.map +1 -0
  170. package/resources/functions/triggers.mjs +70 -0
  171. package/resources/functions/triggers.mjs.map +1 -0
  172. package/resources/index.d.mts +10 -5
  173. package/resources/index.d.mts.map +1 -1
  174. package/resources/index.d.ts +10 -5
  175. package/resources/index.d.ts.map +1 -1
  176. package/resources/index.js +11 -1
  177. package/resources/index.js.map +1 -1
  178. package/resources/index.mjs +5 -0
  179. package/resources/index.mjs.map +1 -1
  180. package/resources/introspect.d.mts +74 -1
  181. package/resources/introspect.d.mts.map +1 -1
  182. package/resources/introspect.d.ts +74 -1
  183. package/resources/introspect.d.ts.map +1 -1
  184. package/resources/introspect.js +22 -0
  185. package/resources/introspect.js.map +1 -1
  186. package/resources/introspect.mjs +22 -0
  187. package/resources/introspect.mjs.map +1 -1
  188. package/resources/messages.d.mts +89 -1
  189. package/resources/messages.d.mts.map +1 -1
  190. package/resources/messages.d.ts +89 -1
  191. package/resources/messages.d.ts.map +1 -1
  192. package/resources/messages.js +48 -0
  193. package/resources/messages.js.map +1 -1
  194. package/resources/messages.mjs +48 -0
  195. package/resources/messages.mjs.map +1 -1
  196. package/resources/number-10dlc/brands.d.mts +10 -5
  197. package/resources/number-10dlc/brands.d.mts.map +1 -1
  198. package/resources/number-10dlc/brands.d.ts +10 -5
  199. package/resources/number-10dlc/brands.d.ts.map +1 -1
  200. package/resources/number-10dlc/brands.js +10 -5
  201. package/resources/number-10dlc/brands.js.map +1 -1
  202. package/resources/number-10dlc/brands.mjs +10 -5
  203. package/resources/number-10dlc/brands.mjs.map +1 -1
  204. package/resources/number-10dlc/campaigns/campaigns.d.mts +8 -7
  205. package/resources/number-10dlc/campaigns/campaigns.d.mts.map +1 -1
  206. package/resources/number-10dlc/campaigns/campaigns.d.ts +8 -7
  207. package/resources/number-10dlc/campaigns/campaigns.d.ts.map +1 -1
  208. package/resources/number-10dlc/campaigns/campaigns.js +8 -7
  209. package/resources/number-10dlc/campaigns/campaigns.js.map +1 -1
  210. package/resources/number-10dlc/campaigns/campaigns.mjs +8 -7
  211. package/resources/number-10dlc/campaigns/campaigns.mjs.map +1 -1
  212. package/resources/phone-numbers.d.mts +6 -1
  213. package/resources/phone-numbers.d.mts.map +1 -1
  214. package/resources/phone-numbers.d.ts +6 -1
  215. package/resources/phone-numbers.d.ts.map +1 -1
  216. package/resources/senders/agent/agent.d.mts +4 -3
  217. package/resources/senders/agent/agent.d.mts.map +1 -1
  218. package/resources/senders/agent/agent.d.ts +4 -3
  219. package/resources/senders/agent/agent.d.ts.map +1 -1
  220. package/resources/senders/agent/agent.js +2 -2
  221. package/resources/senders/agent/agent.js.map +1 -1
  222. package/resources/senders/agent/agent.mjs +2 -2
  223. package/resources/senders/agent/agent.mjs.map +1 -1
  224. package/resources/senders/agent/index.d.mts +2 -2
  225. package/resources/senders/agent/index.d.mts.map +1 -1
  226. package/resources/senders/agent/index.d.ts +2 -2
  227. package/resources/senders/agent/index.d.ts.map +1 -1
  228. package/resources/senders/agent/index.js +2 -2
  229. package/resources/senders/agent/index.js.map +1 -1
  230. package/resources/senders/agent/index.mjs +1 -1
  231. package/resources/senders/agent/index.mjs.map +1 -1
  232. package/resources/senders/agent/knowledge-bases/documents.d.mts +56 -1
  233. package/resources/senders/agent/knowledge-bases/documents.d.mts.map +1 -1
  234. package/resources/senders/agent/knowledge-bases/documents.d.ts +56 -1
  235. package/resources/senders/agent/knowledge-bases/documents.d.ts.map +1 -1
  236. package/resources/senders/agent/knowledge-bases/documents.js +33 -0
  237. package/resources/senders/agent/knowledge-bases/documents.js.map +1 -1
  238. package/resources/senders/agent/knowledge-bases/documents.mjs +33 -0
  239. package/resources/senders/agent/knowledge-bases/documents.mjs.map +1 -1
  240. package/resources/senders/agent/knowledge-bases/index.d.mts +1 -1
  241. package/resources/senders/agent/knowledge-bases/index.d.mts.map +1 -1
  242. package/resources/senders/agent/knowledge-bases/index.d.ts +1 -1
  243. package/resources/senders/agent/knowledge-bases/index.d.ts.map +1 -1
  244. package/resources/senders/agent/knowledge-bases/index.js.map +1 -1
  245. package/resources/senders/agent/knowledge-bases/index.mjs.map +1 -1
  246. package/resources/senders/agent/knowledge-bases/knowledge-bases.d.mts +2 -2
  247. package/resources/senders/agent/knowledge-bases/knowledge-bases.d.mts.map +1 -1
  248. package/resources/senders/agent/knowledge-bases/knowledge-bases.d.ts +2 -2
  249. package/resources/senders/agent/knowledge-bases/knowledge-bases.d.ts.map +1 -1
  250. package/resources/senders/agent/knowledge-bases/knowledge-bases.js.map +1 -1
  251. package/resources/senders/agent/knowledge-bases/knowledge-bases.mjs.map +1 -1
  252. package/resources/senders/agent/tools/index.d.mts +3 -0
  253. package/resources/senders/agent/tools/index.d.mts.map +1 -0
  254. package/resources/senders/agent/tools/index.d.ts +3 -0
  255. package/resources/senders/agent/tools/index.d.ts.map +1 -0
  256. package/resources/senders/agent/tools/index.js +9 -0
  257. package/resources/senders/agent/tools/index.js.map +1 -0
  258. package/resources/senders/agent/tools/index.mjs +4 -0
  259. package/resources/senders/agent/tools/index.mjs.map +1 -0
  260. package/resources/senders/agent/tools/tools.d.mts +338 -0
  261. package/resources/senders/agent/tools/tools.d.mts.map +1 -0
  262. package/resources/senders/agent/tools/tools.d.ts +338 -0
  263. package/resources/senders/agent/tools/tools.d.ts.map +1 -0
  264. package/resources/senders/agent/tools/tools.js +163 -0
  265. package/resources/senders/agent/tools/tools.js.map +1 -0
  266. package/resources/senders/agent/tools/tools.mjs +158 -0
  267. package/resources/senders/agent/tools/tools.mjs.map +1 -0
  268. package/resources/senders/agent/tools/webhook.d.mts +28 -0
  269. package/resources/senders/agent/tools/webhook.d.mts.map +1 -0
  270. package/resources/senders/agent/tools/webhook.d.ts +28 -0
  271. package/resources/senders/agent/tools/webhook.d.ts.map +1 -0
  272. package/resources/senders/agent/tools/webhook.js +28 -0
  273. package/resources/senders/agent/tools/webhook.js.map +1 -0
  274. package/resources/senders/agent/tools/webhook.mjs +24 -0
  275. package/resources/senders/agent/tools/webhook.mjs.map +1 -0
  276. package/resources/senders/agent/tools.d.mts +1 -270
  277. package/resources/senders/agent/tools.d.mts.map +1 -1
  278. package/resources/senders/agent/tools.d.ts +1 -270
  279. package/resources/senders/agent/tools.d.ts.map +1 -1
  280. package/resources/senders/agent/tools.js +2 -131
  281. package/resources/senders/agent/tools.js.map +1 -1
  282. package/resources/senders/agent/tools.mjs +1 -129
  283. package/resources/senders/agent/tools.mjs.map +1 -1
  284. package/resources/senders/index.d.mts +2 -1
  285. package/resources/senders/index.d.mts.map +1 -1
  286. package/resources/senders/index.d.ts +2 -1
  287. package/resources/senders/index.d.ts.map +1 -1
  288. package/resources/senders/index.js +3 -1
  289. package/resources/senders/index.js.map +1 -1
  290. package/resources/senders/index.mjs +1 -0
  291. package/resources/senders/index.mjs.map +1 -1
  292. package/resources/senders/senders.d.mts +4 -0
  293. package/resources/senders/senders.d.mts.map +1 -1
  294. package/resources/senders/senders.d.ts +4 -0
  295. package/resources/senders/senders.d.ts.map +1 -1
  296. package/resources/senders/senders.js +4 -0
  297. package/resources/senders/senders.js.map +1 -1
  298. package/resources/senders/senders.mjs +4 -0
  299. package/resources/senders/senders.mjs.map +1 -1
  300. package/resources/senders/telegram.d.mts +48 -0
  301. package/resources/senders/telegram.d.mts.map +1 -0
  302. package/resources/senders/telegram.d.ts +48 -0
  303. package/resources/senders/telegram.d.ts.map +1 -0
  304. package/resources/senders/telegram.js +41 -0
  305. package/resources/senders/telegram.js.map +1 -0
  306. package/resources/senders/telegram.mjs +37 -0
  307. package/resources/senders/telegram.mjs.map +1 -0
  308. package/resources/templates.d.mts +66 -1
  309. package/resources/templates.d.mts.map +1 -1
  310. package/resources/templates.d.ts +66 -1
  311. package/resources/templates.d.ts.map +1 -1
  312. package/resources/templates.js +31 -0
  313. package/resources/templates.js.map +1 -1
  314. package/resources/templates.mjs +31 -0
  315. package/resources/templates.mjs.map +1 -1
  316. package/resources/urls.d.mts +24 -1
  317. package/resources/urls.d.mts.map +1 -1
  318. package/resources/urls.d.ts +24 -1
  319. package/resources/urls.d.ts.map +1 -1
  320. package/resources/urls.js +15 -0
  321. package/resources/urls.js.map +1 -1
  322. package/resources/urls.mjs +15 -0
  323. package/resources/urls.mjs.map +1 -1
  324. package/src/client.ts +129 -3
  325. package/src/internal/qs/LICENSE.md +13 -0
  326. package/src/internal/qs/README.md +3 -0
  327. package/src/internal/qs/formats.ts +10 -0
  328. package/src/internal/qs/index.ts +13 -0
  329. package/src/internal/qs/stringify.ts +385 -0
  330. package/src/internal/qs/types.ts +71 -0
  331. package/src/internal/qs/utils.ts +265 -0
  332. package/src/internal/utils/query.ts +2 -18
  333. package/src/resources/agent-templates.ts +128 -0
  334. package/src/resources/agents/agents.ts +603 -0
  335. package/src/resources/agents/index.ts +21 -0
  336. package/src/resources/agents/senders.ts +79 -0
  337. package/src/resources/agents.ts +3 -0
  338. package/src/resources/broadcasts/broadcasts.ts +16 -9
  339. package/src/resources/calls.ts +647 -0
  340. package/src/resources/contacts/contacts.ts +35 -20
  341. package/src/resources/conversations.ts +472 -0
  342. package/src/resources/email-domains.ts +337 -0
  343. package/src/resources/functions/functions.ts +202 -0
  344. package/src/resources/functions/git-link.ts +398 -0
  345. package/src/resources/functions/index.ts +22 -0
  346. package/src/resources/functions/triggers.ts +227 -0
  347. package/src/resources/index.ts +57 -0
  348. package/src/resources/introspect.ts +105 -0
  349. package/src/resources/messages.ts +102 -0
  350. package/src/resources/number-10dlc/brands.ts +10 -5
  351. package/src/resources/number-10dlc/campaigns/campaigns.ts +8 -7
  352. package/src/resources/phone-numbers.ts +6 -1
  353. package/src/resources/senders/agent/agent.ts +23 -17
  354. package/src/resources/senders/agent/index.ts +4 -1
  355. package/src/resources/senders/agent/knowledge-bases/documents.ts +89 -0
  356. package/src/resources/senders/agent/knowledge-bases/index.ts +4 -0
  357. package/src/resources/senders/agent/knowledge-bases/knowledge-bases.ts +8 -0
  358. package/src/resources/senders/agent/tools/index.ts +21 -0
  359. package/src/resources/senders/agent/tools/tools.ts +460 -0
  360. package/src/resources/senders/agent/tools/webhook.ts +40 -0
  361. package/src/resources/senders/agent/tools.ts +1 -364
  362. package/src/resources/senders/index.ts +2 -0
  363. package/src/resources/senders/senders.ts +10 -0
  364. package/src/resources/senders/telegram.ts +73 -0
  365. package/src/resources/templates.ts +80 -0
  366. package/src/resources/urls.ts +35 -0
  367. package/src/version.ts +1 -1
  368. package/version.d.mts +1 -1
  369. package/version.d.ts +1 -1
  370. package/version.js +1 -1
  371. package/version.mjs +1 -1
@@ -0,0 +1,462 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import * as SendersAPI from "./senders.js";
3
+ import { SenderConnectParams, SenderConnectResponse, SenderDisconnectParams, Senders } from "./senders.js";
4
+ import * as AgentAPI from "../senders/agent/agent.js";
5
+ import { AgentsCursor } from "../senders/agent/agent.js";
6
+ import { APIPromise } from "../../core/api-promise.js";
7
+ import { type CursorParams, PagePromise } from "../../core/pagination.js";
8
+ import { RequestOptions } from "../../internal/request-options.js";
9
+ export declare class Agents extends APIResource {
10
+ senders: SendersAPI.Senders;
11
+ /**
12
+ * Create an agent without a sender. It is created disabled; connect a sender and
13
+ * enable it when you are ready for it to answer.
14
+ *
15
+ * **Sub-resources.** An agent's tools, flows and knowledge bases are reachable at
16
+ * `/v1/agents/{agentId}/tools`, `/v1/agents/{agentId}/flows` and
17
+ * `/v1/agents/{agentId}/knowledge-bases`, mirroring the sender-scoped routes
18
+ * documented under `/v1/senders/{senderId}/agent/...` exactly. Use the
19
+ * agent-scoped form while the agent has no sender: the sender-scoped one cannot
20
+ * address it.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * const agent = await client.agents.create({
25
+ * model: 'model',
26
+ * name: 'name',
27
+ * provider: 'openai',
28
+ * systemPrompt: 'systemPrompt',
29
+ * });
30
+ * ```
31
+ */
32
+ create(body: AgentCreateParams, options?: RequestOptions): APIPromise<AgentCreateResponse>;
33
+ /**
34
+ * Get an agent
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * const agent = await client.agents.retrieve('agentId');
39
+ * ```
40
+ */
41
+ retrieve(agentID: string, options?: RequestOptions): APIPromise<AgentRetrieveResponse>;
42
+ /**
43
+ * Update an agent
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * const agent = await client.agents.update('agentId');
48
+ * ```
49
+ */
50
+ update(agentID: string, body: AgentUpdateParams, options?: RequestOptions): APIPromise<AgentUpdateResponse>;
51
+ /**
52
+ * Every agent in the project, newest first — including agents that are not
53
+ * connected to any sender yet, which the sender-scoped routes cannot reach. Each
54
+ * item carries `senderIds`, the senders the agent answers on.
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * // Automatically fetches more pages as needed.
59
+ * for await (const agent of client.agents.list()) {
60
+ * // ...
61
+ * }
62
+ * ```
63
+ */
64
+ list(query?: AgentListParams | null | undefined, options?: RequestOptions): PagePromise<AgentsCursor, AgentAPI.Agent>;
65
+ /**
66
+ * Delete an agent
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * await client.agents.delete('agentId');
71
+ * ```
72
+ */
73
+ delete(agentID: string, options?: RequestOptions): APIPromise<void>;
74
+ /**
75
+ * The voices an agent can speak with, for `voice.ttsVoiceId`. Filter by `language`
76
+ * to get the ones that speak it; a voice can still be used with `language: auto`,
77
+ * where the agent follows the caller and keeps the chosen voice.
78
+ *
79
+ * @example
80
+ * ```ts
81
+ * const response = await client.agents.listVoices();
82
+ * ```
83
+ */
84
+ listVoices(query?: AgentListVoicesParams | null | undefined, options?: RequestOptions): APIPromise<AgentListVoicesResponse>;
85
+ /**
86
+ * Run the agent's prompt, model and knowledge base against a message and return
87
+ * the reply instead of delivering it. Writes nothing and charges nothing, so it is
88
+ * safe to call repeatedly while iterating on a prompt.
89
+ *
90
+ * Note that a dry run never **executes** tools — running them would cause real
91
+ * side effects. Live conversations on every channel do call them. When the agent
92
+ * has enabled tools, that gap is reported in `warnings` rather than silently
93
+ * producing an answer that looks like a tool call happened.
94
+ *
95
+ * @example
96
+ * ```ts
97
+ * const response = await client.agents.test('agentId', {
98
+ * message: 'Where is order ORD-12345?',
99
+ * });
100
+ * ```
101
+ */
102
+ test(agentID: string, body: AgentTestParams, options?: RequestOptions): APIPromise<AgentTestResponse>;
103
+ }
104
+ export interface AgentCreateResponse {
105
+ /**
106
+ * AI Agent configuration for a sender.
107
+ */
108
+ agent: AgentAPI.Agent;
109
+ }
110
+ export interface AgentRetrieveResponse {
111
+ /**
112
+ * AI Agent configuration for a sender.
113
+ */
114
+ agent: AgentAPI.Agent;
115
+ }
116
+ export interface AgentUpdateResponse {
117
+ /**
118
+ * AI Agent configuration for a sender.
119
+ */
120
+ agent: AgentAPI.Agent;
121
+ }
122
+ export interface AgentListVoicesResponse {
123
+ items: Array<AgentListVoicesResponse.Item>;
124
+ /**
125
+ * Languages an agent can be pinned to. `auto` follows the caller.
126
+ */
127
+ languages: Array<string>;
128
+ /**
129
+ * Voices in the catalog, before filtering.
130
+ */
131
+ total?: number;
132
+ }
133
+ export declare namespace AgentListVoicesResponse {
134
+ interface Item {
135
+ /**
136
+ * Value for `voice.ttsVoiceId`.
137
+ */
138
+ id: string;
139
+ language: string;
140
+ name: string;
141
+ }
142
+ }
143
+ export interface AgentTestResponse {
144
+ error: string | null;
145
+ inputTokens: number;
146
+ /**
147
+ * Knowledge-base chunks retrieved for this message. Zero means the answer was not
148
+ * grounded in your documents.
149
+ */
150
+ knowledgeChunksUsed: number;
151
+ latencyMs: number;
152
+ outputTokens: number;
153
+ success: boolean;
154
+ /**
155
+ * What the agent would reply.
156
+ */
157
+ text: string | null;
158
+ /**
159
+ * Things that are true of this agent but that a dry run cannot prove. Surfaced so
160
+ * a passing dry run is never mistaken for proof that the agent works live.
161
+ *
162
+ * - The agent being disabled.
163
+ * - Enabled tools that were **not offered to the model** here — the model never
164
+ * saw them, so a reply that looks like a lookup was invented. Live conversations
165
+ * on every channel do offer them; running them here would cause real side
166
+ * effects.
167
+ * - An agent whose sender has none of the channels it triggers on, which answers
168
+ * every dry run and no real message.
169
+ * - Contact metadata that exists on a real conversation but not here.
170
+ */
171
+ warnings: Array<string>;
172
+ /**
173
+ * Tools that actually ran, in order, when the request set `executeTools`. Empty on
174
+ * a normal dry run, where nothing is executed. An entry with `ok: false` means the
175
+ * agent saw an error and answered around it, which is what a customer would have
176
+ * received.
177
+ */
178
+ executedToolCalls?: Array<AgentTestResponse.ExecutedToolCall>;
179
+ }
180
+ export declare namespace AgentTestResponse {
181
+ interface ExecutedToolCall {
182
+ name: string;
183
+ ok: boolean;
184
+ error?: string | null;
185
+ }
186
+ }
187
+ export interface AgentCreateParams {
188
+ model: string;
189
+ name: string;
190
+ /**
191
+ * LLM provider for the AI agent.
192
+ */
193
+ provider: AgentAPI.AgentProvider;
194
+ systemPrompt: string;
195
+ contextWindowMessages?: number;
196
+ includeContactMetadata?: boolean;
197
+ maxTokens?: number;
198
+ temperature?: number;
199
+ triggerOnChannels?: Array<string>;
200
+ triggerOnMessageTypes?: Array<string>;
201
+ /**
202
+ * Voice Agent configuration on a sender's AI agent. Controls how the agent behaves
203
+ * on inbound and outbound phone calls through Zavu's managed voice pipeline
204
+ * (speech recognition, the agent's LLM, and speech synthesis, with real-time
205
+ * interruption handling). Requires the Voice Agents feature to be enabled for your
206
+ * team.
207
+ */
208
+ voice?: AgentCreateParams.Voice;
209
+ }
210
+ export declare namespace AgentCreateParams {
211
+ /**
212
+ * Voice Agent configuration on a sender's AI agent. Controls how the agent behaves
213
+ * on inbound and outbound phone calls through Zavu's managed voice pipeline
214
+ * (speech recognition, the agent's LLM, and speech synthesis, with real-time
215
+ * interruption handling). Requires the Voice Agents feature to be enabled for your
216
+ * team.
217
+ */
218
+ interface Voice {
219
+ /**
220
+ * Whether the agent handles voice calls. When false, the sender's number is not
221
+ * answered by the voice agent and outbound calls are rejected.
222
+ */
223
+ enabled: boolean;
224
+ /**
225
+ * Opening line the agent speaks when the call connects. If omitted, the agent
226
+ * waits for the caller to speak first.
227
+ */
228
+ greeting?: string;
229
+ /**
230
+ * Greeting per language, keyed by language code. Used when the caller's language
231
+ * differs from the one `greeting` is written in.
232
+ */
233
+ greetings?: {
234
+ [key: string]: string;
235
+ };
236
+ /**
237
+ * Whether the caller can interrupt the agent while it is speaking (barge-in). When
238
+ * true, the agent stops talking as soon as the caller starts.
239
+ */
240
+ interruptible?: boolean;
241
+ /**
242
+ * BCP-47 language code used for both speech recognition and speech synthesis (e.g.
243
+ * `en`, `es`, `pt-BR`). Auto-detected from the recipient when omitted.
244
+ */
245
+ language?: string;
246
+ /**
247
+ * Hard limit on call length in minutes. The call ends automatically when reached.
248
+ */
249
+ maxCallDurationMinutes?: number;
250
+ /**
251
+ * How long the agent waits during silence before ending the call.
252
+ */
253
+ maxIdleSeconds?: number;
254
+ /**
255
+ * Model that runs the conversation, co-located in the voice network for lowest
256
+ * latency. Independent of the model used for text messaging. Derived from the
257
+ * agent's text model when omitted.
258
+ */
259
+ model?: string;
260
+ /**
261
+ * Whether the call audio is recorded.
262
+ */
263
+ recordCalls?: boolean;
264
+ /**
265
+ * Speech-recognition model. Uses the default when omitted.
266
+ */
267
+ sttModel?: string;
268
+ /**
269
+ * Speech-recognition provider. Uses the default when omitted.
270
+ */
271
+ sttProvider?: string;
272
+ /**
273
+ * E.164 phone number the agent can transfer the call to. When set, the agent is
274
+ * given a transfer tool it can use to hand the call to a human.
275
+ */
276
+ transferPhoneNumber?: string;
277
+ /**
278
+ * Speech-synthesis provider. Uses the default when omitted.
279
+ */
280
+ ttsProvider?: string;
281
+ /**
282
+ * Identifier of the synthesized voice that speaks. Choose from the voices
283
+ * available in the dashboard. Uses a neutral default when omitted.
284
+ */
285
+ ttsVoiceId?: string;
286
+ /**
287
+ * What the agent does when an answering machine or voicemail is detected on an
288
+ * outbound call.
289
+ */
290
+ voicemailAction?: 'hangup' | 'leave_message';
291
+ /**
292
+ * Message spoken when `voicemailAction` is `leave_message`. Falls back to
293
+ * `greeting` when omitted.
294
+ */
295
+ voicemailMessage?: string;
296
+ /**
297
+ * Speech rate. 1.0 is natural. Only honoured by voices that support rate control;
298
+ * ignored by the others.
299
+ */
300
+ voiceSpeed?: number;
301
+ }
302
+ }
303
+ export interface AgentUpdateParams {
304
+ apiKey?: string;
305
+ contextWindowMessages?: number;
306
+ enabled?: boolean;
307
+ includeContactMetadata?: boolean;
308
+ maxTokens?: number | null;
309
+ model?: string;
310
+ name?: string;
311
+ /**
312
+ * LLM provider for the AI agent.
313
+ */
314
+ provider?: AgentAPI.AgentProvider;
315
+ systemPrompt?: string;
316
+ temperature?: number | null;
317
+ triggerOnChannels?: Array<string>;
318
+ triggerOnMessageTypes?: Array<string>;
319
+ /**
320
+ * Voice Agent configuration. Patch this object to enable voice, change the
321
+ * greeting, or adjust call limits. Requires the Voice Agents feature to be enabled
322
+ * for your team.
323
+ */
324
+ voice?: AgentUpdateParams.Voice;
325
+ }
326
+ export declare namespace AgentUpdateParams {
327
+ /**
328
+ * Voice Agent configuration. Patch this object to enable voice, change the
329
+ * greeting, or adjust call limits. Requires the Voice Agents feature to be enabled
330
+ * for your team.
331
+ */
332
+ interface Voice {
333
+ /**
334
+ * Whether the agent handles voice calls. When false, the sender's number is not
335
+ * answered by the voice agent and outbound calls are rejected.
336
+ */
337
+ enabled: boolean;
338
+ /**
339
+ * Opening line the agent speaks when the call connects. If omitted, the agent
340
+ * waits for the caller to speak first.
341
+ */
342
+ greeting?: string;
343
+ /**
344
+ * Greeting per language, keyed by language code. Used when the caller's language
345
+ * differs from the one `greeting` is written in.
346
+ */
347
+ greetings?: {
348
+ [key: string]: string;
349
+ };
350
+ /**
351
+ * Whether the caller can interrupt the agent while it is speaking (barge-in). When
352
+ * true, the agent stops talking as soon as the caller starts.
353
+ */
354
+ interruptible?: boolean;
355
+ /**
356
+ * BCP-47 language code used for both speech recognition and speech synthesis (e.g.
357
+ * `en`, `es`, `pt-BR`). Auto-detected from the recipient when omitted.
358
+ */
359
+ language?: string;
360
+ /**
361
+ * Hard limit on call length in minutes. The call ends automatically when reached.
362
+ */
363
+ maxCallDurationMinutes?: number;
364
+ /**
365
+ * How long the agent waits during silence before ending the call.
366
+ */
367
+ maxIdleSeconds?: number;
368
+ /**
369
+ * Model that runs the conversation, co-located in the voice network for lowest
370
+ * latency. Independent of the model used for text messaging. Derived from the
371
+ * agent's text model when omitted.
372
+ */
373
+ model?: string;
374
+ /**
375
+ * Whether the call audio is recorded.
376
+ */
377
+ recordCalls?: boolean;
378
+ /**
379
+ * Speech-recognition model. Uses the default when omitted.
380
+ */
381
+ sttModel?: string;
382
+ /**
383
+ * Speech-recognition provider. Uses the default when omitted.
384
+ */
385
+ sttProvider?: string;
386
+ /**
387
+ * E.164 phone number the agent can transfer the call to. When set, the agent is
388
+ * given a transfer tool it can use to hand the call to a human.
389
+ */
390
+ transferPhoneNumber?: string;
391
+ /**
392
+ * Speech-synthesis provider. Uses the default when omitted.
393
+ */
394
+ ttsProvider?: string;
395
+ /**
396
+ * Identifier of the synthesized voice that speaks. Choose from the voices
397
+ * available in the dashboard. Uses a neutral default when omitted.
398
+ */
399
+ ttsVoiceId?: string;
400
+ /**
401
+ * What the agent does when an answering machine or voicemail is detected on an
402
+ * outbound call.
403
+ */
404
+ voicemailAction?: 'hangup' | 'leave_message';
405
+ /**
406
+ * Message spoken when `voicemailAction` is `leave_message`. Falls back to
407
+ * `greeting` when omitted.
408
+ */
409
+ voicemailMessage?: string;
410
+ /**
411
+ * Speech rate. 1.0 is natural. Only honoured by voices that support rate control;
412
+ * ignored by the others.
413
+ */
414
+ voiceSpeed?: number;
415
+ }
416
+ }
417
+ export interface AgentListParams extends CursorParams {
418
+ }
419
+ export interface AgentListVoicesParams {
420
+ /**
421
+ * BCP-47 tag (`en`, `es`, `pt-BR`). Omit, or pass `auto`, for every voice.
422
+ */
423
+ language?: string;
424
+ }
425
+ export interface AgentTestParams {
426
+ /**
427
+ * What to say to the agent.
428
+ */
429
+ message: string;
430
+ /**
431
+ * Run the tools the agent calls instead of reporting the choice and stopping.
432
+ *
433
+ * Off by default because a tool handler talks to the outside world: a rehearsal
434
+ * that charges a card is not a rehearsal. Turn it on to exercise the loop that
435
+ * actually matters — the model picks a tool, the handler answers, the model
436
+ * replies with the result — without sending a message to anyone. What ran comes
437
+ * back in `executedToolCalls`.
438
+ */
439
+ executeTools?: boolean;
440
+ /**
441
+ * Prior turns, oldest first, to exercise multi-turn behaviour without persisting a
442
+ * thread. Trimmed to the agent's context window.
443
+ */
444
+ history?: Array<AgentTestParams.History>;
445
+ /**
446
+ * Set false to skip retrieval and isolate prompt behaviour from the knowledge
447
+ * base.
448
+ */
449
+ useKnowledgeBase?: boolean;
450
+ }
451
+ export declare namespace AgentTestParams {
452
+ interface History {
453
+ content: string;
454
+ role: 'user' | 'assistant';
455
+ }
456
+ }
457
+ export declare namespace Agents {
458
+ export { type AgentCreateResponse as AgentCreateResponse, type AgentRetrieveResponse as AgentRetrieveResponse, type AgentUpdateResponse as AgentUpdateResponse, type AgentListVoicesResponse as AgentListVoicesResponse, type AgentTestResponse as AgentTestResponse, type AgentCreateParams as AgentCreateParams, type AgentUpdateParams as AgentUpdateParams, type AgentListParams as AgentListParams, type AgentListVoicesParams as AgentListVoicesParams, type AgentTestParams as AgentTestParams, };
459
+ export { Senders as Senders, type SenderConnectResponse as SenderConnectResponse, type SenderConnectParams as SenderConnectParams, type SenderDisconnectParams as SenderDisconnectParams, };
460
+ }
461
+ export { type AgentsCursor };
462
+ //# sourceMappingURL=agents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/resources/agents/agents.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,UAAU,qBAAkB;AACxC,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,OAAO,EAAE,qBAAkB;AACxG,OAAO,KAAK,QAAQ,kCAA+B;AACnD,OAAO,EAAE,YAAY,EAAE,kCAA+B;AACtD,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAU,KAAK,YAAY,EAAE,WAAW,EAAE,iCAA8B;AAE/E,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE,qBAA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AAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;IAEF,OAAO,EACL,OAAO,IAAI,OAAO,EAClB,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH;AAED,OAAO,EAAE,KAAK,YAAY,EAAE,CAAC"}
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Agents = void 0;
5
+ const tslib_1 = require("../../internal/tslib.js");
6
+ const resource_1 = require("../../core/resource.js");
7
+ const SendersAPI = tslib_1.__importStar(require("./senders.js"));
8
+ const senders_1 = require("./senders.js");
9
+ const pagination_1 = require("../../core/pagination.js");
10
+ const headers_1 = require("../../internal/headers.js");
11
+ const path_1 = require("../../internal/utils/path.js");
12
+ class Agents extends resource_1.APIResource {
13
+ constructor() {
14
+ super(...arguments);
15
+ this.senders = new SendersAPI.Senders(this._client);
16
+ }
17
+ /**
18
+ * Create an agent without a sender. It is created disabled; connect a sender and
19
+ * enable it when you are ready for it to answer.
20
+ *
21
+ * **Sub-resources.** An agent's tools, flows and knowledge bases are reachable at
22
+ * `/v1/agents/{agentId}/tools`, `/v1/agents/{agentId}/flows` and
23
+ * `/v1/agents/{agentId}/knowledge-bases`, mirroring the sender-scoped routes
24
+ * documented under `/v1/senders/{senderId}/agent/...` exactly. Use the
25
+ * agent-scoped form while the agent has no sender: the sender-scoped one cannot
26
+ * address it.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * const agent = await client.agents.create({
31
+ * model: 'model',
32
+ * name: 'name',
33
+ * provider: 'openai',
34
+ * systemPrompt: 'systemPrompt',
35
+ * });
36
+ * ```
37
+ */
38
+ create(body, options) {
39
+ return this._client.post('/v1/agents', { body, ...options });
40
+ }
41
+ /**
42
+ * Get an agent
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * const agent = await client.agents.retrieve('agentId');
47
+ * ```
48
+ */
49
+ retrieve(agentID, options) {
50
+ return this._client.get((0, path_1.path) `/v1/agents/${agentID}`, options);
51
+ }
52
+ /**
53
+ * Update an agent
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * const agent = await client.agents.update('agentId');
58
+ * ```
59
+ */
60
+ update(agentID, body, options) {
61
+ return this._client.patch((0, path_1.path) `/v1/agents/${agentID}`, { body, ...options });
62
+ }
63
+ /**
64
+ * Every agent in the project, newest first — including agents that are not
65
+ * connected to any sender yet, which the sender-scoped routes cannot reach. Each
66
+ * item carries `senderIds`, the senders the agent answers on.
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * // Automatically fetches more pages as needed.
71
+ * for await (const agent of client.agents.list()) {
72
+ * // ...
73
+ * }
74
+ * ```
75
+ */
76
+ list(query = {}, options) {
77
+ return this._client.getAPIList('/v1/agents', (pagination_1.Cursor), { query, ...options });
78
+ }
79
+ /**
80
+ * Delete an agent
81
+ *
82
+ * @example
83
+ * ```ts
84
+ * await client.agents.delete('agentId');
85
+ * ```
86
+ */
87
+ delete(agentID, options) {
88
+ return this._client.delete((0, path_1.path) `/v1/agents/${agentID}`, {
89
+ ...options,
90
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
91
+ });
92
+ }
93
+ /**
94
+ * The voices an agent can speak with, for `voice.ttsVoiceId`. Filter by `language`
95
+ * to get the ones that speak it; a voice can still be used with `language: auto`,
96
+ * where the agent follows the caller and keeps the chosen voice.
97
+ *
98
+ * @example
99
+ * ```ts
100
+ * const response = await client.agents.listVoices();
101
+ * ```
102
+ */
103
+ listVoices(query = {}, options) {
104
+ return this._client.get('/v1/agents/voices', { query, ...options });
105
+ }
106
+ /**
107
+ * Run the agent's prompt, model and knowledge base against a message and return
108
+ * the reply instead of delivering it. Writes nothing and charges nothing, so it is
109
+ * safe to call repeatedly while iterating on a prompt.
110
+ *
111
+ * Note that a dry run never **executes** tools — running them would cause real
112
+ * side effects. Live conversations on every channel do call them. When the agent
113
+ * has enabled tools, that gap is reported in `warnings` rather than silently
114
+ * producing an answer that looks like a tool call happened.
115
+ *
116
+ * @example
117
+ * ```ts
118
+ * const response = await client.agents.test('agentId', {
119
+ * message: 'Where is order ORD-12345?',
120
+ * });
121
+ * ```
122
+ */
123
+ test(agentID, body, options) {
124
+ return this._client.post((0, path_1.path) `/v1/agents/${agentID}/test`, { body, ...options });
125
+ }
126
+ }
127
+ exports.Agents = Agents;
128
+ Agents.Senders = senders_1.Senders;
129
+ //# sourceMappingURL=agents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/resources/agents/agents.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,iEAAwC;AACxC,0CAAwG;AAIxG,yDAA+E;AAC/E,uDAAsD;AAEtD,uDAAiD;AAEjD,MAAa,MAAO,SAAQ,sBAAW;IAAvC;;QACE,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA+HrE,CAAC;IA7HC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,IAAuB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAe,EAAE,OAAwB;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,cAAc,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;IAED;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