@artinet/sdk 0.5.17 → 0.6.0-preview.1

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 (316) hide show
  1. package/README.md +51 -557
  2. package/dist/browser/browser.d.ts +9 -0
  3. package/dist/browser/browser.js +10 -0
  4. package/dist/browser/client/a2a-client.d.ts +127 -0
  5. package/dist/browser/client/a2a-client.js +233 -0
  6. package/dist/browser/client/index.d.ts +1 -0
  7. package/dist/browser/client/index.js +1 -0
  8. package/dist/browser/config/index.d.ts +158 -0
  9. package/dist/browser/config/index.js +155 -0
  10. package/dist/browser/config/observability.d.ts +119 -0
  11. package/dist/browser/config/observability.js +35 -0
  12. package/dist/browser/services/a2a/helpers/message-builder.d.ts +17 -0
  13. package/dist/browser/services/a2a/helpers/message-builder.js +66 -0
  14. package/dist/browser/transport/rpc/parser.d.ts +15 -0
  15. package/dist/browser/transport/rpc/parser.js +48 -0
  16. package/dist/browser/transport/rpc/rpc-client.d.ts +80 -0
  17. package/dist/browser/transport/rpc/rpc-client.js +189 -0
  18. package/dist/browser/transport/streaming/event-stream.d.ts +25 -0
  19. package/dist/browser/transport/streaming/event-stream.js +100 -0
  20. package/dist/browser/types/a2a/a2a.d.ts +378 -0
  21. package/dist/browser/types/a2a/a2a.js +14 -0
  22. package/dist/browser/types/a2a/builder.d.ts +43 -0
  23. package/dist/browser/types/a2a/index.d.ts +3 -0
  24. package/dist/browser/types/a2a/index.js +2 -0
  25. package/dist/{types/interfaces → browser/types}/client.d.ts +25 -27
  26. package/dist/browser/types/core/core.d.ts +31 -0
  27. package/dist/browser/types/core/index.d.ts +1 -0
  28. package/dist/browser/types/core/index.js +1 -0
  29. package/dist/{types/interfaces/services → browser/types}/index.d.ts +3 -0
  30. package/dist/{types/interfaces/services → browser/types}/index.js +3 -0
  31. package/dist/browser/types/mcp/index.d.ts +1 -0
  32. package/dist/browser/types/mcp/index.js +1 -0
  33. package/dist/{types/interfaces/services/mcp/service.d.ts → browser/types/mcp/mcp.d.ts} +4 -3
  34. package/dist/browser/types/mcp/mcp.js +5 -0
  35. package/dist/browser/types/storage.d.ts +21 -0
  36. package/dist/browser/types/utils/index.d.ts +1 -0
  37. package/dist/browser/types/utils/index.js +1 -0
  38. package/dist/browser/types/utils/transform.d.ts +64 -0
  39. package/dist/browser/types/utils/transform.js +35 -0
  40. package/dist/browser/utils/common/constants.d.ts +11 -0
  41. package/dist/browser/utils/common/constants.js +38 -0
  42. package/dist/browser/utils/common/errors.d.ts +24 -0
  43. package/dist/browser/utils/common/errors.js +42 -0
  44. package/dist/browser/utils/common/utils.d.ts +32 -0
  45. package/dist/browser/utils/common/utils.js +43 -0
  46. package/dist/client/a2a-client.d.ts +21 -19
  47. package/dist/client/a2a-client.js +30 -9
  48. package/dist/config/default.d.ts +50 -0
  49. package/dist/config/default.js +62 -0
  50. package/dist/config/index.d.ts +158 -0
  51. package/dist/config/index.js +155 -0
  52. package/dist/config/observability.d.ts +119 -0
  53. package/dist/config/observability.js +35 -0
  54. package/dist/extensions/otel.d.ts +98 -0
  55. package/dist/extensions/otel.js +190 -0
  56. package/dist/extensions/pino.d.ts +44 -0
  57. package/dist/extensions/pino.js +107 -0
  58. package/dist/extensions/winston.d.ts +47 -0
  59. package/dist/extensions/winston.js +114 -0
  60. package/dist/index.d.ts +2 -0
  61. package/dist/index.js +2 -0
  62. package/dist/server/express/errors.js +3 -3
  63. package/dist/server/express/middeware.d.ts +2 -2
  64. package/dist/server/express/middeware.js +36 -9
  65. package/dist/server/express/server.d.ts +9 -55
  66. package/dist/server/express/server.js +51 -32
  67. package/dist/services/a2a/execute.d.ts +6 -0
  68. package/dist/services/a2a/execute.js +25 -0
  69. package/dist/services/a2a/factory/builder.d.ts +21 -80
  70. package/dist/services/a2a/factory/builder.js +23 -13
  71. package/dist/services/a2a/factory/context.d.ts +15 -128
  72. package/dist/services/a2a/factory/context.js +31 -136
  73. package/dist/services/a2a/factory/handler.d.ts +6 -0
  74. package/dist/services/a2a/factory/{method.js → handler.js} +2 -2
  75. package/dist/services/a2a/factory/index.d.ts +1 -2
  76. package/dist/services/a2a/factory/index.js +1 -2
  77. package/dist/services/a2a/factory/service.d.ts +20 -7
  78. package/dist/services/a2a/factory/service.js +4 -4
  79. package/dist/services/a2a/factory/state-machine.d.ts +11 -0
  80. package/dist/services/a2a/factory/state-machine.js +66 -0
  81. package/dist/services/a2a/{state/update → handlers}/artifact.d.ts +4 -4
  82. package/dist/services/a2a/handlers/cancel-task.d.ts +11 -0
  83. package/dist/services/a2a/handlers/cancel-task.js +33 -0
  84. package/dist/services/a2a/handlers/get-task.d.ts +11 -0
  85. package/dist/services/a2a/handlers/get-task.js +13 -0
  86. package/dist/services/a2a/handlers/resubscribe-task.d.ts +11 -0
  87. package/dist/services/a2a/handlers/resubscribe-task.js +56 -0
  88. package/dist/services/a2a/handlers/send-message.d.ts +11 -0
  89. package/dist/services/a2a/handlers/send-message.js +35 -0
  90. package/dist/services/a2a/handlers/stream-message.d.ts +11 -0
  91. package/dist/services/a2a/handlers/stream-message.js +19 -0
  92. package/dist/services/a2a/handlers/update.d.ts +17 -0
  93. package/dist/services/a2a/handlers/update.js +114 -0
  94. package/dist/services/a2a/helpers/agentcard-builder.d.ts +9 -5
  95. package/dist/services/a2a/helpers/agentcard-builder.js +5 -0
  96. package/dist/services/a2a/helpers/content.d.ts +2 -2
  97. package/dist/services/a2a/helpers/content.js +4 -0
  98. package/dist/services/a2a/helpers/history.d.ts +6 -0
  99. package/dist/services/a2a/helpers/history.js +7 -0
  100. package/dist/services/a2a/helpers/index.d.ts +3 -1
  101. package/dist/services/a2a/helpers/index.js +3 -1
  102. package/dist/services/a2a/helpers/message-builder.d.ts +13 -8
  103. package/dist/services/a2a/helpers/message-builder.js +5 -0
  104. package/dist/services/a2a/helpers/part.d.ts +9 -9
  105. package/dist/services/a2a/helpers/references.d.ts +6 -0
  106. package/dist/services/a2a/helpers/references.js +22 -0
  107. package/dist/services/a2a/index.d.ts +9 -5
  108. package/dist/services/a2a/index.js +8 -5
  109. package/dist/services/a2a/managers.d.ts +23 -0
  110. package/dist/services/a2a/managers.js +95 -0
  111. package/dist/services/a2a/messenger.d.ts +35 -0
  112. package/dist/services/{core/managers/command.js → a2a/messenger.js} +27 -31
  113. package/dist/services/a2a/service.d.ts +41 -371
  114. package/dist/services/a2a/service.js +239 -70
  115. package/dist/services/a2a/state-machine.d.ts +18 -0
  116. package/dist/services/a2a/state-machine.js +76 -0
  117. package/dist/services/a2a/streams.d.ts +22 -0
  118. package/dist/services/a2a/streams.js +98 -0
  119. package/dist/services/core/index.d.ts +1 -2
  120. package/dist/services/core/index.js +1 -2
  121. package/dist/services/core/manager.d.ts +15 -0
  122. package/dist/services/core/manager.js +42 -0
  123. package/dist/services/mcp/service.d.ts +11 -15
  124. package/dist/services/mcp/service.js +16 -16
  125. package/dist/transport/index.d.ts +0 -1
  126. package/dist/transport/index.js +1 -1
  127. package/dist/transport/rpc/parser.d.ts +2 -2
  128. package/dist/transport/rpc/parser.js +7 -7
  129. package/dist/transport/rpc/rpc-client.d.ts +5 -5
  130. package/dist/transport/rpc/rpc-client.js +7 -7
  131. package/dist/transport/streaming/event-stream.d.ts +3 -3
  132. package/dist/transport/streaming/event-stream.js +11 -10
  133. package/dist/transport/trpc/a2a/factory/router.d.ts +479 -871
  134. package/dist/transport/trpc/a2a/factory/router.js +2 -2
  135. package/dist/transport/trpc/a2a/routes/info.d.ts +108 -8
  136. package/dist/transport/trpc/a2a/routes/info.js +6 -2
  137. package/dist/transport/trpc/a2a/routes/message/route.d.ts +113 -162
  138. package/dist/transport/trpc/a2a/routes/message/route.js +7 -13
  139. package/dist/transport/trpc/a2a/routes/tasks/route.d.ts +114 -212
  140. package/dist/transport/trpc/a2a/routes/tasks/route.js +16 -19
  141. package/dist/transport/trpc/a2a/trpc.d.ts +9 -253
  142. package/dist/types/a2a/a2a.d.ts +378 -0
  143. package/dist/types/a2a/a2a.js +14 -0
  144. package/dist/types/a2a/builder.d.ts +43 -0
  145. package/dist/types/a2a/index.d.ts +3 -0
  146. package/dist/types/a2a/index.js +2 -0
  147. package/dist/types/client.d.ts +133 -0
  148. package/dist/types/core/core.d.ts +31 -0
  149. package/dist/types/core/core.js +1 -0
  150. package/dist/types/core/index.d.ts +1 -0
  151. package/dist/types/core/index.js +1 -0
  152. package/dist/types/index.d.ts +6 -3
  153. package/dist/types/index.js +6 -3
  154. package/dist/types/mcp/index.d.ts +1 -0
  155. package/dist/types/mcp/index.js +1 -0
  156. package/dist/types/mcp/mcp.d.ts +50 -0
  157. package/dist/types/mcp/mcp.js +5 -0
  158. package/dist/types/protocol.d.ts +33 -0
  159. package/dist/types/protocol.js +34 -0
  160. package/dist/types/storage.d.ts +21 -0
  161. package/dist/utils/common/constants.d.ts +7 -7
  162. package/dist/utils/common/constants.js +10 -10
  163. package/dist/utils/common/errors.d.ts +18 -17
  164. package/dist/utils/common/errors.js +14 -13
  165. package/dist/utils/common/parse.d.ts +7 -0
  166. package/dist/utils/common/parse.js +14 -0
  167. package/dist/utils/common/schema-validation.d.ts +2 -0
  168. package/dist/utils/common/schema-validation.js +12 -0
  169. package/dist/utils/common/utils.d.ts +23 -0
  170. package/dist/utils/common/utils.js +32 -0
  171. package/dist/utils/common/zAsyncIterable-v3.d.ts +1 -1
  172. package/dist/utils/common/zAsyncIterable-v3.js +2 -1
  173. package/dist/utils/index.d.ts +3 -3
  174. package/dist/utils/index.js +3 -3
  175. package/dist/utils/storage/file.d.ts +8 -17
  176. package/dist/utils/storage/file.js +44 -73
  177. package/package.json +86 -23
  178. package/dist/services/a2a/factory/event.d.ts +0 -58
  179. package/dist/services/a2a/factory/event.js +0 -177
  180. package/dist/services/a2a/factory/method.d.ts +0 -6
  181. package/dist/services/a2a/managers/cancellation.d.ts +0 -11
  182. package/dist/services/a2a/managers/cancellation.js +0 -16
  183. package/dist/services/a2a/managers/connection.d.ts +0 -11
  184. package/dist/services/a2a/managers/connection.js +0 -16
  185. package/dist/services/a2a/managers/context.d.ts +0 -11
  186. package/dist/services/a2a/managers/context.js +0 -16
  187. package/dist/services/a2a/managers/index.d.ts +0 -5
  188. package/dist/services/a2a/managers/index.js +0 -5
  189. package/dist/services/a2a/managers/task.d.ts +0 -11
  190. package/dist/services/a2a/managers/task.js +0 -16
  191. package/dist/services/a2a/methods/cancel-task.d.ts +0 -7
  192. package/dist/services/a2a/methods/cancel-task.js +0 -43
  193. package/dist/services/a2a/methods/get-task.d.ts +0 -112
  194. package/dist/services/a2a/methods/get-task.js +0 -14
  195. package/dist/services/a2a/methods/resubscribe-task.d.ts +0 -7
  196. package/dist/services/a2a/methods/resubscribe-task.js +0 -80
  197. package/dist/services/a2a/methods/send-message.d.ts +0 -7
  198. package/dist/services/a2a/methods/send-message.js +0 -19
  199. package/dist/services/a2a/methods/stream-message.d.ts +0 -8
  200. package/dist/services/a2a/methods/stream-message.js +0 -21
  201. package/dist/services/a2a/state/index.d.ts +0 -3
  202. package/dist/services/a2a/state/index.js +0 -3
  203. package/dist/services/a2a/state/load.d.ts +0 -14
  204. package/dist/services/a2a/state/load.js +0 -71
  205. package/dist/services/a2a/state/process.d.ts +0 -7
  206. package/dist/services/a2a/state/process.js +0 -13
  207. package/dist/services/a2a/state/update/index.d.ts +0 -2
  208. package/dist/services/a2a/state/update/index.js +0 -2
  209. package/dist/services/a2a/state/update/update.d.ts +0 -23
  210. package/dist/services/a2a/state/update/update.js +0 -123
  211. package/dist/services/core/execution/execute.d.ts +0 -6
  212. package/dist/services/core/execution/execute.js +0 -25
  213. package/dist/services/core/execution/index.d.ts +0 -1
  214. package/dist/services/core/execution/index.js +0 -1
  215. package/dist/services/core/managers/command.d.ts +0 -39
  216. package/dist/services/core/managers/event.d.ts +0 -18
  217. package/dist/services/core/managers/event.js +0 -56
  218. package/dist/services/core/managers/index.d.ts +0 -3
  219. package/dist/services/core/managers/index.js +0 -3
  220. package/dist/services/core/managers/stream.d.ts +0 -20
  221. package/dist/services/core/managers/stream.js +0 -77
  222. package/dist/types/ext.d.ts +0 -13
  223. package/dist/types/ext.js +0 -10
  224. package/dist/types/interfaces/index.d.ts +0 -3
  225. package/dist/types/interfaces/index.js +0 -3
  226. package/dist/types/interfaces/services/a2a/builder.d.ts +0 -37
  227. package/dist/types/interfaces/services/a2a/context.d.ts +0 -162
  228. package/dist/types/interfaces/services/a2a/engine.d.ts +0 -7
  229. package/dist/types/interfaces/services/a2a/index.d.ts +0 -5
  230. package/dist/types/interfaces/services/a2a/index.js +0 -5
  231. package/dist/types/interfaces/services/a2a/legacy.d.ts +0 -93
  232. package/dist/types/interfaces/services/a2a/service.d.ts +0 -409
  233. package/dist/types/interfaces/services/a2a/service.js +0 -5
  234. package/dist/types/interfaces/services/core/context/command.d.ts +0 -25
  235. package/dist/types/interfaces/services/core/context/command.js +0 -5
  236. package/dist/types/interfaces/services/core/context/context.d.ts +0 -207
  237. package/dist/types/interfaces/services/core/context/context.js +0 -5
  238. package/dist/types/interfaces/services/core/context/index.d.ts +0 -3
  239. package/dist/types/interfaces/services/core/context/index.js +0 -3
  240. package/dist/types/interfaces/services/core/context/types.d.ts +0 -11
  241. package/dist/types/interfaces/services/core/context/types.js +0 -5
  242. package/dist/types/interfaces/services/core/execution/engine.d.ts +0 -106
  243. package/dist/types/interfaces/services/core/execution/engine.js +0 -5
  244. package/dist/types/interfaces/services/core/execution/environment.d.ts +0 -11
  245. package/dist/types/interfaces/services/core/execution/environment.js +0 -5
  246. package/dist/types/interfaces/services/core/execution/execute.d.ts +0 -7
  247. package/dist/types/interfaces/services/core/execution/execute.js +0 -5
  248. package/dist/types/interfaces/services/core/execution/index.d.ts +0 -3
  249. package/dist/types/interfaces/services/core/execution/index.js +0 -3
  250. package/dist/types/interfaces/services/core/index.d.ts +0 -4
  251. package/dist/types/interfaces/services/core/index.js +0 -4
  252. package/dist/types/interfaces/services/core/managers/cancellation.d.ts +0 -9
  253. package/dist/types/interfaces/services/core/managers/cancellation.js +0 -5
  254. package/dist/types/interfaces/services/core/managers/connection.d.ts +0 -9
  255. package/dist/types/interfaces/services/core/managers/connection.js +0 -5
  256. package/dist/types/interfaces/services/core/managers/context.d.ts +0 -17
  257. package/dist/types/interfaces/services/core/managers/context.js +0 -5
  258. package/dist/types/interfaces/services/core/managers/event.d.ts +0 -328
  259. package/dist/types/interfaces/services/core/managers/event.js +0 -5
  260. package/dist/types/interfaces/services/core/managers/index.d.ts +0 -6
  261. package/dist/types/interfaces/services/core/managers/index.js +0 -6
  262. package/dist/types/interfaces/services/core/managers/stream.d.ts +0 -217
  263. package/dist/types/interfaces/services/core/managers/stream.js +0 -5
  264. package/dist/types/interfaces/services/core/managers/task.d.ts +0 -9
  265. package/dist/types/interfaces/services/core/service.d.ts +0 -115
  266. package/dist/types/interfaces/services/core/service.js +0 -5
  267. package/dist/types/interfaces/services/mcp/index.d.ts +0 -1
  268. package/dist/types/interfaces/services/mcp/index.js +0 -1
  269. package/dist/types/interfaces/services/mcp/service.js +0 -5
  270. package/dist/types/interfaces/storage.d.ts +0 -8
  271. package/dist/types/schemas/a2a/agent.d.ts +0 -2583
  272. package/dist/types/schemas/a2a/agent.js +0 -323
  273. package/dist/types/schemas/a2a/auth.d.ts +0 -908
  274. package/dist/types/schemas/a2a/auth.js +0 -283
  275. package/dist/types/schemas/a2a/error.d.ts +0 -396
  276. package/dist/types/schemas/a2a/error.js +0 -163
  277. package/dist/types/schemas/a2a/index.d.ts +0 -11
  278. package/dist/types/schemas/a2a/index.js +0 -11
  279. package/dist/types/schemas/a2a/kind.d.ts +0 -11
  280. package/dist/types/schemas/a2a/kind.js +0 -20
  281. package/dist/types/schemas/a2a/message.d.ts +0 -10343
  282. package/dist/types/schemas/a2a/message.js +0 -130
  283. package/dist/types/schemas/a2a/notification.d.ts +0 -1517
  284. package/dist/types/schemas/a2a/notification.js +0 -203
  285. package/dist/types/schemas/a2a/parameters.d.ts +0 -956
  286. package/dist/types/schemas/a2a/parameters.js +0 -241
  287. package/dist/types/schemas/a2a/protocol.d.ts +0 -14363
  288. package/dist/types/schemas/a2a/protocol.js +0 -59
  289. package/dist/types/schemas/a2a/rpc.d.ts +0 -182
  290. package/dist/types/schemas/a2a/rpc.js +0 -126
  291. package/dist/types/schemas/a2a/task.d.ts +0 -5886
  292. package/dist/types/schemas/a2a/task.js +0 -134
  293. package/dist/types/schemas/a2a/transport.d.ts +0 -31
  294. package/dist/types/schemas/a2a/transport.js +0 -28
  295. package/dist/types/schemas/index.d.ts +0 -1
  296. package/dist/types/schemas/index.js +0 -1
  297. package/dist/utils/logging/index.d.ts +0 -2
  298. package/dist/utils/logging/index.js +0 -2
  299. package/dist/utils/logging/log.d.ts +0 -33
  300. package/dist/utils/logging/log.js +0 -75
  301. package/dist/utils/logging/logger.d.ts +0 -18
  302. package/dist/utils/logging/logger.js +0 -18
  303. package/dist/utils/storage/memory.d.ts +0 -25
  304. package/dist/utils/storage/memory.js +0 -47
  305. /package/dist/{types/interfaces/services → browser/types}/a2a/builder.js +0 -0
  306. /package/dist/{types/interfaces → browser/types}/client.js +0 -0
  307. /package/dist/{types/interfaces/services/core/managers/task.js → browser/types/core/core.js} +0 -0
  308. /package/dist/{types/interfaces/services → browser/types}/protocol.d.ts +0 -0
  309. /package/dist/{types/interfaces/services → browser/types}/protocol.js +0 -0
  310. /package/dist/{types/interfaces → browser/types}/storage.js +0 -0
  311. /package/dist/services/a2a/{state/update → handlers}/artifact.js +0 -0
  312. /package/dist/services/a2a/{methods → handlers}/index.d.ts +0 -0
  313. /package/dist/services/a2a/{methods → handlers}/index.js +0 -0
  314. /package/dist/types/{interfaces/services/a2a/context.js → a2a/builder.js} +0 -0
  315. /package/dist/types/{interfaces/services/a2a/engine.js → client.js} +0 -0
  316. /package/dist/types/{interfaces/services/a2a/legacy.js → storage.js} +0 -0
