@artinet/sdk 0.5.18 → 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 (399) hide show
  1. package/README.md +36 -617
  2. package/dist/browser/browser.d.ts +1 -1
  3. package/dist/browser/browser.js +1 -1
  4. package/dist/browser/client/a2a-client.d.ts +19 -18
  5. package/dist/browser/client/a2a-client.js +18 -6
  6. package/dist/browser/config/index.d.ts +158 -0
  7. package/dist/browser/config/index.js +155 -0
  8. package/dist/browser/config/observability.d.ts +119 -0
  9. package/dist/browser/config/observability.js +35 -0
  10. package/dist/browser/services/a2a/helpers/message-builder.d.ts +13 -8
  11. package/dist/browser/services/a2a/helpers/message-builder.js +5 -0
  12. package/dist/browser/transport/rpc/parser.d.ts +2 -2
  13. package/dist/browser/transport/rpc/parser.js +6 -6
  14. package/dist/browser/transport/rpc/rpc-client.d.ts +5 -5
  15. package/dist/browser/transport/rpc/rpc-client.js +6 -6
  16. package/dist/browser/transport/streaming/event-stream.d.ts +3 -3
  17. package/dist/browser/transport/streaming/event-stream.js +11 -10
  18. package/dist/browser/types/a2a/a2a.d.ts +378 -0
  19. package/dist/browser/types/a2a/a2a.js +14 -0
  20. package/dist/browser/types/a2a/builder.d.ts +43 -0
  21. package/dist/browser/types/a2a/index.d.ts +3 -0
  22. package/dist/browser/types/a2a/index.js +2 -0
  23. package/dist/{types/interfaces → browser/types}/client.d.ts +25 -27
  24. package/dist/browser/types/core/core.d.ts +31 -0
  25. package/dist/browser/types/core/index.d.ts +1 -0
  26. package/dist/browser/types/core/index.js +1 -0
  27. package/dist/browser/types/index.d.ts +6 -3
  28. package/dist/browser/types/index.js +6 -3
  29. package/dist/browser/types/mcp/index.d.ts +1 -0
  30. package/dist/browser/types/mcp/index.js +1 -0
  31. package/dist/browser/types/{interfaces/services/mcp/service.d.ts → mcp/mcp.d.ts} +4 -3
  32. package/dist/browser/types/{interfaces/services/a2a/context.js → mcp/mcp.js} +1 -1
  33. package/dist/browser/types/storage.d.ts +21 -0
  34. package/dist/browser/utils/common/constants.d.ts +7 -7
  35. package/dist/browser/utils/common/constants.js +9 -9
  36. package/dist/browser/utils/common/errors.d.ts +18 -18
  37. package/dist/browser/utils/common/errors.js +14 -14
  38. package/dist/browser/utils/common/utils.d.ts +23 -0
  39. package/dist/browser/utils/common/utils.js +32 -0
  40. package/dist/client/a2a-client.d.ts +19 -18
  41. package/dist/client/a2a-client.js +18 -6
  42. package/dist/config/default.d.ts +50 -0
  43. package/dist/config/default.js +62 -0
  44. package/dist/config/index.d.ts +158 -0
  45. package/dist/config/index.js +155 -0
  46. package/dist/config/observability.d.ts +119 -0
  47. package/dist/config/observability.js +35 -0
  48. package/dist/extensions/otel.d.ts +98 -0
  49. package/dist/extensions/otel.js +190 -0
  50. package/dist/extensions/pino.d.ts +44 -0
  51. package/dist/extensions/pino.js +107 -0
  52. package/dist/extensions/winston.d.ts +47 -0
  53. package/dist/extensions/winston.js +114 -0
  54. package/dist/index.d.ts +2 -0
  55. package/dist/index.js +2 -0
  56. package/dist/server/express/errors.js +3 -3
  57. package/dist/server/express/middeware.d.ts +2 -2
  58. package/dist/server/express/middeware.js +11 -4
  59. package/dist/server/express/server.d.ts +9 -56
  60. package/dist/server/express/server.js +21 -28
  61. package/dist/services/a2a/execute.d.ts +6 -0
  62. package/dist/services/a2a/execute.js +25 -0
  63. package/dist/services/a2a/factory/builder.d.ts +21 -80
  64. package/dist/services/a2a/factory/builder.js +20 -15
  65. package/dist/services/a2a/factory/context.d.ts +15 -128
  66. package/dist/services/a2a/factory/context.js +31 -136
  67. package/dist/services/a2a/factory/handler.d.ts +6 -0
  68. package/dist/services/a2a/factory/{method.js → handler.js} +2 -2
  69. package/dist/services/a2a/factory/index.d.ts +1 -2
  70. package/dist/services/a2a/factory/index.js +1 -2
  71. package/dist/services/a2a/factory/service.d.ts +20 -7
  72. package/dist/services/a2a/factory/service.js +4 -4
  73. package/dist/services/a2a/factory/state-machine.d.ts +11 -0
  74. package/dist/services/a2a/factory/state-machine.js +66 -0
  75. package/dist/services/a2a/{state/update → handlers}/artifact.d.ts +4 -4
  76. package/dist/services/a2a/handlers/cancel-task.d.ts +11 -0
  77. package/dist/services/a2a/handlers/cancel-task.js +33 -0
  78. package/dist/services/a2a/handlers/get-task.d.ts +11 -0
  79. package/dist/services/a2a/handlers/get-task.js +13 -0
  80. package/dist/services/a2a/handlers/resubscribe-task.d.ts +11 -0
  81. package/dist/services/a2a/handlers/resubscribe-task.js +56 -0
  82. package/dist/services/a2a/handlers/send-message.d.ts +11 -0
  83. package/dist/services/a2a/handlers/send-message.js +35 -0
  84. package/dist/services/a2a/handlers/stream-message.d.ts +11 -0
  85. package/dist/services/a2a/handlers/stream-message.js +19 -0
  86. package/dist/services/a2a/handlers/update.d.ts +17 -0
  87. package/dist/services/a2a/handlers/update.js +114 -0
  88. package/dist/services/a2a/helpers/agentcard-builder.d.ts +9 -5
  89. package/dist/services/a2a/helpers/agentcard-builder.js +4 -0
  90. package/dist/services/a2a/helpers/content.d.ts +2 -2
  91. package/dist/services/a2a/helpers/content.js +4 -0
  92. package/dist/services/a2a/helpers/history.d.ts +6 -2
  93. package/dist/services/a2a/helpers/history.js +4 -0
  94. package/dist/services/a2a/helpers/index.d.ts +2 -2
  95. package/dist/services/a2a/helpers/index.js +2 -2
  96. package/dist/services/a2a/helpers/message-builder.d.ts +13 -8
  97. package/dist/services/a2a/helpers/message-builder.js +5 -0
  98. package/dist/services/a2a/helpers/part.d.ts +9 -9
  99. package/dist/services/a2a/helpers/references.d.ts +6 -0
  100. package/dist/services/a2a/helpers/references.js +22 -0
  101. package/dist/services/a2a/index.d.ts +9 -5
  102. package/dist/services/a2a/index.js +8 -5
  103. package/dist/services/a2a/managers.d.ts +23 -0
  104. package/dist/services/a2a/managers.js +95 -0
  105. package/dist/services/a2a/messenger.d.ts +35 -0
  106. package/dist/services/{core/managers/command.js → a2a/messenger.js} +27 -31
  107. package/dist/services/a2a/service.d.ts +41 -372
  108. package/dist/services/a2a/service.js +238 -83
  109. package/dist/services/a2a/state-machine.d.ts +18 -0
  110. package/dist/services/a2a/state-machine.js +76 -0
  111. package/dist/services/a2a/streams.d.ts +22 -0
  112. package/dist/services/a2a/streams.js +98 -0
  113. package/dist/services/core/index.d.ts +1 -2
  114. package/dist/services/core/index.js +1 -2
  115. package/dist/services/core/manager.d.ts +15 -0
  116. package/dist/services/core/manager.js +42 -0
  117. package/dist/services/mcp/service.d.ts +11 -15
  118. package/dist/services/mcp/service.js +16 -15
  119. package/dist/transport/index.d.ts +0 -1
  120. package/dist/transport/index.js +1 -1
  121. package/dist/transport/rpc/parser.d.ts +2 -2
  122. package/dist/transport/rpc/parser.js +6 -6
  123. package/dist/transport/rpc/rpc-client.d.ts +5 -5
  124. package/dist/transport/rpc/rpc-client.js +6 -6
  125. package/dist/transport/streaming/event-stream.d.ts +3 -3
  126. package/dist/transport/streaming/event-stream.js +11 -10
  127. package/dist/transport/trpc/a2a/factory/router.d.ts +479 -871
  128. package/dist/transport/trpc/a2a/factory/router.js +2 -2
  129. package/dist/transport/trpc/a2a/routes/info.d.ts +108 -8
  130. package/dist/transport/trpc/a2a/routes/info.js +6 -2
  131. package/dist/transport/trpc/a2a/routes/message/route.d.ts +113 -162
  132. package/dist/transport/trpc/a2a/routes/message/route.js +7 -13
  133. package/dist/transport/trpc/a2a/routes/tasks/route.d.ts +114 -212
  134. package/dist/transport/trpc/a2a/routes/tasks/route.js +16 -19
  135. package/dist/transport/trpc/a2a/trpc.d.ts +9 -253
  136. package/dist/types/a2a/a2a.d.ts +378 -0
  137. package/dist/types/a2a/a2a.js +14 -0
  138. package/dist/types/a2a/builder.d.ts +43 -0
  139. package/dist/types/a2a/index.d.ts +3 -0
  140. package/dist/types/a2a/index.js +2 -0
  141. package/dist/{browser/types/interfaces → types}/client.d.ts +25 -27
  142. package/dist/types/core/core.d.ts +31 -0
  143. package/dist/types/core/index.d.ts +1 -0
  144. package/dist/types/core/index.js +1 -0
  145. package/dist/types/index.d.ts +6 -3
  146. package/dist/types/index.js +6 -3
  147. package/dist/types/mcp/index.d.ts +1 -0
  148. package/dist/types/mcp/index.js +1 -0
  149. package/dist/types/{interfaces/services/mcp/service.d.ts → mcp/mcp.d.ts} +4 -3
  150. package/dist/{browser/types/interfaces/services/a2a/engine.js → types/mcp/mcp.js} +1 -1
  151. package/dist/types/storage.d.ts +21 -0
  152. package/dist/utils/common/constants.d.ts +7 -7
  153. package/dist/utils/common/constants.js +9 -9
  154. package/dist/utils/common/errors.d.ts +18 -18
  155. package/dist/utils/common/errors.js +14 -14
  156. package/dist/utils/common/parse.d.ts +7 -0
  157. package/dist/utils/common/parse.js +14 -0
  158. package/dist/utils/common/schema-validation.d.ts +1 -1
  159. package/dist/utils/common/schema-validation.js +7 -7
  160. package/dist/utils/common/utils.d.ts +23 -0
  161. package/dist/utils/common/utils.js +32 -0
  162. package/dist/utils/common/zAsyncIterable-v3.d.ts +1 -1
  163. package/dist/utils/common/zAsyncIterable-v3.js +2 -1
  164. package/dist/utils/index.d.ts +2 -3
  165. package/dist/utils/index.js +2 -3
  166. package/dist/utils/storage/file.d.ts +8 -17
  167. package/dist/utils/storage/file.js +44 -73
  168. package/package.json +73 -13
  169. package/dist/browser/types/ext.d.ts +0 -13
  170. package/dist/browser/types/ext.js +0 -10
  171. package/dist/browser/types/interfaces/index.d.ts +0 -3
  172. package/dist/browser/types/interfaces/index.js +0 -3
  173. package/dist/browser/types/interfaces/services/a2a/builder.d.ts +0 -37
  174. package/dist/browser/types/interfaces/services/a2a/context.d.ts +0 -162
  175. package/dist/browser/types/interfaces/services/a2a/engine.d.ts +0 -7
  176. package/dist/browser/types/interfaces/services/a2a/index.d.ts +0 -5
  177. package/dist/browser/types/interfaces/services/a2a/index.js +0 -5
  178. package/dist/browser/types/interfaces/services/a2a/legacy.d.ts +0 -93
  179. package/dist/browser/types/interfaces/services/a2a/legacy.js +0 -5
  180. package/dist/browser/types/interfaces/services/a2a/service.d.ts +0 -413
  181. package/dist/browser/types/interfaces/services/a2a/service.js +0 -5
  182. package/dist/browser/types/interfaces/services/core/context/command.d.ts +0 -25
  183. package/dist/browser/types/interfaces/services/core/context/command.js +0 -5
  184. package/dist/browser/types/interfaces/services/core/context/context.d.ts +0 -207
  185. package/dist/browser/types/interfaces/services/core/context/context.js +0 -5
  186. package/dist/browser/types/interfaces/services/core/context/index.d.ts +0 -3
  187. package/dist/browser/types/interfaces/services/core/context/index.js +0 -3
  188. package/dist/browser/types/interfaces/services/core/context/types.d.ts +0 -11
  189. package/dist/browser/types/interfaces/services/core/context/types.js +0 -5
  190. package/dist/browser/types/interfaces/services/core/execution/engine.d.ts +0 -106
  191. package/dist/browser/types/interfaces/services/core/execution/engine.js +0 -5
  192. package/dist/browser/types/interfaces/services/core/execution/environment.d.ts +0 -11
  193. package/dist/browser/types/interfaces/services/core/execution/environment.js +0 -5
  194. package/dist/browser/types/interfaces/services/core/execution/execute.d.ts +0 -7
  195. package/dist/browser/types/interfaces/services/core/execution/execute.js +0 -5
  196. package/dist/browser/types/interfaces/services/core/execution/index.d.ts +0 -3
  197. package/dist/browser/types/interfaces/services/core/execution/index.js +0 -3
  198. package/dist/browser/types/interfaces/services/core/index.d.ts +0 -4
  199. package/dist/browser/types/interfaces/services/core/index.js +0 -4
  200. package/dist/browser/types/interfaces/services/core/managers/cancellation.d.ts +0 -9
  201. package/dist/browser/types/interfaces/services/core/managers/cancellation.js +0 -5
  202. package/dist/browser/types/interfaces/services/core/managers/connection.d.ts +0 -9
  203. package/dist/browser/types/interfaces/services/core/managers/connection.js +0 -5
  204. package/dist/browser/types/interfaces/services/core/managers/context.d.ts +0 -17
  205. package/dist/browser/types/interfaces/services/core/managers/context.js +0 -5
  206. package/dist/browser/types/interfaces/services/core/managers/event.d.ts +0 -328
  207. package/dist/browser/types/interfaces/services/core/managers/event.js +0 -5
  208. package/dist/browser/types/interfaces/services/core/managers/index.d.ts +0 -6
  209. package/dist/browser/types/interfaces/services/core/managers/index.js +0 -6
  210. package/dist/browser/types/interfaces/services/core/managers/stream.d.ts +0 -217
  211. package/dist/browser/types/interfaces/services/core/managers/stream.js +0 -5
  212. package/dist/browser/types/interfaces/services/core/managers/task.d.ts +0 -9
  213. package/dist/browser/types/interfaces/services/core/service.d.ts +0 -115
  214. package/dist/browser/types/interfaces/services/core/service.js +0 -5
  215. package/dist/browser/types/interfaces/services/index.d.ts +0 -4
  216. package/dist/browser/types/interfaces/services/index.js +0 -4
  217. package/dist/browser/types/interfaces/services/mcp/index.d.ts +0 -1
  218. package/dist/browser/types/interfaces/services/mcp/index.js +0 -1
  219. package/dist/browser/types/interfaces/services/mcp/service.js +0 -5
  220. package/dist/browser/types/interfaces/storage.d.ts +0 -8
  221. package/dist/browser/types/schemas/a2a/agent.d.ts +0 -2583
  222. package/dist/browser/types/schemas/a2a/agent.js +0 -323
  223. package/dist/browser/types/schemas/a2a/auth.d.ts +0 -908
  224. package/dist/browser/types/schemas/a2a/auth.js +0 -283
  225. package/dist/browser/types/schemas/a2a/error.d.ts +0 -396
  226. package/dist/browser/types/schemas/a2a/error.js +0 -163
  227. package/dist/browser/types/schemas/a2a/index.d.ts +0 -11
  228. package/dist/browser/types/schemas/a2a/index.js +0 -11
  229. package/dist/browser/types/schemas/a2a/kind.d.ts +0 -11
  230. package/dist/browser/types/schemas/a2a/kind.js +0 -20
  231. package/dist/browser/types/schemas/a2a/message.d.ts +0 -10343
  232. package/dist/browser/types/schemas/a2a/message.js +0 -130
  233. package/dist/browser/types/schemas/a2a/notification.d.ts +0 -1517
  234. package/dist/browser/types/schemas/a2a/notification.js +0 -203
  235. package/dist/browser/types/schemas/a2a/parameters.d.ts +0 -956
  236. package/dist/browser/types/schemas/a2a/parameters.js +0 -241
  237. package/dist/browser/types/schemas/a2a/protocol.d.ts +0 -14363
  238. package/dist/browser/types/schemas/a2a/protocol.js +0 -59
  239. package/dist/browser/types/schemas/a2a/rpc.d.ts +0 -182
  240. package/dist/browser/types/schemas/a2a/rpc.js +0 -126
  241. package/dist/browser/types/schemas/a2a/task.d.ts +0 -5886
  242. package/dist/browser/types/schemas/a2a/task.js +0 -134
  243. package/dist/browser/types/schemas/a2a/transport.d.ts +0 -31
  244. package/dist/browser/types/schemas/a2a/transport.js +0 -28
  245. package/dist/browser/types/schemas/index.d.ts +0 -1
  246. package/dist/browser/types/schemas/index.js +0 -1
  247. package/dist/browser/utils/logging/index.d.ts +0 -2
  248. package/dist/browser/utils/logging/index.js +0 -2
  249. package/dist/browser/utils/logging/log.d.ts +0 -33
  250. package/dist/browser/utils/logging/log.js +0 -75
  251. package/dist/browser/utils/logging/logger.d.ts +0 -18
  252. package/dist/browser/utils/logging/logger.js +0 -18
  253. package/dist/services/a2a/factory/event.d.ts +0 -58
  254. package/dist/services/a2a/factory/event.js +0 -177
  255. package/dist/services/a2a/factory/method.d.ts +0 -6
  256. package/dist/services/a2a/managers/cancellation.d.ts +0 -11
  257. package/dist/services/a2a/managers/cancellation.js +0 -16
  258. package/dist/services/a2a/managers/connection.d.ts +0 -11
  259. package/dist/services/a2a/managers/connection.js +0 -16
  260. package/dist/services/a2a/managers/context.d.ts +0 -11
  261. package/dist/services/a2a/managers/context.js +0 -16
  262. package/dist/services/a2a/managers/index.d.ts +0 -5
  263. package/dist/services/a2a/managers/index.js +0 -5
  264. package/dist/services/a2a/managers/task.d.ts +0 -11
  265. package/dist/services/a2a/managers/task.js +0 -16
  266. package/dist/services/a2a/methods/cancel-task.d.ts +0 -7
  267. package/dist/services/a2a/methods/cancel-task.js +0 -43
  268. package/dist/services/a2a/methods/get-task.d.ts +0 -112
  269. package/dist/services/a2a/methods/get-task.js +0 -16
  270. package/dist/services/a2a/methods/resubscribe-task.d.ts +0 -7
  271. package/dist/services/a2a/methods/resubscribe-task.js +0 -80
  272. package/dist/services/a2a/methods/send-message.d.ts +0 -7
  273. package/dist/services/a2a/methods/send-message.js +0 -36
  274. package/dist/services/a2a/methods/stream-message.d.ts +0 -8
  275. package/dist/services/a2a/methods/stream-message.js +0 -21
  276. package/dist/services/a2a/state/index.d.ts +0 -3
  277. package/dist/services/a2a/state/index.js +0 -3
  278. package/dist/services/a2a/state/load.d.ts +0 -14
  279. package/dist/services/a2a/state/load.js +0 -71
  280. package/dist/services/a2a/state/process.d.ts +0 -7
  281. package/dist/services/a2a/state/process.js +0 -13
  282. package/dist/services/a2a/state/update/index.d.ts +0 -2
  283. package/dist/services/a2a/state/update/index.js +0 -2
  284. package/dist/services/a2a/state/update/update.d.ts +0 -23
  285. package/dist/services/a2a/state/update/update.js +0 -123
  286. package/dist/services/core/execution/execute.d.ts +0 -6
  287. package/dist/services/core/execution/execute.js +0 -25
  288. package/dist/services/core/execution/index.d.ts +0 -1
  289. package/dist/services/core/execution/index.js +0 -1
  290. package/dist/services/core/managers/command.d.ts +0 -39
  291. package/dist/services/core/managers/event.d.ts +0 -18
  292. package/dist/services/core/managers/event.js +0 -56
  293. package/dist/services/core/managers/index.d.ts +0 -3
  294. package/dist/services/core/managers/index.js +0 -3
  295. package/dist/services/core/managers/stream.d.ts +0 -20
  296. package/dist/services/core/managers/stream.js +0 -77
  297. package/dist/types/ext.d.ts +0 -13
  298. package/dist/types/ext.js +0 -10
  299. package/dist/types/interfaces/index.d.ts +0 -3
  300. package/dist/types/interfaces/index.js +0 -3
  301. package/dist/types/interfaces/services/a2a/builder.d.ts +0 -37
  302. package/dist/types/interfaces/services/a2a/context.d.ts +0 -162
  303. package/dist/types/interfaces/services/a2a/context.js +0 -5
  304. package/dist/types/interfaces/services/a2a/engine.d.ts +0 -7
  305. package/dist/types/interfaces/services/a2a/engine.js +0 -5
  306. package/dist/types/interfaces/services/a2a/index.d.ts +0 -5
  307. package/dist/types/interfaces/services/a2a/index.js +0 -5
  308. package/dist/types/interfaces/services/a2a/legacy.d.ts +0 -93
  309. package/dist/types/interfaces/services/a2a/legacy.js +0 -5
  310. package/dist/types/interfaces/services/a2a/service.d.ts +0 -413
  311. package/dist/types/interfaces/services/a2a/service.js +0 -5
  312. package/dist/types/interfaces/services/core/context/command.d.ts +0 -25
  313. package/dist/types/interfaces/services/core/context/command.js +0 -5
  314. package/dist/types/interfaces/services/core/context/context.d.ts +0 -207
  315. package/dist/types/interfaces/services/core/context/context.js +0 -5
  316. package/dist/types/interfaces/services/core/context/index.d.ts +0 -3
  317. package/dist/types/interfaces/services/core/context/index.js +0 -3
  318. package/dist/types/interfaces/services/core/context/types.d.ts +0 -11
  319. package/dist/types/interfaces/services/core/context/types.js +0 -5
  320. package/dist/types/interfaces/services/core/execution/engine.d.ts +0 -106
  321. package/dist/types/interfaces/services/core/execution/engine.js +0 -5
  322. package/dist/types/interfaces/services/core/execution/environment.d.ts +0 -11
  323. package/dist/types/interfaces/services/core/execution/environment.js +0 -5
  324. package/dist/types/interfaces/services/core/execution/execute.d.ts +0 -7
  325. package/dist/types/interfaces/services/core/execution/execute.js +0 -5
  326. package/dist/types/interfaces/services/core/execution/index.d.ts +0 -3
  327. package/dist/types/interfaces/services/core/execution/index.js +0 -3
  328. package/dist/types/interfaces/services/core/index.d.ts +0 -4
  329. package/dist/types/interfaces/services/core/index.js +0 -4
  330. package/dist/types/interfaces/services/core/managers/cancellation.d.ts +0 -9
  331. package/dist/types/interfaces/services/core/managers/cancellation.js +0 -5
  332. package/dist/types/interfaces/services/core/managers/connection.d.ts +0 -9
  333. package/dist/types/interfaces/services/core/managers/connection.js +0 -5
  334. package/dist/types/interfaces/services/core/managers/context.d.ts +0 -17
  335. package/dist/types/interfaces/services/core/managers/context.js +0 -5
  336. package/dist/types/interfaces/services/core/managers/event.d.ts +0 -328
  337. package/dist/types/interfaces/services/core/managers/event.js +0 -5
  338. package/dist/types/interfaces/services/core/managers/index.d.ts +0 -6
  339. package/dist/types/interfaces/services/core/managers/index.js +0 -6
  340. package/dist/types/interfaces/services/core/managers/stream.d.ts +0 -217
  341. package/dist/types/interfaces/services/core/managers/stream.js +0 -5
  342. package/dist/types/interfaces/services/core/managers/task.d.ts +0 -9
  343. package/dist/types/interfaces/services/core/service.d.ts +0 -115
  344. package/dist/types/interfaces/services/core/service.js +0 -5
  345. package/dist/types/interfaces/services/index.d.ts +0 -4
  346. package/dist/types/interfaces/services/index.js +0 -4
  347. package/dist/types/interfaces/services/mcp/index.d.ts +0 -1
  348. package/dist/types/interfaces/services/mcp/index.js +0 -1
  349. package/dist/types/interfaces/services/mcp/service.js +0 -5
  350. package/dist/types/interfaces/storage.d.ts +0 -8
  351. package/dist/types/schemas/a2a/agent.d.ts +0 -2583
  352. package/dist/types/schemas/a2a/agent.js +0 -323
  353. package/dist/types/schemas/a2a/auth.d.ts +0 -908
  354. package/dist/types/schemas/a2a/auth.js +0 -283
  355. package/dist/types/schemas/a2a/error.d.ts +0 -396
  356. package/dist/types/schemas/a2a/error.js +0 -163
  357. package/dist/types/schemas/a2a/index.d.ts +0 -11
  358. package/dist/types/schemas/a2a/index.js +0 -11
  359. package/dist/types/schemas/a2a/kind.d.ts +0 -11
  360. package/dist/types/schemas/a2a/kind.js +0 -20
  361. package/dist/types/schemas/a2a/message.d.ts +0 -10343
  362. package/dist/types/schemas/a2a/message.js +0 -130
  363. package/dist/types/schemas/a2a/notification.d.ts +0 -1517
  364. package/dist/types/schemas/a2a/notification.js +0 -203
  365. package/dist/types/schemas/a2a/parameters.d.ts +0 -956
  366. package/dist/types/schemas/a2a/parameters.js +0 -241
  367. package/dist/types/schemas/a2a/protocol.d.ts +0 -14363
  368. package/dist/types/schemas/a2a/protocol.js +0 -59
  369. package/dist/types/schemas/a2a/rpc.d.ts +0 -182
  370. package/dist/types/schemas/a2a/rpc.js +0 -126
  371. package/dist/types/schemas/a2a/task.d.ts +0 -5886
  372. package/dist/types/schemas/a2a/task.js +0 -134
  373. package/dist/types/schemas/a2a/transport.d.ts +0 -31
  374. package/dist/types/schemas/a2a/transport.js +0 -28
  375. package/dist/types/schemas/index.d.ts +0 -1
  376. package/dist/types/schemas/index.js +0 -1
  377. package/dist/utils/logging/index.d.ts +0 -2
  378. package/dist/utils/logging/index.js +0 -2
  379. package/dist/utils/logging/log.d.ts +0 -33
  380. package/dist/utils/logging/log.js +0 -75
  381. package/dist/utils/logging/logger.d.ts +0 -18
  382. package/dist/utils/logging/logger.js +0 -18
  383. package/dist/utils/storage/memory.d.ts +0 -25
  384. package/dist/utils/storage/memory.js +0 -47
  385. /package/dist/browser/types/{interfaces/services/a2a → a2a}/builder.js +0 -0
  386. /package/dist/browser/types/{interfaces/client.js → client.js} +0 -0
  387. /package/dist/browser/types/{interfaces/services/core/managers/task.js → core/core.js} +0 -0
  388. /package/dist/browser/types/{interfaces/services/protocol.d.ts → protocol.d.ts} +0 -0
  389. /package/dist/browser/types/{interfaces/services/protocol.js → protocol.js} +0 -0
  390. /package/dist/browser/types/{interfaces/storage.js → storage.js} +0 -0
  391. /package/dist/services/a2a/{state/update → handlers}/artifact.js +0 -0
  392. /package/dist/services/a2a/{methods → handlers}/index.d.ts +0 -0
  393. /package/dist/services/a2a/{methods → handlers}/index.js +0 -0
  394. /package/dist/types/{interfaces/services/a2a → a2a}/builder.js +0 -0
  395. /package/dist/types/{interfaces/client.js → client.js} +0 -0
  396. /package/dist/types/{interfaces/services/core/managers/task.js → core/core.js} +0 -0
  397. /package/dist/types/{interfaces/services/protocol.d.ts → protocol.d.ts} +0 -0
  398. /package/dist/types/{interfaces/services/protocol.js → protocol.js} +0 -0
  399. /package/dist/types/{interfaces/storage.js → storage.js} +0 -0
