@mastra/core 0.12.0 → 0.12.1-alpha.0

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 (296) hide show
  1. package/dist/a2a/index.cjs +2 -0
  2. package/dist/a2a/index.cjs.map +1 -0
  3. package/dist/a2a/index.js +2 -0
  4. package/dist/a2a/index.js.map +1 -0
  5. package/dist/agent/index.cjs +12 -10
  6. package/dist/agent/index.cjs.map +1 -0
  7. package/dist/agent/index.d.ts.map +1 -1
  8. package/dist/agent/index.js +4 -2
  9. package/dist/agent/index.js.map +1 -0
  10. package/dist/agent/input-processor/processors/index.cjs +28 -0
  11. package/dist/agent/input-processor/processors/index.cjs.map +1 -0
  12. package/dist/agent/input-processor/processors/index.js +3 -0
  13. package/dist/agent/input-processor/processors/index.js.map +1 -0
  14. package/dist/agent/message-list/prompt/convert-to-mastra-v1.d.ts.map +1 -1
  15. package/dist/base.cjs +4 -2
  16. package/dist/base.cjs.map +1 -0
  17. package/dist/base.js +3 -1
  18. package/dist/base.js.map +1 -0
  19. package/dist/bundler/index.cjs +4 -2
  20. package/dist/bundler/index.cjs.map +1 -0
  21. package/dist/bundler/index.js +3 -1
  22. package/dist/bundler/index.js.map +1 -0
  23. package/dist/{chunk-4UWPFBC6.js → chunk-2FSLKKS2.js} +3 -1
  24. package/dist/chunk-2FSLKKS2.js.map +1 -0
  25. package/dist/{chunk-KZZXSYED.cjs → chunk-2HXWRK3P.cjs} +29 -27
  26. package/dist/chunk-2HXWRK3P.cjs.map +1 -0
  27. package/dist/{chunk-73LEILKH.cjs → chunk-2WZYQCRK.cjs} +8 -6
  28. package/dist/chunk-2WZYQCRK.cjs.map +1 -0
  29. package/dist/{chunk-Q56KGUAY.cjs → chunk-36XZYMQJ.cjs} +25 -23
  30. package/dist/chunk-36XZYMQJ.cjs.map +1 -0
  31. package/dist/{chunk-IGFHXXJK.js → chunk-37ZPKICX.js} +94 -33
  32. package/dist/chunk-37ZPKICX.js.map +1 -0
  33. package/dist/{chunk-WQNOATKB.js → chunk-3HXBPDKN.js} +2 -0
  34. package/dist/chunk-3HXBPDKN.js.map +1 -0
  35. package/dist/chunk-3OGLAFSM.cjs +4 -0
  36. package/dist/chunk-3OGLAFSM.cjs.map +1 -0
  37. package/dist/{chunk-YOQP5T77.js → chunk-436FFEF6.js} +2 -0
  38. package/dist/chunk-436FFEF6.js.map +1 -0
  39. package/dist/{chunk-4OWOJCDO.cjs → chunk-4YL65Y6W.cjs} +8 -6
  40. package/dist/chunk-4YL65Y6W.cjs.map +1 -0
  41. package/dist/{chunk-2CF2A2HU.cjs → chunk-53NB2WDT.cjs} +22 -20
  42. package/dist/chunk-53NB2WDT.cjs.map +1 -0
  43. package/dist/{chunk-URX64UP7.js → chunk-5FVXMCGK.js} +6 -4
  44. package/dist/chunk-5FVXMCGK.js.map +1 -0
  45. package/dist/{chunk-KRSHG4J7.js → chunk-5HN7GKA6.js} +46 -12
  46. package/dist/chunk-5HN7GKA6.js.map +1 -0
  47. package/dist/{chunk-B6TOBUS6.cjs → chunk-5K6WYRP2.cjs} +2 -0
  48. package/dist/chunk-5K6WYRP2.cjs.map +1 -0
  49. package/dist/{chunk-7ORSIDEV.cjs → chunk-625T2PQ3.cjs} +102 -97
  50. package/dist/chunk-625T2PQ3.cjs.map +1 -0
  51. package/dist/chunk-64G2N4FJ.cjs +14 -0
  52. package/dist/chunk-64G2N4FJ.cjs.map +1 -0
  53. package/dist/{chunk-6Y4UL5Z6.cjs → chunk-6TEQIYXV.cjs} +2 -0
  54. package/dist/chunk-6TEQIYXV.cjs.map +1 -0
  55. package/dist/{chunk-H4LWPW7Q.js → chunk-6XRFQ7TU.js} +2 -0
  56. package/dist/chunk-6XRFQ7TU.js.map +1 -0
  57. package/dist/{chunk-5MNXPPVV.cjs → chunk-7FSSUE5B.cjs} +4 -2
  58. package/dist/chunk-7FSSUE5B.cjs.map +1 -0
  59. package/dist/chunk-7L556PCF.js +3 -0
  60. package/dist/chunk-7L556PCF.js.map +1 -0
  61. package/dist/{chunk-APM2AG34.js → chunk-BQETQ54N.js} +3 -1
  62. package/dist/chunk-BQETQ54N.js.map +1 -0
  63. package/dist/chunk-CE73R5W7.js +3 -0
  64. package/dist/chunk-CE73R5W7.js.map +1 -0
  65. package/dist/{chunk-PNRVH43M.js → chunk-DNOCVBZR.js} +4 -2
  66. package/dist/chunk-DNOCVBZR.js.map +1 -0
  67. package/dist/{chunk-6UNGH46J.js → chunk-E2ZYWKI7.js} +2 -0
  68. package/dist/chunk-E2ZYWKI7.js.map +1 -0
  69. package/dist/{chunk-U64IJDC5.cjs → chunk-EBVYYC2Q.cjs} +2 -0
  70. package/dist/chunk-EBVYYC2Q.cjs.map +1 -0
  71. package/dist/{chunk-RTZD7HJT.cjs → chunk-EQ7QKYYD.cjs} +14 -12
  72. package/dist/chunk-EQ7QKYYD.cjs.map +1 -0
  73. package/dist/chunk-F37IQKBQ.cjs +4 -0
  74. package/dist/chunk-F37IQKBQ.cjs.map +1 -0
  75. package/dist/{chunk-AW3O6LVD.js → chunk-FGKI3OVY.js} +6 -4
  76. package/dist/chunk-FGKI3OVY.js.map +1 -0
  77. package/dist/{chunk-7OE6SJZL.js → chunk-FQ4W6KBT.js} +3 -1
  78. package/dist/chunk-FQ4W6KBT.js.map +1 -0
  79. package/dist/{chunk-G2GKFUTL.js → chunk-FZKOYSLX.js} +6 -4
  80. package/dist/chunk-FZKOYSLX.js.map +1 -0
  81. package/dist/{chunk-LABUWBKX.cjs → chunk-GJCSNUUV.cjs} +2 -0
  82. package/dist/chunk-GJCSNUUV.cjs.map +1 -0
  83. package/dist/{chunk-Y7D2JLKS.js → chunk-GK5V7YTQ.js} +2 -0
  84. package/dist/chunk-GK5V7YTQ.js.map +1 -0
  85. package/dist/{chunk-4Z3OU5RY.cjs → chunk-H65GI7JY.cjs} +2 -0
  86. package/dist/chunk-H65GI7JY.cjs.map +1 -0
  87. package/dist/{chunk-MBZBQG2W.js → chunk-HRDBORK6.js} +4 -2
  88. package/dist/chunk-HRDBORK6.js.map +1 -0
  89. package/dist/{chunk-GCQ4KKLG.js → chunk-IDCY7WFQ.js} +5 -3
  90. package/dist/chunk-IDCY7WFQ.js.map +1 -0
  91. package/dist/{chunk-2CK6KZ4B.js → chunk-IFEBS52C.js} +7 -5
  92. package/dist/chunk-IFEBS52C.js.map +1 -0
  93. package/dist/{chunk-CC3AUZ4I.cjs → chunk-JNRQRV5Z.cjs} +12 -10
  94. package/dist/chunk-JNRQRV5Z.cjs.map +1 -0
  95. package/dist/{chunk-IFQDWQA7.js → chunk-JOGG3NA3.js} +4 -2
  96. package/dist/chunk-JOGG3NA3.js.map +1 -0
  97. package/dist/chunk-JQE3BLYA.js +3 -0
  98. package/dist/chunk-JQE3BLYA.js.map +1 -0
  99. package/dist/{chunk-JNGXGO62.js → chunk-K2243MGP.js} +3 -1
  100. package/dist/chunk-K2243MGP.js.map +1 -0
  101. package/dist/{chunk-AMETU3JF.js → chunk-L7I7KUJX.js} +4 -2
  102. package/dist/chunk-L7I7KUJX.js.map +1 -0
  103. package/dist/{chunk-TF6V5DPV.js → chunk-LLGIJLDI.js} +20 -15
  104. package/dist/chunk-LLGIJLDI.js.map +1 -0
  105. package/dist/{chunk-BB6DPGIV.cjs → chunk-NFXTYMWZ.cjs} +2 -0
  106. package/dist/chunk-NFXTYMWZ.cjs.map +1 -0
  107. package/dist/{chunk-7XCL2NDJ.cjs → chunk-NU3S64HF.cjs} +7 -5
  108. package/dist/chunk-NU3S64HF.cjs.map +1 -0
  109. package/dist/{chunk-JQOMTERC.js → chunk-PFXXH2RP.js} +2 -0
  110. package/dist/chunk-PFXXH2RP.js.map +1 -0
  111. package/dist/{chunk-EUUWJR6D.cjs → chunk-PO3MSOZM.cjs} +9 -7
  112. package/dist/chunk-PO3MSOZM.cjs.map +1 -0
  113. package/dist/{chunk-C4LMN2IR.js → chunk-QU6RMCGM.js} +2 -0
  114. package/dist/chunk-QU6RMCGM.js.map +1 -0
  115. package/dist/{chunk-BDDSZNZI.cjs → chunk-QVUORBVZ.cjs} +73 -39
  116. package/dist/chunk-QVUORBVZ.cjs.map +1 -0
  117. package/dist/{chunk-5YDTZN2X.js → chunk-R3SQUADS.js} +2 -0
  118. package/dist/chunk-R3SQUADS.js.map +1 -0
  119. package/dist/{chunk-TWP22Z2C.cjs → chunk-S6MAHT7F.cjs} +2 -0
  120. package/dist/chunk-S6MAHT7F.cjs.map +1 -0
  121. package/dist/{chunk-DB5ATCFQ.cjs → chunk-SJNG7JGN.cjs} +10 -8
  122. package/dist/chunk-SJNG7JGN.cjs.map +1 -0
  123. package/dist/{chunk-A5BO52EQ.cjs → chunk-TSNDVBUU.cjs} +2 -0
  124. package/dist/chunk-TSNDVBUU.cjs.map +1 -0
  125. package/dist/{chunk-4LSYL7K7.js → chunk-TTELJD4F.js} +2 -0
  126. package/dist/chunk-TTELJD4F.js.map +1 -0
  127. package/dist/{chunk-XXJ65TNC.cjs → chunk-TVSZEBOM.cjs} +98 -37
  128. package/dist/chunk-TVSZEBOM.cjs.map +1 -0
  129. package/dist/{chunk-ZIZ3CVHN.cjs → chunk-TXGTGUX2.cjs} +2 -0
  130. package/dist/chunk-TXGTGUX2.cjs.map +1 -0
  131. package/dist/{chunk-LXFZUKP3.cjs → chunk-V3VLOOSW.cjs} +2 -0
  132. package/dist/chunk-V3VLOOSW.cjs.map +1 -0
  133. package/dist/chunk-VBPPPQO3.cjs +4 -0
  134. package/dist/chunk-VBPPPQO3.cjs.map +1 -0
  135. package/dist/chunk-VED2OIYL.cjs +4 -0
  136. package/dist/chunk-VED2OIYL.cjs.map +1 -0
  137. package/dist/{chunk-SSJT3HFU.cjs → chunk-VP22CDTX.cjs} +36 -34
  138. package/dist/chunk-VP22CDTX.cjs.map +1 -0
  139. package/dist/{chunk-XM4DZF2K.js → chunk-WIARV7AU.js} +9 -7
  140. package/dist/chunk-WIARV7AU.js.map +1 -0
  141. package/dist/{chunk-NLCJPOTZ.js → chunk-WNSZ4ZMC.js} +3 -1
  142. package/dist/chunk-WNSZ4ZMC.js.map +1 -0
  143. package/dist/{chunk-KZYJFNRH.cjs → chunk-WVIY3V3E.cjs} +4 -2
  144. package/dist/chunk-WVIY3V3E.cjs.map +1 -0
  145. package/dist/{chunk-LHCCHHNV.cjs → chunk-WYJ5BHEW.cjs} +2 -0
  146. package/dist/chunk-WYJ5BHEW.cjs.map +1 -0
  147. package/dist/{chunk-UNAVSISC.js → chunk-YW7UILPE.js} +2 -0
  148. package/dist/chunk-YW7UILPE.js.map +1 -0
  149. package/dist/{chunk-SGGPJWRQ.js → chunk-ZET2LV2K.js} +2 -0
  150. package/dist/chunk-ZET2LV2K.js.map +1 -0
  151. package/dist/chunk-ZPQQN52E.js +3 -0
  152. package/dist/chunk-ZPQQN52E.js.map +1 -0
  153. package/dist/{chunk-B7SQOKEC.cjs → chunk-ZQBOFNR4.cjs} +4 -2
  154. package/dist/chunk-ZQBOFNR4.cjs.map +1 -0
  155. package/dist/deployer/index.cjs +4 -2
  156. package/dist/deployer/index.cjs.map +1 -0
  157. package/dist/deployer/index.js +3 -1
  158. package/dist/deployer/index.js.map +1 -0
  159. package/dist/di/index.cjs +4 -2
  160. package/dist/di/index.cjs.map +1 -0
  161. package/dist/di/index.js +3 -1
  162. package/dist/di/index.js.map +1 -0
  163. package/dist/error/index.cjs +7 -5
  164. package/dist/error/index.cjs.map +1 -0
  165. package/dist/error/index.js +3 -1
  166. package/dist/error/index.js.map +1 -0
  167. package/dist/eval/index.cjs +5 -3
  168. package/dist/eval/index.cjs.map +1 -0
  169. package/dist/eval/index.js +3 -1
  170. package/dist/eval/index.js.map +1 -0
  171. package/dist/hooks/index.cjs +6 -4
  172. package/dist/hooks/index.cjs.map +1 -0
  173. package/dist/hooks/index.js +3 -1
  174. package/dist/hooks/index.js.map +1 -0
  175. package/dist/index.cjs +72 -70
  176. package/dist/index.cjs.map +1 -0
  177. package/dist/index.js +22 -20
  178. package/dist/index.js.map +1 -0
  179. package/dist/integration/index.cjs +5 -3
  180. package/dist/integration/index.cjs.map +1 -0
  181. package/dist/integration/index.js +3 -1
  182. package/dist/integration/index.js.map +1 -0
  183. package/dist/llm/index.cjs +2 -0
  184. package/dist/llm/index.cjs.map +1 -0
  185. package/dist/llm/index.js +2 -0
  186. package/dist/llm/index.js.map +1 -0
  187. package/dist/logger/index.cjs +13 -11
  188. package/dist/logger/index.cjs.map +1 -0
  189. package/dist/logger/index.js +4 -2
  190. package/dist/logger/index.js.map +1 -0
  191. package/dist/mastra/index.cjs +4 -2
  192. package/dist/mastra/index.cjs.map +1 -0
  193. package/dist/mastra/index.js +3 -1
  194. package/dist/mastra/index.js.map +1 -0
  195. package/dist/mcp/index.cjs +6 -4
  196. package/dist/mcp/index.cjs.map +1 -0
  197. package/dist/mcp/index.js +4 -2
  198. package/dist/mcp/index.js.map +1 -0
  199. package/dist/memory/index.cjs +6 -4
  200. package/dist/memory/index.cjs.map +1 -0
  201. package/dist/memory/index.js +3 -1
  202. package/dist/memory/index.js.map +1 -0
  203. package/dist/network/index.cjs +12 -10
  204. package/dist/network/index.cjs.map +1 -0
  205. package/dist/network/index.js +7 -5
  206. package/dist/network/index.js.map +1 -0
  207. package/dist/network/vNext/index.cjs +40 -38
  208. package/dist/network/vNext/index.cjs.map +1 -0
  209. package/dist/network/vNext/index.js +8 -6
  210. package/dist/network/vNext/index.js.map +1 -0
  211. package/dist/relevance/index.cjs +6 -4
  212. package/dist/relevance/index.cjs.map +1 -0
  213. package/dist/relevance/index.js +3 -1
  214. package/dist/relevance/index.js.map +1 -0
  215. package/dist/runtime-context/index.cjs +4 -2
  216. package/dist/runtime-context/index.cjs.map +1 -0
  217. package/dist/runtime-context/index.js +3 -1
  218. package/dist/runtime-context/index.js.map +1 -0
  219. package/dist/scores/index.cjs +9 -7
  220. package/dist/scores/index.cjs.map +1 -0
  221. package/dist/scores/index.js +4 -2
  222. package/dist/scores/index.js.map +1 -0
  223. package/dist/server/index.cjs +15 -13
  224. package/dist/server/index.cjs.map +1 -0
  225. package/dist/server/index.js +6 -4
  226. package/dist/server/index.js.map +1 -0
  227. package/dist/storage/index.cjs +32 -30
  228. package/dist/storage/index.cjs.map +1 -0
  229. package/dist/storage/index.js +8 -6
  230. package/dist/storage/index.js.map +1 -0
  231. package/dist/telemetry/index.cjs +9 -7
  232. package/dist/telemetry/index.cjs.map +1 -0
  233. package/dist/telemetry/index.js +3 -1
  234. package/dist/telemetry/index.js.map +1 -0
  235. package/dist/telemetry/otel-vendor.cjs +2 -0
  236. package/dist/telemetry/otel-vendor.cjs.map +1 -0
  237. package/dist/telemetry/otel-vendor.js +2 -0
  238. package/dist/telemetry/otel-vendor.js.map +1 -0
  239. package/dist/test-utils/llm-mock.cjs +4 -2
  240. package/dist/test-utils/llm-mock.cjs.map +1 -0
  241. package/dist/test-utils/llm-mock.js +3 -1
  242. package/dist/test-utils/llm-mock.js.map +1 -0
  243. package/dist/tools/index.cjs +8 -6
  244. package/dist/tools/index.cjs.map +1 -0
  245. package/dist/tools/index.js +4 -2
  246. package/dist/tools/index.js.map +1 -0
  247. package/dist/tools/is-vercel-tool.cjs +4 -2
  248. package/dist/tools/is-vercel-tool.cjs.map +1 -0
  249. package/dist/tools/is-vercel-tool.js +3 -1
  250. package/dist/tools/is-vercel-tool.js.map +1 -0
  251. package/dist/tts/index.cjs +4 -2
  252. package/dist/tts/index.cjs.map +1 -0
  253. package/dist/tts/index.js +3 -1
  254. package/dist/tts/index.js.map +1 -0
  255. package/dist/utils.cjs +17 -15
  256. package/dist/utils.cjs.map +1 -0
  257. package/dist/utils.js +3 -1
  258. package/dist/utils.js.map +1 -0
  259. package/dist/vector/filter/index.cjs +2 -0
  260. package/dist/vector/filter/index.cjs.map +1 -0
  261. package/dist/vector/filter/index.js +2 -0
  262. package/dist/vector/filter/index.js.map +1 -0
  263. package/dist/vector/index.cjs +4 -2
  264. package/dist/vector/index.cjs.map +1 -0
  265. package/dist/vector/index.js +3 -1
  266. package/dist/vector/index.js.map +1 -0
  267. package/dist/voice/index.cjs +6 -4
  268. package/dist/voice/index.cjs.map +1 -0
  269. package/dist/voice/index.js +3 -1
  270. package/dist/voice/index.js.map +1 -0
  271. package/dist/workflows/constants.cjs +4 -2
  272. package/dist/workflows/constants.cjs.map +1 -0
  273. package/dist/workflows/constants.js +3 -1
  274. package/dist/workflows/constants.js.map +1 -0
  275. package/dist/workflows/index.cjs +12 -10
  276. package/dist/workflows/index.cjs.map +1 -0
  277. package/dist/workflows/index.js +3 -1
  278. package/dist/workflows/index.js.map +1 -0
  279. package/dist/workflows/legacy/index.cjs +24 -22
  280. package/dist/workflows/legacy/index.cjs.map +1 -0
  281. package/dist/workflows/legacy/index.js +3 -1
  282. package/dist/workflows/legacy/index.js.map +1 -0
  283. package/dist/workflows/workflow.d.ts +1 -1
  284. package/dist/workflows/workflow.d.ts.map +1 -1
  285. package/package.json +9 -9
  286. package/dist/chunk-7HZ6NIAF.cjs +0 -2
  287. package/dist/chunk-FRQFWZDN.cjs +0 -2
  288. package/dist/chunk-HSVOEWAM.cjs +0 -2
  289. package/dist/chunk-NH5WJNNS.js +0 -1
  290. package/dist/chunk-R4V75T7J.js +0 -1
  291. package/dist/chunk-RDFYWSJH.cjs +0 -2
  292. package/dist/chunk-RSB4JCLA.cjs +0 -12
  293. package/dist/chunk-VWC3Z77Y.js +0 -1
  294. package/dist/chunk-ZDWFBE5L.js +0 -1
  295. package/dist/integration/openapi-toolset.mock.d.ts +0 -17
  296. package/dist/integration/openapi-toolset.mock.d.ts.map +0 -1
