@inkeep/agents-manage-mcp 0.39.5 → 0.40.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 (530) hide show
  1. package/.vscode/settings.json +5 -0
  2. package/README.md +38 -139
  3. package/dist/index.d.cts.map +1 -1
  4. package/dist/index.d.ts +27 -16
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +7775 -6996
  7. package/dist/index.js.map +1 -1
  8. package/manifest.json +61 -6
  9. package/package.json +12 -12
  10. package/scripts/fetch-openapi.mjs +22 -40
  11. package/scripts/generate.mjs +33 -66
  12. package/src/core.ts +3 -1
  13. package/src/funcs/agentArtifactComponentRelationsAssociateArtifactComponentWithAgent.ts +94 -78
  14. package/src/funcs/agentArtifactComponentRelationsCheckArtifactComponentAgentAssociation.ts +98 -81
  15. package/src/funcs/agentArtifactComponentRelationsGetAgentsUsingArtifactComponent.ts +94 -78
  16. package/src/funcs/agentArtifactComponentRelationsGetArtifactComponentsForAgent.ts +91 -76
  17. package/src/funcs/agentArtifactComponentRelationsRemoveArtifactComponentFromAgent.ts +96 -80
  18. package/src/funcs/agentDataComponentRelationsAssociateDataComponentWithAgent.ts +92 -77
  19. package/src/funcs/agentDataComponentRelationsCheckDataComponentAgentAssociation.ts +95 -79
  20. package/src/funcs/agentDataComponentRelationsGetAgentsUsingDataComponent.ts +91 -76
  21. package/src/funcs/agentDataComponentRelationsGetDataComponentsForAgent.ts +91 -76
  22. package/src/funcs/agentDataComponentRelationsRemoveDataComponentFromAgent.ts +93 -78
  23. package/src/funcs/agentGetFullAgentDefinition.ts +89 -74
  24. package/src/funcs/agentGetRelatedAgentInfos.ts +91 -76
  25. package/src/funcs/agentsCreateAgent.ts +88 -73
  26. package/src/funcs/agentsDeleteAgent.ts +74 -58
  27. package/src/funcs/agentsGetAgent.ts +90 -73
  28. package/src/funcs/agentsListAgents.ts +89 -74
  29. package/src/funcs/agentsUpdateAgent.ts +92 -75
  30. package/src/funcs/apiKeysCreateAPIKey.ts +88 -73
  31. package/src/funcs/apiKeysDeleteAPIKey.ts +74 -58
  32. package/src/funcs/apiKeysGetAPIKeyById.ts +90 -73
  33. package/src/funcs/apiKeysListAPIKeys.ts +90 -75
  34. package/src/funcs/apiKeysUpdateAPIKey.ts +92 -75
  35. package/src/funcs/artifactComponentCreateArtifactComponent.ts +89 -74
  36. package/src/funcs/artifactComponentDeleteArtifactComponent.ts +74 -60
  37. package/src/funcs/artifactComponentGetArtifactComponentById.ts +89 -74
  38. package/src/funcs/artifactComponentListArtifactComponents.ts +90 -75
  39. package/src/funcs/artifactComponentUpdateArtifactComponent.ts +91 -76
  40. package/src/funcs/cliGetApiCliMe.ts +144 -0
  41. package/src/funcs/contextConfigCreateContextConfig.ts +91 -76
  42. package/src/funcs/contextConfigDeleteContextConfig.ts +87 -73
  43. package/src/funcs/contextConfigGetContextConfigById.ts +91 -76
  44. package/src/funcs/contextConfigListContextConfigs.ts +92 -77
  45. package/src/funcs/contextConfigUpdateContextConfig.ts +93 -78
  46. package/src/funcs/conversationsGetConversation.ts +92 -77
  47. package/src/funcs/credentialCreateCredential.ts +90 -73
  48. package/src/funcs/credentialDeleteCredential.ts +73 -59
  49. package/src/funcs/credentialGetCredentialById.ts +89 -74
  50. package/src/funcs/credentialListCredentials.ts +91 -74
  51. package/src/funcs/credentialStoreCreateCredentialInStore.ts +91 -76
  52. package/src/funcs/credentialStoreListCredentialStores.ts +87 -72
  53. package/src/funcs/credentialUpdateCredential.ts +91 -76
  54. package/src/funcs/dataComponentCreateDataComponent.ts +90 -73
  55. package/src/funcs/dataComponentDeleteDataComponent.ts +74 -60
  56. package/src/funcs/dataComponentGetDataComponentById.ts +89 -74
  57. package/src/funcs/dataComponentListDataComponents.ts +91 -74
  58. package/src/funcs/dataComponentUpdateDataComponent.ts +91 -76
  59. package/src/funcs/externalAgentsCreateExternalAgent.ts +90 -73
  60. package/src/funcs/externalAgentsDeleteExternalAgent.ts +74 -60
  61. package/src/funcs/externalAgentsGetExternalAgentById.ts +89 -74
  62. package/src/funcs/externalAgentsListExternalAgents.ts +91 -74
  63. package/src/funcs/externalAgentsUpdateExternalAgent.ts +91 -76
  64. package/src/funcs/fullAgentCreateFullAgent.ts +89 -74
  65. package/src/funcs/fullAgentDeleteFullAgent.ts +86 -70
  66. package/src/funcs/fullAgentGetFullAgent.ts +90 -73
  67. package/src/funcs/fullAgentUpdateFullAgent.ts +92 -75
  68. package/src/funcs/fullProjectCreateFullProject.ts +87 -72
  69. package/src/funcs/fullProjectDeleteFullProject.ts +82 -68
  70. package/src/funcs/fullProjectGetFullProject.ts +86 -71
  71. package/src/funcs/fullProjectUpdateFullProject.ts +88 -73
  72. package/src/funcs/functionToolsCreateFunctionTool.ts +91 -76
  73. package/src/funcs/functionToolsDeleteFunctionTool.ts +87 -73
  74. package/src/funcs/functionToolsGetFunctionTool.ts +91 -76
  75. package/src/funcs/functionToolsListFunctionTools.ts +92 -77
  76. package/src/funcs/functionToolsUpdateFunctionTool.ts +93 -78
  77. package/src/funcs/functionsCreateFunction.ts +90 -73
  78. package/src/funcs/functionsDeleteFunction.ts +86 -70
  79. package/src/funcs/functionsGetFunction.ts +90 -73
  80. package/src/funcs/functionsListFunctions.ts +91 -74
  81. package/src/funcs/functionsUpdateFunction.ts +92 -75
  82. package/src/funcs/health.ts +61 -45
  83. package/src/funcs/invitationsGetApiInvitationsPending.ts +60 -52
  84. package/src/funcs/mcpCatalogListMCPCatalog.ts +88 -71
  85. package/src/funcs/oAuthInitiateOauthLoginPublic.ts +74 -62
  86. package/src/funcs/oAuthOauthCallback.ts +73 -61
  87. package/src/funcs/playgroundCreatePlaygroundToken.ts +75 -62
  88. package/src/funcs/projectsCreateProject.ts +87 -72
  89. package/src/funcs/projectsDeleteProject.ts +86 -71
  90. package/src/funcs/projectsGetProjectById.ts +86 -71
  91. package/src/funcs/projectsListProjects.ts +87 -72
  92. package/src/funcs/projectsUpdateProject.ts +88 -73
  93. package/src/funcs/subAgentCreateSubagent.ts +91 -76
  94. package/src/funcs/subAgentDeleteSubagent.ts +77 -61
  95. package/src/funcs/subAgentExternalAgentRelationsCreateSubAgentExternalAgentRelation.ts +95 -79
  96. package/src/funcs/subAgentExternalAgentRelationsDeleteSubAgentExternalAgentRelation.ts +80 -65
  97. package/src/funcs/subAgentExternalAgentRelationsGetSubAgentExternalAgentRelationById.ts +95 -79
  98. package/src/funcs/subAgentExternalAgentRelationsListSubAgentExternalAgentRelations.ts +96 -80
  99. package/src/funcs/subAgentExternalAgentRelationsUpdateSubAgentExternalAgentRelation.ts +97 -81
  100. package/src/funcs/subAgentGetSubagentById.ts +91 -76
  101. package/src/funcs/subAgentListSubagents.ts +92 -77
  102. package/src/funcs/subAgentRelationsCreateSubAgentRelation.ts +91 -76
  103. package/src/funcs/subAgentRelationsDeleteSubAgentRelation.ts +76 -62
  104. package/src/funcs/subAgentRelationsGetSubAgentRelationById.ts +91 -76
  105. package/src/funcs/subAgentRelationsListSubAgentRelations.ts +96 -81
  106. package/src/funcs/subAgentRelationsUpdateSubAgentRelation.ts +93 -78
  107. package/src/funcs/subAgentTeamAgentRelationsCreateSubAgentTeamAgentRelation.ts +93 -78
  108. package/src/funcs/subAgentTeamAgentRelationsDeleteSubAgentTeamAgentRelation.ts +78 -64
  109. package/src/funcs/subAgentTeamAgentRelationsGetSubAgentTeamAgentRelationById.ts +93 -78
  110. package/src/funcs/subAgentTeamAgentRelationsListSubAgentTeamAgentRelations.ts +94 -79
  111. package/src/funcs/subAgentTeamAgentRelationsUpdateSubAgentTeamAgentRelation.ts +95 -80
  112. package/src/funcs/subAgentToolRelationsCreateSubagentToolRelation.ts +91 -76
  113. package/src/funcs/subAgentToolRelationsDeleteSubagentToolRelation.ts +76 -62
  114. package/src/funcs/subAgentToolRelationsGetSubagentToolRelation.ts +91 -76
  115. package/src/funcs/subAgentToolRelationsGetSubagentsForTool.ts +94 -79
  116. package/src/funcs/subAgentToolRelationsListSubagentToolRelations.ts +94 -79
  117. package/src/funcs/subAgentToolRelationsUpdateSubagentToolRelation.ts +93 -78
  118. package/src/funcs/subAgentUpdateSubagent.ts +93 -78
  119. package/src/funcs/thirdPartyMCPServersGetOauthRedirectUrl.ts +209 -0
  120. package/src/funcs/thirdPartyMCPServersGetThirdPartyMCPServer.ts +89 -74
  121. package/src/funcs/toolsCreateTool.ts +88 -73
  122. package/src/funcs/toolsDeleteTool.ts +97 -58
  123. package/src/funcs/toolsGetTool.ts +90 -73
  124. package/src/funcs/toolsGetUserCredentialForTool.ts +211 -0
  125. package/src/funcs/toolsListTools.ts +90 -75
  126. package/src/funcs/toolsUpdateTool.ts +92 -75
  127. package/src/funcs/userOrganizationsGetApiUsersUserIdOrganizations.ts +62 -52
  128. package/src/funcs/userOrganizationsPostApiUsersUserIdOrganizations.ts +64 -54
  129. package/src/hooks/hooks.ts +25 -14
  130. package/src/hooks/registration.ts +5 -4
  131. package/src/hooks/types.ts +18 -8
  132. package/src/index.ts +2 -1
  133. package/src/lib/base64.ts +8 -3
  134. package/src/lib/config.ts +19 -11
  135. package/src/lib/dlv.ts +3 -2
  136. package/src/lib/encodings.ts +118 -87
  137. package/src/lib/env.ts +17 -7
  138. package/src/lib/files.ts +29 -28
  139. package/src/lib/http.ts +66 -46
  140. package/src/lib/is-plain-object.ts +2 -1
  141. package/src/lib/logger.ts +1 -0
  142. package/src/lib/matchers.ts +111 -94
  143. package/src/lib/primitives.ts +14 -8
  144. package/src/lib/result.ts +4 -1
  145. package/src/lib/retries.ts +26 -18
  146. package/src/lib/schemas.ts +20 -26
  147. package/src/lib/sdks.ts +115 -85
  148. package/src/lib/security.ts +90 -46
  149. package/src/lib/url.ts +10 -5
  150. package/src/mcp-server/cli/start/command.ts +54 -41
  151. package/src/mcp-server/cli/start/impl.ts +52 -38
  152. package/src/mcp-server/cli.ts +2 -1
  153. package/src/mcp-server/console-logger.ts +27 -12
  154. package/src/mcp-server/extensions.ts +11 -6
  155. package/src/mcp-server/mcp-server.ts +8 -7
  156. package/src/mcp-server/prompts.ts +64 -51
  157. package/src/mcp-server/resources.ts +54 -35
  158. package/src/mcp-server/scopes.ts +1 -0
  159. package/src/mcp-server/server.ts +25 -6
  160. package/src/mcp-server/shared.ts +35 -24
  161. package/src/mcp-server/tools/agentArtifactComponentRelationsAssociateArtifactComponentWithAgent.ts +34 -33
  162. package/src/mcp-server/tools/agentArtifactComponentRelationsCheckArtifactComponentAgentAssociation.ts +34 -33
  163. package/src/mcp-server/tools/agentArtifactComponentRelationsGetAgentsUsingArtifactComponent.ts +34 -32
  164. package/src/mcp-server/tools/agentArtifactComponentRelationsGetArtifactComponentsForAgent.ts +34 -32
  165. package/src/mcp-server/tools/agentArtifactComponentRelationsRemoveArtifactComponentFromAgent.ts +34 -32
  166. package/src/mcp-server/tools/agentDataComponentRelationsAssociateDataComponentWithAgent.ts +33 -32
  167. package/src/mcp-server/tools/agentDataComponentRelationsCheckDataComponentAgentAssociation.ts +34 -32
  168. package/src/mcp-server/tools/agentDataComponentRelationsGetAgentsUsingDataComponent.ts +33 -32
  169. package/src/mcp-server/tools/agentDataComponentRelationsGetDataComponentsForAgent.ts +33 -32
  170. package/src/mcp-server/tools/agentDataComponentRelationsRemoveDataComponentFromAgent.ts +33 -32
  171. package/src/mcp-server/tools/agentGetFullAgentDefinition.ts +16 -13
  172. package/src/mcp-server/tools/agentGetRelatedAgentInfos.ts +16 -13
  173. package/src/mcp-server/tools/agentsCreateAgent.ts +16 -13
  174. package/src/mcp-server/tools/agentsDeleteAgent.ts +16 -13
  175. package/src/mcp-server/tools/agentsGetAgent.ts +16 -13
  176. package/src/mcp-server/tools/agentsListAgents.ts +16 -13
  177. package/src/mcp-server/tools/agentsUpdateAgent.ts +16 -13
  178. package/src/mcp-server/tools/apiKeysCreateAPIKey.ts +16 -13
  179. package/src/mcp-server/tools/apiKeysDeleteAPIKey.ts +16 -13
  180. package/src/mcp-server/tools/apiKeysGetAPIKeyById.ts +16 -13
  181. package/src/mcp-server/tools/apiKeysListAPIKeys.ts +16 -13
  182. package/src/mcp-server/tools/apiKeysUpdateAPIKey.ts +16 -13
  183. package/src/mcp-server/tools/artifactComponentCreateArtifactComponent.ts +19 -14
  184. package/src/mcp-server/tools/artifactComponentDeleteArtifactComponent.ts +19 -14
  185. package/src/mcp-server/tools/artifactComponentGetArtifactComponentById.ts +15 -12
  186. package/src/mcp-server/tools/artifactComponentListArtifactComponents.ts +19 -14
  187. package/src/mcp-server/tools/artifactComponentUpdateArtifactComponent.ts +19 -14
  188. package/src/mcp-server/tools/cliGetApiCliMe.ts +38 -0
  189. package/src/mcp-server/tools/contextConfigCreateContextConfig.ts +19 -14
  190. package/src/mcp-server/tools/contextConfigDeleteContextConfig.ts +19 -14
  191. package/src/mcp-server/tools/contextConfigGetContextConfigById.ts +19 -14
  192. package/src/mcp-server/tools/contextConfigListContextConfigs.ts +32 -28
  193. package/src/mcp-server/tools/contextConfigUpdateContextConfig.ts +19 -14
  194. package/src/mcp-server/tools/conversationsGetConversation.ts +16 -13
  195. package/src/mcp-server/tools/credentialCreateCredential.ts +16 -13
  196. package/src/mcp-server/tools/credentialDeleteCredential.ts +16 -13
  197. package/src/mcp-server/tools/credentialGetCredentialById.ts +16 -13
  198. package/src/mcp-server/tools/credentialListCredentials.ts +16 -13
  199. package/src/mcp-server/tools/credentialStoreCreateCredentialInStore.ts +19 -14
  200. package/src/mcp-server/tools/credentialStoreListCredentialStores.ts +19 -14
  201. package/src/mcp-server/tools/credentialUpdateCredential.ts +16 -13
  202. package/src/mcp-server/tools/dataComponentCreateDataComponent.ts +19 -14
  203. package/src/mcp-server/tools/dataComponentDeleteDataComponent.ts +19 -14
  204. package/src/mcp-server/tools/dataComponentGetDataComponentById.ts +19 -14
  205. package/src/mcp-server/tools/dataComponentListDataComponents.ts +32 -28
  206. package/src/mcp-server/tools/dataComponentUpdateDataComponent.ts +19 -14
  207. package/src/mcp-server/tools/externalAgentsCreateExternalAgent.ts +19 -14
  208. package/src/mcp-server/tools/externalAgentsDeleteExternalAgent.ts +19 -14
  209. package/src/mcp-server/tools/externalAgentsGetExternalAgentById.ts +19 -14
  210. package/src/mcp-server/tools/externalAgentsListExternalAgents.ts +19 -14
  211. package/src/mcp-server/tools/externalAgentsUpdateExternalAgent.ts +19 -14
  212. package/src/mcp-server/tools/fullAgentCreateFullAgent.ts +16 -13
  213. package/src/mcp-server/tools/fullAgentDeleteFullAgent.ts +16 -13
  214. package/src/mcp-server/tools/fullAgentGetFullAgent.ts +16 -13
  215. package/src/mcp-server/tools/fullAgentUpdateFullAgent.ts +16 -13
  216. package/src/mcp-server/tools/fullProjectCreateFullProject.ts +16 -13
  217. package/src/mcp-server/tools/fullProjectDeleteFullProject.ts +16 -13
  218. package/src/mcp-server/tools/fullProjectGetFullProject.ts +16 -13
  219. package/src/mcp-server/tools/fullProjectUpdateFullProject.ts +16 -13
  220. package/src/mcp-server/tools/functionToolsCreateFunctionTool.ts +32 -28
  221. package/src/mcp-server/tools/functionToolsDeleteFunctionTool.ts +32 -28
  222. package/src/mcp-server/tools/functionToolsGetFunctionTool.ts +16 -13
  223. package/src/mcp-server/tools/functionToolsListFunctionTools.ts +32 -28
  224. package/src/mcp-server/tools/functionToolsUpdateFunctionTool.ts +32 -28
  225. package/src/mcp-server/tools/functionsCreateFunction.ts +16 -13
  226. package/src/mcp-server/tools/functionsDeleteFunction.ts +16 -13
  227. package/src/mcp-server/tools/functionsGetFunction.ts +16 -13
  228. package/src/mcp-server/tools/functionsListFunctions.ts +16 -13
  229. package/src/mcp-server/tools/functionsUpdateFunction.ts +16 -13
  230. package/src/mcp-server/tools/health.ts +14 -12
  231. package/src/mcp-server/tools/invitationsGetApiInvitationsPending.ts +19 -14
  232. package/src/mcp-server/tools/mcpCatalogListMCPCatalog.ts +16 -13
  233. package/src/mcp-server/tools/oAuthInitiateOauthLoginPublic.ts +16 -13
  234. package/src/mcp-server/tools/oAuthOauthCallback.ts +16 -13
  235. package/src/mcp-server/tools/projectsCreateProject.ts +16 -13
  236. package/src/mcp-server/tools/projectsDeleteProject.ts +16 -13
  237. package/src/mcp-server/tools/projectsGetProjectById.ts +16 -13
  238. package/src/mcp-server/tools/projectsListProjects.ts +16 -13
  239. package/src/mcp-server/tools/projectsUpdateProject.ts +16 -13
  240. package/src/mcp-server/tools/subAgentCreateSubagent.ts +16 -13
  241. package/src/mcp-server/tools/subAgentDeleteSubagent.ts +16 -13
  242. package/src/mcp-server/tools/subAgentExternalAgentRelationsCreateSubAgentExternalAgentRelation.ts +34 -33
  243. package/src/mcp-server/tools/subAgentExternalAgentRelationsDeleteSubAgentExternalAgentRelation.ts +34 -33
  244. package/src/mcp-server/tools/subAgentExternalAgentRelationsGetSubAgentExternalAgentRelationById.ts +34 -33
  245. package/src/mcp-server/tools/subAgentExternalAgentRelationsListSubAgentExternalAgentRelations.ts +34 -31
  246. package/src/mcp-server/tools/subAgentExternalAgentRelationsUpdateSubAgentExternalAgentRelation.ts +34 -33
  247. package/src/mcp-server/tools/subAgentGetSubagentById.ts +16 -13
  248. package/src/mcp-server/tools/subAgentListSubagents.ts +16 -13
  249. package/src/mcp-server/tools/subAgentRelationsCreateSubAgentRelation.ts +19 -14
  250. package/src/mcp-server/tools/subAgentRelationsDeleteSubAgentRelation.ts +19 -14
  251. package/src/mcp-server/tools/subAgentRelationsGetSubAgentRelationById.ts +19 -14
  252. package/src/mcp-server/tools/subAgentRelationsListSubAgentRelations.ts +19 -14
  253. package/src/mcp-server/tools/subAgentRelationsUpdateSubAgentRelation.ts +19 -14
  254. package/src/mcp-server/tools/subAgentTeamAgentRelationsCreateSubAgentTeamAgentRelation.ts +33 -32
  255. package/src/mcp-server/tools/subAgentTeamAgentRelationsDeleteSubAgentTeamAgentRelation.ts +33 -32
  256. package/src/mcp-server/tools/subAgentTeamAgentRelationsGetSubAgentTeamAgentRelationById.ts +34 -32
  257. package/src/mcp-server/tools/subAgentTeamAgentRelationsListSubAgentTeamAgentRelations.ts +33 -32
  258. package/src/mcp-server/tools/subAgentTeamAgentRelationsUpdateSubAgentTeamAgentRelation.ts +33 -32
  259. package/src/mcp-server/tools/subAgentToolRelationsCreateSubagentToolRelation.ts +33 -30
  260. package/src/mcp-server/tools/subAgentToolRelationsDeleteSubagentToolRelation.ts +33 -30
  261. package/src/mcp-server/tools/subAgentToolRelationsGetSubagentToolRelation.ts +20 -16
  262. package/src/mcp-server/tools/subAgentToolRelationsGetSubagentsForTool.ts +19 -14
  263. package/src/mcp-server/tools/subAgentToolRelationsListSubagentToolRelations.ts +33 -30
  264. package/src/mcp-server/tools/subAgentToolRelationsUpdateSubagentToolRelation.ts +33 -30
  265. package/src/mcp-server/tools/subAgentUpdateSubagent.ts +16 -13
  266. package/src/mcp-server/tools/thirdPartyMCPServersGetOauthRedirectUrl.ts +47 -0
  267. package/src/mcp-server/tools/thirdPartyMCPServersGetThirdPartyMCPServer.ts +15 -12
  268. package/src/mcp-server/tools/toolsCreateTool.ts +16 -13
  269. package/src/mcp-server/tools/toolsDeleteTool.ts +16 -13
  270. package/src/mcp-server/tools/toolsGetTool.ts +16 -13
  271. package/src/mcp-server/tools/toolsGetUserCredentialForTool.ts +43 -0
  272. package/src/mcp-server/tools/toolsListTools.ts +16 -13
  273. package/src/mcp-server/tools/toolsUpdateTool.ts +16 -13
  274. package/src/mcp-server/tools/userOrganizationsGetApiUsersUserIdOrganizations.ts +33 -30
  275. package/src/mcp-server/tools/userOrganizationsPostApiUsersUserIdOrganizations.ts +33 -30
  276. package/src/mcp-server/tools.ts +111 -79
  277. package/src/models/agent.ts +3 -2
  278. package/src/models/agentcreate.ts +3 -2
  279. package/src/models/agentlistresponse.ts +6 -5
  280. package/src/models/agentresponse.ts +4 -3
  281. package/src/models/agentstopwhen.ts +3 -2
  282. package/src/models/agentupdate.ts +3 -2
  283. package/src/models/agentwithincontextofproject.ts +30 -21
  284. package/src/models/agentwithincontextofprojectresponse.ts +5 -6
  285. package/src/models/apikey.ts +3 -2
  286. package/src/models/apikeycreate.ts +3 -2
  287. package/src/models/apikeylistresponse.ts +6 -5
  288. package/src/models/apikeyresponse.ts +4 -3
  289. package/src/models/apikeyupdate.ts +3 -2
  290. package/src/models/artifactcomponent.ts +6 -5
  291. package/src/models/artifactcomponentarrayresponse.ts +7 -5
  292. package/src/models/artifactcomponentcreate.ts +5 -6
  293. package/src/models/artifactcomponentlistresponse.ts +8 -6
  294. package/src/models/artifactcomponentresponse.ts +7 -5
  295. package/src/models/artifactcomponentupdate.ts +5 -6
  296. package/src/models/associateartifactcomponentwithagentop.ts +36 -32
  297. package/src/models/associatedatacomponentwithagentop.ts +28 -25
  298. package/src/models/badrequest.ts +28 -16
  299. package/src/models/candelegatetoexternalagent.ts +4 -5
  300. package/src/models/candelegatetoteamagent.ts +4 -5
  301. package/src/models/canuseitem.ts +9 -10
  302. package/src/models/checkartifactcomponentagentassociationop.ts +33 -31
  303. package/src/models/checkdatacomponentagentassociationop.ts +22 -19
  304. package/src/models/componentassociation.ts +7 -9
  305. package/src/models/componentassociationlistresponse.ts +5 -6
  306. package/src/models/contextconfig.ts +5 -6
  307. package/src/models/contextconfigcreate.ts +15 -13
  308. package/src/models/contextconfiglistresponse.ts +5 -6
  309. package/src/models/contextconfigresponse.ts +7 -9
  310. package/src/models/contextconfigupdate.ts +15 -13
  311. package/src/models/conversationwithformattedmessagesresponse.ts +5 -8
  312. package/src/models/createagentop.ts +23 -16
  313. package/src/models/createapikeyop.ts +41 -40
  314. package/src/models/createartifactcomponentop.ts +23 -20
  315. package/src/models/createcontextconfigop.ts +26 -20
  316. package/src/models/createcredentialinstoreop.ts +26 -22
  317. package/src/models/createcredentialinstorerequest.ts +4 -5
  318. package/src/models/createcredentialinstoreresponse.ts +4 -7
  319. package/src/models/createcredentialop.ts +23 -20
  320. package/src/models/createdatacomponentop.ts +25 -19
  321. package/src/models/createexternalagentop.ts +25 -19
  322. package/src/models/createfullagentop.ts +29 -23
  323. package/src/models/createfullprojectop.ts +25 -21
  324. package/src/models/createfunctionop.ts +27 -22
  325. package/src/models/createfunctiontoolop.ts +26 -20
  326. package/src/models/createplaygroundtokenop.ts +17 -30
  327. package/src/models/createprojectop.ts +39 -35
  328. package/src/models/createsubagentexternalagentrelationop.ts +30 -24
  329. package/src/models/createsubagentop.ts +28 -23
  330. package/src/models/createsubagentrelationop.ts +24 -21
  331. package/src/models/createsubagentteamagentrelationop.ts +30 -24
  332. package/src/models/createsubagenttoolrelationop.ts +26 -22
  333. package/src/models/createtoolop.ts +26 -16
  334. package/src/models/credentialreference.ts +35 -14
  335. package/src/models/credentialreferencecreate.ts +25 -7
  336. package/src/models/credentialreferencelistresponse.ts +8 -6
  337. package/src/models/credentialreferenceresponse.ts +7 -5
  338. package/src/models/credentialreferenceupdate.ts +25 -7
  339. package/src/models/credentialstore.ts +20 -10
  340. package/src/models/credentialstorelistresponse.ts +7 -5
  341. package/src/models/datacomponent.ts +5 -4
  342. package/src/models/datacomponentarrayresponse.ts +4 -5
  343. package/src/models/datacomponentcreate.ts +6 -5
  344. package/src/models/datacomponentlistresponse.ts +5 -6
  345. package/src/models/datacomponentresponse.ts +7 -9
  346. package/src/models/datacomponentupdate.ts +6 -5
  347. package/src/models/deleteagentop.ts +11 -10
  348. package/src/models/deleteapikeyop.ts +15 -17
  349. package/src/models/deleteartifactcomponentop.ts +9 -12
  350. package/src/models/deletecontextconfigop.ts +21 -18
  351. package/src/models/deletecredentialop.ts +9 -12
  352. package/src/models/deletedatacomponentop.ts +9 -12
  353. package/src/models/deleteexternalagentop.ts +9 -12
  354. package/src/models/deletefullagentop.ts +20 -17
  355. package/src/models/deletefullprojectop.ts +19 -16
  356. package/src/models/deletefunctionop.ts +22 -20
  357. package/src/models/deletefunctiontoolop.ts +21 -18
  358. package/src/models/deleteprojectop.ts +33 -32
  359. package/src/models/deletesubagentexternalagentrelationop.ts +11 -14
  360. package/src/models/deletesubagentop.ts +12 -16
  361. package/src/models/deletesubagentrelationop.ts +10 -13
  362. package/src/models/deletesubagentteamagentrelationop.ts +11 -14
  363. package/src/models/deletesubagenttoolrelationop.ts +10 -13
  364. package/src/models/deletetoolop.ts +34 -12
  365. package/src/models/errorresponse.ts +3 -2
  366. package/src/models/errors/apierror.ts +5 -4
  367. package/src/models/errors/httpclienterrors.ts +8 -7
  368. package/src/models/errors/sdkvalidationerror.ts +7 -58
  369. package/src/models/existsresponse.ts +3 -2
  370. package/src/models/externalagent.ts +5 -4
  371. package/src/models/externalagentcreate.ts +6 -5
  372. package/src/models/externalagentlistresponse.ts +5 -6
  373. package/src/models/externalagentresponse.ts +7 -9
  374. package/src/models/externalagentupdate.ts +6 -5
  375. package/src/models/forbidden.ts +28 -16
  376. package/src/models/fullagentagentinsert.ts +50 -39
  377. package/src/models/fullprojectdefinition.ts +52 -38
  378. package/src/models/fullprojectdefinitionresponse.ts +5 -6
  379. package/src/models/function.ts +3 -2
  380. package/src/models/functioncreate.ts +3 -2
  381. package/src/models/functionlistresponse.ts +9 -11
  382. package/src/models/functionresponse.ts +7 -5
  383. package/src/models/functiontool.ts +3 -2
  384. package/src/models/functiontoolcreate.ts +4 -3
  385. package/src/models/functiontoollistresponse.ts +5 -6
  386. package/src/models/functiontoolresponse.ts +7 -9
  387. package/src/models/functiontoolupdate.ts +4 -3
  388. package/src/models/functionupdate.ts +3 -2
  389. package/src/models/getagentop.ts +25 -18
  390. package/src/models/getagentsusingartifactcomponentop.ts +27 -21
  391. package/src/models/getagentsusingdatacomponentop.ts +27 -21
  392. package/src/models/getapiclimeop.ts +58 -0
  393. package/src/models/getapiinvitationspendingop.ts +10 -16
  394. package/src/models/getapikeybyidop.ts +34 -33
  395. package/src/models/getapiusersuseridorganizationsop.ts +13 -17
  396. package/src/models/getartifactcomponentbyidop.ts +22 -19
  397. package/src/models/getartifactcomponentsforagentop.ts +25 -21
  398. package/src/models/getcontextconfigbyidop.ts +23 -20
  399. package/src/models/getconversationop.ts +25 -20
  400. package/src/models/getcredentialbyidop.ts +22 -19
  401. package/src/models/getdatacomponentbyidop.ts +22 -19
  402. package/src/models/getdatacomponentsforagentop.ts +23 -20
  403. package/src/models/getexternalagentbyidop.ts +22 -19
  404. package/src/models/getfullagentdefinitionop.ts +27 -21
  405. package/src/models/getfullagentop.ts +38 -31
  406. package/src/models/getfullprojectop.ts +25 -22
  407. package/src/models/getfunctionop.ts +26 -16
  408. package/src/models/getfunctiontoolop.ts +23 -20
  409. package/src/models/getoauthredirecturlop.ts +111 -0
  410. package/src/models/getprojectbyidop.ts +25 -20
  411. package/src/models/getrelatedagentinfosop.ts +25 -21
  412. package/src/models/getsubagentbyidop.ts +25 -19
  413. package/src/models/getsubagentexternalagentrelationbyidop.ts +29 -23
  414. package/src/models/getsubagentrelationbyidop.ts +23 -20
  415. package/src/models/getsubagentsfortoolop.ts +27 -21
  416. package/src/models/getsubagentteamagentrelationbyidop.ts +29 -23
  417. package/src/models/getsubagenttoolrelationop.ts +25 -21
  418. package/src/models/getthirdpartymcpserverop.ts +43 -22
  419. package/src/models/gettoolop.ts +34 -25
  420. package/src/models/getusercredentialfortoolop.ts +64 -0
  421. package/src/models/healthop.ts +4 -3
  422. package/src/models/initiateoauthloginpublicop.ts +11 -13
  423. package/src/models/internalservererror.ts +34 -20
  424. package/src/models/listagentsop.ts +25 -15
  425. package/src/models/listapikeysop.ts +26 -16
  426. package/src/models/listartifactcomponentsop.ts +23 -19
  427. package/src/models/listcontextconfigsop.ts +22 -19
  428. package/src/models/listcredentialsop.ts +23 -19
  429. package/src/models/listcredentialstoresop.ts +21 -18
  430. package/src/models/listdatacomponentsop.ts +21 -18
  431. package/src/models/listexternalagentsop.ts +21 -18
  432. package/src/models/listfunctionsop.ts +36 -35
  433. package/src/models/listfunctiontoolsop.ts +22 -19
  434. package/src/models/listmcpcatalogop.ts +23 -21
  435. package/src/models/listprojectsop.ts +34 -27
  436. package/src/models/listsubagentexternalagentrelationsop.ts +26 -21
  437. package/src/models/listsubagentrelationsop.ts +24 -20
  438. package/src/models/listsubagentsop.ts +37 -36
  439. package/src/models/listsubagentteamagentrelationsop.ts +28 -22
  440. package/src/models/listsubagenttoolrelationsop.ts +27 -21
  441. package/src/models/listtoolsop.ts +41 -18
  442. package/src/models/mcpcataloglistresponse.ts +19 -13
  443. package/src/models/mcptool.ts +54 -25
  444. package/src/models/mcptoollistresponse.ts +6 -5
  445. package/src/models/mcptoolresponse.ts +6 -6
  446. package/src/models/model.ts +4 -3
  447. package/src/models/modelsettings.ts +4 -3
  448. package/src/models/notfound.ts +28 -16
  449. package/src/models/oauthcallbackop.ts +20 -22
  450. package/src/models/pagination.ts +3 -2
  451. package/src/models/postapiusersuseridorganizationsop.ts +18 -25
  452. package/src/models/project.ts +7 -6
  453. package/src/models/projectcreate.ts +7 -6
  454. package/src/models/projectlistresponse.ts +6 -5
  455. package/src/models/projectmodel.ts +4 -3
  456. package/src/models/projectresponse.ts +6 -6
  457. package/src/models/projectupdate.ts +7 -6
  458. package/src/models/relatedagentinfo.ts +8 -6
  459. package/src/models/relatedagentinfolistresponse.ts +8 -6
  460. package/src/models/removeartifactcomponentfromagentop.ts +25 -19
  461. package/src/models/removedatacomponentfromagentop.ts +25 -19
  462. package/src/models/removedresponse.ts +6 -6
  463. package/src/models/security.ts +9 -12
  464. package/src/models/statuscomponent.ts +17 -11
  465. package/src/models/statusupdate.ts +7 -3
  466. package/src/models/stopwhen.ts +3 -2
  467. package/src/models/subagent.ts +7 -6
  468. package/src/models/subagentartifactcomponentresponse.ts +4 -7
  469. package/src/models/subagentcreate.ts +8 -7
  470. package/src/models/subagentdatacomponentresponse.ts +4 -7
  471. package/src/models/subagentexternalagentrelation.ts +3 -4
  472. package/src/models/subagentexternalagentrelationcreate.ts +4 -5
  473. package/src/models/subagentexternalagentrelationlistresponse.ts +6 -7
  474. package/src/models/subagentexternalagentrelationresponse.ts +5 -6
  475. package/src/models/subagentexternalagentrelationupdate.ts +4 -5
  476. package/src/models/subagentlistresponse.ts +9 -11
  477. package/src/models/subagentrelation.ts +6 -4
  478. package/src/models/subagentrelationcreate.ts +15 -8
  479. package/src/models/subagentrelationlistresponse.ts +8 -6
  480. package/src/models/subagentrelationresponse.ts +7 -5
  481. package/src/models/subagentrelationupdate.ts +15 -8
  482. package/src/models/subagentresponse.ts +7 -5
  483. package/src/models/subagentteamagentrelation.ts +3 -4
  484. package/src/models/subagentteamagentrelationcreate.ts +4 -5
  485. package/src/models/subagentteamagentrelationlistresponse.ts +6 -7
  486. package/src/models/subagentteamagentrelationresponse.ts +5 -6
  487. package/src/models/subagentteamagentrelationupdate.ts +4 -5
  488. package/src/models/subagenttoolrelation.ts +13 -15
  489. package/src/models/subagenttoolrelationcreate.ts +13 -13
  490. package/src/models/subagenttoolrelationlistresponse.ts +6 -7
  491. package/src/models/subagenttoolrelationresponse.ts +5 -6
  492. package/src/models/subagenttoolrelationupdate.ts +13 -13
  493. package/src/models/subagentupdate.ts +8 -7
  494. package/src/models/teamagent.ts +3 -2
  495. package/src/models/thirdpartymcpserverresponse.ts +19 -13
  496. package/src/models/toolcreate.ts +43 -24
  497. package/src/models/toolupdate.ts +43 -24
  498. package/src/models/unauthorized.ts +26 -13
  499. package/src/models/unprocessableentity.ts +34 -20
  500. package/src/models/updateagentop.ts +24 -17
  501. package/src/models/updateapikeyop.ts +34 -30
  502. package/src/models/updateartifactcomponentop.ts +24 -21
  503. package/src/models/updatecontextconfigop.ts +27 -21
  504. package/src/models/updatecredentialop.ts +24 -21
  505. package/src/models/updatedatacomponentop.ts +26 -20
  506. package/src/models/updateexternalagentop.ts +26 -20
  507. package/src/models/updatefullagentop.ts +29 -23
  508. package/src/models/updatefullprojectop.ts +25 -21
  509. package/src/models/updatefunctionop.ts +28 -23
  510. package/src/models/updatefunctiontoolop.ts +27 -21
  511. package/src/models/updateprojectop.ts +38 -34
  512. package/src/models/updatesubagentexternalagentrelationop.ts +31 -25
  513. package/src/models/updatesubagentop.ts +29 -24
  514. package/src/models/updatesubagentrelationop.ts +25 -22
  515. package/src/models/updatesubagentteamagentrelationop.ts +31 -25
  516. package/src/models/updatesubagenttoolrelationop.ts +27 -23
  517. package/src/models/updatetoolop.ts +27 -17
  518. package/src/types/async.ts +24 -9
  519. package/src/types/bigint.ts +88 -0
  520. package/src/types/blobs.ts +5 -4
  521. package/src/types/enums.ts +2 -1
  522. package/src/types/fp.ts +4 -1
  523. package/src/types/rfcdate.ts +8 -5
  524. package/src/types/streams.ts +8 -5
  525. package/src/zod-int.ts +9 -0
  526. package/tsconfig.json +3 -2
  527. package/openapi.json +0 -17114
  528. package/scripts/watch-and-fetch.mjs +0 -72
  529. package/src/hooks/auth-hook.ts +0 -32
  530. package/src/http-server.ts +0 -34
