agentstack-sdk 0.5.1-rc2 → 0.5.2-rc2

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 (274) hide show
  1. package/dist/api.cjs +2 -0
  2. package/dist/api.cjs.map +1 -0
  3. package/dist/api.d.ts +5 -0
  4. package/dist/api.js +2 -0
  5. package/dist/api.js.map +1 -0
  6. package/dist/api.umd.js +2 -0
  7. package/dist/api.umd.js.map +1 -0
  8. package/dist/client/a2a/extensions/{ui/oauth.d.ts → auth/oauth/index.d.ts} +3 -6
  9. package/dist/client/a2a/extensions/auth/oauth/schemas.d.ts +32 -0
  10. package/dist/client/a2a/extensions/auth/oauth/types.d.ts +13 -0
  11. package/dist/client/a2a/extensions/auth/secrets/index.d.ts +10 -0
  12. package/dist/client/a2a/extensions/auth/secrets/schemas.d.ts +23 -0
  13. package/dist/client/a2a/extensions/auth/secrets/types.d.ts +10 -0
  14. package/dist/client/a2a/extensions/common/{form.d.ts → form/schemas.d.ts} +87 -45
  15. package/dist/client/a2a/extensions/common/form/types.d.ts +23 -0
  16. package/dist/client/a2a/extensions/index.d.ts +20 -0
  17. package/dist/client/a2a/extensions/interactions/approval/index.d.ts +9 -0
  18. package/dist/client/a2a/extensions/interactions/{approval.d.ts → approval/schemas.d.ts} +0 -8
  19. package/dist/client/a2a/extensions/interactions/approval/types.d.ts +10 -0
  20. package/dist/client/a2a/extensions/schemas.d.ts +18 -0
  21. package/dist/client/a2a/extensions/services/embedding/index.d.ts +9 -0
  22. package/dist/client/a2a/extensions/services/{embedding.d.ts → embedding/schemas.d.ts} +12 -8
  23. package/dist/client/a2a/extensions/services/embedding/types.d.ts +10 -0
  24. package/dist/client/a2a/extensions/services/form/index.d.ts +9 -0
  25. package/dist/client/a2a/extensions/services/{form.d.ts → form/schemas.d.ts} +2 -8
  26. package/dist/client/a2a/extensions/services/form/types.d.ts +8 -0
  27. package/dist/client/a2a/extensions/services/llm/index.d.ts +9 -0
  28. package/dist/client/a2a/extensions/services/{llm.d.ts → llm/schemas.d.ts} +12 -8
  29. package/dist/client/a2a/extensions/services/llm/types.d.ts +10 -0
  30. package/dist/client/a2a/extensions/services/mcp/index.d.ts +9 -0
  31. package/dist/client/a2a/extensions/services/mcp/schemas.d.ts +35 -0
  32. package/dist/client/a2a/extensions/services/mcp/types.d.ts +14 -0
  33. package/dist/client/a2a/extensions/services/{platform.d.ts → platform-api/index.d.ts} +1 -1
  34. package/dist/client/a2a/extensions/services/platform-api/schemas.d.ts +10 -0
  35. package/dist/client/a2a/extensions/services/platform-api/types.d.ts +7 -0
  36. package/dist/client/a2a/extensions/types.d.ts +14 -12
  37. package/dist/client/a2a/extensions/ui/agent-detail/index.d.ts +9 -0
  38. package/dist/client/a2a/extensions/ui/{agent-detail.d.ts → agent-detail/schemas.d.ts} +9 -17
  39. package/dist/client/a2a/extensions/ui/agent-detail/types.d.ts +13 -0
  40. package/dist/client/a2a/extensions/ui/canvas/index.d.ts +9 -0
  41. package/dist/client/a2a/extensions/ui/canvas/schemas.d.ts +11 -0
  42. package/dist/client/a2a/extensions/ui/canvas/types.d.ts +7 -0
  43. package/dist/client/a2a/extensions/ui/citation/index.d.ts +9 -0
  44. package/dist/client/a2a/extensions/ui/{citation.d.ts → citation/schemas.d.ts} +2 -8
  45. package/dist/client/a2a/extensions/ui/citation/types.d.ts +8 -0
  46. package/dist/client/a2a/extensions/ui/error/index.d.ts +9 -0
  47. package/dist/client/a2a/extensions/ui/{error.d.ts → error/schemas.d.ts} +12 -6
  48. package/dist/client/a2a/extensions/ui/error/types.d.ts +9 -0
  49. package/dist/client/a2a/extensions/ui/form-request/index.d.ts +9 -0
  50. package/dist/client/a2a/extensions/ui/settings/index.d.ts +9 -0
  51. package/dist/client/a2a/extensions/ui/{settings.d.ts → settings/schemas.d.ts} +46 -43
  52. package/dist/client/a2a/extensions/ui/settings/types.d.ts +18 -0
  53. package/dist/client/a2a/extensions/ui/trajectory/index.d.ts +9 -0
  54. package/dist/client/a2a/extensions/ui/trajectory/schemas.d.ts +10 -0
  55. package/dist/client/a2a/extensions/ui/trajectory/types.d.ts +7 -0
  56. package/dist/client/a2a/index.d.ts +6 -0
  57. package/dist/client/a2a/protocol/index.d.ts +6 -0
  58. package/dist/client/a2a/protocol/schemas.d.ts +988 -0
  59. package/dist/client/a2a/protocol/tests.d.ts +5 -0
  60. package/dist/client/a2a/protocol/types.d.ts +52 -0
  61. package/dist/client/a2a/protocol/utils.d.ts +6 -0
  62. package/dist/client/api/common/schemas.d.ts +30 -0
  63. package/dist/client/api/common/types.d.ts +18 -0
  64. package/dist/client/api/configuration/api.d.ts +22 -0
  65. package/dist/client/api/configuration/schemas.d.ts +31 -0
  66. package/dist/client/api/configuration/types.d.ts +11 -0
  67. package/dist/client/api/connectors/api.d.ts +78 -0
  68. package/dist/client/api/connectors/schemas.d.ts +114 -0
  69. package/dist/client/api/connectors/types.d.ts +28 -0
  70. package/dist/client/api/contexts/api.d.ts +133 -0
  71. package/dist/client/api/contexts/schemas.d.ts +359 -0
  72. package/dist/client/api/contexts/types.d.ts +34 -0
  73. package/dist/client/api/core/client.d.ts +1273 -0
  74. package/dist/client/api/core/errors/index.d.ts +6 -0
  75. package/dist/client/api/core/errors/types.d.ts +36 -0
  76. package/dist/client/api/core/errors/utils.d.ts +23 -0
  77. package/dist/client/api/core/index.d.ts +7 -0
  78. package/dist/client/api/core/schemas.d.ts +17 -0
  79. package/dist/client/api/core/types.d.ts +45 -0
  80. package/dist/client/api/core/utils.d.ts +23 -0
  81. package/dist/client/api/files/api.d.ts +32 -0
  82. package/dist/client/api/files/schemas.d.ts +61 -0
  83. package/dist/client/api/files/types.d.ts +19 -0
  84. package/dist/client/api/index.d.ts +7 -0
  85. package/dist/client/api/model-providers/api.d.ts +50 -0
  86. package/dist/client/api/model-providers/schemas.d.ts +80 -0
  87. package/dist/client/api/model-providers/types.d.ts +44 -0
  88. package/dist/client/api/provider-builds/api.d.ts +143 -0
  89. package/dist/client/api/provider-builds/schemas.d.ts +250 -0
  90. package/dist/client/api/provider-builds/types.d.ts +31 -0
  91. package/dist/client/api/providers/api.d.ts +847 -0
  92. package/dist/client/api/providers/schemas.d.ts +1335 -0
  93. package/dist/client/api/providers/types.d.ts +45 -0
  94. package/dist/client/api/schemas.d.ts +15 -0
  95. package/dist/client/api/types.d.ts +11 -97
  96. package/dist/client/api/user-feedback/api.d.ts +9 -0
  97. package/dist/client/api/user-feedback/schemas.d.ts +15 -0
  98. package/dist/client/api/user-feedback/types.d.ts +8 -0
  99. package/dist/client/api/users/api.d.ts +13 -0
  100. package/dist/client/api/users/schemas.d.ts +20 -0
  101. package/dist/client/api/users/types.d.ts +14 -0
  102. package/dist/client/api/variables/api.d.ts +12 -0
  103. package/dist/client/api/variables/schemas.d.ts +13 -0
  104. package/dist/client/api/variables/types.d.ts +10 -0
  105. package/dist/client/{a2a/extensions/utils.d.ts → core/extensions/extract.d.ts} +2 -5
  106. package/dist/client/core/extensions/fulfill.d.ts +8 -0
  107. package/dist/client/core/extensions/resolve-user-metadata.d.ts +6 -0
  108. package/dist/client/core/extensions/types.d.ts +67 -0
  109. package/dist/client/core/fulfillment-resolvers/build-llm-extension-fulfillment-resolver.d.ts +8 -0
  110. package/dist/client/{a2a/extensions → core}/handle-agent-card.d.ts +3 -24
  111. package/dist/client/core/handle-task-status-update.d.ts +7 -0
  112. package/dist/client/core/index.d.ts +13 -0
  113. package/dist/client/{a2a/extensions → core}/utils/build-message-builder.d.ts +2 -2
  114. package/dist/core.cjs +2 -0
  115. package/dist/core.cjs.map +1 -0
  116. package/dist/core.d.ts +5 -0
  117. package/dist/core.js +2 -0
  118. package/dist/core.js.map +1 -0
  119. package/dist/core.umd.js +2 -0
  120. package/dist/core.umd.js.map +1 -0
  121. package/dist/extensions.cjs +2 -0
  122. package/dist/extensions.cjs.map +1 -0
  123. package/dist/extensions.d.ts +5 -0
  124. package/dist/extensions.js +2 -0
  125. package/dist/extensions.js.map +1 -0
  126. package/dist/extensions.umd.js +2 -0
  127. package/dist/extensions.umd.js.map +1 -0
  128. package/dist/index.cjs +1 -1
  129. package/dist/index.cjs.map +1 -1
  130. package/dist/index.d.ts +3 -26
  131. package/dist/index.js +1 -1
  132. package/dist/index.js.map +1 -1
  133. package/dist/index.umd.js +1 -1
  134. package/dist/index.umd.js.map +1 -1
  135. package/package.json +36 -8
  136. package/src/api.ts +6 -0
  137. package/src/client/a2a/extensions/auth/oauth/index.ts +23 -0
  138. package/src/client/a2a/extensions/auth/oauth/schemas.ts +34 -0
  139. package/src/client/a2a/extensions/auth/oauth/types.ts +27 -0
  140. package/src/client/a2a/extensions/auth/secrets/index.ts +23 -0
  141. package/src/client/a2a/extensions/auth/secrets/schemas.ts +23 -0
  142. package/src/client/a2a/extensions/auth/secrets/types.ts +19 -0
  143. package/src/client/a2a/extensions/common/{form.ts → form/schemas.ts} +62 -73
  144. package/src/client/a2a/extensions/common/form/types.ts +48 -0
  145. package/src/client/a2a/extensions/index.ts +21 -0
  146. package/src/client/a2a/extensions/interactions/approval/index.ts +17 -0
  147. package/src/client/a2a/extensions/interactions/{approval.ts → approval/schemas.ts} +0 -13
  148. package/src/client/a2a/extensions/interactions/approval/types.ts +19 -0
  149. package/src/client/a2a/extensions/schemas.ts +19 -0
  150. package/src/client/a2a/extensions/services/embedding/index.ts +16 -0
  151. package/src/client/a2a/extensions/services/embedding/schemas.ts +26 -0
  152. package/src/client/a2a/extensions/services/embedding/types.ts +19 -0
  153. package/src/client/a2a/extensions/services/form/index.ts +16 -0
  154. package/src/client/a2a/extensions/services/form/schemas.ts +20 -0
  155. package/src/client/a2a/extensions/services/form/types.ts +12 -0
  156. package/src/client/a2a/extensions/services/llm/index.ts +16 -0
  157. package/src/client/a2a/extensions/services/llm/schemas.ts +26 -0
  158. package/src/client/a2a/extensions/services/llm/types.ts +14 -0
  159. package/src/client/a2a/extensions/services/mcp/index.ts +16 -0
  160. package/src/client/a2a/extensions/services/mcp/schemas.ts +32 -0
  161. package/src/client/a2a/extensions/services/mcp/types.ts +19 -0
  162. package/src/client/a2a/extensions/services/{platform.ts → platform-api/index.ts} +5 -9
  163. package/src/client/a2a/extensions/services/platform-api/schemas.ts +12 -0
  164. package/src/client/a2a/extensions/services/platform-api/types.ts +10 -0
  165. package/src/client/a2a/extensions/types.ts +14 -15
  166. package/src/client/a2a/extensions/ui/agent-detail/index.ts +17 -0
  167. package/src/client/a2a/extensions/ui/agent-detail/schemas.ts +36 -0
  168. package/src/client/a2a/extensions/ui/agent-detail/types.ts +19 -0
  169. package/src/client/a2a/extensions/ui/canvas/index.ts +17 -0
  170. package/src/client/a2a/extensions/ui/canvas/schemas.ts +13 -0
  171. package/src/client/a2a/extensions/ui/canvas/types.ts +10 -0
  172. package/src/client/a2a/extensions/ui/citation/index.ts +17 -0
  173. package/src/client/a2a/extensions/ui/citation/schemas.ts +18 -0
  174. package/src/client/a2a/extensions/ui/citation/types.ts +12 -0
  175. package/src/client/a2a/extensions/ui/error/index.ts +17 -0
  176. package/src/client/a2a/extensions/ui/error/schemas.ts +22 -0
  177. package/src/client/a2a/extensions/ui/error/types.ts +14 -0
  178. package/src/client/a2a/extensions/ui/{form-request.ts → form-request/index.ts} +5 -6
  179. package/src/client/a2a/extensions/ui/settings/index.ts +16 -0
  180. package/src/client/a2a/extensions/ui/settings/schemas.ts +65 -0
  181. package/src/client/a2a/extensions/ui/settings/types.ts +38 -0
  182. package/src/client/a2a/extensions/ui/{trajectory.ts → trajectory/index.ts} +4 -10
  183. package/src/client/a2a/extensions/ui/trajectory/schemas.ts +12 -0
  184. package/src/client/a2a/extensions/ui/trajectory/types.ts +10 -0
  185. package/src/client/a2a/index.ts +7 -0
  186. package/src/client/a2a/protocol/index.ts +7 -0
  187. package/src/client/a2a/protocol/schemas.ts +413 -0
  188. package/src/client/a2a/protocol/tests.ts +172 -0
  189. package/src/client/a2a/protocol/types.ts +127 -0
  190. package/src/client/a2a/protocol/utils.ts +39 -0
  191. package/src/client/api/common/schemas.ts +45 -0
  192. package/src/client/api/common/types.ts +34 -0
  193. package/src/client/api/configuration/api.ts +31 -0
  194. package/src/client/api/configuration/schemas.ts +25 -0
  195. package/src/client/api/configuration/types.ts +22 -0
  196. package/src/client/api/connectors/api.ts +86 -0
  197. package/src/client/api/connectors/schemas.ts +77 -0
  198. package/src/client/api/connectors/types.ts +57 -0
  199. package/src/client/api/contexts/api.ts +113 -0
  200. package/src/client/api/contexts/schemas.ts +156 -0
  201. package/src/client/api/contexts/types.ts +74 -0
  202. package/src/client/api/core/client.ts +155 -0
  203. package/src/client/api/core/errors/index.ts +7 -0
  204. package/src/client/api/core/errors/types.ts +45 -0
  205. package/src/client/api/core/errors/utils.ts +63 -0
  206. package/src/client/api/core/index.ts +8 -0
  207. package/src/client/api/core/schemas.ts +20 -0
  208. package/src/client/api/core/types.ts +57 -0
  209. package/src/client/api/core/utils.ts +100 -0
  210. package/src/client/api/files/api.ts +65 -0
  211. package/src/client/api/files/schemas.ts +56 -0
  212. package/src/client/api/files/types.ts +37 -0
  213. package/src/client/api/index.ts +8 -0
  214. package/src/client/api/model-providers/api.ts +67 -0
  215. package/src/client/api/model-providers/schemas.ts +68 -0
  216. package/src/client/api/model-providers/types.ts +66 -0
  217. package/src/client/api/provider-builds/api.ts +80 -0
  218. package/src/client/api/provider-builds/schemas.ts +98 -0
  219. package/src/client/api/provider-builds/types.ts +61 -0
  220. package/src/client/api/providers/api.ts +122 -0
  221. package/src/client/api/providers/schemas.ts +140 -0
  222. package/src/client/api/providers/types.ts +87 -0
  223. package/src/client/api/schemas.ts +16 -0
  224. package/src/client/api/types.ts +11 -130
  225. package/src/client/api/user-feedback/api.ts +23 -0
  226. package/src/client/api/user-feedback/schemas.ts +18 -0
  227. package/src/client/api/user-feedback/types.ts +11 -0
  228. package/src/client/api/users/api.ts +21 -0
  229. package/src/client/api/users/schemas.ts +21 -0
  230. package/src/client/api/users/types.ts +19 -0
  231. package/src/client/api/variables/api.ts +31 -0
  232. package/src/client/api/variables/schemas.ts +18 -0
  233. package/src/client/api/variables/types.ts +19 -0
  234. package/src/client/{a2a/extensions/utils.ts → core/extensions/extract.ts} +2 -21
  235. package/src/client/core/extensions/fulfill.ts +24 -0
  236. package/src/client/core/extensions/resolve-user-metadata.ts +25 -0
  237. package/src/client/core/extensions/types.ts +84 -0
  238. package/src/client/{a2a/extensions → core}/fulfillment-resolvers/build-llm-extension-fulfillment-resolver.ts +14 -10
  239. package/src/client/{a2a/extensions → core}/handle-agent-card.ts +14 -37
  240. package/src/client/core/handle-task-status-update.ts +60 -0
  241. package/src/client/core/index.ts +14 -0
  242. package/src/client/{a2a/extensions → core}/utils/build-message-builder.ts +2 -3
  243. package/src/core.ts +6 -0
  244. package/src/extensions.ts +6 -0
  245. package/src/index.ts +3 -30
  246. package/dist/client/a2a/extensions/fulfillment-resolvers/build-llm-extension-fulfillment-resolver.d.ts +0 -8
  247. package/dist/client/a2a/extensions/handle-task-status-update.d.ts +0 -32
  248. package/dist/client/a2a/extensions/resolve-user-metadata.d.ts +0 -11
  249. package/dist/client/a2a/extensions/services/mcp.d.ts +0 -46
  250. package/dist/client/a2a/extensions/services/oauth-provider.d.ts +0 -30
  251. package/dist/client/a2a/extensions/services/secrets.d.ts +0 -28
  252. package/dist/client/a2a/extensions/ui/canvas.d.ts +0 -16
  253. package/dist/client/a2a/extensions/ui/form-request.d.ts +0 -11
  254. package/dist/client/a2a/extensions/ui/trajectory.d.ts +0 -15
  255. package/dist/client/api/build-api-client.d.ts +0 -62
  256. package/dist/types.d.ts +0 -10
  257. package/src/client/a2a/extensions/handle-task-status-update.ts +0 -95
  258. package/src/client/a2a/extensions/resolve-user-metadata.ts +0 -30
  259. package/src/client/a2a/extensions/services/embedding.ts +0 -43
  260. package/src/client/a2a/extensions/services/form.ts +0 -31
  261. package/src/client/a2a/extensions/services/llm.ts +0 -39
  262. package/src/client/a2a/extensions/services/mcp.ts +0 -59
  263. package/src/client/a2a/extensions/services/oauth-provider.ts +0 -52
  264. package/src/client/a2a/extensions/services/secrets.ts +0 -46
  265. package/src/client/a2a/extensions/ui/agent-detail.ts +0 -46
  266. package/src/client/a2a/extensions/ui/canvas.ts +0 -24
  267. package/src/client/a2a/extensions/ui/citation.ts +0 -30
  268. package/src/client/a2a/extensions/ui/error.ts +0 -33
  269. package/src/client/a2a/extensions/ui/oauth.ts +0 -21
  270. package/src/client/a2a/extensions/ui/settings.ts +0 -84
  271. package/src/client/api/build-api-client.ts +0 -125
  272. package/src/types.ts +0 -9
  273. /package/dist/client/{a2a → core}/create-authenticated-fetch.d.ts +0 -0
  274. /package/src/client/{a2a → core}/create-authenticated-fetch.ts +0 -0