@@ -77,3 +77,5 @@ exports.ErrorCodePushNotificationNotSupported = ErrorCodePushNotificationNotSupp
77
77
  exports.ErrorCodeTaskNotCancelable = ErrorCodeTaskNotCancelable;
78
78
  exports.ErrorCodeTaskNotFound = ErrorCodeTaskNotFound;
79
79
  exports.ErrorCodeUnsupportedOperation = ErrorCodeUnsupportedOperation;
80
+ //# sourceMappingURL=index.cjs.map
81
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources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AO,IAAI,SAAA,CAAS,uBAAA,EAAyB,OAAA,EAAS,IAAI,CAAA;AAAA,EAC5D;AAAA,EAEA,OAAO,eAAe,MAAA,EAA0B;AAC9C,IAAA,OAAO,IAAI,SAAA,CAAS,uBAAA,EAAyB,CAAA,kBAAA,EAAqB,MAAM,CAAA,CAAE,CAAA;AAAA,EAC5E;AAAA,EAEA,OAAO,aAAA,CAAc,OAAA,EAAiB,IAAA,EAA0B;AAC9D,IAAA,OAAO,IAAI,SAAA,CAAS,sBAAA,EAAwB,OAAA,EAAS,IAAI,CAAA;AAAA,EAC3D;AAAA,EAEA,OAAO,aAAA,CAAc,OAAA,EAAiB,IAAA,EAA0B;AAC9D,IAAA,OAAO,IAAI,SAAA,CAAS,sBAAA,EAAwB,OAAA,EAAS,IAAI,CAAA;AAAA,EAC3D;AAAA,EAEA,OAAO,aAAa,MAAA,EAA0B;AAC5C,IAAA,OAAO,IAAI,SAAA,CAAS,qBAAA,EAAuB,mBAAmB,MAAM,CAAA,CAAA,EAAI,QAAW,MAAM,CAAA;AAAA,EAC3F;AAAA,EAEA,OAAO,kBAAkB,MAAA,EAA0B;AACjD,IAAA,OAAO,IAAI,SAAA,CAAS,0BAAA,EAA4B,wBAAwB,MAAM,CAAA,CAAA,EAAI,QAAW,MAAM,CAAA;AAAA,EACrG;AAAA,EAEA,OAAO,4BAAA,GAAyC;AAC9C,IAAA,OAAO,IAAI,SAAA,CAAS,qCAAA,EAAuC,oCAAoC,CAAA;AAAA,EACjG;AAAA,EAEA,OAAO,qBAAqB,SAAA,EAA6B;AACvD,IAAA,OAAO,IAAI,SAAA,CAAS,6BAAA,EAA+B,CAAA,uBAAA,EAA0B,SAAS,CAAA,CAAE,CAAA;AAAA,EAC1F;AACF","file":"index.cjs","sourcesContent":["// === JSON-RPC Base Structures\n\n/**\n * Base interface for identifying JSON-RPC messages.\n */\nexport interface JSONRPCMessageIdentifier {\n /**\n * Request identifier. Can be a string, number, or null.\n * Responses must have the same ID as the request they relate to.\n * Notifications (requests without an expected response) should omit the ID or use null.\n */\n id?: number | string | null;\n}\n\n/**\n * Base interface for all JSON-RPC messages (Requests and Responses).\n */\nexport interface JSONRPCMessage extends JSONRPCMessageIdentifier {\n /**\n * Specifies the JSON-RPC version. Must be \"2.0\".\n * @default \"2.0\"\n * @const \"2.0\"\n */\n jsonrpc?: '2.0';\n}\n\n/**\n * Represents a JSON-RPC request object base structure.\n * Specific request types should extend this.\n */\nexport interface JSONRPCRequest extends JSONRPCMessage {\n /**\n * The name of the method to be invoked.\n */\n method: string;\n\n /**\n * Parameters for the method. Can be a structured object, an array, or null/omitted.\n * Specific request interfaces will define the exact type.\n * @default null\n */\n params?: unknown; // Base type; specific requests will override\n}\n\n/**\n * Represents a JSON-RPC error object.\n */\nexport interface JSONRPCError<Data = unknown | null, Code = number> {\n /**\n * A number indicating the error type that occurred.\n */\n code: Code;\n\n /**\n * A string providing a short description of the error.\n */\n message: string;\n\n /**\n * Optional additional data about the error.\n * @default null\n */\n data?: Data;\n}\n\n/**\n * Represents a JSON-RPC response object.\n */\nexport interface JSONRPCResponse<R = unknown | null, E = unknown | null> extends JSONRPCMessage {\n /**\n * The result of the method invocation. Required on success.\n * Should be null or omitted if an error occurred.\n * @default null\n */\n result?: R;\n\n /**\n * An error object if an error occurred during the request. Required on failure.\n * Should be null or omitted if the request was successful.\n * @default null\n */\n error?: JSONRPCError<E> | null;\n}\n\n// === Core A2A Data Structures\n\n/**\n * Represents the state of a task within the A2A protocol.\n * @description An enumeration.\n */\nexport type TaskState = 'submitted' | 'working' | 'input-required' | 'completed' | 'canceled' | 'failed' | 'unknown';\n\n/**\n * Defines the authentication schemes and credentials for an agent.\n */\nexport interface AgentAuthentication {\n /**\n * List of supported authentication schemes.\n */\n schemes: string[];\n\n /**\n * Credentials for authentication. Can be a string (e.g., token) or null if not required initially.\n * @default null\n */\n credentials?: string | null;\n}\n\n/**\n * Describes the capabilities of an agent.\n */\nexport interface AgentCapabilities {\n /**\n * Indicates if the agent supports streaming responses.\n * @default false\n */\n streaming?: boolean;\n\n /**\n * Indicates if the agent supports push notification mechanisms.\n * @default false\n */\n pushNotifications?: boolean;\n\n /**\n * Indicates if the agent supports providing state transition history.\n * @default false\n */\n stateTransitionHistory?: boolean;\n}\n\n/**\n * Represents the provider or organization behind an agent.\n */\nexport interface AgentProvider {\n /**\n * The name of the organization providing the agent.\n */\n organization: string;\n\n /**\n * URL associated with the agent provider.\n * @default null\n */\n url?: string | null;\n}\n\n/**\n * Defines a specific skill or capability offered by an agent.\n */\nexport interface AgentSkill {\n /**\n * Unique identifier for the skill.\n */\n id: string;\n\n /**\n * Human-readable name of the skill.\n */\n name: string;\n\n /**\n * Optional description of the skill.\n * @default null\n */\n description?: string | null;\n\n /**\n * Optional list of tags associated with the skill for categorization.\n * @default null\n */\n tags?: string[] | null;\n\n /**\n * Optional list of example inputs or use cases for the skill.\n * @default null\n */\n examples?: string[] | null;\n\n /**\n * Optional list of input modes supported by this skill, overriding agent defaults.\n * @default null\n */\n inputModes?: string[] | null;\n\n /**\n * Optional list of output modes supported by this skill, overriding agent defaults.\n * @default null\n */\n outputModes?: string[] | null;\n}\n\n/**\n * Represents the metadata card for an agent, describing its properties and capabilities.\n */\nexport interface AgentCard {\n /**\n * The name of the agent.\n */\n name: string;\n\n /**\n * An optional description of the agent.\n * @default null\n */\n description?: string | null;\n\n /**\n * The base URL endpoint for interacting with the agent.\n */\n url: string;\n\n /**\n * Information about the provider of the agent.\n * @default null\n */\n provider?: AgentProvider | null;\n\n /**\n * The version identifier for the agent or its API.\n */\n version: string;\n\n /**\n * An optional URL pointing to the agent's documentation.\n * @default null\n */\n documentationUrl?: string | null;\n\n /**\n * The capabilities supported by the agent.\n */\n capabilities: AgentCapabilities;\n\n /**\n * Authentication details required to interact with the agent.\n * @default null\n */\n authentication?: AgentAuthentication | null;\n\n /**\n * Default input modes supported by the agent (e.g., 'text', 'file', 'json').\n * @default [\"text\"]\n */\n defaultInputModes?: string[];\n\n /**\n * Default output modes supported by the agent (e.g., 'text', 'file', 'json').\n * @default [\"text\"]\n */\n defaultOutputModes?: string[];\n\n /**\n * List of specific skills offered by the agent.\n */\n skills: AgentSkill[];\n}\n\nexport interface FileContentBase {\n /**\n * Optional name of the file.\n * @default null\n */\n name?: string | null;\n\n /**\n * Optional MIME type of the file content.\n * @default null\n */\n mimeType?: string | null;\n\n /**\n * File content encoded as a Base64 string. Use this OR `uri`.\n */\n bytes?: string | null;\n\n /**\n * URI pointing to the file content. Use this OR `bytes`.\n */\n uri?: string | null;\n}\n\nexport type FileContentBytes = FileContentBase & {\n /* File content encoded as a Base64 string. Use this OR `uri`. */\n bytes: string;\n uri?: never;\n};\n\nexport type FileContentUri = FileContentBase & {\n /** URI pointing to the file content. */\n uri: string;\n bytes?: never;\n};\n\n/**\n * Represents the content of a file, either as base64 encoded bytes or a URI.\n * @description Ensures that either 'bytes' or 'uri' is provided, but not both. (Note: This constraint is informational in TypeScript types).\n */\nexport type FileContent = FileContentBytes | FileContentUri;\n\n/**\n * Represents a part of a message containing text content.\n */\nexport interface TextPart {\n type: 'text';\n\n /**\n * The text content.\n */\n text: string;\n\n /**\n * Optional metadata associated with this text part.\n */\n metadata?: Record<string, unknown> | null;\n}\n\n/**\n * Represents a part of a message containing file content.\n */\nexport interface FilePart {\n /**\n * Type identifier for this part.\n */\n type: 'file';\n\n /**\n * The file content, provided either inline or via URI.\n */\n file: FileContent;\n\n /**\n * Optional metadata associated with this file part.\n */\n metadata?: Record<string, unknown> | null;\n}\n\n/**\n * Represents a part of a message containing structured data (JSON).\n */\nexport interface DataPart {\n /**\n * Type identifier for this part.\n */\n type: 'data';\n\n /**\n * The structured data content as a JSON object.\n */\n data: Record<string, unknown>;\n\n /**\n * Optional metadata associated with this data part.\n */\n metadata?: Record<string, unknown> | null;\n}\n\n/**\n * Represents a single part of a multi-part message. Can be text, file, or data.\n */\nexport type Part = TextPart | FilePart | DataPart;\n\n/**\n * Represents an artifact generated or used by a task, potentially composed of multiple parts.\n */\nexport interface Artifact {\n /**\n * Optional name for the artifact.\n * @default null\n */\n name?: string | null;\n\n /**\n * Optional description of the artifact.\n * @default null\n */\n description?: string | null;\n\n /**\n * The constituent parts of the artifact.\n */\n parts: Part[];\n\n /**\n * Optional index for ordering artifacts, especially relevant in streaming or updates.\n * @default 0\n */\n index?: number;\n\n /**\n * Optional flag indicating if this artifact content should append to previous content (for streaming).\n * @default null\n */\n append?: boolean | null;\n\n /**\n * Optional metadata associated with the artifact.\n * @default null\n */\n metadata?: Record<string, unknown> | null;\n\n /**\n * Optional flag indicating if this is the last chunk of data for this artifact (for streaming).\n * @default null\n */\n lastChunk?: boolean | null;\n}\n\n/**\n * Represents a message exchanged between a user and an agent.\n */\nexport interface Message {\n /**\n * The role of the sender (user or agent).\n */\n role: 'user' | 'agent';\n\n /**\n * The content of the message, composed of one or more parts.\n */\n parts: Part[];\n\n /**\n * Optional metadata associated with the message.\n * @default null\n */\n metadata?: Record<string, unknown> | null;\n}\n\n/**\n * Represents the status of a task at a specific point in time.\n */\nexport interface TaskStatus {\n /**\n * The current state of the task.\n */\n state: TaskState;\n\n /**\n * An optional message associated with the current status (e.g., progress update, final response).\n * @default null\n */\n message?: Message | null;\n\n /**\n * The timestamp when this status was recorded (ISO 8601 format).\n * @format date-time\n */\n timestamp?: string;\n}\n\n/**\n * Represents a task being processed by an agent.\n */\nexport interface Task {\n /**\n * Unique identifier for the task.\n */\n id: string;\n\n /**\n * Optional identifier for the session this task belongs to.\n * @default null\n */\n sessionId?: string | null;\n\n /**\n * The current status of the task.\n */\n status: TaskStatus;\n\n /**\n * Optional list of artifacts associated with the task (e.g., outputs, intermediate files).\n * @default null\n */\n artifacts?: Artifact[] | null;\n\n /**\n * Optional metadata associated with the task.\n * @default null\n */\n metadata?: Record<string, unknown> | null;\n}\n\n/**\n * Represents the history of messages exchanged within a task's session.\n */\nexport interface TaskHistory {\n /**\n * List of messages in chronological order.\n * @default []\n */\n messageHistory?: Message[];\n}\n\n/**\n * Represents a status update event for a task, typically used in streaming scenarios.\n */\nexport interface TaskStatusUpdateEvent {\n /**\n * The ID of the task being updated.\n */\n id: string;\n\n /**\n * The new status of the task.\n */\n status: TaskStatus;\n\n /**\n * Flag indicating if this is the final update for the task.\n * @default false\n */\n final?: boolean;\n\n /**\n * Optional metadata associated with this update event.\n * @default null\n */\n metadata?: Record<string, unknown> | null;\n}\n\n/**\n * Represents an artifact update event for a task, typically used in streaming scenarios.\n */\nexport interface TaskArtifactUpdateEvent {\n /**\n * The ID of the task being updated.\n */\n id: string;\n\n /**\n * The new or updated artifact for the task.\n */\n artifact: Artifact;\n\n /**\n * Flag indicating if this is the final update for the task.\n * @default false\n */\n final?: boolean;\n\n /**\n * Optional metadata associated with this update event.\n * @default null\n */\n metadata?: Record<string, unknown> | null;\n}\n\n// Alias for backward compatibility\nexport type TaskUpdateEvent = TaskStatusUpdateEvent;\n\n// === Error Types (Standard and A2A)\n\n/** Error code for JSON Parse Error (-32700). Invalid JSON was received by the server. */\nexport const ErrorCodeParseError = -32700;\nexport type ErrorCodeParseError = typeof ErrorCodeParseError;\n/** Error code for Invalid Request (-32600). The JSON sent is not a valid Request object. */\nexport const ErrorCodeInvalidRequest = -32600;\nexport type ErrorCodeInvalidRequest = typeof ErrorCodeInvalidRequest;\n/** Error code for Method Not Found (-32601). The method does not exist / is not available. */\nexport const ErrorCodeMethodNotFound = -32601;\nexport type ErrorCodeMethodNotFound = typeof ErrorCodeMethodNotFound;\n/** Error code for Invalid Params (-32602). Invalid method parameter(s). */\nexport const ErrorCodeInvalidParams = -32602;\nexport type ErrorCodeInvalidParams = typeof ErrorCodeInvalidParams;\n/** Error code for Internal Error (-32603). Internal JSON-RPC error. */\nexport const ErrorCodeInternalError = -32603;\nexport type ErrorCodeInternalError = typeof ErrorCodeInternalError;\n\n/** Error code for Task Not Found (-32001). The specified task was not found. */\nexport const ErrorCodeTaskNotFound = -32001;\nexport type ErrorCodeTaskNotFound = typeof ErrorCodeTaskNotFound;\n/** Error code for Task Not Cancelable (-32002). The specified task cannot be canceled. */\nexport const ErrorCodeTaskNotCancelable = -32002;\nexport type ErrorCodeTaskNotCancelable = typeof ErrorCodeTaskNotCancelable;\n/** Error code for Push Notification Not Supported (-32003). Push Notifications are not supported for this operation or agent. */\nexport const ErrorCodePushNotificationNotSupported = -32003;\nexport type ErrorCodePushNotificationNotSupported = typeof ErrorCodePushNotificationNotSupported;\n/** Error code for Unsupported Operation (-32004). The requested operation is not supported by the agent. */\nexport const ErrorCodeUnsupportedOperation = -32004;\nexport type ErrorCodeUnsupportedOperation = typeof ErrorCodeUnsupportedOperation;\n\n/**\n * Union of all well-known A2A and standard JSON-RPC error codes defined in this schema.\n * Use this type for checking against specific error codes. A server might theoretically\n * use other codes within the valid JSON-RPC ranges.\n */\nexport type KnownErrorCode =\n | typeof ErrorCodeParseError\n | typeof ErrorCodeInvalidRequest\n | typeof ErrorCodeMethodNotFound\n | typeof ErrorCodeInvalidParams\n | typeof ErrorCodeInternalError\n | typeof ErrorCodeTaskNotFound\n | typeof ErrorCodeTaskNotCancelable\n | typeof ErrorCodePushNotificationNotSupported\n | typeof ErrorCodeUnsupportedOperation;\n\ntype A2AError = JSONRPCError<unknown | null, KnownErrorCode | number>;\n\n// === Push Notifications and Authentication Info\n\n/**\n * Authentication information, potentially including additional properties beyond the standard ones.\n * (Note: Schema allows additional properties).\n */\nexport interface AuthenticationInfo extends AgentAuthentication {\n /** Allow any other properties */\n [key: string]: any;\n}\n\n/**\n * Information required for setting up push notifications.\n */\nexport interface PushNotificationConfig {\n /**\n * The URL endpoint where the agent should send notifications.\n */\n url: string;\n\n /**\n * A token to be included in push notification requests for verification/authentication.\n */\n token?: string;\n\n /**\n * Optional authentication details needed by the agent to call the notification URL.\n * @default null\n */\n authentication?: AuthenticationInfo | null;\n}\n\n/**\n * Represents the push notification information associated with a specific task ID.\n * Used as parameters for `tasks/pushNotification/set` and as a result type.\n */\nexport interface TaskPushNotificationConfig {\n /**\n * The ID of the task the notification config is associated with.\n */\n id: string;\n /**\n * The push notification configuration details.\n */\n pushNotificationConfig: PushNotificationConfig;\n}\n\n// ================================================================= A2A Request Parameter Types\n// =================================================================\n\n/**\n * Parameters for the `tasks/send` method.\n */\nexport interface TaskSendParams {\n /**\n * Unique identifier for the task being initiated or continued.\n */\n id: string;\n\n /**\n * Optional identifier for the session this task belongs to. If not provided, a new session might be implicitly created depending on the agent.\n */\n sessionId?: string;\n\n /**\n * The message content to send to the agent for processing.\n */\n message: Message;\n\n /**\n * Optional pushNotification information for receiving notifications about this task. Requires agent capability.\n * @default null\n */\n pushNotification?: PushNotificationConfig | null;\n\n /**\n * Optional parameter to specify how much message history to include in the response.\n * @default null\n */\n historyLength?: number | null;\n\n /**\n * Optional metadata associated with sending this message.\n * @default null\n */\n metadata?: Record<string, unknown> | null;\n}\n\n/**\n * Basic parameters used for task ID operations.\n * Used by: `tasks/cancel`, `tasks/pushNotification/get`.\n */\nexport interface TaskIdParams {\n /**\n * The unique identifier of the task.\n */\n id: string;\n\n /**\n * Optional metadata to include with the operation.\n * @default null\n */\n metadata?: Record<string, unknown> | null;\n}\n\n/**\n * Parameters used for querying task-related information by ID.\n * Used by: `tasks/get`, `tasks/getHistory`, `tasks/subscribe`, `tasks/resubscribe`.\n */\nexport interface TaskQueryParams extends TaskIdParams {\n /**\n * Optional history length to retrieve for the task.\n * @default null\n */\n historyLength?: number | null;\n}\n\n// === A2A Request Interfaces\n\n/**\n * Request to send a message/initiate a task.\n */\nexport interface SendTaskRequest extends JSONRPCRequest {\n /**\n * Method name for sending a task message.\n */\n method: 'tasks/send';\n /**\n * Parameters for the send task method.\n */\n params: TaskSendParams;\n}\n\n/**\n * Request to retrieve the current state of a task.\n */\nexport interface GetTaskRequest extends JSONRPCRequest {\n /**\n * Method name for getting task status.\n */\n method: 'tasks/get';\n /**\n * Parameters for the get task method.\n */\n params: TaskQueryParams;\n}\n\n/**\n * Request to cancel a currently running task.\n */\nexport interface CancelTaskRequest extends JSONRPCRequest {\n /**\n * Method name for canceling a task.\n */\n method: 'tasks/cancel';\n /**\n * Parameters for the cancel task method.\n */\n params: TaskIdParams;\n}\n\n/**\n * Request to set or update the push notification config for a task.\n */\nexport interface SetTaskPushNotificationRequest extends JSONRPCRequest {\n /**\n * Method name for setting a task notifications.\n */\n method: 'tasks/pushNotification/set';\n /**\n * Parameters for the set task push notification method.\n */\n params: TaskPushNotificationConfig; // Uses TaskPushNotificationConfig directly as params\n}\n\n/**\n * Request to retrieve the currently configured push notification configuration for a task.\n */\nexport interface GetTaskPushNotificationRequest extends JSONRPCRequest {\n /**\n * Method name for getting task notification configuration.\n */\n method: 'tasks/pushNotification/get';\n /**\n * Parameters for the get task push notification config method.\n */\n params: TaskIdParams;\n}\n\n/**\n * Request to resubscribe to updates for a task after a connection interruption.\n */\nexport interface TaskResubscriptionRequest extends JSONRPCRequest {\n /**\n * Method name for resubscribing to task updates.\n */\n method: 'tasks/resubscribe';\n /**\n * Parameters for the task resubscription method.\n */\n params: TaskQueryParams;\n}\n\n/**\n * Request to send a message/initiate a task and subscribe to streaming updates.\n */\nexport interface SendTaskStreamingRequest extends JSONRPCRequest {\n /**\n * Method name for sending a task message and subscribing to updates.\n */\n method: 'tasks/sendSubscribe';\n /**\n * Parameters for the streaming task send method.\n */\n params: TaskSendParams;\n}\n\n// === A2A Response Interfaces\n\n/**\n * Response to a `tasks/send` request.\n * Contains the Task object or an error.\n */\nexport type SendTaskResponse = JSONRPCResponse<Task | null, A2AError>;\n\n/**\n * Response to a streaming task operation, either through `tasks/sendSubscribe` or a subscription.\n * Contains a TaskStatusUpdateEvent, TaskArtifactUpdateEvent, or an error.\n */\nexport type SendTaskStreamingResponse = JSONRPCResponse<\n TaskStatusUpdateEvent | TaskArtifactUpdateEvent | null,\n A2AError\n>;\n\n/**\n * Response to a `tasks/get` request. Contains the Task object or an error.\n */\nexport type GetTaskResponse = JSONRPCResponse<Task | null, A2AError>;\n\n/**\n * Response to a `tasks/cancel` request. Contains the updated Task object (usually with 'canceled' state) or an error.\n */\nexport type CancelTaskResponse = JSONRPCResponse<Task | null, A2AError>;\n\n/**\n * Response to a `tasks/getHistory` request. Contains the TaskHistory object or an error.\n */\nexport type GetTaskHistoryResponse = JSONRPCResponse<TaskHistory | null, A2AError>;\n\n/**\n * Response to a `tasks/pushNotification/set` request. Contains the confirmed TaskPushNotificationConfig or an error.\n */\nexport type SetTaskPushNotificationResponse = JSONRPCResponse<TaskPushNotificationConfig | null, A2AError>;\n\n/**\n * Response to a `tasks/pushNotification/get` request. Contains the TaskPushNotificationConfig or an error.\n */\nexport type GetTaskPushNotificationResponse = JSONRPCResponse<TaskPushNotificationConfig | null, A2AError>;\n\n// Note: The response to TaskSubscriptionRequest is typically handled by the underlying protocol\n// (like WebSocket messages containing TaskUpdateEvent) rather than a single JSON-RPC response object.\n// The schema doesn't define a specific JSON-RPC response type for `tasks/subscribe`.\n\n// === Union Types for A2A Requests/Responses\n\n/**\n * Represents any valid request defined in the A2A protocol.\n */\nexport type A2ARequest =\n | SendTaskRequest\n | GetTaskRequest\n | CancelTaskRequest\n // | GetTaskHistoryRequest // Removed as it's not in the latest spec\n | SetTaskPushNotificationRequest\n | GetTaskPushNotificationRequest\n // | TaskSubscriptionRequest // Removed as it's replaced by sendSubscribe or resubscribe\n | TaskResubscriptionRequest\n | SendTaskStreamingRequest;\n\n/**\n * Represents any valid JSON-RPC response defined in the A2A protocol.\n * (This is a helper type, not explicitly defined with `oneOf` in the schema like A2ARequest, but useful).\n */\nexport type A2AResponse =\n | SendTaskResponse\n | GetTaskResponse\n | CancelTaskResponse\n | GetTaskHistoryResponse\n | SetTaskPushNotificationResponse\n | GetTaskPushNotificationResponse;\n// Subscription responses are typically event streams (TaskUpdateEvent) sent over the transport,\n// not direct JSON-RPC responses to the subscribe request itself.\n\n// Helper type for the simplified store\nexport interface TaskAndHistory {\n task: Task;\n history: Message[];\n}\n\nexport interface TaskContext {\n /**\n * The current state of the task when the handler is invoked or resumed.\n * Note: This is a snapshot. For the absolute latest state during async operations,\n * the handler might need to reload the task via the store.\n */\n task: Task;\n\n /**\n * The specific user message that triggered this handler invocation or resumption.\n */\n userMessage: Message;\n\n /**\n * Function to check if cancellation has been requested for this task.\n * Handlers should ideally check this periodically during long-running operations.\n * @returns {boolean} True if cancellation has been requested, false otherwise.\n */\n isCancelled(): boolean;\n\n /**\n * The message history associated with the task up to the point the handler is invoked.\n * Optional, as history might not always be available or relevant.\n */\n history?: Message[];\n\n // taskStore is removed as the server now handles loading/saving directly.\n // If a handler specifically needs history, it would need to be passed differently\n // or the handler pattern might need adjustment based on use case.\n\n // Potential future additions:\n // - logger instance\n // - AbortSignal linked to cancellation\n}\n","import {\n ErrorCodeParseError,\n ErrorCodeInvalidRequest,\n ErrorCodeMethodNotFound,\n ErrorCodePushNotificationNotSupported,\n ErrorCodeTaskNotCancelable,\n ErrorCodeTaskNotFound,\n ErrorCodeUnsupportedOperation,\n ErrorCodeInvalidParams,\n ErrorCodeInternalError,\n} from './types';\nimport type { JSONRPCError, KnownErrorCode } from './types';\n\n/**\n * Custom error class for A2A server operations, incorporating JSON-RPC error codes.\n */\nexport class A2AError extends Error {\n public code: KnownErrorCode | number;\n public data?: unknown;\n public taskId?: string; // Optional task ID context\n\n constructor(code: KnownErrorCode | number, message: string, data?: unknown, taskId?: string) {\n super(message);\n this.name = 'A2AError';\n this.code = code;\n this.data = data;\n this.taskId = taskId; // Store associated task ID if provided\n }\n\n /**\n * Formats the error into a standard JSON-RPC error object structure.\n */\n toJSONRPCError(): JSONRPCError<unknown> {\n const errorObject: JSONRPCError<unknown> = {\n code: this.code,\n message: this.message,\n };\n if (this.data !== undefined) {\n errorObject.data = this.data;\n }\n return errorObject;\n }\n\n // Static factory methods for common errors\n\n static parseError(message: string, data?: unknown): A2AError {\n return new A2AError(ErrorCodeParseError, message, data);\n }\n\n static invalidRequest(message: string, data?: unknown): A2AError {\n return new A2AError(ErrorCodeInvalidRequest, message, data);\n }\n\n static methodNotFound(method: string): A2AError {\n return new A2AError(ErrorCodeMethodNotFound, `Method not found: ${method}`);\n }\n\n static invalidParams(message: string, data?: unknown): A2AError {\n return new A2AError(ErrorCodeInvalidParams, message, data);\n }\n\n static internalError(message: string, data?: unknown): A2AError {\n return new A2AError(ErrorCodeInternalError, message, data);\n }\n\n static taskNotFound(taskId: string): A2AError {\n return new A2AError(ErrorCodeTaskNotFound, `Task not found: ${taskId}`, undefined, taskId);\n }\n\n static taskNotCancelable(taskId: string): A2AError {\n return new A2AError(ErrorCodeTaskNotCancelable, `Task not cancelable: ${taskId}`, undefined, taskId);\n }\n\n static pushNotificationNotSupported(): A2AError {\n return new A2AError(ErrorCodePushNotificationNotSupported, 'Push Notification is not supported');\n }\n\n static unsupportedOperation(operation: string): A2AError {\n return new A2AError(ErrorCodeUnsupportedOperation, `Unsupported operation: ${operation}`);\n }\n}\n"]}
package/dist/a2a/index.js CHANGED
@@ -66,3 +66,5 @@ var A2AError = class _A2AError extends Error {
66
66
  };
