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