@@ -2,131 +2,18 @@
2
2
  * Copyright 2025 The Artinet Project
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- /**
6
- * @fileoverview A2A Context Factory Functions
7
- *
8
- * This module provides factory functions for creating A2A execution contexts
9
- * and command channels. It handles the composition of various context components
10
- * including command proxies, event managers, and cancellation mechanisms.
11
- *
12
- * @module A2AContextFactory
13
- * @version 0.5.7
14
- * @since 0.5.6
15
- * @author The Artinet Project
16
- */
17
- import { Command, ReceiveCommandProxyInterface, State, Update, Context, A2AServiceInterface, ContextManagerInterface, EventManagerOptions } from "../../../types/index.js";
18
- /**
19
- * Creates a command channel proxy for the given command.
20
- *
21
- * This function wraps a command in a proxy interface that provides
22
- * controlled access to command data and may add additional functionality
23
- * such as validation, logging, or transformation.
24
- *
25
- * @template TCommand - The command type, must extend Command
26
- * @param request - The command to wrap in a proxy
27
- * @returns Command proxy interface for the request
28
- *
29
- * @example
30
- * ```typescript
31
- * const command: MessageSendParams = {
32
- * message: {
33
- * content: 'Hello, world!',
34
- * recipient: 'agent-123'
35
- * }
36
- * };
37
- *
38
- * const commandProxy = createCommandChannel(command);
39
- * // Use commandProxy to access command data safely
40
- * ```
41
- *
42
- * @public
43
- * @since 0.5.6
44
- */
45
- export declare function createCommandChannel<TCommand extends Command = Command>(request: TCommand): ReceiveCommandProxyInterface<TCommand>;
46
- /**
47
- * Creates a complete A2A execution context for command processing.
48
- *
49
- * This is the main factory function for creating execution contexts in the A2A
50
- * framework. It assembles all the necessary components including command proxy,
51
- * event management, cancellation handling, and state management into a cohesive
52
- * execution environment.
53
- *
54
- * The context serves as the primary execution environment passed to execution
55
- * engines and provides access to all the resources and capabilities needed
56
- * for command processing.
57
- *
58
- * @template TCommand - The command type, must extend Command
59
- * @template TState - The state type, must extend State
60
- * @template TUpdate - The update type, must extend Update
61
- *
62
- * @param request - The command to execute
63
- * @param service - The A2A service instance
64
- * @param contextManager - Manager for context lifecycle
65
- * @param abortSignal - Optional abort signal for cancellation
66
- * @param contextId - Optional context ID (generates UUID if not provided)
67
- * @param eventOverrides - Optional event manager configuration overrides
68
- * @returns Fully configured execution context
69
- *
70
- * @example
71
- * ```typescript
72
- * // Basic context creation
73
- * const context = createContext(
74
- * messageCommand,
75
- * a2aService,
76
- * contextManager
77
- * );
78
- *
79
- * // Execute with the context
80
- * for await (const update of engine(context)) {
81
- * console.log('Update:', update);
82
- * }
83
- * ```
84
- *
85
- * @example
86
- * ```typescript
87
- * // Context creation with custom options
88
- * const abortController = new AbortController();
89
- * const customEventOptions = {
90
- * onStart: async (ctx) => {
91
- * console.log('Custom start handler');
92
- * return initialState;
93
- * }
94
- * };
95
- *
96
- * const context = createContext(
97
- * command,
98
- * service,
99
- * contextManager,
100
- * abortController.signal,
101
- * 'custom-context-id',
102
- * customEventOptions
103
- * );
104
- *
105
- * // Cancel after 30 seconds
106
- * setTimeout(() => abortController.abort(), 30000);
107
- * ```
108
- *
109
- * @remarks
110
- * **Context Lifecycle:**
111
- * 1. Command proxy is created to wrap the incoming request
112
- * 2. Event manager is instantiated with service and override options
113
- * 3. Cancellation mechanisms are configured (abort signal + service cancellation)
114
- * 4. State accessor is bound to the event manager
115
- * 5. Complete context is registered with the context manager
116
- *
117
- * **Cancellation Handling:**
118
- * The context provides multiple cancellation mechanisms:
119
- * - AbortSignal for standard cancellation patterns
120
- * - Service-level cancellation tracking
121
- * - Combined cancellation status through isCancelled()
122
- *
123
- * **Event Management:**
124
- * The context includes an event manager that handles:
125
- * - Execution lifecycle events (start, update, complete, error)
126
- * - State transitions and persistence
127
- * - Custom event handling through overrides
128
- *
129
- * @public
130
- * @since 0.5.6
131
- */
132
- export declare function createContext<TCommand extends Command = Command, TState extends State = State, TUpdate extends Update = Update>(request: TCommand, service: A2AServiceInterface<TCommand, TState, TUpdate>, contextManager: ContextManagerInterface<TCommand, TState, TUpdate>, abortSignal?: AbortSignal, contextId?: string, eventOverrides?: EventManagerOptions<TCommand, TState, TUpdate>): Context<TCommand, TState, TUpdate>;
5
+ import { A2A } from "../../../types/index.js";
6
+ export declare function createBaseContext({ contextId, service, task, overrides, abortSignal, }: {
7
+ contextId: string;
8
+ service: A2A.Service;
9
+ task?: A2A.Task;
10
+ overrides?: Partial<Omit<A2A.EventConsumer, "contextId">>;
11
+ abortSignal?: AbortSignal;
12
+ }): A2A.BaseContext;
13
+ export declare function createContext({ baseContext, taskId, messenger, extensions, references, }: {
14
+ baseContext: A2A.BaseContext;
15
+ taskId: string;
16
+ messenger: A2A.MessageConsumerProxy;
17
+ extensions?: A2A.AgentExtension[];
18
+ references?: A2A.Task[];
19
+ }): A2A.Context;
@@ -2,149 +2,44 @@
2
2
  * Copyright 2025 The Artinet Project
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- import { createEventManager } from "./event.js";
6
- import { v4 as uuidv4 } from "uuid";
7
- import { CommandChannel } from "../../core/managers/command.js";
8
5
  /**
9
- * Creates a command channel proxy for the given command.
10
- *
11
- * This function wraps a command in a proxy interface that provides
12
- * controlled access to command data and may add additional functionality
13
- * such as validation, logging, or transformation.
14
- *
15
- * @template TCommand - The command type, must extend Command
16
- * @param request - The command to wrap in a proxy
17
- * @returns Command proxy interface for the request
18
- *
19
- * @example
20
- * ```typescript
21
- * const command: MessageSendParams = {
22
- * message: {
23
- * content: 'Hello, world!',
24
- * recipient: 'agent-123'
25
- * }
26
- * };
27
- *
28
- * const commandProxy = createCommandChannel(command);
29
- * // Use commandProxy to access command data safely
30
- * ```
31
- *
32
- * @public
33
- * @since 0.5.6
34
- */
35
- export function createCommandChannel(request) {
36
- return CommandChannel.create(request);
37
- }
38
- /**
39
- * Creates a complete A2A execution context for command processing.
40
- *
41
- * This is the main factory function for creating execution contexts in the A2A
42
- * framework. It assembles all the necessary components including command proxy,
43
- * event management, cancellation handling, and state management into a cohesive
44
- * execution environment.
45
- *
46
- * The context serves as the primary execution environment passed to execution
47
- * engines and provides access to all the resources and capabilities needed
48
- * for command processing.
49
- *
50
- * @template TCommand - The command type, must extend Command
51
- * @template TState - The state type, must extend State
52
- * @template TUpdate - The update type, must extend Update
6
+ * @fileoverview A2A Context Factory Functions
53
7
  *
54
- * @param request - The command to execute
55
- * @param service - The A2A service instance
56
- * @param contextManager - Manager for context lifecycle
57
- * @param abortSignal - Optional abort signal for cancellation
58
- * @param contextId - Optional context ID (generates UUID if not provided)
59
- * @param eventOverrides - Optional event manager configuration overrides
60
- * @returns Fully configured execution context
8
+ * This module provides factory functions for creating A2A execution contexts
9
+ * and command channels. It handles the composition of various context components
10
+ * including command proxies, event managers, and cancellation mechanisms.
61
11
  *
62
- * @example
63
- * ```typescript
64
- * // Basic context creation
65
- * const context = createContext(
66
- * messageCommand,
67
- * a2aService,
68
- * contextManager
69
- * );
70
- *
71
- * // Execute with the context
72
- * for await (const update of engine(context)) {
73
- * console.log('Update:', update);
74
- * }
75
- * ```
76
- *
77
- * @example
78
- * ```typescript
79
- * // Context creation with custom options
80
- * const abortController = new AbortController();
81
- * const customEventOptions = {
82
- * onStart: async (ctx) => {
83
- * console.log('Custom start handler');
84
- * return initialState;
85
- * }
86
- * };
87
- *
88
- * const context = createContext(
89
- * command,
90
- * service,
91
- * contextManager,
92
- * abortController.signal,
93
- * 'custom-context-id',
94
- * customEventOptions
95
- * );
96
- *
97
- * // Cancel after 30 seconds
98
- * setTimeout(() => abortController.abort(), 30000);
99
- * ```
100
- *
101
- * @remarks
102
- * **Context Lifecycle:**
103
- * 1. Command proxy is created to wrap the incoming request
104
- * 2. Event manager is instantiated with service and override options
105
- * 3. Cancellation mechanisms are configured (abort signal + service cancellation)
106
- * 4. State accessor is bound to the event manager
107
- * 5. Complete context is registered with the context manager
108
- *
109
- * **Cancellation Handling:**
110
- * The context provides multiple cancellation mechanisms:
111
- * - AbortSignal for standard cancellation patterns
112
- * - Service-level cancellation tracking
113
- * - Combined cancellation status through isCancelled()
114
- *
115
- * **Event Management:**
116
- * The context includes an event manager that handles:
117
- * - Execution lifecycle events (start, update, complete, error)
118
- * - State transitions and persistence
119
- * - Custom event handling through overrides
120
- *
121
- * @public
12
+ * @module A2AContextFactory
13
+ * @version 0.6.0-preview
122
14
  * @since 0.5.6
15
+ * @author The Artinet Project
123
16
  */
