@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,48 +1,50 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 6809fa25f96d
3
4
  */
4
5
 
5
- import { bytesToBase64 } from './base64.js';
6
- import { isPlainObject } from './is-plain-object.js';
6
+ import { bytesToBase64 } from "./base64.js";
7
+ import { isPlainObject } from "./is-plain-object.js";
7
8
 
8
9
  export class EncodingError extends Error {
9
10
  constructor(message: string) {
10
11
  super(message);
11
- this.name = 'EncodingError';
12
+ this.name = "EncodingError";
12
13
  }
13
14
  }
14
15
 
15
16
  export function encodeMatrix(
16
17
  key: string,
17
18
  value: unknown,
18
- options?: { explode?: boolean; charEncoding?: 'percent' | 'none' }
19
+ options?: { explode?: boolean; charEncoding?: "percent" | "none" },
19
20
  ): string | undefined {
20
- let out = '';
21
- const pairs: [string, unknown][] = options?.explode ? explode(key, value) : [[key, value]];
21
+ let out = "";
22
+ const pairs: [string, unknown][] = options?.explode
23
+ ? explode(key, value)
24
+ : [[key, value]];
22
25
 
23
26
  if (pairs.every(([_, v]) => v == null)) {
24
27
  return;
25
28
  }
26
29
 
27
30
  const encodeString = (v: string) => {
28
- return options?.charEncoding === 'percent' ? encodeURIComponent(v) : v;
31
+ return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
29
32
  };
30
33
  const encodeValue = (v: unknown) => encodeString(serializeValue(v));
31
34
 
32
35
  pairs.forEach(([pk, pv]) => {
33
- let tmp = '';
36
+ let tmp = "";
34
37
  let encValue: string | null | undefined = null;
35
38
 
36
39
  if (pv == null) {
37
40
  return;
38
- }
39
- if (Array.isArray(pv)) {
40
- encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(',');
41
+ } else if (Array.isArray(pv)) {
42
+ encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(",");
41
43
  } else if (isPlainObject(pv)) {
42
44
  const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => {
43
45
  return `,${encodeString(k)},${encodeValue(v)}`;
44
46
  });
45
- encValue = mapped?.join('').slice(1);
47
+ encValue = mapped?.join("").slice(1);
46
48
  } else {
47
49
  encValue = `${encodeValue(pv)}`;
48
50
  }
@@ -72,39 +74,42 @@ export function encodeMatrix(
72
74
  export function encodeLabel(
73
75
  key: string,
74
76
  value: unknown,
75
- options?: { explode?: boolean; charEncoding?: 'percent' | 'none' }
77
+ options?: { explode?: boolean; charEncoding?: "percent" | "none" },
76
78
  ): string | undefined {
77
- let out = '';
78
- const pairs: [string, unknown][] = options?.explode ? explode(key, value) : [[key, value]];
79
+ let out = "";
80
+ const pairs: [string, unknown][] = options?.explode
81
+ ? explode(key, value)
82
+ : [[key, value]];
79
83
 
80
84
  if (pairs.every(([_, v]) => v == null)) {
81
85
  return;
82
86
  }
83
87
 
84
88
  const encodeString = (v: string) => {
85
- return options?.charEncoding === 'percent' ? encodeURIComponent(v) : v;
89
+ return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
86
90
  };
87
91
  const encodeValue = (v: unknown) => encodeString(serializeValue(v));
88
92
 
89
93
  pairs.forEach(([pk, pv]) => {
90
- let encValue: string | null | undefined = '';
94
+ let encValue: string | null | undefined = "";
91
95
 
92
96
  if (pv == null) {
93
97
  return;
94
- }
95
- if (Array.isArray(pv)) {
96
- encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join('.');
98
+ } else if (Array.isArray(pv)) {
99
+ encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(".");
97
100
  } else if (isPlainObject(pv)) {
98
101
  const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => {
99
102
  return `.${encodeString(k)}.${encodeValue(v)}`;
100
103
  });
101
- encValue = mapped?.join('').slice(1);
104
+ encValue = mapped?.join("").slice(1);
102
105
  } else {
103
- const k = options?.explode && isPlainObject(value) ? `${encodeString(pk)}=` : '';
106
+ const k = options?.explode && isPlainObject(value)
107
+ ? `${encodeString(pk)}=`
108
+ : "";
104
109
  encValue = `${k}${encodeValue(pv)}`;
105
110
  }
106
111
 
107
- out += encValue == null ? '' : `.${encValue}`;
112
+ out += encValue == null ? "" : `.${encValue}`;
108
113
  });
109
114
 
110
115
  return out;
@@ -113,24 +118,26 @@ export function encodeLabel(
113
118
  type FormEncoder = (
114
119
  key: string,
115
120
  value: unknown,
116
- options?: { explode?: boolean; charEncoding?: 'percent' | 'none' }
121
+ options?: { explode?: boolean; charEncoding?: "percent" | "none" },
117
122
  ) => string | undefined;
118
123
 
119
124
  function formEncoder(sep: string): FormEncoder {
120
125
  return (
121
126
  key: string,
122
127
  value: unknown,
123
- options?: { explode?: boolean; charEncoding?: 'percent' | 'none' }
128
+ options?: { explode?: boolean; charEncoding?: "percent" | "none" },
124
129
  ) => {
125
- let out = '';
126
- const pairs: [string, unknown][] = options?.explode ? explode(key, value) : [[key, value]];
130
+ let out = "";
131
+ const pairs: [string, unknown][] = options?.explode
132
+ ? explode(key, value)
133
+ : [[key, value]];
127
134
 
128
135
  if (pairs.every(([_, v]) => v == null)) {
129
136
  return;
130
137
  }
131
138
 
132
139
  const encodeString = (v: string) => {
133
- return options?.charEncoding === 'percent' ? encodeURIComponent(v) : v;
140
+ return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
134
141
  };
135
142
 
136
143
  const encodeValue = (v: unknown) => encodeString(serializeValue(v));
@@ -138,13 +145,12 @@ function formEncoder(sep: string): FormEncoder {
138
145
  const encodedSep = encodeString(sep);
139
146
 
140
147
  pairs.forEach(([pk, pv]) => {
141
- let tmp = '';
148
+ let tmp = "";
142
149
  let encValue: string | null | undefined = null;
143
150
 
144
151
  if (pv == null) {
145
152
  return;
146
- }
147
- if (Array.isArray(pv)) {
153
+ } else if (Array.isArray(pv)) {
148
154
  encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(encodedSep);
149
155
  } else if (isPlainObject(pv)) {
150
156
  encValue = mapDefinedEntries(Object.entries(pv), ([k, v]) => {
@@ -161,7 +167,7 @@ function formEncoder(sep: string): FormEncoder {
161
167
  tmp = `${encodeString(pk)}=${encValue}`;
162
168
 
163
169
  // If we end up with the nothing then skip forward
164
- if (!tmp || tmp === '=') {
170
+ if (!tmp || tmp === "=") {
165
171
  return;
166
172
  }
167
173
 
@@ -172,32 +178,33 @@ function formEncoder(sep: string): FormEncoder {
172
178
  };
173
179
  }
174
180
 
175
- export const encodeForm = formEncoder(',');
176
- export const encodeSpaceDelimited = formEncoder(' ');
177
- export const encodePipeDelimited = formEncoder('|');
181
+ export const encodeForm = formEncoder(",");
182
+ export const encodeSpaceDelimited = formEncoder(" ");
183
+ export const encodePipeDelimited = formEncoder("|");
178
184
 
179
185
  export function encodeBodyForm(
180
186
  key: string,
181
187
  value: unknown,
182
- options?: { explode?: boolean; charEncoding?: 'percent' | 'none' }
188
+ options?: { explode?: boolean; charEncoding?: "percent" | "none" },
183
189
  ): string {
184
- let out = '';
185
- const pairs: [string, unknown][] = options?.explode ? explode(key, value) : [[key, value]];
190
+ let out = "";
191
+ const pairs: [string, unknown][] = options?.explode
192
+ ? explode(key, value)
193
+ : [[key, value]];
186
194
 
187
195
  const encodeString = (v: string) => {
188
- return options?.charEncoding === 'percent' ? encodeURIComponent(v) : v;
196
+ return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
189
197
  };
190
198
 
191
199
  const encodeValue = (v: unknown) => encodeString(serializeValue(v));
192
200
 
193
201
  pairs.forEach(([pk, pv]) => {
194
- let tmp = '';
195
- let encValue = '';
202
+ let tmp = "";
203
+ let encValue = "";
196
204
 
197
205
  if (pv == null) {
198
206
  return;
199
- }
200
- if (Array.isArray(pv)) {
207
+ } else if (Array.isArray(pv)) {
201
208
  encValue = JSON.stringify(pv, jsonReplacer);
202
209
  } else if (isPlainObject(pv)) {
203
210
  encValue = JSON.stringify(pv, jsonReplacer);
@@ -208,7 +215,7 @@ export function encodeBodyForm(
208
215
  tmp = `${encodeString(pk)}=${encValue}`;
209
216
 
210
217
  // If we end up with the nothing then skip forward
211
- if (!tmp || tmp === '=') {
218
+ if (!tmp || tmp === "=") {
212
219
  return;
213
220
  }
214
221
 
@@ -221,7 +228,7 @@ export function encodeBodyForm(
221
228
  export function encodeDeepObject(
222
229
  key: string,
223
230
  value: unknown,
224
- options?: { charEncoding?: 'percent' | 'none' }
231
+ options?: { charEncoding?: "percent" | "none" },
225
232
  ): string | undefined {
226
233
  if (value == null) {
227
234
  return;
@@ -229,7 +236,7 @@ export function encodeDeepObject(
229
236
 
230
237
  if (!isPlainObject(value)) {
231
238
  throw new EncodingError(
232
- `Value of parameter '${key}' which uses deepObject encoding must be an object or null`
239
+ `Value of parameter '${key}' which uses deepObject encoding must be an object or null`,
233
240
  );
234
241
  }
235
242
 
@@ -239,16 +246,16 @@ export function encodeDeepObject(
239
246
  export function encodeDeepObjectObject(
240
247
  key: string,
241
248
  value: unknown,
242
- options?: { charEncoding?: 'percent' | 'none' }
249
+ options?: { charEncoding?: "percent" | "none" },
243
250
  ): string | undefined {
244
251
  if (value == null) {
245
252
  return;
246
253
  }
247
254
 
248
- let out = '';
255
+ let out = "";
249
256
 
250
257
  const encodeString = (v: string) => {
251
- return options?.charEncoding === 'percent' ? encodeURIComponent(v) : v;
258
+ return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
252
259
  };
253
260
 
254
261
  if (!isPlainObject(value)) {
@@ -265,7 +272,7 @@ export function encodeDeepObjectObject(
265
272
  if (isPlainObject(cv)) {
266
273
  const objOut = encodeDeepObjectObject(pk, cv, options);
267
274
 
268
- out += objOut == null ? '' : `&${objOut}`;
275
+ out += objOut == null ? "" : `&${objOut}`;
269
276
 
270
277
  return;
271
278
  }
@@ -273,9 +280,9 @@ export function encodeDeepObjectObject(
273
280
  const pairs: unknown[] = Array.isArray(cv) ? cv : [cv];
274
281
  const encoded = mapDefined(pairs, (v) => {
275
282
  return `${encodeString(pk)}=${encodeString(serializeValue(v))}`;
276
- })?.join('&');
283
+ })?.join("&");
277
284
 
278
- out += encoded == null ? '' : `&${encoded}`;
285
+ out += encoded == null ? "" : `&${encoded}`;
279
286
  });
280
287
 
281
288
  return out.slice(1);
@@ -284,14 +291,14 @@ export function encodeDeepObjectObject(
284
291
  export function encodeJSON(
285
292
  key: string,
286
293
  value: unknown,
287
- options?: { explode?: boolean; charEncoding?: 'percent' | 'none' }
294
+ options?: { explode?: boolean; charEncoding?: "percent" | "none" },
288
295
  ): string | undefined {
289
- if (typeof value === 'undefined') {
296
+ if (typeof value === "undefined") {
290
297
  return;
291
298
  }
292
299
 
293
300
  const encodeString = (v: string) => {
294
- return options?.charEncoding === 'percent' ? encodeURIComponent(v) : v;
301
+ return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
295
302
  };
296
303
 
297
304
  const encVal = encodeString(JSON.stringify(value, jsonReplacer));
@@ -302,39 +309,40 @@ export function encodeJSON(
302
309
  export const encodeSimple = (
303
310
  key: string,
304
311
  value: unknown,
305
- options?: { explode?: boolean; charEncoding?: 'percent' | 'none' }
312
+ options?: { explode?: boolean; charEncoding?: "percent" | "none" },
306
313
  ): string | undefined => {
307
- let out = '';
308
- const pairs: [string, unknown][] = options?.explode ? explode(key, value) : [[key, value]];
314
+ let out = "";
315
+ const pairs: [string, unknown][] = options?.explode
316
+ ? explode(key, value)
317
+ : [[key, value]];
309
318
 
310
319
  if (pairs.every(([_, v]) => v == null)) {
311
320
  return;
312
321
  }
313
322
 
314
323
  const encodeString = (v: string) => {
315
- return options?.charEncoding === 'percent' ? encodeURIComponent(v) : v;
324
+ return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
316
325
  };
317
326
  const encodeValue = (v: unknown) => encodeString(serializeValue(v));
318
327
 
319
328
  pairs.forEach(([pk, pv]) => {
320
- let tmp: string | null | undefined = '';
329
+ let tmp: string | null | undefined = "";
321
330
 
322
331
  if (pv == null) {
323
332
  return;
324
- }
325
- if (Array.isArray(pv)) {
326
- tmp = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(',');
333
+ } else if (Array.isArray(pv)) {
334
+ tmp = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(",");
327
335
  } else if (isPlainObject(pv)) {
328
336
  const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => {
329
337
  return `,${encodeString(k)},${encodeValue(v)}`;
330
338
  });
331
- tmp = mapped?.join('').slice(1);
339
+ tmp = mapped?.join("").slice(1);
332
340
  } else {
333
- const k = options?.explode && isPlainObject(value) ? `${pk}=` : '';
341
+ const k = options?.explode && isPlainObject(value) ? `${pk}=` : "";
334
342
  tmp = `${k}${encodeValue(pv)}`;
335
343
  }
336
344
 
337
- out += tmp ? `,${tmp}` : '';
345
+ out += tmp ? `,${tmp}` : "";
338
346
  });
339
347
 
340
348
  return out.slice(1);
@@ -343,25 +351,28 @@ export const encodeSimple = (
343
351
  function explode(key: string, value: unknown): [string, unknown][] {
344
352
  if (Array.isArray(value)) {
345
353
  return value.map((v) => [key, v]);
346
- }
347
- if (isPlainObject(value)) {
354
+ } else if (isPlainObject(value)) {
348
355
  const o = value ?? {};
349
356
  return Object.entries(o).map(([k, v]) => [k, v]);
357
+ } else {
358
+ return [[key, value]];
350
359
  }
351
- return [[key, value]];
352
360
  }
353
361
 
354
362
  function serializeValue(value: unknown): string {
355
363
  if (value == null) {
356
- return '';
357
- }
358
- if (value instanceof Date) {
364
+ return "";
365
+ } else if (value instanceof Date) {
359
366
  return value.toISOString();
360
- }
361
- if (value instanceof Uint8Array) {
367
+ } else if (value instanceof Uint8Array) {
362
368
  return bytesToBase64(value);
363
- }
364
- if (typeof value === 'object') {
369
+ } else if (typeof value === "object") {
370
+ if (
371
+ "toJSON" in value
372
+ && typeof value.toJSON === "function"
373
+ ) {
374
+ return String(value.toJSON());
375
+ }
365
376
  return JSON.stringify(value, jsonReplacer);
366
377
  }
367
378
 
@@ -371,8 +382,11 @@ function serializeValue(value: unknown): string {
371
382
  function jsonReplacer(_: string, value: unknown): unknown {
372
383
  if (value instanceof Uint8Array) {
373
384
  return bytesToBase64(value);
385
+ } else if (typeof value === "bigint") {
386
+ return value.toString();
387
+ } else {
388
+ return value;
374
389
  }
375
- return value;
376
390
  }
377
391
 
378
392
  function mapDefined<T, R>(inp: T[], mapper: (v: T) => R): R[] | null {
@@ -394,7 +408,10 @@ function mapDefined<T, R>(inp: T[], mapper: (v: T) => R): R[] | null {
394
408
  return res.length ? res : null;
395
409
  }
396
410
 
397
- function mapDefinedEntries<K, V, R>(inp: Iterable<[K, V]>, mapper: (v: [K, V]) => R): R[] | null {
411
+ function mapDefinedEntries<K, V, R>(
412
+ inp: Iterable<[K, V]>,
413
+ mapper: (v: [K, V]) => R,
414
+ ): R[] | null {
398
415
  const acc: R[] = [];
399
416
  for (const [k, v] of inp) {
400
417
  if (v == null) {
@@ -413,28 +430,34 @@ function mapDefinedEntries<K, V, R>(inp: Iterable<[K, V]>, mapper: (v: [K, V]) =
413
430
  }
414
431
 
415
432
  export function queryJoin(...args: (string | undefined)[]): string {
416
- return args.filter(Boolean).join('&');
433
+ return args.filter(Boolean).join("&");
417
434
  }
418
435
 
419
436
  type QueryEncoderOptions = {
420
437
  explode?: boolean;
421
- charEncoding?: 'percent' | 'none';
438
+ charEncoding?: "percent" | "none";
422
439
  };
423
440
 
424
441
  type QueryEncoder = (
425
442
  key: string,
426
443
  value: unknown,
427
- options?: QueryEncoderOptions
444
+ options?: QueryEncoderOptions,
428
445
  ) => string | undefined;
429
446
 
430
- type BulkQueryEncoder = (values: Record<string, unknown>, options?: QueryEncoderOptions) => string;
447
+ type BulkQueryEncoder = (
448
+ values: Record<string, unknown>,
449
+ options?: QueryEncoderOptions,
450
+ ) => string;
431
451
 
432
452
  export function queryEncoder(f: QueryEncoder): BulkQueryEncoder {
433
- const bulkEncode = (values: Record<string, unknown>, options?: QueryEncoderOptions): string => {
453
+ const bulkEncode = function(
454
+ values: Record<string, unknown>,
455
+ options?: QueryEncoderOptions,
456
+ ): string {
434
457
  const opts: QueryEncoderOptions = {
435
458
  ...options,
436
459
  explode: options?.explode ?? true,
437
- charEncoding: options?.charEncoding ?? 'percent',
460
+ charEncoding: options?.charEncoding ?? "percent",
438
461
  };
439
462
 
440
463
  const encoded = Object.entries(values).map(([key, value]) => {
@@ -452,14 +475,22 @@ export const encodeSpaceDelimitedQuery = queryEncoder(encodeSpaceDelimited);
452
475
  export const encodePipeDelimitedQuery = queryEncoder(encodePipeDelimited);
453
476
  export const encodeDeepObjectQuery = queryEncoder(encodeDeepObject);
454
477
 
455
- export function appendForm(fd: FormData, key: string, value: unknown, fileName?: string): void {
478
+ export function appendForm(
479
+ fd: FormData,
480
+ key: string,
481
+ value: unknown,
482
+ fileName?: string,
483
+ ): void {
456
484
  if (value == null) {
457
485
  return;
458
- }
459
- if (value instanceof Blob && fileName) {
486
+ } else if (value instanceof Blob && fileName) {
460
487
  fd.append(key, value, fileName);
461
488
  } else if (value instanceof Blob) {
462
489
  fd.append(key, value);
490
+ } else if (Array.isArray(value)) {
491
+ value.forEach((v) => {
492
+ appendForm(fd, key, v);
493
+ });
463
494
  } else {
464
495
  fd.append(key, String(value));
465
496
  }
package/src/lib/env.ts CHANGED
@@ -1,19 +1,27 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 9e795945f7bf
3
4
  */
4
5
 
5
- import * as z from 'zod';
6
- import { dlv } from './dlv.js';
6
+ import { dlv } from "./dlv.js";
7
+
8
+ import * as z from "zod";
7
9
 
8
10
  export interface Env {
9
- INKEEPAGENTS_DEBUG?: boolean | undefined;
11
+ INKEEPAGENTSMANAGE_COOKIE_AUTH?: string | undefined;
12
+ INKEEPAGENTSMANAGE_BEARER_AUTH?: string | undefined;
13
+
14
+ INKEEPAGENTSMANAGE_DEBUG?: boolean | undefined;
10
15
  }
11
16
 
12
- export const envSchema: z.ZodType<Env, z.ZodTypeDef, unknown> = z.object({
13
- INKEEPAGENTS_DEBUG: z.coerce.boolean().optional(),
17
+ export const envSchema: z.ZodType<Env> = z.object({
18
+ INKEEPAGENTSMANAGE_COOKIE_AUTH: z.string().optional(),
19
+ INKEEPAGENTSMANAGE_BEARER_AUTH: z.string().optional(),
20
+
21
+ INKEEPAGENTSMANAGE_DEBUG: z.coerce.boolean().optional(),
14
22
  });
15
23
 
16
- let envMemo: Env | undefined;
24
+ let envMemo: Env | undefined = undefined;
17
25
  /**
18
26
  * Reads and validates environment variables.
19
27
  */
@@ -22,7 +30,9 @@ export function env(): Env {
22
30
  return envMemo;
23
31
  }
24
32
 
25
- envMemo = envSchema.parse(dlv(globalThis, 'process.env') ?? dlv(globalThis, 'Deno.env') ?? {});
33
+ envMemo = envSchema.parse(
34
+ dlv(globalThis, "process.env") ?? dlv(globalThis, "Deno.env") ?? {},
35
+ );
26
36
  return envMemo;
27
37
  }
28
38
 
package/src/lib/files.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 4f64b199f510
3
4
  */
4
5
 
5
6
  /**
@@ -9,7 +10,7 @@
9
10
  * request structure.
10
11
  */
11
12
  export async function readableStreamToArrayBuffer(
12
- readable: ReadableStream<Uint8Array>
13
+ readable: ReadableStream<Uint8Array>,
13
14
  ): Promise<ArrayBuffer> {
14
15
  const reader = readable.getReader();
15
16
  const chunks: Uint8Array[] = [];
@@ -46,36 +47,36 @@ export async function readableStreamToArrayBuffer(
46
47
  export function getContentTypeFromFileName(fileName: string): string | null {
47
48
  if (!fileName) return null;
48
49
 
49
- const ext = fileName.toLowerCase().split('.').pop();
50
+ const ext = fileName.toLowerCase().split(".").pop();
50
51
  if (!ext) return null;
51
52
 
52
53
  const mimeTypes: Record<string, string> = {
53
- json: 'application/json',
54
- xml: 'application/xml',
55
- html: 'text/html',
56
- htm: 'text/html',
57
- txt: 'text/plain',
58
- csv: 'text/csv',
59
- pdf: 'application/pdf',
60
- png: 'image/png',
61
- jpg: 'image/jpeg',
62
- jpeg: 'image/jpeg',
63
- gif: 'image/gif',
64
- svg: 'image/svg+xml',
65
- js: 'application/javascript',
66
- css: 'text/css',
67
- zip: 'application/zip',
68
- tar: 'application/x-tar',
69
- gz: 'application/gzip',
70
- mp4: 'video/mp4',
71
- mp3: 'audio/mpeg',
72
- wav: 'audio/wav',
73
- webp: 'image/webp',
74
- ico: 'image/x-icon',
75
- woff: 'font/woff',
76
- woff2: 'font/woff2',
77
- ttf: 'font/ttf',
78
- otf: 'font/otf',
54
+ json: "application/json",
55
+ xml: "application/xml",
56
+ html: "text/html",
57
+ htm: "text/html",
58
+ txt: "text/plain",
59
+ csv: "text/csv",
60
+ pdf: "application/pdf",
61
+ png: "image/png",
62
+ jpg: "image/jpeg",
63
+ jpeg: "image/jpeg",
64
+ gif: "image/gif",
65
+ svg: "image/svg+xml",
66
+ js: "application/javascript",
67
+ css: "text/css",
68
+ zip: "application/zip",
69
+ tar: "application/x-tar",
70
+ gz: "application/gzip",
71
+ mp4: "video/mp4",
72
+ mp3: "audio/mpeg",
73
+ wav: "audio/wav",
74
+ webp: "image/webp",
75
+ ico: "image/x-icon",
76
+ woff: "font/woff",
77
+ woff2: "font/woff2",
78
+ ttf: "font/ttf",
79
+ otf: "font/otf",
79
80
  };
80
81
 
81
82
  return mimeTypes[ext] || null;