67
67
 
68
68
  export { A2AError, ErrorCodeInternalError, ErrorCodeInvalidParams, ErrorCodeInvalidRequest, ErrorCodeMethodNotFound, ErrorCodeParseError, ErrorCodePushNotificationNotSupported, ErrorCodeTaskNotCancelable, ErrorCodeTaskNotFound, ErrorCodeUnsupportedOperation };
69
+ //# sourceMappingURL=index.js.map
70
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/a2a/types.ts","../../src/a2a/error.ts"],"names":[],"mappings":";AA2iBO,IAAM,mBAAA,GAAsB;AAG5B,IAAM,uBAAA,GAA0B;AAGhC,IAAM,uBAAA,GAA0B;AAGhC,IAAM,sBAAA,GAAyB;AAG/B,IAAM,sBAAA,GAAyB;AAI/B,IAAM,qBAAA,GAAwB;AAG9B,IAAM,0BAAA,GAA6B;AAGnC,IAAM,qCAAA,GAAwC;AAG9C,IAAM,6BAAA,GAAgC;;;ACpjBtC,IAAM,QAAA,GAAN,MAAM,SAAA,SAAiB,KAAA,CAAM;AAAA,EA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,EAEA,OAAO,aAAA,CAAc,OAAA,EAAiB,IAAA,EAA0B;AAC9D,IAAA,OAAO,IAAI,SAAA,CAAS,sBAAA,EAAwB,OAAA,EAAS,IAAI,CAAA;AAAA,EAC3D;AAAA,EAEA,OAAO,aAAa,MAAA,EAA0B;AAC5C,IAAA,OAAO,IAAI,SAAA,CAAS,qBAAA,EAAuB,mBAAmB,MAAM,CAAA,CAAA,EAAI,QAAW,MAAM,CAAA;AAAA,EAC3F;AAAA,EAEA,OAAO,kBAAkB,MAAA,EAA0B;AACjD,IAAA,OAAO,IAAI,SAAA,CAAS,0BAAA,EAA4B,wBAAwB,MAAM,CAAA,CAAA,EAAI,QAAW,MAAM,CAAA;AAAA,EACrG;AAAA,EAEA,OAAO,4BAAA,GAAyC;AAC9C,IAAA,OAAO,IAAI,SAAA,CAAS,qCAAA,EAAuC,oCAAoC,CAAA;AAAA,EACjG;AAAA,EAEA,OAAO,qBAAqB,SAAA,EAA6B;AACvD,IAAA,OAAO,IAAI,SAAA,CAAS,6BAAA,EAA+B,CAAA,uBAAA,EAA0B,SAAS,CAAA,CAAE,CAAA;AAAA,EAC1F;AACF","file":"index.js","sourcesContent":["// === JSON-RPC Base Structures\n\n/**\n * Base interface for identifying JSON-RPC messages.\n */\nexport interface JSONRPCMessageIdentifier {\n /**\n * Request identifier. Can be a string, number, or null.\n * Responses must have the same ID as the request they relate to.\n * Notifications (requests without an expected response) should omit the ID or use null.\n */\n id?: number | string | null;\n}\n\n/**\n * Base interface for all JSON-RPC messages (Requests and Responses).\n */\nexport interface JSONRPCMessage extends JSONRPCMessageIdentifier {\n /**\n * Specifies the JSON-RPC version. Must be \"2.0\".\n * @default \"2.0\"\n * @const \"2.0\"\n */\n jsonrpc?: '2.0';\n}\n\n/**\n * Represents a JSON-RPC request object base structure.\n * Specific request types should extend this.\n */\nexport interface JSONRPCRequest extends JSONRPCMessage {\n /**\n * The name of the method to be invoked.\n */\n method: string;\n\n /**\n * Parameters for the method. Can be a structured object, an array, or null/omitted.\n * Specific request interfaces will define the exact type.\n * @default null\n */\n params?: unknown; // Base type; specific requests will override\n}\n\n/**\n * Represents a JSON-RPC error object.\n */\nexport interface JSONRPCError<Data = unknown | null, Code = number> {\n /**\n * A number indicating the error type that occurred.\n */\n code: Code;\n\n /**\n * A string providing a short description of the error.\n */\n message: string;\n\n /**\n * Optional additional data about the error.\n * @default null\n */\n data?: Data;\n}\n\n/**\n * Represents a JSON-RPC response object.\n */\nexport interface JSONRPCResponse<R = unknown | null, E = unknown | null> extends JSONRPCMessage {\n /**\n * The result of the method invocation. Required on success.\n * Should be null or omitted if an error occurred.\n * @default null\n */\n result?: R;\n\n /**\n * An error object if an error occurred during the request. Required on failure.\n * Should be null or omitted if the request was successful.\n * @default null\n */\n error?: JSONRPCError<E> | null;\n}\n\n// === Core A2A Data Structures\n\n/**\n * Represents the state of a task within the A2A protocol.\n * @description An enumeration.\n */\nexport type TaskState = 'submitted' | 'working' | 'input-required' | 'completed' | 'canceled' | 'failed' | 'unknown';\n\n/**\n * Defines the authentication schemes and credentials for an agent.\n */\nexport interface AgentAuthentication {\n /**\n * List of supported authentication schemes.\n */\n schemes: string[];\n\n /**\n * Credentials for authentication. Can be a string (e.g., token) or null if not required initially.\n * @default null\n */\n credentials?: string | null;\n}\n\n/**\n * Describes the capabilities of an agent.\n */\nexport interface AgentCapabilities {\n /**\n * Indicates if the agent supports streaming responses.\n * @default false\n */\n streaming?: boolean;\n\n /**\n * Indicates if the agent supports push notification mechanisms.\n * @default false\n */\n pushNotifications?: boolean;\n\n /**\n * Indicates if the agent supports providing state transition history.\n * @default false\n */\n stateTransitionHistory?: boolean;\n}\n\n/**\n * Represents the provider or organization behind an agent.\n */\nexport interface AgentProvider {\n /**\n * The name of the organization providing the agent.\n */\n organization: string;\n\n /**\n * URL associated with the agent provider.\n * @default null\n */\n url?: string | null;\n}\n\n/**\n * Defines a specific skill or capability offered by an agent.\n */\nexport interface AgentSkill {\n /**\n * Unique identifier for the skill.\n */\n id: string;\n\n /**\n * Human-readable name of the skill.\n */\n name: string;\n\n /**\n * Optional description of the skill.\n * @default null\n */\n description?: string | null;\n\n /**\n * Optional list of tags associated with the skill for categorization.\n * @default null\n */\n tags?: string[] | null;\n\n /**\n * Optional list of example inputs or use cases for the skill.\n * @default null\n */\n examples?: string[] | null;\n\n /**\n * Optional list of input modes supported by this skill, overriding agent defaults.\n * @default null\n */\n inputModes?: string[] | null;\n\n /**\n * Optional list of output modes supported by this skill, overriding agent defaults.\n * @default null\n */\n outputModes?: string[] | null;\n}\n\n/**\n * Represents the metadata card for an agent, describing its properties and capabilities.\n */\nexport interface AgentCard {\n /**\n * The name of the agent.\n */\n name: string;\n\n /**\n * An optional description of the agent.\n * @default null\n */\n description?: string | null;\n\n /**\n * The base URL endpoint for interacting with the agent.\n */\n url: string;\n\n /**\n * Information about the provider of the agent.\n * @default null\n */\n provider?: AgentProvider | null;\n\n /**\n * The version identifier for the agent or its API.\n */\n version: string;\n\n /**\n * An optional URL pointing to the agent's documentation.\n * @default null\n */\n documentationUrl?: string | null;\n\n /**\n * The capabilities supported by the agent.\n */\n capabilities: AgentCapabilities;\n\n /**\n * Authentication details required to interact with the agent.\n * @default null\n */\n authentication?: AgentAuthentication | null;\n\n /**\n * Default input modes supported by the agent (e.g., 'text', 'file', 'json').\n * @default [\"text\"]\n */\n defaultInputModes?: string[];\n\n /**\n * Default output modes supported by the agent (e.g., 'text', 'file', 'json').\n * @default [\"text\"]\n */\n defaultOutputModes?: string[];\n\n /**\n * List of specific skills offered by the agent.\n */\n skills: AgentSkill[];\n}\n\nexport interface FileContentBase {\n /**\n * Optional name of the file.\n * @default null\n */\n name?: string | null;\n\n /**\n * Optional MIME type of the file content.\n * @default null\n */\n mimeType?: string | null;\n\n /**\n * File content encoded as a Base64 string. Use this OR `uri`.\n */\n bytes?: string | null;\n\n /**\n * URI pointing to the file content. Use this OR `bytes`.\n */\n uri?: string | null;\n}\n\nexport type FileContentBytes = FileContentBase & {\n /* File content encoded as a Base64 string. Use this OR `uri`. */\n bytes: string;\n uri?: never;\n};\n\nexport type FileContentUri = FileContentBase & {\n /** URI pointing to the file content. */\n uri: string;\n bytes?: never;\n};\n\n/**\n * Represents the content of a file, either as base64 encoded bytes or a URI.\n * @description Ensures that either 'bytes' or 'uri' is provided, but not both. (Note: This constraint is informational in TypeScript types).\n */\nexport type FileContent = FileContentBytes | FileContentUri;\n\n/**\n * Represents a part of a message containing text content.\n */\nexport interface TextPart {\n type: 'text';\n\n /**\n * The text content.\n */\n text: string;\n\n /**\n * Optional metadata associated with this text part.\n */\n metadata?: Record<string, unknown> | null;\n}\n\n/**\n * Represents a part of a message containing file content.\n */\nexport interface FilePart {\n /**\n * Type identifier for this part.\n */\n type: 'file';\n\n /**\n * The file content, provided either inline or via URI.\n */\n file: FileContent;\n\n /**\n * Optional metadata associated with this file part.\n */\n metadata?: Record<string, unknown> | null;\n}\n\n/**\n * Represents a part of a message containing structured data (JSON).\n */\nexport interface DataPart {\n /**\n * Type identifier for this part.\n */\n type: 'data';\n\n /**\n * The structured data content as a JSON object.\n */\n data: Record<string, unknown>;\n\n /**\n * Optional metadata associated with this data part.\n */\n metadata?: Record<string, unknown> | null;\n}\n\n/**\n * Represents a single part of a multi-part message. Can be text, file, or data.\n */\nexport type Part = TextPart | FilePart | DataPart;\n\n/**\n * Represents an artifact generated or used by a task, potentially composed of multiple parts.\n */\nexport interface Artifact {\n /**\n * Optional name for the artifact.\n * @default null\n */\n name?: string | null;\n\n /**\n * Optional description of the artifact.\n * @default null\n */\n description?: string | null;\n\n /**\n * The constituent parts of the artifact.\n */\n parts: Part[];\n\n /**\n * Optional index for ordering artifacts, especially relevant in streaming or updates.\n * @default 0\n */\n index?: number;\n\n /**\n * Optional flag indicating if this artifact content should append to previous content (for streaming).\n * @default null\n */\n append?: boolean | null;\n\n /**\n * Optional metadata associated with the artifact.\n * @default null\n */\n metadata?: Record<string, unknown> | null;\n\n /**\n * Optional flag indicating if this is the last chunk of data for this artifact (for streaming).\n * @default null\n */\n lastChunk?: boolean | null;\n}\n\n/**\n * Represents a message exchanged between a user and an agent.\n */\nexport interface Message {\n /**\n * The role of the sender (user or agent).\n */\n role: 'user' | 'agent';\n\n /**\n * The content of the message, composed of one or more parts.\n */\n parts: Part[];\n\n /**\n * Optional metadata associated with the message.\n * @default null\n */\n metadata?: Record<string, unknown> | null;\n}\n\n/**\n * Represents the status of a task at a specific point in time.\n */\nexport interface TaskStatus {\n /**\n * The current state of the task.\n */\n state: TaskState;\n\n /**\n * An optional message associated with the current status (e.g., progress update, final response).\n * @default null\n */\n message?: Message | null;\n\n /**\n * The timestamp when this status was recorded (ISO 8601 format).\n * @format date-time\n */\n timestamp?: string;\n}\n\n/**\n * Represents a task being processed by an agent.\n */\nexport interface Task {\n /**\n * Unique identifier for the task.\n */\n id: string;\n\n /**\n * Optional identifier for the session this task belongs to.\n * @default null\n */\n sessionId?: string | null;\n\n /**\n * The current status of the task.\n */\n status: TaskStatus;\n\n /**\n * Optional list of artifacts associated with the task (e.g., outputs, intermediate files).\n * @default null\n */\n artifacts?: Artifact[] | null;\n\n /**\n * Optional metadata associated with the task.\n * @default null\n */\n metadata?: Record<string, unknown> | null;\n}\n\n/**\n * Represents the history of messages exchanged within a task's session.\n */\nexport interface TaskHistory {\n /**\n * List of messages in chronological order.\n * @default []\n */\n messageHistory?: Message[];\n}\n\n/**\n * Represents a status update event for a task, typically used in streaming scenarios.\n */\nexport interface TaskStatusUpdateEvent {\n /**\n * The ID of the task being updated.\n */\n id: string;\n\n /**\n * The new status of the task.\n */\n status: TaskStatus;\n\n /**\n * Flag indicating if this is the final update for the task.\n * @default false\n */\n final?: boolean;\n\n /**\n * Optional metadata associated with this update event.\n * @default null\n */\n metadata?: Record<string, unknown> | null;\n}\n\n/**\n * Represents an artifact update event for a task, typically used in streaming scenarios.\n */\nexport interface TaskArtifactUpdateEvent {\n /**\n * The ID of the task being updated.\n */\n id: string;\n\n /**\n * The new or updated artifact for the task.\n */\n artifact: Artifact;\n\n /**\n * Flag indicating if this is the final update for the task.\n * @default false\n */\n final?: boolean;\n\n /**\n * Optional metadata associated with this update event.\n * @default null\n */\n metadata?: Record<string, unknown> | null;\n}\n\n// Alias for backward compatibility\nexport type TaskUpdateEvent = TaskStatusUpdateEvent;\n\n// === Error Types (Standard and A2A)\n\n/** Error code for JSON Parse Error (-32700). Invalid JSON was received by the server. */\nexport const ErrorCodeParseError = -32700;\nexport type ErrorCodeParseError = typeof ErrorCodeParseError;\n/** Error code for Invalid Request (-32600). The JSON sent is not a valid Request object. */\nexport const ErrorCodeInvalidRequest = -32600;\nexport type ErrorCodeInvalidRequest = typeof ErrorCodeInvalidRequest;\n/** Error code for Method Not Found (-32601). The method does not exist / is not available. */\nexport const ErrorCodeMethodNotFound = -32601;\nexport type ErrorCodeMethodNotFound = typeof ErrorCodeMethodNotFound;\n/** Error code for Invalid Params (-32602). Invalid method parameter(s). */\nexport const ErrorCodeInvalidParams = -32602;\nexport type ErrorCodeInvalidParams = typeof ErrorCodeInvalidParams;\n/** Error code for Internal Error (-32603). Internal JSON-RPC error. */\nexport const ErrorCodeInternalError = -32603;\nexport type ErrorCodeInternalError = typeof ErrorCodeInternalError;\n\n/** Error code for Task Not Found (-32001). The specified task was not found. */\nexport const ErrorCodeTaskNotFound = -32001;\nexport type ErrorCodeTaskNotFound = typeof ErrorCodeTaskNotFound;\n/** Error code for Task Not Cancelable (-32002). The specified task cannot be canceled. */\nexport const ErrorCodeTaskNotCancelable = -32002;\nexport type ErrorCodeTaskNotCancelable = typeof ErrorCodeTaskNotCancelable;\n/** Error code for Push Notification Not Supported (-32003). Push Notifications are not supported for this operation or agent. */\nexport const ErrorCodePushNotificationNotSupported = -32003;\nexport type ErrorCodePushNotificationNotSupported = typeof ErrorCodePushNotificationNotSupported;\n/** Error code for Unsupported Operation (-32004). The requested operation is not supported by the agent. */\nexport const ErrorCodeUnsupportedOperation = -32004;\nexport type ErrorCodeUnsupportedOperation = typeof ErrorCodeUnsupportedOperation;\n\n/**\n * Union of all well-known A2A and standard JSON-RPC error codes defined in this schema.\n * Use this type for checking against specific error codes. A server might theoretically\n * use other codes within the valid JSON-RPC ranges.\n */\nexport type KnownErrorCode =\n | typeof ErrorCodeParseError\n | typeof ErrorCodeInvalidRequest\n | typeof ErrorCodeMethodNotFound\n | typeof ErrorCodeInvalidParams\n | typeof ErrorCodeInternalError\n | typeof ErrorCodeTaskNotFound\n | typeof ErrorCodeTaskNotCancelable\n | typeof ErrorCodePushNotificationNotSupported\n | typeof ErrorCodeUnsupportedOperation;\n\ntype A2AError = JSONRPCError<unknown | null, KnownErrorCode | number>;\n\n// === Push Notifications and Authentication Info\n\n/**\n * Authentication information, potentially including additional properties beyond the standard ones.\n * (Note: Schema allows additional properties).\n */\nexport interface AuthenticationInfo extends AgentAuthentication {\n /** Allow any other properties */\n [key: string]: any;\n}\n\n/**\n * Information required for setting up push notifications.\n */\nexport interface PushNotificationConfig {\n /**\n * The URL endpoint where the agent should send notifications.\n */\n url: string;\n\n /**\n * A token to be included in push notification requests for verification/authentication.\n */\n token?: string;\n\n /**\n * Optional authentication details needed by the agent to call the notification URL.\n * @default null\n */\n authentication?: AuthenticationInfo | null;\n}\n\n/**\n * Represents the push notification information associated with a specific task ID.\n * Used as parameters for `tasks/pushNotification/set` and as a result type.\n */\nexport interface TaskPushNotificationConfig {\n /**\n * The ID of the task the notification config is associated with.\n */\n id: string;\n /**\n * The push notification configuration details.\n */\n pushNotificationConfig: PushNotificationConfig;\n}\n\n// ================================================================= A2A Request Parameter Types\n// =================================================================\n\n/**\n * Parameters for the `tasks/send` method.\n */\nexport interface TaskSendParams {\n /**\n * Unique identifier for the task being initiated or continued.\n */\n id: string;\n\n /**\n * Optional identifier for the session this task belongs to. If not provided, a new session might be implicitly created depending on the agent.\n */\n sessionId?: string;\n\n /**\n * The message content to send to the agent for processing.\n */\n message: Message;\n\n /**\n * Optional pushNotification information for receiving notifications about this task. Requires agent capability.\n * @default null\n */\n pushNotification?: PushNotificationConfig | null;\n\n /**\n * Optional parameter to specify how much message history to include in the response.\n * @default null\n */\n historyLength?: number | null;\n\n /**\n * Optional metadata associated with sending this message.\n * @default null\n */\n metadata?: Record<string, unknown> | null;\n}\n\n/**\n * Basic parameters used for task ID operations.\n * Used by: `tasks/cancel`, `tasks/pushNotification/get`.\n */\nexport interface TaskIdParams {\n /**\n * The unique identifier of the task.\n */\n id: string;\n\n /**\n * Optional metadata to include with the operation.\n * @default null\n */\n metadata?: Record<string, unknown> | null;\n}\n\n/**\n * Parameters used for querying task-related information by ID.\n * Used by: `tasks/get`, `tasks/getHistory`, `tasks/subscribe`, `tasks/resubscribe`.\n */\nexport interface TaskQueryParams extends TaskIdParams {\n /**\n * Optional history length to retrieve for the task.\n * @default null\n */\n historyLength?: number | null;\n}\n\n// === A2A Request Interfaces\n\n/**\n * Request to send a message/initiate a task.\n */\nexport interface SendTaskRequest extends JSONRPCRequest {\n /**\n * Method name for sending a task message.\n */\n method: 'tasks/send';\n /**\n * Parameters for the send task method.\n */\n params: TaskSendParams;\n}\n\n/**\n * Request to retrieve the current state of a task.\n */\nexport interface GetTaskRequest extends JSONRPCRequest {\n /**\n * Method name for getting task status.\n */\n method: 'tasks/get';\n /**\n * Parameters for the get task method.\n */\n params: TaskQueryParams;\n}\n\n/**\n * Request to cancel a currently running task.\n */\nexport interface CancelTaskRequest extends JSONRPCRequest {\n /**\n * Method name for canceling a task.\n */\n method: 'tasks/cancel';\n /**\n * Parameters for the cancel task method.\n */\n params: TaskIdParams;\n}\n\n/**\n * Request to set or update the push notification config for a task.\n */\nexport interface SetTaskPushNotificationRequest extends JSONRPCRequest {\n /**\n * Method name for setting a task notifications.\n */\n method: 'tasks/pushNotification/set';\n /**\n * Parameters for the set task push notification method.\n */\n params: TaskPushNotificationConfig; // Uses TaskPushNotificationConfig directly as params\n}\n\n/**\n * Request to retrieve the currently configured push notification configuration for a task.\n */\nexport interface GetTaskPushNotificationRequest extends JSONRPCRequest {\n /**\n * Method name for getting task notification configuration.\n */\n method: 'tasks/pushNotification/get';\n /**\n * Parameters for the get task push notification config method.\n */\n params: TaskIdParams;\n}\n\n/**\n * Request to resubscribe to updates for a task after a connection interruption.\n */\nexport interface TaskResubscriptionRequest extends JSONRPCRequest {\n /**\n * Method name for resubscribing to task updates.\n */\n method: 'tasks/resubscribe';\n /**\n * Parameters for the task resubscription method.\n */\n params: TaskQueryParams;\n}\n\n/**\n * Request to send a message/initiate a task and subscribe to streaming updates.\n */\nexport interface SendTaskStreamingRequest extends JSONRPCRequest {\n /**\n * Method name for sending a task message and subscribing to updates.\n */\n method: 'tasks/sendSubscribe';\n /**\n * Parameters for the streaming task send method.\n */\n params: TaskSendParams;\n}\n\n// === A2A Response Interfaces\n\n/**\n * Response to a `tasks/send` request.\n * Contains the Task object or an error.\n */\nexport type SendTaskResponse = JSONRPCResponse<Task | null, A2AError>;\n\n/**\n * Response to a streaming task operation, either through `tasks/sendSubscribe` or a subscription.\n * Contains a TaskStatusUpdateEvent, TaskArtifactUpdateEvent, or an error.\n */\nexport type SendTaskStreamingResponse = JSONRPCResponse<\n TaskStatusUpdateEvent | TaskArtifactUpdateEvent | null,\n A2AError\n>;\n\n/**\n * Response to a `tasks/get` request. Contains the Task object or an error.\n */\nexport type GetTaskResponse = JSONRPCResponse<Task | null, A2AError>;\n\n/**\n * Response to a `tasks/cancel` request. Contains the updated Task object (usually with 'canceled' state) or an error.\n */\nexport type CancelTaskResponse = JSONRPCResponse<Task | null, A2AError>;\n\n/**\n * Response to a `tasks/getHistory` request. Contains the TaskHistory object or an error.\n */\nexport type GetTaskHistoryResponse = JSONRPCResponse<TaskHistory | null, A2AError>;\n\n/**\n * Response to a `tasks/pushNotification/set` request. Contains the confirmed TaskPushNotificationConfig or an error.\n */\nexport type SetTaskPushNotificationResponse = JSONRPCResponse<TaskPushNotificationConfig | null, A2AError>;\n\n/**\n * Response to a `tasks/pushNotification/get` request. Contains the TaskPushNotificationConfig or an error.\n */\nexport type GetTaskPushNotificationResponse = JSONRPCResponse<TaskPushNotificationConfig | null, A2AError>;\n\n// Note: The response to TaskSubscriptionRequest is typically handled by the underlying protocol\n// (like WebSocket messages containing TaskUpdateEvent) rather than a single JSON-RPC response object.\n// The schema doesn't define a specific JSON-RPC response type for `tasks/subscribe`.\n\n// === Union Types for A2A Requests/Responses\n\n/**\n * Represents any valid request defined in the A2A protocol.\n */\nexport type A2ARequest =\n | SendTaskRequest\n | GetTaskRequest\n | CancelTaskRequest\n // | GetTaskHistoryRequest // Removed as it's not in the latest spec\n | SetTaskPushNotificationRequest\n | GetTaskPushNotificationRequest\n // | TaskSubscriptionRequest // Removed as it's replaced by sendSubscribe or resubscribe\n | TaskResubscriptionRequest\n | SendTaskStreamingRequest;\n\n/**\n * Represents any valid JSON-RPC response defined in the A2A protocol.\n * (This is a helper type, not explicitly defined with `oneOf` in the schema like A2ARequest, but useful).\n */\nexport type A2AResponse =\n | SendTaskResponse\n | GetTaskResponse\n | CancelTaskResponse\n | GetTaskHistoryResponse\n | SetTaskPushNotificationResponse\n | GetTaskPushNotificationResponse;\n// Subscription responses are typically event streams (TaskUpdateEvent) sent over the transport,\n// not direct JSON-RPC responses to the subscribe request itself.\n\n// Helper type for the simplified store\nexport interface TaskAndHistory {\n task: Task;\n history: Message[];\n}\n\nexport interface TaskContext {\n /**\n * The current state of the task when the handler is invoked or resumed.\n * Note: This is a snapshot. For the absolute latest state during async operations,\n * the handler might need to reload the task via the store.\n */\n task: Task;\n\n /**\n * The specific user message that triggered this handler invocation or resumption.\n */\n userMessage: Message;\n\n /**\n * Function to check if cancellation has been requested for this task.\n * Handlers should ideally check this periodically during long-running operations.\n * @returns {boolean} True if cancellation has been requested, false otherwise.\n */\n isCancelled(): boolean;\n\n /**\n * The message history associated with the task up to the point the handler is invoked.\n * Optional, as history might not always be available or relevant.\n */\n history?: Message[];\n\n // taskStore is removed as the server now handles loading/saving directly.\n // If a handler specifically needs history, it would need to be passed differently\n // or the handler pattern might need adjustment based on use case.\n\n // Potential future additions:\n // - logger instance\n // - AbortSignal linked to cancellation\n}\n","import {\n ErrorCodeParseError,\n ErrorCodeInvalidRequest,\n ErrorCodeMethodNotFound,\n ErrorCodePushNotificationNotSupported,\n ErrorCodeTaskNotCancelable,\n ErrorCodeTaskNotFound,\n ErrorCodeUnsupportedOperation,\n ErrorCodeInvalidParams,\n ErrorCodeInternalError,\n} from './types';\nimport type { JSONRPCError, KnownErrorCode } from './types';\n\n/**\n * Custom error class for A2A server operations, incorporating JSON-RPC error codes.\n */\nexport class A2AError extends Error {\n public code: KnownErrorCode | number;\n public data?: unknown;\n public taskId?: string; // Optional task ID context\n\n constructor(code: KnownErrorCode | number, message: string, data?: unknown, taskId?: string) {\n super(message);\n this.name = 'A2AError';\n this.code = code;\n this.data = data;\n this.taskId = taskId; // Store associated task ID if provided\n }\n\n /**\n * Formats the error into a standard JSON-RPC error object structure.\n */\n toJSONRPCError(): JSONRPCError<unknown> {\n const errorObject: JSONRPCError<unknown> = {\n code: this.code,\n message: this.message,\n };\n if (this.data !== undefined) {\n errorObject.data = this.data;\n }\n return errorObject;\n }\n\n // Static factory methods for common errors\n\n static parseError(message: string, data?: unknown): A2AError {\n return new A2AError(ErrorCodeParseError, message, data);\n }\n\n static invalidRequest(message: string, data?: unknown): A2AError {\n return new A2AError(ErrorCodeInvalidRequest, message, data);\n }\n\n static methodNotFound(method: string): A2AError {\n return new A2AError(ErrorCodeMethodNotFound, `Method not found: ${method}`);\n }\n\n static invalidParams(message: string, data?: unknown): A2AError {\n return new A2AError(ErrorCodeInvalidParams, message, data);\n }\n\n static internalError(message: string, data?: unknown): A2AError {\n return new A2AError(ErrorCodeInternalError, message, data);\n }\n\n static taskNotFound(taskId: string): A2AError {\n return new A2AError(ErrorCodeTaskNotFound, `Task not found: ${taskId}`, undefined, taskId);\n }\n\n static taskNotCancelable(taskId: string): A2AError {\n return new A2AError(ErrorCodeTaskNotCancelable, `Task not cancelable: ${taskId}`, undefined, taskId);\n }\n\n static pushNotificationNotSupported(): A2AError {\n return new A2AError(ErrorCodePushNotificationNotSupported, 'Push Notification is not supported');\n }\n\n static unsupportedOperation(operation: string): A2AError {\n return new A2AError(ErrorCodeUnsupportedOperation, `Unsupported operation: ${operation}`);\n }\n}\n"]}
@@ -1,39 +1,41 @@
1
1
  'use strict';