@@ -1,31 +1,33 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 6b73f0ce7b27
3
4
  */
4
5
 
5
- import type { InkeepAgentsCore } from '../core.js';
6
- import { encodeFormQuery } from '../lib/encodings.js';
7
- import * as M from '../lib/matchers.js';
8
- import { compactMap } from '../lib/primitives.js';
9
- import { safeParse } from '../lib/schemas.js';
10
- import type { RequestOptions } from '../lib/sdks.js';
11
- import { pathToFunc } from '../lib/url.js';
12
- import type { APIError } from '../models/errors/apierror.js';
13
- import type {
6
+ import { InkeepAgentsManageCore } from "../core.js";
7
+ import { encodeFormQuery } from "../lib/encodings.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import { APIError } from "../models/errors/apierror.js";
15
+ import {
14
16
  ConnectionError,
15
17
  InvalidRequestError,
16
18
  RequestAbortedError,
17
19
  RequestTimeoutError,
18
20
  UnexpectedClientError,
19
- } from '../models/errors/httpclienterrors.js';
20
- import type { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
21
23
  import {
22
- type InitiateOauthLoginPublicRequest,
24
+ InitiateOauthLoginPublicRequest,
23
25
  InitiateOauthLoginPublicRequest$zodSchema,
24
- type InitiateOauthLoginPublicResponse,
26
+ InitiateOauthLoginPublicResponse,
25
27
  InitiateOauthLoginPublicResponse$zodSchema,
26
- } from '../models/initiateoauthloginpublicop.js';
27
- import { type APICall, APIPromise } from '../types/async.js';
28
- import type { Result } from '../types/fp.js';
28
+ } from "../models/initiateoauthloginpublicop.js";
29
+ import { APICall, APIPromise } from "../types/async.js";
30
+ import { Result } from "../types/fp.js";
29
31
 
30
32
  /**
31
33
  * Initiate OAuth login for MCP tool
@@ -34,9 +36,9 @@ import type { Result } from '../types/fp.js';
34
36
  * Detects OAuth requirements and redirects to authorization server (public endpoint)
35
37
  */
36
38
  export function oAuthInitiateOauthLoginPublic(
37
- client$: InkeepAgentsCore,
39
+ client$: InkeepAgentsManageCore,
38
40
  request: InitiateOauthLoginPublicRequest,
39
- options?: RequestOptions
41
+ options?: RequestOptions,
40
42
  ): APIPromise<
41
43
  Result<
42
44
  InitiateOauthLoginPublicResponse,
@@ -49,13 +51,17 @@ export function oAuthInitiateOauthLoginPublic(
49
51
  | ConnectionError
50
52
  >
51
53
  > {
52
- return new APIPromise($do(client$, request, options));
54
+ return new APIPromise($do(
55
+ client$,
56
+ request,
57
+ options,
58
+ ));
53
59
  }
54
60
 
55
61
  async function $do(
56
- client$: InkeepAgentsCore,
62
+ client$: InkeepAgentsManageCore,
57
63
  request: InitiateOauthLoginPublicRequest,
58
- options?: RequestOptions
64
+ options?: RequestOptions,
59
65
  ): Promise<
60
66
  [
61
67
  Result<
@@ -74,53 +80,59 @@ async function $do(
74
80
  const parsed$ = safeParse(
75
81
  request,
76
82
  (value$) => InitiateOauthLoginPublicRequest$zodSchema.parse(value$),
77
- 'Input validation failed'
83
+ "Input validation failed",
78
84
  );
79
85
  if (!parsed$.ok) {
80
- return [parsed$, { status: 'invalid' }];
86
+ return [parsed$, { status: "invalid" }];
81
87
  }
82
88
  const payload$ = parsed$.value;
83
89
  const body$ = null;
84
- const path$ = pathToFunc('/oauth/login')();
90
+ const path$ = pathToFunc("/oauth/login")();
85
91
  const query$ = encodeFormQuery({
86
- projectId: payload$.projectId,
87
- tenantId: payload$.tenantId,
88
- toolId: payload$.toolId,
92
+ "projectId": payload$.projectId,
93
+ "tenantId": payload$.tenantId,
94
+ "toolId": payload$.toolId,
89
95
  });
90
96
 
91
- const headers$ = new Headers(
92
- compactMap({
93
- Accept: 'text/html',
94
- })
95
- );
97
+ const headers$ = new Headers(compactMap({
98
+ Accept: "text/html",
99
+ }));
100
+ const securityInput = await extractSecurity(client$._options.security);
101
+ const requestSecurity = resolveGlobalSecurity(securityInput);
96
102
 
97
103
  const context = {
98
104
  options: client$._options,
99
- baseURL: options?.serverURL ?? client$._baseURL ?? '',
100
- operationID: 'initiate-oauth-login-public',
105
+ baseURL: options?.serverURL ?? client$._baseURL ?? "",
106
+ operationID: "initiate-oauth-login-public",
101
107
  oAuth2Scopes: null,
102
- resolvedSecurity: null,
103
- securitySource: null,
104
- retryConfig: options?.retries || client$._options.retryConfig || { strategy: 'none' },
105
- retryCodes: options?.retryCodes || ['429', '500', '502', '503', '504'],
108
+ resolvedSecurity: requestSecurity,
109
+ securitySource: client$._options.security,
110
+ retryConfig: options?.retries
111
+ || client$._options.retryConfig
112
+ || { strategy: "none" },
113
+ retryCodes: options?.retryCodes || [
114
+ "429",
115
+ "500",
116
+ "502",
117
+ "503",
118
+ "504",
119
+ ],
106
120
  };
107
121
 
108
- const requestRes = client$._createRequest(
109
- context,
110
- {
111
- method: 'GET',
112
- baseURL: options?.serverURL,
113
- path: path$,
114
- headers: headers$,
115
- query: query$,
116
- body: body$,
117
- userAgent: client$._options.userAgent,
118
- timeoutMs: options?.timeoutMs || client$._options.timeoutMs || -1,
119
- },
120
- options
121
- );
122
+ const requestRes = client$._createRequest(context, {
123
+ security: requestSecurity,
124
+ method: "GET",
125
+ baseURL: options?.serverURL,
126
+ path: path$,
127
+ headers: headers$,
128
+ query: query$,
129
+ body: body$,
130
+ userAgent: client$._options.userAgent,
131
+ timeoutMs: options?.timeoutMs || client$._options.timeoutMs
132
+ || -1,
133
+ }, options);
122
134
  if (!requestRes.ok) {
123
- return [requestRes, { status: 'invalid' }];
135
+ return [requestRes, { status: "invalid" }];
124
136
  }
125
137
  const req$ = requestRes.value;
126
138
 
@@ -131,7 +143,7 @@ async function $do(
131
143
  retryCodes: context.retryCodes,
132
144
  });
133
145
  if (!doResult.ok) {
134
- return [doResult, { status: 'request-error', request: req$ }];
146
+ return [doResult, { status: "request-error", request: req$ }];
135
147
  }
136
148
  const response = doResult.value;
137
149
  const responseFields$ = {
@@ -150,18 +162,18 @@ async function $do(
150
162
  >(
151
163
  M.nil(302, InitiateOauthLoginPublicResponse$zodSchema),
152
164
  M.text(400, InitiateOauthLoginPublicResponse$zodSchema, {
153
- ctype: 'text/html',
154
- key: 'fourHundredTextHtmlRes',
165
+ ctype: "text/html",
166
+ key: "fourHundredTextHtmlRes",
155
167
  }),
156
168
  M.text(404, InitiateOauthLoginPublicResponse$zodSchema, {
157
- ctype: 'text/html',
158
- key: 'fourHundredAndFourTextHtmlRes',
169
+ ctype: "text/html",
170
+ key: "fourHundredAndFourTextHtmlRes",
159
171
  }),
160
172
  M.text(500, InitiateOauthLoginPublicResponse$zodSchema, {
161
- ctype: 'text/html',
162
- key: 'fiveHundredTextHtmlRes',
163
- })
173
+ ctype: "text/html",
174
+ key: "fiveHundredTextHtmlRes",
175
+ }),
164
176
  )(response, req$, { extraFields: responseFields$ });
165
177
 
166
- return [result$, { status: 'complete', request: req$, response }];
178
+ return [result$, { status: "complete", request: req$, response }];
167
179
  }
@@ -1,31 +1,33 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 26db66b6fa7f
3
4
  */
4
5
 
5
- import type { InkeepAgentsCore } from '../core.js';
6
- import { encodeFormQuery } from '../lib/encodings.js';
7
- import * as M from '../lib/matchers.js';
8
- import { compactMap } from '../lib/primitives.js';
9
- import { safeParse } from '../lib/schemas.js';
10
- import type { RequestOptions } from '../lib/sdks.js';
11
- import { pathToFunc } from '../lib/url.js';
12
- import type { APIError } from '../models/errors/apierror.js';
13
- import type {
6
+ import { InkeepAgentsManageCore } from "../core.js";
7
+ import { encodeFormQuery } from "../lib/encodings.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import { APIError } from "../models/errors/apierror.js";
15
+ import {
14
16
  ConnectionError,
15
17
  InvalidRequestError,
16
18
  RequestAbortedError,
17
19
  RequestTimeoutError,
18
20
  UnexpectedClientError,
19
- } from '../models/errors/httpclienterrors.js';
20
- import type { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
21
23
  import {
22
- type OauthCallbackRequest,
24
+ OauthCallbackRequest,
23
25
  OauthCallbackRequest$zodSchema,
24
- type OauthCallbackResponse,
26
+ OauthCallbackResponse,
25
27
  OauthCallbackResponse$zodSchema,
26
- } from '../models/oauthcallbackop.js';
27
- import { type APICall, APIPromise } from '../types/async.js';
28
- import type { Result } from '../types/fp.js';
28
+ } from "../models/oauthcallbackop.js";
29
+ import { APICall, APIPromise } from "../types/async.js";
30
+ import { Result } from "../types/fp.js";
29
31
 
30
32
  /**
31
33
  * OAuth authorization callback
@@ -34,9 +36,9 @@ import type { Result } from '../types/fp.js';
34
36
  * Handles OAuth authorization codes and completes the authentication flow
35
37
  */
36
38
  export function oAuthOauthCallback(
37
- client$: InkeepAgentsCore,
39
+ client$: InkeepAgentsManageCore,
38
40
  request: OauthCallbackRequest,
39
- options?: RequestOptions
41
+ options?: RequestOptions,
40
42
  ): APIPromise<
41
43
  Result<
42
44
  OauthCallbackResponse,
@@ -49,13 +51,17 @@ export function oAuthOauthCallback(
49
51
  | ConnectionError
50
52
  >
51
53
  > {
52
- return new APIPromise($do(client$, request, options));
54
+ return new APIPromise($do(
55
+ client$,
56
+ request,
57
+ options,
58
+ ));
53
59
  }
54
60
 
55
61
  async function $do(
56
- client$: InkeepAgentsCore,
62
+ client$: InkeepAgentsManageCore,
57
63
  request: OauthCallbackRequest,
58
- options?: RequestOptions
64
+ options?: RequestOptions,
59
65
  ): Promise<
60
66
  [
61
67
  Result<
@@ -74,54 +80,60 @@ async function $do(
74
80
  const parsed$ = safeParse(
75
81
  request,
76
82
  (value$) => OauthCallbackRequest$zodSchema.parse(value$),
77
- 'Input validation failed'
83
+ "Input validation failed",
78
84
  );
79
85
  if (!parsed$.ok) {
80
- return [parsed$, { status: 'invalid' }];
86
+ return [parsed$, { status: "invalid" }];
81
87
  }
82
88
  const payload$ = parsed$.value;
83
89
  const body$ = null;
84
- const path$ = pathToFunc('/oauth/callback')();
90
+ const path$ = pathToFunc("/oauth/callback")();
85
91
  const query$ = encodeFormQuery({
86
- code: payload$.code,
87
- error: payload$.error,
88
- error_description: payload$.error_description,
89
- state: payload$.state,
92
+ "code": payload$.code,
93
+ "error": payload$.error,
94
+ "error_description": payload$.error_description,
95
+ "state": payload$.state,
90
96
  });
91
97
 
92
- const headers$ = new Headers(
93
- compactMap({
94
- Accept: 'text/html',
95
- })
96
- );
98
+ const headers$ = new Headers(compactMap({
99
+ Accept: "text/html",
100
+ }));
101
+ const securityInput = await extractSecurity(client$._options.security);
102
+ const requestSecurity = resolveGlobalSecurity(securityInput);
97
103
 
98
104
  const context = {
99
105
  options: client$._options,
100
- baseURL: options?.serverURL ?? client$._baseURL ?? '',
101
- operationID: 'oauth-callback',
106
+ baseURL: options?.serverURL ?? client$._baseURL ?? "",
107
+ operationID: "oauth-callback",
102
108
  oAuth2Scopes: null,
103
- resolvedSecurity: null,
104
- securitySource: null,
105
- retryConfig: options?.retries || client$._options.retryConfig || { strategy: 'none' },
106
- retryCodes: options?.retryCodes || ['429', '500', '502', '503', '504'],
109
+ resolvedSecurity: requestSecurity,
110
+ securitySource: client$._options.security,
111
+ retryConfig: options?.retries
112
+ || client$._options.retryConfig
113
+ || { strategy: "none" },
114
+ retryCodes: options?.retryCodes || [
115
+ "429",
116
+ "500",
117
+ "502",
118
+ "503",
119
+ "504",
120
+ ],
107
121
  };
108
122
 
109
- const requestRes = client$._createRequest(
110
- context,
111
- {
112
- method: 'GET',
113
- baseURL: options?.serverURL,
114
- path: path$,
115
- headers: headers$,
116
- query: query$,
117
- body: body$,
118
- userAgent: client$._options.userAgent,
119
- timeoutMs: options?.timeoutMs || client$._options.timeoutMs || -1,
120
- },
121
- options
122
- );
123
+ const requestRes = client$._createRequest(context, {
124
+ security: requestSecurity,
125
+ method: "GET",
126
+ baseURL: options?.serverURL,
127
+ path: path$,
128
+ headers: headers$,
129
+ query: query$,
130
+ body: body$,
131
+ userAgent: client$._options.userAgent,
132
+ timeoutMs: options?.timeoutMs || client$._options.timeoutMs
133
+ || -1,
134
+ }, options);
123
135
  if (!requestRes.ok) {
124
- return [requestRes, { status: 'invalid' }];
136
+ return [requestRes, { status: "invalid" }];
125
137
  }
126
138
  const req$ = requestRes.value;
127
139
 
@@ -132,7 +144,7 @@ async function $do(
132
144
  retryCodes: context.retryCodes,
133
145
  });
134
146
  if (!doResult.ok) {
135
- return [doResult, { status: 'request-error', request: req$ }];
147
+ return [doResult, { status: "request-error", request: req$ }];
136
148
  }
137
149
  const response = doResult.value;
138
150
  const responseFields$ = {
@@ -151,14 +163,14 @@ async function $do(
151
163
  >(
152
164
  M.nil(302, OauthCallbackResponse$zodSchema),
153
165
  M.text(400, OauthCallbackResponse$zodSchema, {
154
- ctype: 'text/html',
155
- key: 'fourHundredTextHtmlRes',
166
+ ctype: "text/html",
167
+ key: "fourHundredTextHtmlRes",
156
168
  }),
157
169
  M.text(500, OauthCallbackResponse$zodSchema, {
158
- ctype: 'text/html',
159
- key: 'fiveHundredTextHtmlRes',
160
- })
170
+ ctype: "text/html",
171
+ key: "fiveHundredTextHtmlRes",
172
+ }),
161
173
  )(response, req$, { extraFields: responseFields$ });
162
174
 
163
- return [result$, { status: 'complete', request: req$, response }];
175
+ return [result$, { status: "complete", request: req$, response }];
164
176
  }
@@ -1,33 +1,34 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 524cee2c1bbc
3
4
  */
4
5
 
5
- import { InkeepAgentsCore } from '../core.js';
6
- import { encodeJSON, encodeSimple } from '../lib/encodings.js';
7
- import * as M from '../lib/matchers.js';
8
- import { compactMap } from '../lib/primitives.js';
9
- import { safeParse } from '../lib/schemas.js';
10
- import { RequestOptions } from '../lib/sdks.js';
11
- import { resolveSecurity } from '../lib/security.js';
12
- import { pathToFunc } from '../lib/url.js';
6
+ import { InkeepAgentsManageCore } from "../core.js";
7
+ import { encodeJSON, encodeSimple } from "../lib/encodings.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { resolveSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
13
14
  import {
14
15
  CreatePlaygroundTokenRequest,
15
16
  CreatePlaygroundTokenRequest$zodSchema,
16
17
  CreatePlaygroundTokenResponse,
17
18
  CreatePlaygroundTokenResponse$zodSchema,
18
19
  CreatePlaygroundTokenSecurity,
19
- } from '../models/createplaygroundtokenop.js';
20
- import { APIError } from '../models/errors/apierror.js';
20
+ } from "../models/createplaygroundtokenop.js";
21
+ import { APIError } from "../models/errors/apierror.js";
21
22
  import {
22
23
  ConnectionError,
23
24
  InvalidRequestError,
24
25
  RequestAbortedError,
25
26
  RequestTimeoutError,
26
27
  UnexpectedClientError,
27
- } from '../models/errors/httpclienterrors.js';
28
- import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
29
- import { APICall, APIPromise } from '../types/async.js';
30
- import { Result } from '../types/fp.js';
28
+ } from "../models/errors/httpclienterrors.js";
29
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
30
+ import { APICall, APIPromise } from "../types/async.js";
31
+ import { Result } from "../types/fp.js";
31
32
 
32
33
  /**
33
34
  * Generate temporary API key for playground
@@ -36,10 +37,10 @@ import { Result } from '../types/fp.js';
36
37
  * Generates a short-lived API key (1 hour expiry) for authenticated users to access the run-api from the playground
37
38
  */
38
39
  export function playgroundCreatePlaygroundToken(
39
- client$: InkeepAgentsCore,
40
+ client$: InkeepAgentsManageCore,
40
41
  security: CreatePlaygroundTokenSecurity,
41
42
  request: CreatePlaygroundTokenRequest,
42
- options?: RequestOptions
43
+ options?: RequestOptions,
43
44
  ): APIPromise<
44
45
  Result<
45
46
  CreatePlaygroundTokenResponse,
@@ -52,14 +53,19 @@ export function playgroundCreatePlaygroundToken(
52
53
  | ConnectionError
53
54
  >
54
55
  > {
55
- return new APIPromise($do(client$, security, request, options));
56
+ return new APIPromise($do(
57
+ client$,
58
+ security,
59
+ request,
60
+ options,
61
+ ));
56
62
  }
57
63
 
58
64
  async function $do(
59
- client$: InkeepAgentsCore,
65
+ client$: InkeepAgentsManageCore,
60
66
  security: CreatePlaygroundTokenSecurity,
61
67
  request: CreatePlaygroundTokenRequest,
62
- options?: RequestOptions
68
+ options?: RequestOptions,
63
69
  ): Promise<
64
70
  [
65
71
  Result<
@@ -78,64 +84,71 @@ async function $do(
78
84
  const parsed$ = safeParse(
79
85
  request,
80
86
  (value$) => CreatePlaygroundTokenRequest$zodSchema.parse(value$),
81
- 'Input validation failed'
87
+ "Input validation failed",
82
88
  );
83
89
  if (!parsed$.ok) {
84
- return [parsed$, { status: 'invalid' }];
90
+ return [parsed$, { status: "invalid" }];
85
91
  }
86
92
  const payload$ = parsed$.value;
87
- const body$ = encodeJSON('body', payload$.body, { explode: true });
93
+ const body$ = encodeJSON("body", payload$.body, { explode: true });
88
94
 
89
95
  const pathParams$ = {
90
- tenantId: encodeSimple('tenantId', payload$.tenantId, {
96
+ tenantId: encodeSimple("tenantId", payload$.tenantId, {
91
97
  explode: false,
92
- charEncoding: 'percent',
98
+ charEncoding: "percent",
93
99
  }),
94
100
  };
95
- const path$ = pathToFunc('/tenants/{tenantId}/playground/token')(pathParams$);
96
-
97
- const headers$ = new Headers(
98
- compactMap({
99
- 'Content-Type': 'application/json',
100
- Accept: 'application/json',
101
- })
101
+ const path$ = pathToFunc("/tenants/{tenantId}/playground/token")(
102
+ pathParams$,
102
103
  );
103
104
 
104
- const requestSecurity = resolveSecurity([
105
- {
106
- fieldName: 'better-auth.session_token',
107
- type: 'apiKey:cookie',
108
- value: security?.cookieAuth,
109
- },
110
- ]);
105
+ const headers$ = new Headers(compactMap({
106
+ "Content-Type": "application/json",
107
+ Accept: "application/json",
108
+ }));
109
+
110
+ const requestSecurity = resolveSecurity(
111
+ [
112
+ {
113
+ fieldName: "better-auth.session_token",
114
+ type: "apiKey:cookie",
115
+ value: security?.cookieAuth,
116
+ },
117
+ ],
118
+ );
111
119
 
112
120
  const context = {
113
121
  options: client$._options,
114
- baseURL: options?.serverURL ?? client$._baseURL ?? '',
115
- operationID: 'create-playground-token',
122
+ baseURL: options?.serverURL ?? client$._baseURL ?? "",
123
+ operationID: "create-playground-token",
116
124
  oAuth2Scopes: null,
117
125
  resolvedSecurity: requestSecurity,
118
126
  securitySource: security,
119
- retryConfig: options?.retries || client$._options.retryConfig || { strategy: 'none' },
120
- retryCodes: options?.retryCodes || ['429', '500', '502', '503', '504'],
127
+ retryConfig: options?.retries
128
+ || client$._options.retryConfig
129
+ || { strategy: "none" },
130
+ retryCodes: options?.retryCodes || [
131
+ "429",
132
+ "500",
133
+ "502",
134
+ "503",
135
+ "504",
136
+ ],
121
137
  };
122
138
 
123
- const requestRes = client$._createRequest(
124
- context,
125
- {
126
- security: requestSecurity,
127
- method: 'POST',
128
- baseURL: options?.serverURL,
129
- path: path$,
130
- headers: headers$,
131
- body: body$,
132
- userAgent: client$._options.userAgent,
133
- timeoutMs: options?.timeoutMs || client$._options.timeoutMs || -1,
134
- },
135
- options
136
- );
139
+ const requestRes = client$._createRequest(context, {
140
+ security: requestSecurity,
141
+ method: "POST",
142
+ baseURL: options?.serverURL,
143
+ path: path$,
144
+ headers: headers$,
145
+ body: body$,
146
+ userAgent: client$._options.userAgent,
147
+ timeoutMs: options?.timeoutMs || client$._options.timeoutMs
148
+ || -1,
149
+ }, options);
137
150
  if (!requestRes.ok) {
138
- return [requestRes, { status: 'invalid' }];
151
+ return [requestRes, { status: "invalid" }];
139
152
  }
140
153
  const req$ = requestRes.value;
141
154
 
@@ -146,7 +159,7 @@ async function $do(
146
159
  retryCodes: context.retryCodes,
147
160
  });
148
161
  if (!doResult.ok) {
149
- return [doResult, { status: 'request-error', request: req$ }];
162
+ return [doResult, { status: "request-error", request: req$ }];
150
163
  }
151
164
  const response = doResult.value;
152
165
  const responseFields$ = {
@@ -163,11 +176,11 @@ async function $do(
163
176
  | RequestTimeoutError
164
177
  | ConnectionError
165
178
  >(
166
- M.json(200, CreatePlaygroundTokenResponse$zodSchema, { key: 'object' }),
179
+ M.json(200, CreatePlaygroundTokenResponse$zodSchema, { key: "object" }),
167
180
  M.json(401, CreatePlaygroundTokenResponse$zodSchema, {
168
- key: 'ErrorResponse',
169
- })
181
+ key: "ErrorResponse",
182
+ }),
170
183
  )(response, req$, { extraFields: responseFields$ });
171
184
 
172
- return [result$, { status: 'complete', request: req$, response }];
185
+ return [result$, { status: "complete", request: req$, response }];
173
186
  }