@artinet/sdk 0.5.4 → 0.5.6

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 (622) hide show
  1. package/CHANGELOG.md +106 -20
  2. package/README.md +472 -215
  3. package/dist/client/a2a-client.js +6 -1
  4. package/dist/client/a2a-client.js.map +1 -1
  5. package/dist/index.js +3 -2
  6. package/dist/index.js.map +1 -1
  7. package/dist/server/express/errors.js +51 -0
  8. package/dist/server/express/errors.js.map +1 -0
  9. package/dist/server/express/index.js +4 -0
  10. package/dist/server/express/index.js.map +1 -0
  11. package/dist/server/express/middeware.js +116 -0
  12. package/dist/server/express/middeware.js.map +1 -0
  13. package/dist/server/express/server.js +80 -0
  14. package/dist/server/express/server.js.map +1 -0
  15. package/dist/server/index.js +1 -7
  16. package/dist/server/index.js.map +1 -1
  17. package/dist/services/a2a/factory/builder.js +392 -0
  18. package/dist/services/a2a/factory/builder.js.map +1 -0
  19. package/dist/services/a2a/factory/context.js +151 -0
  20. package/dist/services/a2a/factory/context.js.map +1 -0
  21. package/dist/services/a2a/factory/event.js +182 -0
  22. package/dist/services/a2a/factory/event.js.map +1 -0
  23. package/dist/services/a2a/factory/index.js +6 -0
  24. package/dist/services/a2a/factory/index.js.map +1 -0
  25. package/dist/services/a2a/factory/method.js +15 -0
  26. package/dist/services/a2a/factory/method.js.map +1 -0
  27. package/dist/services/a2a/factory/service.js +12 -0
  28. package/dist/services/a2a/factory/service.js.map +1 -0
  29. package/dist/services/a2a/helpers/index.js +2 -0
  30. package/dist/services/a2a/helpers/index.js.map +1 -0
  31. package/dist/services/a2a/helpers/part.js +47 -0
  32. package/dist/services/a2a/helpers/part.js.map +1 -0
  33. package/dist/services/a2a/index.js +5 -1
  34. package/dist/services/a2a/index.js.map +1 -1
  35. package/dist/services/a2a/managers/cancellation.js +17 -0
  36. package/dist/services/a2a/managers/cancellation.js.map +1 -0
  37. package/dist/services/a2a/managers/connection.js +17 -0
  38. package/dist/services/a2a/managers/connection.js.map +1 -0
  39. package/dist/services/a2a/managers/context.js +17 -0
  40. package/dist/services/a2a/managers/context.js.map +1 -0
  41. package/dist/services/a2a/managers/index.js +6 -0
  42. package/dist/services/a2a/managers/index.js.map +1 -0
  43. package/dist/services/a2a/managers/task.js +17 -0
  44. package/dist/services/a2a/managers/task.js.map +1 -0
  45. package/dist/services/a2a/methods/cancel-task.js +47 -0
  46. package/dist/services/a2a/methods/cancel-task.js.map +1 -0
  47. package/dist/services/a2a/methods/get-task.js +15 -0
  48. package/dist/services/a2a/methods/get-task.js.map +1 -0
  49. package/dist/services/a2a/methods/index.js +6 -0
  50. package/dist/services/a2a/methods/index.js.map +1 -0
  51. package/dist/services/a2a/methods/resubscribe-task.js +77 -0
  52. package/dist/services/a2a/methods/resubscribe-task.js.map +1 -0
  53. package/dist/services/a2a/methods/send-message.js +20 -0
  54. package/dist/services/a2a/methods/send-message.js.map +1 -0
  55. package/dist/services/a2a/methods/stream-message.js +39 -0
  56. package/dist/services/a2a/methods/stream-message.js.map +1 -0
  57. package/dist/services/a2a/service.js +88 -239
  58. package/dist/services/a2a/service.js.map +1 -1
  59. package/dist/services/a2a/state/index.js +4 -0
  60. package/dist/services/a2a/state/index.js.map +1 -0
  61. package/dist/services/a2a/state/load.js +43 -0
  62. package/dist/services/a2a/state/load.js.map +1 -0
  63. package/dist/services/a2a/state/process.js +14 -0
  64. package/dist/services/a2a/state/process.js.map +1 -0
  65. package/dist/services/a2a/state/update/artifact.js +40 -0
  66. package/dist/services/a2a/state/update/artifact.js.map +1 -0
  67. package/dist/services/a2a/state/update/index.js +3 -0
  68. package/dist/services/a2a/state/update/index.js.map +1 -0
  69. package/dist/{server/lib/update/base.js → services/a2a/state/update/update.js} +23 -9
  70. package/dist/services/a2a/state/update/update.js.map +1 -0
  71. package/dist/services/core/execution/execute.js +26 -0
  72. package/dist/services/core/execution/execute.js.map +1 -0
  73. package/dist/services/core/execution/index.js +2 -0
  74. package/dist/services/core/execution/index.js.map +1 -0
  75. package/dist/services/core/index.js +3 -0
  76. package/dist/services/core/index.js.map +1 -0
  77. package/dist/services/core/managers/command.js +95 -0
  78. package/dist/services/core/managers/command.js.map +1 -0
  79. package/dist/services/core/managers/event.js +57 -0
  80. package/dist/services/core/managers/event.js.map +1 -0
  81. package/dist/services/core/managers/index.js +4 -0
  82. package/dist/services/core/managers/index.js.map +1 -0
  83. package/dist/services/core/managers/stream.js +78 -0
  84. package/dist/services/core/managers/stream.js.map +1 -0
  85. package/dist/services/index.js +2 -1
  86. package/dist/services/index.js.map +1 -1
  87. package/dist/transport/index.js +1 -1
  88. package/dist/transport/index.js.map +1 -1
  89. package/dist/transport/rpc/parser.js +13 -5
  90. package/dist/transport/rpc/parser.js.map +1 -1
  91. package/dist/transport/rpc/rpc-client.js +10 -2
  92. package/dist/transport/rpc/rpc-client.js.map +1 -1
  93. package/dist/transport/streaming/event-stream.js +5 -1
  94. package/dist/transport/streaming/event-stream.js.map +1 -1
  95. package/dist/transport/trpc/a2a/factory/index.js +2 -0
  96. package/dist/transport/trpc/a2a/factory/index.js.map +1 -0
  97. package/dist/transport/trpc/a2a/factory/router.js +17 -0
  98. package/dist/transport/trpc/a2a/factory/router.js.map +1 -0
  99. package/dist/transport/trpc/a2a/index.js +4 -0
  100. package/dist/transport/trpc/a2a/index.js.map +1 -0
  101. package/dist/transport/trpc/a2a/routes/index.js +4 -0
  102. package/dist/transport/trpc/a2a/routes/index.js.map +1 -0
  103. package/dist/transport/trpc/a2a/routes/info.js +10 -0
  104. package/dist/transport/trpc/a2a/routes/info.js.map +1 -0
  105. package/dist/transport/trpc/a2a/routes/message/index.js +2 -0
  106. package/dist/transport/trpc/a2a/routes/message/index.js.map +1 -0
  107. package/dist/transport/trpc/a2a/routes/message/route.js +38 -0
  108. package/dist/transport/trpc/a2a/routes/message/route.js.map +1 -0
  109. package/dist/transport/trpc/a2a/routes/tasks/index.js +2 -0
  110. package/dist/transport/trpc/a2a/routes/tasks/index.js.map +1 -0
  111. package/dist/transport/trpc/a2a/routes/tasks/route.js +71 -0
  112. package/dist/transport/trpc/a2a/routes/tasks/route.js.map +1 -0
  113. package/dist/transport/trpc/a2a/trpc.js +36 -0
  114. package/dist/transport/trpc/a2a/trpc.js.map +1 -0
  115. package/dist/transport/trpc/index.js +2 -0
  116. package/dist/transport/trpc/index.js.map +1 -0
  117. package/dist/types/client/a2a-client.d.ts +5 -1
  118. package/dist/types/client/a2a-client.d.ts.map +1 -1
  119. package/dist/types/ext.js +11 -0
  120. package/dist/types/ext.js.map +1 -0
  121. package/dist/types/index.d.ts +3 -2
  122. package/dist/types/index.d.ts.map +1 -1
  123. package/dist/types/index.js +3 -4
  124. package/dist/types/index.js.map +1 -1
  125. package/dist/types/interfaces/client.js +6 -0
  126. package/dist/types/interfaces/client.js.map +1 -0
  127. package/dist/types/interfaces/index.js +4 -0
  128. package/dist/types/interfaces/index.js.map +1 -0
  129. package/dist/types/interfaces/services/a2a/builder.js +2 -0
  130. package/dist/types/interfaces/services/a2a/builder.js.map +1 -0
  131. package/dist/types/interfaces/services/a2a/context.js +6 -0
  132. package/dist/types/interfaces/services/a2a/context.js.map +1 -0
  133. package/dist/types/interfaces/services/a2a/engine.js +6 -0
  134. package/dist/types/interfaces/services/a2a/engine.js.map +1 -0
  135. package/dist/types/interfaces/services/a2a/index.js +6 -0
  136. package/dist/types/interfaces/services/a2a/index.js.map +1 -0
  137. package/dist/types/interfaces/services/a2a/legacy.js +6 -0
  138. package/dist/types/interfaces/services/a2a/legacy.js.map +1 -0
  139. package/dist/types/interfaces/services/a2a/service.js +6 -0
  140. package/dist/types/interfaces/services/a2a/service.js.map +1 -0
  141. package/dist/types/interfaces/services/core/context/command.js +6 -0
  142. package/dist/types/interfaces/services/core/context/command.js.map +1 -0
  143. package/dist/types/interfaces/services/core/context/context.js +6 -0
  144. package/dist/types/interfaces/services/core/context/context.js.map +1 -0
  145. package/dist/types/interfaces/services/core/context/index.js +4 -0
  146. package/dist/types/interfaces/services/core/context/index.js.map +1 -0
  147. package/dist/types/interfaces/services/core/context/types.js +6 -0
  148. package/dist/types/interfaces/services/core/context/types.js.map +1 -0
  149. package/dist/types/interfaces/services/core/execution/engine.js +6 -0
  150. package/dist/types/interfaces/services/core/execution/engine.js.map +1 -0
  151. package/dist/types/interfaces/services/core/execution/environment.js +6 -0
  152. package/dist/types/interfaces/services/core/execution/environment.js.map +1 -0
  153. package/dist/types/interfaces/services/core/execution/execute.js +6 -0
  154. package/dist/types/interfaces/services/core/execution/execute.js.map +1 -0
  155. package/dist/types/interfaces/services/core/execution/index.js +4 -0
  156. package/dist/types/interfaces/services/core/execution/index.js.map +1 -0
  157. package/dist/types/interfaces/services/core/index.js +5 -0
  158. package/dist/types/interfaces/services/core/index.js.map +1 -0
  159. package/dist/types/interfaces/services/core/managers/cancellation.js +6 -0
  160. package/dist/types/interfaces/services/core/managers/cancellation.js.map +1 -0
  161. package/dist/types/interfaces/services/core/managers/connection.js +6 -0
  162. package/dist/types/interfaces/services/core/managers/connection.js.map +1 -0
  163. package/dist/types/interfaces/services/core/managers/context.js +6 -0
  164. package/dist/types/interfaces/services/core/managers/context.js.map +1 -0
  165. package/dist/types/interfaces/services/core/managers/event.js +6 -0
  166. package/dist/types/interfaces/services/core/managers/event.js.map +1 -0
  167. package/dist/types/interfaces/services/core/managers/index.js +7 -0
  168. package/dist/types/interfaces/services/core/managers/index.js.map +1 -0
  169. package/dist/types/interfaces/services/core/managers/stream.js +6 -0
  170. package/dist/types/interfaces/services/core/managers/stream.js.map +1 -0
  171. package/dist/types/interfaces/services/core/managers/task.js +2 -0
  172. package/dist/types/interfaces/services/core/managers/task.js.map +1 -0
  173. package/dist/types/interfaces/services/core/service.js +6 -0
  174. package/dist/types/interfaces/services/core/service.js.map +1 -0
  175. package/dist/types/interfaces/services/index.js +4 -0
  176. package/dist/types/interfaces/services/index.js.map +1 -0
  177. package/dist/types/{services → interfaces/services}/protocol.js +4 -0
  178. package/dist/types/interfaces/services/protocol.js.map +1 -0
  179. package/dist/types/interfaces/storage.js +6 -0
  180. package/dist/types/interfaces/storage.js.map +1 -0
  181. package/dist/types/schemas/a2a/agent.js +319 -0
  182. package/dist/types/schemas/a2a/agent.js.map +1 -0
  183. package/dist/types/schemas/a2a/auth.js +274 -0
  184. package/dist/types/schemas/a2a/auth.js.map +1 -0
  185. package/dist/types/schemas/a2a/error.js +119 -0
  186. package/dist/types/schemas/a2a/error.js.map +1 -1
  187. package/dist/types/schemas/a2a/index.js +8 -4
  188. package/dist/types/schemas/a2a/index.js.map +1 -1
  189. package/dist/types/schemas/a2a/kind.js +21 -0
  190. package/dist/types/schemas/a2a/kind.js.map +1 -0
  191. package/dist/types/schemas/a2a/message.js +130 -1
  192. package/dist/types/schemas/a2a/message.js.map +1 -1
  193. package/dist/types/schemas/a2a/notification.js +202 -1
  194. package/dist/types/schemas/a2a/notification.js.map +1 -1
  195. package/dist/types/schemas/a2a/parameters.js +241 -1
  196. package/dist/types/schemas/a2a/parameters.js.map +1 -1
  197. package/dist/types/schemas/a2a/protocol.js +60 -0
  198. package/dist/types/schemas/a2a/protocol.js.map +1 -0
  199. package/dist/types/schemas/a2a/rpc.js +126 -1
  200. package/dist/types/schemas/a2a/rpc.js.map +1 -1
  201. package/dist/types/schemas/a2a/task.js +131 -12
  202. package/dist/types/schemas/a2a/task.js.map +1 -1
  203. package/dist/types/schemas/a2a/transport.js +28 -0
  204. package/dist/types/schemas/a2a/transport.js.map +1 -0
  205. package/dist/types/schemas/deployment/index.js +3 -0
  206. package/dist/types/schemas/deployment/index.js.map +1 -0
  207. package/dist/types/schemas/deployment/proxy.js +6 -0
  208. package/dist/types/schemas/deployment/proxy.js.map +1 -0
  209. package/dist/types/schemas/deployment/request.js +88 -0
  210. package/dist/types/schemas/deployment/request.js.map +1 -0
  211. package/dist/types/schemas/index.js +1 -0
  212. package/dist/types/schemas/index.js.map +1 -1
  213. package/dist/types/server/express/errors.d.ts +10 -0
  214. package/dist/types/server/express/errors.d.ts.map +1 -0
  215. package/dist/types/server/express/index.d.ts +4 -0
  216. package/dist/types/server/express/index.d.ts.map +1 -0
  217. package/dist/types/server/express/middeware.d.ts +8 -0
  218. package/dist/types/server/express/middeware.d.ts.map +1 -0
  219. package/dist/types/server/express/server.d.ts +71 -0
  220. package/dist/types/server/express/server.d.ts.map +1 -0
  221. package/dist/types/server/index.d.ts +1 -7
  222. package/dist/types/server/index.d.ts.map +1 -1
  223. package/dist/types/services/a2a/factory/builder.d.ts +352 -0
  224. package/dist/types/services/a2a/factory/builder.d.ts.map +1 -0
  225. package/dist/types/services/a2a/factory/context.d.ts +133 -0
  226. package/dist/types/services/a2a/factory/context.d.ts.map +1 -0
  227. package/dist/types/services/a2a/factory/event.d.ts +59 -0
  228. package/dist/types/services/a2a/factory/event.d.ts.map +1 -0
  229. package/dist/types/services/a2a/factory/index.d.ts +6 -0
  230. package/dist/types/services/a2a/factory/index.d.ts.map +1 -0
  231. package/dist/types/services/a2a/factory/method.d.ts +7 -0
  232. package/dist/types/services/a2a/factory/method.d.ts.map +1 -0
  233. package/dist/types/services/a2a/factory/service.d.ts +10 -0
  234. package/dist/types/services/a2a/factory/service.d.ts.map +1 -0
  235. package/dist/types/services/a2a/helpers/index.d.ts +2 -0
  236. package/dist/types/services/a2a/helpers/index.d.ts.map +1 -0
  237. package/dist/types/services/a2a/helpers/part.d.ts +49 -0
  238. package/dist/types/services/a2a/helpers/part.d.ts.map +1 -0
  239. package/dist/types/services/a2a/index.d.ts +5 -1
  240. package/dist/types/services/a2a/index.d.ts.map +1 -1
  241. package/dist/types/services/a2a/managers/cancellation.d.ts +12 -0
  242. package/dist/types/services/a2a/managers/cancellation.d.ts.map +1 -0
  243. package/dist/types/services/a2a/managers/connection.d.ts +12 -0
  244. package/dist/types/services/a2a/managers/connection.d.ts.map +1 -0
  245. package/dist/types/services/a2a/managers/context.d.ts +12 -0
  246. package/dist/types/services/a2a/managers/context.d.ts.map +1 -0
  247. package/dist/types/services/a2a/managers/index.d.ts +6 -0
  248. package/dist/types/services/a2a/managers/index.d.ts.map +1 -0
  249. package/dist/types/services/a2a/managers/task.d.ts +12 -0
  250. package/dist/types/services/a2a/managers/task.d.ts.map +1 -0
  251. package/dist/types/services/a2a/methods/cancel-task.d.ts +8 -0
  252. package/dist/types/services/a2a/methods/cancel-task.d.ts.map +1 -0
  253. package/dist/types/services/a2a/methods/get-task.d.ts +113 -0
  254. package/dist/types/services/a2a/methods/get-task.d.ts.map +1 -0
  255. package/dist/types/services/a2a/methods/index.d.ts +6 -0
  256. package/dist/types/services/a2a/methods/index.d.ts.map +1 -0
  257. package/dist/types/services/a2a/methods/resubscribe-task.d.ts +8 -0
  258. package/dist/types/services/a2a/methods/resubscribe-task.d.ts.map +1 -0
  259. package/dist/types/services/a2a/methods/send-message.d.ts +8 -0
  260. package/dist/types/services/a2a/methods/send-message.d.ts.map +1 -0
  261. package/dist/types/services/a2a/methods/stream-message.d.ts +9 -0
  262. package/dist/types/services/a2a/methods/stream-message.d.ts.map +1 -0
  263. package/dist/types/services/a2a/service.d.ts +375 -41
  264. package/dist/types/services/a2a/service.d.ts.map +1 -1
  265. package/dist/types/services/a2a/state/index.d.ts +4 -0
  266. package/dist/types/services/a2a/state/index.d.ts.map +1 -0
  267. package/dist/types/services/a2a/state/load.d.ts +15 -0
  268. package/dist/types/services/a2a/state/load.d.ts.map +1 -0
  269. package/dist/types/services/a2a/state/process.d.ts +8 -0
  270. package/dist/types/services/a2a/state/process.d.ts.map +1 -0
  271. package/dist/types/services/a2a/state/update/artifact.d.ts +11 -0
  272. package/dist/types/services/a2a/state/update/artifact.d.ts.map +1 -0
  273. package/dist/types/services/a2a/state/update/index.d.ts +3 -0
  274. package/dist/types/services/a2a/state/update/index.d.ts.map +1 -0
  275. package/dist/types/services/a2a/state/update/update.d.ts +24 -0
  276. package/dist/types/services/a2a/state/update/update.d.ts.map +1 -0
  277. package/dist/types/services/core/execution/execute.d.ts +7 -0
  278. package/dist/types/services/core/execution/execute.d.ts.map +1 -0
  279. package/dist/types/services/core/execution/index.d.ts +2 -0
  280. package/dist/types/services/core/execution/index.d.ts.map +1 -0
  281. package/dist/types/services/core/index.d.ts +3 -0
  282. package/dist/types/services/core/index.d.ts.map +1 -0
  283. package/dist/types/services/core/managers/command.d.ts +40 -0
  284. package/dist/types/services/core/managers/command.d.ts.map +1 -0
  285. package/dist/types/services/core/managers/event.d.ts +19 -0
  286. package/dist/types/services/core/managers/event.d.ts.map +1 -0
  287. package/dist/types/services/core/managers/index.d.ts +4 -0
  288. package/dist/types/services/core/managers/index.d.ts.map +1 -0
  289. package/dist/types/services/core/managers/stream.d.ts +21 -0
  290. package/dist/types/services/core/managers/stream.d.ts.map +1 -0
  291. package/dist/types/services/index.d.ts +2 -1
  292. package/dist/types/services/index.d.ts.map +1 -1
  293. package/dist/types/transport/index.d.ts +1 -1
  294. package/dist/types/transport/index.d.ts.map +1 -1
  295. package/dist/types/transport/rpc/parser.d.ts +5 -1
  296. package/dist/types/transport/rpc/parser.d.ts.map +1 -1
  297. package/dist/types/transport/rpc/rpc-client.d.ts +5 -1
  298. package/dist/types/transport/rpc/rpc-client.d.ts.map +1 -1
  299. package/dist/types/transport/streaming/event-stream.d.ts +5 -1
  300. package/dist/types/transport/streaming/event-stream.d.ts.map +1 -1
  301. package/dist/types/transport/trpc/a2a/factory/index.d.ts +2 -0
  302. package/dist/types/transport/trpc/a2a/factory/index.d.ts.map +1 -0
  303. package/dist/types/transport/trpc/a2a/factory/router.d.ts +2631 -0
  304. package/dist/types/transport/trpc/a2a/factory/router.d.ts.map +1 -0
  305. package/dist/types/transport/trpc/a2a/index.d.ts +4 -0
  306. package/dist/types/transport/trpc/a2a/index.d.ts.map +1 -0
  307. package/dist/types/transport/trpc/a2a/routes/index.d.ts +4 -0
  308. package/dist/types/transport/trpc/a2a/routes/index.d.ts.map +1 -0
  309. package/dist/types/transport/trpc/a2a/routes/info.d.ts +102 -0
  310. package/dist/types/transport/trpc/a2a/routes/info.d.ts.map +1 -0
  311. package/dist/types/transport/trpc/a2a/routes/message/index.d.ts +2 -0
  312. package/dist/types/transport/trpc/a2a/routes/message/index.d.ts.map +1 -0
  313. package/dist/types/transport/trpc/a2a/routes/message/route.d.ts +523 -0
  314. package/dist/types/transport/trpc/a2a/routes/message/route.d.ts.map +1 -0
  315. package/dist/types/transport/trpc/a2a/routes/tasks/index.d.ts +2 -0
  316. package/dist/types/transport/trpc/a2a/routes/tasks/index.d.ts.map +1 -0
  317. package/dist/types/transport/trpc/a2a/routes/tasks/route.d.ts +646 -0
  318. package/dist/types/transport/trpc/a2a/routes/tasks/route.d.ts.map +1 -0
  319. package/dist/types/transport/trpc/a2a/trpc.d.ts +272 -0
  320. package/dist/types/transport/trpc/a2a/trpc.d.ts.map +1 -0
  321. package/dist/types/transport/trpc/index.d.ts +2 -0
  322. package/dist/types/transport/trpc/index.d.ts.map +1 -0
  323. package/dist/types/types/ext.d.ts +14 -0
  324. package/dist/types/types/ext.d.ts.map +1 -0
  325. package/dist/types/types/index.d.ts +3 -4
  326. package/dist/types/types/index.d.ts.map +1 -1
  327. package/dist/types/types/{client.d.ts → interfaces/client.d.ts} +7 -2
  328. package/dist/types/types/interfaces/client.d.ts.map +1 -0
  329. package/dist/types/types/interfaces/index.d.ts +4 -0
  330. package/dist/types/types/interfaces/index.d.ts.map +1 -0
  331. package/dist/types/types/interfaces/services/a2a/builder.d.ts +33 -0
  332. package/dist/types/types/interfaces/services/a2a/builder.d.ts.map +1 -0
  333. package/dist/types/types/interfaces/services/a2a/context.d.ts +163 -0
  334. package/dist/types/types/interfaces/services/a2a/context.d.ts.map +1 -0
  335. package/dist/types/types/interfaces/services/a2a/engine.d.ts +8 -0
  336. package/dist/types/types/interfaces/services/a2a/engine.d.ts.map +1 -0
  337. package/dist/types/types/interfaces/services/a2a/index.d.ts +6 -0
  338. package/dist/types/types/interfaces/services/a2a/index.d.ts.map +1 -0
  339. package/dist/types/types/interfaces/services/a2a/legacy.d.ts +90 -0
  340. package/dist/types/types/interfaces/services/a2a/legacy.d.ts.map +1 -0
  341. package/dist/types/types/interfaces/services/a2a/service.d.ts +409 -0
  342. package/dist/types/types/interfaces/services/a2a/service.d.ts.map +1 -0
  343. package/dist/types/types/interfaces/services/core/context/command.d.ts +26 -0
  344. package/dist/types/types/interfaces/services/core/context/command.d.ts.map +1 -0
  345. package/dist/types/types/interfaces/services/core/context/context.d.ts +208 -0
  346. package/dist/types/types/interfaces/services/core/context/context.d.ts.map +1 -0
  347. package/dist/types/types/interfaces/services/core/context/index.d.ts +4 -0
  348. package/dist/types/types/interfaces/services/core/context/index.d.ts.map +1 -0
  349. package/dist/types/types/interfaces/services/core/context/types.d.ts +12 -0
  350. package/dist/types/types/interfaces/services/core/context/types.d.ts.map +1 -0
  351. package/dist/types/types/interfaces/services/core/execution/engine.d.ts +107 -0
  352. package/dist/types/types/interfaces/services/core/execution/engine.d.ts.map +1 -0
  353. package/dist/types/types/interfaces/services/core/execution/environment.d.ts +12 -0
  354. package/dist/types/types/interfaces/services/core/execution/environment.d.ts.map +1 -0
  355. package/dist/types/types/interfaces/services/core/execution/execute.d.ts +8 -0
  356. package/dist/types/types/interfaces/services/core/execution/execute.d.ts.map +1 -0
  357. package/dist/types/types/interfaces/services/core/execution/index.d.ts +4 -0
  358. package/dist/types/types/interfaces/services/core/execution/index.d.ts.map +1 -0
  359. package/dist/types/types/interfaces/services/core/index.d.ts +5 -0
  360. package/dist/types/types/interfaces/services/core/index.d.ts.map +1 -0
  361. package/dist/types/types/interfaces/services/core/managers/cancellation.d.ts +10 -0
  362. package/dist/types/types/interfaces/services/core/managers/cancellation.d.ts.map +1 -0
  363. package/dist/types/types/interfaces/services/core/managers/connection.d.ts +10 -0
  364. package/dist/types/types/interfaces/services/core/managers/connection.d.ts.map +1 -0
  365. package/dist/types/types/interfaces/services/core/managers/context.d.ts +18 -0
  366. package/dist/types/types/interfaces/services/core/managers/context.d.ts.map +1 -0
  367. package/dist/types/types/interfaces/services/core/managers/event.d.ts +329 -0
  368. package/dist/types/types/interfaces/services/core/managers/event.d.ts.map +1 -0
  369. package/dist/types/types/interfaces/services/core/managers/index.d.ts +7 -0
  370. package/dist/types/types/interfaces/services/core/managers/index.d.ts.map +1 -0
  371. package/dist/types/types/interfaces/services/core/managers/stream.d.ts +218 -0
  372. package/dist/types/types/interfaces/services/core/managers/stream.d.ts.map +1 -0
  373. package/dist/types/types/interfaces/services/core/managers/task.d.ts +10 -0
  374. package/dist/types/types/interfaces/services/core/managers/task.d.ts.map +1 -0
  375. package/dist/types/types/interfaces/services/core/service.d.ts +116 -0
  376. package/dist/types/types/interfaces/services/core/service.d.ts.map +1 -0
  377. package/dist/types/types/interfaces/services/index.d.ts +4 -0
  378. package/dist/types/types/interfaces/services/index.d.ts.map +1 -0
  379. package/dist/types/types/{services → interfaces/services}/protocol.d.ts +4 -0
  380. package/dist/types/types/interfaces/services/protocol.d.ts.map +1 -0
  381. package/dist/types/types/interfaces/storage.d.ts +9 -0
  382. package/dist/types/types/interfaces/storage.d.ts.map +1 -0
  383. package/dist/types/types/schemas/a2a/agent.d.ts +509 -0
  384. package/dist/types/types/schemas/a2a/agent.d.ts.map +1 -0
  385. package/dist/types/types/schemas/a2a/auth.d.ts +285 -0
  386. package/dist/types/types/schemas/a2a/auth.d.ts.map +1 -0
  387. package/dist/types/types/schemas/a2a/error.d.ts +133 -27
  388. package/dist/types/types/schemas/a2a/error.d.ts.map +1 -1
  389. package/dist/types/types/schemas/a2a/index.d.ts +8 -216
  390. package/dist/types/types/schemas/a2a/index.d.ts.map +1 -1
  391. package/dist/types/types/schemas/a2a/kind.d.ts +28 -0
  392. package/dist/types/types/schemas/a2a/kind.d.ts.map +1 -0
  393. package/dist/types/types/schemas/a2a/message.d.ts +2549 -69
  394. package/dist/types/types/schemas/a2a/message.d.ts.map +1 -1
  395. package/dist/types/types/schemas/a2a/notification.d.ts +321 -70
  396. package/dist/types/types/schemas/a2a/notification.d.ts.map +1 -1
  397. package/dist/types/types/schemas/a2a/parameters.d.ts +287 -167
  398. package/dist/types/types/schemas/a2a/parameters.d.ts.map +1 -1
  399. package/dist/types/types/schemas/a2a/protocol.d.ts +3207 -0
  400. package/dist/types/types/schemas/a2a/protocol.d.ts.map +1 -0
  401. package/dist/types/types/schemas/a2a/rpc.d.ts +42 -89
  402. package/dist/types/types/schemas/a2a/rpc.d.ts.map +1 -1
  403. package/dist/types/types/schemas/a2a/task.d.ts +1460 -214
  404. package/dist/types/types/schemas/a2a/task.d.ts.map +1 -1
  405. package/dist/types/types/schemas/a2a/transport.d.ts +28 -0
  406. package/dist/types/types/schemas/a2a/transport.d.ts.map +1 -0
  407. package/dist/types/types/schemas/deployment/index.d.ts +3 -0
  408. package/dist/types/types/schemas/deployment/index.d.ts.map +1 -0
  409. package/dist/types/types/{proxy.d.ts → schemas/deployment/proxy.d.ts} +6 -2
  410. package/dist/types/types/schemas/deployment/proxy.d.ts.map +1 -0
  411. package/dist/types/types/schemas/deployment/request.d.ts +508 -0
  412. package/dist/types/types/schemas/deployment/request.d.ts.map +1 -0
  413. package/dist/types/types/utils/index.d.ts +2 -0
  414. package/dist/types/types/utils/index.d.ts.map +1 -0
  415. package/dist/types/types/{transform.d.ts → utils/transform.d.ts} +4 -0
  416. package/dist/types/types/utils/transform.d.ts.map +1 -0
  417. package/dist/types/utils/api/register.d.ts +4 -0
  418. package/dist/types/utils/api/register.d.ts.map +1 -1
  419. package/dist/types/utils/common/constants.d.ts +8 -4
  420. package/dist/types/utils/common/constants.d.ts.map +1 -1
  421. package/dist/types/utils/common/errors.d.ts +6 -12
  422. package/dist/types/utils/common/errors.d.ts.map +1 -1
  423. package/dist/types/utils/common/utils.d.ts +4 -14
  424. package/dist/types/utils/common/utils.d.ts.map +1 -1
  425. package/dist/types/utils/common/zAsyncIterable.d.ts +23 -0
  426. package/dist/types/utils/common/zAsyncIterable.d.ts.map +1 -0
  427. package/dist/types/utils/deployment/agents.d.ts +5 -1
  428. package/dist/types/utils/deployment/agents.d.ts.map +1 -1
  429. package/dist/types/utils/deployment/bundler.d.ts +4 -0
  430. package/dist/types/utils/deployment/bundler.d.ts.map +1 -1
  431. package/dist/types/utils/deployment/full-deployment.d.ts +12 -2
  432. package/dist/types/utils/deployment/full-deployment.d.ts.map +1 -1
  433. package/dist/types/utils/deployment/index.d.ts +5 -0
  434. package/dist/types/utils/deployment/index.d.ts.map +1 -0
  435. package/dist/types/utils/deployment/task-wrapper.d.ts +6 -2
  436. package/dist/types/utils/deployment/task-wrapper.d.ts.map +1 -1
  437. package/dist/types/utils/deployment/test-deployment.d.ts +7 -2
  438. package/dist/types/utils/deployment/test-deployment.d.ts.map +1 -1
  439. package/dist/types/utils/index.d.ts +4 -6
  440. package/dist/types/utils/index.d.ts.map +1 -1
  441. package/dist/types/utils/index.js +2 -0
  442. package/dist/types/utils/index.js.map +1 -0
  443. package/dist/types/utils/logging/index.d.ts +3 -0
  444. package/dist/types/utils/logging/index.d.ts.map +1 -0
  445. package/dist/types/utils/logging/log.d.ts +4 -0
  446. package/dist/types/utils/logging/log.d.ts.map +1 -1
  447. package/dist/types/utils/logging/logger.d.ts +4 -0
  448. package/dist/types/utils/logging/logger.d.ts.map +1 -1
  449. package/dist/types/{server/lib → utils}/storage/file.d.ts +9 -4
  450. package/dist/types/utils/storage/file.d.ts.map +1 -0
  451. package/dist/types/{server/lib → utils}/storage/memory.d.ts +9 -4
  452. package/dist/types/utils/storage/memory.d.ts.map +1 -0
  453. package/dist/types/{transform.js → utils/transform.js} +2 -1
  454. package/dist/types/utils/transform.js.map +1 -0
  455. package/dist/utils/api/register.js +4 -0
  456. package/dist/utils/api/register.js.map +1 -1
  457. package/dist/utils/common/constants.js +20 -11
  458. package/dist/utils/common/constants.js.map +1 -1
  459. package/dist/utils/common/errors.js +7 -40
  460. package/dist/utils/common/errors.js.map +1 -1
  461. package/dist/utils/common/utils.js +4 -46
  462. package/dist/utils/common/utils.js.map +1 -1
  463. package/dist/utils/common/zAsyncIterable.js +40 -0
  464. package/dist/utils/common/zAsyncIterable.js.map +1 -0
  465. package/dist/utils/deployment/agents.js +4 -0
  466. package/dist/utils/deployment/agents.js.map +1 -1
  467. package/dist/utils/deployment/bundler.js +4 -0
  468. package/dist/utils/deployment/bundler.js.map +1 -1
  469. package/dist/utils/deployment/full-deployment.js +6 -2
  470. package/dist/utils/deployment/full-deployment.js.map +1 -1
  471. package/dist/utils/deployment/index.js +5 -0
  472. package/dist/utils/deployment/index.js.map +1 -0
  473. package/dist/utils/deployment/task-wrapper.js +4 -0
  474. package/dist/utils/deployment/task-wrapper.js.map +1 -1
  475. package/dist/utils/deployment/test-deployment.js +15 -7
  476. package/dist/utils/deployment/test-deployment.js.map +1 -1
  477. package/dist/utils/index.js +10 -6
  478. package/dist/utils/index.js.map +1 -1
  479. package/dist/utils/logging/index.js +3 -0
  480. package/dist/utils/logging/index.js.map +1 -0
  481. package/dist/utils/logging/log.js +4 -0
  482. package/dist/utils/logging/log.js.map +1 -1
  483. package/dist/utils/logging/logger.js +13 -0
  484. package/dist/utils/logging/logger.js.map +1 -1
  485. package/dist/{server/lib → utils}/storage/file.js +17 -6
  486. package/dist/utils/storage/file.js.map +1 -0
  487. package/dist/{server/lib → utils}/storage/memory.js +15 -5
  488. package/dist/utils/storage/memory.js.map +1 -0
  489. package/package.json +16 -5
  490. package/dist/server/a2a-server.js +0 -237
  491. package/dist/server/a2a-server.js.map +0 -1
  492. package/dist/server/interfaces/params.js +0 -3
  493. package/dist/server/interfaces/params.js.map +0 -1
  494. package/dist/server/interfaces/server.js +0 -2
  495. package/dist/server/interfaces/server.js.map +0 -1
  496. package/dist/server/interfaces/store.js +0 -18
  497. package/dist/server/interfaces/store.js.map +0 -1
  498. package/dist/server/lib/express-server.js +0 -252
  499. package/dist/server/lib/express-server.js.map +0 -1
  500. package/dist/server/lib/json-middleware.js +0 -3
  501. package/dist/server/lib/json-middleware.js.map +0 -1
  502. package/dist/server/lib/middleware/a2a-methods.js +0 -140
  503. package/dist/server/lib/middleware/a2a-methods.js.map +0 -1
  504. package/dist/server/lib/middleware/factory.js +0 -59
  505. package/dist/server/lib/middleware/factory.js.map +0 -1
  506. package/dist/server/lib/state.js +0 -80
  507. package/dist/server/lib/state.js.map +0 -1
  508. package/dist/server/lib/storage/file.js.map +0 -1
  509. package/dist/server/lib/storage/memory.js.map +0 -1
  510. package/dist/server/lib/update/base.js.map +0 -1
  511. package/dist/services/a2a/repository.js +0 -160
  512. package/dist/services/a2a/repository.js.map +0 -1
  513. package/dist/services/manager.js +0 -61
  514. package/dist/services/manager.js.map +0 -1
  515. package/dist/services/mcp/index.js +0 -2
  516. package/dist/services/mcp/index.js.map +0 -1
  517. package/dist/services/mcp/service.js +0 -75
  518. package/dist/services/mcp/service.js.map +0 -1
  519. package/dist/transport/streaming/stream.js +0 -111
  520. package/dist/transport/streaming/stream.js.map +0 -1
  521. package/dist/types/client.js +0 -2
  522. package/dist/types/client.js.map +0 -1
  523. package/dist/types/express.js +0 -2
  524. package/dist/types/express.js.map +0 -1
  525. package/dist/types/extended-schema.js +0 -7
  526. package/dist/types/extended-schema.js.map +0 -1
  527. package/dist/types/proxy.js +0 -2
  528. package/dist/types/proxy.js.map +0 -1
  529. package/dist/types/schemas/a2a/auth/auth.js +0 -2
  530. package/dist/types/schemas/a2a/auth/auth.js.map +0 -1
  531. package/dist/types/schemas/a2a/auth/base.js +0 -2
  532. package/dist/types/schemas/a2a/auth/base.js.map +0 -1
  533. package/dist/types/schemas/a2a/auth/index.js +0 -4
  534. package/dist/types/schemas/a2a/auth/index.js.map +0 -1
  535. package/dist/types/schemas/a2a/auth/oauth.js +0 -2
  536. package/dist/types/schemas/a2a/auth/oauth.js.map +0 -1
  537. package/dist/types/schemas/a2a/ref.js +0 -25
  538. package/dist/types/schemas/a2a/ref.js.map +0 -1
  539. package/dist/types/server/a2a-server.d.ts +0 -145
  540. package/dist/types/server/a2a-server.d.ts.map +0 -1
  541. package/dist/types/server/interfaces/params.d.ts +0 -109
  542. package/dist/types/server/interfaces/params.d.ts.map +0 -1
  543. package/dist/types/server/interfaces/server.d.ts +0 -35
  544. package/dist/types/server/interfaces/server.d.ts.map +0 -1
  545. package/dist/types/server/interfaces/store.d.ts +0 -35
  546. package/dist/types/server/interfaces/store.d.ts.map +0 -1
  547. package/dist/types/server/lib/express-server.d.ts +0 -59
  548. package/dist/types/server/lib/express-server.d.ts.map +0 -1
  549. package/dist/types/server/lib/json-middleware.d.ts +0 -3
  550. package/dist/types/server/lib/json-middleware.d.ts.map +0 -1
  551. package/dist/types/server/lib/middleware/a2a-methods.d.ts +0 -7
  552. package/dist/types/server/lib/middleware/a2a-methods.d.ts.map +0 -1
  553. package/dist/types/server/lib/middleware/factory.d.ts +0 -12
  554. package/dist/types/server/lib/middleware/factory.d.ts.map +0 -1
  555. package/dist/types/server/lib/state.d.ts +0 -20
  556. package/dist/types/server/lib/state.d.ts.map +0 -1
  557. package/dist/types/server/lib/storage/file.d.ts.map +0 -1
  558. package/dist/types/server/lib/storage/memory.d.ts.map +0 -1
  559. package/dist/types/server/lib/update/base.d.ts +0 -21
  560. package/dist/types/server/lib/update/base.d.ts.map +0 -1
  561. package/dist/types/services/a2a/repository.d.ts +0 -77
  562. package/dist/types/services/a2a/repository.d.ts.map +0 -1
  563. package/dist/types/services/a2a/repository.js +0 -2
  564. package/dist/types/services/a2a/repository.js.map +0 -1
  565. package/dist/types/services/a2a/service.js +0 -2
  566. package/dist/types/services/a2a/service.js.map +0 -1
  567. package/dist/types/services/context.js +0 -29
  568. package/dist/types/services/context.js.map +0 -1
  569. package/dist/types/services/dispatcher.js +0 -33
  570. package/dist/types/services/dispatcher.js.map +0 -1
  571. package/dist/types/services/index.js +0 -9
  572. package/dist/types/services/index.js.map +0 -1
  573. package/dist/types/services/manager.d.ts +0 -44
  574. package/dist/types/services/manager.d.ts.map +0 -1
  575. package/dist/types/services/manager.js +0 -2
  576. package/dist/types/services/manager.js.map +0 -1
  577. package/dist/types/services/mcp/index.d.ts +0 -2
  578. package/dist/types/services/mcp/index.d.ts.map +0 -1
  579. package/dist/types/services/mcp/service.d.ts +0 -30
  580. package/dist/types/services/mcp/service.d.ts.map +0 -1
  581. package/dist/types/services/mcp/service.js +0 -8
  582. package/dist/types/services/mcp/service.js.map +0 -1
  583. package/dist/types/services/protocol.js.map +0 -1
  584. package/dist/types/services/service.js +0 -2
  585. package/dist/types/services/service.js.map +0 -1
  586. package/dist/types/transform.js.map +0 -1
  587. package/dist/types/transport/streaming/stream.d.ts +0 -42
  588. package/dist/types/transport/streaming/stream.d.ts.map +0 -1
  589. package/dist/types/types/client.d.ts.map +0 -1
  590. package/dist/types/types/express.d.ts +0 -66
  591. package/dist/types/types/express.d.ts.map +0 -1
  592. package/dist/types/types/extended-schema.d.ts +0 -174
  593. package/dist/types/types/extended-schema.d.ts.map +0 -1
  594. package/dist/types/types/proxy.d.ts.map +0 -1
  595. package/dist/types/types/schemas/a2a/auth/auth.d.ts +0 -80
  596. package/dist/types/types/schemas/a2a/auth/auth.d.ts.map +0 -1
  597. package/dist/types/types/schemas/a2a/auth/base.d.ts +0 -16
  598. package/dist/types/types/schemas/a2a/auth/base.d.ts.map +0 -1
  599. package/dist/types/types/schemas/a2a/auth/index.d.ts +0 -4
  600. package/dist/types/types/schemas/a2a/auth/index.d.ts.map +0 -1
  601. package/dist/types/types/schemas/a2a/auth/oauth.d.ts +0 -124
  602. package/dist/types/types/schemas/a2a/auth/oauth.d.ts.map +0 -1
  603. package/dist/types/types/schemas/a2a/ref.d.ts +0 -2057
  604. package/dist/types/types/schemas/a2a/ref.d.ts.map +0 -1
  605. package/dist/types/types/services/a2a/repository.d.ts +0 -85
  606. package/dist/types/types/services/a2a/repository.d.ts.map +0 -1
  607. package/dist/types/types/services/a2a/service.d.ts +0 -29
  608. package/dist/types/types/services/a2a/service.d.ts.map +0 -1
  609. package/dist/types/types/services/context.d.ts +0 -167
  610. package/dist/types/types/services/context.d.ts.map +0 -1
  611. package/dist/types/types/services/dispatcher.d.ts +0 -20
  612. package/dist/types/types/services/dispatcher.d.ts.map +0 -1
  613. package/dist/types/types/services/index.d.ts +0 -9
  614. package/dist/types/types/services/index.d.ts.map +0 -1
  615. package/dist/types/types/services/manager.d.ts +0 -42
  616. package/dist/types/types/services/manager.d.ts.map +0 -1
  617. package/dist/types/types/services/mcp/service.d.ts +0 -57
  618. package/dist/types/types/services/mcp/service.d.ts.map +0 -1
  619. package/dist/types/types/services/protocol.d.ts.map +0 -1
  620. package/dist/types/types/services/service.d.ts +0 -35
  621. package/dist/types/types/services/service.d.ts.map +0 -1
  622. package/dist/types/types/transform.d.ts.map +0 -1