124
- export function createContext(request, service, contextManager, abortSignal = new AbortController().signal, contextId = uuidv4(), eventOverrides) {
125
- // Note: Context reuse logic is currently disabled for testing
126
- // Future versions may re-enable context reuse for performance optimization
127
- // if (contextId && contextId.length > 0) {
128
- // //disable for testing
129
- // const context = contextManager.getContext(contextId);
130
- // if (!context) {
131
- // console.error("createExecutionContext", contextId, "Context not found");
132
- // throw new TRPCError({
133
- // code: "NOT_FOUND",
134
- // message: "Context not found",
135
- // });
136
- // }
137
- // return context;
138
- // }
139
- let newEventManager;
17
+ import { createStateMachine } from "./state-machine.js";
18
+ import { v4 as uuidv4 } from "uuid";
19
+ export function createBaseContext({ contextId = uuidv4(), service, task, overrides, abortSignal = new AbortController().signal, }) {
20
+ const isCancelled = async () => (await service.cancellations.has(task?.id ?? contextId)) ||
21
+ abortSignal.aborted;
22
+ const getState = async (args) => args ? await service.tasks.get(args) : task;
140
23
  const context = {
141
24
  contextId: contextId,
142
- command: createCommandChannel(request),
143
- events: (newEventManager = createEventManager(service, contextId, eventOverrides)),
144
- signal: abortSignal,
145
- isCancelled: () => abortSignal?.aborted || service.isCancelled(contextId),
146
- State: () => newEventManager.getState(),
25
+ service: service,
26
+ publisher: createStateMachine({ contextId, service, task, overrides }),
27
+ isCancelled,
28
+ abortSignal: abortSignal,
29
+ getState,
30
+ };
31
+ return context;
32
+ }
33
+ export function createContext({ baseContext, taskId, messenger, extensions, references, }) {
34
+ const getTask = async () => baseContext.publisher.currentTask;
35
+ const context = {
36
+ ...baseContext,
37
+ taskId: baseContext.publisher.currentTask.id ?? taskId,
38
+ userMessage: messenger.message,
39
+ messages: messenger,
40
+ getTask,
41
+ extensions: extensions,
42
+ references: references,
147
43
  };
148
- contextManager.setContext(contextId, context);
149
44
  return context;
150
45
  }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright 2025 The Artinet Project
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { A2A } from "../../../types/index.js";
6
+ export declare function createHandler(methods?: Omit<Partial<A2A.RequestHandler>, "getAgentCard">): Omit<A2A.RequestHandler, "getAgentCard">;
@@ -2,8 +2,8 @@
2
2
  * Copyright 2025 The Artinet Project
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- import { getTask, cancelTask, sendMessage, streamMessage, resubscribe, } from "../methods/index.js";
6
- export function createMethods(methods) {
5
+ import { getTask, cancelTask, sendMessage, streamMessage, resubscribe, } from "../handlers/index.js";
6
+ export function createHandler(methods) {
7
7
  return {
8
8
  getTask: methods?.getTask ?? getTask,
9
9
  cancelTask: methods?.cancelTask ?? cancelTask,
@@ -1,5 +1,4 @@
1
1
  export * from "./context.js";
2
2
  export * from "./builder.js";
3
- export * from "./event.js";
4
- export * from "./method.js";
3
+ export * from "./state-machine.js";
5
4
  export * from "./service.js";
@@ -1,5 +1,4 @@
1
1
  export * from "./context.js";
2
2
  export * from "./builder.js";
3
- export * from "./event.js";
4
- export * from "./method.js";
3
+ export * from "./state-machine.js";
5
4
  export * from "./service.js";
@@ -1,9 +1,22 @@
1
+ import { A2A } from "../../../types/index.js";
2
+ import { Service } from "../service.js";
3
+ export type AgentCardParams = (Partial<A2A.AgentCard> & Required<Pick<A2A.AgentCard, "name">>) | string;
4
+ export interface ServiceParams {
5
+ agentCard: AgentCardParams;
6
+ engine: A2A.Engine;
7
+ contexts?: A2A.Contexts;
8
+ streams?: A2A.Streams;
9
+ connections?: A2A.Connections;
10
+ cancellations?: A2A.Cancellations;
11
+ tasks?: A2A.Tasks;
12
+ methods?: Omit<A2A.RequestHandler, "getAgentCard">;
13
+ overrides?: Partial<Omit<A2A.EventConsumer, "contextId">>;
14
+ }
15
+ export type CreateAgentParams = ServiceParams;
16
+ export declare function createService(params: ServiceParams): Service;
17
+ export declare const createAgent: typeof createService;
18
+ export type AgentHandler = ReturnType<typeof createService>;
1
19
  /**
2
- * Copyright 2025 The Artinet Project
3
- * SPDX-License-Identifier: Apache-2.0
20
+ * @deprecated Use AgentHandler instead
4
21
  */
5
- import { FactoryParams } from "../../../types/index.js";
6
- import { A2AService } from "../service.js";
7
- export declare function createService(params: FactoryParams): A2AService;
8
- export declare const createAgent: typeof createService;
9
- export type AgentImpl = ReturnType<typeof createAgent>;
22
+ export type AgentImpl = AgentHandler;
@@ -2,11 +2,11 @@
2
2
  * Copyright 2025 The Artinet Project
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- import { A2AService } from "../service.js";
6
- import { ContextManager, ConnectionManager, CancellationManager, TaskManager, } from "../managers/index.js";
7
- import { createMethods } from "./method.js";
5
+ import { createHandler } from "./handler.js";
8
6
  import { createAgentCard } from "../helpers/agentcard-builder.js";
7
+ import { Service } from "../service.js";
8
+ import { Contexts, Streams, Connections, Cancellations, Tasks, } from "../managers.js";
9
9
  export function createService(params) {
10
- return new A2AService(createAgentCard(params.agentCard), params.engine, params.contexts ?? new ContextManager(), params.connections ?? new ConnectionManager(), params.cancellations ?? new CancellationManager(), params.tasks ?? new TaskManager(), createMethods(params.methods), params.events);
10
+ return new Service(createAgentCard(params.agentCard), params.engine, params.connections ?? new Connections(), params.cancellations ?? new Cancellations(), params.tasks ?? new Tasks(), params.contexts ?? new Contexts(), params.streams ?? new Streams(), createHandler(params.methods), params.overrides);
11
11
  }
12
12
  export const createAgent = createService;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright 2025 The Artinet Project
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { A2A } from "../../../types/index.js";
6
+ export declare function createStateMachine({ contextId, service, task: currentTask, overrides, }: {
7
+ contextId: string;
8
+ service: A2A.Service;
9
+ task?: A2A.Task;
10
+ overrides?: Partial<Omit<A2A.EventConsumer, "contextId">>;
11
+ }): A2A.EventPublisher;
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Copyright 2025 The Artinet Project
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { StateMachine } from "../state-machine.js";
6
+ import { logger } from "../../../config/index.js";
7
+ import { TASK_NOT_FOUND, CANCEL_UPDATE, FAILED_UPDATE } from "../../../utils/index.js";
8
+ import assert from "assert";
9
+ export function createStateMachine({ contextId, service, task: currentTask, overrides, }) {
10
+ const handler = {
11
+ contextId: contextId,
12
+ onStart: async (context) => {
13
+ assert(context.contextId === contextId, "context mismatch");
14
+ logger.info(`onStart[ctx:${contextId}]:`, { taskId: context.taskId });
15
+ await service.connections.set(context.contextId);
16
+ const task = await service.tasks.get(context.taskId);
17
+ // we now expect the task to be created by the service
18
+ // so if it's not found we throw an error
19
+ if (!task) {
20
+ throw TASK_NOT_FOUND({ taskId: context.taskId, contextId: contextId });
21
+ }
22
+ return task;
23
+ },
24
+ onCancel: async (update, task) => {
25
+ logger.info(`onCancel[ctx:${contextId}]:`, "cancellation triggered");
26
+ logger.debug(`onCancel[ctx:${contextId}]:`, "arguments", update, task);
27
+ await service.cancellations.set(task.id);
28
+ const cancellation = CANCEL_UPDATE(task.id, task.contextId, update.status?.message);
29
+ await service.tasks.update((await service.contexts.get(contextId)), cancellation);
30
+ },
31
+ onUpdate: async (update, task) => {
32
+ logger.info(`onUpdate[ctx:${contextId}]:`);
33
+ logger.debug(`onUpdate[ctx:${contextId}]:`, { taskId: task.id });
34
+ if (await service.cancellations.has(task.id)) {
35
+ logger.warn(`onUpdate[ctx:${contextId}]:`, { taskId: task.id }, "task is cancelled, no longer processing updates");
36
+ return task;
37
+ }
38
+ return await service.tasks.update((await service.contexts.get(contextId)), update);
39
+ },
40
+ onError: async (error, task) => {
41
+ logger.error(`onError[ctx:${contextId}]:`, error);
42
+ if (!task) {
43
+ logger.error(`onError[ctx:${contextId}]:`, new Error("task not found"));
44
+ return;
45
+ }
46
+ const errorUpdate = FAILED_UPDATE(task.id, contextId, undefined, error instanceof Error ? error.message : String(error));
47
+ await service.tasks
48
+ .update((await service.contexts.get(contextId)), errorUpdate)
49
+ .catch((error) => {
50
+ //we capture errors thrown during error handling to ensure we trigger completion gracefully
51
+ logger.error(`onError[ctx:${contextId}]:`, error);
52
+ });
53
+ },
54
+ onComplete: async (task) => {
55
+ assert(task.contextId === contextId, "context mismatch");
56
+ logger.info(`onComplete[ctx:${contextId}]:`, { taskId: task.id });
57
+ await service.cancellations.delete(task.id);
58
+ await service.connections.delete(task.contextId);
59
+ await service.contexts.delete(task.contextId);
60
+ },
61
+ };
62
+ return new StateMachine(contextId, {
63
+ ...handler,
64
+ ...overrides,
65
+ }, currentTask);
66
+ }
@@ -2,9 +2,9 @@
2
2
  * Copyright 2025 The Artinet Project
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- import { Artifact } from "../../../../types/index.js";
6
- export declare function updateByIndex(append: boolean, artifacts: Artifact[], index: number, artifactUpdate: Artifact): {
7
- artifacts: Artifact[];
5
+ import { A2A } from "../../../types/index.js";
6
+ export declare function updateByIndex(append: boolean, artifacts: A2A.Artifact[], index: number, artifactUpdate: A2A.Artifact): {
7
+ artifacts: A2A.Artifact[];
8
8
  replaced: boolean;
9
9
  };
10
- export declare function processArtifactUpdate(append: boolean, artifacts: Artifact[], artifactUpdate: Artifact): Artifact[];
10
+ export declare function processArtifactUpdate(append: boolean, artifacts: A2A.Artifact[], artifactUpdate: A2A.Artifact): A2A.Artifact[];
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright 2025 The Artinet Project
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { A2A } from "../../../types/index.js";
6
+ export declare const cancelTask: A2A.RequestHandler["cancelTask"];
7
+ export type CancelTaskHandler = typeof cancelTask;
8
+ /**
9
+ * @deprecated Use CancelTaskHandler instead
10
+ */
11
+ export type CancelTaskMethod = CancelTaskHandler;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Copyright 2025 The Artinet Project
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { A2A } from "../../../types/index.js";
6
+ import { FINAL_STATES, TASK_NOT_FOUND, TASK_NOT_CANCELABLE, INTERNAL_ERROR, } from "../../../utils/index.js";
7
+ export const cancelTask = async ({ id: taskId }, context) => {
8
+ if (!context) {
9
+ throw INTERNAL_ERROR({ error: { message: "Context is required" } });
10
+ }
11
+ const service = context.service;
12
+ const task = await service.tasks.get(taskId);
13
+ if (!task) {
14
+ throw TASK_NOT_FOUND({ taskId });
15
+ }
16
+ if (FINAL_STATES.includes(task.status.state)) {
17
+ throw TASK_NOT_CANCELABLE("Task is in a final state: " + task.status.state);
18
+ }
19
+ service.cancellations.set(taskId);
20
+ const cancelledTask = {
21
+ ...task,
22
+ status: {
23
+ ...task.status,
24
+ state: A2A.TaskState.canceled,
25
+ },
26
+ };
27
+ context.publisher?.on("complete", async () => {
28
+ await service.cancellations.delete(taskId);
29
+ await service.contexts.delete(context.contextId);
30
+ });
31
+ await context.publisher.onCancel(cancelledTask);
32
+ return cancelledTask;
33
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright 2025 The Artinet Project
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { A2A } from "../../../types/index.js";
6
+ export declare const getTask: A2A.RequestHandler["getTask"];
7
+ export type GetTaskHandler = typeof getTask;
8
+ /**
9
+ * @deprecated Use GetTaskHandler instead
10
+ */
11
+ export type GetTaskMethod = GetTaskHandler;
@@ -0,0 +1,13 @@
1
+ import { TASK_NOT_FOUND, INTERNAL_ERROR } from "../../../utils/index.js";
2
+ import { getLatestHistory } from "../helpers/index.js";
3
+ export const getTask = async ({ id: taskId, historyLength }, context) => {
4
+ if (!context) {
5
+ throw INTERNAL_ERROR({ error: { message: "Context is required" } });
6
+ }
7
+ const task = await context.service.tasks.get(taskId);
8
+ if (!task) {
9
+ throw TASK_NOT_FOUND({ taskId });
10
+ }
11
+ task.history = getLatestHistory(task, historyLength);
12
+ return task;
13
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright 2025 The Artinet Project
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { A2A } from "../../../types/index.js";
6
+ export declare const resubscribe: A2A.RequestHandler["resubscribe"];
7
+ export type TaskResubscribeHandler = typeof resubscribe;
8
+ /**
9
+ * @deprecated Use ResubscribeTaskHandler instead
10
+ */
11
+ export type ResubscribeTaskMethod = TaskResubscribeHandler;
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Copyright 2025 The Artinet Project
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { A2A } from "../../../types/index.js";
6
+ import { FINAL_STATES, INTERNAL_ERROR, TASK_NOT_FOUND } from "../../../utils/index.js";
7
+ const flush = (task, stream) => {
8
+ if (task.artifacts && task.artifacts.length > 0) {
9
+ for (const artifact of task.artifacts) {
10
+ const artifactUpdate = {
11
+ kind: A2A.Kind["artifact-update"],
12
+ taskId: task.id,
13
+ contextId: task.contextId,
14
+ artifact,
15
+ lastChunk: task.artifacts.length === 1,
16
+ metadata: task.metadata,
17
+ };
18
+ stream.updates.push(artifactUpdate);
19
+ task.artifacts.shift();
20
+ }
21
+ }
22
+ };
23
+ export const resubscribe = async function* ({ id: taskId }, context) {
24
+ if (!context) {
25
+ throw INTERNAL_ERROR({ error: { message: "Context is required" } });
26
+ }
27
+ const service = context.service;
28
+ if (!(await service.tasks.has(taskId))) {
29
+ throw TASK_NOT_FOUND({ taskId });
30
+ }
31
+ const stream = (await service.streams.get(context.contextId)) ??
32
+ (await service.streams.create({
33
+ contextId: context.contextId,
34
+ context,
35
+ }));
36
+ // since we already checked if the task exists
37
+ // then we dont care about the upsert in onStart
38
+ // so we can just push the update and continue
39
+ context.publisher.on("start", async (_, task) => {
40
+ stream.updates.push({
41
+ kind: "status-update",
42
+ taskId: task.id,
43
+ contextId: task.contextId,
44
+ status: task.status,
45
+ final: false,
46
+ metadata: task.metadata,
47
+ });
48
+ if (FINAL_STATES.includes(task.status.state)) {
49
+ flush(task, stream);
50
+ await stream.kill();
51
+ }
52
+ });
53
+ yield* stream.run({
54
+ service: service,
55
+ });
56
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright 2025 The Artinet Project
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { A2A } from "../../../types/index.js";
6
+ export declare const sendMessage: A2A.RequestHandler["sendMessage"];
7
+ export type SendMessageHandler = typeof sendMessage;
8
+ /**
9
+ * @deprecated Use SendMessageHandler instead
10
+ */
11
+ export type SendMessageMethod = SendMessageHandler;