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