package/README.md CHANGED
@@ -7,21 +7,22 @@
7
7
 
8
8
  # artinet SDK
9
9
 
10
- The artinet SDK is a Full Stack Agent builder written in TypeScript for [node.js](https://nodejs.org/) that aims to simplify the creation of interoperable AI agents. Learn more at [the artinet project](https://artinet.io/).
10
+ The artinet SDK is a TypeScript library designed for Agentic Communication. It's written for [node.js](https://nodejs.org/) and aims to simplify the creation of interoperable AI agents. Learn more at [the artinet project](https://artinet.io/).
11
11
 
12
- This SDK significantly supports multiple agentic communication protocols, offering a production-ready solution with a focus on developer experience, reliability, and comprehensive features.
12
+ This SDK leverages a service-oriented architecture for building AI agents allowing developers to easily create agents as simple processes or seamlessly embed them within a dedicated server.
13
13
 
14
14
  ### Quick Start
15
15
 
16
- To build your own agent/server use the [`create-quick-agent`](https://www.npmjs.com/package/@artinet/create-quick-agent) command:
16
+ To build your own agent/server use the [`create-quick-agent`](https://www.npmjs.com/package/@artinet/create-quick-agent) (supports v0.5.2) command:
17
17
 
18
18
  ```bash
19
19
  npx @artinet/create-quick-agent@latest
20
20
  ```
21
21
 
22
- Its got [serveral template projects](https://github.com/the-artinet-project/create-quick-agent) that you can use to get started building agents today.
22
+ It has [serveral template projects](https://github.com/the-artinet-project/create-quick-agent) that you can use to get started building agents today.
23
23
 
24
24
  ## Table of Contents
25
+
25
26
  - [artinet SDK](#artinet-sdk)
26
27
  - [Quick Start](#quick-start)
27
28
  - [Table of Contents](#table-of-contents)
@@ -39,33 +40,39 @@ Its got [serveral template projects](https://github.com/the-artinet-project/crea
39
40
  - [Authentication](#authentication)
40
41
  - [Server](#server)
41
42
  - [Implementing an A2A Agent](#implementing-an-a2a-agent)
43
+ - [AgentBuilder](#agentbuilder)
44
+ - [AgentEngine](#agentengine)
45
+ - [Event Handling/Monitoring \& Message Streaming](#event-handlingmonitoring--message-streaming)
42
46
  - [Persistent Storage](#persistent-storage)
43
47
  - [Logging](#logging)
44
- - [Server Registration \& Discovery](#server-registration--discovery)
48
+ - [Server Registration \& Discovery (v0.5.2)](#server-registration--discovery-v052)
45
49
  - [Advanced Server Customization](#advanced-server-customization)
46
- - [Quick-Agents (Alpha)](#quick-agents-alpha)
50
+ - [Quick-Agents (Alpha v0.5.2)](#quick-agents-alpha-v052)
47
51
  - [Contributing](#contributing)
48
52
  - [License](#license)
49
53
  - [Acknowledgements](#acknowledgements)
50
54
 
51
55
  ## Features
52
56
 
53
- - **Plug-and-Play Server:** Built on Express.js, the `ExpressServer` handles Transport-layer complexity, routing, protocol compliance, and Server-Sent Events (SSE) streaming mechanics automatically. Just provide your core agent logic (`AgentEngine`) and configuration via `ExpressServerOptions`.
54
- - **TypeScript First:** Fully written in TypeScript with comprehensive type definitions for a robust developer experience.
55
- - **Protocol Compliance:** Implements the complete A2A specification with growing support for recieving commands via MCP & ACP.
56
- - **Code Deployment (Experimental)** | Bundle, test, and deploy agent code onto the artinet. Includes bundler, task wrapper, and deployment utilities.
57
-
58
- | Component/Feature | Description | Key Classes/Types |
59
- | :------------------ | :-------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------- |
60
- | **Client** | Interact with A2A-compliant agents. Supports standard & streaming requests. | `A2AClient`, `RpcError` |
61
- | **Server** | Host agents that can communicate using a variety of protocols. Handles protocol details, routing, SSE. | `ExpressServer`, `ExpressServerOptions` |
62
- | **Reqeust Handling** | Define agent logic using async generators. | `AgentEngine`, `ExecutionContext`, `UpdateEvent` |
63
- | **Storage** | Persist event state. In-memory and file-based options included. | `Store`, `InMemoryTaskStore`, `FileStore` |
64
- | **Streaming (SSE)** | Handle real-time updates via SSE. | |
65
- | **Logging** | Configure structured logging for debugging and monitoring. | `logger`, `configureLogger`, `LogLevel` |
66
- | **Advanced Server** | Customize the underlying JSON-RPC server or integrate into existing apps. | `CreateJSONRPCServerParams`, `createJSONRPCMethod` |
67
- | **Core Types** | Based on the official JSON Schemas. | `Tool`,`AgentCard`, `Task`, `Message`, `Part`, `Artifact`, etc. |
68
- | **Agent Utilities (for Sandboxed Environments)** | Standardized utilities for agents in managed environments to interact with the host system for task lifecycle, inter-agent communication, and external API calls. | `artinet.v0.taskManager`, `artinet.v0.connect`, `artinet.v0.agent`, `TaskProxy`, `ConnectAPICallback`, `ClientProxy`, `ClientFactory` |
57
+ - **Service-Oriented Architecture:** Modern, modular design with a dedicated layer for protocol handling and state management.
58
+ - **Modern Express Server:** Quickly create an Express Server with the `createAgentServer()` function. It handles all of the transport-layer complexity, adds an A2A <-> JSON-RPC middleware, and manages Server-Sent Events (SSE) automatically.
59
+ - **TypeScript First:** Written in TypeScript with a fully implemented Zod <-> A2A schema.
60
+ - **Protocol Compliance:** Implements the complete A2A specification (v0.3.0) with support for any kind of transport layer (Express, tRPC, WebSockets, etc).
61
+ - **Code Deployment:** Bundle, test, and deploy agent code onto the artinet via the `./deployment` module (v0.5.3). Includes bundler, agent handler, and deployment utilities.
62
+
63
+ | Component/Feature | Description | Key Classes/Types |
64
+ | :------------------- | :-------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------- |
65
+ | **Client** | Interact with A2A-compliant agents. Supports standard & streaming requests. | `A2AClient` |
66
+ | **Server** | Quickly spin up an Agent as a Server. | `createAgentServer`, `ExpressAgentServer`, `jsonRPCMiddleware` |
67
+ | **Agent Creation** | Design agents with the Agent Builder or take control with the Agent Engine. | `AgentEngine`, `Context`, `AgentBuilder` |
68
+ | **Storage** | Persist event state. In-memory and file-based options included. | `Store`, `InMemoryTaskStore`, `FileStore` |
69
+ | **Streaming (SSE)** | Handle real-time updates via Server-Sent Events with middleware support. | Built-in SSE handling, streaming generators |
70
+ | **Event Handling** | Monitor agent execution with our event system. | `EventManager`, `eventOverrides`, Event listeners (`start`, `update`, `error`, `complete`, `cancel`) |
71
+ | **Logging** | Configure structured logging for debugging and monitoring. | `logger`, `configureLogger`, `LogLevel` |
72
+ | **Transport Layers** | Built-in support for Express/TRPC. | Express middleware, tRPC router, or easily create your own. |
73
+ | **Core Types** | Fully implement A2A schema in Zod. | `AgentCard`, `Task`, `Message`, `Part`, `Artifact`, etc. |
74
+ | **Deployment** | Bundle, test, and deploy agents onto the artinet platform (v0.5.2). | `@artinet/sdk/deployment`, `fullDeployment`, `testDeployment`, `bundle` |
75
+ | **Agent Utilities** | Run agents in managed environments with our proxy system. | `artinet.v0.taskManager`, `artinet.v0.connect`, `artinet.v0.agent` |
69
76
 
70
77
  ## Installation
71
78
 
@@ -75,59 +82,73 @@ npm install @artinet/sdk
75
82
 
76
83
  ## Requirements
77
84
 
78
- - Node.js (v22.0.0 or higher recommended, check `package.json` engines for exact requirement)
85
+ - Node.js (v22.0.0 or higher recommended)
79
86
 
80
87
  ## Documentation
81
88
 
82
89
  For more detailed documentation visit our documentation site [here](https://the-artinet-project.github.io/artinet-documentation/).
83
90
 
84
91
  ## Example
85
-
86
- A basic A2A server and client interaction. For more detailed examples, see the `examples/` directory.
92
+
93
+ A basic A2A server and client interaction (For simple agents see the [AgentBuilder](#agentbuilder) section). For more detailed examples, see the `examples/` directory.
87
94
 
88
95
  **1. Server (`quick-server.ts`)**
89
96
 
90
97
  ```typescript
91
98
  import {
92
- ExpressServer,
99
+ createAgentServer,
93
100
  ExecutionContext,
94
101
  AgentEngine,
95
- InMemoryTaskStore,
102
+ TaskManager,
103
+ MessageSendParams,
104
+ getParts,
96
105
  } from "@artinet/sdk";
97
106
 
98
- // Minimal agent logic: receive text, yield working state, yield completed state with echo
99
- const quickAgentLogic: AgentEngine = async function* (context: ExecutionContext) {
100
- const params = context.getRequestParams() as MessageSendParams; //for A2A requests
101
- const userInput = params.message.parts[0].kind === "text"
102
- ? context.userMessage.parts[0].text
103
- : "";
104
- yield { state: "working" };
105
- // Simulate some work if needed, check context.isCancelled()
107
+ //Define your Agents Behaviour
108
+ const quickAgentLogic: AgentEngine = async function* (context: Context) {
109
+ const params: MessageSendParams = context.command; //MessageSendParams
110
+ const { text: userInput} = getParts(params.message.parts); //helper function to consume parts
111
+ const task = context.State(); //TaskAndHistory
112
+ yield {
113
+ ...
114
+ state: "working"
115
+ ...
116
+ };
117
+
106
118
  yield {
119
+ ...
107
120
  state: "completed",
108
121
  message: {
109
122
  role: "agent",
110
123
  parts: [{ kind: "text", text: `You said: ${userInput}` }],
111
124
  },
125
+ ...
112
126
  };
113
127
  };
114
128
 
115
- const server = new A2AServer({
116
- handler: quickAgentLogic,
117
- taskStore: new InMemoryTaskStore(),
118
- port: 4000,
119
- basePath: "/a2a",
120
- card: {
121
- name: "QuickStart Agent",
122
- url: "http://localhost:4000/a2a",
123
- version: "0.1.0",
124
- capabilities: { streaming: true },
125
- skills: [{ id: "echo", name: "Echo Skill" }],
129
+ // Create an agent server
130
+ const { app, agent } = createAgentServer({
131
+ agent: {
132
+ engine: quickAgentLogic,
133
+ agentCard: {
134
+ name: "QuickStart Agent",
135
+ url: "http://localhost:4000/a2a",
136
+ version: "0.1.0",
137
+ capabilities: { streaming: true },
138
+ skills: [{ id: "echo", name: "Echo Skill" }],
139
+ ...
140
+ },
141
+ tasks: new TaskManager(),
142
+ ...
126
143
  },
144
+ basePath: "/a2a",
145
+ agentCardPath: "/.well-known/agent.json"
146
+ ...
127
147
  });
128
148
 
129
- server.start();
130
- console.log("A2A Server running at http://localhost:4000/a2a");
149
+ app.listen(4000, () => {
150
+ console.log("A2A Server running at http://localhost:4000/a2a");
151
+ });
131
152
  ```
132
153
 
133
154
  **2. Client (`quick-client.ts`)**
@@ -142,13 +163,14 @@ async function runClient() {
142
163
  messageId: "test-message-id",
143
164
  kind: "message",
144
165
  role: "user",
145
- parts: [{ kind: "text", text: "Hello Quick Start!" }],
166
+ parts: [{ kind: "text", text: "Hello World!" }],
167
+ ...
146
168
  };
147
169
 
148
170
  const stream = client.sendStreamingMessage({ message });
149
171
 
150
172
  for await (const update of stream) {
151
- // process the update
173
+ // process the updates
152
174
  ...
153
175
  }
154
176
  console.log("Stream finished.");
@@ -193,6 +215,7 @@ async function runBasicTask() {
193
215
  kind: "message",
194
216
  role: "user",
195
217
  parts: [{ kind: "text", text: "What is the capital of France?" }],
218
+ ...
196
219
  };
197
220
 
198
221
  const task = await client.sendMessage({ message });
@@ -216,10 +239,13 @@ async function runStreamingTask() {
216
239
  const client = new A2AClient("https://your-a2a-server.com/a2a");
217
240
  const message: Message = {
218
241
  role: "user",
219
- parts: [{ type: "text", text: "Tell me a short story." }],
242
+ parts: [{ kind: "text", text: "Tell me a short story." }],
243
+ ...
220
244
  };
221
245
 
222
- const stream = client.sendStreamingMessage({ id: "streaming-task-1", message });
246
+ const stream = client.sendStreamingMessage({
247
+ message,
248
+ });
223
249
 
224
250
  for await (const update of stream) {
225
251
  if ((update as TaskStatusUpdateEvent).status) {
@@ -253,76 +279,231 @@ client.setHeaders({ Authorization: "Bearer ...", "X-Custom": "value" });
253
279
 
254
280
  ### Server
255
281
 
256
- Host agents using `A2AServer`. Handles protocol details. See `examples/` for more.
282
+ Use `createAgentServer()` to embed your Agents in an Express App.
257
283
 
258
284
  #### Implementing an A2A Agent
259
285
 
260
- Define agent behavior with an async generator `TaskHandler`.
286
+ The SDK provides a variety of options for creating complex ([AgentEngine](#agentengine)) or simple agents ([AgentBuilder](#agentbuilder)).
287
+
288
+ ##### AgentBuilder
289
+
290
+ **Option 1: Using AgentBuilder (Recommended for Simple Workflows)**
291
+
292
+ For simple agents with one or more processing steps, use the `AgentBuilder` pattern:
293
+
294
+ ```typescript
295
+ import { createAgentServer, AgentBuilder, TaskManager } from "@artinet/sdk";
296
+
297
+ //create a simple agent
298
+ const simpleAgent = AgentBuilder().text(() => "hello world!");
299
+
300
+ //or design a powerful workflow
301
+ const { app, agent } = createAgentServer({
302
+ agent: AgentBuilder()
303
+ .text(({ command, context }) => {
304
+ const userMessage =
305
+ command.message.parts[0]?.kind === "text"
306
+ ? command.message.parts[0].text
307
+ : "";
308
+ return {
309
+ parts: [`Processing: ${userMessage}`], //parts are immediately sent back to the caller as TaskStatusUpdateEvents
310
+ args: [userMessage], //args are passed to the next step
311
+ };
312
+ })
313
+ .file(({ command, args }) => {
314
+ const processedText = args[0];
315
+ return {
316
+ parts: [
317
+ {
318
+ name: "result.txt",
319
+ mimeType: "text/plain",
320
+ bytes: `Processed result: ${processedText}`,
321
+ },
322
+ ],
323
+ args: ["file-generated"],
324
+ };
325
+ })
326
+ .text(({ command, args }) => {
327
+ const status = args[0];
328
+ return `Task completed. Status: ${status}`;
329
+ }) //A final Task is returned to the caller which contains all of the emitted parts.
330
+ .createAgent({
331
+ agentCard: {
332
+ name: "Multi-Step Agent",
333
+ url: "http://localhost:3000/a2a",
334
+ version: "1.0.0",
335
+ capabilities: { streaming: true },
336
+ skills: [{ id: "multi-processor", name: "Multi-Step Processor" }],
337
+ },
338
+ tasks: new TaskManager(),
339
+ }),
340
+ basePath: "/a2a",
341
+ });
342
+
343
+ app.listen(3000, () => {
344
+ console.log("Multi-Step A2A Server running on http://localhost:3000/a2a");
345
+ });
346
+ ```
347
+
348
+ The `AgentBuilder` approach is particularly useful when you need:
349
+
350
+ - **Step-by-step processing**: Break down complex tasks into discrete, manageable steps
351
+ - **Data flow between steps**: Pass results from one step to the next using the `args` parameter
352
+ - **Different content types**: Mix text, file, and data processing in a single workflow
353
+ - **Reusable components**: Build modular agents that can be easily edited or extended
354
+
355
+ ##### AgentEngine
356
+
357
+ **Option 2: Direct AgentEngine Implementation**
358
+
359
+ When you need full control over the execution flow, implement an `AgentEngine` directly:
261
360
 
262
361
  ```typescript
263
362
  import {
264
- A2AServer,
265
- ExecutionContext,
363
+ createAgentServer,
364
+ Context,
266
365
  AgentEngine,
267
- InMemoryTaskStore,
366
+ TaskManager,
268
367
  } from "@artinet/sdk";
269
368
 
270
-
271
- const myAgent: AgentEngine = async function* (context: ExecutionContext) {
272
-
369
+ const myAgent: AgentEngine = async function* (context: Context) {
370
+ const task: TaskAndHistory = context.events.getState();
273
371
  yield {
274
372
  state: "working",
275
373
  message: {
374
+ ...
276
375
  role: "agent",
277
- parts: [{ type: "text", text: "Processing..." }],
376
+ parts: [{ kind: "text", text: "Processing..." }],
278
377
  },
378
+ ...
279
379
  };
280
-
281
- // Check context.isCancelled() if operation is long
282
- // await someAsyncTask();
283
- ...
284
-
285
380
  yield {
381
+ ...
286
382
  name: "result.txt",
287
383
  mimeType: "text/plain",
288
- parts: [{ type: "text", text: "Report data" }],
384
+ parts: [{ kind: "text", text: "Report data" }],
289
385
  };
290
386
 
291
387
  yield {
388
+ ...
292
389
  state: "completed",
293
390
  message: {
391
+ kind: "message"
294
392
  role: "agent",
295
- parts: [{ type: "text", text: "Finished processing." }],
393
+ parts: [{ kind: "text", text: "Finished processing." }],
394
+ ...
296
395
  },
297
396
  };
298
397
  };
299
398
 
300
- const myServer = new A2AServer({
301
- handler: myAgent,
302
- taskStore: new InMemoryTaskStore(),
303
- port: 3000,
399
+ const { app, agent } = createAgentServer({
400
+ agent: {
401
+ engine: myAgent,
402
+ agentCard: {
403
+ name: "Example Agent",
404
+ url: "http://localhost:3000/a2a",
405
+ version: "1.0.0",
406
+ capabilities: { streaming: true },
407
+ skills: [{ id: "processor", name: "Text Processor" }],
408
+ },
409
+ tasks: new TaskManager(),
410
+ },
304
411
  basePath: "/a2a",
305
- card: {
306
- name: "Example Agent",
412
+ agentCardPath: "/.well-known/agent-card.json",
413
+ });
414
+ ```
415
+
416
+ #### Event Handling/Monitoring & Message Streaming
417
+
418
+ The SDK provides comprehensive event handling & message streaming capabilities that allow you to modify agent execution, subscribe to events, stream commands, and respond to state changes in real-time.
419
+
420
+ **Override Event Behaviour**
421
+
422
+ When using the service layer, you can provide your own Event Handlers:
423
+
424
+ ```typescript
425
+ import { createAgent, TaskManager, ContextManager, Command, SendCommandInterface } from "@artinet/sdk";
426
+
427
+ const customContextManager = new ContextManger();
428
+ const agent = createAgent({
429
+ engine: (context: Context){
430
+ context.events.on("update", (currentState, nextState) => {
431
+ //allow other processes to subscribe to your agent
432
+ })
433
+ ...
434
+ //handle command streams directly within an agent
435
+ for await (const command of context.command) {
436
+ console.log("new command recieved: ", command);
437
+ //will continue polling until the command stream is closed by calling command.close();
438
+ }
439
+ //or process them asynchronously
440
+ context.command.on("send", (command) => {
441
+ ...
442
+ });
443
+ },
444
+ agentCard: {
445
+ name: "Event-Monitored Agent",
307
446
  url: "http://localhost:3000/a2a",
308
447
  version: "1.0.0",
309
448
  capabilities: { streaming: true },
310
- skills: [{ id: "processor", name: "Text Processor" }],
449
+ skills: [{ id: "monitor", name: "Monitored Agent" }],
450
+ },
451
+ contexts: customContextManager,
452
+ tasks: new TaskManager(),
453
+ eventOverrides: { //for even greater control create your own Event Handlers
454
+ onStart: async (context) => {
455
+ ...
456
+ return currentState;
457
+ },
458
+ onUpdate: async (currentState, nextState) => {
459
+ ...
460
+ return currentState;
461
+ },
462
+ ...
311
463
  },
312
464
  });
313
465
 
314
- myServer.start();
315
- console.log("A2A Server running on http://localhost:3000/a2a");
466
+ const result = await agent.sendMessage({
467
+ contextId: "123"
468
+ ...
469
+ });
470
+
471
+ const currentContext = customContextManager.getContext("123");
472
+
473
+ //subscribe to the events from a specific context
474
+ currentContext.events.on("complete", () {
475
+ ...
476
+ //errors thrown here will be triggered in the original context
477
+ });
478
+
479
+ //stream new commands into a running context
480
+ (currentContext.command as SendCommandInterface<Command>).send({
481
+ ...
482
+ });
483
+
484
+ currentContext.command.close();
316
485
  ```
317
486
 
487
+ **Available Event Types**
488
+
489
+ The EventManager supports the following event types:
490
+
491
+ - **`OnStart`/`start`**: Fired when agent execution begins
492
+ - **`OnUpdate`/`update`**: Fired on each state update during execution
493
+ - **`OnError`/`error`**: Fired when an error occurs during execution
494
+ - **`OnComplete`/`complete`**: Fired when agent execution completes successfully
495
+ - **`OnCancel`/`cancel`**: Fired when agent execution is cancelled
496
+
318
497
  #### Persistent Storage
319
498
 
320
- Use `FileStore` for file-based persistence. Ensure the directory exists.
499
+ For storage, use our out of the box storage providers like `FileStore`. Or implement the `Store` interface to create your own.
321
500
 
322
501
  ```typescript
323
502
  import path from "path";
324
503
  import fs from "fs";
504
+ import { FileStore } from "@artinet/sdk";
325
505
 
506
+ //make sure the directory exists
326
507
  const dataDir = path.join(process.cwd(), "a2a-data");
327
508
  if (!fs.existsSync(dataDir)) {
328
509
  fs.mkdirSync(dataDir, { recursive: true });
@@ -330,8 +511,14 @@ if (!fs.existsSync(dataDir)) {
330
511
 
331
512
  const myStore = new FileStore(dataDir);
332
513
 
333
- const myServer = new A2AServer({
334
- taskStore: myStore,
514
+ const { app, agent } = createAgentServer({
515
+ agent: {
516
+ engine: myAgent,
517
+ agentCard: {
518
+ ...
519
+ },
520
+ tasks: myStore,
521
+ },
335
522
  ...
336
523
  });
337
524
  ```
@@ -350,108 +537,160 @@ logger.info("Server starting...");
350
537
  //use helper functions
351
538
  logDebug("LoggerTest", { taskId: "task-123" }, "Task status updated.");
352
539
 
353
- // Create child logger with bound context
540
+ // Create child loggers with bounded contexts
354
541
  const taskLogger = logger.child({ taskId: "abc" });
355
542
  taskLogger.info("Processing step X");
356
543
  ```
357
544
 
358
- #### Server Registration & Discovery
545
+ #### Server Registration & Discovery (v0.5.2)
359
546
 
360
- The SDK includes features to help make your agent discoverable:
547
+ The SDK includes features to help make your agent discoverable using the new service-based architecture:
361
548
 
362
- - **Automatic Registration:** You can configure your `A2AServer` to automatically register your `AgentCard` with the [A2A Registry](https://artinet.io) upon startup by setting `register: true` (default: `false`) in the server parameters.
549
+ - **Automatic Registration:** You can configure your agent server to automatically register your `AgentCard` with the [A2A Registry](https://artinet.io) upon startup by setting `register: true` in the server parameters (temporarily unavailable in v0.5.6).
363
550
 
364
551
  ```typescript
365
- const myServer = new A2AServer({
366
- ...
367
- card: {
368
- ...
552
+ const { app, agent } = createAgentServer({
553
+ agent: {
554
+ engine: myAgent,
555
+ agentCard: {
556
+ // ...
369
557
  url: "http://my-public-domain:3000/my-agent", // Publicly accessible URL
370
- ...
558
+ // ...
371
559
  },
372
- register: true, // Enable automatic registration on start
373
- });
560
+ },
561
+ });
374
562
  ```
375
563
 
376
- - **Custom Agent Card Path:** By default, the server exposes its `AgentCard` at `/.well-known/agent.json` [RFC8615](https://datatracker.ietf.org/doc/html/rfc8615) and a fallback at `/agent-card`. You can specify a different fallback path using the `fallbackPath` option in `A2AServerParams`.
564
+ - **Custom Agent Card Path:** By default, the server exposes its `AgentCard` at `/.well-known/agent-card.json` following [RFC8615](https://datatracker.ietf.org/doc/html/rfc8615). You can specify a custom path using the `agentCardPath` option.
377
565
 
378
566
  ```typescript
379
- const myServer = new A2AServer({
380
- ...
381
- basePath: "/apiV2"
382
- fallbackPath: "/apiV2/custom-card-info", // Agent card available here
383
- ...
384
- });
385
- // The AgentCard is now accessible at http://localhost:3001/apiV2/custom-card-info
567
+ const { app, agent } = createAgentServer({
568
+ ...
569
+ basePath: "/apiV2",
570
+ agentCardPath: "/apiV2/custom-card-info", // Custom agent card path
571
+ });
572
+ // The AgentCard is now accessible at http://localhost:3000/apiV2/custom-card-info
386
573
  ```
387
574
 
388
575
  #### Advanced Server Customization
389
576
 
390
- Provide a custom `createJSONRPCServer` function (implementing `JSONRPCServerFactory`) for fine-grained control over the underlying RPC server.
577
+ Our new architecture provides multiple ways to customize your agent server:
578
+
579
+ **1. Using `createAgentServer`:**
580
+ Easily spin up an A2A Express app `createAgentServer()`:
581
+
582
+ ```typescript
583
+ const initialApp = express();
584
+
585
+ // custom middleware
586
+ initialApp.use((req, res, next) => {
587
+ ...
588
+ next();
589
+ });
391
590
 
392
- This factory function receives objects of type `CreateJSONRPCServerParams` & `RequestParams` containing the necessary SDK dependencies (`taskHandler`, `taskStore`, `agentCard`, `activeCancellations`, `createTaskContext`, `closeStreamsForTask`) and the specific method parameters (i.e. `SendMessageRequest["params"]`). You can use these dependencies to configure the standard A2A methods and add your own custom JSON-RPC methods.
591
+ const { app, agent } = createAgentServer({
592
+ app: initialApp
593
+ agent: {
594
+ ...
595
+ },
596
+ });
393
597
 
394
- The SDK exports default handlers for the standard A2A methods (e.g., `defaultSendMessageMethod`), create your own using dedicated A2A method types(`SendMessageMethod`) and use `createJSONRPCMethod` to easily wrap these methods with dependency injection and error handling.
598
+ // custom middleware
599
+ app.use("/custom", (req, res, next) => {
600
+ ...
601
+ });
395
602
 
396
- See `src/server/lib/middleware/factory.ts` and `src/server/lib/middleware/a2a-methods.ts` for implementation details.
603
+ ```
397
604
 
398
- **Example:**
605
+ **2. Use the JSON-RPC Middleware:**
606
+ Directly import our preconfigured JSON-RPC middleware:
399
607
 
400
608
  ```typescript
609
+ import express from "express";
610
+ import { createAgent, jsonRPCMiddleware, errorHandler, InMemoryTaskStore } from "@artinet/sdk";
401
611
 
402
- const myCustomSendMethod: SendMessageMethod = (
403
- deps,
404
- requestParams,
405
- callback
406
- ) => {
407
- const { taskStore, taskHandler, createTaskContext } = deps;
408
- const { id: taskId } = requestParams;
409
- const { message, sessionId, metadata } = requestParams;
410
- ...
411
- callback(null, ...);
412
- };
612
+ const customApp = express();
413
613
 
414
- const myCustomRPCServer: JSONRPCServerFactory = (
415
- params: CreateJSONRPCServerParams
416
- ): JSONRPCServerType => {
417
- //Use a custom message/send method
418
- const messageSendMethod = createJSONRPCMethod(params, myCustomSendMethod, "message/send");
419
- const taskGetMethod = createJSONRPCMethod(params, defaultGetTaskMethod, "tasks/get");
420
- const taskCancelMethod = createJSONRPCMethod(params, defaultCancelTaskMethod, "tasks/cancel");
421
-
422
- // Note: Push notifications are not fully implemented yet
423
- const taskPushNotificationSetMethod = createJSONRPCMethod(params, defaultSetTaskPushNotificationMethod, "tasks/pushNotificationConfig/set");
424
- const taskPushNotificationGetMethod = createJSONRPCMethod(params, defaultGetTaskPushNotificationMethod, "tasks/pushNotificationConfig/get");
425
-
426
- const rpcServer = new JSONRPCServer({
427
- "message/send": messageSendMethod,
428
- "tasks/get": taskGetMethod,
429
- "tasks/cancel": taskCancelMethod,
430
- "tasks/pushNotificationConfig/set": taskPushNotificationSetMethod,
431
- "tasks/pushNotificationConfig/get": taskPushNotificationGetMethod,
432
- });
614
+ const agent = createAgent({
615
+ engine: myAgentLogic,
616
+ agentCard: {
617
+ ...
618
+ },
619
+ tasks: new InMemoryTaskStore(),
620
+ });
433
621
 
434
- return rpcServer;
435
- };
622
+ customApp.use("/auth", yourAuthMiddleware);
623
+ customApp.use("/metrics", yourMetricsMiddleware);
624
+ customApp.use(express.json());
436
625
 
626
+ // Add the A2A middleware
627
+ customApp.post("/", async (req, res, next) => {
628
+ return await jsonRPCMiddleware(agent, req, res, next);
629
+ });
630
+ // Dont forget to add error handling*
631
+ customApp.use(errorHandler);
437
632
 
438
- const server = new A2AServer({
439
- createJSONRPCServer: myCustomRPCServer,
440
- ...
633
+ // Serve the agent card
634
+ customApp.get("/.well-known/agent-card.json", (req, res) => {
635
+ res.json(agent.agentCard);
636
+ });
637
+
638
+ // Start your custom server
639
+ const server = customApp.listen(3000, () => {
640
+ console.log("Custom A2A server running on port 3000");
441
641
  });
442
642
  ```
443
643
 
444
- **Using the Custom Factory**
644
+ **3. Using Custom Transport Layers:**
645
+ Use our preconfigured TRPC router, or create your own integration with WebSockets & other protocols:
445
646
 
446
- Pass your factory function via the `createJSONRPCServer` option during `A2AServer` initialization.
647
+ ```typescript
648
+ import { createAgentRouter } from "@artinet/sdk";
447
649
 
448
- **Important:** The default `A2AServer` setup automatically adds Express middleware to handle Server-Sent Events (SSE) for `message/stream` and `tasks/resubscribe`, as well as the `/agent/card` (and `/.well-known/agent.json`) GET endpoints. If you are **not** using `A2AServer` and integrating the Jayson server middleware into your own Express application, you **must** implement these SSE and card endpoints yourself to maintain full A2A compliance, especially for streaming functionality. See `src/server/lib/express-server.ts` for how the default server handles these routes.
650
+ const agentRouter = createAgentRouter();
651
+ ```
449
652
 
450
- ### Quick-Agents (Alpha)
653
+ **Use the Agent:**
654
+ Directly invoke the agent to use it locally:
451
655
 
452
- We are excited to introduce new capabilities for deploying agents directly onto the artinet.
656
+ ```typescript
657
+ import { createAgent } from "@artinet/sdk";
453
658
 
454
- We've added a `testDeployment` utility which is available for all users letting you bundle and test your agent logic in a temporary sandboxed environment.
659
+ const agent = createAgent({
660
+ engine: myAgentLogic,
661
+ agentCard: {
662
+ ...
663
+ },
664
+ tasks: new InMemoryTaskStore(),
665
+ });
666
+
667
+ // Wrap these calls in your desired transport logic
668
+ const result = await agent.sendMessage({
669
+ ...
670
+ });
671
+
672
+ // Directly process streams
673
+ const stream = agent.streamMessage({
674
+ ...
675
+ });
676
+
677
+ for await (const update of stream) {
678
+ ...
679
+ }
680
+ ```
681
+
682
+ **Important:** When using custom implementations, ensure you handle:
683
+
684
+ - Server-Sent Events (SSE) for `message/stream` and `tasks/resubscribe`
685
+ - Agent card endpoints at `/.well-known/agent-card.json`
686
+ - Proper error handling and JSON-RPC compliance
687
+ - CORS headers if needed for web clients
688
+
689
+ ### Quick-Agents (Alpha v0.5.2)
690
+
691
+ We are excited to introduce new capabilities for deploying agents directly onto the artinet.
692
+
693
+ We've added a `testDeployment` utility which is available for all users letting you bundle and test your agent logic in a temporary sandboxed environment.
455
694
 
456
695
  **QUICK-AGENTS** Use the `fullDeployment` utility, which allows direct deployment of your bundled agent code and `AgentCard` to the Artinet platform (requires an `ARTINET_API_KEY`).
457
696
 
@@ -459,89 +698,108 @@ To join the beta waitlist, please email us at humans@artinet.io and stay tuned f
459
698
 
460
699
  Key features include:
461
700
 
462
- - **Easy Agent Bundling:** Bundle your agent's code and dependencies into a single file using the `bundle` utility.
463
- ```typescript
464
- import { bundle } from "@artinet/sdk";
701
+ - **Easy Agent Bundling:** Bundle your agent's code and dependencies into a single file using the `bundle` utility from the new deployment export.
465
702
 
466
- const bundledCode = await bundle(new URL('./your-agent.ts', import.meta.url));
467
- ```
703
+ ```typescript
704
+ import { bundle } from "@artinet/sdk/deployment";
468
705
 
469
- - **Sandboxed Enviroments:** Streamline agent logic for quick and easy deployments. The new `artinet.v0` namespace (accessible via `@artinet/sdk/agents`) provides `taskManager`, `connect`, and `agent`.
470
- - `artinet.v0.taskManager`: Manages the agent's lifecycle by iterating over the agent's `TaskHandler` and communicating updates to the host environment.
471
- - `artinet.v0.connect`: Replaces the deprecated `fetchResponseProxy`. Allows agents to make proxied calls to other agents or LLMs via the host environment.
472
- - `artinet.v0.agent`: A factory function to obtain a `ClientProxy` for type-safe communication with other agents, managed by the host environment.
706
+ const bundledCode = await bundle(new URL("./your-agent.ts", import.meta.url));
707
+ ```
473
708
 
474
- Example of using the new `artinet.v0` utilities in an agent:
475
- ```typescript
476
- import { TaskContext, TaskYieldUpdate, Task } from "@artinet/sdk";
477
- import { artinet } from "@artinet/sdk/agents";
709
+ - **Sandboxed Enviroments:** Streamline agent logic for quick and easy deployments. The new `artinet.v0` namespace (accessible via `@artinet/sdk/agents`) provides `taskManager`, `connect`, and `agent`.
478
710
 
479
- export async function* myAgentLogic(context: TaskContext): AsyncGenerator<TaskYieldUpdate, Task | void, unknown> {
480
- yield { state: "working" };
711
+ - `artinet.v0.taskManager`: Manages the agent's lifecycle by iterating over the agent's `TaskHandler` and communicating updates to the host environment.
712
+ - `artinet.v0.connect`: Replaces the deprecated `fetchResponseProxy`. Allows agents to make proxied calls to other agents or LLMs via the host environment.
713
+ - `artinet.v0.agent`: A factory function to obtain a `ClientProxy` for type-safe communication with other agents, managed by the host environment.
481
714
 
482
- // Call another agent/LLM using artinet.v0.connect
483
- const llmResponse = await artinet.v0.connect({
484
- agentId: "SomeLLMAgentID",
485
- messages: [{ role: "user", content: "Tell me a joke." }]
486
- });
715
+ Example of using the new `artinet.v0` utilities in an agent:
487
716
 
488
- // Or communicate tasks with artinet.v0.agent
489
- const anotherAgent = artinet.v0.agent({
490
- baseUrl: "https://agents.artinet.io/agentId=456",
491
- });
492
- const taskResult = await anotherAgent.sendTask({
493
- ...
494
- });
717
+ ```typescript
718
+ import { TaskContext, TaskYieldUpdate, Task } from "@artinet/sdk";
719
+ import { artinet } from "@artinet/sdk/agents";
495
720
 
496
- }
721
+ export async function* myAgentLogic(context: TaskContext): AsyncGenerator<TaskYieldUpdate, Task | void, unknown> {
722
+ yield { state: "working" };
497
723
 
498
- // The host environment will invoke this taskManager with the agent's logic.
499
- await artinet.v0.taskManager({ taskHandler: myAgentLogic });
500
- ```
501
- *Note: The `taskHandlerProxy` and `fetchResponseProxy` utilities are now deprecated in favor of `artinet.v0.taskManager` and `artinet.v0.connect` respectively.*
724
+ // Call another agent/LLM using artinet.v0.connect
725
+ const llmResponse = await artinet.v0.connect({
726
+ agentId: "SomeLLMAgentID",
727
+ messages: [{ role: "user", content: "Tell me a joke." }]
728
+ });
502
729
 
503
- - **Test-Agents (Experimental):** Simulate and test your agents @ agents.artinet.io/test/deploy using the `testDeployment` tool.
504
- ```typescript
505
- import { testDeployment, ServerDeploymentRequestParams, SendTaskRequest } from "@artinet/sdk";
730
+ // Or communicate tasks with artinet.v0.agent
731
+ const anotherAgent = artinet.v0.agent({
732
+ baseUrl: "https://agents.artinet.io/agentId=456",
733
+ });
734
+ const taskResult = await anotherAgent.sendTask({
735
+ ...
736
+ });
506
737
 
507
- const deploymentParams: ServerDeploymentRequestParams = {
508
- code: "/* bundled code string */",
509
- };
510
- //create a list of tasks for your agent to complete once deployed
511
- const testRequests: SendTaskRequest[] = [
512
- { id: "t1", message: { role: "user", parts: [{ type: "text", text: "Hi!" }] } }
513
- ];
738
+ }
514
739
 
515
- for await (const result of testDeployment(deploymentParams, testRequests)) {
516
- console.log(result); //process the task completion requests as they come in to confirm your agents logic
517
- }
518
- ```
740
+ // The host environment will invoke this taskManager with the agent's logic.
741
+ await artinet.v0.taskManager({ taskHandler: myAgentLogic });
742
+ ```
519
743
 
520
- - **Full Deployment (Experimental):** Deploy your agent to the Artinet platform using the `fullDeployment` utility.
521
- ```typescript
522
- import { fullDeployment, ServerDeploymentRequestParams } from "@artinet/sdk";
744
+ _Note: The `taskHandlerProxy` and `fetchResponseProxy` utilities are now deprecated in favor of `artinet.v0.taskManager` and `artinet.v0.connect` respectively._
523
745
 
524
- const deploymentParams: ServerDeploymentRequestParams = {
525
- name: "My Awesome Agent",
526
- agentCard: { /* your agent card */ },
527
- code: "/* bundled code string */",
528
- };
746
+ - **Test-Agents (Experimental):** Simulate and test your agents @ agents.artinet.io/test/deploy using the `testDeployment` tool.
747
+
748
+ ```typescript
749
+ import {
750
+ testDeployment,
751
+ ServerDeploymentRequestParams,
752
+ SendTaskRequest,
753
+ } from "@artinet/sdk/deployment";
754
+
755
+ const deploymentParams: ServerDeploymentRequestParams = {
756
+ code: "/* bundled code string */",
757
+ };
758
+ //create a list of tasks for your agent to complete once deployed
759
+ const testRequests: SendTaskRequest[] = [
760
+ {
761
+ id: "t1",
762
+ message: { role: "user", parts: [{ type: "text", text: "Hi!" }] },
763
+ },
764
+ ];
765
+
766
+ for await (const result of testDeployment(deploymentParams, testRequests)) {
767
+ console.log(result); //process the task completion requests as they come in to confirm your agents logic
768
+ }
769
+ ```
770
+
771
+ - **Full Deployment (Experimental):** Deploy your agent to the Artinet platform using the `fullDeployment` utility.
772
+
773
+ ```typescript
774
+ import {
775
+ fullDeployment,
776
+ ServerDeploymentRequestParams,
777
+ } from "@artinet/sdk/deployment";
778
+
779
+ const deploymentParams: ServerDeploymentRequestParams = {
780
+ name: "My Awesome Agent",
781
+ agentCard: {
782
+ /* your agent card */
783
+ },
784
+ code: "/* bundled code string */",
785
+ };
786
+
787
+ const deploymentResult = await fullDeployment(deploymentParams); // Requires an ARTINET_API_KEY environment variable
788
+ console.log("Deployment Result:", deploymentResult);
789
+ ```
790
+
791
+ - **Dedicated Endpoints:** Once deployed your agent will be available On-Demand at its dedicated enpoint. (e.g. "https://agents.artinet.io/agentId=0xabf698845743538727a81352bfcfdb724e5c2bbe3113a26362482248f9f3e5fa/.well-known/agent-card.json")
792
+ - **New Types:** To support these features, new types for server deployment requests and responses (such as `ServerDeploymentRequestParams`, `ServerDeploymentResponse`) have been added to `src/types/extended-schema.ts`. New types for sandboxed agent interactions (`TaskProxy`, `ConnectAPICallback`, `ClientProxy`, etc.) are in `src/types/proxy.ts`.
793
+
794
+ **QUICK-AGENT FAQs**
795
+
796
+ - Test-Agents expire after 60s (need more time? let us know @humans@artinet.io)
797
+ - Quick-Agents do not have access to a filesystem or networking (limited persistance & networking capabalities are on the project roadmap).
798
+ - Quick-Agents v0 does not support streaming, push notifications or state transition history (these capabilities are on the project roadmap).
799
+ - Larger deployments can take significant time to deploy which may cause `fullDeployment` to timeout. In such cases wait to see if the listing has been added to your account before trying to deploy again.
800
+ - Quick-Agent logic is public, therefore the artinet project is not liable for any sensitive material held within a deployment.
801
+ - Available with version 0.5.6+ of the SDK with enhanced deployment capabilities.
529
802
 
530
- const deploymentResult = await fullDeployment(deploymentParams); // Requires an ARTINET_API_KEY environment variable
531
- console.log("Deployment Result:", deploymentResult);
532
- ```
533
-
534
- - **Dedicated Endpoints:** Once deployed your agent will be available On-Demand at its dedicated enpoint. (e.g. "https://agents.artinet.io/agentId=0xabf698845743538727a81352bfcfdb724e5c2bbe3113a26362482248f9f3e5fa/.well-known/agent.json")
535
- - **New Types:** To support these features, new types for server deployment requests and responses (such as `ServerDeploymentRequestParams`, `ServerDeploymentResponse`) have been added to `src/types/extended-schema.ts`. New types for sandboxed agent interactions (`TaskProxy`, `ConnectAPICallback`, `ClientProxy`, etc.) are in `src/types/proxy.ts`.
536
-
537
- **QUICK-AGENT FAQs**
538
- - Test-Agents expire after 60s (need more time? let us know @humans@artinet.io)
539
- - Quick-Agents do not have access to a filesystem or networking (limited persistance & networking capabalities are on the project roadmap).
540
- - Quick-Agents v0 does not support streaming, push notifications or state transition history (these capabilities are on the project roadmap).
541
- - Larger deployments can take significant time to deploy which may cause `fullDeployment` to timeout. In such cases wait to see if the listing has been added to your account before trying to deploy again.
542
- - Quick-Agent logic is public, therefore the artinet project is not liable for any sensitive material held within a deployment.
543
- - Only availble with version 0.5.3 of the SDK.
544
-
545
803
  Sign-up at [artinet.io](https://artinet.io/) to deploy your Quick-Agent today!
546
804
 
547
805
  ## Contributing
@@ -561,6 +819,5 @@ This SDK builds upon the concepts and specifications of the [Agent2Agent (A2A) P
561
819
  Libraries used include:
562
820
 
563
821
  - [Express.js](https://expressjs.com/) for the server framework.
564
- - [Jayson](https://github.com/tedeh/jayson) for JSON-RPC handling.
565
822
  - [Pino](https://getpino.io/) for logging.
566
823
  - [EventSource Parser](https://github.com/rexxars/eventsource-parser) for SSE streaming.