@corti/sdk 0.1.1 → 0.1.2-agents.rc

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 (495) hide show
  1. package/README.md +17 -0
  2. package/dist/cjs/Client.d.ts +3 -0
  3. package/dist/cjs/Client.js +11 -6
  4. package/dist/cjs/api/errors/NotFoundError.d.ts +1 -2
  5. package/dist/cjs/api/index.d.ts +4 -0
  6. package/dist/cjs/api/index.js +4 -0
  7. package/dist/cjs/api/resources/agents/client/Client.d.ts +195 -0
  8. package/dist/cjs/api/resources/agents/client/Client.js +874 -0
  9. package/dist/cjs/api/resources/agents/client/index.d.ts +2 -0
  10. package/dist/cjs/api/resources/agents/client/index.js +17 -0
  11. package/dist/cjs/api/resources/agents/client/requests/AgentsCreateAgent.d.ts +20 -0
  12. package/dist/cjs/api/resources/agents/client/requests/AgentsCreateAgent.js +5 -0
  13. package/dist/cjs/api/resources/agents/client/requests/AgentsGetContextRequest.d.ts +17 -0
  14. package/dist/cjs/api/resources/agents/client/requests/AgentsGetContextRequest.js +5 -0
  15. package/dist/cjs/api/resources/agents/client/requests/AgentsGetTaskRequest.d.ts +13 -0
  16. package/dist/cjs/api/resources/agents/client/requests/AgentsGetTaskRequest.js +5 -0
  17. package/dist/cjs/api/resources/agents/client/requests/AgentsListRequest.d.ts +17 -0
  18. package/dist/cjs/api/resources/agents/client/requests/AgentsListRequest.js +5 -0
  19. package/dist/cjs/api/resources/agents/client/requests/index.d.ts +4 -0
  20. package/dist/cjs/api/resources/agents/client/requests/index.js +2 -0
  21. package/dist/cjs/api/resources/agents/index.d.ts +2 -0
  22. package/dist/cjs/api/resources/agents/index.js +18 -0
  23. package/dist/cjs/api/resources/agents/types/AgentsCreateAgentExpertsItem.d.ts +13 -0
  24. package/dist/cjs/api/resources/agents/types/AgentsCreateAgentExpertsItem.js +5 -0
  25. package/dist/cjs/api/resources/agents/types/AgentsMessageSendResponse.d.ts +8 -0
  26. package/dist/cjs/api/resources/agents/types/AgentsMessageSendResponse.js +5 -0
  27. package/dist/cjs/api/resources/agents/types/AgentsMessageStreamResponse.d.ts +10 -0
  28. package/dist/cjs/api/resources/agents/types/AgentsMessageStreamResponse.js +5 -0
  29. package/dist/cjs/api/resources/agents/types/index.d.ts +3 -0
  30. package/dist/cjs/api/resources/agents/types/index.js +19 -0
  31. package/dist/cjs/api/resources/documents/client/Client.js +1 -7
  32. package/dist/cjs/api/resources/index.d.ts +3 -0
  33. package/dist/cjs/api/resources/index.js +4 -1
  34. package/dist/cjs/api/resources/recordings/client/Client.js +2 -14
  35. package/dist/cjs/api/types/AgentsAgent.d.ts +13 -0
  36. package/dist/cjs/api/types/AgentsAgent.js +5 -0
  37. package/dist/cjs/api/types/AgentsAgentCapabilities.d.ts +14 -0
  38. package/dist/cjs/api/types/AgentsAgentCapabilities.js +5 -0
  39. package/dist/cjs/api/types/AgentsAgentCard.d.ts +36 -0
  40. package/dist/cjs/api/types/AgentsAgentCard.js +5 -0
  41. package/dist/cjs/api/types/AgentsAgentCardPreferredTransport.d.ts +5 -0
  42. package/dist/cjs/api/types/AgentsAgentCardPreferredTransport.js +5 -0
  43. package/dist/cjs/api/types/AgentsAgentCardSignature.d.ts +11 -0
  44. package/dist/cjs/api/types/AgentsAgentCardSignature.js +5 -0
  45. package/dist/cjs/api/types/AgentsAgentExpertsItem.d.ts +13 -0
  46. package/dist/cjs/api/types/AgentsAgentExpertsItem.js +5 -0
  47. package/dist/cjs/api/types/AgentsAgentExtension.d.ts +13 -0
  48. package/dist/cjs/api/types/AgentsAgentExtension.js +5 -0
  49. package/dist/cjs/api/types/AgentsAgentInterface.d.ts +9 -0
  50. package/dist/cjs/api/types/AgentsAgentInterface.js +5 -0
  51. package/dist/cjs/api/types/AgentsAgentInterfaceTransport.d.ts +5 -0
  52. package/dist/cjs/api/types/AgentsAgentInterfaceTransport.js +5 -0
  53. package/dist/cjs/api/types/AgentsAgentReference.d.ts +13 -0
  54. package/dist/cjs/api/types/AgentsAgentReference.js +5 -0
  55. package/dist/cjs/api/types/AgentsAgentResponse.d.ts +5 -0
  56. package/dist/cjs/api/types/AgentsAgentResponse.js +5 -0
  57. package/dist/cjs/api/types/AgentsAgentSkill.d.ts +22 -0
  58. package/dist/cjs/api/types/AgentsAgentSkill.js +5 -0
  59. package/dist/cjs/api/types/AgentsArtifact.d.ts +18 -0
  60. package/dist/cjs/api/types/AgentsArtifact.js +5 -0
  61. package/dist/cjs/api/types/AgentsContext.d.ts +9 -0
  62. package/dist/cjs/api/types/AgentsContext.js +5 -0
  63. package/dist/cjs/api/types/AgentsContextItemsItem.d.ts +13 -0
  64. package/dist/cjs/api/types/AgentsContextItemsItem.js +5 -0
  65. package/dist/cjs/api/types/AgentsCreateExpert.d.ts +14 -0
  66. package/dist/cjs/api/types/AgentsCreateExpert.js +5 -0
  67. package/dist/cjs/api/types/AgentsCreateMcpServer.d.ts +20 -0
  68. package/dist/cjs/api/types/AgentsCreateMcpServer.js +5 -0
  69. package/dist/cjs/api/types/AgentsCreateMcpServerAuthorizationType.d.ts +12 -0
  70. package/dist/cjs/api/types/AgentsCreateMcpServerAuthorizationType.js +11 -0
  71. package/dist/cjs/api/types/AgentsCreateMcpServerTransportType.d.ts +12 -0
  72. package/dist/cjs/api/types/AgentsCreateMcpServerTransportType.js +11 -0
  73. package/dist/cjs/api/types/AgentsDataPart.d.ts +9 -0
  74. package/dist/cjs/api/types/AgentsDataPart.js +5 -0
  75. package/dist/cjs/api/types/AgentsExpert.d.ts +16 -0
  76. package/dist/cjs/api/types/AgentsExpert.js +5 -0
  77. package/dist/cjs/api/types/AgentsExpertReference.d.ts +12 -0
  78. package/dist/cjs/api/types/AgentsExpertReference.js +5 -0
  79. package/dist/cjs/api/types/AgentsFilePart.d.ts +9 -0
  80. package/dist/cjs/api/types/AgentsFilePart.js +5 -0
  81. package/dist/cjs/api/types/AgentsFilePartFile.d.ts +5 -0
  82. package/dist/cjs/api/types/AgentsFilePartFile.js +5 -0
  83. package/dist/cjs/api/types/AgentsFileWithBytes.d.ts +11 -0
  84. package/dist/cjs/api/types/AgentsFileWithBytes.js +5 -0
  85. package/dist/cjs/api/types/AgentsFileWithUri.d.ts +11 -0
  86. package/dist/cjs/api/types/AgentsFileWithUri.js +5 -0
  87. package/dist/cjs/api/types/AgentsMcpServer.d.ts +18 -0
  88. package/dist/cjs/api/types/AgentsMcpServer.js +5 -0
  89. package/dist/cjs/api/types/AgentsMcpServerAuthorizationType.d.ts +12 -0
  90. package/dist/cjs/api/types/AgentsMcpServerAuthorizationType.js +11 -0
  91. package/dist/cjs/api/types/AgentsMcpServerTransportType.d.ts +11 -0
  92. package/dist/cjs/api/types/AgentsMcpServerTransportType.js +10 -0
  93. package/dist/cjs/api/types/AgentsMessage.d.ts +22 -0
  94. package/dist/cjs/api/types/AgentsMessage.js +5 -0
  95. package/dist/cjs/api/types/AgentsMessageRole.d.ts +11 -0
  96. package/dist/cjs/api/types/AgentsMessageRole.js +10 -0
  97. package/dist/cjs/api/types/AgentsMessageSendConfiguration.d.ts +13 -0
  98. package/dist/cjs/api/types/AgentsMessageSendConfiguration.js +5 -0
  99. package/dist/cjs/api/types/AgentsMessageSendParams.d.ts +10 -0
  100. package/dist/cjs/api/types/AgentsMessageSendParams.js +5 -0
  101. package/dist/cjs/api/types/AgentsPart.d.ts +16 -0
  102. package/dist/cjs/api/types/AgentsPart.js +5 -0
  103. package/dist/cjs/api/types/AgentsPushNotificationAuthenticationInfo.d.ts +9 -0
  104. package/dist/cjs/api/types/AgentsPushNotificationAuthenticationInfo.js +5 -0
  105. package/dist/cjs/api/types/AgentsPushNotificationConfig.d.ts +13 -0
  106. package/dist/cjs/api/types/AgentsPushNotificationConfig.js +5 -0
  107. package/dist/cjs/api/types/AgentsTask.d.ts +17 -0
  108. package/dist/cjs/api/types/AgentsTask.js +5 -0
  109. package/dist/cjs/api/types/AgentsTaskArtifactUpdateEvent.d.ts +19 -0
  110. package/dist/cjs/api/types/AgentsTaskArtifactUpdateEvent.js +5 -0
  111. package/dist/cjs/api/types/AgentsTaskStatus.d.ts +12 -0
  112. package/dist/cjs/api/types/AgentsTaskStatus.js +5 -0
  113. package/dist/cjs/api/types/AgentsTaskStatusState.d.ts +18 -0
  114. package/dist/cjs/api/types/AgentsTaskStatusState.js +17 -0
  115. package/dist/cjs/api/types/AgentsTaskStatusUpdateEvent.d.ts +17 -0
  116. package/dist/cjs/api/types/AgentsTaskStatusUpdateEvent.js +5 -0
  117. package/dist/cjs/api/types/AgentsTextPart.d.ts +9 -0
  118. package/dist/cjs/api/types/AgentsTextPart.js +5 -0
  119. package/dist/cjs/api/types/AgentsTransportProtocol.d.ts +12 -0
  120. package/dist/cjs/api/types/AgentsTransportProtocol.js +11 -0
  121. package/dist/cjs/api/types/index.d.ts +43 -0
  122. package/dist/cjs/api/types/index.js +43 -0
  123. package/dist/cjs/core/index.d.ts +1 -0
  124. package/dist/cjs/core/index.js +1 -0
  125. package/dist/cjs/core/stream/Stream.d.ts +46 -0
  126. package/dist/cjs/core/stream/Stream.js +169 -0
  127. package/dist/cjs/core/stream/index.d.ts +1 -0
  128. package/dist/cjs/core/stream/index.js +5 -0
  129. package/dist/cjs/custom/CortiClient.d.ts +3 -0
  130. package/dist/cjs/custom/CortiClient.js +9 -4
  131. package/dist/cjs/custom/RefreshBearerProvider.d.ts +10 -5
  132. package/dist/cjs/custom/RefreshBearerProvider.js +1 -1
  133. package/dist/cjs/custom/index.d.ts +1 -0
  134. package/dist/cjs/custom/index.js +17 -0
  135. package/dist/cjs/custom/utils/getEnvironmentFromString.js +1 -0
  136. package/dist/cjs/environments.d.ts +3 -0
  137. package/dist/cjs/environments.js +2 -0
  138. package/dist/cjs/serialization/resources/agents/client/index.d.ts +2 -0
  139. package/dist/cjs/serialization/resources/agents/client/index.js +41 -0
  140. package/dist/cjs/serialization/resources/agents/client/list.d.ts +11 -0
  141. package/dist/cjs/serialization/resources/agents/client/list.js +42 -0
  142. package/dist/cjs/serialization/resources/agents/client/requests/AgentsCreateAgent.d.ts +16 -0
  143. package/dist/cjs/serialization/resources/agents/client/requests/AgentsCreateAgent.js +47 -0
  144. package/dist/cjs/serialization/resources/agents/client/requests/index.d.ts +1 -0
  145. package/dist/cjs/serialization/resources/agents/client/requests/index.js +5 -0
  146. package/dist/cjs/serialization/resources/agents/index.d.ts +2 -0
  147. package/dist/cjs/serialization/resources/agents/index.js +18 -0
  148. package/dist/cjs/serialization/resources/agents/types/AgentsCreateAgentExpertsItem.d.ts +18 -0
  149. package/dist/cjs/serialization/resources/agents/types/AgentsCreateAgentExpertsItem.js +51 -0
  150. package/dist/cjs/serialization/resources/agents/types/AgentsMessageSendResponse.d.ts +15 -0
  151. package/dist/cjs/serialization/resources/agents/types/AgentsMessageSendResponse.js +46 -0
  152. package/dist/cjs/serialization/resources/agents/types/AgentsMessageStreamResponse.d.ts +19 -0
  153. package/dist/cjs/serialization/resources/agents/types/AgentsMessageStreamResponse.js +50 -0
  154. package/dist/cjs/serialization/resources/agents/types/index.d.ts +3 -0
  155. package/dist/cjs/serialization/resources/agents/types/index.js +19 -0
  156. package/dist/cjs/serialization/resources/index.d.ts +3 -0
  157. package/dist/cjs/serialization/resources/index.js +4 -1
  158. package/dist/cjs/serialization/types/AgentsAgent.d.ts +16 -0
  159. package/dist/cjs/serialization/types/AgentsAgent.js +47 -0
  160. package/dist/cjs/serialization/types/AgentsAgentCapabilities.d.ts +16 -0
  161. package/dist/cjs/serialization/types/AgentsAgentCapabilities.js +47 -0
  162. package/dist/cjs/serialization/types/AgentsAgentCard.d.ts +32 -0
  163. package/dist/cjs/serialization/types/AgentsAgentCard.js +65 -0
  164. package/dist/cjs/serialization/types/AgentsAgentCardPreferredTransport.d.ts +11 -0
  165. package/dist/cjs/serialization/types/AgentsAgentCardPreferredTransport.js +42 -0
  166. package/dist/cjs/serialization/types/AgentsAgentCardSignature.d.ts +14 -0
  167. package/dist/cjs/serialization/types/AgentsAgentCardSignature.js +45 -0
  168. package/dist/cjs/serialization/types/AgentsAgentExpertsItem.d.ts +18 -0
  169. package/dist/cjs/serialization/types/AgentsAgentExpertsItem.js +51 -0
  170. package/dist/cjs/serialization/types/AgentsAgentExtension.d.ts +15 -0
  171. package/dist/cjs/serialization/types/AgentsAgentExtension.js +46 -0
  172. package/dist/cjs/serialization/types/AgentsAgentInterface.d.ts +14 -0
  173. package/dist/cjs/serialization/types/AgentsAgentInterface.js +45 -0
  174. package/dist/cjs/serialization/types/AgentsAgentInterfaceTransport.d.ts +11 -0
  175. package/dist/cjs/serialization/types/AgentsAgentInterfaceTransport.js +42 -0
  176. package/dist/cjs/serialization/types/AgentsAgentReference.d.ts +14 -0
  177. package/dist/cjs/serialization/types/AgentsAgentReference.js +45 -0
  178. package/dist/cjs/serialization/types/AgentsAgentResponse.d.ts +12 -0
  179. package/dist/cjs/serialization/types/AgentsAgentResponse.js +43 -0
  180. package/dist/cjs/serialization/types/AgentsAgentSkill.d.ts +20 -0
  181. package/dist/cjs/serialization/types/AgentsAgentSkill.js +51 -0
  182. package/dist/cjs/serialization/types/AgentsArtifact.d.ts +18 -0
  183. package/dist/cjs/serialization/types/AgentsArtifact.js +49 -0
  184. package/dist/cjs/serialization/types/AgentsContext.d.ts +14 -0
  185. package/dist/cjs/serialization/types/AgentsContext.js +45 -0
  186. package/dist/cjs/serialization/types/AgentsContextItemsItem.d.ts +18 -0
  187. package/dist/cjs/serialization/types/AgentsContextItemsItem.js +51 -0
  188. package/dist/cjs/serialization/types/AgentsCreateExpert.d.ts +16 -0
  189. package/dist/cjs/serialization/types/AgentsCreateExpert.js +47 -0
  190. package/dist/cjs/serialization/types/AgentsCreateMcpServer.d.ts +20 -0
  191. package/dist/cjs/serialization/types/AgentsCreateMcpServer.js +51 -0
  192. package/dist/cjs/serialization/types/AgentsCreateMcpServerAuthorizationType.d.ts +10 -0
  193. package/dist/cjs/serialization/types/AgentsCreateMcpServerAuthorizationType.js +41 -0
  194. package/dist/cjs/serialization/types/AgentsCreateMcpServerTransportType.d.ts +10 -0
  195. package/dist/cjs/serialization/types/AgentsCreateMcpServerTransportType.js +41 -0
  196. package/dist/cjs/serialization/types/AgentsDataPart.d.ts +13 -0
  197. package/dist/cjs/serialization/types/AgentsDataPart.js +44 -0
  198. package/dist/cjs/serialization/types/AgentsExpert.d.ts +17 -0
  199. package/dist/cjs/serialization/types/AgentsExpert.js +48 -0
  200. package/dist/cjs/serialization/types/AgentsExpertReference.d.ts +13 -0
  201. package/dist/cjs/serialization/types/AgentsExpertReference.js +44 -0
  202. package/dist/cjs/serialization/types/AgentsFilePart.d.ts +14 -0
  203. package/dist/cjs/serialization/types/AgentsFilePart.js +45 -0
  204. package/dist/cjs/serialization/types/AgentsFilePartFile.d.ts +12 -0
  205. package/dist/cjs/serialization/types/AgentsFilePartFile.js +43 -0
  206. package/dist/cjs/serialization/types/AgentsFileWithBytes.d.ts +14 -0
  207. package/dist/cjs/serialization/types/AgentsFileWithBytes.js +45 -0
  208. package/dist/cjs/serialization/types/AgentsFileWithUri.d.ts +14 -0
  209. package/dist/cjs/serialization/types/AgentsFileWithUri.js +45 -0
  210. package/dist/cjs/serialization/types/AgentsMcpServer.d.ts +19 -0
  211. package/dist/cjs/serialization/types/AgentsMcpServer.js +50 -0
  212. package/dist/cjs/serialization/types/AgentsMcpServerAuthorizationType.d.ts +10 -0
  213. package/dist/cjs/serialization/types/AgentsMcpServerAuthorizationType.js +41 -0
  214. package/dist/cjs/serialization/types/AgentsMcpServerTransportType.d.ts +10 -0
  215. package/dist/cjs/serialization/types/AgentsMcpServerTransportType.js +41 -0
  216. package/dist/cjs/serialization/types/AgentsMessage.d.ts +21 -0
  217. package/dist/cjs/serialization/types/AgentsMessage.js +52 -0
  218. package/dist/cjs/serialization/types/AgentsMessageRole.d.ts +10 -0
  219. package/dist/cjs/serialization/types/AgentsMessageRole.js +41 -0
  220. package/dist/cjs/serialization/types/AgentsMessageSendConfiguration.d.ts +16 -0
  221. package/dist/cjs/serialization/types/AgentsMessageSendConfiguration.js +47 -0
  222. package/dist/cjs/serialization/types/AgentsMessageSendParams.d.ts +16 -0
  223. package/dist/cjs/serialization/types/AgentsMessageSendParams.js +47 -0
  224. package/dist/cjs/serialization/types/AgentsPart.d.ts +22 -0
  225. package/dist/cjs/serialization/types/AgentsPart.js +53 -0
  226. package/dist/cjs/serialization/types/AgentsPushNotificationAuthenticationInfo.d.ts +13 -0
  227. package/dist/cjs/serialization/types/AgentsPushNotificationAuthenticationInfo.js +44 -0
  228. package/dist/cjs/serialization/types/AgentsPushNotificationConfig.d.ts +16 -0
  229. package/dist/cjs/serialization/types/AgentsPushNotificationConfig.js +47 -0
  230. package/dist/cjs/serialization/types/AgentsTask.d.ts +20 -0
  231. package/dist/cjs/serialization/types/AgentsTask.js +51 -0
  232. package/dist/cjs/serialization/types/AgentsTaskArtifactUpdateEvent.d.ts +19 -0
  233. package/dist/cjs/serialization/types/AgentsTaskArtifactUpdateEvent.js +50 -0
  234. package/dist/cjs/serialization/types/AgentsTaskStatus.d.ts +16 -0
  235. package/dist/cjs/serialization/types/AgentsTaskStatus.js +47 -0
  236. package/dist/cjs/serialization/types/AgentsTaskStatusState.d.ts +10 -0
  237. package/dist/cjs/serialization/types/AgentsTaskStatusState.js +51 -0
  238. package/dist/cjs/serialization/types/AgentsTaskStatusUpdateEvent.d.ts +18 -0
  239. package/dist/cjs/serialization/types/AgentsTaskStatusUpdateEvent.js +49 -0
  240. package/dist/cjs/serialization/types/AgentsTextPart.d.ts +13 -0
  241. package/dist/cjs/serialization/types/AgentsTextPart.js +44 -0
  242. package/dist/cjs/serialization/types/AgentsTransportProtocol.d.ts +10 -0
  243. package/dist/cjs/serialization/types/AgentsTransportProtocol.js +41 -0
  244. package/dist/cjs/serialization/types/index.d.ts +43 -0
  245. package/dist/cjs/serialization/types/index.js +43 -0
  246. package/dist/cjs/version.d.ts +1 -1
  247. package/dist/cjs/version.js +1 -1
  248. package/dist/esm/Client.d.mts +3 -0
  249. package/dist/esm/Client.mjs +7 -2
  250. package/dist/esm/api/errors/NotFoundError.d.mts +1 -2
  251. package/dist/esm/api/index.d.mts +4 -0
  252. package/dist/esm/api/index.mjs +4 -0
  253. package/dist/esm/api/resources/agents/client/Client.d.mts +195 -0
  254. package/dist/esm/api/resources/agents/client/Client.mjs +837 -0
  255. package/dist/esm/api/resources/agents/client/index.d.mts +2 -0
  256. package/dist/esm/api/resources/agents/client/index.mjs +1 -0
  257. package/dist/esm/api/resources/agents/client/requests/AgentsCreateAgent.d.mts +20 -0
  258. package/dist/esm/api/resources/agents/client/requests/AgentsCreateAgent.mjs +4 -0
  259. package/dist/esm/api/resources/agents/client/requests/AgentsGetContextRequest.d.mts +17 -0
  260. package/dist/esm/api/resources/agents/client/requests/AgentsGetContextRequest.mjs +4 -0
  261. package/dist/esm/api/resources/agents/client/requests/AgentsGetTaskRequest.d.mts +13 -0
  262. package/dist/esm/api/resources/agents/client/requests/AgentsGetTaskRequest.mjs +4 -0
  263. package/dist/esm/api/resources/agents/client/requests/AgentsListRequest.d.mts +17 -0
  264. package/dist/esm/api/resources/agents/client/requests/AgentsListRequest.mjs +4 -0
  265. package/dist/esm/api/resources/agents/client/requests/index.d.mts +4 -0
  266. package/dist/esm/api/resources/agents/client/requests/index.mjs +1 -0
  267. package/dist/esm/api/resources/agents/index.d.mts +2 -0
  268. package/dist/esm/api/resources/agents/index.mjs +2 -0
  269. package/dist/esm/api/resources/agents/types/AgentsCreateAgentExpertsItem.d.mts +13 -0
  270. package/dist/esm/api/resources/agents/types/AgentsCreateAgentExpertsItem.mjs +4 -0
  271. package/dist/esm/api/resources/agents/types/AgentsMessageSendResponse.d.mts +8 -0
  272. package/dist/esm/api/resources/agents/types/AgentsMessageSendResponse.mjs +4 -0
  273. package/dist/esm/api/resources/agents/types/AgentsMessageStreamResponse.d.mts +10 -0
  274. package/dist/esm/api/resources/agents/types/AgentsMessageStreamResponse.mjs +4 -0
  275. package/dist/esm/api/resources/agents/types/index.d.mts +3 -0
  276. package/dist/esm/api/resources/agents/types/index.mjs +3 -0
  277. package/dist/esm/api/resources/documents/client/Client.mjs +1 -7
  278. package/dist/esm/api/resources/index.d.mts +3 -0
  279. package/dist/esm/api/resources/index.mjs +3 -0
  280. package/dist/esm/api/resources/recordings/client/Client.mjs +2 -14
  281. package/dist/esm/api/types/AgentsAgent.d.mts +13 -0
  282. package/dist/esm/api/types/AgentsAgent.mjs +4 -0
  283. package/dist/esm/api/types/AgentsAgentCapabilities.d.mts +14 -0
  284. package/dist/esm/api/types/AgentsAgentCapabilities.mjs +4 -0
  285. package/dist/esm/api/types/AgentsAgentCard.d.mts +36 -0
  286. package/dist/esm/api/types/AgentsAgentCard.mjs +4 -0
  287. package/dist/esm/api/types/AgentsAgentCardPreferredTransport.d.mts +5 -0
  288. package/dist/esm/api/types/AgentsAgentCardPreferredTransport.mjs +4 -0
  289. package/dist/esm/api/types/AgentsAgentCardSignature.d.mts +11 -0
  290. package/dist/esm/api/types/AgentsAgentCardSignature.mjs +4 -0
  291. package/dist/esm/api/types/AgentsAgentExpertsItem.d.mts +13 -0
  292. package/dist/esm/api/types/AgentsAgentExpertsItem.mjs +4 -0
  293. package/dist/esm/api/types/AgentsAgentExtension.d.mts +13 -0
  294. package/dist/esm/api/types/AgentsAgentExtension.mjs +4 -0
  295. package/dist/esm/api/types/AgentsAgentInterface.d.mts +9 -0
  296. package/dist/esm/api/types/AgentsAgentInterface.mjs +4 -0
  297. package/dist/esm/api/types/AgentsAgentInterfaceTransport.d.mts +5 -0
  298. package/dist/esm/api/types/AgentsAgentInterfaceTransport.mjs +4 -0
  299. package/dist/esm/api/types/AgentsAgentReference.d.mts +13 -0
  300. package/dist/esm/api/types/AgentsAgentReference.mjs +4 -0
  301. package/dist/esm/api/types/AgentsAgentResponse.d.mts +5 -0
  302. package/dist/esm/api/types/AgentsAgentResponse.mjs +4 -0
  303. package/dist/esm/api/types/AgentsAgentSkill.d.mts +22 -0
  304. package/dist/esm/api/types/AgentsAgentSkill.mjs +4 -0
  305. package/dist/esm/api/types/AgentsArtifact.d.mts +18 -0
  306. package/dist/esm/api/types/AgentsArtifact.mjs +4 -0
  307. package/dist/esm/api/types/AgentsContext.d.mts +9 -0
  308. package/dist/esm/api/types/AgentsContext.mjs +4 -0
  309. package/dist/esm/api/types/AgentsContextItemsItem.d.mts +13 -0
  310. package/dist/esm/api/types/AgentsContextItemsItem.mjs +4 -0
  311. package/dist/esm/api/types/AgentsCreateExpert.d.mts +14 -0
  312. package/dist/esm/api/types/AgentsCreateExpert.mjs +4 -0
  313. package/dist/esm/api/types/AgentsCreateMcpServer.d.mts +20 -0
  314. package/dist/esm/api/types/AgentsCreateMcpServer.mjs +4 -0
  315. package/dist/esm/api/types/AgentsCreateMcpServerAuthorizationType.d.mts +12 -0
  316. package/dist/esm/api/types/AgentsCreateMcpServerAuthorizationType.mjs +8 -0
  317. package/dist/esm/api/types/AgentsCreateMcpServerTransportType.d.mts +12 -0
  318. package/dist/esm/api/types/AgentsCreateMcpServerTransportType.mjs +8 -0
  319. package/dist/esm/api/types/AgentsDataPart.d.mts +9 -0
  320. package/dist/esm/api/types/AgentsDataPart.mjs +4 -0
  321. package/dist/esm/api/types/AgentsExpert.d.mts +16 -0
  322. package/dist/esm/api/types/AgentsExpert.mjs +4 -0
  323. package/dist/esm/api/types/AgentsExpertReference.d.mts +12 -0
  324. package/dist/esm/api/types/AgentsExpertReference.mjs +4 -0
  325. package/dist/esm/api/types/AgentsFilePart.d.mts +9 -0
  326. package/dist/esm/api/types/AgentsFilePart.mjs +4 -0
  327. package/dist/esm/api/types/AgentsFilePartFile.d.mts +5 -0
  328. package/dist/esm/api/types/AgentsFilePartFile.mjs +4 -0
  329. package/dist/esm/api/types/AgentsFileWithBytes.d.mts +11 -0
  330. package/dist/esm/api/types/AgentsFileWithBytes.mjs +4 -0
  331. package/dist/esm/api/types/AgentsFileWithUri.d.mts +11 -0
  332. package/dist/esm/api/types/AgentsFileWithUri.mjs +4 -0
  333. package/dist/esm/api/types/AgentsMcpServer.d.mts +18 -0
  334. package/dist/esm/api/types/AgentsMcpServer.mjs +4 -0
  335. package/dist/esm/api/types/AgentsMcpServerAuthorizationType.d.mts +12 -0
  336. package/dist/esm/api/types/AgentsMcpServerAuthorizationType.mjs +8 -0
  337. package/dist/esm/api/types/AgentsMcpServerTransportType.d.mts +11 -0
  338. package/dist/esm/api/types/AgentsMcpServerTransportType.mjs +7 -0
  339. package/dist/esm/api/types/AgentsMessage.d.mts +22 -0
  340. package/dist/esm/api/types/AgentsMessage.mjs +4 -0
  341. package/dist/esm/api/types/AgentsMessageRole.d.mts +11 -0
  342. package/dist/esm/api/types/AgentsMessageRole.mjs +7 -0
  343. package/dist/esm/api/types/AgentsMessageSendConfiguration.d.mts +13 -0
  344. package/dist/esm/api/types/AgentsMessageSendConfiguration.mjs +4 -0
  345. package/dist/esm/api/types/AgentsMessageSendParams.d.mts +10 -0
  346. package/dist/esm/api/types/AgentsMessageSendParams.mjs +4 -0
  347. package/dist/esm/api/types/AgentsPart.d.mts +16 -0
  348. package/dist/esm/api/types/AgentsPart.mjs +4 -0
  349. package/dist/esm/api/types/AgentsPushNotificationAuthenticationInfo.d.mts +9 -0
  350. package/dist/esm/api/types/AgentsPushNotificationAuthenticationInfo.mjs +4 -0
  351. package/dist/esm/api/types/AgentsPushNotificationConfig.d.mts +13 -0
  352. package/dist/esm/api/types/AgentsPushNotificationConfig.mjs +4 -0
  353. package/dist/esm/api/types/AgentsTask.d.mts +17 -0
  354. package/dist/esm/api/types/AgentsTask.mjs +4 -0
  355. package/dist/esm/api/types/AgentsTaskArtifactUpdateEvent.d.mts +19 -0
  356. package/dist/esm/api/types/AgentsTaskArtifactUpdateEvent.mjs +4 -0
  357. package/dist/esm/api/types/AgentsTaskStatus.d.mts +12 -0
  358. package/dist/esm/api/types/AgentsTaskStatus.mjs +4 -0
  359. package/dist/esm/api/types/AgentsTaskStatusState.d.mts +18 -0
  360. package/dist/esm/api/types/AgentsTaskStatusState.mjs +14 -0
  361. package/dist/esm/api/types/AgentsTaskStatusUpdateEvent.d.mts +17 -0
  362. package/dist/esm/api/types/AgentsTaskStatusUpdateEvent.mjs +4 -0
  363. package/dist/esm/api/types/AgentsTextPart.d.mts +9 -0
  364. package/dist/esm/api/types/AgentsTextPart.mjs +4 -0
  365. package/dist/esm/api/types/AgentsTransportProtocol.d.mts +12 -0
  366. package/dist/esm/api/types/AgentsTransportProtocol.mjs +8 -0
  367. package/dist/esm/api/types/index.d.mts +43 -0
  368. package/dist/esm/api/types/index.mjs +43 -0
  369. package/dist/esm/core/index.d.mts +1 -0
  370. package/dist/esm/core/index.mjs +1 -0
  371. package/dist/esm/core/stream/Stream.d.mts +46 -0
  372. package/dist/esm/core/stream/Stream.mjs +164 -0
  373. package/dist/esm/core/stream/index.d.mts +1 -0
  374. package/dist/esm/core/stream/index.mjs +1 -0
  375. package/dist/esm/custom/CortiClient.d.mts +3 -0
  376. package/dist/esm/custom/CortiClient.mjs +9 -4
  377. package/dist/esm/custom/RefreshBearerProvider.d.mts +10 -5
  378. package/dist/esm/custom/RefreshBearerProvider.mjs +1 -1
  379. package/dist/esm/custom/index.d.mts +1 -0
  380. package/dist/esm/custom/index.mjs +1 -0
  381. package/dist/esm/custom/utils/getEnvironmentFromString.mjs +1 -0
  382. package/dist/esm/environments.d.mts +3 -0
  383. package/dist/esm/environments.mjs +2 -0
  384. package/dist/esm/serialization/resources/agents/client/index.d.mts +2 -0
  385. package/dist/esm/serialization/resources/agents/client/index.mjs +2 -0
  386. package/dist/esm/serialization/resources/agents/client/list.d.mts +11 -0
  387. package/dist/esm/serialization/resources/agents/client/list.mjs +6 -0
  388. package/dist/esm/serialization/resources/agents/client/requests/AgentsCreateAgent.d.mts +16 -0
  389. package/dist/esm/serialization/resources/agents/client/requests/AgentsCreateAgent.mjs +11 -0
  390. package/dist/esm/serialization/resources/agents/client/requests/index.d.mts +1 -0
  391. package/dist/esm/serialization/resources/agents/client/requests/index.mjs +1 -0
  392. package/dist/esm/serialization/resources/agents/index.d.mts +2 -0
  393. package/dist/esm/serialization/resources/agents/index.mjs +2 -0
  394. package/dist/esm/serialization/resources/agents/types/AgentsCreateAgentExpertsItem.d.mts +18 -0
  395. package/dist/esm/serialization/resources/agents/types/AgentsCreateAgentExpertsItem.mjs +15 -0
  396. package/dist/esm/serialization/resources/agents/types/AgentsMessageSendResponse.d.mts +15 -0
  397. package/dist/esm/serialization/resources/agents/types/AgentsMessageSendResponse.mjs +10 -0
  398. package/dist/esm/serialization/resources/agents/types/AgentsMessageStreamResponse.d.mts +19 -0
  399. package/dist/esm/serialization/resources/agents/types/AgentsMessageStreamResponse.mjs +14 -0
  400. package/dist/esm/serialization/resources/agents/types/index.d.mts +3 -0
  401. package/dist/esm/serialization/resources/agents/types/index.mjs +3 -0
  402. package/dist/esm/serialization/resources/index.d.mts +3 -0
  403. package/dist/esm/serialization/resources/index.mjs +3 -0
  404. package/dist/esm/serialization/types/AgentsAgent.d.mts +16 -0
  405. package/dist/esm/serialization/types/AgentsAgent.mjs +11 -0
  406. package/dist/esm/serialization/types/AgentsAgentCapabilities.d.mts +16 -0
  407. package/dist/esm/serialization/types/AgentsAgentCapabilities.mjs +11 -0
  408. package/dist/esm/serialization/types/AgentsAgentCard.d.mts +32 -0
  409. package/dist/esm/serialization/types/AgentsAgentCard.mjs +29 -0
  410. package/dist/esm/serialization/types/AgentsAgentCardPreferredTransport.d.mts +11 -0
  411. package/dist/esm/serialization/types/AgentsAgentCardPreferredTransport.mjs +6 -0
  412. package/dist/esm/serialization/types/AgentsAgentCardSignature.d.mts +14 -0
  413. package/dist/esm/serialization/types/AgentsAgentCardSignature.mjs +9 -0
  414. package/dist/esm/serialization/types/AgentsAgentExpertsItem.d.mts +18 -0
  415. package/dist/esm/serialization/types/AgentsAgentExpertsItem.mjs +15 -0
  416. package/dist/esm/serialization/types/AgentsAgentExtension.d.mts +15 -0
  417. package/dist/esm/serialization/types/AgentsAgentExtension.mjs +10 -0
  418. package/dist/esm/serialization/types/AgentsAgentInterface.d.mts +14 -0
  419. package/dist/esm/serialization/types/AgentsAgentInterface.mjs +9 -0
  420. package/dist/esm/serialization/types/AgentsAgentInterfaceTransport.d.mts +11 -0
  421. package/dist/esm/serialization/types/AgentsAgentInterfaceTransport.mjs +6 -0
  422. package/dist/esm/serialization/types/AgentsAgentReference.d.mts +14 -0
  423. package/dist/esm/serialization/types/AgentsAgentReference.mjs +9 -0
  424. package/dist/esm/serialization/types/AgentsAgentResponse.d.mts +12 -0
  425. package/dist/esm/serialization/types/AgentsAgentResponse.mjs +7 -0
  426. package/dist/esm/serialization/types/AgentsAgentSkill.d.mts +20 -0
  427. package/dist/esm/serialization/types/AgentsAgentSkill.mjs +15 -0
  428. package/dist/esm/serialization/types/AgentsArtifact.d.mts +18 -0
  429. package/dist/esm/serialization/types/AgentsArtifact.mjs +13 -0
  430. package/dist/esm/serialization/types/AgentsContext.d.mts +14 -0
  431. package/dist/esm/serialization/types/AgentsContext.mjs +9 -0
  432. package/dist/esm/serialization/types/AgentsContextItemsItem.d.mts +18 -0
  433. package/dist/esm/serialization/types/AgentsContextItemsItem.mjs +15 -0
  434. package/dist/esm/serialization/types/AgentsCreateExpert.d.mts +16 -0
  435. package/dist/esm/serialization/types/AgentsCreateExpert.mjs +11 -0
  436. package/dist/esm/serialization/types/AgentsCreateMcpServer.d.mts +20 -0
  437. package/dist/esm/serialization/types/AgentsCreateMcpServer.mjs +15 -0
  438. package/dist/esm/serialization/types/AgentsCreateMcpServerAuthorizationType.d.mts +10 -0
  439. package/dist/esm/serialization/types/AgentsCreateMcpServerAuthorizationType.mjs +5 -0
  440. package/dist/esm/serialization/types/AgentsCreateMcpServerTransportType.d.mts +10 -0
  441. package/dist/esm/serialization/types/AgentsCreateMcpServerTransportType.mjs +5 -0
  442. package/dist/esm/serialization/types/AgentsDataPart.d.mts +13 -0
  443. package/dist/esm/serialization/types/AgentsDataPart.mjs +8 -0
  444. package/dist/esm/serialization/types/AgentsExpert.d.mts +17 -0
  445. package/dist/esm/serialization/types/AgentsExpert.mjs +12 -0
  446. package/dist/esm/serialization/types/AgentsExpertReference.d.mts +13 -0
  447. package/dist/esm/serialization/types/AgentsExpertReference.mjs +8 -0
  448. package/dist/esm/serialization/types/AgentsFilePart.d.mts +14 -0
  449. package/dist/esm/serialization/types/AgentsFilePart.mjs +9 -0
  450. package/dist/esm/serialization/types/AgentsFilePartFile.d.mts +12 -0
  451. package/dist/esm/serialization/types/AgentsFilePartFile.mjs +7 -0
  452. package/dist/esm/serialization/types/AgentsFileWithBytes.d.mts +14 -0
  453. package/dist/esm/serialization/types/AgentsFileWithBytes.mjs +9 -0
  454. package/dist/esm/serialization/types/AgentsFileWithUri.d.mts +14 -0
  455. package/dist/esm/serialization/types/AgentsFileWithUri.mjs +9 -0
  456. package/dist/esm/serialization/types/AgentsMcpServer.d.mts +19 -0
  457. package/dist/esm/serialization/types/AgentsMcpServer.mjs +14 -0
  458. package/dist/esm/serialization/types/AgentsMcpServerAuthorizationType.d.mts +10 -0
  459. package/dist/esm/serialization/types/AgentsMcpServerAuthorizationType.mjs +5 -0
  460. package/dist/esm/serialization/types/AgentsMcpServerTransportType.d.mts +10 -0
  461. package/dist/esm/serialization/types/AgentsMcpServerTransportType.mjs +5 -0
  462. package/dist/esm/serialization/types/AgentsMessage.d.mts +21 -0
  463. package/dist/esm/serialization/types/AgentsMessage.mjs +16 -0
  464. package/dist/esm/serialization/types/AgentsMessageRole.d.mts +10 -0
  465. package/dist/esm/serialization/types/AgentsMessageRole.mjs +5 -0
  466. package/dist/esm/serialization/types/AgentsMessageSendConfiguration.d.mts +16 -0
  467. package/dist/esm/serialization/types/AgentsMessageSendConfiguration.mjs +11 -0
  468. package/dist/esm/serialization/types/AgentsMessageSendParams.d.mts +16 -0
  469. package/dist/esm/serialization/types/AgentsMessageSendParams.mjs +11 -0
  470. package/dist/esm/serialization/types/AgentsPart.d.mts +22 -0
  471. package/dist/esm/serialization/types/AgentsPart.mjs +17 -0
  472. package/dist/esm/serialization/types/AgentsPushNotificationAuthenticationInfo.d.mts +13 -0
  473. package/dist/esm/serialization/types/AgentsPushNotificationAuthenticationInfo.mjs +8 -0
  474. package/dist/esm/serialization/types/AgentsPushNotificationConfig.d.mts +16 -0
  475. package/dist/esm/serialization/types/AgentsPushNotificationConfig.mjs +11 -0
  476. package/dist/esm/serialization/types/AgentsTask.d.mts +20 -0
  477. package/dist/esm/serialization/types/AgentsTask.mjs +15 -0
  478. package/dist/esm/serialization/types/AgentsTaskArtifactUpdateEvent.d.mts +19 -0
  479. package/dist/esm/serialization/types/AgentsTaskArtifactUpdateEvent.mjs +14 -0
  480. package/dist/esm/serialization/types/AgentsTaskStatus.d.mts +16 -0
  481. package/dist/esm/serialization/types/AgentsTaskStatus.mjs +11 -0
  482. package/dist/esm/serialization/types/AgentsTaskStatusState.d.mts +10 -0
  483. package/dist/esm/serialization/types/AgentsTaskStatusState.mjs +15 -0
  484. package/dist/esm/serialization/types/AgentsTaskStatusUpdateEvent.d.mts +18 -0
  485. package/dist/esm/serialization/types/AgentsTaskStatusUpdateEvent.mjs +13 -0
  486. package/dist/esm/serialization/types/AgentsTextPart.d.mts +13 -0
  487. package/dist/esm/serialization/types/AgentsTextPart.mjs +8 -0
  488. package/dist/esm/serialization/types/AgentsTransportProtocol.d.mts +10 -0
  489. package/dist/esm/serialization/types/AgentsTransportProtocol.mjs +5 -0
  490. package/dist/esm/serialization/types/index.d.mts +43 -0
  491. package/dist/esm/serialization/types/index.mjs +43 -0
  492. package/dist/esm/version.d.mts +1 -1
  493. package/dist/esm/version.mjs +1 -1
  494. package/package.json +1 -1
  495. package/reference.md +720 -0
