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
@@ -1,15 +0,0 @@
1
- /**
2
- * Copyright 2025 © BeeAI a Series of LF Projects, LLC
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- import z from 'zod';
6
- import type { A2AUiExtension } from '../types';
7
- declare const URI = "https://a2a-extensions.agentstack.beeai.dev/ui/trajectory/v1";
8
- declare const schema: z.ZodObject<{
9
- title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
10
- content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
- group_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
- }, z.core.$strip>;
13
- export type TrajectoryMetadata = z.infer<typeof schema>;
14
- export declare const trajectoryExtension: A2AUiExtension<typeof URI, TrajectoryMetadata>;
15
- export {};
@@ -1,62 +0,0 @@
1
- /**
2
- * Copyright 2025 © BeeAI a Series of LF Projects, LLC
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- import type { ContextPermissionsGrant, GlobalPermissionsGrant, ModelCapability } from './types';
6
- export interface MatchProvidersParams {
7
- suggestedModels: string[] | null;
8
- capability: ModelCapability;
9
- scoreCutoff: number;
10
- }
11
- export interface CreateContextTokenParams {
12
- contextId: string;
13
- globalPermissions: GlobalPermissionsGrant;
14
- contextPermissions: ContextPermissionsGrant;
15
- }
16
- export declare const buildApiClient: ({ baseUrl, fetch: customFetchImpl, }?: {
17
- baseUrl: string;
18
- fetch?: typeof globalThis.fetch;
19
- }) => {
20
- createContextToken: ({ contextId, globalPermissions, contextPermissions }: CreateContextTokenParams) => Promise<{
21
- token: {
22
- token: string;
23
- expires_at: string | null;
24
- };
25
- contextId: string;
26
- }>;
27
- createContext: (providerId: string) => Promise<{
28
- id: string;
29
- created_at: string;
30
- updated_at: string;
31
- last_active_at: string;
32
- created_by: string;
33
- provider_id: string | null;
34
- metadata: Record<string, unknown> | null;
35
- }>;
36
- matchProviders: ({ suggestedModels, capability, scoreCutoff }: MatchProvidersParams) => Promise<{
37
- total_count: number;
38
- has_more: boolean;
39
- next_page_token: string | null;
40
- items: {
41
- model_id: string;
42
- score: number;
43
- }[];
44
- }>;
45
- listConnectors: () => Promise<{
46
- total_count: number;
47
- has_more: boolean;
48
- next_page_token: string | null;
49
- items: {
50
- id: string;
51
- url: string;
52
- state: import("./types").ConnectorState;
53
- auth_request: {
54
- type: "code";
55
- authorization_endpoint: string;
56
- } | null;
57
- disconnect_reason: string | null;
58
- metadata: Record<string, string> | null;
59
- }[];
60
- }>;
61
- };
62
- export type AgentstackClient = ReturnType<typeof buildApiClient>;
package/dist/types.d.ts DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * Copyright 2025 © BeeAI a Series of LF Projects, LLC
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- import z from 'zod';
6
- export declare const interactionModeSchema: z.ZodEnum<{
7
- "single-turn": "single-turn";
8
- "multi-turn": "multi-turn";
9
- }>;
10
- export type InteractionMode = z.infer<typeof interactionModeSchema>;
@@ -1,95 +0,0 @@
1
- /**
2
- * Copyright 2025 © BeeAI a Series of LF Projects, LLC
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
-
6
- import type { TaskStatusUpdateEvent } from '@a2a-js/sdk';
7
-
8
- import type { FormRender } from './common/form';
9
- import type { ApprovalRequest } from './interactions/approval';
10
- import { approvalExtension } from './interactions/approval';
11
- import type { SecretDemands } from './services/secrets';
12
- import { secretsMessageExtension } from './services/secrets';
13
- import { FormRequestExtension } from './ui/form-request';
14
- import { oauthRequestExtension } from './ui/oauth';
15
- import { extractUiExtensionData } from './utils';
16
-
17
- const secretsMessageExtensionExtractor = extractUiExtensionData(secretsMessageExtension);
18
- const oauthRequestExtensionExtractor = extractUiExtensionData(oauthRequestExtension);
19
- const FormRequestExtensionExtractor = extractUiExtensionData(FormRequestExtension);
20
- const approvalExtensionExtractor = extractUiExtensionData(approvalExtension);
21
-
22
- export enum TaskStatusUpdateType {
23
- SecretRequired = 'secret-required',
24
- FormRequired = 'form-required',
25
- OAuthRequired = 'oauth-required',
26
- ApprovalRequired = 'approval-required',
27
- }
28
-
29
- export interface SecretRequiredResult {
30
- type: TaskStatusUpdateType.SecretRequired;
31
- demands: SecretDemands;
32
- }
33
-
34
- export interface FormRequiredResult {
35
- type: TaskStatusUpdateType.FormRequired;
36
- form: FormRender;
37
- }
38
-
39
- export interface OAuthRequiredResult {
40
- type: TaskStatusUpdateType.OAuthRequired;
41
- url: string;
42
- }
43
-
44
- export interface ApprovalRequiredResult {
45
- type: TaskStatusUpdateType.ApprovalRequired;
46
- request: ApprovalRequest;
47
- }
48
-
49
- export type TaskStatusUpdateResult =
50
- | SecretRequiredResult
51
- | FormRequiredResult
52
- | OAuthRequiredResult
53
- | ApprovalRequiredResult;
54
-
55
- export const handleTaskStatusUpdate = (event: TaskStatusUpdateEvent): TaskStatusUpdateResult[] => {
56
- const results: TaskStatusUpdateResult[] = [];
57
-
58
- if (event.status.state === 'auth-required') {
59
- const secretRequired = secretsMessageExtensionExtractor(event.status.message?.metadata);
60
- const oauthRequired = oauthRequestExtensionExtractor(event.status.message?.metadata);
61
-
62
- if (oauthRequired) {
63
- results.push({
64
- type: TaskStatusUpdateType.OAuthRequired,
65
- url: oauthRequired.authorization_endpoint_url,
66
- });
67
- }
68
-
69
- if (secretRequired) {
70
- results.push({
71
- type: TaskStatusUpdateType.SecretRequired,
72
- demands: secretRequired,
73
- });
74
- }
75
- } else if (event.status.state === 'input-required') {
76
- const formRequired = FormRequestExtensionExtractor(event.status.message?.metadata);
77
- const approvalRequired = approvalExtensionExtractor(event.status.message?.metadata);
78
-
79
- if (formRequired) {
80
- results.push({
81
- type: TaskStatusUpdateType.FormRequired,
82
- form: formRequired,
83
- });
84
- }
85
-
86
- if (approvalRequired) {
87
- results.push({
88
- type: TaskStatusUpdateType.ApprovalRequired,
89
- request: approvalRequired,
90
- });
91
- }
92
- }
93
-
94
- return results;
95
- };
@@ -1,30 +0,0 @@
1
- /**
2
- * Copyright 2025 © BeeAI a Series of LF Projects, LLC
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
-
6
- import type { FormResponseValue } from './common/form';
7
- import { type CanvasEditRequest, CanvasExtension } from './ui/canvas';
8
- import { FormRequestExtension } from './ui/form-request';
9
-
10
- export type UserMetadataInputs = Partial<{
11
- form: Record<string, FormResponseValue>;
12
- canvasEditRequest: CanvasEditRequest;
13
- }>;
14
-
15
- export const resolveUserMetadata = async (inputs: UserMetadataInputs) => {
16
- const metadata: Record<string, unknown> = {};
17
-
18
- const { form, canvasEditRequest } = inputs;
19
-
20
- if (form) {
21
- metadata[FormRequestExtension.getUri()] = {
22
- values: form,
23
- };
24
- }
25
- if (canvasEditRequest) {
26
- metadata[CanvasExtension.getUri()] = canvasEditRequest;
27
- }
28
-
29
- return metadata;
30
- };
@@ -1,43 +0,0 @@
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 type { A2AServiceExtension } from '../types';
9
-
10
- const URI = 'https://a2a-extensions.agentstack.beeai.dev/services/embedding/v1';
11
-
12
- const embeddingDemandSchema = z.object({
13
- description: z.string().nullish(),
14
- suggested: z.array(z.string()).nullish(),
15
- });
16
-
17
- const embeddingDemandsSchema = z.object({
18
- embedding_demands: z.record(z.string(), embeddingDemandSchema),
19
- });
20
- export type EmbeddingDemands = z.infer<typeof embeddingDemandsSchema>;
21
-
22
- const embeddingFulfillmentsSchema = z.object({
23
- embedding_fulfillments: z.record(
24
- z.string(),
25
- z.object({
26
- identifier: z.string().nullish(),
27
- api_base: z.string(),
28
- api_key: z.string(),
29
- api_model: z.string(),
30
- }),
31
- ),
32
- });
33
- export type EmbeddingFulfillments = z.infer<typeof embeddingFulfillmentsSchema>;
34
-
35
- export const embeddingExtension: A2AServiceExtension<
36
- typeof URI,
37
- z.infer<typeof embeddingDemandsSchema>,
38
- EmbeddingFulfillments
39
- > = {
40
- getUri: () => URI,
41
- getDemandsSchema: () => embeddingDemandsSchema,
42
- getFulfillmentSchema: () => embeddingFulfillmentsSchema,
43
- };
@@ -1,31 +0,0 @@
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 { formRenderSchema, formResponseSchema } from '../common/form';
9
- import type { A2AServiceExtension } from '../types';
10
-
11
- const URI = 'https://a2a-extensions.agentstack.beeai.dev/services/form/v1';
12
-
13
- const formDemandSchema = z.object({
14
- form_demands: z
15
- .object({
16
- initial_form: formRenderSchema,
17
- })
18
- .partial(),
19
- });
20
- export type FormDemands = z.infer<typeof formDemandSchema>;
21
-
22
- const formFulfillmentSchema = z.object({
23
- form_fulfillments: z.record(z.string(), formResponseSchema),
24
- });
25
- export type FormFulfillments = z.infer<typeof formFulfillmentSchema>;
26
-
27
- export const formExtension: A2AServiceExtension<typeof URI, FormDemands, FormFulfillments> = {
28
- getDemandsSchema: () => formDemandSchema,
29
- getFulfillmentSchema: () => formFulfillmentSchema,
30
- getUri: () => URI,
31
- };
@@ -1,39 +0,0 @@
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 type { A2AServiceExtension } from '../types';
9
-
10
- const URI = 'https://a2a-extensions.agentstack.beeai.dev/services/llm/v1';
11
-
12
- const llmDemandSchema = z.object({
13
- description: z.string().nullish(),
14
- suggested: z.array(z.string()).nullish(),
15
- });
16
-
17
- const llmDemandsSchema = z.object({
18
- llm_demands: z.record(z.string(), llmDemandSchema),
19
- });
20
- export type LLMDemands = z.infer<typeof llmDemandsSchema>;
21
-
22
- const llmFulfillmentSchema = z.object({
23
- llm_fulfillments: z.record(
24
- z.string(),
25
- z.object({
26
- identifier: z.string().nullish(),
27
- api_base: z.string(),
28
- api_key: z.string(),
29
- api_model: z.string(),
30
- }),
31
- ),
32
- });
33
- export type LLMFulfillments = z.infer<typeof llmFulfillmentSchema>;
34
-
35
- export const llmExtension: A2AServiceExtension<typeof URI, z.infer<typeof llmDemandsSchema>, LLMFulfillments> = {
36
- getUri: () => URI,
37
- getDemandsSchema: () => llmDemandsSchema,
38
- getFulfillmentSchema: () => llmFulfillmentSchema,
39
- };
@@ -1,59 +0,0 @@
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 type { A2AServiceExtension } from '../types';
9
-
10
- const URI = 'https://a2a-extensions.agentstack.beeai.dev/services/mcp/v1';
11
-
12
- const mcpTransportTypesEnum = z.enum(['streamable_http', 'stdio']);
13
- type MCPTransportType = z.infer<typeof mcpTransportTypesEnum>;
14
-
15
- const mcpDemandSchema = z.object({
16
- description: z.string().nullish(),
17
- suggested: z.array(z.string()).nullish(),
18
- allowed_transports: z.array(mcpTransportTypesEnum).nullish(),
19
- });
20
-
21
- const mcpDemandsSchema = z.object({
22
- mcp_demands: z.record(z.string(), mcpDemandSchema),
23
- });
24
- export type MCPDemands = z.infer<typeof mcpDemandsSchema>;
25
-
26
- const mcpFulfillmentSchema = z.object({
27
- mcp_fulfillments: z.record(
28
- z.string(),
29
- z.object({
30
- transport: z.object({
31
- type: mcpTransportTypesEnum,
32
- url: z.string(),
33
- headers: z.record(z.string(), z.string()).optional(),
34
- }),
35
- }),
36
- ),
37
- });
38
- export type MCPFulfillments = z.infer<typeof mcpFulfillmentSchema>;
39
-
40
- export const mcpExtension: A2AServiceExtension<
41
- typeof URI,
42
- z.infer<typeof mcpDemandsSchema>,
43
- {
44
- mcp_fulfillments: Record<
45
- string,
46
- {
47
- transport: {
48
- type: MCPTransportType;
49
- url: string;
50
- headers?: Record<string, string>;
51
- };
52
- }
53
- >;
54
- }
55
- > = {
56
- getUri: () => URI,
57
- getDemandsSchema: () => mcpDemandsSchema,
58
- getFulfillmentSchema: () => mcpFulfillmentSchema,
59
- };
@@ -1,52 +0,0 @@
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 type { A2AServiceExtension } from '../types';
9
-
10
- const URI = 'https://a2a-extensions.agentstack.beeai.dev/auth/oauth/v1';
11
-
12
- const oauthDemandSchema = z.object({
13
- redirect_uri: z.boolean(),
14
- });
15
-
16
- const oauthDemandsSchema = z.object({
17
- oauth_demands: z.record(z.string(), oauthDemandSchema),
18
- });
19
- export type OAuthDemands = z.infer<typeof oauthDemandsSchema>;
20
-
21
- const oauthFulfillmentSchema = z.object({
22
- oauth_fulfillments: z.record(
23
- z.string(),
24
- z.object({
25
- redirect_uri: z.string(),
26
- }),
27
- ),
28
- });
29
- export type OAuthFulfillments = z.infer<typeof oauthFulfillmentSchema>;
30
-
31
- export const oauthProviderExtension: A2AServiceExtension<
32
- typeof URI,
33
- z.infer<typeof oauthDemandsSchema>,
34
- {
35
- oauth_fulfillments: Record<
36
- string,
37
- {
38
- redirect_uri: string;
39
- }
40
- >;
41
- }
42
- > = {
43
- getUri: () => URI,
44
- getDemandsSchema: () => oauthDemandsSchema,
45
- getFulfillmentSchema: () => oauthFulfillmentSchema,
46
- };
47
-
48
- export const oauthMessageSchema = z.object({
49
- data: z.object({
50
- redirect_uri: z.string(),
51
- }),
52
- });
@@ -1,46 +0,0 @@
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 type { A2AServiceExtension, A2AUiExtension } from '../types';
9
-
10
- const URI = 'https://a2a-extensions.agentstack.beeai.dev/auth/secrets/v1';
11
-
12
- const secretDemandSchema = z.object({
13
- name: z.string(),
14
- description: z.string().nullish(),
15
- });
16
- export type SecretDemand = z.infer<typeof secretDemandSchema>;
17
-
18
- const secretDemandsSchema = z.object({
19
- secret_demands: z.record(z.string(), secretDemandSchema),
20
- });
21
- export type SecretDemands = z.infer<typeof secretDemandsSchema>;
22
-
23
- const secretFulfillmentSchema = z.object({
24
- secret_fulfillments: z.record(
25
- z.string(),
26
- z.object({
27
- secret: z.string(),
28
- }),
29
- ),
30
- });
31
- export type SecretFulfillments = z.infer<typeof secretFulfillmentSchema>;
32
-
33
- export const secretsExtension: A2AServiceExtension<
34
- typeof URI,
35
- z.infer<typeof secretDemandsSchema>,
36
- SecretFulfillments
37
- > = {
38
- getUri: () => URI,
39
- getDemandsSchema: () => secretDemandsSchema,
40
- getFulfillmentSchema: () => secretFulfillmentSchema,
41
- };
42
-
43
- export const secretsMessageExtension: A2AUiExtension<typeof URI, SecretDemands> = {
44
- getMessageMetadataSchema: () => z.object({ [URI]: secretDemandsSchema }).partial(),
45
- getUri: () => URI,
46
- };
@@ -1,46 +0,0 @@
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 { interactionModeSchema } from '../../../../types';
9
- import type { A2AUiExtension } from '../types';
10
-
11
- const URI = 'https://a2a-extensions.agentstack.beeai.dev/ui/agent-detail/v1';
12
-
13
- const contributorSchema = z.object({
14
- name: z.string(),
15
- email: z.string().nullish(),
16
- url: z.string().nullish(),
17
- });
18
-
19
- const toolSchema = z.object({
20
- name: z.string(),
21
- description: z.string(),
22
- });
23
-
24
- const schema = z.object({
25
- interaction_mode: z.union([interactionModeSchema, z.string()]).nullish(),
26
- user_greeting: z.string().nullish(),
27
- input_placeholder: z.string().nullish(),
28
- tools: z.array(toolSchema).nullish(),
29
- framework: z.string().nullish(),
30
- license: z.string().nullish(),
31
- programming_language: z.string().nullish(),
32
- homepage_url: z.string().nullish(),
33
- source_code_url: z.string().nullish(),
34
- container_image_url: z.string().nullish(),
35
- author: contributorSchema.nullish(),
36
- contributors: z.array(contributorSchema).nullish(),
37
- });
38
-
39
- export type AgentDetailTool = z.infer<typeof toolSchema>;
40
- export type AgentDetailContributor = z.infer<typeof contributorSchema>;
41
- export type AgentDetail = z.infer<typeof schema>;
42
-
43
- export const agentDetailExtension: A2AUiExtension<typeof URI, AgentDetail> = {
44
- getMessageMetadataSchema: () => z.object({ [URI]: schema }).partial(),
45
- getUri: () => URI,
46
- };
@@ -1,24 +0,0 @@
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 type { A2AUiExtension } from '../types';
9
-
10
- const URI = 'https://a2a-extensions.agentstack.beeai.dev/ui/canvas/v1';
11
-
12
- const schema = z.object({
13
- start_index: z.int(),
14
- end_index: z.int(),
15
- description: z.string().nullish(),
16
- artifact_id: z.string(),
17
- });
18
-
19
- export type CanvasEditRequest = z.infer<typeof schema>;
20
-
21
- export const CanvasExtension: A2AUiExtension<typeof URI, CanvasEditRequest> = {
22
- getMessageMetadataSchema: () => z.object({ [URI]: schema }).partial(),
23
- getUri: () => URI,
24
- };
@@ -1,30 +0,0 @@
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 type { A2AUiExtension } from '../types';
9
-
10
- const URI = 'https://a2a-extensions.agentstack.beeai.dev/ui/citation/v1';
11
-
12
- const citationSchema = z.object({
13
- url: z.string().nullish(),
14
- start_index: z.number().nullish(),
15
- end_index: z.number().nullish(),
16
- title: z.string().nullish(),
17
- description: z.string().nullish(),
18
- });
19
-
20
- const schema = z.object({
21
- citations: z.array(citationSchema),
22
- });
23
-
24
- export type CitationMetadata = z.infer<typeof schema>;
25
- export type Citation = z.infer<typeof citationSchema>;
26
-
27
- export const citationExtension: A2AUiExtension<typeof URI, CitationMetadata> = {
28
- getMessageMetadataSchema: () => z.object({ [URI]: schema }).partial(),
29
- getUri: () => URI,
30
- };
@@ -1,33 +0,0 @@
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 type { A2AUiExtension } from '../types';
9
-
10
- const URI = 'https://a2a-extensions.agentstack.beeai.dev/ui/error/v1';
11
-
12
- const errorSchema = z.object({
13
- title: z.string(),
14
- message: z.string(),
15
- });
16
-
17
- const errorGroupSchema = z.object({
18
- message: z.string(),
19
- errors: z.array(errorSchema),
20
- });
21
-
22
- const schema = z.object({
23
- error: z.union([errorSchema, errorGroupSchema]),
24
- context: z.record(z.string(), z.unknown()).nullish(),
25
- stack_trace: z.string().nullish(),
26
- });
27
-
28
- export type ErrorMetadata = z.infer<typeof schema>;
29
-
30
- export const errorExtension: A2AUiExtension<typeof URI, ErrorMetadata> = {
31
- getMessageMetadataSchema: () => z.object({ [URI]: schema }).partial(),
32
- getUri: () => URI,
33
- };
@@ -1,21 +0,0 @@
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 type { A2AUiExtension } from '../types';
9
-
10
- const URI = 'https://a2a-extensions.agentstack.beeai.dev/auth/oauth/v1';
11
-
12
- const schema = z.object({
13
- authorization_endpoint_url: z.string(),
14
- });
15
-
16
- export type OAuthRequest = z.infer<typeof schema>;
17
-
18
- export const oauthRequestExtension: A2AUiExtension<typeof URI, OAuthRequest> = {
19
- getMessageMetadataSchema: () => z.object({ [URI]: schema }).partial(),
20
- getUri: () => URI,
21
- };