agentfootprint 10.3.1 → 10.4.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 (414) hide show
  1. package/AGENTS.md +2 -2
  2. package/CAPABILITIES.md +6 -0
  3. package/README.md +44 -0
  4. package/ai-instructions/claude-code/SKILL.md +2 -2
  5. package/dist/adapters/mcp/agentcoreRuntime/errorType.js +24 -0
  6. package/dist/adapters/mcp/agentcoreRuntime/errorType.js.map +1 -0
  7. package/dist/adapters/mcp/agentcoreRuntime/invoke.js +265 -0
  8. package/dist/adapters/mcp/agentcoreRuntime/invoke.js.map +1 -0
  9. package/dist/adapters/mcp/agentcoreRuntime/safeAnswer.js +415 -0
  10. package/dist/adapters/mcp/agentcoreRuntime/safeAnswer.js.map +1 -0
  11. package/dist/adapters/mcp/agentcoreRuntime/session.js +179 -0
  12. package/dist/adapters/mcp/agentcoreRuntime/session.js.map +1 -0
  13. package/dist/adapters/mcp/agentcoreRuntime/sessionBusy.js +117 -0
  14. package/dist/adapters/mcp/agentcoreRuntime/sessionBusy.js.map +1 -0
  15. package/dist/adapters/mcp/agentcoreRuntime/strictJson.js +220 -0
  16. package/dist/adapters/mcp/agentcoreRuntime/strictJson.js.map +1 -0
  17. package/dist/adapters/mcp/agentcoreRuntime/transport.js +204 -0
  18. package/dist/adapters/mcp/agentcoreRuntime/transport.js.map +1 -0
  19. package/dist/adapters/memory/agentcore.js +435 -20
  20. package/dist/adapters/memory/agentcore.js.map +1 -1
  21. package/dist/adapters/memory/memoryBank.js +16 -3
  22. package/dist/adapters/memory/memoryBank.js.map +1 -1
  23. package/dist/adapters/memory/pgVector.js +10 -4
  24. package/dist/adapters/memory/pgVector.js.map +1 -1
  25. package/dist/adapters/memory/redis.js +11 -3
  26. package/dist/adapters/memory/redis.js.map +1 -1
  27. package/dist/adapters/memory/s3Vectors.js +8 -3
  28. package/dist/adapters/memory/s3Vectors.js.map +1 -1
  29. package/dist/adapters/memory/sqliteVector.js +10 -4
  30. package/dist/adapters/memory/sqliteVector.js.map +1 -1
  31. package/dist/ag-ui/adapter.js +71 -0
  32. package/dist/ag-ui/adapter.js.map +1 -0
  33. package/dist/ag-ui/framing.js +66 -0
  34. package/dist/ag-ui/framing.js.map +1 -0
  35. package/dist/ag-ui/frontendTools.js +69 -0
  36. package/dist/ag-ui/frontendTools.js.map +1 -0
  37. package/dist/ag-ui/ids.js +54 -0
  38. package/dist/ag-ui/ids.js.map +1 -0
  39. package/dist/ag-ui/index.js +27 -0
  40. package/dist/ag-ui/index.js.map +1 -0
  41. package/dist/ag-ui/request.js +356 -0
  42. package/dist/ag-ui/request.js.map +1 -0
  43. package/dist/ag-ui/serializer.js +899 -0
  44. package/dist/ag-ui/serializer.js.map +1 -0
  45. package/dist/ag-ui/types.js +22 -0
  46. package/dist/ag-ui/types.js.map +1 -0
  47. package/dist/core/Agent.js +38 -5
  48. package/dist/core/Agent.js.map +1 -1
  49. package/dist/core/RunnerBase.js +16 -2
  50. package/dist/core/RunnerBase.js.map +1 -1
  51. package/dist/core/agent/buildAgentChart.js +4 -0
  52. package/dist/core/agent/buildAgentChart.js.map +1 -1
  53. package/dist/core/agent/buildDynamicAgentChart.js +4 -0
  54. package/dist/core/agent/buildDynamicAgentChart.js.map +1 -1
  55. package/dist/core/agent/callerIdentity.js +2 -1
  56. package/dist/core/agent/callerIdentity.js.map +1 -1
  57. package/dist/core/agent/stages/routeTurn.js +3 -3
  58. package/dist/core/agent/stages/routeTurn.js.map +1 -1
  59. package/dist/core/agent/stages/seed.js +49 -8
  60. package/dist/core/agent/stages/seed.js.map +1 -1
  61. package/dist/core/agent/stages/timeLayer.js +2 -2
  62. package/dist/core/agent/stages/timeLayer.js.map +1 -1
  63. package/dist/core/agent/stages/toolCalls.js +26 -5
  64. package/dist/core/agent/stages/toolCalls.js.map +1 -1
  65. package/dist/core/memberRun.js +244 -0
  66. package/dist/core/memberRun.js.map +1 -0
  67. package/dist/core/slots/buildToolsSlot.js +1 -1
  68. package/dist/core/slots/buildToolsSlot.js.map +1 -1
  69. package/dist/core-flow/Conditional.js +29 -8
  70. package/dist/core-flow/Conditional.js.map +1 -1
  71. package/dist/core-flow/Graph.js +38 -13
  72. package/dist/core-flow/Graph.js.map +1 -1
  73. package/dist/core-flow/Loop.js +29 -9
  74. package/dist/core-flow/Loop.js.map +1 -1
  75. package/dist/core-flow/Parallel.js +35 -14
  76. package/dist/core-flow/Parallel.js.map +1 -1
  77. package/dist/core-flow/Sequence.js +29 -8
  78. package/dist/core-flow/Sequence.js.map +1 -1
  79. package/dist/core-flow/Workflow.js +34 -10
  80. package/dist/core-flow/Workflow.js.map +1 -1
  81. package/dist/doors/ag-ui.js +36 -0
  82. package/dist/doors/ag-ui.js.map +1 -0
  83. package/dist/esm/adapters/mcp/agentcoreRuntime/errorType.d.ts +12 -0
  84. package/dist/esm/adapters/mcp/agentcoreRuntime/errorType.js +20 -0
  85. package/dist/esm/adapters/mcp/agentcoreRuntime/errorType.js.map +1 -0
  86. package/dist/esm/adapters/mcp/agentcoreRuntime/invoke.d.ts +116 -0
  87. package/dist/esm/adapters/mcp/agentcoreRuntime/invoke.js +260 -0
  88. package/dist/esm/adapters/mcp/agentcoreRuntime/invoke.js.map +1 -0
  89. package/dist/esm/adapters/mcp/agentcoreRuntime/safeAnswer.d.ts +49 -0
  90. package/dist/esm/adapters/mcp/agentcoreRuntime/safeAnswer.js +409 -0
  91. package/dist/esm/adapters/mcp/agentcoreRuntime/safeAnswer.js.map +1 -0
  92. package/dist/esm/adapters/mcp/agentcoreRuntime/session.d.ts +80 -0
  93. package/dist/esm/adapters/mcp/agentcoreRuntime/session.js +175 -0
  94. package/dist/esm/adapters/mcp/agentcoreRuntime/session.js.map +1 -0
  95. package/dist/esm/adapters/mcp/agentcoreRuntime/sessionBusy.d.ts +61 -0
  96. package/dist/esm/adapters/mcp/agentcoreRuntime/sessionBusy.js +112 -0
  97. package/dist/esm/adapters/mcp/agentcoreRuntime/sessionBusy.js.map +1 -0
  98. package/dist/esm/adapters/mcp/agentcoreRuntime/strictJson.d.ts +37 -0
  99. package/dist/esm/adapters/mcp/agentcoreRuntime/strictJson.js +215 -0
  100. package/dist/esm/adapters/mcp/agentcoreRuntime/strictJson.js.map +1 -0
  101. package/dist/esm/adapters/mcp/agentcoreRuntime/transport.d.ts +176 -0
  102. package/dist/esm/adapters/mcp/agentcoreRuntime/transport.js +199 -0
  103. package/dist/esm/adapters/mcp/agentcoreRuntime/transport.js.map +1 -0
  104. package/dist/esm/adapters/memory/agentcore.d.ts +152 -7
  105. package/dist/esm/adapters/memory/agentcore.js +433 -19
  106. package/dist/esm/adapters/memory/agentcore.js.map +1 -1
  107. package/dist/esm/adapters/memory/memoryBank.d.ts +3 -2
  108. package/dist/esm/adapters/memory/memoryBank.js +16 -3
  109. package/dist/esm/adapters/memory/memoryBank.js.map +1 -1
  110. package/dist/esm/adapters/memory/pgVector.js +10 -4
  111. package/dist/esm/adapters/memory/pgVector.js.map +1 -1
  112. package/dist/esm/adapters/memory/redis.d.ts +8 -3
  113. package/dist/esm/adapters/memory/redis.js +11 -3
  114. package/dist/esm/adapters/memory/redis.js.map +1 -1
  115. package/dist/esm/adapters/memory/s3Vectors.js +8 -3
  116. package/dist/esm/adapters/memory/s3Vectors.js.map +1 -1
  117. package/dist/esm/adapters/memory/sqliteVector.js +10 -4
  118. package/dist/esm/adapters/memory/sqliteVector.js.map +1 -1
  119. package/dist/esm/ag-ui/adapter.d.ts +68 -0
  120. package/dist/esm/ag-ui/adapter.js +67 -0
  121. package/dist/esm/ag-ui/adapter.js.map +1 -0
  122. package/dist/esm/ag-ui/framing.d.ts +51 -0
  123. package/dist/esm/ag-ui/framing.js +62 -0
  124. package/dist/esm/ag-ui/framing.js.map +1 -0
  125. package/dist/esm/ag-ui/frontendTools.d.ts +37 -0
  126. package/dist/esm/ag-ui/frontendTools.js +64 -0
  127. package/dist/esm/ag-ui/frontendTools.js.map +1 -0
  128. package/dist/esm/ag-ui/ids.d.ts +43 -0
  129. package/dist/esm/ag-ui/ids.js +49 -0
  130. package/dist/esm/ag-ui/ids.js.map +1 -0
  131. package/dist/esm/ag-ui/index.d.ts +17 -0
  132. package/dist/esm/ag-ui/index.js +17 -0
  133. package/dist/esm/ag-ui/index.js.map +1 -0
  134. package/dist/esm/ag-ui/request.d.ts +72 -0
  135. package/dist/esm/ag-ui/request.js +350 -0
  136. package/dist/esm/ag-ui/request.js.map +1 -0
  137. package/dist/esm/ag-ui/serializer.d.ts +173 -0
  138. package/dist/esm/ag-ui/serializer.js +895 -0
  139. package/dist/esm/ag-ui/serializer.js.map +1 -0
  140. package/dist/esm/ag-ui/types.d.ts +305 -0
  141. package/dist/esm/ag-ui/types.js +19 -0
  142. package/dist/esm/ag-ui/types.js.map +1 -0
  143. package/dist/esm/core/Agent.d.ts +2 -0
  144. package/dist/esm/core/Agent.js +38 -5
  145. package/dist/esm/core/Agent.js.map +1 -1
  146. package/dist/esm/core/RunnerBase.js +17 -3
  147. package/dist/esm/core/RunnerBase.js.map +1 -1
  148. package/dist/esm/core/agent/buildAgentChart.js +4 -0
  149. package/dist/esm/core/agent/buildAgentChart.js.map +1 -1
  150. package/dist/esm/core/agent/buildDynamicAgentChart.js +4 -0
  151. package/dist/esm/core/agent/buildDynamicAgentChart.js.map +1 -1
  152. package/dist/esm/core/agent/callerIdentity.js +2 -1
  153. package/dist/esm/core/agent/callerIdentity.js.map +1 -1
  154. package/dist/esm/core/agent/stages/routeTurn.d.ts +1 -1
  155. package/dist/esm/core/agent/stages/routeTurn.js +3 -3
  156. package/dist/esm/core/agent/stages/routeTurn.js.map +1 -1
  157. package/dist/esm/core/agent/stages/seed.d.ts +11 -1
  158. package/dist/esm/core/agent/stages/seed.js +49 -8
  159. package/dist/esm/core/agent/stages/seed.js.map +1 -1
  160. package/dist/esm/core/agent/stages/timeLayer.js +2 -2
  161. package/dist/esm/core/agent/stages/timeLayer.js.map +1 -1
  162. package/dist/esm/core/agent/stages/toolCalls.d.ts +11 -1
  163. package/dist/esm/core/agent/stages/toolCalls.js +26 -5
  164. package/dist/esm/core/agent/stages/toolCalls.js.map +1 -1
  165. package/dist/esm/core/agent/types.d.ts +16 -6
  166. package/dist/esm/core/memberRun.d.ts +132 -0
  167. package/dist/esm/core/memberRun.js +227 -0
  168. package/dist/esm/core/memberRun.js.map +1 -0
  169. package/dist/esm/core/slots/buildToolsSlot.d.ts +1 -1
  170. package/dist/esm/core/slots/buildToolsSlot.js +1 -1
  171. package/dist/esm/core/slots/buildToolsSlot.js.map +1 -1
  172. package/dist/esm/core-flow/Conditional.d.ts +8 -0
  173. package/dist/esm/core-flow/Conditional.js +29 -8
  174. package/dist/esm/core-flow/Conditional.js.map +1 -1
  175. package/dist/esm/core-flow/Graph.js +38 -13
  176. package/dist/esm/core-flow/Graph.js.map +1 -1
  177. package/dist/esm/core-flow/Loop.d.ts +8 -0
  178. package/dist/esm/core-flow/Loop.js +29 -9
  179. package/dist/esm/core-flow/Loop.js.map +1 -1
  180. package/dist/esm/core-flow/Parallel.d.ts +8 -0
  181. package/dist/esm/core-flow/Parallel.js +35 -14
  182. package/dist/esm/core-flow/Parallel.js.map +1 -1
  183. package/dist/esm/core-flow/Sequence.d.ts +8 -0
  184. package/dist/esm/core-flow/Sequence.js +29 -8
  185. package/dist/esm/core-flow/Sequence.js.map +1 -1
  186. package/dist/esm/core-flow/Workflow.js +34 -10
  187. package/dist/esm/core-flow/Workflow.js.map +1 -1
  188. package/dist/esm/doors/ag-ui.d.ts +19 -0
  189. package/dist/esm/doors/ag-ui.js +20 -0
  190. package/dist/esm/doors/ag-ui.js.map +1 -0
  191. package/dist/esm/hosting/envelope.js +5 -0
  192. package/dist/esm/hosting/envelope.js.map +1 -1
  193. package/dist/esm/hosting/httpHost.js +5 -78
  194. package/dist/esm/hosting/httpHost.js.map +1 -1
  195. package/dist/esm/hosting/index.d.ts +4 -1
  196. package/dist/esm/hosting/index.js +2 -0
  197. package/dist/esm/hosting/index.js.map +1 -1
  198. package/dist/esm/hosting/pendingAsk.d.ts +19 -0
  199. package/dist/esm/hosting/pendingAsk.js +38 -0
  200. package/dist/esm/hosting/pendingAsk.js.map +1 -0
  201. package/dist/esm/hosting/protocolAdapter.d.ts +229 -0
  202. package/dist/esm/hosting/protocolAdapter.js +23 -0
  203. package/dist/esm/hosting/protocolAdapter.js.map +1 -0
  204. package/dist/esm/hosting/refusalStatus.d.ts +30 -0
  205. package/dist/esm/hosting/refusalStatus.js +81 -0
  206. package/dist/esm/hosting/refusalStatus.js.map +1 -0
  207. package/dist/esm/hosting/standingAgent.js +1 -31
  208. package/dist/esm/hosting/standingAgent.js.map +1 -1
  209. package/dist/esm/hosting/stream.d.ts +39 -0
  210. package/dist/esm/hosting/stream.js +34 -2
  211. package/dist/esm/hosting/stream.js.map +1 -1
  212. package/dist/esm/hosting/streamHandler.d.ts +134 -0
  213. package/dist/esm/hosting/streamHandler.js +493 -0
  214. package/dist/esm/hosting/streamHandler.js.map +1 -0
  215. package/dist/esm/hosting/types.d.ts +15 -0
  216. package/dist/esm/hosting/types.js.map +1 -1
  217. package/dist/esm/hosting/verifiedThreads.d.ts +29 -0
  218. package/dist/esm/hosting/verifiedThreads.js +46 -0
  219. package/dist/esm/hosting/verifiedThreads.js.map +1 -0
  220. package/dist/esm/index.d.ts +1 -0
  221. package/dist/esm/index.js +3 -0
  222. package/dist/esm/index.js.map +1 -1
  223. package/dist/esm/lib/humanizeLLMError.d.ts +15 -0
  224. package/dist/esm/lib/humanizeLLMError.js +22 -7
  225. package/dist/esm/lib/humanizeLLMError.js.map +1 -1
  226. package/dist/esm/mcp/throttleRetry.d.ts +51 -0
  227. package/dist/esm/mcp/throttleRetry.js +37 -4
  228. package/dist/esm/mcp/throttleRetry.js.map +1 -1
  229. package/dist/esm/memory/define.js +45 -1
  230. package/dist/esm/memory/define.js.map +1 -1
  231. package/dist/esm/memory/define.types.d.ts +24 -0
  232. package/dist/esm/memory/define.types.js.map +1 -1
  233. package/dist/esm/memory/stages/formatDefault.js +3 -1
  234. package/dist/esm/memory/stages/formatDefault.js.map +1 -1
  235. package/dist/esm/memory/store/InMemoryStore.d.ts +8 -3
  236. package/dist/esm/memory/store/InMemoryStore.js +12 -3
  237. package/dist/esm/memory/store/InMemoryStore.js.map +1 -1
  238. package/dist/esm/memory/store/index.d.ts +1 -0
  239. package/dist/esm/memory/store/index.js +5 -0
  240. package/dist/esm/memory/store/index.js.map +1 -1
  241. package/dist/esm/memory/store/types.d.ts +38 -4
  242. package/dist/esm/memory/store/writeOptions.d.ts +118 -0
  243. package/dist/esm/memory/store/writeOptions.js +242 -0
  244. package/dist/esm/memory/store/writeOptions.js.map +1 -0
  245. package/dist/esm/memory-providers.d.ts +1 -1
  246. package/dist/esm/memory-providers.js +4 -1
  247. package/dist/esm/memory-providers.js.map +1 -1
  248. package/dist/esm/patterns/MapReduce.js +8 -2
  249. package/dist/esm/patterns/MapReduce.js.map +1 -1
  250. package/dist/esm/tool-providers/index.d.ts +5 -0
  251. package/dist/esm/tool-providers/index.js +6 -0
  252. package/dist/esm/tool-providers/index.js.map +1 -1
  253. package/dist/esm/trace-toolpack/selfExplain.d.ts +8 -0
  254. package/dist/esm/trace-toolpack/selfExplain.js +25 -2
  255. package/dist/esm/trace-toolpack/selfExplain.js.map +1 -1
  256. package/dist/hosting/envelope.js +5 -0
  257. package/dist/hosting/envelope.js.map +1 -1
  258. package/dist/hosting/httpHost.js +5 -78
  259. package/dist/hosting/httpHost.js.map +1 -1
  260. package/dist/hosting/index.js +9 -3
  261. package/dist/hosting/index.js.map +1 -1
  262. package/dist/hosting/pendingAsk.js +42 -0
  263. package/dist/hosting/pendingAsk.js.map +1 -0
  264. package/dist/hosting/protocolAdapter.js +24 -0
  265. package/dist/hosting/protocolAdapter.js.map +1 -0
  266. package/dist/hosting/refusalStatus.js +84 -0
  267. package/dist/hosting/refusalStatus.js.map +1 -0
  268. package/dist/hosting/standingAgent.js +2 -32
  269. package/dist/hosting/standingAgent.js.map +1 -1
  270. package/dist/hosting/stream.js +35 -3
  271. package/dist/hosting/stream.js.map +1 -1
  272. package/dist/hosting/streamHandler.js +497 -0
  273. package/dist/hosting/streamHandler.js.map +1 -0
  274. package/dist/hosting/types.js.map +1 -1
  275. package/dist/hosting/verifiedThreads.js +50 -0
  276. package/dist/hosting/verifiedThreads.js.map +1 -0
  277. package/dist/index.js +9 -3
  278. package/dist/index.js.map +1 -1
  279. package/dist/lib/humanizeLLMError.js +23 -8
  280. package/dist/lib/humanizeLLMError.js.map +1 -1
  281. package/dist/mcp/throttleRetry.js +41 -6
  282. package/dist/mcp/throttleRetry.js.map +1 -1
  283. package/dist/memory/define.js +45 -1
  284. package/dist/memory/define.js.map +1 -1
  285. package/dist/memory/define.types.js.map +1 -1
  286. package/dist/memory/stages/formatDefault.js +3 -1
  287. package/dist/memory/stages/formatDefault.js.map +1 -1
  288. package/dist/memory/store/InMemoryStore.js +12 -3
  289. package/dist/memory/store/InMemoryStore.js.map +1 -1
  290. package/dist/memory/store/index.js +11 -1
  291. package/dist/memory/store/index.js.map +1 -1
  292. package/dist/memory/store/writeOptions.js +250 -0
  293. package/dist/memory/store/writeOptions.js.map +1 -0
  294. package/dist/memory-providers.js +4 -1
  295. package/dist/memory-providers.js.map +1 -1
  296. package/dist/patterns/MapReduce.js +8 -2
  297. package/dist/patterns/MapReduce.js.map +1 -1
  298. package/dist/tool-providers/index.js +10 -1
  299. package/dist/tool-providers/index.js.map +1 -1
  300. package/dist/trace-toolpack/selfExplain.js +25 -2
  301. package/dist/trace-toolpack/selfExplain.js.map +1 -1
  302. package/dist/types/adapters/mcp/agentcoreRuntime/errorType.d.ts +13 -0
  303. package/dist/types/adapters/mcp/agentcoreRuntime/errorType.d.ts.map +1 -0
  304. package/dist/types/adapters/mcp/agentcoreRuntime/invoke.d.ts +117 -0
  305. package/dist/types/adapters/mcp/agentcoreRuntime/invoke.d.ts.map +1 -0
  306. package/dist/types/adapters/mcp/agentcoreRuntime/safeAnswer.d.ts +50 -0
  307. package/dist/types/adapters/mcp/agentcoreRuntime/safeAnswer.d.ts.map +1 -0
  308. package/dist/types/adapters/mcp/agentcoreRuntime/session.d.ts +81 -0
  309. package/dist/types/adapters/mcp/agentcoreRuntime/session.d.ts.map +1 -0
  310. package/dist/types/adapters/mcp/agentcoreRuntime/sessionBusy.d.ts +62 -0
  311. package/dist/types/adapters/mcp/agentcoreRuntime/sessionBusy.d.ts.map +1 -0
  312. package/dist/types/adapters/mcp/agentcoreRuntime/strictJson.d.ts +38 -0
  313. package/dist/types/adapters/mcp/agentcoreRuntime/strictJson.d.ts.map +1 -0
  314. package/dist/types/adapters/mcp/agentcoreRuntime/transport.d.ts +177 -0
  315. package/dist/types/adapters/mcp/agentcoreRuntime/transport.d.ts.map +1 -0
  316. package/dist/types/adapters/memory/agentcore.d.ts +152 -7
  317. package/dist/types/adapters/memory/agentcore.d.ts.map +1 -1
  318. package/dist/types/adapters/memory/memoryBank.d.ts +3 -2
  319. package/dist/types/adapters/memory/memoryBank.d.ts.map +1 -1
  320. package/dist/types/adapters/memory/pgVector.d.ts.map +1 -1
  321. package/dist/types/adapters/memory/redis.d.ts +8 -3
  322. package/dist/types/adapters/memory/redis.d.ts.map +1 -1
  323. package/dist/types/adapters/memory/s3Vectors.d.ts.map +1 -1
  324. package/dist/types/adapters/memory/sqliteVector.d.ts.map +1 -1
  325. package/dist/types/ag-ui/adapter.d.ts +69 -0
  326. package/dist/types/ag-ui/adapter.d.ts.map +1 -0
  327. package/dist/types/ag-ui/framing.d.ts +52 -0
  328. package/dist/types/ag-ui/framing.d.ts.map +1 -0
  329. package/dist/types/ag-ui/frontendTools.d.ts +38 -0
  330. package/dist/types/ag-ui/frontendTools.d.ts.map +1 -0
  331. package/dist/types/ag-ui/ids.d.ts +44 -0
  332. package/dist/types/ag-ui/ids.d.ts.map +1 -0
  333. package/dist/types/ag-ui/index.d.ts +18 -0
  334. package/dist/types/ag-ui/index.d.ts.map +1 -0
  335. package/dist/types/ag-ui/request.d.ts +73 -0
  336. package/dist/types/ag-ui/request.d.ts.map +1 -0
  337. package/dist/types/ag-ui/serializer.d.ts +174 -0
  338. package/dist/types/ag-ui/serializer.d.ts.map +1 -0
  339. package/dist/types/ag-ui/types.d.ts +306 -0
  340. package/dist/types/ag-ui/types.d.ts.map +1 -0
  341. package/dist/types/core/Agent.d.ts +2 -0
  342. package/dist/types/core/Agent.d.ts.map +1 -1
  343. package/dist/types/core/RunnerBase.d.ts.map +1 -1
  344. package/dist/types/core/agent/buildAgentChart.d.ts.map +1 -1
  345. package/dist/types/core/agent/buildDynamicAgentChart.d.ts.map +1 -1
  346. package/dist/types/core/agent/callerIdentity.d.ts.map +1 -1
  347. package/dist/types/core/agent/stages/routeTurn.d.ts +1 -1
  348. package/dist/types/core/agent/stages/routeTurn.d.ts.map +1 -1
  349. package/dist/types/core/agent/stages/seed.d.ts +11 -1
  350. package/dist/types/core/agent/stages/seed.d.ts.map +1 -1
  351. package/dist/types/core/agent/stages/toolCalls.d.ts +11 -1
  352. package/dist/types/core/agent/stages/toolCalls.d.ts.map +1 -1
  353. package/dist/types/core/agent/types.d.ts +16 -6
  354. package/dist/types/core/agent/types.d.ts.map +1 -1
  355. package/dist/types/core/memberRun.d.ts +133 -0
  356. package/dist/types/core/memberRun.d.ts.map +1 -0
  357. package/dist/types/core/slots/buildToolsSlot.d.ts +1 -1
  358. package/dist/types/core/slots/buildToolsSlot.d.ts.map +1 -1
  359. package/dist/types/core-flow/Conditional.d.ts +8 -0
  360. package/dist/types/core-flow/Conditional.d.ts.map +1 -1
  361. package/dist/types/core-flow/Graph.d.ts.map +1 -1
  362. package/dist/types/core-flow/Loop.d.ts +8 -0
  363. package/dist/types/core-flow/Loop.d.ts.map +1 -1
  364. package/dist/types/core-flow/Parallel.d.ts +8 -0
  365. package/dist/types/core-flow/Parallel.d.ts.map +1 -1
  366. package/dist/types/core-flow/Sequence.d.ts +8 -0
  367. package/dist/types/core-flow/Sequence.d.ts.map +1 -1
  368. package/dist/types/core-flow/Workflow.d.ts.map +1 -1
  369. package/dist/types/doors/ag-ui.d.ts +20 -0
  370. package/dist/types/doors/ag-ui.d.ts.map +1 -0
  371. package/dist/types/hosting/httpHost.d.ts.map +1 -1
  372. package/dist/types/hosting/index.d.ts +4 -1
  373. package/dist/types/hosting/index.d.ts.map +1 -1
  374. package/dist/types/hosting/pendingAsk.d.ts +20 -0
  375. package/dist/types/hosting/pendingAsk.d.ts.map +1 -0
  376. package/dist/types/hosting/protocolAdapter.d.ts +230 -0
  377. package/dist/types/hosting/protocolAdapter.d.ts.map +1 -0
  378. package/dist/types/hosting/refusalStatus.d.ts +31 -0
  379. package/dist/types/hosting/refusalStatus.d.ts.map +1 -0
  380. package/dist/types/hosting/standingAgent.d.ts.map +1 -1
  381. package/dist/types/hosting/stream.d.ts +39 -0
  382. package/dist/types/hosting/stream.d.ts.map +1 -1
  383. package/dist/types/hosting/streamHandler.d.ts +135 -0
  384. package/dist/types/hosting/streamHandler.d.ts.map +1 -0
  385. package/dist/types/hosting/types.d.ts +15 -0
  386. package/dist/types/hosting/types.d.ts.map +1 -1
  387. package/dist/types/hosting/verifiedThreads.d.ts +30 -0
  388. package/dist/types/hosting/verifiedThreads.d.ts.map +1 -0
  389. package/dist/types/index.d.ts +1 -0
  390. package/dist/types/index.d.ts.map +1 -1
  391. package/dist/types/lib/humanizeLLMError.d.ts +15 -0
  392. package/dist/types/lib/humanizeLLMError.d.ts.map +1 -1
  393. package/dist/types/mcp/throttleRetry.d.ts +51 -0
  394. package/dist/types/mcp/throttleRetry.d.ts.map +1 -1
  395. package/dist/types/memory/define.d.ts.map +1 -1
  396. package/dist/types/memory/define.types.d.ts +24 -0
  397. package/dist/types/memory/define.types.d.ts.map +1 -1
  398. package/dist/types/memory/stages/formatDefault.d.ts.map +1 -1
  399. package/dist/types/memory/store/InMemoryStore.d.ts +8 -3
  400. package/dist/types/memory/store/InMemoryStore.d.ts.map +1 -1
  401. package/dist/types/memory/store/index.d.ts +1 -0
  402. package/dist/types/memory/store/index.d.ts.map +1 -1
  403. package/dist/types/memory/store/types.d.ts +38 -4
  404. package/dist/types/memory/store/types.d.ts.map +1 -1
  405. package/dist/types/memory/store/writeOptions.d.ts +119 -0
  406. package/dist/types/memory/store/writeOptions.d.ts.map +1 -0
  407. package/dist/types/memory-providers.d.ts +1 -1
  408. package/dist/types/memory-providers.d.ts.map +1 -1
  409. package/dist/types/patterns/MapReduce.d.ts.map +1 -1
  410. package/dist/types/tool-providers/index.d.ts +5 -0
  411. package/dist/types/tool-providers/index.d.ts.map +1 -1
  412. package/dist/types/trace-toolpack/selfExplain.d.ts +8 -0
  413. package/dist/types/trace-toolpack/selfExplain.d.ts.map +1 -1
  414. package/package.json +25 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoke.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/mcp/agentcoreRuntime/invoke.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAMnE,iFAAiF;AACjF,MAAM,WAAW,yBAAyB;IACxC,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACnF;AAED,8EAA8E;AAC9E,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,sBAAsB,CAAC,EAAE,KAAK,MAAM,EAAE;QAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,KAAK,yBAAyB,CAAC;IAChC,QAAQ,CAAC,yBAAyB,CAAC,EAAE,KAAK,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;CACtE;AAED,sEAAsE;AACtE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,mFAAmF;AACnF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,yBAAyB,CAAC;IAC5C,0EAA0E;IAC1E,QAAQ,CAAC,GAAG,CAAC,EAAE,gCAAgC,CAAC;CACjD;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG;IACpD,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC;IAC3C,QAAQ,CAAC,yBAAyB,EAAE,KAAK,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;CACrE,CAqBA;AAqCD;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,yBAAyB,EACjC,yBAAyB,EAAE,KAAK,KAAK,EAAE,OAAO,KAAK,OAAO,GACzD,aAAa,CA+Bf"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * safeAnswer — what the MCP client may read of an answer: read ONCE, checked,