2
2
 
3
- var chunk7ORSIDEV_cjs = require('../chunk-7ORSIDEV.cjs');
4
- var chunkXXJ65TNC_cjs = require('../chunk-XXJ65TNC.cjs');
3
+ var chunk625T2PQ3_cjs = require('../chunk-625T2PQ3.cjs');
4
+ var chunkTVSZEBOM_cjs = require('../chunk-TVSZEBOM.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "Agent", {
9
9
  enumerable: true,
10
- get: function () { return chunk7ORSIDEV_cjs.Agent; }
10
+ get: function () { return chunk625T2PQ3_cjs.Agent; }
11
11
  });
12
12
  Object.defineProperty(exports, "LanguageDetector", {
13
13
  enumerable: true,
14
- get: function () { return chunk7ORSIDEV_cjs.LanguageDetector; }
14
+ get: function () { return chunk625T2PQ3_cjs.LanguageDetector; }
15
15
  });
16
16
  Object.defineProperty(exports, "ModerationInputProcessor", {
17
17
  enumerable: true,
18
- get: function () { return chunk7ORSIDEV_cjs.ModerationInputProcessor; }
18
+ get: function () { return chunk625T2PQ3_cjs.ModerationInputProcessor; }
19
19
  });
20
20
  Object.defineProperty(exports, "PIIDetector", {
21
21
  enumerable: true,
22
- get: function () { return chunk7ORSIDEV_cjs.PIIDetector; }
22
+ get: function () { return chunk625T2PQ3_cjs.PIIDetector; }
23
23
  });