@@ -0,0 +1,874 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
39
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
40
+ return new (P || (P = Promise))(function (resolve, reject) {
41
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
42
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
43
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
44
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
45
+ });
46
+ };
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.Agents = void 0;
49
+ const core = __importStar(require("../../../../core/index.js"));
50
+ const Corti = __importStar(require("../../../index.js"));
51
+ const headers_js_1 = require("../../../../core/headers.js");
52
+ const serializers = __importStar(require("../../../../serialization/index.js"));
53
+ const errors = __importStar(require("../../../../errors/index.js"));
54
+ class Agents {
55
+ constructor(_options) {
56
+ this._options = _options;
57
+ }
58
+ /**
59
+ * This endpoint retrieves a list of all agents that can be called by the Corti Agent Framework.
60
+ *
61
+ * @param {Corti.AgentsListRequest} request
62
+ * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
63
+ *
64
+ * @throws {@link Corti.BadRequestError}
65
+ * @throws {@link Corti.UnauthorizedError}
66
+ *
67
+ * @example
68
+ * await client.agents.list()
69
+ */
70
+ list(request = {}, requestOptions) {
71
+ return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
72
+ }
73
+ __list() {
74
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
75
+ var _a, _b, _c, _d;
76
+ const { limit, offset } = request;
77
+ const _queryParams = {};
78
+ if (limit !== undefined) {
79
+ _queryParams["limit"] = (_a = limit === null || limit === void 0 ? void 0 : limit.toString()) !== null && _a !== void 0 ? _a : null;
80
+ }
81
+ if (offset !== undefined) {
82
+ _queryParams["offset"] = (_b = offset === null || offset === void 0 ? void 0 : offset.toString()) !== null && _b !== void 0 ? _b : null;
83
+ }
84
+ const _response = yield core.fetcher({
85
+ url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment)).agents, "agents"),
86
+ method: "GET",
87
+ headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
88
+ Authorization: yield this._getAuthorizationHeader(),
89
+ "Tenant-Name": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.tenantName,
90
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
91
+ queryParameters: _queryParams,
92
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
93
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
94
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
95
+ });
96
+ if (_response.ok) {
97
+ return {
98
+ data: serializers.agents.list.Response.parseOrThrow(_response.body, {
99
+ unrecognizedObjectKeys: "passthrough",
100
+ allowUnrecognizedUnionMembers: true,
101
+ allowUnrecognizedEnumValues: true,
102
+ skipValidation: true,
103
+ breadcrumbsPrefix: ["response"],
104
+ }),
105
+ rawResponse: _response.rawResponse,
106
+ };
107
+ }
108
+ if (_response.error.reason === "status-code") {
109
+ switch (_response.error.statusCode) {
110
+ case 400:
111
+ throw new Corti.BadRequestError(_response.error.body, _response.rawResponse);
112
+ case 401:
113
+ throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse);
114
+ default:
115
+ throw new errors.CortiError({
116
+ statusCode: _response.error.statusCode,
117
+ body: _response.error.body,
118
+ rawResponse: _response.rawResponse,
119
+ });
120
+ }
121
+ }
122
+ switch (_response.error.reason) {
123
+ case "non-json":
124
+ throw new errors.CortiError({
125
+ statusCode: _response.error.statusCode,
126
+ body: _response.error.rawBody,
127
+ rawResponse: _response.rawResponse,
128
+ });
129
+ case "timeout":
130
+ throw new errors.CortiTimeoutError("Timeout exceeded when calling GET /agents.");
131
+ case "unknown":
132
+ throw new errors.CortiError({
133
+ message: _response.error.errorMessage,
134
+ rawResponse: _response.rawResponse,
135
+ });
136
+ }
137
+ });
138
+ }
139
+ /**
140
+ * This endpoint allows the creation of a new agent that can be utilized in the `POST /threads` endpoint.
141
+ *
142
+ * @param {Corti.AgentsCreateAgent} request
143
+ * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
144
+ *
145
+ * @throws {@link Corti.BadRequestError}
146
+ * @throws {@link Corti.UnauthorizedError}
147
+ *
148
+ * @example
149
+ * await client.agents.create({
150
+ * name: "name",
151
+ * description: "description"
152
+ * })
153
+ */
154
+ create(request, requestOptions) {
155
+ return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
156
+ }
157
+ __create(request, requestOptions) {
158
+ return __awaiter(this, void 0, void 0, function* () {
159
+ var _a, _b;
160
+ const _response = yield core.fetcher({
161
+ url: core.url.join((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment)).agents, "agents"),
162
+ method: "POST",
163
+ headers: (0, headers_js_1.mergeHeaders)((_b = this._options) === null || _b === void 0 ? void 0 : _b.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
164
+ Authorization: yield this._getAuthorizationHeader(),
165
+ "Tenant-Name": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.tenantName,
166
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
167
+ contentType: "application/json",
168
+ requestType: "json",
169
+ body: serializers.AgentsCreateAgent.jsonOrThrow(request, {
170
+ unrecognizedObjectKeys: "strip",
171
+ omitUndefined: true,
172
+ }),
173
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
174
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
175
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
176
+ });
177
+ if (_response.ok) {
178
+ return {
179
+ data: serializers.AgentsAgent.parseOrThrow(_response.body, {
180
+ unrecognizedObjectKeys: "passthrough",
181
+ allowUnrecognizedUnionMembers: true,
182
+ allowUnrecognizedEnumValues: true,
183
+ skipValidation: true,
184
+ breadcrumbsPrefix: ["response"],
185
+ }),
186
+ rawResponse: _response.rawResponse,
187
+ };
188
+ }
189
+ if (_response.error.reason === "status-code") {
190
+ switch (_response.error.statusCode) {
191
+ case 400:
192
+ throw new Corti.BadRequestError(_response.error.body, _response.rawResponse);
193
+ case 401:
194
+ throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse);
195
+ default:
196
+ throw new errors.CortiError({
197
+ statusCode: _response.error.statusCode,
198
+ body: _response.error.body,
199
+ rawResponse: _response.rawResponse,
200
+ });
201
+ }
202
+ }
203
+ switch (_response.error.reason) {
204
+ case "non-json":
205
+ throw new errors.CortiError({
206
+ statusCode: _response.error.statusCode,
207
+ body: _response.error.rawBody,
208
+ rawResponse: _response.rawResponse,
209
+ });
210
+ case "timeout":
211
+ throw new errors.CortiTimeoutError("Timeout exceeded when calling POST /agents.");
212
+ case "unknown":
213
+ throw new errors.CortiError({
214
+ message: _response.error.errorMessage,
215
+ rawResponse: _response.rawResponse,
216
+ });
217
+ }
218
+ });
219
+ }
220
+ /**
221
+ * This endpoint retrieves an agent by its identifier. The agent contains information about its capabilities and the experts it can call.
222
+ *
223
+ * @param {string} id - The identifier of the agent to retrieve.
224
+ * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
225
+ *
226
+ * @throws {@link Corti.BadRequestError}
227
+ * @throws {@link Corti.UnauthorizedError}
228
+ * @throws {@link Corti.NotFoundError}
229
+ *
230
+ * @example
231
+ * await client.agents.get("id")
232
+ */
233
+ get(id, requestOptions) {
234
+ return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions));
235
+ }
236
+ __get(id, requestOptions) {
237
+ return __awaiter(this, void 0, void 0, function* () {
238
+ var _a, _b;
239
+ const _response = yield core.fetcher({
240
+ url: core.url.join((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment)).agents, `agents/${encodeURIComponent(id)}`),
241
+ method: "GET",
242
+ headers: (0, headers_js_1.mergeHeaders)((_b = this._options) === null || _b === void 0 ? void 0 : _b.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
243
+ Authorization: yield this._getAuthorizationHeader(),
244
+ "Tenant-Name": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.tenantName,
245
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
246
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
247
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
248
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
249
+ });
250
+ if (_response.ok) {
251
+ return {
252
+ data: serializers.AgentsAgentResponse.parseOrThrow(_response.body, {
253
+ unrecognizedObjectKeys: "passthrough",
254
+ allowUnrecognizedUnionMembers: true,
255
+ allowUnrecognizedEnumValues: true,
256
+ skipValidation: true,
257
+ breadcrumbsPrefix: ["response"],
258
+ }),
259
+ rawResponse: _response.rawResponse,
260
+ };
261
+ }
262
+ if (_response.error.reason === "status-code") {
263
+ switch (_response.error.statusCode) {
264
+ case 400:
265
+ throw new Corti.BadRequestError(_response.error.body, _response.rawResponse);
266
+ case 401:
267
+ throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse);
268
+ case 404:
269
+ throw new Corti.NotFoundError(_response.error.body, _response.rawResponse);
270
+ default:
271
+ throw new errors.CortiError({
272
+ statusCode: _response.error.statusCode,
273
+ body: _response.error.body,
274
+ rawResponse: _response.rawResponse,
275
+ });
276
+ }
277
+ }
278
+ switch (_response.error.reason) {
279
+ case "non-json":
280
+ throw new errors.CortiError({
281
+ statusCode: _response.error.statusCode,
282
+ body: _response.error.rawBody,
283
+ rawResponse: _response.rawResponse,
284
+ });
285
+ case "timeout":
286
+ throw new errors.CortiTimeoutError("Timeout exceeded when calling GET /agents/{id}.");
287
+ case "unknown":
288
+ throw new errors.CortiError({
289
+ message: _response.error.errorMessage,
290
+ rawResponse: _response.rawResponse,
291
+ });
292
+ }
293
+ });
294
+ }
295
+ /**
296
+ * This endpoint deletes an agent by its identifier. Once deleted, the agent can no longer be used in threads.
297
+ *
298
+ * @param {string} id - The identifier of the agent to delete.
299
+ * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
300
+ *
301
+ * @throws {@link Corti.BadRequestError}
302
+ * @throws {@link Corti.UnauthorizedError}
303
+ * @throws {@link Corti.NotFoundError}
304
+ *
305
+ * @example
306
+ * await client.agents.delete("id")
307
+ */
308
+ delete(id, requestOptions) {
309
+ return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions));
310
+ }
311
+ __delete(id, requestOptions) {
312
+ return __awaiter(this, void 0, void 0, function* () {
313
+ var _a, _b;
314
+ const _response = yield core.fetcher({
315
+ url: core.url.join((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment)).agents, `agents/${encodeURIComponent(id)}`),
316
+ method: "DELETE",
317
+ headers: (0, headers_js_1.mergeHeaders)((_b = this._options) === null || _b === void 0 ? void 0 : _b.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
318
+ Authorization: yield this._getAuthorizationHeader(),
319
+ "Tenant-Name": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.tenantName,
320
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
321
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
322
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
323
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
324
+ });
325
+ if (_response.ok) {
326
+ return { data: undefined, rawResponse: _response.rawResponse };
327
+ }
328
+ if (_response.error.reason === "status-code") {
329
+ switch (_response.error.statusCode) {
330
+ case 400:
331
+ throw new Corti.BadRequestError(_response.error.body, _response.rawResponse);
332
+ case 401:
333
+ throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse);
334
+ case 404:
335
+ throw new Corti.NotFoundError(_response.error.body, _response.rawResponse);
336
+ default:
337
+ throw new errors.CortiError({
338
+ statusCode: _response.error.statusCode,
339
+ body: _response.error.body,
340
+ rawResponse: _response.rawResponse,
341
+ });
342
+ }
343
+ }
344
+ switch (_response.error.reason) {
345
+ case "non-json":
346
+ throw new errors.CortiError({
347
+ statusCode: _response.error.statusCode,
348
+ body: _response.error.rawBody,
349
+ rawResponse: _response.rawResponse,
350
+ });
351
+ case "timeout":
352
+ throw new errors.CortiTimeoutError("Timeout exceeded when calling DELETE /agents/{id}.");
353
+ case "unknown":
354
+ throw new errors.CortiError({
355
+ message: _response.error.errorMessage,
356
+ rawResponse: _response.rawResponse,
357
+ });
358
+ }
359
+ });
360
+ }
361
+ /**
362
+ * This endpoint updates an existing agent. Only the fields provided in the request body will be updated; other fields will remain unchanged.
363
+ *
364
+ * @param {string} id - The identifier of the agent to update.
365
+ * @param {Corti.AgentsAgent} request
366
+ * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
367
+ *
368
+ * @throws {@link Corti.BadRequestError}
369
+ * @throws {@link Corti.UnauthorizedError}
370
+ * @throws {@link Corti.NotFoundError}
371
+ *
372
+ * @example
373
+ * await client.agents.update("id", {
374
+ * id: "id",
375
+ * name: "name",
376
+ * description: "description"
377
+ * })
378
+ */
379
+ update(id, request, requestOptions) {
380
+ return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions));
381
+ }
382
+ __update(id, request, requestOptions) {
383
+ return __awaiter(this, void 0, void 0, function* () {
384
+ var _a, _b;
385
+ const _response = yield core.fetcher({
386
+ url: core.url.join((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment)).agents, `agents/${encodeURIComponent(id)}`),
387
+ method: "PATCH",
388
+ headers: (0, headers_js_1.mergeHeaders)((_b = this._options) === null || _b === void 0 ? void 0 : _b.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
389
+ Authorization: yield this._getAuthorizationHeader(),
390
+ "Tenant-Name": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.tenantName,
391
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
392
+ contentType: "application/json",
393
+ requestType: "json",
394
+ body: serializers.AgentsAgent.jsonOrThrow(request, {
395
+ unrecognizedObjectKeys: "strip",
396
+ omitUndefined: true,
397
+ }),
398
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
399
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
400
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
401
+ });
402
+ if (_response.ok) {
403
+ return {
404
+ data: serializers.AgentsAgent.parseOrThrow(_response.body, {
405
+ unrecognizedObjectKeys: "passthrough",
406
+ allowUnrecognizedUnionMembers: true,
407
+ allowUnrecognizedEnumValues: true,
408
+ skipValidation: true,
409
+ breadcrumbsPrefix: ["response"],
410
+ }),
411
+ rawResponse: _response.rawResponse,
412
+ };
413
+ }
414
+ if (_response.error.reason === "status-code") {
415
+ switch (_response.error.statusCode) {
416
+ case 400:
417
+ throw new Corti.BadRequestError(_response.error.body, _response.rawResponse);
418
+ case 401:
419
+ throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse);
420
+ case 404:
421
+ throw new Corti.NotFoundError(_response.error.body, _response.rawResponse);
422
+ default:
423
+ throw new errors.CortiError({
424
+ statusCode: _response.error.statusCode,
425
+ body: _response.error.body,
426
+ rawResponse: _response.rawResponse,
427
+ });
428
+ }
429
+ }
430
+ switch (_response.error.reason) {
431
+ case "non-json":
432
+ throw new errors.CortiError({
433
+ statusCode: _response.error.statusCode,
434
+ body: _response.error.rawBody,
435
+ rawResponse: _response.rawResponse,
436
+ });
437
+ case "timeout":
438
+ throw new errors.CortiTimeoutError("Timeout exceeded when calling PATCH /agents/{id}.");
439
+ case "unknown":
440
+ throw new errors.CortiError({
441
+ message: _response.error.errorMessage,
442
+ rawResponse: _response.rawResponse,
443
+ });
444
+ }
445
+ });
446
+ }
447
+ /**
448
+ * This endpoint retrieves the agent card in JSON format, which provides metadata about the agent, including its name, description, and the experts it can call.
449
+ *
450
+ * @param {string} id - The identifier of the agent to retrieve the agent card for.
451
+ * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
452
+ *
453
+ * @throws {@link Corti.BadRequestError}
454
+ * @throws {@link Corti.UnauthorizedError}
455
+ * @throws {@link Corti.NotFoundError}
456
+ *
457
+ * @example
458
+ * await client.agents.getCard("id")
459
+ */
460
+ getCard(id, requestOptions) {
461
+ return core.HttpResponsePromise.fromPromise(this.__getCard(id, requestOptions));
462
+ }
463
+ __getCard(id, requestOptions) {
464
+ return __awaiter(this, void 0, void 0, function* () {
465
+ var _a, _b;
466
+ const _response = yield core.fetcher({
467
+ url: core.url.join((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment)).agents, `agents/${encodeURIComponent(id)}/agent-card.json`),
468
+ method: "GET",
469
+ headers: (0, headers_js_1.mergeHeaders)((_b = this._options) === null || _b === void 0 ? void 0 : _b.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
470
+ Authorization: yield this._getAuthorizationHeader(),
471
+ "Tenant-Name": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.tenantName,
472
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
473
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
474
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
475
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
476
+ });
477
+ if (_response.ok) {
478
+ return {
479
+ data: serializers.AgentsAgentCard.parseOrThrow(_response.body, {
480
+ unrecognizedObjectKeys: "passthrough",
481
+ allowUnrecognizedUnionMembers: true,
482
+ allowUnrecognizedEnumValues: true,
483
+ skipValidation: true,
484
+ breadcrumbsPrefix: ["response"],
485
+ }),
486
+ rawResponse: _response.rawResponse,
487
+ };
488
+ }
489
+ if (_response.error.reason === "status-code") {
490
+ switch (_response.error.statusCode) {
491
+ case 400:
492
+ throw new Corti.BadRequestError(_response.error.body, _response.rawResponse);
493
+ case 401:
494
+ throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse);
495
+ case 404:
496
+ throw new Corti.NotFoundError(_response.error.body, _response.rawResponse);
497
+ default:
498
+ throw new errors.CortiError({
499
+ statusCode: _response.error.statusCode,
500
+ body: _response.error.body,
501
+ rawResponse: _response.rawResponse,
502
+ });
503
+ }
504
+ }
505
+ switch (_response.error.reason) {
506
+ case "non-json":
507
+ throw new errors.CortiError({
508
+ statusCode: _response.error.statusCode,
509
+ body: _response.error.rawBody,
510
+ rawResponse: _response.rawResponse,
511
+ });
512
+ case "timeout":
513
+ throw new errors.CortiTimeoutError("Timeout exceeded when calling GET /agents/{id}/agent-card.json.");
514
+ case "unknown":
515
+ throw new errors.CortiError({
516
+ message: _response.error.errorMessage,
517
+ rawResponse: _response.rawResponse,
518
+ });
519
+ }
520
+ });
521
+ }
522
+ /**
523
+ * This endpoint sends a message to the specified agent to start or continue a task. The agent processes the message and returns a response. If the message contains a task ID that matches an ongoing task, the agent will continue that task; otherwise, it will start a new task.
524
+ *
525
+ * @param {string} id - The identifier of the agent to send the message to.
526
+ * @param {Corti.AgentsMessageSendParams} request
527
+ * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
528
+ *
529
+ * @throws {@link Corti.BadRequestError}
530
+ * @throws {@link Corti.UnauthorizedError}
531
+ * @throws {@link Corti.NotFoundError}
532
+ *
533
+ * @example
534
+ * await client.agents.messageSend("id", {
535
+ * message: {
536
+ * role: "user",
537
+ * parts: [{
538
+ * kind: "text",
539
+ * text: "text"
540
+ * }],
541
+ * messageId: "messageId"
542
+ * }
543
+ * })
544
+ */
545
+ messageSend(id, request, requestOptions) {
546
+ return core.HttpResponsePromise.fromPromise(this.__messageSend(id, request, requestOptions));
547
+ }
548
+ __messageSend(id, request, requestOptions) {
549
+ return __awaiter(this, void 0, void 0, function* () {
550
+ var _a, _b;
551
+ const _response = yield core.fetcher({
552
+ url: core.url.join((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment)).agents, `agents/${encodeURIComponent(id)}/v1/message:send`),
553
+ method: "POST",
554
+ headers: (0, headers_js_1.mergeHeaders)((_b = this._options) === null || _b === void 0 ? void 0 : _b.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
555
+ Authorization: yield this._getAuthorizationHeader(),
556
+ "Tenant-Name": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.tenantName,
557
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
558
+ contentType: "application/json",
559
+ requestType: "json",
560
+ body: serializers.AgentsMessageSendParams.jsonOrThrow(request, {
561
+ unrecognizedObjectKeys: "strip",
562
+ omitUndefined: true,
563
+ }),
564
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
565
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
566
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
567
+ });
568
+ if (_response.ok) {
569
+ return {
570
+ data: serializers.AgentsMessageSendResponse.parseOrThrow(_response.body, {
571
+ unrecognizedObjectKeys: "passthrough",
572
+ allowUnrecognizedUnionMembers: true,
573
+ allowUnrecognizedEnumValues: true,
574
+ skipValidation: true,
575
+ breadcrumbsPrefix: ["response"],
576
+ }),
577
+ rawResponse: _response.rawResponse,
578
+ };
579
+ }
580
+ if (_response.error.reason === "status-code") {
581
+ switch (_response.error.statusCode) {
582
+ case 400:
583
+ throw new Corti.BadRequestError(_response.error.body, _response.rawResponse);
584
+ case 401:
585
+ throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse);
586
+ case 404:
587
+ throw new Corti.NotFoundError(_response.error.body, _response.rawResponse);
588
+ default:
589
+ throw new errors.CortiError({
590
+ statusCode: _response.error.statusCode,
591
+ body: _response.error.body,
592
+ rawResponse: _response.rawResponse,
593
+ });
594
+ }
595
+ }
596
+ switch (_response.error.reason) {
597
+ case "non-json":
598
+ throw new errors.CortiError({
599
+ statusCode: _response.error.statusCode,
600
+ body: _response.error.rawBody,
601
+ rawResponse: _response.rawResponse,
602
+ });
603
+ case "timeout":
604
+ throw new errors.CortiTimeoutError("Timeout exceeded when calling POST /agents/{id}/v1/message:send.");
605
+ case "unknown":
606
+ throw new errors.CortiError({
607
+ message: _response.error.errorMessage,
608
+ rawResponse: _response.rawResponse,
609
+ });
610
+ }
611
+ });
612
+ }
613
+ /**
614
+ * Sends a message to the specified agent and streams the response as it is generated. This method requires the server to have support for streaming.
615
+ */
616
+ messageStream(id, request, requestOptions) {
617
+ return core.HttpResponsePromise.fromPromise(this.__messageStream(id, request, requestOptions));
618
+ }
619
+ __messageStream(id, request, requestOptions) {
620
+ return __awaiter(this, void 0, void 0, function* () {
621
+ var _a, _b;
622
+ const _response = yield core.fetcher({
623
+ url: core.url.join((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment)).agents, `agents/${encodeURIComponent(id)}/v1/message:stream`),
624
+ method: "POST",
625
+ headers: (0, headers_js_1.mergeHeaders)((_b = this._options) === null || _b === void 0 ? void 0 : _b.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
626
+ Authorization: yield this._getAuthorizationHeader(),
627
+ "Tenant-Name": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.tenantName,
628
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
629
+ contentType: "application/json",
630
+ requestType: "json",
631
+ body: serializers.AgentsMessageSendParams.jsonOrThrow(request, {
632
+ unrecognizedObjectKeys: "strip",
633
+ omitUndefined: true,
634
+ }),
635
+ responseType: "sse",
636
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
637
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
638
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
639
+ });
640
+ if (_response.ok) {
641
+ return {
642
+ data: new core.Stream({
643
+ stream: _response.body,
644
+ parse: (data) => __awaiter(this, void 0, void 0, function* () {
645
+ return serializers.AgentsMessageStreamResponse.parseOrThrow(data, {
646
+ unrecognizedObjectKeys: "passthrough",
647
+ allowUnrecognizedUnionMembers: true,
648
+ allowUnrecognizedEnumValues: true,
649
+ skipValidation: true,
650
+ breadcrumbsPrefix: ["response"],
651
+ });
652
+ }),
653
+ signal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
654
+ eventShape: {
655
+ type: "sse",
656
+ streamTerminator: "[DONE]",
657
+ },
658
+ }),
659
+ rawResponse: _response.rawResponse,
660
+ };
661
+ }
662
+ if (_response.error.reason === "status-code") {
663
+ switch (_response.error.statusCode) {
664
+ case 400:
665
+ throw new Corti.BadRequestError(_response.error.body, _response.rawResponse);
666
+ case 401:
667
+ throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse);
668
+ case 404:
669
+ throw new Corti.NotFoundError(_response.error.body, _response.rawResponse);
670
+ default:
671
+ throw new errors.CortiError({
672
+ statusCode: _response.error.statusCode,
673
+ body: _response.error.body,
674
+ rawResponse: _response.rawResponse,
675
+ });
676
+ }
677
+ }
678
+ switch (_response.error.reason) {
679
+ case "non-json":
680
+ throw new errors.CortiError({
681
+ statusCode: _response.error.statusCode,
682
+ body: _response.error.rawBody,
683
+ rawResponse: _response.rawResponse,
684
+ });
685
+ case "timeout":
686
+ throw new errors.CortiTimeoutError("Timeout exceeded when calling POST /agents/{id}/v1/message:stream.");
687
+ case "unknown":
688
+ throw new errors.CortiError({
689
+ message: _response.error.errorMessage,
690
+ rawResponse: _response.rawResponse,
691
+ });
692
+ }
693
+ });
694
+ }
695
+ /**
696
+ * This endpoint retrieves the status and details of a specific task associated with the given agent. It provides information about the task's current state, history, and any artifacts produced during its execution.
697
+ *
698
+ * @param {string} id - The identifier of the agent associated with the task.
699
+ * @param {string} taskId - The identifier of the task to retrieve.
700
+ * @param {Corti.AgentsGetTaskRequest} request
701
+ * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
702
+ *
703
+ * @throws {@link Corti.BadRequestError}
704
+ * @throws {@link Corti.UnauthorizedError}
705
+ * @throws {@link Corti.NotFoundError}
706
+ *
707
+ * @example
708
+ * await client.agents.getTask("id", "taskId")
709
+ */
710
+ getTask(id, taskId, request = {}, requestOptions) {
711
+ return core.HttpResponsePromise.fromPromise(this.__getTask(id, taskId, request, requestOptions));
712
+ }
713
+ __getTask(id_1, taskId_1) {
714
+ return __awaiter(this, arguments, void 0, function* (id, taskId, request = {}, requestOptions) {
715
+ var _a, _b, _c;
716
+ const { historyLength } = request;
717
+ const _queryParams = {};
718
+ if (historyLength !== undefined) {
719
+ _queryParams["historyLength"] = (_a = historyLength === null || historyLength === void 0 ? void 0 : historyLength.toString()) !== null && _a !== void 0 ? _a : null;
720
+ }
721
+ const _response = yield core.fetcher({
722
+ url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)).agents, `agents/${encodeURIComponent(id)}/v1/tasks/${encodeURIComponent(taskId)}`),
723
+ method: "GET",
724
+ headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
725
+ Authorization: yield this._getAuthorizationHeader(),
726
+ "Tenant-Name": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.tenantName,
727
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
728
+ queryParameters: _queryParams,
729
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
730
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
731
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
732
+ });
733
+ if (_response.ok) {
734
+ return {
735
+ data: serializers.AgentsTask.parseOrThrow(_response.body, {
736
+ unrecognizedObjectKeys: "passthrough",
737
+ allowUnrecognizedUnionMembers: true,
738
+ allowUnrecognizedEnumValues: true,
739
+ skipValidation: true,
740
+ breadcrumbsPrefix: ["response"],
741
+ }),
742
+ rawResponse: _response.rawResponse,
743
+ };
744
+ }
745
+ if (_response.error.reason === "status-code") {
746
+ switch (_response.error.statusCode) {
747
+ case 400:
748
+ throw new Corti.BadRequestError(_response.error.body, _response.rawResponse);
749
+ case 401:
750
+ throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse);
751
+ case 404:
752
+ throw new Corti.NotFoundError(_response.error.body, _response.rawResponse);
753
+ default:
754
+ throw new errors.CortiError({
755
+ statusCode: _response.error.statusCode,
756
+ body: _response.error.body,
757
+ rawResponse: _response.rawResponse,
758
+ });
759
+ }
760
+ }
761
+ switch (_response.error.reason) {
762
+ case "non-json":
763
+ throw new errors.CortiError({
764
+ statusCode: _response.error.statusCode,
765
+ body: _response.error.rawBody,
766
+ rawResponse: _response.rawResponse,
767
+ });
768
+ case "timeout":
769
+ throw new errors.CortiTimeoutError("Timeout exceeded when calling GET /agents/{id}/v1/tasks/{taskId}.");
770
+ case "unknown":
771
+ throw new errors.CortiError({
772
+ message: _response.error.errorMessage,
773
+ rawResponse: _response.rawResponse,
774
+ });
775
+ }
776
+ });
777
+ }
778
+ /**
779
+ * This endpoint retrieves all tasks and top-level messages associated with a specific context for the given agent.
780
+ *
781
+ * @param {string} id - The identifier of the agent associated with the context.
782
+ * @param {string} contextId - The identifier of the context (thread) to retrieve tasks for.
783
+ * @param {Corti.AgentsGetContextRequest} request
784
+ * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
785
+ *
786
+ * @throws {@link Corti.BadRequestError}
787
+ * @throws {@link Corti.UnauthorizedError}
788
+ * @throws {@link Corti.NotFoundError}
789
+ *
790
+ * @example
791
+ * await client.agents.getContext("id", "contextId")
792
+ */
793
+ getContext(id, contextId, request = {}, requestOptions) {
794
+ return core.HttpResponsePromise.fromPromise(this.__getContext(id, contextId, request, requestOptions));
795
+ }
796
+ __getContext(id_1, contextId_1) {
797
+ return __awaiter(this, arguments, void 0, function* (id, contextId, request = {}, requestOptions) {
798
+ var _a, _b, _c, _d;
799
+ const { limit, offset } = request;
800
+ const _queryParams = {};
801
+ if (limit !== undefined) {
802
+ _queryParams["limit"] = (_a = limit === null || limit === void 0 ? void 0 : limit.toString()) !== null && _a !== void 0 ? _a : null;
803
+ }
804
+ if (offset !== undefined) {
805
+ _queryParams["offset"] = (_b = offset === null || offset === void 0 ? void 0 : offset.toString()) !== null && _b !== void 0 ? _b : null;
806
+ }
807
+ const _response = yield core.fetcher({
808
+ url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment)).agents, `agents/${encodeURIComponent(id)}/v1/contexts/${encodeURIComponent(contextId)}`),
809
+ method: "GET",
810
+ headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
811
+ Authorization: yield this._getAuthorizationHeader(),
812
+ "Tenant-Name": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.tenantName,
813
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
814
+ queryParameters: _queryParams,
815
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
816
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
817
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
818
+ });
819
+ if (_response.ok) {
820
+ return {
821
+ data: serializers.AgentsContext.parseOrThrow(_response.body, {
822
+ unrecognizedObjectKeys: "passthrough",
823
+ allowUnrecognizedUnionMembers: true,
824
+ allowUnrecognizedEnumValues: true,
825
+ skipValidation: true,
826
+ breadcrumbsPrefix: ["response"],
827
+ }),
828
+ rawResponse: _response.rawResponse,
829
+ };
830
+ }
831
+ if (_response.error.reason === "status-code") {
832
+ switch (_response.error.statusCode) {
833
+ case 400:
834
+ throw new Corti.BadRequestError(_response.error.body, _response.rawResponse);
835
+ case 401:
836
+ throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse);
837
+ case 404:
838
+ throw new Corti.NotFoundError(_response.error.body, _response.rawResponse);
839
+ default:
840
+ throw new errors.CortiError({
841
+ statusCode: _response.error.statusCode,
842
+ body: _response.error.body,
843
+ rawResponse: _response.rawResponse,
844
+ });
845
+ }
846
+ }
847
+ switch (_response.error.reason) {
848
+ case "non-json":
849
+ throw new errors.CortiError({
850
+ statusCode: _response.error.statusCode,
851
+ body: _response.error.rawBody,
852
+ rawResponse: _response.rawResponse,
853
+ });
854
+ case "timeout":
855
+ throw new errors.CortiTimeoutError("Timeout exceeded when calling GET /agents/{id}/v1/contexts/{contextId}.");
856
+ case "unknown":
857
+ throw new errors.CortiError({
858
+ message: _response.error.errorMessage,
859
+ rawResponse: _response.rawResponse,
860
+ });
861
+ }
862
+ });
863
+ }
864
+ _getAuthorizationHeader() {
865
+ return __awaiter(this, void 0, void 0, function* () {
866
+ const bearer = yield core.Supplier.get(this._options.token);
867
+ if (bearer != null) {
868
+ return `Bearer ${bearer}`;
869
+ }
870
+ return undefined;
871
+ });
872
+ }
873
+ }
874
+ exports.Agents = Agents;