@@ -0,0 +1,127 @@
1
+ /**
2
+ * Copyright 2025 © BeeAI a Series of LF Projects, LLC
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ import type z from 'zod';
7
+
8
+ import type {
9
+ agentCapabilitiesSchema,
10
+ agentCardSchema,
11
+ agentCardSignatureSchema,
12
+ agentExtensionSchema,
13
+ agentInterfaceSchema,
14
+ agentProviderSchema,
15
+ agentSkillSchema,
16
+ apiKeySecuritySchemeSchema,
17
+ artifactSchema,
18
+ authenticatedExtendedCardNotConfiguredErrorSchema,
19
+ authorizationCodeOAuthFlowSchema,
20
+ clientCredentialsOAuthFlowSchema,
21
+ contentTypeNotSupportedErrorSchema,
22
+ dataPartSchema,
23
+ filePartSchema,
24
+ fileWithBytesSchema,
25
+ fileWithUriSchema,
26
+ getTaskResponseSchema,
27
+ getTaskSuccessResponseSchema,
28
+ httpAuthSecuritySchemeSchema,
29
+ implicitOAuthFlowSchema,
30
+ internalErrorSchema,
31
+ invalidAgentResponseErrorSchema,
32
+ invalidParamsErrorSchema,
33
+ invalidRequestErrorSchema,
34
+ jsonParseErrorSchema,
35
+ jsonRpcErrorResponseSchema,
36
+ jsonRpcErrorSchema,
37
+ messageSchema,
38
+ methodNotFoundErrorSchema,
39
+ mutualTlsSecuritySchemeSchema,
40
+ oauth2SecuritySchemeSchema,
41
+ oauthFlowsSchema,
42
+ openIdConnectSecuritySchemeSchema,
43
+ partSchema,
44
+ passwordOAuthFlowSchema,
45
+ pushNotificationNotSupportedErrorSchema,
46
+ securitySchemeSchema,
47
+ taskArtifactUpdateEventSchema,
48
+ taskNotCancelableErrorSchema,
49
+ taskNotFoundErrorSchema,
50
+ taskSchema,
51
+ taskStatusSchema,
52
+ taskStatusUpdateEventSchema,
53
+ textPartSchema,
54
+ unsupportedOperationErrorSchema,
55
+ } from './schemas';
56
+
57
+ export type AgentInterface = z.infer<typeof agentInterfaceSchema>;
58
+
59
+ export type AgentExtension = z.infer<typeof agentExtensionSchema>;
60
+
61
+ export type AgentCapabilities = z.infer<typeof agentCapabilitiesSchema>;
62
+
63
+ export type AgentProvider = z.infer<typeof agentProviderSchema>;
64
+
65
+ export type AgentCardSignature = z.infer<typeof agentCardSignatureSchema>;
66
+
67
+ export type AgentSkill = z.infer<typeof agentSkillSchema>;
68
+
69
+ export type AuthorizationCodeOAuthFlow = z.infer<typeof authorizationCodeOAuthFlowSchema>;
70
+ export type ClientCredentialsOAuthFlow = z.infer<typeof clientCredentialsOAuthFlowSchema>;
71
+ export type ImplicitOAuthFlow = z.infer<typeof implicitOAuthFlowSchema>;
72
+ export type PasswordOAuthFlow = z.infer<typeof passwordOAuthFlowSchema>;
73
+
74
+ export type OAuthFlows = z.infer<typeof oauthFlowsSchema>;
75
+
76
+ export type APIKeySecurityScheme = z.infer<typeof apiKeySecuritySchemeSchema>;
77
+ export type HTTPAuthSecurityScheme = z.infer<typeof httpAuthSecuritySchemeSchema>;
78
+ export type OAuth2SecurityScheme = z.infer<typeof oauth2SecuritySchemeSchema>;
79
+ export type OpenIdConnectSecurityScheme = z.infer<typeof openIdConnectSecuritySchemeSchema>;
80
+ export type MutualTLSSecurityScheme = z.infer<typeof mutualTlsSecuritySchemeSchema>;
81
+
82
+ export type SecurityScheme = z.infer<typeof securitySchemeSchema>;
83
+
84
+ export type AgentCard = z.infer<typeof agentCardSchema>;
85
+
86
+ export type FileWithBytes = z.infer<typeof fileWithBytesSchema>;
87
+ export type FileWithUri = z.infer<typeof fileWithUriSchema>;
88
+
89
+ export type TextPart = z.infer<typeof textPartSchema>;
90
+ export type FilePart = z.infer<typeof filePartSchema>;
91
+ export type DataPart = z.infer<typeof dataPartSchema>;
92
+
93
+ export type Part = z.infer<typeof partSchema>;
94
+
95
+ export type Artifact = z.infer<typeof artifactSchema>;
96
+
97
+ export type Message = z.infer<typeof messageSchema>;
98
+
99
+ export type TaskStatus = z.infer<typeof taskStatusSchema>;
100
+
101
+ export type TaskStatusUpdateEvent = z.infer<typeof taskStatusUpdateEventSchema>;
102
+
103
+ export type Task = z.infer<typeof taskSchema>;
104
+
105
+ export type TaskArtifactUpdateEvent = z.infer<typeof taskArtifactUpdateEventSchema>;
106
+
107
+ export type JSONRPCError = z.infer<typeof jsonRpcErrorSchema>;
108
+ export type JSONParseError = z.infer<typeof jsonParseErrorSchema>;
109
+ export type InvalidRequestError = z.infer<typeof invalidRequestErrorSchema>;
110
+ export type MethodNotFoundError = z.infer<typeof methodNotFoundErrorSchema>;
111
+ export type InvalidParamsError = z.infer<typeof invalidParamsErrorSchema>;
112
+ export type InternalError = z.infer<typeof internalErrorSchema>;
113
+ export type TaskNotFoundError = z.infer<typeof taskNotFoundErrorSchema>;
114
+ export type TaskNotCancelableError = z.infer<typeof taskNotCancelableErrorSchema>;
115
+ export type PushNotificationNotSupportedError = z.infer<typeof pushNotificationNotSupportedErrorSchema>;
116
+ export type UnsupportedOperationError = z.infer<typeof unsupportedOperationErrorSchema>;
117
+ export type ContentTypeNotSupportedError = z.infer<typeof contentTypeNotSupportedErrorSchema>;
118
+ export type InvalidAgentResponseError = z.infer<typeof invalidAgentResponseErrorSchema>;
119
+ export type AuthenticatedExtendedCardNotConfiguredError = z.infer<
120
+ typeof authenticatedExtendedCardNotConfiguredErrorSchema
121
+ >;
122
+
123
+ export type JSONRPCErrorResponse = z.infer<typeof jsonRpcErrorResponseSchema>;
124
+
125
+ export type GetTaskSuccessResponse = z.infer<typeof getTaskSuccessResponseSchema>;
126
+
127
+ export type GetTaskResponse = z.infer<typeof getTaskResponseSchema>;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Copyright 2025 © BeeAI a Series of LF Projects, LLC
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ import z from 'zod';
7
+
8
+ export function a2aSchema<T extends z.ZodType>(schema: T) {
9
+ return z.preprocess((value) => normalizeOptionalNulls(schema, value), schema);
10
+ }
11
+
12
+ // Only handles ZodOptional and ZodObject here.
13
+ // ZodArray/ZodUnion/ZodRecord aren't traversed and are normalized via their nested a2aSchema types (e.g., z.array(a2aSchema(...)).
14
+ function normalizeOptionalNulls(schema: z.core.$ZodType, data: unknown): unknown {
15
+ if (schema instanceof z.ZodOptional) {
16
+ if (data === null) {
17
+ return undefined;
18
+ }
19
+
20
+ return normalizeOptionalNulls(schema.unwrap(), data);
21
+ }
22
+
23
+ if (schema instanceof z.ZodObject) {
24
+ if (data === null || typeof data !== 'object' || Array.isArray(data)) {
25
+ return data;
26
+ }
27
+
28
+ const { shape } = schema;
29
+ const record = data as Record<string, unknown>;
30
+
31
+ return Object.keys(record).reduce<Record<string, unknown>>((acc, key) => {
32
+ acc[key] = key in shape ? normalizeOptionalNulls(shape[key], record[key]) : record[key];
33
+
34
+ return acc;
35
+ }, {});
36
+ }
37
+
38
+ return data;
39
+ }
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Copyright 2025 © BeeAI a Series of LF Projects, LLC
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ import z from 'zod';
7
+
8
+ import { GitHubVersionType } from './types';
9
+
10
+ export const gitHubVersionTypeSchema = z.enum(GitHubVersionType);
11
+
12
+ export const gitHubRegistryLocationSchema = z.string();
13
+
14
+ export const networkRegistryLocationSchema = z.string();
15
+
16
+ export const fileSystemRegistryLocationSchema = z.string();
17
+
18
+ export const dockerImageIdSchema = z.string();
19
+
20
+ export const dockerImageProviderLocationSchema = dockerImageIdSchema;
21
+
22
+ export const networkProviderLocationSchema = z.string();
23
+
24
+ export const resolvedGitHubUrlSchema = z.object({
25
+ host: z.string(),
26
+ org: z.string(),
27
+ repo: z.string(),
28
+ version: z.string(),
29
+ version_type: gitHubVersionTypeSchema,
30
+ commit_hash: z.string(),
31
+ path: z.string().nullish(),
32
+ });
33
+
34
+ export const resolvedDockerImageIdSchema = z.object({
35
+ registry: z.string(),
36
+ repository: z.string(),
37
+ tag: z.string(),
38
+ digest: z.string(),
39
+ image_id: dockerImageIdSchema,
40
+ });
41
+
42
+ export const readableStreamSchema = z.custom<ReadableStream<Uint8Array<ArrayBuffer>>>(
43
+ (value) => value instanceof ReadableStream,
44
+ { error: 'Expected ReadableStream' },
45
+ );
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Copyright 2025 © BeeAI a Series of LF Projects, LLC
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ import type z from 'zod';
7
+
8
+ import type {
9
+ dockerImageIdSchema,
10
+ dockerImageProviderLocationSchema,
11
+ fileSystemRegistryLocationSchema,
12
+ gitHubRegistryLocationSchema,
13
+ networkProviderLocationSchema,
14
+ networkRegistryLocationSchema,
15
+ resolvedDockerImageIdSchema,
16
+ resolvedGitHubUrlSchema,
17
+ } from './schemas';
18
+
19
+ export enum GitHubVersionType {
20
+ Head = 'head',
21
+ Tag = 'tag',
22
+ }
23
+
24
+ export type GitHubRegistryLocation = z.infer<typeof gitHubRegistryLocationSchema>;
25
+ export type NetworkRegistryLocation = z.infer<typeof networkRegistryLocationSchema>;
26
+ export type FileSystemRegistryLocation = z.infer<typeof fileSystemRegistryLocationSchema>;
27
+
28
+ export type DockerImageId = z.infer<typeof dockerImageIdSchema>;
29
+
30
+ export type DockerImageProviderLocation = z.infer<typeof dockerImageProviderLocationSchema>;
31
+ export type NetworkProviderLocation = z.infer<typeof networkProviderLocationSchema>;
32
+
33
+ export type ResolvedGitHubUrl = z.infer<typeof resolvedGitHubUrlSchema>;
34
+ export type ResolvedDockerImageId = z.infer<typeof resolvedDockerImageIdSchema>;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Copyright 2025 © BeeAI a Series of LF Projects, LLC
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ import type { CallApi } from '../core/types';
7
+ import { ApiMethod } from '../core/types';
8
+ import { readSystemConfigurationResponseSchema, updateSystemConfigurationResponseSchema } from './schemas';
9
+ import type { UpdateSystemConfigurationRequest } from './types';
10
+
11
+ export function createConfigurationApi(callApi: CallApi) {
12
+ const readSystemConfiguration = () =>
13
+ callApi({
14
+ method: ApiMethod.Get,
15
+ path: '/api/v1/configurations/system',
16
+ schema: readSystemConfigurationResponseSchema,
17
+ });
18
+
19
+ const updateSystemConfiguration = ({ ...body }: UpdateSystemConfigurationRequest) =>
20
+ callApi({
21
+ method: ApiMethod.Put,
22
+ path: '/api/v1/configurations/system',
23
+ schema: updateSystemConfigurationResponseSchema,
24
+ body,
25
+ });
26
+
27
+ return {
28
+ readSystemConfiguration,
29
+ updateSystemConfiguration,
30
+ };
31
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright 2025 © BeeAI a Series of LF Projects, LLC
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ import z from 'zod';
7
+
8
+ export const systemConfigurationSchema = z.object({
9
+ id: z.string(),
10
+ created_by: z.string(),
11
+ updated_at: z.string(),
12
+ default_embedding_model: z.string().nullish(),
13
+ default_llm_model: z.string().nullish(),
14
+ });
15
+
16
+ export const readSystemConfigurationRequestSchema = z.never();
17
+
18
+ export const readSystemConfigurationResponseSchema = systemConfigurationSchema;
19
+
20
+ export const updateSystemConfigurationRequestSchema = z.object({
21
+ default_embedding_model: z.string().nullish(),
22
+ default_llm_model: z.string().nullish(),
23
+ });
24
+
25
+ export const updateSystemConfigurationResponseSchema = systemConfigurationSchema;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright 2025 © BeeAI a Series of LF Projects, LLC
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ import type z from 'zod';
7
+
8
+ import type {
9
+ readSystemConfigurationRequestSchema,
10
+ readSystemConfigurationResponseSchema,
11
+ systemConfigurationSchema,
12
+ updateSystemConfigurationRequestSchema,
13
+ updateSystemConfigurationResponseSchema,
14
+ } from './schemas';
15
+
16
+ export type SystemConfiguration = z.infer<typeof systemConfigurationSchema>;
17
+
18
+ export type ReadSystemConfigurationRequest = z.infer<typeof readSystemConfigurationRequestSchema>;
19
+ export type ReadSystemConfigurationResponse = z.infer<typeof readSystemConfigurationResponseSchema>;
20
+
21
+ export type UpdateSystemConfigurationRequest = z.infer<typeof updateSystemConfigurationRequestSchema>;
22
+ export type UpdateSystemConfigurationResponse = z.infer<typeof updateSystemConfigurationResponseSchema>;
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Copyright 2025 © BeeAI a Series of LF Projects, LLC
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ import type { CallApi } from '../core/types';
7
+ import { ApiMethod } from '../core/types';
8
+ import {
9
+ connectConnectorResponseSchema,
10
+ createConnectorResponseSchema,
11
+ deleteConnectorResponseSchema,
12
+ disconnectConnectorResponseSchema,
13
+ listConnectorPresetsResponseSchema,
14
+ listConnectorsResponseSchema,
15
+ readConnectorResponseSchema,
16
+ } from './schemas';
17
+ import type {
18
+ ConnectConnectorRequest,
19
+ CreateConnectorRequest,
20
+ DeleteConnectorRequest,
21
+ DisconnectConnectorRequest,
22
+ ReadConnectorRequest,
23
+ } from './types';
24
+
25
+ export function createConnectorsApi(callApi: CallApi) {
26
+ const listConnectors = () =>
27
+ callApi({
28
+ method: ApiMethod.Get,
29
+ path: '/api/v1/connectors',
30
+ schema: listConnectorsResponseSchema,
31
+ });
32
+
33
+ const createConnector = ({ ...body }: CreateConnectorRequest) =>
34
+ callApi({
35
+ method: ApiMethod.Post,
36
+ path: '/api/v1/connectors',
37
+ schema: createConnectorResponseSchema,
38
+ body,
39
+ });
40
+
41
+ const readConnector = ({ connector_id }: ReadConnectorRequest) =>
42
+ callApi({
43
+ method: ApiMethod.Get,
44
+ path: `/api/v1/connectors/${connector_id}`,
45
+ schema: readConnectorResponseSchema,
46
+ });
47
+
48
+ const deleteConnector = ({ connector_id }: DeleteConnectorRequest) =>
49
+ callApi({
50
+ method: ApiMethod.Delete,
51
+ path: `/api/v1/connectors/${connector_id}`,
52
+ schema: deleteConnectorResponseSchema,
53
+ });
54
+
55
+ const connectConnector = ({ connector_id, ...body }: ConnectConnectorRequest) =>
56
+ callApi({
57
+ method: ApiMethod.Post,
58
+ path: `/api/v1/connectors/${connector_id}/connect`,
59
+ schema: connectConnectorResponseSchema,
60
+ body,
61
+ });
62
+
63
+ const disconnectConnector = ({ connector_id }: DisconnectConnectorRequest) =>
64
+ callApi({
65
+ method: ApiMethod.Post,
66
+ path: `/api/v1/connectors/${connector_id}/disconnect`,
67
+ schema: disconnectConnectorResponseSchema,
68
+ });
69
+
70
+ const listConnectorPresets = () =>
71
+ callApi({
72
+ method: ApiMethod.Get,
73
+ path: '/api/v1/connectors/presets',
74
+ schema: listConnectorPresetsResponseSchema,
75
+ });
76
+
77
+ return {
78
+ listConnectors,
79
+ createConnector,
80
+ readConnector,
81
+ deleteConnector,
82
+ connectConnector,
83
+ disconnectConnector,
84
+ listConnectorPresets,
85
+ };
86
+ }
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Copyright 2025 © BeeAI a Series of LF Projects, LLC
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ import z from 'zod';
7
+
8
+ import { paginatedResponseSchema } from '../core/schemas';
9
+ import { ConnectorState } from './types';
10
+
11
+ export const connectorStateSchema = z.enum(ConnectorState);
12
+
13
+ export const connectorSchema = z.object({
14
+ id: z.string(),
15
+ url: z.string(),
16
+ state: connectorStateSchema,
17
+ auth_request: z
18
+ .object({
19
+ type: z.literal('code'),
20
+ authorization_endpoint: z.string(),
21
+ })
22
+ .nullable(),
23
+ disconnect_reason: z.string().nullable(),
24
+ metadata: z.record(z.string(), z.string()).nullable(),
25
+ });
26
+
27
+ export const listConnectorsRequestSchema = z.never();
28
+
29
+ export const listConnectorsResponseSchema = paginatedResponseSchema.extend({
30
+ items: z.array(connectorSchema),
31
+ });
32
+
33
+ export const createConnectorRequestSchema = z.object({
34
+ match_preset: z.boolean(),
35
+ url: z.string(),
36
+ client_id: z.string().nullish(),
37
+ client_secret: z.string().nullish(),
38
+ metadata: z.record(z.string(), z.string()).nullish(),
39
+ });
40
+
41
+ export const createConnectorResponseSchema = connectorSchema;
42
+
43
+ export const readConnectorRequestSchema = z.object({
44
+ connector_id: z.string(),
45
+ });
46
+
47
+ export const readConnectorResponseSchema = connectorSchema;
48
+
49
+ export const deleteConnectorRequestSchema = z.object({
50
+ connector_id: z.string(),
51
+ });
52
+
53
+ export const deleteConnectorResponseSchema = z.null();
54
+
55
+ export const connectConnectorRequestSchema = z.object({
56
+ connector_id: z.string(),
57
+ redirect_url: z.string().nullish(),
58
+ });
59
+
60
+ export const connectConnectorResponseSchema = connectorSchema;
61
+
62
+ export const disconnectConnectorRequestSchema = z.object({
63
+ connector_id: z.string(),
64
+ });
65
+
66
+ export const disconnectConnectorResponseSchema = connectorSchema;
67
+
68
+ export const connectorPresetSchema = z.object({
69
+ url: z.string(),
70
+ metadata: z.record(z.string(), z.string()).nullable(),
71
+ });
72
+
73
+ export const listConnectorPresetsRequestSchema = z.never();
74
+
75
+ export const listConnectorPresetsResponseSchema = paginatedResponseSchema.extend({
76
+ items: z.array(connectorPresetSchema),
77
+ });
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Copyright 2025 © BeeAI a Series of LF Projects, LLC
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ import type z from 'zod';
7
+
8
+ import type {
9
+ connectConnectorRequestSchema,
10
+ connectConnectorResponseSchema,
11
+ connectorPresetSchema,
12
+ connectorSchema,
13
+ createConnectorRequestSchema,
14
+ createConnectorResponseSchema,
15
+ deleteConnectorRequestSchema,
16
+ deleteConnectorResponseSchema,
17
+ disconnectConnectorRequestSchema,
18
+ disconnectConnectorResponseSchema,
19
+ listConnectorPresetsRequestSchema,
20
+ listConnectorPresetsResponseSchema,
21
+ listConnectorsRequestSchema,
22
+ listConnectorsResponseSchema,
23
+ readConnectorRequestSchema,
24
+ readConnectorResponseSchema,
25
+ } from './schemas';
26
+
27
+ export enum ConnectorState {
28
+ Created = 'created',
29
+ AuthRequired = 'auth_required',
30
+ Connected = 'connected',
31
+ Disconnected = 'disconnected',
32
+ }
33
+
34
+ export type Connector = z.infer<typeof connectorSchema>;
35
+
36
+ export type ListConnectorsRequest = z.infer<typeof listConnectorsRequestSchema>;
37
+ export type ListConnectorsResponse = z.infer<typeof listConnectorsResponseSchema>;
38
+
39
+ export type CreateConnectorRequest = z.infer<typeof createConnectorRequestSchema>;
40
+ export type CreateConnectorResponse = z.infer<typeof createConnectorResponseSchema>;
41
+
42
+ export type ReadConnectorRequest = z.infer<typeof readConnectorRequestSchema>;
43
+ export type ReadConnectorResponse = z.infer<typeof readConnectorResponseSchema>;
44
+
45
+ export type DeleteConnectorRequest = z.infer<typeof deleteConnectorRequestSchema>;
46
+ export type DeleteConnectorResponse = z.infer<typeof deleteConnectorResponseSchema>;
47
+
48
+ export type ConnectConnectorRequest = z.infer<typeof connectConnectorRequestSchema>;
49
+ export type ConnectConnectorResponse = z.infer<typeof connectConnectorResponseSchema>;
50
+
51
+ export type DisconnectConnectorRequest = z.infer<typeof disconnectConnectorRequestSchema>;
52
+ export type DisconnectConnectorResponse = z.infer<typeof disconnectConnectorResponseSchema>;
53
+
54
+ export type ConnectorPreset = z.infer<typeof connectorPresetSchema>;
55
+
56
+ export type ListConnectorPresetsRequest = z.infer<typeof listConnectorPresetsRequestSchema>;
57
+ export type ListConnectorPresetsResponse = z.infer<typeof listConnectorPresetsResponseSchema>;
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Copyright 2025 © BeeAI a Series of LF Projects, LLC
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ import type { CallApi } from '../core/types';
7
+ import { ApiMethod } from '../core/types';
8
+ import {
9
+ createContextHistoryResponseSchema,
10
+ createContextResponseSchema,
11
+ createContextTokenResponseSchema,
12
+ deleteContextResponseSchema,
13
+ listContextHistoryResponseSchema,
14
+ listContextsResponseSchema,
15
+ patchContextMetadataResponseSchema,
16
+ readContextResponseSchema,
17
+ updateContextResponseSchema,
18
+ } from './schemas';
19
+ import type {
20
+ CreateContextHistoryRequest,
21
+ CreateContextRequest,
22
+ CreateContextTokenRequest,
23
+ DeleteContextRequest,
24
+ ListContextHistoryRequest,
25
+ ListContextsRequest,
26
+ PatchContextMetadataRequest,
27
+ ReadContextRequest,
28
+ UpdateContextRequest,
29
+ } from './types';
30
+
31
+ export function createContextsApi(callApi: CallApi) {
32
+ const listContexts = ({ query }: ListContextsRequest) =>
33
+ callApi({
34
+ method: ApiMethod.Get,
35
+ path: '/api/v1/contexts',
36
+ schema: listContextsResponseSchema,
37
+ query,
38
+ });
39
+
40
+ const createContext = ({ ...body }: CreateContextRequest) =>
41
+ callApi({
42
+ method: ApiMethod.Post,
43
+ path: '/api/v1/contexts',
44
+ schema: createContextResponseSchema,
45
+ body,
46
+ });
47
+
48
+ const readContext = ({ context_id }: ReadContextRequest) =>
49
+ callApi({
50
+ method: ApiMethod.Get,
51
+ path: `/api/v1/contexts/${context_id}`,
52
+ schema: readContextResponseSchema,
53
+ });
54
+
55
+ const updateContext = ({ context_id, ...body }: UpdateContextRequest) =>
56
+ callApi({
57
+ method: ApiMethod.Put,
58
+ path: `/api/v1/contexts/${context_id}`,
59
+ schema: updateContextResponseSchema,
60
+ body,
61
+ });
62
+
63
+ const deleteContext = ({ context_id }: DeleteContextRequest) =>
64
+ callApi({
65
+ method: ApiMethod.Delete,
66
+ path: `/api/v1/contexts/${context_id}`,
67
+ schema: deleteContextResponseSchema,
68
+ });
69
+
70
+ const listContextHistory = ({ context_id, query }: ListContextHistoryRequest) =>
71
+ callApi({
72
+ method: ApiMethod.Get,
73
+ path: `/api/v1/contexts/${context_id}/history`,
74
+ schema: listContextHistoryResponseSchema,
75
+ query,
76
+ });
77
+
78
+ const createContextHistory = ({ context_id, ...body }: CreateContextHistoryRequest) =>
79
+ callApi({
80
+ method: ApiMethod.Post,
81
+ path: `/api/v1/contexts/${context_id}/history`,
82
+ schema: createContextHistoryResponseSchema,
83
+ body,
84
+ });
85
+
86
+ const patchContextMetadata = ({ context_id, ...body }: PatchContextMetadataRequest) =>
87
+ callApi({
88
+ method: ApiMethod.Patch,
89
+ path: `/api/v1/contexts/${context_id}/metadata`,
90
+ schema: patchContextMetadataResponseSchema,
91
+ body,
92
+ });
93
+
94
+ const createContextToken = ({ context_id, ...body }: CreateContextTokenRequest) =>
95
+ callApi({
96
+ method: ApiMethod.Post,
97
+ path: `/api/v1/contexts/${context_id}/token`,
98
+ schema: createContextTokenResponseSchema,
99
+ body,
100
+ });
101
+
102
+ return {
103
+ listContexts,
104
+ createContext,
105
+ readContext,
106
+ updateContext,
107
+ deleteContext,
108
+ listContextHistory,
109
+ createContextHistory,
110
+ patchContextMetadata,
111
+ createContextToken,
112
+ };
113
+ }