24
24
  Object.defineProperty(exports, "PromptInjectionDetector", {
25
25
  enumerable: true,
26
- get: function () { return chunk7ORSIDEV_cjs.PromptInjectionDetector; }
26
+ get: function () { return chunk625T2PQ3_cjs.PromptInjectionDetector; }
27
27
  });
28
28
  Object.defineProperty(exports, "TripWire", {
29
29
  enumerable: true,
30
- get: function () { return chunk7ORSIDEV_cjs.TripWire; }
30
+ get: function () { return chunk625T2PQ3_cjs.TripWire; }
31
31
  });
32
32
  Object.defineProperty(exports, "UnicodeNormalizer", {
33
33
  enumerable: true,
34
- get: function () { return chunk7ORSIDEV_cjs.UnicodeNormalizer; }
34
+ get: function () { return chunk625T2PQ3_cjs.UnicodeNormalizer; }
35
35
  });
36
36
  Object.defineProperty(exports, "MessageList", {
37
37
  enumerable: true,
38
- get: function () { return chunkXXJ65TNC_cjs.MessageList; }
38
+ get: function () { return chunkTVSZEBOM_cjs.MessageList; }
39
39
  });
40
+ //# sourceMappingURL=index.cjs.map
41
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,cAAc,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,gBAAgB,EAAkB,SAAS,EAAE,MAAM,IAAI,CAAC;AAEvG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,KAAK,EAAE,gBAAgB,EAAe,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAIV,oBAAoB,EACpB,kBAAkB,EAQnB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,E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AE,MAAM,GAAG,GAAG,CAAC;KACpB,GACA,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC;IA2CjD;;;;;OAKG;IACG,WAAW;;;IA4CjB,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,SAAS,CAAC;QAAE,MAAM,EAAE,CAAC,CAAC,SAAS,CAAA;KAAE,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC;QAAE,IAAI,EAAE,CAAC,CAAC,SAAS,CAAA;KAAE,CAAC,EAAE,GAAG,CAAC;IAKvG;;;OAGG;IACH,OAAO,CAAC,4BAA4B;IAyBpC;;;OAGG;YACW,wBAAwB;CAwBvC"}
@@ -1,2 +1,4 @@
1
- export { Agent, LanguageDetector, ModerationInputProcessor, PIIDetector, PromptInjectionDetector, TripWire, UnicodeNormalizer } from '../chunk-TF6V5DPV.js';
2
- export { MessageList } from '../chunk-IGFHXXJK.js';
1
+ export { Agent, LanguageDetector, ModerationInputProcessor, PIIDetector, PromptInjectionDetector, TripWire, UnicodeNormalizer } from '../chunk-LLGIJLDI.js';
2
+ export { MessageList } from '../chunk-37ZPKICX.js';
3
+ //# sourceMappingURL=index.js.map
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ var chunk625T2PQ3_cjs = require('../../../chunk-625T2PQ3.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "LanguageDetector", {
8
+ enumerable: true,
9
+ get: function () { return chunk625T2PQ3_cjs.LanguageDetector; }
10
+ });
11
+ Object.defineProperty(exports, "ModerationInputProcessor", {
12
+ enumerable: true,
13
+ get: function () { return chunk625T2PQ3_cjs.ModerationInputProcessor; }
14
+ });
15
+ Object.defineProperty(exports, "PIIDetector", {
16
+ enumerable: true,
17
+ get: function () { return chunk625T2PQ3_cjs.PIIDetector; }
18
+ });
19
+ Object.defineProperty(exports, "PromptInjectionDetector", {
20
+ enumerable: true,
21
+ get: function () { return chunk625T2PQ3_cjs.PromptInjectionDetector; }
22
+ });
23
+ Object.defineProperty(exports, "UnicodeNormalizer", {
24
+ enumerable: true,
25
+ get: function () { return chunk625T2PQ3_cjs.UnicodeNormalizer; }
26
+ });
27
+ //# sourceMappingURL=index.cjs.map
28
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,3 @@
1
+ export { LanguageDetector, ModerationInputProcessor, PIIDetector, PromptInjectionDetector, UnicodeNormalizer } from '../../../chunk-LLGIJLDI.js';
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -1 +1 @@
1
- {"version":3,"file":"convert-to-mastra-v1.d.ts","sourceRoot":"","sources":["../../../../src/agent/message-list/prompt/convert-to-mastra-v1.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAA0B,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAsBlF,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC,eAAe,CAAC,qBAmQnE"}
1
+ {"version":3,"file":"convert-to-mastra-v1.d.ts","sourceRoot":"","sources":["../../../../src/agent/message-list/prompt/convert-to-mastra-v1.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAA0B,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAsBlF,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC,eAAe,CAAC,qBA8UnE"}
package/dist/base.cjs CHANGED
@@ -1,10 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunk73LEILKH_cjs = require('./chunk-73LEILKH.cjs');
3
+ var chunk2WZYQCRK_cjs = require('./chunk-2WZYQCRK.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "MastraBase", {
8
8
  enumerable: true,
9
- get: function () { return chunk73LEILKH_cjs.MastraBase; }
9
+ get: function () { return chunk2WZYQCRK_cjs.MastraBase; }
10
10
  });
11
+ //# sourceMappingURL=base.cjs.map
12
+ //# sourceMappingURL=base.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"base.cjs"}
package/dist/base.js CHANGED
@@ -1 +1,3 @@
1
- export { MastraBase } from './chunk-7OE6SJZL.js';
1
+ export { MastraBase } from './chunk-FQ4W6KBT.js';
2
+ //# sourceMappingURL=base.js.map
3
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"base.js"}
@@ -1,10 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkKZYJFNRH_cjs = require('../chunk-KZYJFNRH.cjs');
3
+ var chunkWVIY3V3E_cjs = require('../chunk-WVIY3V3E.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "MastraBundler", {
8
8
  enumerable: true,
9
- get: function () { return chunkKZYJFNRH_cjs.MastraBundler; }
9
+ get: function () { return chunkWVIY3V3E_cjs.MastraBundler; }
10
10
  });
