@strands-agents/sdk 1.7.0 → 1.9.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 (686) hide show
  1. package/dist/src/agent/agent.d.ts +32 -2
  2. package/dist/src/agent/agent.d.ts.map +1 -1
  3. package/dist/src/agent/agent.js +92 -4
  4. package/dist/src/agent/agent.js.map +1 -1
  5. package/dist/src/context-manager/modes/agentic/agentic-context.d.ts +3 -3
  6. package/dist/src/context-manager/modes/agentic/agentic-context.d.ts.map +1 -1
  7. package/dist/src/conversation-manager/sliding-window-conversation-manager.d.ts.map +1 -1
  8. package/dist/src/conversation-manager/sliding-window-conversation-manager.js +2 -0
  9. package/dist/src/conversation-manager/sliding-window-conversation-manager.js.map +1 -1
  10. package/dist/src/errors.d.ts +7 -0
  11. package/dist/src/errors.d.ts.map +1 -1
  12. package/dist/src/errors.js +10 -0
  13. package/dist/src/errors.js.map +1 -1
  14. package/dist/src/experimental/checkpoint.d.ts +118 -0
  15. package/dist/src/experimental/checkpoint.d.ts.map +1 -0
  16. package/dist/src/experimental/checkpoint.js +108 -0
  17. package/dist/src/experimental/checkpoint.js.map +1 -0
  18. package/dist/src/experimental/index.d.ts +10 -0
  19. package/dist/src/experimental/index.d.ts.map +1 -0
  20. package/dist/src/experimental/index.js +9 -0
  21. package/dist/src/experimental/index.js.map +1 -0
  22. package/dist/src/index.d.ts +1 -1
  23. package/dist/src/index.d.ts.map +1 -1
  24. package/dist/src/index.js +1 -1
  25. package/dist/src/index.js.map +1 -1
  26. package/dist/src/index.node.d.ts.map +1 -1
  27. package/dist/src/index.node.js +3 -0
  28. package/dist/src/index.node.js.map +1 -1
  29. package/dist/src/injection/message-injection.d.ts.map +1 -1
  30. package/dist/src/injection/message-injection.js +2 -0
  31. package/dist/src/injection/message-injection.js.map +1 -1
  32. package/dist/src/interventions/actions.d.ts.map +1 -1
  33. package/dist/src/interventions/actions.js.map +1 -1
  34. package/dist/src/{mcp.d.ts → mcp/client.d.ts} +13 -4
  35. package/dist/src/mcp/client.d.ts.map +1 -0
  36. package/dist/src/{mcp.js → mcp/client.js} +15 -3
  37. package/dist/src/mcp/client.js.map +1 -0
  38. package/dist/src/mcp/config.d.ts +52 -0
  39. package/dist/src/mcp/config.d.ts.map +1 -0
  40. package/dist/src/mcp/config.js +12 -0
  41. package/dist/src/mcp/config.js.map +1 -0
  42. package/dist/src/mcp/config.node.d.ts +16 -0
  43. package/dist/src/mcp/config.node.d.ts.map +1 -0
  44. package/dist/src/mcp/config.node.js +145 -0
  45. package/dist/src/mcp/config.node.js.map +1 -0
  46. package/dist/src/mcp/index.d.ts +3 -0
  47. package/dist/src/mcp/index.d.ts.map +1 -0
  48. package/dist/src/mcp/index.js +2 -0
  49. package/dist/src/mcp/index.js.map +1 -0
  50. package/dist/src/models/model.d.ts.map +1 -1
  51. package/dist/src/models/model.js +2 -1
  52. package/dist/src/models/model.js.map +1 -1
  53. package/dist/src/multiagent/graph.d.ts +7 -0
  54. package/dist/src/multiagent/graph.d.ts.map +1 -1
  55. package/dist/src/multiagent/graph.js +22 -1
  56. package/dist/src/multiagent/graph.js.map +1 -1
  57. package/dist/src/multiagent/multiagent.d.ts +2 -1
  58. package/dist/src/multiagent/multiagent.d.ts.map +1 -1
  59. package/dist/src/multiagent/multiagent.js.map +1 -1
  60. package/dist/src/multiagent/nodes.d.ts +5 -0
  61. package/dist/src/multiagent/nodes.d.ts.map +1 -1
  62. package/dist/src/multiagent/nodes.js +15 -0
  63. package/dist/src/multiagent/nodes.js.map +1 -1
  64. package/dist/src/multiagent/state.d.ts.map +1 -1
  65. package/dist/src/multiagent/state.js.map +1 -1
  66. package/dist/src/tools/function-tool.d.ts +1 -1
  67. package/dist/src/tools/function-tool.d.ts.map +1 -1
  68. package/dist/src/tools/function-tool.js +4 -12
  69. package/dist/src/tools/function-tool.js.map +1 -1
  70. package/dist/src/tools/mcp-tool.d.ts +2 -1
  71. package/dist/src/tools/mcp-tool.d.ts.map +1 -1
  72. package/dist/src/tools/mcp-tool.js +1 -0
  73. package/dist/src/tools/mcp-tool.js.map +1 -1
  74. package/dist/src/tools/tool-factory.d.ts +1 -1
  75. package/dist/src/tools/tool-factory.d.ts.map +1 -1
  76. package/dist/src/tools/types.d.ts +4 -0
  77. package/dist/src/tools/types.d.ts.map +1 -1
  78. package/dist/src/tools/zod-tool.d.ts +4 -2
  79. package/dist/src/tools/zod-tool.d.ts.map +1 -1
  80. package/dist/src/tools/zod-tool.js.map +1 -1
  81. package/dist/src/tsconfig.tsbuildinfo +1 -1
  82. package/dist/src/types/agent.d.ts +18 -1
  83. package/dist/src/types/agent.d.ts.map +1 -1
  84. package/dist/src/types/agent.js +12 -0
  85. package/dist/src/types/agent.js.map +1 -1
  86. package/dist/src/types/media.d.ts.map +1 -1
  87. package/dist/src/types/media.js.map +1 -1
  88. package/dist/src/types/messages.d.ts +22 -1
  89. package/dist/src/types/messages.d.ts.map +1 -1
  90. package/dist/src/types/messages.js +22 -0
  91. package/dist/src/types/messages.js.map +1 -1
  92. package/dist/src/vended-memory-stores/test-memory-store/index.d.ts +2 -0
  93. package/dist/src/vended-memory-stores/test-memory-store/index.d.ts.map +1 -0
  94. package/dist/src/vended-memory-stores/test-memory-store/index.js +2 -0
  95. package/dist/src/vended-memory-stores/test-memory-store/index.js.map +1 -0
  96. package/dist/src/vended-memory-stores/test-memory-store/store.d.ts +122 -0
  97. package/dist/src/vended-memory-stores/test-memory-store/store.d.ts.map +1 -0
  98. package/dist/src/vended-memory-stores/test-memory-store/store.js +281 -0
  99. package/dist/src/vended-memory-stores/test-memory-store/store.js.map +1 -0
  100. package/dist/src/vended-plugins/context-offloader/search.d.ts.map +1 -1
  101. package/dist/src/vended-plugins/context-offloader/search.js +4 -2
  102. package/dist/src/vended-plugins/context-offloader/search.js.map +1 -1
  103. package/dist/src/vended-plugins/context-offloader/storage.js +1 -1
  104. package/dist/src/vended-plugins/context-offloader/storage.js.map +1 -1
  105. package/dist/src/vended-plugins/skills/skill.d.ts.map +1 -1
  106. package/dist/src/vended-plugins/skills/skill.js.map +1 -1
  107. package/dist/src/vended-tools/notebook/notebook.d.ts +1 -1
  108. package/package.json +41 -30
  109. package/dist/src/__fixtures__/agent-helpers.d.ts +0 -136
  110. package/dist/src/__fixtures__/agent-helpers.d.ts.map +0 -1
  111. package/dist/src/__fixtures__/agent-helpers.js +0 -156
  112. package/dist/src/__fixtures__/agent-helpers.js.map +0 -1
  113. package/dist/src/__fixtures__/environment.d.ts +0 -12
  114. package/dist/src/__fixtures__/environment.d.ts.map +0 -1
  115. package/dist/src/__fixtures__/environment.js +0 -12
  116. package/dist/src/__fixtures__/environment.js.map +0 -1
  117. package/dist/src/__fixtures__/metrics-helpers.d.ts +0 -55
  118. package/dist/src/__fixtures__/metrics-helpers.d.ts.map +0 -1
  119. package/dist/src/__fixtures__/metrics-helpers.js +0 -57
  120. package/dist/src/__fixtures__/metrics-helpers.js.map +0 -1
  121. package/dist/src/__fixtures__/mock-message-model.d.ts +0 -103
  122. package/dist/src/__fixtures__/mock-message-model.d.ts.map +0 -1
  123. package/dist/src/__fixtures__/mock-message-model.js +0 -245
  124. package/dist/src/__fixtures__/mock-message-model.js.map +0 -1
  125. package/dist/src/__fixtures__/mock-meter.d.ts +0 -32
  126. package/dist/src/__fixtures__/mock-meter.d.ts.map +0 -1
  127. package/dist/src/__fixtures__/mock-meter.js +0 -47
  128. package/dist/src/__fixtures__/mock-meter.js.map +0 -1
  129. package/dist/src/__fixtures__/mock-plugin.d.ts +0 -13
  130. package/dist/src/__fixtures__/mock-plugin.d.ts.map +0 -1
  131. package/dist/src/__fixtures__/mock-plugin.js +0 -35
  132. package/dist/src/__fixtures__/mock-plugin.js.map +0 -1
  133. package/dist/src/__fixtures__/mock-span.d.ts +0 -78
  134. package/dist/src/__fixtures__/mock-span.d.ts.map +0 -1
  135. package/dist/src/__fixtures__/mock-span.js +0 -93
  136. package/dist/src/__fixtures__/mock-span.js.map +0 -1
  137. package/dist/src/__fixtures__/mock-storage-provider.d.ts +0 -42
  138. package/dist/src/__fixtures__/mock-storage-provider.d.ts.map +0 -1
  139. package/dist/src/__fixtures__/mock-storage-provider.js +0 -122
  140. package/dist/src/__fixtures__/mock-storage-provider.js.map +0 -1
  141. package/dist/src/__fixtures__/model-test-helpers.d.ts +0 -56
  142. package/dist/src/__fixtures__/model-test-helpers.d.ts.map +0 -1
  143. package/dist/src/__fixtures__/model-test-helpers.js +0 -85
  144. package/dist/src/__fixtures__/model-test-helpers.js.map +0 -1
  145. package/dist/src/__fixtures__/register-node-defaults.d.ts +0 -2
  146. package/dist/src/__fixtures__/register-node-defaults.d.ts.map +0 -1
  147. package/dist/src/__fixtures__/register-node-defaults.js +0 -6
  148. package/dist/src/__fixtures__/register-node-defaults.js.map +0 -1
  149. package/dist/src/__fixtures__/slim-types.d.ts +0 -51
  150. package/dist/src/__fixtures__/slim-types.d.ts.map +0 -1
  151. package/dist/src/__fixtures__/slim-types.js +0 -6
  152. package/dist/src/__fixtures__/slim-types.js.map +0 -1
  153. package/dist/src/__fixtures__/test-sandbox.node.d.ts +0 -15
  154. package/dist/src/__fixtures__/test-sandbox.node.d.ts.map +0 -1
  155. package/dist/src/__fixtures__/test-sandbox.node.js +0 -23
  156. package/dist/src/__fixtures__/test-sandbox.node.js.map +0 -1
  157. package/dist/src/__fixtures__/tool-helpers.d.ts +0 -45
  158. package/dist/src/__fixtures__/tool-helpers.d.ts.map +0 -1
  159. package/dist/src/__fixtures__/tool-helpers.js +0 -101
  160. package/dist/src/__fixtures__/tool-helpers.js.map +0 -1
  161. package/dist/src/__tests__/default-slot.test.d.ts +0 -2
  162. package/dist/src/__tests__/default-slot.test.d.ts.map +0 -1
  163. package/dist/src/__tests__/default-slot.test.js +0 -33
  164. package/dist/src/__tests__/default-slot.test.js.map +0 -1
  165. package/dist/src/__tests__/errors.test.d.ts +0 -2
  166. package/dist/src/__tests__/errors.test.d.ts.map +0 -1
  167. package/dist/src/__tests__/errors.test.js +0 -170
  168. package/dist/src/__tests__/errors.test.js.map +0 -1
  169. package/dist/src/__tests__/index.test.d.ts +0 -2
  170. package/dist/src/__tests__/index.test.d.ts.map +0 -1
  171. package/dist/src/__tests__/index.test.js +0 -48
  172. package/dist/src/__tests__/index.test.js.map +0 -1
  173. package/dist/src/__tests__/interrupt.test.d.ts +0 -2
  174. package/dist/src/__tests__/interrupt.test.d.ts.map +0 -1
  175. package/dist/src/__tests__/interrupt.test.js +0 -264
  176. package/dist/src/__tests__/interrupt.test.js.map +0 -1
  177. package/dist/src/__tests__/mcp.test.d.ts +0 -2
  178. package/dist/src/__tests__/mcp.test.d.ts.map +0 -1
  179. package/dist/src/__tests__/mcp.test.js +0 -1003
  180. package/dist/src/__tests__/mcp.test.js.map +0 -1
  181. package/dist/src/__tests__/mime.test.d.ts +0 -2
  182. package/dist/src/__tests__/mime.test.d.ts.map +0 -1
  183. package/dist/src/__tests__/mime.test.js +0 -83
  184. package/dist/src/__tests__/mime.test.js.map +0 -1
  185. package/dist/src/__tests__/state-store.test.d.ts +0 -2
  186. package/dist/src/__tests__/state-store.test.d.ts.map +0 -1
  187. package/dist/src/__tests__/state-store.test.js +0 -285
  188. package/dist/src/__tests__/state-store.test.js.map +0 -1
  189. package/dist/src/a2a/__tests__/a2a-agent.test.d.ts +0 -2
  190. package/dist/src/a2a/__tests__/a2a-agent.test.d.ts.map +0 -1
  191. package/dist/src/a2a/__tests__/a2a-agent.test.js +0 -383
  192. package/dist/src/a2a/__tests__/a2a-agent.test.js.map +0 -1
  193. package/dist/src/a2a/__tests__/adapters.test.d.ts +0 -2
  194. package/dist/src/a2a/__tests__/adapters.test.d.ts.map +0 -1
  195. package/dist/src/a2a/__tests__/adapters.test.js +0 -151
  196. package/dist/src/a2a/__tests__/adapters.test.js.map +0 -1
  197. package/dist/src/a2a/__tests__/async-lock.test.d.ts +0 -2
  198. package/dist/src/a2a/__tests__/async-lock.test.d.ts.map +0 -1
  199. package/dist/src/a2a/__tests__/async-lock.test.js +0 -137
  200. package/dist/src/a2a/__tests__/async-lock.test.js.map +0 -1
  201. package/dist/src/a2a/__tests__/events.test.d.ts +0 -2
  202. package/dist/src/a2a/__tests__/events.test.d.ts.map +0 -1
  203. package/dist/src/a2a/__tests__/events.test.js +0 -68
  204. package/dist/src/a2a/__tests__/events.test.js.map +0 -1
  205. package/dist/src/a2a/__tests__/executor.test.d.ts +0 -2
  206. package/dist/src/a2a/__tests__/executor.test.d.ts.map +0 -1
  207. package/dist/src/a2a/__tests__/executor.test.js +0 -345
  208. package/dist/src/a2a/__tests__/executor.test.js.map +0 -1
  209. package/dist/src/a2a/__tests__/server.test.d.ts +0 -2
  210. package/dist/src/a2a/__tests__/server.test.d.ts.map +0 -1
  211. package/dist/src/a2a/__tests__/server.test.js +0 -71
  212. package/dist/src/a2a/__tests__/server.test.js.map +0 -1
  213. package/dist/src/a2a/__tests__/server.test.node.d.ts +0 -2
  214. package/dist/src/a2a/__tests__/server.test.node.d.ts.map +0 -1
  215. package/dist/src/a2a/__tests__/server.test.node.js +0 -110
  216. package/dist/src/a2a/__tests__/server.test.node.js.map +0 -1
  217. package/dist/src/agent/__tests__/agent-as-tool.invocation-state.test.d.ts +0 -2
  218. package/dist/src/agent/__tests__/agent-as-tool.invocation-state.test.d.ts.map +0 -1
  219. package/dist/src/agent/__tests__/agent-as-tool.invocation-state.test.js +0 -23
  220. package/dist/src/agent/__tests__/agent-as-tool.invocation-state.test.js.map +0 -1
  221. package/dist/src/agent/__tests__/agent-as-tool.test.d.ts +0 -2
  222. package/dist/src/agent/__tests__/agent-as-tool.test.d.ts.map +0 -1
  223. package/dist/src/agent/__tests__/agent-as-tool.test.js +0 -347
  224. package/dist/src/agent/__tests__/agent-as-tool.test.js.map +0 -1
  225. package/dist/src/agent/__tests__/agent.cancel.test.d.ts +0 -2
  226. package/dist/src/agent/__tests__/agent.cancel.test.d.ts.map +0 -1
  227. package/dist/src/agent/__tests__/agent.cancel.test.js +0 -337
  228. package/dist/src/agent/__tests__/agent.cancel.test.js.map +0 -1
  229. package/dist/src/agent/__tests__/agent.concurrent.test.d.ts +0 -2
  230. package/dist/src/agent/__tests__/agent.concurrent.test.d.ts.map +0 -1
  231. package/dist/src/agent/__tests__/agent.concurrent.test.js +0 -488
  232. package/dist/src/agent/__tests__/agent.concurrent.test.js.map +0 -1
  233. package/dist/src/agent/__tests__/agent.context-manager.test.d.ts +0 -2
  234. package/dist/src/agent/__tests__/agent.context-manager.test.d.ts.map +0 -1
  235. package/dist/src/agent/__tests__/agent.context-manager.test.js +0 -106
  236. package/dist/src/agent/__tests__/agent.context-manager.test.js.map +0 -1
  237. package/dist/src/agent/__tests__/agent.hook.test.d.ts +0 -2
  238. package/dist/src/agent/__tests__/agent.hook.test.d.ts.map +0 -1
  239. package/dist/src/agent/__tests__/agent.hook.test.js +0 -1332
  240. package/dist/src/agent/__tests__/agent.hook.test.js.map +0 -1
  241. package/dist/src/agent/__tests__/agent.interrupt.test.d.ts +0 -2
  242. package/dist/src/agent/__tests__/agent.interrupt.test.d.ts.map +0 -1
  243. package/dist/src/agent/__tests__/agent.interrupt.test.js +0 -779
  244. package/dist/src/agent/__tests__/agent.interrupt.test.js.map +0 -1
  245. package/dist/src/agent/__tests__/agent.invocation-state.test.d.ts +0 -2
  246. package/dist/src/agent/__tests__/agent.invocation-state.test.d.ts.map +0 -1
  247. package/dist/src/agent/__tests__/agent.invocation-state.test.js +0 -219
  248. package/dist/src/agent/__tests__/agent.invocation-state.test.js.map +0 -1
  249. package/dist/src/agent/__tests__/agent.model-retry.test.d.ts +0 -2
  250. package/dist/src/agent/__tests__/agent.model-retry.test.d.ts.map +0 -1
  251. package/dist/src/agent/__tests__/agent.model-retry.test.js +0 -161
  252. package/dist/src/agent/__tests__/agent.model-retry.test.js.map +0 -1
  253. package/dist/src/agent/__tests__/agent.stateful-model.test.d.ts +0 -2
  254. package/dist/src/agent/__tests__/agent.stateful-model.test.d.ts.map +0 -1
  255. package/dist/src/agent/__tests__/agent.stateful-model.test.js +0 -169
  256. package/dist/src/agent/__tests__/agent.stateful-model.test.js.map +0 -1
  257. package/dist/src/agent/__tests__/agent.test.d.ts +0 -2
  258. package/dist/src/agent/__tests__/agent.test.d.ts.map +0 -1
  259. package/dist/src/agent/__tests__/agent.test.js +0 -1624
  260. package/dist/src/agent/__tests__/agent.test.js.map +0 -1
  261. package/dist/src/agent/__tests__/agent.tracer.test.node.d.ts +0 -2
  262. package/dist/src/agent/__tests__/agent.tracer.test.node.d.ts.map +0 -1
  263. package/dist/src/agent/__tests__/agent.tracer.test.node.js +0 -535
  264. package/dist/src/agent/__tests__/agent.tracer.test.node.js.map +0 -1
  265. package/dist/src/agent/__tests__/printer.test.d.ts +0 -2
  266. package/dist/src/agent/__tests__/printer.test.d.ts.map +0 -1
  267. package/dist/src/agent/__tests__/printer.test.js +0 -188
  268. package/dist/src/agent/__tests__/printer.test.js.map +0 -1
  269. package/dist/src/agent/__tests__/snapshot.test.d.ts +0 -2
  270. package/dist/src/agent/__tests__/snapshot.test.d.ts.map +0 -1
  271. package/dist/src/agent/__tests__/snapshot.test.js +0 -442
  272. package/dist/src/agent/__tests__/snapshot.test.js.map +0 -1
  273. package/dist/src/agent/__tests__/tool-caller.test.d.ts +0 -2
  274. package/dist/src/agent/__tests__/tool-caller.test.d.ts.map +0 -1
  275. package/dist/src/agent/__tests__/tool-caller.test.js +0 -459
  276. package/dist/src/agent/__tests__/tool-caller.test.js.map +0 -1
  277. package/dist/src/conversation-manager/__tests__/agentic-context.test.d.ts +0 -2
  278. package/dist/src/conversation-manager/__tests__/agentic-context.test.d.ts.map +0 -1
  279. package/dist/src/conversation-manager/__tests__/agentic-context.test.js +0 -332
  280. package/dist/src/conversation-manager/__tests__/agentic-context.test.js.map +0 -1
  281. package/dist/src/conversation-manager/__tests__/context-compression.test.d.ts +0 -2
  282. package/dist/src/conversation-manager/__tests__/context-compression.test.d.ts.map +0 -1
  283. package/dist/src/conversation-manager/__tests__/context-compression.test.js +0 -176
  284. package/dist/src/conversation-manager/__tests__/context-compression.test.js.map +0 -1
  285. package/dist/src/conversation-manager/__tests__/conversation-manager.test.d.ts +0 -2
  286. package/dist/src/conversation-manager/__tests__/conversation-manager.test.d.ts.map +0 -1
  287. package/dist/src/conversation-manager/__tests__/conversation-manager.test.js +0 -321
  288. package/dist/src/conversation-manager/__tests__/conversation-manager.test.js.map +0 -1
  289. package/dist/src/conversation-manager/__tests__/null-conversation-manager.test.d.ts +0 -2
  290. package/dist/src/conversation-manager/__tests__/null-conversation-manager.test.d.ts.map +0 -1
  291. package/dist/src/conversation-manager/__tests__/null-conversation-manager.test.js +0 -64
  292. package/dist/src/conversation-manager/__tests__/null-conversation-manager.test.js.map +0 -1
  293. package/dist/src/conversation-manager/__tests__/pin.test.d.ts +0 -2
  294. package/dist/src/conversation-manager/__tests__/pin.test.d.ts.map +0 -1
  295. package/dist/src/conversation-manager/__tests__/pin.test.js +0 -119
  296. package/dist/src/conversation-manager/__tests__/pin.test.js.map +0 -1
  297. package/dist/src/conversation-manager/__tests__/sliding-window-conversation-manager.test.d.ts +0 -2
  298. package/dist/src/conversation-manager/__tests__/sliding-window-conversation-manager.test.d.ts.map +0 -1
  299. package/dist/src/conversation-manager/__tests__/sliding-window-conversation-manager.test.js +0 -1080
  300. package/dist/src/conversation-manager/__tests__/sliding-window-conversation-manager.test.js.map +0 -1
  301. package/dist/src/conversation-manager/__tests__/summarizing-conversation-manager.test.d.ts +0 -2
  302. package/dist/src/conversation-manager/__tests__/summarizing-conversation-manager.test.d.ts.map +0 -1
  303. package/dist/src/conversation-manager/__tests__/summarizing-conversation-manager.test.js +0 -400
  304. package/dist/src/conversation-manager/__tests__/summarizing-conversation-manager.test.js.map +0 -1
  305. package/dist/src/conversation-manager/__tests__/token-usage-middleware.test.d.ts +0 -2
  306. package/dist/src/conversation-manager/__tests__/token-usage-middleware.test.d.ts.map +0 -1
  307. package/dist/src/conversation-manager/__tests__/token-usage-middleware.test.js +0 -138
  308. package/dist/src/conversation-manager/__tests__/token-usage-middleware.test.js.map +0 -1
  309. package/dist/src/hooks/__tests__/events.test.d.ts +0 -2
  310. package/dist/src/hooks/__tests__/events.test.d.ts.map +0 -1
  311. package/dist/src/hooks/__tests__/events.test.js +0 -1060
  312. package/dist/src/hooks/__tests__/events.test.js.map +0 -1
  313. package/dist/src/hooks/__tests__/registry.test.d.ts +0 -2
  314. package/dist/src/hooks/__tests__/registry.test.d.ts.map +0 -1
  315. package/dist/src/hooks/__tests__/registry.test.js +0 -325
  316. package/dist/src/hooks/__tests__/registry.test.js.map +0 -1
  317. package/dist/src/injection/__tests__/message-injection.test.d.ts +0 -2
  318. package/dist/src/injection/__tests__/message-injection.test.d.ts.map +0 -1
  319. package/dist/src/injection/__tests__/message-injection.test.js +0 -200
  320. package/dist/src/injection/__tests__/message-injection.test.js.map +0 -1
  321. package/dist/src/interventions/__tests__/handler.test.d.ts +0 -2
  322. package/dist/src/interventions/__tests__/handler.test.d.ts.map +0 -1
  323. package/dist/src/interventions/__tests__/handler.test.js +0 -35
  324. package/dist/src/interventions/__tests__/handler.test.js.map +0 -1
  325. package/dist/src/interventions/__tests__/registry.test.d.ts +0 -2
  326. package/dist/src/interventions/__tests__/registry.test.d.ts.map +0 -1
  327. package/dist/src/interventions/__tests__/registry.test.js +0 -692
  328. package/dist/src/interventions/__tests__/registry.test.js.map +0 -1
  329. package/dist/src/logging/__tests__/logger.test.d.ts +0 -2
  330. package/dist/src/logging/__tests__/logger.test.d.ts.map +0 -1
  331. package/dist/src/logging/__tests__/logger.test.js +0 -70
  332. package/dist/src/logging/__tests__/logger.test.js.map +0 -1
  333. package/dist/src/logging/__tests__/warn-once.test.d.ts +0 -2
  334. package/dist/src/logging/__tests__/warn-once.test.d.ts.map +0 -1
  335. package/dist/src/logging/__tests__/warn-once.test.js +0 -30
  336. package/dist/src/logging/__tests__/warn-once.test.js.map +0 -1
  337. package/dist/src/mcp.d.ts.map +0 -1
  338. package/dist/src/mcp.js.map +0 -1
  339. package/dist/src/memory/__tests__/memory-manager.test.d.ts +0 -2
  340. package/dist/src/memory/__tests__/memory-manager.test.d.ts.map +0 -1
  341. package/dist/src/memory/__tests__/memory-manager.test.js +0 -679
  342. package/dist/src/memory/__tests__/memory-manager.test.js.map +0 -1
  343. package/dist/src/memory/__tests__/memory-tracing.test.d.ts +0 -2
  344. package/dist/src/memory/__tests__/memory-tracing.test.d.ts.map +0 -1
  345. package/dist/src/memory/__tests__/memory-tracing.test.js +0 -250
  346. package/dist/src/memory/__tests__/memory-tracing.test.js.map +0 -1
  347. package/dist/src/memory/extraction/__tests__/extraction.test.d.ts +0 -2
  348. package/dist/src/memory/extraction/__tests__/extraction.test.d.ts.map +0 -1
  349. package/dist/src/memory/extraction/__tests__/extraction.test.js +0 -639
  350. package/dist/src/memory/extraction/__tests__/extraction.test.js.map +0 -1
  351. package/dist/src/memory/extraction/__tests__/model-extractor.test.d.ts +0 -2
  352. package/dist/src/memory/extraction/__tests__/model-extractor.test.d.ts.map +0 -1
  353. package/dist/src/memory/extraction/__tests__/model-extractor.test.js +0 -104
  354. package/dist/src/memory/extraction/__tests__/model-extractor.test.js.map +0 -1
  355. package/dist/src/memory/extraction/__tests__/resolve-extraction-config.test.d.ts +0 -2
  356. package/dist/src/memory/extraction/__tests__/resolve-extraction-config.test.d.ts.map +0 -1
  357. package/dist/src/memory/extraction/__tests__/resolve-extraction-config.test.js +0 -81
  358. package/dist/src/memory/extraction/__tests__/resolve-extraction-config.test.js.map +0 -1
  359. package/dist/src/middleware/__tests__/agent-middleware.test.d.ts +0 -2
  360. package/dist/src/middleware/__tests__/agent-middleware.test.d.ts.map +0 -1
  361. package/dist/src/middleware/__tests__/agent-middleware.test.js +0 -1206
  362. package/dist/src/middleware/__tests__/agent-middleware.test.js.map +0 -1
  363. package/dist/src/middleware/__tests__/copy-on-input.test.d.ts +0 -2
  364. package/dist/src/middleware/__tests__/copy-on-input.test.d.ts.map +0 -1
  365. package/dist/src/middleware/__tests__/copy-on-input.test.js +0 -379
  366. package/dist/src/middleware/__tests__/copy-on-input.test.js.map +0 -1
  367. package/dist/src/middleware/__tests__/custom-stages.test.d.ts +0 -2
  368. package/dist/src/middleware/__tests__/custom-stages.test.d.ts.map +0 -1
  369. package/dist/src/middleware/__tests__/custom-stages.test.js +0 -97
  370. package/dist/src/middleware/__tests__/custom-stages.test.js.map +0 -1
  371. package/dist/src/middleware/__tests__/middleware-interrupts.test.d.ts +0 -2
  372. package/dist/src/middleware/__tests__/middleware-interrupts.test.d.ts.map +0 -1
  373. package/dist/src/middleware/__tests__/middleware-interrupts.test.js +0 -267
  374. package/dist/src/middleware/__tests__/middleware-interrupts.test.js.map +0 -1
  375. package/dist/src/middleware/__tests__/registry.test.d.ts +0 -2
  376. package/dist/src/middleware/__tests__/registry.test.d.ts.map +0 -1
  377. package/dist/src/middleware/__tests__/registry.test.js +0 -525
  378. package/dist/src/middleware/__tests__/registry.test.js.map +0 -1
  379. package/dist/src/models/__tests__/anthropic.test.d.ts +0 -2
  380. package/dist/src/models/__tests__/anthropic.test.d.ts.map +0 -1
  381. package/dist/src/models/__tests__/anthropic.test.js +0 -793
  382. package/dist/src/models/__tests__/anthropic.test.js.map +0 -1
  383. package/dist/src/models/__tests__/bedrock.test.d.ts +0 -2
  384. package/dist/src/models/__tests__/bedrock.test.d.ts.map +0 -1
  385. package/dist/src/models/__tests__/bedrock.test.js +0 -3964
  386. package/dist/src/models/__tests__/bedrock.test.js.map +0 -1
  387. package/dist/src/models/__tests__/defaults.test.d.ts +0 -2
  388. package/dist/src/models/__tests__/defaults.test.d.ts.map +0 -1
  389. package/dist/src/models/__tests__/defaults.test.js +0 -36
  390. package/dist/src/models/__tests__/defaults.test.js.map +0 -1
  391. package/dist/src/models/__tests__/google.test.d.ts +0 -2
  392. package/dist/src/models/__tests__/google.test.d.ts.map +0 -1
  393. package/dist/src/models/__tests__/google.test.js +0 -1145
  394. package/dist/src/models/__tests__/google.test.js.map +0 -1
  395. package/dist/src/models/__tests__/model.test.d.ts +0 -2
  396. package/dist/src/models/__tests__/model.test.d.ts.map +0 -1
  397. package/dist/src/models/__tests__/model.test.js +0 -921
  398. package/dist/src/models/__tests__/model.test.js.map +0 -1
  399. package/dist/src/models/__tests__/streaming.test.d.ts +0 -2
  400. package/dist/src/models/__tests__/streaming.test.d.ts.map +0 -1
  401. package/dist/src/models/__tests__/streaming.test.js +0 -50
  402. package/dist/src/models/__tests__/streaming.test.js.map +0 -1
  403. package/dist/src/models/__tests__/test-utils.d.ts +0 -10
  404. package/dist/src/models/__tests__/test-utils.d.ts.map +0 -1
  405. package/dist/src/models/__tests__/test-utils.js +0 -17
  406. package/dist/src/models/__tests__/test-utils.js.map +0 -1
  407. package/dist/src/models/__tests__/vercel.test.d.ts +0 -2
  408. package/dist/src/models/__tests__/vercel.test.d.ts.map +0 -1
  409. package/dist/src/models/__tests__/vercel.test.js +0 -740
  410. package/dist/src/models/__tests__/vercel.test.js.map +0 -1
  411. package/dist/src/models/openai/__tests__/chat.test.d.ts +0 -2
  412. package/dist/src/models/openai/__tests__/chat.test.d.ts.map +0 -1
  413. package/dist/src/models/openai/__tests__/chat.test.js +0 -1586
  414. package/dist/src/models/openai/__tests__/chat.test.js.map +0 -1
  415. package/dist/src/models/openai/__tests__/errors.test.d.ts +0 -2
  416. package/dist/src/models/openai/__tests__/errors.test.d.ts.map +0 -1
  417. package/dist/src/models/openai/__tests__/errors.test.js +0 -39
  418. package/dist/src/models/openai/__tests__/errors.test.js.map +0 -1
  419. package/dist/src/models/openai/__tests__/mantle.test.d.ts +0 -2
  420. package/dist/src/models/openai/__tests__/mantle.test.d.ts.map +0 -1
  421. package/dist/src/models/openai/__tests__/mantle.test.js +0 -189
  422. package/dist/src/models/openai/__tests__/mantle.test.js.map +0 -1
  423. package/dist/src/models/openai/__tests__/responses.test.d.ts +0 -2
  424. package/dist/src/models/openai/__tests__/responses.test.d.ts.map +0 -1
  425. package/dist/src/models/openai/__tests__/responses.test.js +0 -709
  426. package/dist/src/models/openai/__tests__/responses.test.js.map +0 -1
  427. package/dist/src/multiagent/__tests__/events.test.d.ts +0 -2
  428. package/dist/src/multiagent/__tests__/events.test.d.ts.map +0 -1
  429. package/dist/src/multiagent/__tests__/events.test.js +0 -493
  430. package/dist/src/multiagent/__tests__/events.test.js.map +0 -1
  431. package/dist/src/multiagent/__tests__/graph.invocation-state.test.d.ts +0 -2
  432. package/dist/src/multiagent/__tests__/graph.invocation-state.test.d.ts.map +0 -1
  433. package/dist/src/multiagent/__tests__/graph.invocation-state.test.js +0 -95
  434. package/dist/src/multiagent/__tests__/graph.invocation-state.test.js.map +0 -1
  435. package/dist/src/multiagent/__tests__/graph.test.d.ts +0 -2
  436. package/dist/src/multiagent/__tests__/graph.test.d.ts.map +0 -1
  437. package/dist/src/multiagent/__tests__/graph.test.js +0 -698
  438. package/dist/src/multiagent/__tests__/graph.test.js.map +0 -1
  439. package/dist/src/multiagent/__tests__/graph.tracer.test.d.ts +0 -2
  440. package/dist/src/multiagent/__tests__/graph.tracer.test.d.ts.map +0 -1
  441. package/dist/src/multiagent/__tests__/graph.tracer.test.js +0 -218
  442. package/dist/src/multiagent/__tests__/graph.tracer.test.js.map +0 -1
  443. package/dist/src/multiagent/__tests__/interrupts.test.d.ts +0 -2
  444. package/dist/src/multiagent/__tests__/interrupts.test.d.ts.map +0 -1
  445. package/dist/src/multiagent/__tests__/interrupts.test.js +0 -390
  446. package/dist/src/multiagent/__tests__/interrupts.test.js.map +0 -1
  447. package/dist/src/multiagent/__tests__/nodes.test.d.ts +0 -2
  448. package/dist/src/multiagent/__tests__/nodes.test.d.ts.map +0 -1
  449. package/dist/src/multiagent/__tests__/nodes.test.js +0 -321
  450. package/dist/src/multiagent/__tests__/nodes.test.js.map +0 -1
  451. package/dist/src/multiagent/__tests__/queue.test.d.ts +0 -2
  452. package/dist/src/multiagent/__tests__/queue.test.d.ts.map +0 -1
  453. package/dist/src/multiagent/__tests__/queue.test.js +0 -118
  454. package/dist/src/multiagent/__tests__/queue.test.js.map +0 -1
  455. package/dist/src/multiagent/__tests__/snapshot.test.d.ts +0 -2
  456. package/dist/src/multiagent/__tests__/snapshot.test.d.ts.map +0 -1
  457. package/dist/src/multiagent/__tests__/snapshot.test.js +0 -161
  458. package/dist/src/multiagent/__tests__/snapshot.test.js.map +0 -1
  459. package/dist/src/multiagent/__tests__/state.test.d.ts +0 -2
  460. package/dist/src/multiagent/__tests__/state.test.d.ts.map +0 -1
  461. package/dist/src/multiagent/__tests__/state.test.js +0 -526
  462. package/dist/src/multiagent/__tests__/state.test.js.map +0 -1
  463. package/dist/src/multiagent/__tests__/swarm.invocation-state.test.d.ts +0 -2
  464. package/dist/src/multiagent/__tests__/swarm.invocation-state.test.d.ts.map +0 -1
  465. package/dist/src/multiagent/__tests__/swarm.invocation-state.test.js +0 -56
  466. package/dist/src/multiagent/__tests__/swarm.invocation-state.test.js.map +0 -1
  467. package/dist/src/multiagent/__tests__/swarm.test.d.ts +0 -2
  468. package/dist/src/multiagent/__tests__/swarm.test.d.ts.map +0 -1
  469. package/dist/src/multiagent/__tests__/swarm.test.js +0 -477
  470. package/dist/src/multiagent/__tests__/swarm.test.js.map +0 -1
  471. package/dist/src/multiagent/__tests__/swarm.tracer.test.d.ts +0 -2
  472. package/dist/src/multiagent/__tests__/swarm.tracer.test.d.ts.map +0 -1
  473. package/dist/src/multiagent/__tests__/swarm.tracer.test.js +0 -235
  474. package/dist/src/multiagent/__tests__/swarm.tracer.test.js.map +0 -1
  475. package/dist/src/plugins/__tests__/plugin.test.d.ts +0 -2
  476. package/dist/src/plugins/__tests__/plugin.test.d.ts.map +0 -1
  477. package/dist/src/plugins/__tests__/plugin.test.js +0 -114
  478. package/dist/src/plugins/__tests__/plugin.test.js.map +0 -1
  479. package/dist/src/plugins/__tests__/registry.test.d.ts +0 -2
  480. package/dist/src/plugins/__tests__/registry.test.d.ts.map +0 -1
  481. package/dist/src/plugins/__tests__/registry.test.js +0 -147
  482. package/dist/src/plugins/__tests__/registry.test.js.map +0 -1
  483. package/dist/src/registry/__tests__/tool-registry.test.d.ts +0 -2
  484. package/dist/src/registry/__tests__/tool-registry.test.d.ts.map +0 -1
  485. package/dist/src/registry/__tests__/tool-registry.test.js +0 -210
  486. package/dist/src/registry/__tests__/tool-registry.test.js.map +0 -1
  487. package/dist/src/retry/__tests__/backoff-strategy.test.d.ts +0 -2
  488. package/dist/src/retry/__tests__/backoff-strategy.test.d.ts.map +0 -1
  489. package/dist/src/retry/__tests__/backoff-strategy.test.js +0 -116
  490. package/dist/src/retry/__tests__/backoff-strategy.test.js.map +0 -1
  491. package/dist/src/retry/__tests__/default-model-retry-strategy.test.d.ts +0 -2
  492. package/dist/src/retry/__tests__/default-model-retry-strategy.test.d.ts.map +0 -1
  493. package/dist/src/retry/__tests__/default-model-retry-strategy.test.js +0 -225
  494. package/dist/src/retry/__tests__/default-model-retry-strategy.test.js.map +0 -1
  495. package/dist/src/sandbox/__tests__/default.test.browser.d.ts +0 -2
  496. package/dist/src/sandbox/__tests__/default.test.browser.d.ts.map +0 -1
  497. package/dist/src/sandbox/__tests__/default.test.browser.js +0 -11
  498. package/dist/src/sandbox/__tests__/default.test.browser.js.map +0 -1
  499. package/dist/src/sandbox/__tests__/default.test.node.d.ts +0 -2
  500. package/dist/src/sandbox/__tests__/default.test.node.d.ts.map +0 -1
  501. package/dist/src/sandbox/__tests__/default.test.node.js +0 -23
  502. package/dist/src/sandbox/__tests__/default.test.node.js.map +0 -1
  503. package/dist/src/sandbox/__tests__/docker.test.node.d.ts +0 -2
  504. package/dist/src/sandbox/__tests__/docker.test.node.d.ts.map +0 -1
  505. package/dist/src/sandbox/__tests__/docker.test.node.js +0 -89
  506. package/dist/src/sandbox/__tests__/docker.test.node.js.map +0 -1
  507. package/dist/src/sandbox/__tests__/errors.test.node.d.ts +0 -2
  508. package/dist/src/sandbox/__tests__/errors.test.node.d.ts.map +0 -1
  509. package/dist/src/sandbox/__tests__/errors.test.node.js +0 -33
  510. package/dist/src/sandbox/__tests__/errors.test.node.js.map +0 -1
  511. package/dist/src/sandbox/__tests__/not-a-sandbox-local-environment.test.node.d.ts +0 -2
  512. package/dist/src/sandbox/__tests__/not-a-sandbox-local-environment.test.node.d.ts.map +0 -1
  513. package/dist/src/sandbox/__tests__/not-a-sandbox-local-environment.test.node.js +0 -124
  514. package/dist/src/sandbox/__tests__/not-a-sandbox-local-environment.test.node.js.map +0 -1
  515. package/dist/src/sandbox/__tests__/posix-shell.test.node.d.ts +0 -2
  516. package/dist/src/sandbox/__tests__/posix-shell.test.node.d.ts.map +0 -1
  517. package/dist/src/sandbox/__tests__/posix-shell.test.node.js +0 -298
  518. package/dist/src/sandbox/__tests__/posix-shell.test.node.js.map +0 -1
  519. package/dist/src/sandbox/__tests__/ssh.test.node.d.ts +0 -2
  520. package/dist/src/sandbox/__tests__/ssh.test.node.d.ts.map +0 -1
  521. package/dist/src/sandbox/__tests__/ssh.test.node.js +0 -262
  522. package/dist/src/sandbox/__tests__/ssh.test.node.js.map +0 -1
  523. package/dist/src/session/__tests__/file-storage.test.node.d.ts +0 -2
  524. package/dist/src/session/__tests__/file-storage.test.node.d.ts.map +0 -1
  525. package/dist/src/session/__tests__/file-storage.test.node.js +0 -278
  526. package/dist/src/session/__tests__/file-storage.test.node.js.map +0 -1
  527. package/dist/src/session/__tests__/s3-storage.test.d.ts +0 -2
  528. package/dist/src/session/__tests__/s3-storage.test.d.ts.map +0 -1
  529. package/dist/src/session/__tests__/s3-storage.test.js +0 -461
  530. package/dist/src/session/__tests__/s3-storage.test.js.map +0 -1
  531. package/dist/src/session/__tests__/session-manager.test.d.ts +0 -2
  532. package/dist/src/session/__tests__/session-manager.test.d.ts.map +0 -1
  533. package/dist/src/session/__tests__/session-manager.test.js +0 -832
  534. package/dist/src/session/__tests__/session-manager.test.js.map +0 -1
  535. package/dist/src/session/__tests__/validation.test.d.ts +0 -2
  536. package/dist/src/session/__tests__/validation.test.d.ts.map +0 -1
  537. package/dist/src/session/__tests__/validation.test.js +0 -47
  538. package/dist/src/session/__tests__/validation.test.js.map +0 -1
  539. package/dist/src/telemetry/__tests__/config.test.d.ts +0 -2
  540. package/dist/src/telemetry/__tests__/config.test.d.ts.map +0 -1
  541. package/dist/src/telemetry/__tests__/config.test.js +0 -64
  542. package/dist/src/telemetry/__tests__/config.test.js.map +0 -1
  543. package/dist/src/telemetry/__tests__/config.test.node.d.ts +0 -2
  544. package/dist/src/telemetry/__tests__/config.test.node.d.ts.map +0 -1
  545. package/dist/src/telemetry/__tests__/config.test.node.js +0 -164
  546. package/dist/src/telemetry/__tests__/config.test.node.js.map +0 -1
  547. package/dist/src/telemetry/__tests__/json.test.d.ts +0 -2
  548. package/dist/src/telemetry/__tests__/json.test.d.ts.map +0 -1
  549. package/dist/src/telemetry/__tests__/json.test.js +0 -89
  550. package/dist/src/telemetry/__tests__/json.test.js.map +0 -1
  551. package/dist/src/telemetry/__tests__/local-trace.test.d.ts +0 -2
  552. package/dist/src/telemetry/__tests__/local-trace.test.d.ts.map +0 -1
  553. package/dist/src/telemetry/__tests__/local-trace.test.js +0 -158
  554. package/dist/src/telemetry/__tests__/local-trace.test.js.map +0 -1
  555. package/dist/src/telemetry/__tests__/meter.test.d.ts +0 -2
  556. package/dist/src/telemetry/__tests__/meter.test.d.ts.map +0 -1
  557. package/dist/src/telemetry/__tests__/meter.test.js +0 -695
  558. package/dist/src/telemetry/__tests__/meter.test.js.map +0 -1
  559. package/dist/src/telemetry/__tests__/tracer.test.node.d.ts +0 -2
  560. package/dist/src/telemetry/__tests__/tracer.test.node.d.ts.map +0 -1
  561. package/dist/src/telemetry/__tests__/tracer.test.node.js +0 -958
  562. package/dist/src/telemetry/__tests__/tracer.test.node.js.map +0 -1
  563. package/dist/src/tools/__tests__/structured-output-tool.test.d.ts +0 -2
  564. package/dist/src/tools/__tests__/structured-output-tool.test.d.ts.map +0 -1
  565. package/dist/src/tools/__tests__/structured-output-tool.test.js +0 -84
  566. package/dist/src/tools/__tests__/structured-output-tool.test.js.map +0 -1
  567. package/dist/src/tools/__tests__/tool-factory.test.d.ts +0 -2
  568. package/dist/src/tools/__tests__/tool-factory.test.d.ts.map +0 -1
  569. package/dist/src/tools/__tests__/tool-factory.test.js +0 -98
  570. package/dist/src/tools/__tests__/tool-factory.test.js.map +0 -1
  571. package/dist/src/tools/__tests__/tool.test.d.ts +0 -2
  572. package/dist/src/tools/__tests__/tool.test.d.ts.map +0 -1
  573. package/dist/src/tools/__tests__/tool.test.js +0 -1043
  574. package/dist/src/tools/__tests__/tool.test.js.map +0 -1
  575. package/dist/src/tools/__tests__/zod-tool.test-d.d.ts +0 -2
  576. package/dist/src/tools/__tests__/zod-tool.test-d.d.ts.map +0 -1
  577. package/dist/src/tools/__tests__/zod-tool.test-d.js +0 -227
  578. package/dist/src/tools/__tests__/zod-tool.test-d.js.map +0 -1
  579. package/dist/src/tools/__tests__/zod-tool.test.d.ts +0 -2
  580. package/dist/src/tools/__tests__/zod-tool.test.d.ts.map +0 -1
  581. package/dist/src/tools/__tests__/zod-tool.test.js +0 -563
  582. package/dist/src/tools/__tests__/zod-tool.test.js.map +0 -1
  583. package/dist/src/types/__tests__/agent.test.d.ts +0 -2
  584. package/dist/src/types/__tests__/agent.test.d.ts.map +0 -1
  585. package/dist/src/types/__tests__/agent.test.js +0 -476
  586. package/dist/src/types/__tests__/agent.test.js.map +0 -1
  587. package/dist/src/types/__tests__/citations.test.d.ts +0 -2
  588. package/dist/src/types/__tests__/citations.test.d.ts.map +0 -1
  589. package/dist/src/types/__tests__/citations.test.js +0 -104
  590. package/dist/src/types/__tests__/citations.test.js.map +0 -1
  591. package/dist/src/types/__tests__/json.test.d.ts +0 -2
  592. package/dist/src/types/__tests__/json.test.d.ts.map +0 -1
  593. package/dist/src/types/__tests__/json.test.js +0 -298
  594. package/dist/src/types/__tests__/json.test.js.map +0 -1
  595. package/dist/src/types/__tests__/media.test.d.ts +0 -2
  596. package/dist/src/types/__tests__/media.test.d.ts.map +0 -1
  597. package/dist/src/types/__tests__/media.test.js +0 -478
  598. package/dist/src/types/__tests__/media.test.js.map +0 -1
  599. package/dist/src/types/__tests__/messages.test.d.ts +0 -2
  600. package/dist/src/types/__tests__/messages.test.d.ts.map +0 -1
  601. package/dist/src/types/__tests__/messages.test.js +0 -681
  602. package/dist/src/types/__tests__/messages.test.js.map +0 -1
  603. package/dist/src/types/__tests__/validation.test.d.ts +0 -2
  604. package/dist/src/types/__tests__/validation.test.d.ts.map +0 -1
  605. package/dist/src/types/__tests__/validation.test.js +0 -30
  606. package/dist/src/types/__tests__/validation.test.js.map +0 -1
  607. package/dist/src/vended-interventions/cedar/__tests__/cedar.test.node.d.ts +0 -2
  608. package/dist/src/vended-interventions/cedar/__tests__/cedar.test.node.d.ts.map +0 -1
  609. package/dist/src/vended-interventions/cedar/__tests__/cedar.test.node.js +0 -756
  610. package/dist/src/vended-interventions/cedar/__tests__/cedar.test.node.js.map +0 -1
  611. package/dist/src/vended-interventions/hitl/__tests__/hitl.test.d.ts +0 -2
  612. package/dist/src/vended-interventions/hitl/__tests__/hitl.test.d.ts.map +0 -1
  613. package/dist/src/vended-interventions/hitl/__tests__/hitl.test.js +0 -358
  614. package/dist/src/vended-interventions/hitl/__tests__/hitl.test.js.map +0 -1
  615. package/dist/src/vended-interventions/steering/__tests__/handler.test.d.ts +0 -2
  616. package/dist/src/vended-interventions/steering/__tests__/handler.test.d.ts.map +0 -1
  617. package/dist/src/vended-interventions/steering/__tests__/handler.test.js +0 -163
  618. package/dist/src/vended-interventions/steering/__tests__/handler.test.js.map +0 -1
  619. package/dist/src/vended-interventions/steering/__tests__/llm.test.d.ts +0 -2
  620. package/dist/src/vended-interventions/steering/__tests__/llm.test.d.ts.map +0 -1
  621. package/dist/src/vended-interventions/steering/__tests__/llm.test.js +0 -60
  622. package/dist/src/vended-interventions/steering/__tests__/llm.test.js.map +0 -1
  623. package/dist/src/vended-interventions/steering/__tests__/tool-ledger.test.d.ts +0 -2
  624. package/dist/src/vended-interventions/steering/__tests__/tool-ledger.test.d.ts.map +0 -1
  625. package/dist/src/vended-interventions/steering/__tests__/tool-ledger.test.js +0 -94
  626. package/dist/src/vended-interventions/steering/__tests__/tool-ledger.test.js.map +0 -1
  627. package/dist/src/vended-memory-stores/bedrock-knowledge-base/__tests__/bedrock-knowledge-base-store.test.node.d.ts +0 -2
  628. package/dist/src/vended-memory-stores/bedrock-knowledge-base/__tests__/bedrock-knowledge-base-store.test.node.d.ts.map +0 -1
  629. package/dist/src/vended-memory-stores/bedrock-knowledge-base/__tests__/bedrock-knowledge-base-store.test.node.js +0 -758
  630. package/dist/src/vended-memory-stores/bedrock-knowledge-base/__tests__/bedrock-knowledge-base-store.test.node.js.map +0 -1
  631. package/dist/src/vended-plugins/context-injector/__tests__/plugin.test.d.ts +0 -2
  632. package/dist/src/vended-plugins/context-injector/__tests__/plugin.test.d.ts.map +0 -1
  633. package/dist/src/vended-plugins/context-injector/__tests__/plugin.test.js +0 -96
  634. package/dist/src/vended-plugins/context-injector/__tests__/plugin.test.js.map +0 -1
  635. package/dist/src/vended-plugins/context-offloader/__tests__/file-storage-sandbox.test.node.d.ts +0 -2
  636. package/dist/src/vended-plugins/context-offloader/__tests__/file-storage-sandbox.test.node.d.ts.map +0 -1
  637. package/dist/src/vended-plugins/context-offloader/__tests__/file-storage-sandbox.test.node.js +0 -68
  638. package/dist/src/vended-plugins/context-offloader/__tests__/file-storage-sandbox.test.node.js.map +0 -1
  639. package/dist/src/vended-plugins/context-offloader/__tests__/plugin.test.d.ts +0 -2
  640. package/dist/src/vended-plugins/context-offloader/__tests__/plugin.test.d.ts.map +0 -1
  641. package/dist/src/vended-plugins/context-offloader/__tests__/plugin.test.js +0 -539
  642. package/dist/src/vended-plugins/context-offloader/__tests__/plugin.test.js.map +0 -1
  643. package/dist/src/vended-plugins/context-offloader/__tests__/plugin.test.node.d.ts +0 -2
  644. package/dist/src/vended-plugins/context-offloader/__tests__/plugin.test.node.d.ts.map +0 -1
  645. package/dist/src/vended-plugins/context-offloader/__tests__/plugin.test.node.js +0 -97
  646. package/dist/src/vended-plugins/context-offloader/__tests__/plugin.test.node.js.map +0 -1
  647. package/dist/src/vended-plugins/context-offloader/__tests__/search.test.d.ts +0 -2
  648. package/dist/src/vended-plugins/context-offloader/__tests__/search.test.d.ts.map +0 -1
  649. package/dist/src/vended-plugins/context-offloader/__tests__/search.test.js +0 -149
  650. package/dist/src/vended-plugins/context-offloader/__tests__/search.test.js.map +0 -1
  651. package/dist/src/vended-plugins/context-offloader/__tests__/storage.test.d.ts +0 -2
  652. package/dist/src/vended-plugins/context-offloader/__tests__/storage.test.d.ts.map +0 -1
  653. package/dist/src/vended-plugins/context-offloader/__tests__/storage.test.js +0 -216
  654. package/dist/src/vended-plugins/context-offloader/__tests__/storage.test.js.map +0 -1
  655. package/dist/src/vended-plugins/context-offloader/__tests__/storage.test.node.d.ts +0 -2
  656. package/dist/src/vended-plugins/context-offloader/__tests__/storage.test.node.d.ts.map +0 -1
  657. package/dist/src/vended-plugins/context-offloader/__tests__/storage.test.node.js +0 -78
  658. package/dist/src/vended-plugins/context-offloader/__tests__/storage.test.node.js.map +0 -1
  659. package/dist/src/vended-plugins/goal/__tests__/plugin.test.d.ts +0 -2
  660. package/dist/src/vended-plugins/goal/__tests__/plugin.test.d.ts.map +0 -1
  661. package/dist/src/vended-plugins/goal/__tests__/plugin.test.js +0 -736
  662. package/dist/src/vended-plugins/goal/__tests__/plugin.test.js.map +0 -1
  663. package/dist/src/vended-plugins/skills/__tests__/agent-skills.test.node.d.ts +0 -2
  664. package/dist/src/vended-plugins/skills/__tests__/agent-skills.test.node.d.ts.map +0 -1
  665. package/dist/src/vended-plugins/skills/__tests__/agent-skills.test.node.js +0 -482
  666. package/dist/src/vended-plugins/skills/__tests__/agent-skills.test.node.js.map +0 -1
  667. package/dist/src/vended-plugins/skills/__tests__/skill.test.node.d.ts +0 -2
  668. package/dist/src/vended-plugins/skills/__tests__/skill.test.node.d.ts.map +0 -1
  669. package/dist/src/vended-plugins/skills/__tests__/skill.test.node.js +0 -476
  670. package/dist/src/vended-plugins/skills/__tests__/skill.test.node.js.map +0 -1
  671. package/dist/src/vended-tools/bash/__tests__/bash.test.node.d.ts +0 -2
  672. package/dist/src/vended-tools/bash/__tests__/bash.test.node.d.ts.map +0 -1
  673. package/dist/src/vended-tools/bash/__tests__/bash.test.node.js +0 -390
  674. package/dist/src/vended-tools/bash/__tests__/bash.test.node.js.map +0 -1
  675. package/dist/src/vended-tools/file-editor/__tests__/file-editor.test.node.d.ts +0 -2
  676. package/dist/src/vended-tools/file-editor/__tests__/file-editor.test.node.d.ts.map +0 -1
  677. package/dist/src/vended-tools/file-editor/__tests__/file-editor.test.node.js +0 -452
  678. package/dist/src/vended-tools/file-editor/__tests__/file-editor.test.node.js.map +0 -1
  679. package/dist/src/vended-tools/http-request/__tests__/http-request.test.d.ts +0 -2
  680. package/dist/src/vended-tools/http-request/__tests__/http-request.test.d.ts.map +0 -1
  681. package/dist/src/vended-tools/http-request/__tests__/http-request.test.js +0 -189
  682. package/dist/src/vended-tools/http-request/__tests__/http-request.test.js.map +0 -1
  683. package/dist/src/vended-tools/notebook/__tests__/notebook.test.d.ts +0 -2
  684. package/dist/src/vended-tools/notebook/__tests__/notebook.test.d.ts.map +0 -1
  685. package/dist/src/vended-tools/notebook/__tests__/notebook.test.js +0 -388
  686. package/dist/src/vended-tools/notebook/__tests__/notebook.test.js.map +0 -1