@@ -1,123 +0,0 @@
1
- /**
2
- * Copyright 2025 The Artinet Project
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- import { getCurrentTimestamp } from "../../../../utils/index.js";
6
- import { logError } from "../../../../utils/logging/index.js";
7
- import { processArtifactUpdate } from "./artifact.js";
8
- export var UpdateKind;
9
- (function (UpdateKind) {
10
- UpdateKind["Message"] = "message";
11
- UpdateKind["Task"] = "task";
12
- UpdateKind["StatusUpdate"] = "status-update";
13
- UpdateKind["ArtifactUpdate"] = "artifact-update";
14
- })(UpdateKind || (UpdateKind = {}));
15
- const isMessageInHistory = (task, message) => {
16
- return task.history?.find((msg) => msg.messageId === message.messageId);
17
- };
18
- const updateHistory = (current, updateMessage) => {
19
- if (!isMessageInHistory(current.task, updateMessage)) {
20
- // current.history = [...(current.history ?? []), updateMessage]; deprecating history
21
- current.task.history = [...(current.task.history ?? []), updateMessage];
22
- }
23
- };
24
- export const updateMessage = async (props) => {
25
- const { context, update } = props;
26
- if (!update || update.kind !== UpdateKind.Message) {
27
- logError("updateMessage", "Invalid update", update);
28
- return false;
29
- }
30
- context.latestUserMessage = update;
31
- return true;
32
- };
33
- export const updateTask = async (props) => {
34
- const { context, current, update } = props;
35
- if (!update || update.kind !== UpdateKind.Task) {
36
- logError("updateTask", "Invalid update kind", update);
37
- return false;
38
- }
39
- current.task = { ...current.task, ...update };
40
- if (context.latestUserMessage &&
41
- !isMessageInHistory(current.task, context.latestUserMessage)) {
42
- //todo seems that we can use updateHistory here instead (will change after we deprecate history fully & add update specific tests)
43
- current.task.history = [
44
- context.latestUserMessage,
45
- ...(current.task.history ?? []),
46
- ];
47
- // current.history = [context.latestUserMessage, ...(current.history ?? [])]; deprecating history
48
- }
49
- return true;
50
- };
51
- export const updateTaskStatusUpdate = async (props) => {
52
- const { current, update } = props;
53
- if (!update || update.kind !== UpdateKind.StatusUpdate) {
54
- logError("updateTaskStatusUpdate", "Invalid update kind", update);
55
- return false;
56
- }
57
- if (current.task.id === update.taskId) {
58
- current.task.status = update.status;
59
- current.task.status.timestamp = getCurrentTimestamp();
60
- if (update.status.message) {
61
- updateHistory(current, update.status.message);
62
- }
63
- return true;
64
- }
65
- logError("updateTaskStatusUpdate", "Invalid task id", update);
66
- return false;
67
- };
68
- export const updateTaskArtifactUpdate = async (props) => {
69
- const { current, update } = props;
70
- if (!update || update.kind !== UpdateKind.ArtifactUpdate) {
71
- logError("updateTaskArtifactUpdate", "Invalid update kind", update);
72
- return false;
73
- }
74
- if (current.task.id === update.taskId) {
75
- current.task.artifacts = processArtifactUpdate(update.append ?? false, current.task.artifacts ?? [], update.artifact);
76
- return true;
77
- }
78
- logError("updateTaskArtifactUpdate", "Invalid task id", update); //we should never get here, but just in case
79
- return true;
80
- };
81
- export const updateState = async (props) => {
82
- const { context, current, update } = props;
83
- if (!update || !update.kind) {
84
- logError("update", "Invalid update", update);
85
- return false;
86
- }
87
- if (!current || !current.task || !current.task.id) {
88
- logError("update", "Invalid current", current);
89
- return false;
90
- }
91
- if (!context || !context.contextId) {
92
- logError("update", "Invalid context", context);
93
- return false;
94
- }
95
- switch (update.kind) {
96
- case UpdateKind.Message:
97
- return updateMessage({
98
- context,
99
- current,
100
- update: update,
101
- });
102
- case UpdateKind.Task:
103
- return updateTask({
104
- context,
105
- current,
106
- update: update,
107
- });
108
- case UpdateKind.StatusUpdate:
109
- return updateTaskStatusUpdate({
110
- context,
111
- current,
112
- update: update,
113
- });
114
- case UpdateKind.ArtifactUpdate:
115
- return updateTaskArtifactUpdate({
116
- context,
117
- current,
118
- update: update,
119
- });
120
- default:
121
- return false;
122
- }
123
- };
@@ -1,6 +0,0 @@
1
- /**
2
- * Copyright 2025 The Artinet Project
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- import { ExecutionEngine, CoreState, CoreUpdate, CoreContext, CoreCommand } from "../../../types/index.js";
6
- export declare const coreExecute: <TCommand extends CoreCommand = CoreCommand, TUpdate extends CoreUpdate = CoreUpdate, TState extends CoreState = CoreState, TContext extends CoreContext<TCommand, TState, TUpdate> = CoreContext<TCommand, TState, TUpdate>>(engine: ExecutionEngine<TCommand, TState, TUpdate>, context: TContext) => Promise<void>;
@@ -1,25 +0,0 @@
1
- /**
2
- * Copyright 2025 The Artinet Project
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- export const coreExecute = async (engine, context) => {
6
- try {
7
- if (context.events.onStart) {
8
- await context.events.onStart(context);
9
- }
10
- for await (const update of engine(context)) {
11
- if (context.isCancelled() || context.signal.aborted) {
12
- await context.events.onCancel(update);
13
- break;
14
- }
15
- await context.events.onUpdate(update);
16
- }
17
- }
18
- catch (error) {
19
- context.events.onError(error);
20
- throw error;
21
- }
22
- finally {
23
- context.events.onComplete();
24
- }
25
- };
@@ -1 +0,0 @@
1
- export * from "./execute.js";
@@ -1 +0,0 @@
1
- export * from "./execute.js";
@@ -1,39 +0,0 @@
1
- /**
2
- * Copyright 2025 The Artinet Project
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- import { CoreCommand, CommandChannelInterface, CommandChannelProxyInterface, CommandChannelMap } from "../../../types/index.js";
6
- import { EventEmitter } from "events";
7
- export declare class CommandChannel<TCommand extends CoreCommand = CoreCommand> extends EventEmitter<CommandChannelMap<TCommand>> implements CommandChannelInterface<TCommand> {
8
- private readonly _command;
9
- private commands;
10
- private resolvers;
11
- private done;
12
- /**
13
- * @param command - The initial command to send
14
- * @note The initial command is tied to the channel and cannot be changed
15
- */
16
- constructor(_command: TCommand);
17
- /**
18
- * @returns True if the channel is open
19
- */
20
- get isOpen(): boolean;
21
- /**
22
- * @returns The list of commands
23
- */
24
- get commandList(): TCommand[];
25
- /**
26
- * @returns The current command
27
- */
28
- get command(): TCommand;
29
- /**
30
- * @returns The command channel as an async iterable
31
- */
32
- [Symbol.asyncIterator](): AsyncIterableIterator<TCommand, TCommand, TCommand | undefined>;
33
- valueOf(): TCommand;
34
- send(command: TCommand): void;
35
- close(): void;
36
- next(): Promise<IteratorResult<TCommand>>;
37
- return(value: TCommand): Promise<IteratorResult<TCommand>>;
38
- static create<TCommand extends CoreCommand = CoreCommand>(command: TCommand): CommandChannelProxyInterface<TCommand>;
39
- }
@@ -1,18 +0,0 @@
1
- /**
2
- * Copyright 2025 The Artinet Project
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- import { EventEmitter } from "events";
6
- import { EventManagerInterface, EventManagerOptions, CoreCommand, CoreState, CoreUpdate, CoreContext, EventManagerMap } from "../../../types/index.js";
7
- export declare class EventManager<TCommand extends CoreCommand = CoreCommand, TState extends CoreState = CoreState, TUpdate extends CoreUpdate = CoreUpdate> extends EventEmitter<EventManagerMap<TCommand, TState, TUpdate>> implements EventManagerInterface<TCommand, TState, TUpdate> {
8
- readonly contextId: string;
9
- private currentState;
10
- private options;
11
- constructor(contextId: string, options?: EventManagerOptions<TCommand, TState, TUpdate>);
12
- onStart: (context: CoreContext<TCommand, TState, TUpdate>) => Promise<TState>;
13
- onCancel: (nextState: TUpdate) => Promise<void>;
14
- onUpdate: (nextState: TUpdate) => Promise<TState>;
15
- onError: (error: any) => Promise<void>;
16
- onComplete: () => Promise<void>;
17
- getState: () => TState;
18
- }
@@ -1,56 +0,0 @@
1
- /**
2
- * Copyright 2025 The Artinet Project
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- import { EventEmitter } from "events";
6
- export class EventManager extends EventEmitter {
7
- contextId;
8
- currentState = {};
9
- options;
10
- constructor(contextId, options = {}) {
11
- super();
12
- this.contextId = contextId;
13
- this.options = options;
14
- }
15
- onStart = async (context) => {
16
- if (this.options.onStart) {
17
- this.currentState = await this.options.onStart(context);
18
- }
19
- this.emit("start", context.command, this.currentState);
20
- return this.currentState;
21
- };
22
- onCancel = async (nextState) => {
23
- if (this.options.onCancel) {
24
- await this.options.onCancel(this.currentState, nextState);
25
- }
26
- this.emit("cancel", nextState);
27
- };
28
- onUpdate = async (nextState) => {
29
- if (this.options.onUpdate) {
30
- this.currentState = await this.options.onUpdate(this.currentState, nextState);
31
- }
32
- else {
33
- this.currentState = nextState;
34
- }
35
- this.emit("update", this.currentState, nextState);
36
- return this.currentState;
37
- };
38
- onError = async (error) => {
39
- if (this.options.onError) {
40
- await this.options.onError(this.currentState, error);
41
- }
42
- this.emit("error", error, this.currentState);
43
- };
44
- onComplete = async () => {
45
- if (this.options.onComplete) {
46
- await this.options.onComplete(this.currentState);
47
- }
48
- this.emit("complete", this.currentState);
49
- };
50
- getState = () => {
51
- if (this.options.getState) {
52
- return this.options.getState();
53
- }
54
- return this.currentState;
55
- };
56
- }
@@ -1,3 +0,0 @@
1
- export * from "./command.js";
2
- export * from "./event.js";
3
- export * from "./stream.js";
@@ -1,3 +0,0 @@
1
- export * from "./command.js";
2
- export * from "./event.js";
3
- export * from "./stream.js";
@@ -1,20 +0,0 @@
1
- /**
2
- * Copyright 2025 The Artinet Project
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- import { StreamManagerInterface, ExecutionEngine, CoreContext, ServiceInterface, CoreCommand, CoreState, CoreUpdate } from "../../../types/index.js";
6
- export declare class StreamManager<TCommand extends CoreCommand = CoreCommand, TState extends CoreState = CoreState, TUpdate extends CoreUpdate = CoreUpdate> implements StreamManagerInterface<TCommand, TState, TUpdate> {
7
- private contextId;
8
- private completed;
9
- private updates;
10
- private executionContext;
11
- constructor(executionContext?: CoreContext<TCommand, TState, TUpdate>);
12
- getContextId(): string;
13
- addUpdate(update: TUpdate): void;
14
- getUpdates(): TUpdate[];
15
- isCompleted(): boolean;
16
- setCompleted(): void;
17
- getExecutionContext(): CoreContext<TCommand, TState, TUpdate>;
18
- setExecutionContext(executionContext: CoreContext<TCommand, TState, TUpdate>): void;
19
- stream(engine: ExecutionEngine<TCommand, TState, TUpdate>, service?: ServiceInterface<TCommand, TState, TUpdate>): AsyncGenerator<Awaited<NonNullable<TUpdate>>, void, unknown>;
20
- }
@@ -1,77 +0,0 @@
1
- /**
2
- * Copyright 2025 The Artinet Project
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- import { coreExecute } from "../execution/execute.js";
6
- export class StreamManager {
7
- contextId = null;
8
- completed = false;
9
- updates = [];
10
- executionContext = null;
11
- constructor(executionContext) {
12
- if (executionContext) {
13
- this.executionContext = executionContext;
14
- this.contextId = executionContext.events.contextId;
15
- }
16
- this.completed = false;
17
- this.updates = [];
18
- }
19
- getContextId() {
20
- if (!this.contextId) {
21
- throw new Error("Context id not set");
22
- }
23
- return this.contextId;
24
- }
25
- addUpdate(update) {
26
- this.updates.push(update);
27
- }
28
- getUpdates() {
29
- return this.updates;
30
- }
31
- isCompleted() {
32
- return this.completed;
33
- }
34
- setCompleted() {
35
- this.completed = true;
36
- }
37
- getExecutionContext() {
38
- if (!this.executionContext) {
39
- throw new Error("Execution context not set");
40
- }
41
- return this.executionContext;
42
- }
43
- setExecutionContext(executionContext) {
44
- this.executionContext = executionContext;
45
- this.contextId = executionContext.events.contextId;
46
- }
47
- async *stream(engine, service) {
48
- let executionError = null;
49
- const context = this.getExecutionContext();
50
- context.events.on("update", (_, update) => {
51
- if (!context.isCancelled()) {
52
- this.addUpdate(update);
53
- }
54
- });
55
- const executePromise = (service ? service.execute(engine, context) : coreExecute(engine, context))
56
- .catch((error) => {
57
- executionError = error;
58
- })
59
- .finally(() => {
60
- this.setCompleted();
61
- });
62
- while (!this.isCompleted() || this.getUpdates().length > 0) {
63
- if (executionError) {
64
- throw executionError;
65
- }
66
- if (this.getUpdates().length > 0) {
67
- yield this.getUpdates().shift();
68
- }
69
- await new Promise((resolve) => setTimeout(resolve, 10));
70
- }
71
- await executePromise;
72
- this.setCompleted();
73
- if (executionError) {
74
- throw executionError;
75
- }
76
- }
77
- }
@@ -1,13 +0,0 @@
1
- /**
2
- * Copyright 2025 The Artinet Project
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- /**
6
- * For artinet specific conventions
7
- * AgentInfo will expand to incorporate additional details required from other protocols
8
- * (e.g. AgentFAQ(NANDA), AgentCard(A2A), etc.)
9
- */
10
- export { AgentCardSchema as AgentInfoSchema } from "./schemas/a2a/index.js";
11
- export type { AgentCard as AgentInfo } from "./schemas/a2a/index.js";
12
- export type { A2AEngine as AgentEngine } from "./interfaces/services/a2a/index.js";
13
- export type { A2AServiceInterface as Agent } from "./interfaces/services/a2a/index.js";
package/dist/types/ext.js DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * Copyright 2025 The Artinet Project
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- /**
6
- * For artinet specific conventions
7
- * AgentInfo will expand to incorporate additional details required from other protocols
8
- * (e.g. AgentFAQ(NANDA), AgentCard(A2A), etc.)
9
- */
10
- export { AgentCardSchema as AgentInfoSchema } from "./schemas/a2a/index.js";
@@ -1,3 +0,0 @@
1
- export * from "./services/index.js";
2
- export * from "./storage.js";
3
- export * from "./client.js";
@@ -1,3 +0,0 @@
1
- export * from "./services/index.js";
2
- export * from "./storage.js";
3
- export * from "./client.js";
@@ -1,37 +0,0 @@
1
- /**
2
- * Copyright 2025 The Artinet Project
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- import { Context, Command, TextPart, DataPart, FilePart } from "../../../index.js";
6
- /**
7
- * Restricting to command for now, but could be extended to other types of commands in the future.
8
- * When we shift to CoreCommand, move this into core.
9
- */
10
- export interface StepArgs<TCommand extends Command = Command> {
11
- command: TCommand;
12
- context: Context;
13
- }
14
- export type StepParams<TCommand extends Command = Command, TInboundArgs extends readonly unknown[] = []> = StepArgs<TCommand> & Partial<{
15
- content: string;
16
- args: TInboundArgs;
17
- }>;
18
- export type StepOutput<TPart extends DataPart["data"] | FilePart["file"] | TextPart["text"]> = {
19
- parts: Array<TPart> | TPart;
20
- };
21
- export type StepOutputWithForwardArgs<TPart extends DataPart["data"] | FilePart["file"] | TextPart["text"], TForwardArgs extends readonly unknown[] = []> = StepOutput<TPart> & {
22
- args: TForwardArgs;
23
- };
24
- export type Step<TCommand extends Command = Command, TPart extends DataPart["data"] | FilePart["file"] | TextPart["text"] = TextPart["text"], TInboundArgs extends readonly unknown[] = [], TForwardArgs extends readonly unknown[] = [], TOutput extends StepOutput<TPart> | StepOutputWithForwardArgs<TPart, TForwardArgs> | Array<TPart> | TPart = StepOutput<TPart>> = (params: StepParams<TCommand, TInboundArgs>) => Promise<TOutput> | TOutput;
25
- export type StepWithKind<TCommand extends Command = Command, TPart extends DataPart["data"] | FilePart["file"] | TextPart["text"] = TextPart["text"], TInboundArgs extends readonly unknown[] = [], TForwardArgs extends readonly unknown[] = [], TOutput extends StepOutput<TPart> | StepOutputWithForwardArgs<TPart, TForwardArgs> | Array<TPart> | TPart = StepOutput<TPart>, TKind extends "text" | "file" | "data" = "text"> = {
26
- step: Step<TCommand, TPart, TInboundArgs, TForwardArgs, TOutput>;
27
- kind: TKind;
28
- };
29
- export type OutArgsOf<O> = O extends StepOutputWithForwardArgs<any, infer A> ? A : [];
30
- export interface StepBuilder<TCommand extends Command = Command, TInboundArgs extends readonly unknown[] = []> {
31
- /**
32
- * Add a step to the builder.
33
- * @param step - The step to add.
34
- * @returns A new builder with the step added.
35
- */
36
- addStep<TPart extends DataPart["data"] | FilePart["file"] | TextPart["text"] = TextPart["text"], TForwardArgs extends readonly unknown[] = [], TOutput extends StepOutput<TPart> | StepOutputWithForwardArgs<TPart, TForwardArgs> | Array<TPart> | TPart = StepOutput<TPart>, TKind extends "text" | "file" | "data" = "text">(step: StepWithKind<TCommand, TPart, TInboundArgs, TForwardArgs, TOutput, TKind>): StepBuilder<TCommand, OutArgsOf<TOutput>>;
37
- }
@@ -1,162 +0,0 @@
1
- /**
2
- * Copyright 2025 The Artinet Project
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- /**
6
- * @fileoverview A2A (Agent-to-Agent) Context Type Definitions
7
- *
8
- * This module provides type definitions for the Agent-to-Agent communication context,
9
- * extending the core context types with A2A-specific functionality for task handling,
10
- * message processing, and event management.
11
- *
12
- * @module A2AContext
13
- * @version 0.5.7
14
- * @since 0.5.6
15
- * @author The Artinet Project
16
- */
17
- import { type TaskStatusUpdateEvent, type TaskArtifactUpdateEvent, type Task, type Message, A2ARequest, MessageSendParams } from "../../../schemas/a2a/index.js";
18
- import { CoreCommand, CoreState, CoreUpdate } from "../core/context/types.js";
19
- import { CoreContext } from "../core/context/context.js";
20
- import { TaskAndHistory } from "./legacy.js";
21
- /**
22
- * Represents the possible types of updates that can be yielded by a TaskHandler.
23
- *
24
- * This union type encompasses all event types that can be emitted during A2A
25
- * task processing, providing a type-safe way to handle different update scenarios.
26
- *
27
- * @description Either a Message, Task, TaskStatusUpdateEvent, or TaskArtifactUpdateEvent.
28
- *
29
- * @public
30
- * @since 0.5.6
31
- */
32
- export type UpdateEvent = Message | Task | TaskStatusUpdateEvent | TaskArtifactUpdateEvent;
33
- /**
34
- * A2A Command type that extends CoreCommand with A2A-specific parameter constraints.
35
- *
36
- * This generic type provides type-safe command handling for A2A operations,
37
- * ensuring that command parameters conform to the expected A2A request structure.
38
- *
39
- * @template TParams - The parameter type for the command, must extend A2ARequest params
40
- * @default MessageSendParams - Default parameter type for message sending operations
41
- *
42
- * @example
43
- * ```typescript
44
- * // Using default MessageSendParams
45
- * const messageCommand: Command = {
46
- * type: 'send_message',
47
- * params: { content: 'Hello', recipient: 'agent123' }
48
- * };
49
- *
50
- * // Using custom parameter type
51
- * interface CustomParams extends NonNullable<A2ARequest["params"]> {
52
- * customField: string;
53
- * }
54
- * const customCommand: Command<CustomParams> = {
55
- * type: 'custom_action',
56
- * params: { customField: 'value' }
57
- * };
58
- * ```
59
- *
60
- * @public
61
- * @since 0.5.6
62
- */
63
- export type Command<TParams extends NonNullable<A2ARequest["params"]> = MessageSendParams> = CoreCommand<TParams>;
64
- /**
65
- * A2A State type that extends CoreState with task and history management.
66
- *
67
- * This type represents the state container for A2A operations, including
68
- * task tracking and historical data management capabilities.
69
- *
70
- * @example
71
- * ```typescript
72
- * const state: State = {
73
- * data: {
74
- * currentTask: taskInstance,
75
- * history: [...previousTasks]
76
- * },
77
- * metadata: {
78
- * lastUpdated: new Date(),
79
- * version: '1.0.0'
80
- * }
81
- * };
82
- * ```
83
- *
84
- * @public
85
- * @since 0.5.6
86
- */
87
- export type State = CoreState<TaskAndHistory>;
88
- /**
89
- * A2A Update type that extends CoreUpdate with A2A-specific update events.
90
- *
91
- * This generic type provides type-safe update handling for A2A operations,
92
- * ensuring that updates conform to the expected UpdateEvent structure.
93
- *
94
- * @template TUpdate - The update event type, must extend UpdateEvent
95
- * @default UpdateEvent - Default update event type
96
- *
97
- * @example
98
- * ```typescript
99
- * // Using default UpdateEvent
100
- * const update: Update = {
101
- * type: 'task_status_update',
102
- * payload: statusUpdateEvent
103
- * };
104
- *
105
- * // Using specific update type
106
- * const messageUpdate: Update<Message> = {
107
- * type: 'message',
108
- * payload: messageEvent
109
- * };
110
- * ```
111
- *
112
- * @public
113
- * @since 0.5.6
114
- */
115
- export type Update<TUpdate extends UpdateEvent = UpdateEvent> = CoreUpdate<TUpdate>;
116
- /**
117
- * A2A Context type that combines Command, State, and Update types for complete context management.
118
- *
119
- * This is the main context type for A2A operations, providing a comprehensive
120
- * type-safe interface for handling commands, managing state, and processing updates
121
- * within the Agent-to-Agent communication framework.
122
- *
123
- * @template TCommand - The command type, must extend Command
124
- * @template TState - The state type, must extend State
125
- * @template TUpdate - The update type, must extend Update<UpdateEvent>
126
- *
127
- * @default TCommand - Command<MessageSendParams>
128
- * @default TState - State
129
- * @default TUpdate - Update<UpdateEvent>
130
- *
131
- * @example
132
- * ```typescript
133
- * // Using default types
134
- * const context: Context = {
135
- * command: messageCommand,
136
- * state: currentState,
137
- * update: latestUpdate,
138
- * // ... other context properties
139
- * };
140
- *
141
- * // Using custom types
142
- * interface CustomCommand extends Command<CustomParams> {
143
- * priority: number;
144
- * }
145
- *
146
- * const customContext: Context<CustomCommand, State, Update<Task>> = {
147
- * command: customCommand,
148
- * state: currentState,
149
- * update: taskUpdate,
150
- * // ... other context properties
151
- * };
152
- * ```
153
- *
154
- * @remarks
155
- * This context type is designed to be the primary interface for A2A service
156
- * implementations, providing type safety and ensuring proper handling of
157
- * agent-to-agent communication patterns.
158
- *
159
- * @public
160
- * @since 0.5.6
161
- */
162
- export type Context<TCommand extends Command = Command<MessageSendParams>, TState extends State = State, TUpdate extends Update<UpdateEvent> = Update<UpdateEvent>> = CoreContext<TCommand, TState, TUpdate>;
@@ -1,5 +0,0 @@
1
- /**
2
- * Copyright 2025 The Artinet Project
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- export {};
@@ -1,7 +0,0 @@
1
- /**
2
- * Copyright 2025 The Artinet Project
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- import { ExecutionEngine } from "../core/execution/index.js";
6
- import { Command, State, Update } from "./context.js";
7
- export type A2AEngine = ExecutionEngine<Command, State, Update>;
@@ -1,5 +0,0 @@
1
- /**
2
- * Copyright 2025 The Artinet Project
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- export {};
@@ -1,5 +0,0 @@
1
- export * from "./builder.js";
2
- export * from "./context.js";
3
- export * from "./engine.js";
4
- export * from "./legacy.js";
5
- export * from "./service.js";
@@ -1,5 +0,0 @@
1
- export * from "./builder.js";
2
- export * from "./context.js";
3
- export * from "./engine.js";
4
- export * from "./legacy.js";
5
- export * from "./service.js";