11
+ //# sourceMappingURL=index.cjs.map
12
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -1 +1,3 @@
1
- export { MastraBundler } from '../chunk-JNGXGO62.js';
1
+ export { MastraBundler } from '../chunk-K2243MGP.js';
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -1,4 +1,4 @@
1
- import { createTool } from './chunk-C4LMN2IR.js';
1
+ import { createTool } from './chunk-QU6RMCGM.js';
2
2
  import { z } from 'zod';
3
3
 
4
4
  // src/integration/integration.ts
@@ -86,3 +86,5 @@ var OpenAPIToolset = class {
86
86
  };
87
87
 
88
88
  export { Integration, OpenAPIToolset };
89
+ //# sourceMappingURL=chunk-2FSLKKS2.js.map
90
+ //# sourceMappingURL=chunk-2FSLKKS2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/integration/integration.ts","../src/integration/openapi-toolset.ts"],"names":[],"mappings":";;;;AAGO,IAAM,cAAN,MAAwD;AAAA,EAC7D,IAAA,GAAe,aAAA;AAAA,EACP,SAAA;AAAA,EAER,WAAA,GAAc;AACZ,IAAA,IAAA,CAAK,YAAY,EAAC;AAAA,EACpB;AAAA;AAAA;AAAA;AAAA,EAMA,gBAAA,CAAiB,MAAc,EAAA,EAAc;AAC3C,IAAA,IAAI,IAAA,CAAK,SAAA,CAAU,IAAI,CAAA,EAAG;AACxB,MAAA,MAAM,IAAI,KAAA,CAAM,CAAA,eAAA,EAAkB,IAAI,CAAA,oBAAA,CAAsB,CAAA;AAAA,IAC9D;AACA,IAAA,IAAA,CAAK,SAAA,CAAU,IAAI,CAAA,GAAI,EAAA;AAAA,EACzB;AAAA,EAEO,YAAA,CAAa,EAAE,UAAA,EAAW,EAAuD;AACtF,IAAA,IAAI,UAAA,EAAY;AACd,MAAA,OAAO,MAAA,CAAO,OAAA,CAAQ,IAAA,CAAK,SAAS,CAAA,CAAE,MAAA,CAAO,CAAC,GAAA,EAAK,CAAC,CAAA,EAAG,CAAC,CAAA,KAAM;AAC5D,QAAA,OAAO;AAAA,UACL,GAAG,GAAA;AAAA,UACH,CAAC,CAAC,GAAG;AAAA,YACH,MAAM,CAAA,CAAE;AAAA;AACV,SACF;AAAA,MACF,CAAA,EAAG,EAAE,CAAA;AAAA,IACP;AACA,IAAA,OAAO,IAAA,CAAK,SAAA;AAAA,EACd;AAAA;AAAA;AAAA;AAAA,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AA,QACxC,aAAa,OAAA,IAAW,eAAA;AAAA;AAAA,QAExB,OAAA,EAAS,OAAO,EAAE,OAAA,EAAQ,KAAM;AAC9B,UAAA,MAAM,MAAA,GAAS,MAAM,IAAA,CAAK,YAAA,EAAa;AACvC,UAAA,MAAM,KAAA,GAAQ,OAAO,GAA0B,CAAA;AAC/C,UAAA,OAAQ,KAAA,CAAc;AAAA,YACpB,GAAI;AAAA,WACL,CAAA;AAAA,QACH;AAAA,OACD,CAAA;AAED,MAAA,OAAO,EAAE,GAAG,GAAA,EAAK,CAAC,GAAG,GAAG,IAAA,EAAK;AAAA,IAC/B,CAAA,EAAG,EAAE,CAAA;AAEL,IAAA,OAAO,KAAA;AAAA,EACT;AACF","file":"chunk-2FSLKKS2.js","sourcesContent":["import type { ToolAction } from '../tools';\nimport type { Workflow } from '../workflows';\n\nexport class Integration<ToolsParams = void, ApiClient = void> {\n name: string = 'Integration';\n private workflows: Record<string, Workflow>;\n\n constructor() {\n this.workflows = {};\n }\n\n /**\n * Workflows\n */\n\n registerWorkflow(name: string, fn: Workflow) {\n if (this.workflows[name]) {\n throw new Error(`Sync function \"${name}\" already registered`);\n }\n this.workflows[name] = fn;\n }\n\n public getWorkflows({ serialized }: { serialized?: boolean }): Record<string, Workflow> {\n if (serialized) {\n return Object.entries(this.workflows).reduce((acc, [k, v]) => {\n return {\n ...acc,\n [k]: {\n name: v.name,\n },\n };\n }, {});\n }\n return this.workflows;\n }\n\n /**\n * TOOLS\n */\n getStaticTools(_params?: ToolsParams): Record<string, ToolAction<any, any, any>> {\n throw new Error('Method not implemented.');\n }\n\n async getTools(_params?: ToolsParams): Promise<Record<string, ToolAction<any, any, any>>> {\n throw new Error('Method not implemented.');\n }\n\n async getApiClient(): Promise<ApiClient> {\n throw new Error('Method not implemented');\n }\n}\n","import { z } from 'zod';\n\nimport { createTool } from '../tools';\nimport type { ToolAction } from '../tools';\n\nexport abstract class OpenAPIToolset {\n abstract readonly name: string;\n abstract readonly tools: Record<string, ToolAction<any, any, any>>;\n\n authType: string = 'API_KEY';\n\n constructor() {}\n\n protected get toolSchemas(): any {\n return {};\n }\n\n protected get toolDocumentations(): Record<string, { comment: string; doc?: string }> {\n return {};\n }\n\n protected get baseClient(): any {\n return {};\n }\n\n async getApiClient(): Promise<any> {\n throw new Error('API not implemented');\n }\n\n protected _generateIntegrationTools<T>() {\n const { client: _client, ...clientMethods } = this.baseClient;\n const schemas = this.toolSchemas;\n const documentations = this.toolDocumentations;\n\n const tools = Object.keys(clientMethods).reduce((acc, key) => {\n const comment = documentations[key]?.comment;\n // const doc = documentations[key]?.doc;\n const fallbackComment = `Execute ${key}`;\n\n const tool = createTool({\n id: key,\n inputSchema: schemas[key] || z.object({}),\n description: comment || fallbackComment,\n // documentation: doc || fallbackComment,\n execute: async ({ context }) => {\n const client = await this.getApiClient();\n const value = client[key as keyof typeof client];\n return (value as any)({\n ...(context as any),\n });\n },\n });\n\n return { ...acc, [key]: tool };\n }, {});\n\n return tools as T;\n }\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkLHCCHHNV_cjs = require('./chunk-LHCCHHNV.cjs');
4
- var chunk73LEILKH_cjs = require('./chunk-73LEILKH.cjs');
3
+ var chunkWYJ5BHEW_cjs = require('./chunk-WYJ5BHEW.cjs');
4
+ var chunk2WZYQCRK_cjs = require('./chunk-2WZYQCRK.cjs');
5
5
 