@@ -1,758 +0,0 @@
1
- import { describe, it, expect, beforeEach, vi } from 'vitest';
2
- import { BedrockAgentRuntimeClient } from '@aws-sdk/client-bedrock-agent-runtime';
3
- import { BedrockAgentClient } from '@aws-sdk/client-bedrock-agent';
4
- import { BedrockKnowledgeBaseStore } from '../store.js';
5
- import { MemoryManager } from '../../../memory/index.js';
6
- import { InvocationTrigger } from '../../../memory/extraction/triggers.js';
7
- import { Message, TextBlock } from '../../../types/messages.js';
8
- import { AfterInvocationEvent, MessageAddedEvent } from '../../../hooks/events.js';
9
- import { createMockAgent } from '../../../__fixtures__/agent-helpers.js';
10
- import { logger } from '../../../logging/logger.js';
11
- // Mock the AWS SDK clients. Command classes are stubbed to echo their input as `{ input }`, so a
12
- // test can assert on `send`'s argument — mirroring src/session/__tests__/s3-storage.test.ts. Client
13
- // constructors return a stub with a `send` spy; tests that exercise behavior inject their own client
14
- // instead (the store accepts `config.runtimeClient` / `config.agentClient` / `config.s3.client`).
15
- vi.mock('@aws-sdk/client-bedrock-agent-runtime', () => ({
16
- BedrockAgentRuntimeClient: vi.fn().mockImplementation(function () {
17
- return { send: vi.fn() };
18
- }),
19
- RetrieveCommand: vi.fn().mockImplementation(function (input) {
20
- return { input };
21
- }),
22
- }));
23
- vi.mock('@aws-sdk/client-bedrock-agent', () => ({
24
- BedrockAgentClient: vi.fn().mockImplementation(function () {
25
- return { send: vi.fn() };
26
- }),
27
- IngestKnowledgeBaseDocumentsCommand: vi.fn().mockImplementation(function (input) {
28
- return { input, _command: 'IngestKnowledgeBaseDocuments' };
29
- }),
30
- GetKnowledgeBaseCommand: vi.fn().mockImplementation(function (input) {
31
- return { input, _command: 'GetKnowledgeBase' };
32
- }),
33
- }));
34
- vi.mock('@aws-sdk/client-s3', () => ({
35
- S3Client: vi.fn().mockImplementation(function () {
36
- return { send: vi.fn() };
37
- }),
38
- PutObjectCommand: vi.fn().mockImplementation(function (input) {
39
- return { input };
40
- }),
41
- }));
42
- // uuid v7 backs both the S3 object key and the CUSTOM document id; pin it for deterministic assertions.
43
- vi.mock('uuid', () => ({
44
- v7: vi.fn().mockReturnValue('test-uuid-v7'),
45
- }));
46
- /** A stub AWS client whose `send` is a spy the test can program and inspect. */
47
- function mockClient() {
48
- return { send: vi.fn() };
49
- }
50
- /**
51
- * Programs an agent client's `send` to discriminate by command: a {@link GetKnowledgeBaseCommand}
52
- * resolves to a knowledge base of `kbType` (driving search-config selection), while everything else
53
- * (i.e. ingestion) resolves to `{}`. Defaults to a `VECTOR` knowledge base.
54
- */
55
- function programAgentSend(agent, kbType = 'VECTOR') {
56
- agent.send.mockImplementation((command) => command?._command === 'GetKnowledgeBase'
57
- ? Promise.resolve({ knowledgeBase: { knowledgeBaseConfiguration: { type: kbType } } })
58
- : Promise.resolve({}));
59
- }
60
- /**
61
- * Builds a store from a base connection config plus per-store fields. `config` overrides merge onto
62
- * the shared connection (`knowledgeBaseId: 'kb-1'` + injected runtime/agent clients); `overrides`
63
- * carry the per-store fields that sit outside `config` (`name`, `scope`, `writable`, ...). The
64
- * returned `runtime` / `agent` spies are the injected clients, ready to program and inspect.
65
- */
66
- function makeStore(overrides = {}, configOverrides = {}) {
67
- const runtime = mockClient();
68
- runtime.send.mockResolvedValue({ retrievalResults: [] });
69
- const agent = mockClient();
70
- programAgentSend(agent);
71
- const store = new BedrockKnowledgeBaseStore({
72
- config: { knowledgeBaseId: 'kb-1', runtimeClient: runtime, agentClient: agent, ...configOverrides },
73
- name: 'kb',
74
- ...overrides,
75
- });
76
- return { store, runtime, agent };
77
- }
78
- /** A writable CUSTOM store built via {@link makeStore}, with the data source wired into `config`. */
79
- function makeCustomStore(overrides = {}, configOverrides = {}) {
80
- const { store, agent } = makeStore({ writable: true, ...overrides }, { dataSourceType: 'CUSTOM', dataSourceId: 'ds-1', ...configOverrides });
81
- return { store, agent };
82
- }
83
- /** A writable S3 store built via {@link makeStore}, with the data source + bucket wired into `config`. */
84
- function makeS3Store(overrides = {}, configOverrides = {}) {
85
- const s3 = mockClient();
86
- s3.send.mockResolvedValue({});
87
- const { store, agent } = makeStore({ writable: true, ...overrides }, {
88
- dataSourceType: 'S3',
89
- dataSourceId: 'ds-1',
90
- s3: { bucket: 'my-bucket', client: s3, prefix: 'memories' },
91
- ...configOverrides,
92
- });
93
- return { store, agent, s3 };
94
- }
95
- /** Reads the filter the most recent RetrieveCommand was sent with. */
96
- function lastSearchFilter(runtime) {
97
- const calls = runtime.send.mock.calls;
98
- return calls[calls.length - 1]?.[0].input.retrievalConfiguration.vectorSearchConfiguration.filter;
99
- }
100
- /** Reads the inline attributes the most recent CUSTOM ingestion document carried. */
101
- function lastInlineAttributes(agent) {
102
- const calls = agent.send.mock.calls;
103
- return calls[calls.length - 1]?.[0].input.documents[0].metadata?.inlineAttributes ?? [];
104
- }
105
- describe('BedrockKnowledgeBaseStore', () => {
106
- beforeEach(() => {
107
- vi.clearAllMocks();
108
- });
109
- describe('constructor', () => {
110
- it('exposes name and defaults writable to false', () => {
111
- const { store } = makeStore();
112
- expect(store.name).toBe('kb');
113
- expect(store.writable).toBe(false);
114
- expect(store.description).toBeUndefined();
115
- expect(store.maxSearchResults).toBeUndefined();
116
- });
117
- it('keeps name and scope as independent fields', () => {
118
- const { store } = makeStore({ name: 'explicit', scope: 'user-abc' });
119
- expect(store.name).toBe('explicit');
120
- expect(store.scope).toBe('user-abc');
121
- });
122
- it('requires name at the type level', () => {
123
- // @ts-expect-error name is required
124
- new BedrockKnowledgeBaseStore({ config: { knowledgeBaseId: 'kb-1' }, scope: 'user-abc' });
125
- });
126
- it('carries through description and maxSearchResults', () => {
127
- const { store } = makeStore({ description: 'product docs', maxSearchResults: 7 });
128
- expect(store.description).toBe('product docs');
129
- expect(store.maxSearchResults).toBe(7);
130
- });
131
- it('throws when writable is true but dataSourceType is omitted', () => {
132
- expect(() => makeStore({ writable: true })).toThrow("add requires dataSourceType 'CUSTOM' or 'S3'");
133
- });
134
- it("throws when writable is true but dataSourceType is 'OTHER'", () => {
135
- expect(() => makeStore({ writable: true }, { dataSourceType: 'OTHER' })).toThrow("add requires dataSourceType 'CUSTOM' or 'S3'");
136
- });
137
- it('throws when maxSearchResults is less than 1', () => {
138
- expect(() => makeStore({ maxSearchResults: 0 })).toThrow('maxSearchResults must be at least 1');
139
- expect(() => makeStore({ maxSearchResults: -5 })).toThrow('maxSearchResults must be at least 1');
140
- });
141
- it("allows writable with a 'CUSTOM' data source", () => {
142
- const { store } = makeCustomStore();
143
- expect(store.writable).toBe(true);
144
- });
145
- it("allows writable with an 'S3' data source", () => {
146
- const { store } = makeS3Store();
147
- expect(store.writable).toBe(true);
148
- });
149
- it('constructs a default runtime client when none is injected', () => {
150
- new BedrockKnowledgeBaseStore({ config: { knowledgeBaseId: 'kb-1' }, name: 'kb' });
151
- expect(vi.mocked(BedrockAgentRuntimeClient)).toHaveBeenCalledWith({});
152
- });
153
- it('uses the injected runtime client without constructing one', () => {
154
- makeStore();
155
- expect(vi.mocked(BedrockAgentRuntimeClient)).not.toHaveBeenCalled();
156
- });
157
- });
158
- describe('extraction config', () => {
159
- const extractor = { extract: vi.fn() };
160
- it('defaults extraction to undefined', () => {
161
- const { store } = makeStore();
162
- expect(store.extraction).toBeUndefined();
163
- });
164
- it('exposes a configured extraction config verbatim', () => {
165
- const extraction = { trigger: new InvocationTrigger(), extractor };
166
- const { store } = makeCustomStore({ extraction });
167
- expect(store.extraction).toBe(extraction);
168
- });
169
- it('exposes the boolean shorthand verbatim', () => {
170
- // The store passes `extraction` straight through; the MemoryManager resolves the shorthand and
171
- // (since a KB is add-only, with no addMessages) defaults it to a ModelExtractor.
172
- const { store } = makeCustomStore({ extraction: true });
173
- expect(store.extraction).toBe(true);
174
- });
175
- });
176
- describe('search', () => {
177
- it('issues a RetrieveCommand with the query and a default result limit of 10', async () => {
178
- const { store, runtime } = makeStore();
179
- await store.search('how do refunds work');
180
- expect(runtime.send).toHaveBeenCalledWith(expect.objectContaining({
181
- input: {
182
- knowledgeBaseId: 'kb-1',
183
- retrievalQuery: { text: 'how do refunds work' },
184
- retrievalConfiguration: { vectorSearchConfiguration: { numberOfResults: 10 } },
185
- },
186
- }));
187
- });
188
- it("uses the store's maxSearchResults when the caller omits one", async () => {
189
- const { store, runtime } = makeStore({ maxSearchResults: 5 });
190
- await store.search('q');
191
- expect(runtime.send).toHaveBeenCalledWith(expect.objectContaining({
192
- input: expect.objectContaining({
193
- retrievalConfiguration: { vectorSearchConfiguration: { numberOfResults: 5 } },
194
- }),
195
- }));
196
- });
197
- it('lets a per-call maxSearchResults override the store default', async () => {
198
- const { store, runtime } = makeStore({ maxSearchResults: 5 });
199
- await store.search('q', { maxSearchResults: 2 });
200
- expect(runtime.send).toHaveBeenCalledWith(expect.objectContaining({
201
- input: expect.objectContaining({
202
- retrievalConfiguration: { vectorSearchConfiguration: { numberOfResults: 2 } },
203
- }),
204
- }));
205
- });
206
- it('derives a scope filter (default key "namespace") and applies it to retrieval', async () => {
207
- const { store, runtime } = makeStore({ scope: 'user-123' });
208
- await store.search('q');
209
- expect(runtime.send).toHaveBeenCalledWith(expect.objectContaining({
210
- input: expect.objectContaining({
211
- retrievalConfiguration: {
212
- vectorSearchConfiguration: {
213
- numberOfResults: 10,
214
- filter: { equals: { key: 'namespace', value: 'user-123' } },
215
- },
216
- },
217
- }),
218
- }));
219
- });
220
- it('honors a custom scopeMetadataKey when building the scope filter', async () => {
221
- const { store, runtime } = makeStore({ scope: 'acme' }, { scopeMetadataKey: 'tenant' });
222
- await store.search('q');
223
- expect(runtime.send).toHaveBeenCalledWith(expect.objectContaining({
224
- input: expect.objectContaining({
225
- retrievalConfiguration: expect.objectContaining({
226
- vectorSearchConfiguration: expect.objectContaining({
227
- filter: { equals: { key: 'tenant', value: 'acme' } },
228
- }),
229
- }),
230
- }),
231
- }));
232
- });
233
- it('prefers an explicit filter over a scope-derived one', async () => {
234
- const filter = { equals: { key: 'custom', value: 'v' } };
235
- const { store, runtime } = makeStore({ scope: 'ignored', filter });
236
- await store.search('q');
237
- expect(runtime.send).toHaveBeenCalledWith(expect.objectContaining({
238
- input: expect.objectContaining({
239
- retrievalConfiguration: expect.objectContaining({
240
- vectorSearchConfiguration: expect.objectContaining({ filter }),
241
- }),
242
- }),
243
- }));
244
- });
245
- it('maps content, metadata, location, and score onto each entry', async () => {
246
- const { store, runtime } = makeStore();
247
- runtime.send.mockResolvedValue({
248
- retrievalResults: [
249
- {
250
- content: { text: 'refunds take 5 days' },
251
- metadata: { source: 'faq' },
252
- location: { type: 'S3', s3Location: { uri: 's3://b/k' } },
253
- score: 0.92,
254
- },
255
- ],
256
- });
257
- const results = await store.search('q');
258
- expect(results).toStrictEqual([
259
- {
260
- content: 'refunds take 5 days',
261
- metadata: {
262
- source: 'faq',
263
- _sourceLocation: { type: 'S3', s3Location: { uri: 's3://b/k' } },
264
- _relevanceScore: 0.92,
265
- },
266
- },
267
- ]);
268
- });
269
- it('defaults missing content to an empty string and omits absent metadata', async () => {
270
- const { store, runtime } = makeStore();
271
- runtime.send.mockResolvedValue({ retrievalResults: [{}] });
272
- const results = await store.search('q');
273
- expect(results).toStrictEqual([{ content: '', metadata: {} }]);
274
- });
275
- it('returns an empty array when the knowledge base yields no results', async () => {
276
- const { store } = makeStore();
277
- await expect(store.search('q')).resolves.toStrictEqual([]);
278
- });
279
- it('returns an empty array when the response omits retrievalResults entirely', async () => {
280
- const { store, runtime } = makeStore();
281
- runtime.send.mockResolvedValue({});
282
- await expect(store.search('q')).resolves.toStrictEqual([]);
283
- });
284
- it('logs and rethrows when the retrieve call fails', async () => {
285
- const errorSpy = vi.spyOn(logger, 'error').mockImplementation(() => { });
286
- const { store, runtime } = makeStore();
287
- runtime.send.mockRejectedValue(new Error('retrieve boom'));
288
- await expect(store.search('q')).rejects.toThrow('retrieve boom');
289
- expect(errorSpy).toHaveBeenCalled();
290
- errorSpy.mockRestore();
291
- });
292
- /** Reads the retrievalConfiguration the most recent RetrieveCommand was sent with. */
293
- function lastRetrievalConfiguration(runtime) {
294
- const calls = runtime.send.mock.calls;
295
- return calls[calls.length - 1]?.[0].input.retrievalConfiguration;
296
- }
297
- it('detects the kind from GetKnowledgeBase using the knowledge base id', async () => {
298
- const { store, agent } = makeStore();
299
- await store.search('q');
300
- const detectCall = agent.send.mock.calls.find((c) => c[0]?._command === 'GetKnowledgeBase');
301
- expect(detectCall?.[0].input).toStrictEqual({ knowledgeBaseId: 'kb-1' });
302
- });
303
- it('queries a managed knowledge base with managedSearchConfiguration', async () => {
304
- const { store, runtime, agent } = makeStore();
305
- programAgentSend(agent, 'MANAGED');
306
- await store.search('q');
307
- expect(lastRetrievalConfiguration(runtime)).toStrictEqual({
308
- managedSearchConfiguration: { numberOfResults: 10 },
309
- });
310
- });
311
- it('carries the scope filter into managedSearchConfiguration', async () => {
312
- const { store, runtime, agent } = makeStore({ scope: 'user-123' });
313
- programAgentSend(agent, 'MANAGED');
314
- await store.search('q');
315
- expect(lastRetrievalConfiguration(runtime)).toStrictEqual({
316
- managedSearchConfiguration: {
317
- numberOfResults: 10,
318
- filter: { equals: { key: 'namespace', value: 'user-123' } },
319
- },
320
- });
321
- });
322
- it('queries a vector knowledge base with vectorSearchConfiguration', async () => {
323
- // makeStore reports VECTOR by default.
324
- const { store, runtime } = makeStore();
325
- await store.search('q');
326
- expect(lastRetrievalConfiguration(runtime)).toStrictEqual({
327
- vectorSearchConfiguration: { numberOfResults: 10 },
328
- });
329
- });
330
- it('treats non-managed types as vector', async () => {
331
- const { store, runtime, agent } = makeStore();
332
- programAgentSend(agent, 'KENDRA');
333
- await store.search('q');
334
- expect(lastRetrievalConfiguration(runtime)).toHaveProperty('vectorSearchConfiguration');
335
- });
336
- it('detects the kind once and reuses it across searches', async () => {
337
- const { store, agent } = makeStore();
338
- programAgentSend(agent, 'MANAGED');
339
- await store.search('q');
340
- await store.search('q');
341
- const detectCalls = agent.send.mock.calls.filter((c) => c[0]?._command === 'GetKnowledgeBase');
342
- expect(detectCalls).toHaveLength(1);
343
- });
344
- it('throws when detection fails', async () => {
345
- const { store, agent } = makeStore();
346
- agent.send.mockRejectedValue(new Error('AccessDenied'));
347
- await expect(store.search('q')).rejects.toThrow('AccessDenied');
348
- });
349
- it('initialize is idempotent', async () => {
350
- const { store, agent } = makeStore();
351
- await store.initialize();
352
- await store.initialize();
353
- const detectCalls = agent.send.mock.calls.filter((c) => c[0]?._command === 'GetKnowledgeBase');
354
- expect(detectCalls).toHaveLength(1);
355
- });
356
- });
357
- describe('add — CUSTOM data source', () => {
358
- it('throws when dataSourceId is missing', () => {
359
- expect(() => makeStore({ writable: true }, { dataSourceType: 'CUSTOM' })).toThrow('dataSourceId is required');
360
- });
361
- it('throws when content is empty or whitespace-only', async () => {
362
- const { store } = makeCustomStore();
363
- await expect(store.add('')).rejects.toThrow('content must not be empty');
364
- await expect(store.add(' ')).rejects.toThrow('content must not be empty');
365
- });
366
- it('returns the generated custom document id', async () => {
367
- const { store } = makeCustomStore();
368
- await expect(store.add('fact')).resolves.toStrictEqual({ documentId: 'test-uuid-v7' });
369
- });
370
- it('uses the same id for the document identifier and the returned documentId', async () => {
371
- const { store, agent } = makeCustomStore();
372
- const result = await store.add('fact');
373
- const document = agent.send.mock.calls[0]?.[0].input.documents[0];
374
- expect(document.content.custom.customDocumentIdentifier.id).toBe(result.documentId);
375
- });
376
- it('ingests an inline CUSTOM document with no metadata field when no scope or metadata', async () => {
377
- const { store, agent } = makeCustomStore();
378
- await store.add('remember this');
379
- expect(agent.send).toHaveBeenCalledWith(expect.objectContaining({
380
- input: {
381
- knowledgeBaseId: 'kb-1',
382
- dataSourceId: 'ds-1',
383
- documents: [
384
- {
385
- content: {
386
- dataSourceType: 'CUSTOM',
387
- custom: {
388
- customDocumentIdentifier: { id: 'test-uuid-v7' },
389
- sourceType: 'IN_LINE',
390
- inlineContent: { type: 'TEXT', textContent: { data: 'remember this' } },
391
- },
392
- },
393
- },
394
- ],
395
- },
396
- }));
397
- });
398
- it('attaches the scope as a leading inline attribute', async () => {
399
- const { store, agent } = makeCustomStore({ scope: 'user-123' });
400
- await store.add('fact');
401
- const document = agent.send.mock.calls[0]?.[0].input.documents[0];
402
- expect(document.metadata.inlineAttributes).toStrictEqual([
403
- { key: 'namespace', value: { type: 'STRING', stringValue: 'user-123' } },
404
- ]);
405
- });
406
- it('drops metadata keys that collide with scopeMetadataKey and preserves scope', async () => {
407
- const { store, agent } = makeCustomStore({ scope: 'tenant-A' });
408
- const warnSpy = vi.spyOn(logger, 'warn');
409
- await store.add('fact', { namespace: 'tenant-EVIL', other: 'ok' });
410
- const document = agent.send.mock.calls[0]?.[0].input.documents[0];
411
- const attrs = document.metadata.inlineAttributes;
412
- expect(attrs.filter((a) => a.key === 'namespace')).toHaveLength(1);
413
- expect(attrs.find((a) => a.key === 'namespace').value.stringValue).toBe('tenant-A');
414
- expect(attrs.find((a) => a.key === 'other')).toBeDefined();
415
- expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining('collides with scopeMetadataKey'));
416
- warnSpy.mockRestore();
417
- });
418
- it('maps supported metadata value types and skips unsupported ones', async () => {
419
- const { store, agent } = makeCustomStore();
420
- await store.add('fact', {
421
- str: 'a',
422
- num: 1,
423
- bool: false,
424
- arr: ['x', 'y'],
425
- obj: { nested: true },
426
- nul: null,
427
- mixedArr: [1, 'a'],
428
- });
429
- const document = agent.send.mock.calls[0]?.[0].input.documents[0];
430
- expect(document.metadata.inlineAttributes).toStrictEqual([
431
- { key: 'str', value: { type: 'STRING', stringValue: 'a' } },
432
- { key: 'num', value: { type: 'NUMBER', numberValue: 1 } },
433
- { key: 'bool', value: { type: 'BOOLEAN', booleanValue: false } },
434
- { key: 'arr', value: { type: 'STRING_LIST', stringListValue: ['x', 'y'] } },
435
- ]);
436
- });
437
- it('logs and rethrows when ingestion fails', async () => {
438
- const errorSpy = vi.spyOn(logger, 'error').mockImplementation(() => { });
439
- const { store, agent } = makeCustomStore();
440
- agent.send.mockRejectedValue(new Error('ingest boom'));
441
- await expect(store.add('fact')).rejects.toThrow('ingest boom');
442
- expect(errorSpy).toHaveBeenCalled();
443
- errorSpy.mockRestore();
444
- });
445
- it('lazily constructs a default agent client when none is injected', async () => {
446
- // No injected agentClient, so construct directly rather than via the helper.
447
- const store = new BedrockKnowledgeBaseStore({
448
- config: { knowledgeBaseId: 'kb-1', dataSourceType: 'CUSTOM', dataSourceId: 'ds-1' },
449
- name: 'kb',
450
- writable: true,
451
- });
452
- await store.add('fact');
453
- expect(vi.mocked(BedrockAgentClient)).toHaveBeenCalledWith({});
454
- });
455
- it('attaches accessControlList verbatim in inline metadata', async () => {
456
- const acl = [{ access: 'ALLOW', name: 'alice@example.com', type: 'USER' }];
457
- const { store, agent } = makeCustomStore({ accessControlList: acl });
458
- await store.add('fact', { team: 'hr' });
459
- const doc = agent.send.mock.calls.find((c) => c[0]?.input?.documents)?.[0].input.documents[0];
460
- expect(doc.metadata.type).toBe('IN_LINE_ATTRIBUTE');
461
- expect(doc.metadata.accessControlList).toStrictEqual(acl);
462
- });
463
- it('raises when ACL is set but no inline attributes are present', async () => {
464
- const acl = [{ access: 'DENY', name: 'bob@example.com', type: 'USER' }];
465
- const { store } = makeCustomStore({ accessControlList: acl });
466
- await expect(store.add('fact')).rejects.toThrow('at least one metadata attribute');
467
- });
468
- it('carries both inline attributes and ACL when scope provides an attribute', async () => {
469
- const acl = [{ access: 'ALLOW', name: 'alice@example.com', type: 'USER' }];
470
- const { store, agent } = makeCustomStore({ scope: 'user-123', accessControlList: acl });
471
- await store.add('fact');
472
- const doc = agent.send.mock.calls.find((c) => c[0]?.input?.documents)?.[0].input.documents[0];
473
- expect(doc.metadata.accessControlList).toStrictEqual(acl);
474
- expect(doc.metadata.inlineAttributes).toStrictEqual([
475
- { key: 'namespace', value: { type: 'STRING', stringValue: 'user-123' } },
476
- ]);
477
- });
478
- it('rewrites a missing-ACL ValidationException to point at the param', async () => {
479
- const { store, agent } = makeCustomStore();
480
- const err = Object.assign(new Error('accessControlList is required when ACL is enabled'), {
481
- name: 'ValidationException',
482
- });
483
- agent.send.mockRejectedValueOnce(err);
484
- await expect(store.add('fact')).rejects.toThrow('accessControlList configured');
485
- });
486
- it('does not rewrite when ACL is already configured', async () => {
487
- const acl = [{ access: 'ALLOW', name: 'alice@example.com', type: 'USER' }];
488
- const { store, agent } = makeCustomStore({ scope: 'u', accessControlList: acl });
489
- const err = Object.assign(new Error('accessControlList is invalid'), { name: 'ValidationException' });
490
- agent.send.mockRejectedValueOnce(err);
491
- await expect(store.add('fact')).rejects.toThrow('accessControlList is invalid');
492
- });
493
- });
494
- describe('add — S3 data source', () => {
495
- it('throws when the s3 config is missing', () => {
496
- expect(() => makeStore({ writable: true }, { dataSourceType: 'S3', dataSourceId: 'ds-1' })).toThrow('s3 config is required');
497
- });
498
- it("returns the uploaded content object's s3:// URI as the document id", async () => {
499
- const { store } = makeS3Store();
500
- await expect(store.add('content')).resolves.toStrictEqual({
501
- documentId: 's3://my-bucket/memories/test-uuid-v7.txt',
502
- });
503
- });
504
- it('uploads the content object and ingests an S3 document referencing it (no sidecar)', async () => {
505
- const { store, agent, s3 } = makeS3Store();
506
- await store.add('s3 content');
507
- expect(s3.send).toHaveBeenCalledTimes(1);
508
- expect(s3.send).toHaveBeenCalledWith(expect.objectContaining({
509
- input: {
510
- Bucket: 'my-bucket',
511
- Key: 'memories/test-uuid-v7.txt',
512
- Body: 's3 content',
513
- ContentType: 'text/plain; charset=utf-8',
514
- },
515
- }));
516
- expect(agent.send).toHaveBeenCalledWith(expect.objectContaining({
517
- input: {
518
- knowledgeBaseId: 'kb-1',
519
- dataSourceId: 'ds-1',
520
- documents: [
521
- {
522
- content: {
523
- dataSourceType: 'S3',
524
- s3: { s3Location: { uri: 's3://my-bucket/memories/test-uuid-v7.txt' } },
525
- },
526
- },
527
- ],
528
- },
529
- }));
530
- });
531
- it('does not double up the slash when the prefix already ends in one', async () => {
532
- const client = mockClient();
533
- client.send.mockResolvedValue({});
534
- const { store } = makeS3Store({}, { s3: { bucket: 'my-bucket', client: client, prefix: 'memories/' } });
535
- await store.add('content');
536
- expect(client.send).toHaveBeenCalledWith(expect.objectContaining({ input: expect.objectContaining({ Key: 'memories/test-uuid-v7.txt' }) }));
537
- });
538
- it('writes a sidecar carrying the scope and points the document metadata at it', async () => {
539
- const { store, agent, s3 } = makeS3Store({ scope: 'team-a' });
540
- await store.add('content');
541
- expect(s3.send).toHaveBeenCalledTimes(2);
542
- expect(s3.send).toHaveBeenNthCalledWith(2, expect.objectContaining({
543
- input: {
544
- Bucket: 'my-bucket',
545
- Key: 'memories/test-uuid-v7.txt.metadata.json',
546
- Body: JSON.stringify({
547
- metadataAttributes: {
548
- namespace: { value: { type: 'STRING', stringValue: 'team-a' }, includeForEmbedding: false },
549
- },
550
- }),
551
- ContentType: 'application/json',
552
- },
553
- }));
554
- const document = agent.send.mock.calls[0]?.[0].input.documents[0];
555
- expect(document.metadata).toStrictEqual({
556
- type: 'S3_LOCATION',
557
- s3Location: { uri: 's3://my-bucket/memories/test-uuid-v7.txt.metadata.json' },
558
- });
559
- });
560
- it('writes a sidecar built from caller metadata', async () => {
561
- const { store, s3 } = makeS3Store();
562
- await store.add('content', { priority: 'high' });
563
- expect(s3.send).toHaveBeenCalledTimes(2);
564
- expect(s3.send).toHaveBeenNthCalledWith(2, expect.objectContaining({
565
- input: expect.objectContaining({
566
- Body: JSON.stringify({
567
- metadataAttributes: {
568
- priority: { value: { type: 'STRING', stringValue: 'high' }, includeForEmbedding: false },
569
- },
570
- }),
571
- }),
572
- }));
573
- });
574
- it('omits unsupported metadata values from the sidecar', async () => {
575
- const { store, s3 } = makeS3Store();
576
- await store.add('content', { keep: 'yes', drop: { nested: true } });
577
- expect(s3.send).toHaveBeenNthCalledWith(2, expect.objectContaining({
578
- input: expect.objectContaining({
579
- Body: JSON.stringify({
580
- metadataAttributes: {
581
- keep: { value: { type: 'STRING', stringValue: 'yes' }, includeForEmbedding: false },
582
- },
583
- }),
584
- }),
585
- }));
586
- });
587
- it('lazily constructs an agent client with no config when neither client nor config is given', async () => {
588
- const s3 = mockClient();
589
- s3.send.mockResolvedValue({});
590
- const store = new BedrockKnowledgeBaseStore({
591
- config: {
592
- knowledgeBaseId: 'kb-1',
593
- dataSourceType: 'S3',
594
- dataSourceId: 'ds-1',
595
- s3: { bucket: 'my-bucket', client: s3, prefix: 'memories' },
596
- },
597
- name: 'kb',
598
- writable: true,
599
- });
600
- await store.add('content');
601
- expect(vi.mocked(BedrockAgentClient)).toHaveBeenCalledWith({});
602
- });
603
- it('logs and rethrows when the S3 upload fails, before any ingestion', async () => {
604
- const errorSpy = vi.spyOn(logger, 'error').mockImplementation(() => { });
605
- const { store, agent, s3 } = makeS3Store();
606
- s3.send.mockRejectedValue(new Error('upload boom'));
607
- await expect(store.add('content')).rejects.toThrow('upload boom');
608
- expect(errorSpy).toHaveBeenCalled();
609
- expect(agent.send).not.toHaveBeenCalled();
610
- errorSpy.mockRestore();
611
- });
612
- it('writes ACL into the sidecar with capitalized keys', async () => {
613
- const acl = [{ access: 'ALLOW', name: 'alice@example.com', type: 'USER' }];
614
- const { store, s3 } = makeS3Store({ accessControlList: acl });
615
- await store.add('content');
616
- // The sidecar is the second send; parse it for the ACL.
617
- const sidecarCall = s3.send.mock.calls[1]?.[0].input;
618
- const sidecarBody = JSON.parse(sidecarCall.Body);
619
- expect(sidecarBody.accessControlList).toStrictEqual([
620
- { Name: 'alice@example.com', Type: 'USER', Access: 'ALLOW' },
621
- ]);
622
- });
623
- it('writes a sidecar for ACL-only when no scope or metadata', async () => {
624
- const acl = [{ access: 'DENY', name: 'bob@example.com', type: 'USER' }];
625
- const { store, s3 } = makeS3Store({ accessControlList: acl });
626
- await store.add('content');
627
- expect(s3.send).toHaveBeenCalledTimes(2);
628
- const sidecarBody = JSON.parse(s3.send.mock.calls[1]?.[0].input.Body);
629
- expect(sidecarBody.metadataAttributes).toStrictEqual({});
630
- expect(sidecarBody.accessControlList).toStrictEqual([{ Name: 'bob@example.com', Type: 'USER', Access: 'DENY' }]);
631
- });
632
- it('sidecar carries both scope attributes and ACL', async () => {
633
- const acl = [{ access: 'ALLOW', name: 'alice@example.com', type: 'USER' }];
634
- const { store, s3 } = makeS3Store({ scope: 'team-a', accessControlList: acl });
635
- await store.add('content');
636
- const sidecarBody = JSON.parse(s3.send.mock.calls[1]?.[0].input.Body);
637
- expect(sidecarBody.metadataAttributes.namespace.value.stringValue).toBe('team-a');
638
- expect(sidecarBody.accessControlList).toStrictEqual([
639
- { Name: 'alice@example.com', Type: 'USER', Access: 'ALLOW' },
640
- ]);
641
- });
642
- });
643
- describe('add — non-writable store', () => {
644
- it('throws when add is called on a non-writable store', async () => {
645
- const agent = mockClient();
646
- const store = new BedrockKnowledgeBaseStore({
647
- config: { knowledgeBaseId: 'kb-1', dataSourceType: 'OTHER', dataSourceId: 'ds-1', agentClient: agent },
648
- name: 'kb',
649
- });
650
- await expect(store.add('fact')).rejects.toThrow('store is not writable');
651
- expect(agent.send).not.toHaveBeenCalled();
652
- });
653
- });
654
- describe('config reuse across namespaces', () => {
655
- it('reuses an injected runtime client across stores built from the same config', async () => {
656
- const runtime = mockClient();
657
- runtime.send.mockResolvedValue({ retrievalResults: [] });
658
- const config = { knowledgeBaseId: 'kb-1', knowledgeBaseType: 'VECTOR', runtimeClient: runtime };
659
- const personal = new BedrockKnowledgeBaseStore({ config, name: 'personal', scope: 'user-abc' });
660
- const team = new BedrockKnowledgeBaseStore({ config, name: 'team', scope: 'other' });
661
- expect(vi.mocked(BedrockAgentRuntimeClient)).not.toHaveBeenCalled();
662
- await personal.search('q');
663
- expect(lastSearchFilter(runtime)).toStrictEqual({ equals: { key: 'namespace', value: 'user-abc' } });
664
- await team.search('q');
665
- expect(lastSearchFilter(runtime)).toStrictEqual({ equals: { key: 'namespace', value: 'other' } });
666
- });
667
- it('constructs a separate default runtime client per store when the config injects none', () => {
668
- const config = { knowledgeBaseId: 'kb-1' };
669
- new BedrockKnowledgeBaseStore({ config, name: 'a' });
670
- new BedrockKnowledgeBaseStore({ config, name: 'b' });
671
- expect(vi.mocked(BedrockAgentRuntimeClient)).toHaveBeenCalledTimes(2);
672
- });
673
- it('inherits the data source from the shared config when writing', async () => {
674
- const agent = mockClient();
675
- agent.send.mockResolvedValue({});
676
- const config = {
677
- knowledgeBaseId: 'kb-shared',
678
- dataSourceType: 'CUSTOM',
679
- dataSourceId: 'ds-shared',
680
- agentClient: agent,
681
- };
682
- const store = new BedrockKnowledgeBaseStore({ config, name: 'personal', scope: 'user-abc', writable: true });
683
- await store.add('fact');
684
- expect(agent.send).toHaveBeenCalledWith(expect.objectContaining({
685
- input: expect.objectContaining({ knowledgeBaseId: 'kb-shared', dataSourceId: 'ds-shared' }),
686
- }));
687
- });
688
- it('registers distinct-name stores together in a MemoryManager', () => {
689
- const config = { knowledgeBaseId: 'kb-1', runtimeClient: mockClient() };
690
- const personal = new BedrockKnowledgeBaseStore({ config, name: 'personal', scope: 'user-abc' });
691
- const team = new BedrockKnowledgeBaseStore({ config, name: 'team', scope: 'other' });
692
- expect(() => new MemoryManager({ stores: [personal, team] })).not.toThrow();
693
- });
694
- it('rejects two stores with the same name in a MemoryManager', () => {
695
- const config = { knowledgeBaseId: 'kb-1', runtimeClient: mockClient() };
696
- const a = new BedrockKnowledgeBaseStore({ config, name: 'dupe', scope: 'user-abc' });
697
- const b = new BedrockKnowledgeBaseStore({ config, name: 'dupe', scope: 'other' });
698
- expect(() => new MemoryManager({ stores: [a, b] })).toThrow("duplicate store name 'dupe'");
699
- });
700
- });
701
- describe('scope and filter resolution', () => {
702
- it('applies no filter when the store has no scope', async () => {
703
- const { store, runtime } = makeStore();
704
- await store.search('q');
705
- expect(lastSearchFilter(runtime)).toBeUndefined();
706
- });
707
- it('scopes writes by scope even when an explicit search filter is set (search/write asymmetry)', async () => {
708
- const { store, agent } = makeCustomStore({ scope: 'tenant-a', filter: { equals: { key: 'custom', value: 'v' } } });
709
- await store.add('fact');
710
- expect(lastInlineAttributes(agent)).toStrictEqual([
711
- { key: 'namespace', value: { type: 'STRING', stringValue: 'tenant-a' } },
712
- ]);
713
- });
714
- });
715
- describe('metadata logging', () => {
716
- it('logs a debug line when a CUSTOM document drops an unsupported metadata value', async () => {
717
- const debugSpy = vi.spyOn(logger, 'debug').mockImplementation(() => { });
718
- const { store } = makeCustomStore();
719
- await store.add('fact', { good: 'v', bad: { nested: true } });
720
- expect(debugSpy).toHaveBeenCalledWith(expect.stringContaining('key=<bad>'));
721
- expect(debugSpy).not.toHaveBeenCalledWith(expect.stringContaining('key=<good>'));
722
- debugSpy.mockRestore();
723
- });
724
- });
725
- // End-to-end: a writable CUSTOM store carrying an extraction config is picked up by MemoryManager,
726
- // and on a trigger fire the extracted facts are ingested through the store's own `add` (i.e. via
727
- // IngestKnowledgeBaseDocuments on the injected agent client). No AWS calls; clients are mocked.
728
- describe('extraction via MemoryManager', () => {
729
- it('ingests extracted facts through add when the trigger fires', async () => {
730
- const extractor = {
731
- extract: vi.fn().mockResolvedValue([{ content: 'user prefers dark mode' }]),
732
- };
733
- const { store, agent: agentClient } = makeCustomStore({
734
- extraction: { trigger: new InvocationTrigger(), extractor },
735
- });
736
- const mm = new MemoryManager({ stores: [store] });
737
- const agent = createMockAgent();
738
- await mm.initAgent(agent);
739
- // Buffer a turn, then fire the after-invocation hook and flush the background save.
740
- const message = new Message({ role: 'user', content: [new TextBlock('I like dark mode')] });
741
- const added = agent.trackedHooks.filter((h) => h.eventType === MessageAddedEvent);
742
- for (const hook of added)
743
- await hook.callback(new MessageAddedEvent({ agent, message, invocationState: {} }));
744
- const after = agent.trackedHooks.filter((h) => h.eventType === AfterInvocationEvent);
745
- for (const hook of after)
746
- await hook.callback(new AfterInvocationEvent({ agent, invocationState: {} }));
747
- await mm.flush();
748
- expect(extractor.extract).toHaveBeenCalledTimes(1);
749
- // The fact was ingested via IngestKnowledgeBaseDocuments with the extracted content.
750
- // First call is GetKnowledgeBase (from initialize), second is IngestKnowledgeBaseDocuments.
751
- const ingestCalls = agentClient.send.mock.calls.filter((c) => c[0]?._command === 'IngestKnowledgeBaseDocuments');
752
- expect(ingestCalls).toHaveLength(1);
753
- const document = ingestCalls[0]?.[0].input.documents[0];
754
- expect(document.content.custom.inlineContent.textContent.data).toBe('user prefers dark mode');
755
- });
756
- });
757
- });
758
- //# sourceMappingURL=bedrock-knowledge-base-store.test.node.js.map