3
+ * and handed on as the canonical form of exactly what was checked.
4
+ *
5
+ * ── Why an allow-list ────────────────────────────────────────────────────────
6
+ * Whatever an answer's body says becomes the MCP client's error text, and a
7
+ * failed tool call hands that text to the model, the run's history and
8
+ * `tool_end`. Service text can carry anything the request did: AWS answers a
9
+ * signature mismatch with the whole signed request (the session token among
10
+ * it), its validation errors quote the value they refused, a proxy may echo a
11
+ * header. So a failure is RE-WRITTEN from parts that cannot carry a secret:
12
+ * the status; the AWS error type when it is a plain name; `Retry-After` when
13
+ * it is seconds or a date; and for a JSON-RPC error its integer `code`, the
14
+ * client's own `id`, and its `message` ONLY when it is one of the fixed
15
+ * sentences the MCP SDK and the AgentCore Runtime contract use
16
+ * ({@link KNOWN_ERROR_MESSAGES}).
17
+ *
18
+ * ── Why one reading ──────────────────────────────────────────────────────────
19
+ * A check that reads a body one way and a client that reads the same bytes
20
+ * another is a parser differential: a crafted answer passes the check and is
21
+ * used as something else. So a 2xx answer is never handed on as its raw bytes.
22
+ * It is classified by ONE rule (its media type, exactly `application/json` or
23
+ * `text/event-stream`, UTF-8), decoded strictly, parsed once
24
+ * (`strictJson.ts` — a duplicated key, trailing data or a byte-order mark is
25
+ * refused), checked, and RE-SERIALIZED: the client reads the value that was
26
+ * checked, never the bytes it came from. One message per body or event — a
27
+ * batch is refused. An answer that cannot be read unambiguously is refused by
28
+ * name, as a 502 whose text is this library's.
29
+ *
30
+ * Pattern: pure functions + one TransformStream. Role: outer ring, the
31
+ * transport's one rule for what the client reads.
32
+ */
33
+ /**
34
+ * JSON-RPC error messages a reply may keep word for word — fixed strings that
35
+ * carry nothing of the request: the JSON-RPC 2.0 standard errors, the MCP
36
+ * Streamable HTTP session error, and the AgentCore Runtime MCP contract's
37
+ * mappings of its exceptions.
38
+ */
39
+ export declare const KNOWN_ERROR_MESSAGES: ReadonlySet<string>;
40
+ /** Is this answer an authentication or authorization failure? */
41
+ export declare function isAuthFailure(status: number, type: string | undefined): boolean;
42
+ /**
43
+ * The answer the MCP client may read: a failure rewritten from safe parts; a
44
+ * 2xx read once and re-serialized; an answer that cannot be read
45
+ * unambiguously refused (502).
46
+ */
47
+ export declare function safeAnswer(response: Response): Promise<Response>;
48
+ /** The fixed sentence a failure with no JSON-RPC reply is answered with. */
49
+ export declare function failureSentence(status: number, type: string | undefined): string;
50
+ //# sourceMappingURL=safeAnswer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safeAnswer.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/mcp/agentcoreRuntime/safeAnswer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAKH;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,MAAM,CAanD,CAAC;AAqCH,iEAAiE;AACjE,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAG/E;AAED;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAQtE;AAoID,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAYhF"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * session — the session strategies: which AgentCore Runtime session a request
3
+ * lands in.
4
+ *
5
+ * ── The facts they rest on ───────────────────────────────────────────────────
6
+ * From the AgentCore Runtime MCP protocol contract and the `InvokeAgentRuntime`
7
+ * API reference:
8
+ *
9
+ * - The runtime routes by `Mcp-Session-Id` and always returns one. A client
10
+ * "must capture the Mcp-Session-Id returned in the response and include it
11
+ * in all subsequent requests" for microVM affinity; without it "each request
12
+ * may be routed to a new microVM".
13
+ * - `InvokeAgentRuntime` also carries `runtimeSessionId`
14
+ * (`X-Amzn-Bedrock-AgentCore-Runtime-Session-Id`, 33–256 characters), and
15
+ * the AWS SDK models it as an idempotency token — it fills a FRESH random id
16
+ * on every call that leaves it unset.
17
+ *
18
+ * ── 'per-call' (the default) ─────────────────────────────────────────────────
19
+ * Every request in a session of its own: this strategy sends a FRESH runtime
20
+ * session id with every request and no `Mcp-Session-Id`, and the
21
+ * `Mcp-Session-Id` a response carries is not handed to the MCP client, so
22
+ * nothing can carry one call's session into the next. Isolation by
23
+ * construction: a client shared by every user of a process (tools built once at
24
+ * startup — the common shape) never puts two users in one microVM. The price is
25
+ * a cold start per call, and it needs a STATELESS server (`stateless_http=True`,
26
+ * the runtime's recommended default) — a stateful one sees every request as a
27
+ * stranger.
28
+ *
29
+ * ── 'reuse' ──────────────────────────────────────────────────────────────────
30
+ * One session per CONNECTION (per `mcpClient` built on the transport), and the
31
+ * TRANSPORT owns the key. A request with no `Mcp-Session-Id` (a client's
32
+ * `initialize`) opens a connection with a fresh runtime session id; the
33
+ * `Mcp-Session-Id` the server returns for it is stored WITH that connection,
34
+ * and the client is handed an opaque handle of the transport's own in its
35
+ * place. Every later request carrying the handle is sent in that connection's
36
+ * runtime session with the server's own id; a handle the transport does not
37
+ * know is answered 404 "Session not found" here, never sent.
38
+ *
39
+ * Why a handle and not the server's id: the server's ids are unique only as far
40
+ * as the server makes them. One that numbers sessions per process hands every
41
+ * fresh microVM the same first id, and a map keyed by it would send the second
42
+ * client into the first one's microVM. A handle is ours, random, and per
43
+ * connection, so two clients on one transport are two sessions whatever the
44
+ * server returns — while ONE client is still one session for whoever calls
45
+ * through it. Build a client per conversation; never share a 'reuse' client
46
+ * between users.
47
+ *
48
+ * At most {@link MAX_CONNECTIONS} connections are remembered, least recently
49
+ * used forgotten first; a client's `DELETE` (its `close()`) forgets its own.
50
+ *
51
+ * Pattern: Strategy. Role: outer ring, vendor fact. Holds no credential.
52
+ */
53
+ /** The runtime session header, as `InvokeAgentRuntime` binds `runtimeSessionId` to it. */
54
+ export declare const AGENTCORE_RUNTIME_SESSION_HEADER = "X-Amzn-Bedrock-AgentCore-Runtime-Session-Id";
55
+ /** The MCP Streamable HTTP session header. */
56
+ export declare const MCP_SESSION_HEADER = "Mcp-Session-Id";
57
+ /** Which session a request lands in. See the module note for each. */
58
+ export type AgentCoreRuntimeSession = 'reuse' | 'per-call';
59
+ /**
60
+ * What a strategy does with one request: either answer it here, unsent, or
61
+ * let it go — with its session headers fixed in place — and say what the MCP
62
+ * client may see of the response.
63
+ */
64
+ export type SessionStep = {
65
+ readonly answer: Response;
66
+ } | {
67
+ readonly settle: (response: Response) => Response;
68
+ };
69
+ /** One strategy, applied once per request the MCP client makes. */
70
+ export interface SessionStrategy {
71
+ request(headers: Headers, method: string): SessionStep;
72
+ }
73
+ /** How many connections a 'reuse' transport remembers before it forgets the least recently used. */
74
+ export declare const MAX_CONNECTIONS = 256;
75
+ /**
76
+ * Build the strategy for one transport.
77
+ *
78
+ * @throws when `kind` is not one of the two strategies.
79
+ */
80
+ export declare function sessionStrategy(kind: AgentCoreRuntimeSession): SessionStrategy;
81
+ //# sourceMappingURL=session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/mcp/agentcoreRuntime/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH,0FAA0F;AAC1F,eAAO,MAAM,gCAAgC,gDAAgD,CAAC;AAE9F,8CAA8C;AAC9C,eAAO,MAAM,kBAAkB,mBAAmB,CAAC;AAEnD,sEAAsE;AACtE,MAAM,MAAM,uBAAuB,GAAG,OAAO,GAAG,UAAU,CAAC;AAE3D;;;;GAIG;AACH,MAAM,MAAM,WAAW,GACnB;IAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAA;CAAE,GAC7B;IAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,QAAQ,CAAA;CAAE,CAAC;AAE1D,mEAAmE;AACnE,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAAC;CACxD;AAED,oGAAoG;AACpG,eAAO,MAAM,eAAe,MAAM,CAAC;AAUnC;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,uBAAuB,GAAG,eAAe,CAQ9E"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * sessionBusy — the retry strategy: AgentCore Runtime's "session operation in
3
+ * progress", recognised. One small function, on purpose.
4
+ *
5
+ * ── What the service says, in its own words ──────────────────────────────────
6
+ * The AgentCore Runtime MCP protocol contract maps the runtime's exceptions onto
7
+ * JSON-RPC errors, and exactly one of them is retryable by design:
8
+ *
9
+ * -32005 RetryableConflictException HTTP 200 "Session operation in progress, please retry"
10
+ *
11
+ * returned "when a second operation targets a session while the service is
12
+ * provisioning or tearing down that session. Because MCP returns HTTP 200 with
13
+ * the error in the JSON-RPC body, the caller must inspect the response body and
14
+ * retry with short exponential backoff — MCP clients do not auto-retry it."
15
+ *
16
+ * So no status code says it, and the MCP SDK will not wait for it: left alone,
17
+ * it reaches the model as a failed tool call, a moment after the session it was
18
+ * waiting for came up.
19
+ *
20
+ * ── Why asking again is safe ─────────────────────────────────────────────────
21
+ * The refusal is the PLATFORM's, about the session, made before the request
22
+ * reached the MCP server: nothing ran. That is the license a 429 holds, and the
23
+ * only one `retryingFetchWhen` accepts (see `mcp/throttleRetry.ts` ·
24
+ * `RetryDecision`).
25
+ *
26
+ * ── What it must NOT match ───────────────────────────────────────────────────
27
+ * `ConflictException` shares the code -32005 ("Resource conflict - Resource
28
+ * already exists") and is not retryable; the contract tells the two apart only
29
+ * by the message, so the message is part of the match. Anything else — another
30
+ * status, an SSE stream, a batch reply, a body that is not JSON — is delivered
31
+ * as it is.
32
+ *
33
+ * ── The API-layer form ───────────────────────────────────────────────────────
34
+ * `InvokeAgentRuntime`'s API reference gives the same exception as an HTTP 409,
35
+ * its type in the `x-amzn-errortype` header (the REST protocol's error-type
36
+ * header; the SigV4 strategy rebuilds exactly that from the SDK's exception,
37
+ * because the transport's SDK client has its own retry off). It is the same
38
+ * refusal, so it is the same decision — matched by the type, never by the 409
39
+ * alone.
40
+ *
41
+ * Pattern: Strategy (a `RetryDecision`). Role: outer ring, vendor fact.
42
+ */
43
+ import type { RetryVerdict } from '../../../mcp/throttleRetry.js';
44
+ /** The JSON-RPC error code the contract gives `RetryableConflictException`. */
45
+ export declare const SESSION_BUSY_CODE = -32005;
46
+ /**
47
+ * Is this response AgentCore Runtime's session-busy refusal — in either form:
48
+ * the MCP contract's HTTP 200 with JSON-RPC -32005, or the API's 409
49
+ * `RetryableConflictException`?
50
+ *
51
+ * Reads a CLONE of the body, so the response is delivered intact either way.
52
+ * Answers `{}` (wait the loop's own backoff, then send the same request again)
53
+ * or `undefined` (deliver it).
54
+ */
55
+ export declare function sessionBusy(response: Response): Promise<RetryVerdict | undefined>;
56
+ /**
57
+ * The match itself, over a parsed body: ONE JSON-RPC reply whose error carries
58
+ * the contract's code and message. A batch is never retried whole — some of
59
+ * its replies may be the record of work that ran.
60
+ */
61
+ export declare function isSessionBusyReply(body: unknown): boolean;
62
+ //# sourceMappingURL=sessionBusy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sessionBusy.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/mcp/agentcoreRuntime/sessionBusy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAGlE,+EAA+E;AAC/E,eAAO,MAAM,iBAAiB,SAAS,CAAC;AAYxC;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAsBvF;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAQzD"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * strictJson — ONE reading of a JSON text, with every ambiguity refused.
3
+ *
4
+ * `JSON.parse` resolves ambiguity silently: a duplicated key keeps its LAST
5
+ * value, while another reader may keep the first. A check that reads a body one
6
+ * way and a consumer that reads it another is a parser differential — a crafted
7
+ * answer passes the check and is used as something else. So the transport reads
8
+ * an answer once, here, refusing what two readers could disagree on, and hands
9
+ * the client the canonical re-serialization of exactly the value it checked.
10
+ *
11
+ * Refused, by name: a duplicated object key, trailing data after the value, a
12
+ * leading byte-order mark, nesting deeper than {@link MAX_DEPTH}, a number
13
+ * out of range (its re-serialization would be `null`), and anything that is
14
+ * not RFC 8259 JSON.
15
+ *
16
+ * Objects are built with own properties only (a `__proto__` key is data, never
17
+ * a prototype).
18
+ *
19
+ * Pattern: recursive-descent parser. Role: outer ring, the one reader.
20
+ */
21
+ /** Why a text was refused. */
22
+ export declare class AmbiguousJsonError extends Error {
23
+ readonly reason: string;
24
+ constructor(reason: string);
25
+ }
26
+ /** How deep a value may nest. */
27
+ export declare const MAX_DEPTH = 256;
28
+ /** A JSON value, as read. */
29
+ export type JsonValue = null | boolean | number | string | readonly JsonValue[] | {
30
+ readonly [key: string]: JsonValue;
31
+ };
32
+ /**
33
+ * The one value `text` holds.
34
+ *
35
+ * @throws AmbiguousJsonError when the text is not exactly one unambiguous value.
36
+ */
37
+ export declare function parseStrictJson(text: string): JsonValue;
38
+ //# sourceMappingURL=strictJson.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strictJson.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/mcp/agentcoreRuntime/strictJson.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,8BAA8B;AAC9B,qBAAa,kBAAmB,SAAQ,KAAK;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM;CAIpC;AAED,iCAAiC;AACjC,eAAO,MAAM,SAAS,MAAM,CAAC;AAE7B,6BAA6B;AAC7B,MAAM,MAAM,SAAS,GACjB,IAAI,GACJ,OAAO,GACP,MAAM,GACN,MAAM,GACN,SAAS,SAAS,EAAE,GACpB;IAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAE1C;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAQvD"}
@@ -0,0 +1,177 @@
1
+ /**
2
+ * agentCoreRuntimeMcpTransport — an MCP server hosted on AWS Bedrock
3
+ * **AgentCore Runtime**, reached as an ordinary MCP transport.
4
+ *
5
+ * const orders = await mcpClient({
6
+ * name: 'orders',
7
+ * transport: agentCoreRuntimeMcpTransport({
8
+ * agentRuntimeArn: 'arn:aws:bedrock-agentcore:us-west-2:123456789012:runtime/orders_mcp-a1b2c3',
9
+ * region: 'us-west-2',
10
+ * }),
11
+ * });
12
+ *
13
+ * ── Why this exists ──────────────────────────────────────────────────────────
14
+ * `agentCoreGatewayTransport` reaches a Gateway; `agentCoreRuntimeHost` hosts
15
+ * OUR agent on Runtime. Neither calls an MCP server somebody deployed TO
16
+ * Runtime, and that server is not reachable as a plain URL: every request goes
17
+ * through `InvokeAgentRuntime`, it lands in a runtime SESSION that has to be
18
+ * carried from call to call, and the platform answers a request that arrives
19
+ * while that session is still coming up with an HTTP 200 whose body says
20
+ * "Session operation in progress, please retry" — which no MCP client retries.
21
+ *
22
+ * ── What it is: one port, three strategies ───────────────────────────────────
23
+ * The port is the existing one: this returns an `http` member of
24
+ * `McpTransport`, so `mcpClient` builds it like any other Streamable HTTP
25
+ * server and knows nothing about AgentCore. Everything AgentCore-specific sits
26
+ * in the `fetch` it carries, composed from three choices, one file each:
27
+ *
28
+ * session (`session.ts`) 'per-call' (the default: a session per request),
29
+ * or 'reuse' (one session per MCP client, keyed by
30
+ * a handle the transport issues)
31
+ * retry (`sessionBusy.ts`) the session-busy refusal, retried with bounded
32
+ * backoff by the SAME loop `mcpClient` uses for a
33
+ * 429 (`mcp/throttleRetry.ts` · `retryingFetchWhen`)
34
+ * auth (`invoke.ts`) 'sigv4' through the AWS SDK's InvokeAgentRuntime,
35
+ * or a bearer token over the documented HTTPS
36
+ * endpoint — the SDK has no bearer scheme, and the
37
+ * API reference says an OAuth caller must use HTTPS
38
+ *
39
+ * in that order, outermost first: the session is applied once per request, so
40
+ * every attempt of it lands in the same runtime session, and every attempt is
41
+ * signed (or vended) afresh, the ordering `mcp/throttleRetry.ts` requires.
42
+ * What the MCP client reads of a failure is rewritten from the library's own
43
+ * fixed sentences and safe ids (`safeAnswer.ts`), never the service's text.
44
+ * `mcpClient`'s own 429 retry still wraps the whole thing.
45
+ *
46
+ * ── What it does NOT do ──────────────────────────────────────────────────────
47
+ * Deploy or manage a runtime (a control-plane job), or host one (that is
48
+ * `agentCoreRuntimeHost`). This is the CLIENT side of a server somebody already
49
+ * deployed with `--protocol MCP`.
50
+ *
51
+ * Pattern: Facade over three Strategies. Role: outer ring, vendor adapter.
52
+ */
53
+ import { type FetchLike } from '../../../mcp/gatewayTransport.js';
54
+ import { type ThrottleRetryOptions } from '../../../mcp/throttleRetry.js';
55
+ import type { McpHttpTransport } from '../../../mcp/types.js';
56
+ import type { CredentialProvider } from '../../../identity/types.js';
57
+ import { type AgentCoreRuntimeSdkClient, type BedrockAgentCoreRuntimeSdkModule } from './invoke.js';
58
+ import { type AgentCoreRuntimeSession } from './session.js';
59
+ /**
60
+ * A bearer token, for a runtime whose inbound auth is OAuth (a JWT authorizer).
61
+ *
62
+ * Vended PER REQUEST by the provider — the same once-and-dropped rule as
63
+ * `gatewayTransport`, through the same code.
64
+ */
65
+ export interface AgentCoreRuntimeBearerAuth {
66
+ /** Who vends the token. `agentCoreIdentity()` or any `CredentialProvider`. */
67
+ readonly bearer: CredentialProvider;
68
+ /** The downstream service id your provider keys on. Default `'runtime'`. */
69
+ readonly service?: string;
70
+ /** OAuth scopes, when the provider uses them. */
71
+ readonly scopes?: readonly string[];
72
+ /**
73
+ * `'machine'` (2-legged), the only mode. `'user'` is refused: the transport
74
+ * asks for its token without naming any user, so a user-delegated token
75
+ * would be sent for whoever calls through the client. For a token per user,
76
+ * build a transport per user whose provider vends that user's token.
77
+ */
78
+ readonly mode?: 'machine';
79
+ /**
80
+ * Your own `fetch`, called UNDERNEATH the per-request vending — an HTTP
81
+ * agent, a proxy. It sees the final headers, the vended one included.
82
+ */
83
+ readonly fetch?: FetchLike;
84
+ }
85
+ /**
86
+ * How requests are authenticated — the runtime's inbound auth decides which.
87
+ *
88
+ * - `'sigv4'` — IAM. The AWS SDK signs `InvokeAgentRuntime` with your AWS
89
+ * credentials (the default chain, or the `client` you pass).
90
+ * - `{ bearer }` — OAuth. A plain HTTPS request with `Authorization: Bearer`,
91
+ * because the SDK cannot send a bearer token.
92
+ */
93
+ export type AgentCoreRuntimeAuth = 'sigv4' | AgentCoreRuntimeBearerAuth;
94
+ /**
95
+ * The session-busy retry: the same ceilings and the same `onRetry` report as
96
+ * `mcpClient`'s `retryOnThrottle`, applied to AgentCore's own refusal.
97
+ */
98
+ export type AgentCoreRuntimeRetryOptions = ThrottleRetryOptions;
99
+ /** Options for {@link agentCoreRuntimeMcpTransport}. */
100
+ export interface AgentCoreRuntimeMcpTransportOptions {
101
+ /**
102
+ * The runtime hosting the MCP server — its ARN, as `agentcore deploy` prints
103
+ * it, or its id together with {@link accountId}.
104
+ */
105
+ readonly agentRuntimeArn: string;
106
+ /** The region it runs in, e.g. `'us-west-2'`. */
107
+ readonly region: string;
108
+ /** The endpoint (version) to invoke. The runtime's default endpoint when omitted. */
109
+ readonly qualifier?: string;
110
+ /** The owning account — required by AgentCore when `agentRuntimeArn` is an id, not an ARN. */
111
+ readonly accountId?: string;
112
+ /** How requests are authenticated. Default `'sigv4'`. */
113
+ readonly auth?: AgentCoreRuntimeAuth;
114
+ /**
115
+ * Which runtime session each request lands in. Default `'per-call'`.
116
+ *
117
+ * - `'per-call'` — every request in a session of its own; nothing carries
118
+ * over, so one client can serve every user of a process. Needs a
119
+ * stateless server (the runtime's recommended default).
120
+ * - `'reuse'` — one session per CLIENT: each `mcpClient` built on this
121
+ * transport keeps its own runtime session for its life. **Build one
122
+ * client per conversation**: a client shared by two users is one
123
+ * session — one microVM, one server state — for both.
124
+ */
125
+ readonly session?: AgentCoreRuntimeSession;
126
+ /**
127
+ * Retry AgentCore's "session operation in progress" refusal — the MCP
128
+ * contract's HTTP 200 with JSON-RPC -32005, or the API's 409
129
+ * `RetryableConflictException`. On by default: up to 5 attempts, never more
130
+ * than 10 s of waiting in total, jittered exponential backoff. `false` lets
131
+ * the refusal through on the first attempt.
132
+ *
133
+ * Nothing else is retried here: a 429 goes to `mcpClient`'s own throttle
134
+ * retry, and a 5xx, a dropped connection or any other JSON-RPC error
135
+ * (throttling's -32003 included) is delivered as it is — it may be the
136
+ * record of work that ran.
137
+ */
138
+ readonly retry?: boolean | AgentCoreRuntimeRetryOptions;
139
+ /**
140
+ * SigV4 only: a `BedrockAgentCoreClient` you built, so its credentials,
141
+ * region and retry settings are the ones used. Refused with `{ bearer }`.
142
+ *
143
+ * **Build it with `maxAttempts: 1`.** The client this transport builds has
144
+ * the SDK's own retry off, because the SDK's standard policy re-sends a call
145
+ * after a 5xx or a dropped connection — work that may already have run. Your
146
+ * client keeps whatever policy you gave it.
147
+ */
148
+ readonly client?: AgentCoreRuntimeSdkClient;
149
+ /** @internal Test injection — the AWS SDK module. */
150
+ readonly _sdk?: BedrockAgentCoreRuntimeSdkModule;
151
+ }
152
+ /**
153
+ * An MCP transport for a server hosted on AgentCore Runtime.
154
+ *
155
+ * @throws when the runtime or region is missing, when a strategy is unknown,
156
+ * when `client` is given beside `{ bearer }`, or — for `'sigv4'` — when the
157
+ * AWS SDK peer dependency cannot be loaded.
158
+ */
159
+ export declare function agentCoreRuntimeMcpTransport(options: AgentCoreRuntimeMcpTransportOptions): McpHttpTransport;
160
+ /** Where a runtime's MCP endpoint is, as {@link agentCoreRuntimeUrl} needs it. */
161
+ export interface AgentCoreRuntimeUrlOptions {
162
+ readonly agentRuntimeArn: string;
163
+ readonly region: string;
164
+ readonly qualifier?: string;
165
+ readonly accountId?: string;
166
+ }
167
+ /**
168
+ * The HTTPS endpoint of a runtime's MCP server:
169
+ * `https://bedrock-agentcore.{region}.amazonaws.com/runtimes/{url-encoded ARN}/invocations`,
170
+ * with `qualifier` / `accountId` as query parameters when given — the request
171
+ * line of `InvokeAgentRuntime`, and the URL AgentCore's own MCP examples dial.
172
+ *
173
+ * @throws when `agentRuntimeArn` or `region` is missing, or the region is not
174
+ * shaped like one (it becomes part of a hostname).
175
+ */
176
+ export declare function agentCoreRuntimeUrl(options: AgentCoreRuntimeUrlOptions): string;
177
+ //# sourceMappingURL=transport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/mcp/agentcoreRuntime/transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH,OAAO,EAGL,KAAK,SAAS,EACf,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAGL,KAAK,yBAAyB,EAC9B,KAAK,gCAAgC,EACtC,MAAM,aAAa,CAAC;AAErB,OAAO,EAAmB,KAAK,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAG7E;;;;;GAKG;AACH,MAAM,WAAW,0BAA0B;IACzC,8EAA8E;IAC9E,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,iDAAiD;IACjD,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;CAC5B;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,0BAA0B,CAAC;AAExE;;;GAGG;AACH,MAAM,MAAM,4BAA4B,GAAG,oBAAoB,CAAC;AAEhE,wDAAwD;AACxD,MAAM,WAAW,mCAAmC;IAClD;;;OAGG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,qFAAqF;IACrF,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,8FAA8F;IAC9F,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,yDAAyD;IACzD,QAAQ,CAAC,IAAI,CAAC,EAAE,oBAAoB,CAAC;IACrC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,uBAAuB,CAAC;IAC3C;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,4BAA4B,CAAC;IACxD;;;;;;;;OAQG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,yBAAyB,CAAC;IAC5C,qDAAqD;IACrD,QAAQ,CAAC,IAAI,CAAC,EAAE,gCAAgC,CAAC;CAClD;AAWD;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,mCAAmC,GAC3C,gBAAgB,CAqBlB;AAED,kFAAkF;AAClF,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,MAAM,CAuB/E"}