6
6
  // src/storage/base.ts
7
7
  function ensureDate(date) {
@@ -21,17 +21,17 @@ function resolveMessageLimit({
21
21
  if (last === false) return 0;
22
22
  return defaultLimit;
23
23
  }
24
- var MastraStorage = class extends chunk73LEILKH_cjs.MastraBase {
24
+ var MastraStorage = class extends chunk2WZYQCRK_cjs.MastraBase {
25
25
  /** @deprecated import from { TABLE_WORKFLOW_SNAPSHOT } '@mastra/core/storage' instead */
26
- static TABLE_WORKFLOW_SNAPSHOT = chunkLHCCHHNV_cjs.TABLE_WORKFLOW_SNAPSHOT;
26
+ static TABLE_WORKFLOW_SNAPSHOT = chunkWYJ5BHEW_cjs.TABLE_WORKFLOW_SNAPSHOT;
27
27
  /** @deprecated import from { TABLE_EVALS } '@mastra/core/storage' instead */
28
- static TABLE_EVALS = chunkLHCCHHNV_cjs.TABLE_EVALS;
28
+ static TABLE_EVALS = chunkWYJ5BHEW_cjs.TABLE_EVALS;
29
29
  /** @deprecated import from { TABLE_MESSAGES } '@mastra/core/storage' instead */
30
- static TABLE_MESSAGES = chunkLHCCHHNV_cjs.TABLE_MESSAGES;
30
+ static TABLE_MESSAGES = chunkWYJ5BHEW_cjs.TABLE_MESSAGES;
31
31
  /** @deprecated import from { TABLE_THREADS } '@mastra/core/storage' instead */
32
- static TABLE_THREADS = chunkLHCCHHNV_cjs.TABLE_THREADS;
32
+ static TABLE_THREADS = chunkWYJ5BHEW_cjs.TABLE_THREADS;
33
33
  /** @deprecated import { TABLE_TRACES } from '@mastra/core/storage' instead */
34
- static TABLE_TRACES = chunkLHCCHHNV_cjs.TABLE_TRACES;
34
+ static TABLE_TRACES = chunkWYJ5BHEW_cjs.TABLE_TRACES;
35
35
  hasInitialized = null;
36
36
  shouldCacheInit = true;
37
37
  stores;
@@ -110,7 +110,7 @@ var MastraStorage = class extends chunk73LEILKH_cjs.MastraBase {
110
110
  if (this.stores?.traces) {
111
111
  return this.stores.traces.batchTraceInsert({ records });
112
112
  }
113
- return this.batchInsert({ tableName: chunkLHCCHHNV_cjs.TABLE_TRACES, records });
113
+ return this.batchInsert({ tableName: chunkWYJ5BHEW_cjs.TABLE_TRACES, records });
114
114
  }
115
115
  async getResourceById(_) {
116
116
  throw new Error(
@@ -138,43 +138,43 @@ var MastraStorage = class extends chunk73LEILKH_cjs.MastraBase {
138
138
  }
139
139
  const tableCreationTasks = [
140
140
  this.createTable({
141
- tableName: chunkLHCCHHNV_cjs.TABLE_WORKFLOW_SNAPSHOT,
142
- schema: chunkLHCCHHNV_cjs.TABLE_SCHEMAS[chunkLHCCHHNV_cjs.TABLE_WORKFLOW_SNAPSHOT]
141
+ tableName: chunkWYJ5BHEW_cjs.TABLE_WORKFLOW_SNAPSHOT,
142
+ schema: chunkWYJ5BHEW_cjs.TABLE_SCHEMAS[chunkWYJ5BHEW_cjs.TABLE_WORKFLOW_SNAPSHOT]
143
143
  }),
144
144
  this.createTable({
145
- tableName: chunkLHCCHHNV_cjs.TABLE_EVALS,
146
- schema: chunkLHCCHHNV_cjs.TABLE_SCHEMAS[chunkLHCCHHNV_cjs.TABLE_EVALS]
145
+ tableName: chunkWYJ5BHEW_cjs.TABLE_EVALS,
146
+ schema: chunkWYJ5BHEW_cjs.TABLE_SCHEMAS[chunkWYJ5BHEW_cjs.TABLE_EVALS]
147
147
  }),
148
148
  this.createTable({
149
- tableName: chunkLHCCHHNV_cjs.TABLE_THREADS,
150
- schema: chunkLHCCHHNV_cjs.TABLE_SCHEMAS[chunkLHCCHHNV_cjs.TABLE_THREADS]
149
+ tableName: chunkWYJ5BHEW_cjs.TABLE_THREADS,
150
+ schema: chunkWYJ5BHEW_cjs.TABLE_SCHEMAS[chunkWYJ5BHEW_cjs.TABLE_THREADS]
151
151
  }),
152
152
  this.createTable({
153
- tableName: chunkLHCCHHNV_cjs.TABLE_MESSAGES,
154
- schema: chunkLHCCHHNV_cjs.TABLE_SCHEMAS[chunkLHCCHHNV_cjs.TABLE_MESSAGES]
153
+ tableName: chunkWYJ5BHEW_cjs.TABLE_MESSAGES,
154
+ schema: chunkWYJ5BHEW_cjs.TABLE_SCHEMAS[chunkWYJ5BHEW_cjs.TABLE_MESSAGES]
155
155
  }),
156
156
  this.createTable({
157
- tableName: chunkLHCCHHNV_cjs.TABLE_TRACES,
158
- schema: chunkLHCCHHNV_cjs.TABLE_SCHEMAS[chunkLHCCHHNV_cjs.TABLE_TRACES]
157
+ tableName: chunkWYJ5BHEW_cjs.TABLE_TRACES,
158
+ schema: chunkWYJ5BHEW_cjs.TABLE_SCHEMAS[chunkWYJ5BHEW_cjs.TABLE_TRACES]
159
159
  }),
160
160
  this.createTable({
161
- tableName: chunkLHCCHHNV_cjs.TABLE_SCORERS,
162
- schema: chunkLHCCHHNV_cjs.TABLE_SCHEMAS[chunkLHCCHHNV_cjs.TABLE_SCORERS]
161
+ tableName: chunkWYJ5BHEW_cjs.TABLE_SCORERS,
162
+ schema: chunkWYJ5BHEW_cjs.TABLE_SCHEMAS[chunkWYJ5BHEW_cjs.TABLE_SCORERS]
163
163
  })
164
164
  ];
165
165
  if (this.supports.resourceWorkingMemory) {
166
166
  tableCreationTasks.push(
167
167
  this.createTable({
168
- tableName: chunkLHCCHHNV_cjs.TABLE_RESOURCES,
169
- schema: chunkLHCCHHNV_cjs.TABLE_SCHEMAS[chunkLHCCHHNV_cjs.TABLE_RESOURCES]
168
+ tableName: chunkWYJ5BHEW_cjs.TABLE_RESOURCES,
169
+ schema: chunkWYJ5BHEW_cjs.TABLE_SCHEMAS[chunkWYJ5BHEW_cjs.TABLE_RESOURCES]
170
170
  })
171
171
  );
172
172
  }
173
173
  this.hasInitialized = Promise.all(tableCreationTasks).then(() => true);
174
174
  await this.hasInitialized;
175
175
  await this?.alterTable?.({
176
- tableName: chunkLHCCHHNV_cjs.TABLE_MESSAGES,
177
- schema: chunkLHCCHHNV_cjs.TABLE_SCHEMAS[chunkLHCCHHNV_cjs.TABLE_MESSAGES],
176
+ tableName: chunkWYJ5BHEW_cjs.TABLE_MESSAGES,
177
+ schema: chunkWYJ5BHEW_cjs.TABLE_SCHEMAS[chunkWYJ5BHEW_cjs.TABLE_MESSAGES],
178
178
  ifNotExists: ["resourceId"]
179
179
  });
180
180
  }
@@ -193,7 +193,7 @@ var MastraStorage = class extends chunk73LEILKH_cjs.MastraBase {
193
193
  };
194
194
  this.logger.debug("Persisting workflow snapshot", { workflowName, runId, data });
195
195
  await this.insert({
196
- tableName: chunkLHCCHHNV_cjs.TABLE_WORKFLOW_SNAPSHOT,
196
+ tableName: chunkWYJ5BHEW_cjs.TABLE_WORKFLOW_SNAPSHOT,
197
197
  record: data
198
198
  });
199
199
  }
@@ -206,7 +206,7 @@ var MastraStorage = class extends chunk73LEILKH_cjs.MastraBase {
206
206
  }
207
207
  this.logger.debug("Loading workflow snapshot", { workflowName, runId });
208
208
  const d = await this.load({
209
- tableName: chunkLHCCHHNV_cjs.TABLE_WORKFLOW_SNAPSHOT,
209
+ tableName: chunkWYJ5BHEW_cjs.TABLE_WORKFLOW_SNAPSHOT,
210
210
  keys: { workflow_name: workflowName, run_id: runId }
211
211
  });
212
212
  return d ? d.snapshot : null;
@@ -217,3 +217,5 @@ exports.MastraStorage = MastraStorage;
217
217
  exports.ensureDate = ensureDate;
218
218
  exports.resolveMessageLimit = resolveMessageLimit;
219
219
  exports.serializeDate = serializeDate;
220
+ //# sourceMappingURL=chunk-2HXWRK3P.cjs.map
221
+ //# sourceMappingURL=chunk-2HXWRK3P.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/storage/base.ts"],"names":["MastraBase","TABLE_WORKFLOW_SNAPSHOT","TABLE_EVALS","TABLE_MESSAGES","TABLE_THREADS","TABLE_TRACES","TABLE_SCHEMAS","TABLE_SCORERS","TABLE_RESOURCES"],"mappings":";;;;;;AAmDO,SAAS,WAAW,IAAA,EAAmD;AAC5E,EAAA,IAAI,CAAC,MAAM,OAAO,MAAA;AAClB,EAAA,OAAO,IAAA,YAAgB,IAAA,GAAO,IAAA,GAAO,IAAI,KAAK,IAAI,CAAA;AACpD;AAEO,SAAS,cAAc,IAAA,EAAqD;AACjF,EAAA,IAAI,CAAC,MAAM,OAAO,MAAA;AAClB,EAAA,MAAM,OAAA,GAAU,WAAW,IAAI,CAAA;AAC/B,EAAA,OAAO,SAAS,WAAA,EAAY;AAC9B;AAEO,SAAS,mBAAA,CAAoB;AAAA,EAClC,IAAA;AAAA,EACA;AACF,CAAA,EAGW;AAET,EAAA,IAAI,OAAO,IAAA,KAAS,QAAA,SAAiB,IAAA,CAAK,GAAA,CAAI,GAAG,IAAI,CAAA;AACrD,EAAA,IAAI,IAAA,K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C,IAAA,IAAI,CAAC,KAAK,cAAA,EAAgB;AACxB,MAAA,MAAM,KAAK,IAAA,EAAK;AAAA,IAClB;AACA,IAAA,IAAA,CAAK,OAAO,KAAA,CAAM,2BAAA,EAA6B,EAAE,YAAA,EAAc,OAAO,CAAA;AACtE,IAAA,MAAM,CAAA,GAAI,MAAM,IAAA,CAAK,IAAA,CAAqC;AAAA,MACxD,SAAA,EAAWA,yCAAA;AAAA,MACX,IAAA,EAAM,EAAE,aAAA,EAAe,YAAA,EAAc,QAAQ,KAAA;AAAM,KACpD,CAAA;AAED,IAAA,OAAO,CAAA,GAAI,EAAE,QAAA,GAAW,IAAA;AAAA,EAC1B;AAuEF","file":"chunk-2HXWRK3P.cjs","sourcesContent":["import type { MastraMessageContentV2, MastraMessageV2 } from '../agent';\nimport { MastraBase } from '../base';\nimport type { MastraMessageV1, StorageThreadType } from '../memory/types';\nimport type { ScoreRowData } from '../scores';\nimport type { Trace } from '../telemetry';\n\nimport type { WorkflowRunState } from '../workflows';\n\nimport {\n TABLE_WORKFLOW_SNAPSHOT,\n TABLE_EVALS,\n TABLE_MESSAGES,\n TABLE_THREADS,\n TABLE_TRACES,\n TABLE_RESOURCES,\n TABLE_SCORERS,\n TABLE_SCHEMAS,\n} from './constants';\nimport type { TABLE_NAMES } from './constants';\nimport type {\n ScoresStorage,\n StoreOperations,\n WorkflowsStorage,\n TracesStorage,\n MemoryStorage,\n LegacyEvalsStorage,\n} from './domains';\nimport type {\n EvalRow,\n PaginationInfo,\n StorageColumn,\n StorageGetMessagesArg,\n StorageResourceType,\n StoragePagination,\n ThreadSortOptions,\n WorkflowRun,\n WorkflowRuns,\n StorageGetTracesArg,\n PaginationArgs,\n StorageGetTracesPaginatedArg,\n} from './types';\n\nexport type StorageDomains = {\n legacyEvals: LegacyEvalsStorage;\n operations: StoreOperations;\n workflows: WorkflowsStorage;\n scores: ScoresStorage;\n traces: TracesStorage;\n memory: MemoryStorage;\n};\n\nexport function ensureDate(date: Date | string | undefined): Date | undefined {\n if (!date) return undefined;\n return date instanceof Date ? date : new Date(date);\n}\n\nexport function serializeDate(date: Date | string | undefined): string | undefined {\n if (!date) return undefined;\n const dateObj = ensureDate(date);\n return dateObj?.toISOString();\n}\n\nexport function resolveMessageLimit({\n last,\n defaultLimit,\n}: {\n last: number | false | undefined;\n defaultLimit: number;\n}): number {\n // TODO: Figure out consistent default limit for all stores as some stores use 40 and some use no limit (Number.MAX_SAFE_INTEGER)\n if (typeof last === 'number') return Math.max(0, last);\n if (last === false) return 0;\n return defaultLimit;\n}\nexport abstract class MastraStorage extends MastraBase {\n /** @deprecated import from { TABLE_WORKFLOW_SNAPSHOT } '@mastra/core/storage' instead */\n static readonly TABLE_WORKFLOW_SNAPSHOT = TABLE_WORKFLOW_SNAPSHOT;\n /** @deprecated import from { TABLE_EVALS } '@mastra/core/storage' instead */\n static readonly TABLE_EVALS = TABLE_EVALS;\n /** @deprecated import from { TABLE_MESSAGES } '@mastra/core/storage' instead */\n static readonly TABLE_MESSAGES = TABLE_MESSAGES;\n /** @deprecated import from { TABLE_THREADS } '@mastra/core/storage' instead */\n static readonly TABLE_THREADS = TABLE_THREADS;\n /** @deprecated import { TABLE_TRACES } from '@mastra/core/storage' instead */\n static readonly TABLE_TRACES = TABLE_TRACES;\n\n protected hasInitialized: null | Promise<boolean> = null;\n protected shouldCacheInit = true;\n\n stores?: StorageDomains;\n\n constructor({ name }: { name: string }) {\n super({\n component: 'STORAGE',\n name,\n });\n }\n\n public get supports(): {\n selectByIncludeResourceScope: boolean;\n resourceWorkingMemory: boolean;\n hasColumn: boolean;\n createTable: boolean;\n deleteMessages: boolean;\n } {\n return {\n selectByIncludeResourceScope: false,\n resourceWorkingMemory: false,\n hasColumn: false,\n createTable: false,\n deleteMessages: false,\n };\n }\n\n protected ensureDate(date: Date | string | undefined): Date | undefined {\n return ensureDate(date);\n }\n\n protected serializeDate(date: Date | string | undefined): string | undefined {\n return serializeDate(date);\n }\n\n /**\n * Resolves limit for how many messages to fetch\n *\n * @param last The number of messages to fetch\n * @param defaultLimit The default limit to use if last is not provided\n * @returns The resolved limit\n */\n protected resolveMessageLimit({\n last,\n defaultLimit,\n }: {\n last: number | false | undefined;\n defaultLimit: number;\n }): number {\n return resolveMessageLimit({ last, defaultLimit });\n }\n\n protected getSqlType(type: StorageColumn['type']): string {\n switch (type) {\n case 'text':\n return 'TEXT';\n case 'timestamp':\n return 'TIMESTAMP';\n case 'float':\n return 'FLOAT';\n case 'integer':\n return 'INTEGER';\n case 'bigint':\n return 'BIGINT';\n case 'jsonb':\n return 'JSONB';\n case 'float':\n return 'FLOAT';\n default:\n return 'TEXT';\n }\n }\n\n protected getDefaultValue(type: StorageColumn['type']): string {\n switch (type) {\n case 'text':\n case 'uuid':\n return \"DEFAULT ''\";\n case 'timestamp':\n return \"DEFAULT '1970-01-01 00:00:00'\";\n case 'integer':\n case 'float':\n case 'bigint':\n return 'DEFAULT 0';\n case 'jsonb':\n return \"DEFAULT '{}'\";\n default:\n return \"DEFAULT ''\";\n }\n }\n\n abstract createTable({ tableName }: { tableName: TABLE_NAMES; schema: Record<string, StorageColumn> }): Promise<void>;\n\n abstract clearTable({ tableName }: { tableName: TABLE_NAMES }): Promise<void>;\n\n abstract dropTable({ tableName }: { tableName: TABLE_NAMES }): Promise<void>;\n\n abstract alterTable(args: {\n tableName: TABLE_NAMES;\n schema: Record<string, StorageColumn>;\n ifNotExists: string[];\n }): Promise<void>;\n\n abstract insert({ tableName, record }: { tableName: TABLE_NAMES; record: Record<string, any> }): Promise<void>;\n\n abstract batchInsert({\n tableName,\n records,\n }: {\n tableName: TABLE_NAMES;\n records: Record<string, any>[];\n }): Promise<void>;\n\n batchTraceInsert({ records }: { records: Record<string, any>[] }): Promise<void> {\n if (this.stores?.traces) {\n return this.stores.traces.batchTraceInsert({ records });\n }\n return this.batchInsert({ tableName: TABLE_TRACES, records });\n }\n\n abstract load<R>({ tableName, keys }: { tableName: TABLE_NAMES; keys: Record<string, any> }): Promise<R | null>;\n\n abstract getThreadById({ threadId }: { threadId: string }): Promise<StorageThreadType | null>;\n\n abstract getThreadsByResourceId({\n resourceId,\n orderBy,\n sortDirection,\n }: { resourceId: string } & ThreadSortOptions): Promise<StorageThreadType[]>;\n\n abstract saveThread({ thread }: { thread: StorageThreadType }): Promise<StorageThreadType>;\n\n abstract updateThread({\n id,\n title,\n metadata,\n }: {\n id: string;\n title: string;\n metadata: Record<string, unknown>;\n }): Promise<StorageThreadType>;\n\n abstract deleteThread({ threadId }: { threadId: string }): Promise<void>;\n\n async getResourceById(_: { resourceId: string }): Promise<StorageResourceType | null> {\n throw new Error(\n `Resource working memory is not supported by this storage adapter (${this.constructor.name}). ` +\n `Supported storage adapters: LibSQL (@mastra/libsql), PostgreSQL (@mastra/pg), Upstash (@mastra/upstash). ` +\n `To use per-resource working memory, switch to one of these supported storage adapters.`,\n );\n }\n\n async saveResource(_: { resource: StorageResourceType }): Promise<StorageResourceType> {\n throw new Error(\n `Resource working memory is not supported by this storage adapter (${this.constructor.name}). ` +\n `Supported storage adapters: LibSQL (@mastra/libsql), PostgreSQL (@mastra/pg), Upstash (@mastra/upstash). ` +\n `To use per-resource working memory, switch to one of these supported storage adapters.`,\n );\n }\n\n async updateResource(_: {\n resourceId: string;\n workingMemory?: string;\n metadata?: Record<string, unknown>;\n }): Promise<StorageResourceType> {\n throw new Error(\n `Resource working memory is not supported by this storage adapter (${this.constructor.name}). ` +\n `Supported storage adapters: LibSQL (@mastra/libsql), PostgreSQL (@mastra/pg), Upstash (@mastra/upstash). ` +\n `To use per-resource working memory, switch to one of these supported storage adapters.`,\n );\n }\n\n abstract getMessages(args: StorageGetMessagesArg & { format?: 'v1' }): Promise<MastraMessageV1[]>;\n abstract getMessages(args: StorageGetMessagesArg & { format: 'v2' }): Promise<MastraMessageV2[]>;\n abstract getMessages({\n threadId,\n resourceId,\n selectBy,\n format,\n }: StorageGetMessagesArg & { format?: 'v1' | 'v2' }): Promise<MastraMessageV1[] | MastraMessageV2[]>;\n\n abstract saveMessages(args: { messages: MastraMessageV1[]; format?: undefined | 'v1' }): Promise<MastraMessageV1[]>;\n abstract saveMessages(args: { messages: MastraMessageV2[]; format: 'v2' }): Promise<MastraMessageV2[]>;\n abstract saveMessages(\n args: { messages: MastraMessageV1[]; format?: undefined | 'v1' } | { messages: MastraMessageV2[]; format: 'v2' },\n ): Promise<MastraMessageV2[] | MastraMessageV1[]>;\n\n abstract updateMessages(args: {\n messages: Partial<Omit<MastraMessageV2, 'createdAt'>> &\n {\n id: string;\n content?: { metadata?: MastraMessageContentV2['metadata']; content?: MastraMessageContentV2['content'] };\n }[];\n }): Promise<MastraMessageV2[]>;\n\n async deleteMessages(_messageIds: string[]): Promise<void> {\n throw new Error(\n `Message deletion is not supported by this storage adapter (${this.constructor.name}). ` +\n `The deleteMessages method needs to be implemented in the storage adapter.`,\n );\n }\n\n abstract getTraces(args: StorageGetTracesArg): Promise<Trace[]>;\n\n abstract getTracesPaginated(args: StorageGetTracesPaginatedArg): Promise<PaginationInfo & { traces: Trace[] }>;\n\n async init(): Promise<void> {\n // to prevent race conditions, await any current init\n if (this.shouldCacheInit && (await this.hasInitialized)) {\n return;\n }\n\n const tableCreationTasks = [\n this.createTable({\n tableName: TABLE_WORKFLOW_SNAPSHOT,\n schema: TABLE_SCHEMAS[TABLE_WORKFLOW_SNAPSHOT],\n }),\n\n this.createTable({\n tableName: TABLE_EVALS,\n schema: TABLE_SCHEMAS[TABLE_EVALS],\n }),\n\n this.createTable({\n tableName: TABLE_THREADS,\n schema: TABLE_SCHEMAS[TABLE_THREADS],\n }),\n\n this.createTable({\n tableName: TABLE_MESSAGES,\n schema: TABLE_SCHEMAS[TABLE_MESSAGES],\n }),\n\n this.createTable({\n tableName: TABLE_TRACES,\n schema: TABLE_SCHEMAS[TABLE_TRACES],\n }),\n\n this.createTable({\n tableName: TABLE_SCORERS,\n schema: TABLE_SCHEMAS[TABLE_SCORERS],\n }),\n ];\n\n // Only create resources table for storage adapters that support it\n if (this.supports.resourceWorkingMemory) {\n tableCreationTasks.push(\n this.createTable({\n tableName: TABLE_RESOURCES,\n schema: TABLE_SCHEMAS[TABLE_RESOURCES],\n }),\n );\n }\n\n this.hasInitialized = Promise.all(tableCreationTasks).then(() => true);\n\n await this.hasInitialized;\n\n await this?.alterTable?.({\n tableName: TABLE_MESSAGES,\n schema: TABLE_SCHEMAS[TABLE_MESSAGES],\n ifNotExists: ['resourceId'],\n });\n }\n\n async persistWorkflowSnapshot({\n workflowName,\n runId,\n snapshot,\n }: {\n workflowName: string;\n runId: string;\n snapshot: WorkflowRunState;\n }): Promise<void> {\n await this.init();\n\n const data = {\n workflow_name: workflowName,\n run_id: runId,\n snapshot,\n createdAt: new Date(),\n updatedAt: new Date(),\n };\n this.logger.debug('Persisting workflow snapshot', { workflowName, runId, data });\n await this.insert({\n tableName: TABLE_WORKFLOW_SNAPSHOT,\n record: data,\n });\n }\n\n async loadWorkflowSnapshot({\n workflowName,\n runId,\n }: {\n workflowName: string;\n runId: string;\n }): Promise<WorkflowRunState | null> {\n if (!this.hasInitialized) {\n await this.init();\n }\n this.logger.debug('Loading workflow snapshot', { workflowName, runId });\n const d = await this.load<{ snapshot: WorkflowRunState }>({\n tableName: TABLE_WORKFLOW_SNAPSHOT,\n keys: { workflow_name: workflowName, run_id: runId },\n });\n\n return d ? d.snapshot : null;\n }\n\n /**\n * SCORERS\n */\n\n abstract getScoreById({ id }: { id: string }): Promise<ScoreRowData | null>;\n\n abstract saveScore(score: Omit<ScoreRowData, 'id' | 'createdAt' | 'updatedAt'>): Promise<{ score: ScoreRowData }>;\n\n abstract getScoresByScorerId({\n scorerId,\n pagination,\n entityId,\n entityType,\n }: {\n scorerId: string;\n pagination: StoragePagination;\n entityId?: string;\n entityType?: string;\n }): Promise<{ pagination: PaginationInfo; scores: ScoreRowData[] }>;\n\n abstract getScoresByRunId({\n runId,\n pagination,\n }: {\n runId: string;\n pagination: StoragePagination;\n }): Promise<{ pagination: PaginationInfo; scores: ScoreRowData[] }>;\n\n abstract getScoresByEntityId({\n entityId,\n entityType,\n pagination,\n }: {\n pagination: StoragePagination;\n entityId: string;\n entityType: string;\n }): Promise<{ pagination: PaginationInfo; scores: ScoreRowData[] }>;\n\n abstract getEvals(\n options: {\n agentName?: string;\n type?: 'test' | 'live';\n } & PaginationArgs,\n ): Promise<PaginationInfo & { evals: EvalRow[] }>;\n\n abstract getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;\n\n abstract getWorkflowRuns(args?: {\n workflowName?: string;\n fromDate?: Date;\n toDate?: Date;\n limit?: number;\n offset?: number;\n resourceId?: string;\n }): Promise<WorkflowRuns>;\n\n abstract getWorkflowRunById(args: { runId: string; workflowName?: string }): Promise<WorkflowRun | null>;\n\n abstract getThreadsByResourceIdPaginated(\n args: {\n resourceId: string;\n page: number;\n perPage: number;\n } & ThreadSortOptions,\n ): Promise<PaginationInfo & { threads: StorageThreadType[] }>;\n\n abstract getMessagesPaginated(\n args: StorageGetMessagesArg & { format?: 'v1' | 'v2' },\n ): Promise<PaginationInfo & { messages: MastraMessageV1[] | MastraMessageV2[] }>;\n}\n"]}