@strands-agents/sdk 1.7.0 → 1.8.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 (659) hide show
  1. package/dist/src/agent/agent.d.ts +1 -1
  2. package/dist/src/agent/agent.d.ts.map +1 -1
  3. package/dist/src/agent/agent.js +1 -1
  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/index.d.ts +1 -1
  8. package/dist/src/index.d.ts.map +1 -1
  9. package/dist/src/index.js +1 -1
  10. package/dist/src/index.js.map +1 -1
  11. package/dist/src/index.node.d.ts.map +1 -1
  12. package/dist/src/index.node.js +3 -0
  13. package/dist/src/index.node.js.map +1 -1
  14. package/dist/src/interventions/actions.d.ts.map +1 -1
  15. package/dist/src/interventions/actions.js.map +1 -1
  16. package/dist/src/{mcp.d.ts → mcp/client.d.ts} +13 -4
  17. package/dist/src/mcp/client.d.ts.map +1 -0
  18. package/dist/src/{mcp.js → mcp/client.js} +15 -3
  19. package/dist/src/mcp/client.js.map +1 -0
  20. package/dist/src/mcp/config.d.ts +52 -0
  21. package/dist/src/mcp/config.d.ts.map +1 -0
  22. package/dist/src/mcp/config.js +12 -0
  23. package/dist/src/mcp/config.js.map +1 -0
  24. package/dist/src/mcp/config.node.d.ts +16 -0
  25. package/dist/src/mcp/config.node.d.ts.map +1 -0
  26. package/dist/src/mcp/config.node.js +145 -0
  27. package/dist/src/mcp/config.node.js.map +1 -0
  28. package/dist/src/mcp/index.d.ts +3 -0
  29. package/dist/src/mcp/index.d.ts.map +1 -0
  30. package/dist/src/mcp/index.js +2 -0
  31. package/dist/src/mcp/index.js.map +1 -0
  32. package/dist/src/models/model.d.ts.map +1 -1
  33. package/dist/src/models/model.js +2 -1
  34. package/dist/src/models/model.js.map +1 -1
  35. package/dist/src/multiagent/graph.d.ts +7 -0
  36. package/dist/src/multiagent/graph.d.ts.map +1 -1
  37. package/dist/src/multiagent/graph.js +22 -1
  38. package/dist/src/multiagent/graph.js.map +1 -1
  39. package/dist/src/multiagent/nodes.d.ts +5 -0
  40. package/dist/src/multiagent/nodes.d.ts.map +1 -1
  41. package/dist/src/multiagent/nodes.js +15 -0
  42. package/dist/src/multiagent/nodes.js.map +1 -1
  43. package/dist/src/multiagent/state.d.ts.map +1 -1
  44. package/dist/src/multiagent/state.js.map +1 -1
  45. package/dist/src/tools/function-tool.d.ts +1 -1
  46. package/dist/src/tools/function-tool.d.ts.map +1 -1
  47. package/dist/src/tools/function-tool.js +4 -12
  48. package/dist/src/tools/function-tool.js.map +1 -1
  49. package/dist/src/tools/mcp-tool.d.ts +2 -1
  50. package/dist/src/tools/mcp-tool.d.ts.map +1 -1
  51. package/dist/src/tools/mcp-tool.js +1 -0
  52. package/dist/src/tools/mcp-tool.js.map +1 -1
  53. package/dist/src/tools/tool-factory.d.ts +1 -1
  54. package/dist/src/tools/tool-factory.d.ts.map +1 -1
  55. package/dist/src/tools/types.d.ts +4 -0
  56. package/dist/src/tools/types.d.ts.map +1 -1
  57. package/dist/src/tools/zod-tool.d.ts +4 -2
  58. package/dist/src/tools/zod-tool.d.ts.map +1 -1
  59. package/dist/src/tools/zod-tool.js.map +1 -1
  60. package/dist/src/tsconfig.tsbuildinfo +1 -1
  61. package/dist/src/types/media.d.ts.map +1 -1
  62. package/dist/src/types/media.js.map +1 -1
  63. package/dist/src/types/messages.d.ts.map +1 -1
  64. package/dist/src/types/messages.js.map +1 -1
  65. package/dist/src/vended-memory-stores/local/index.d.ts +2 -0
  66. package/dist/src/vended-memory-stores/local/index.d.ts.map +1 -0
  67. package/dist/src/vended-memory-stores/local/index.js +2 -0
  68. package/dist/src/vended-memory-stores/local/index.js.map +1 -0
  69. package/dist/src/vended-memory-stores/local/store.d.ts +122 -0
  70. package/dist/src/vended-memory-stores/local/store.d.ts.map +1 -0
  71. package/dist/src/vended-memory-stores/local/store.js +281 -0
  72. package/dist/src/vended-memory-stores/local/store.js.map +1 -0
  73. package/dist/src/vended-plugins/context-offloader/search.d.ts.map +1 -1
  74. package/dist/src/vended-plugins/context-offloader/search.js +4 -2
  75. package/dist/src/vended-plugins/context-offloader/search.js.map +1 -1
  76. package/dist/src/vended-plugins/context-offloader/storage.js +1 -1
  77. package/dist/src/vended-plugins/context-offloader/storage.js.map +1 -1
  78. package/dist/src/vended-plugins/skills/skill.d.ts.map +1 -1
  79. package/dist/src/vended-plugins/skills/skill.js.map +1 -1
  80. package/dist/src/vended-tools/notebook/notebook.d.ts +1 -1
  81. package/package.json +21 -14
  82. package/dist/src/__fixtures__/agent-helpers.d.ts +0 -136
  83. package/dist/src/__fixtures__/agent-helpers.d.ts.map +0 -1
  84. package/dist/src/__fixtures__/agent-helpers.js +0 -156
  85. package/dist/src/__fixtures__/agent-helpers.js.map +0 -1
  86. package/dist/src/__fixtures__/environment.d.ts +0 -12
  87. package/dist/src/__fixtures__/environment.d.ts.map +0 -1
  88. package/dist/src/__fixtures__/environment.js +0 -12
  89. package/dist/src/__fixtures__/environment.js.map +0 -1
  90. package/dist/src/__fixtures__/metrics-helpers.d.ts +0 -55
  91. package/dist/src/__fixtures__/metrics-helpers.d.ts.map +0 -1
  92. package/dist/src/__fixtures__/metrics-helpers.js +0 -57
  93. package/dist/src/__fixtures__/metrics-helpers.js.map +0 -1
  94. package/dist/src/__fixtures__/mock-message-model.d.ts +0 -103
  95. package/dist/src/__fixtures__/mock-message-model.d.ts.map +0 -1
  96. package/dist/src/__fixtures__/mock-message-model.js +0 -245
  97. package/dist/src/__fixtures__/mock-message-model.js.map +0 -1
  98. package/dist/src/__fixtures__/mock-meter.d.ts +0 -32
  99. package/dist/src/__fixtures__/mock-meter.d.ts.map +0 -1
  100. package/dist/src/__fixtures__/mock-meter.js +0 -47
  101. package/dist/src/__fixtures__/mock-meter.js.map +0 -1
  102. package/dist/src/__fixtures__/mock-plugin.d.ts +0 -13
  103. package/dist/src/__fixtures__/mock-plugin.d.ts.map +0 -1
  104. package/dist/src/__fixtures__/mock-plugin.js +0 -35
  105. package/dist/src/__fixtures__/mock-plugin.js.map +0 -1
  106. package/dist/src/__fixtures__/mock-span.d.ts +0 -78
  107. package/dist/src/__fixtures__/mock-span.d.ts.map +0 -1
  108. package/dist/src/__fixtures__/mock-span.js +0 -93
  109. package/dist/src/__fixtures__/mock-span.js.map +0 -1
  110. package/dist/src/__fixtures__/mock-storage-provider.d.ts +0 -42
  111. package/dist/src/__fixtures__/mock-storage-provider.d.ts.map +0 -1
  112. package/dist/src/__fixtures__/mock-storage-provider.js +0 -122
  113. package/dist/src/__fixtures__/mock-storage-provider.js.map +0 -1
  114. package/dist/src/__fixtures__/model-test-helpers.d.ts +0 -56
  115. package/dist/src/__fixtures__/model-test-helpers.d.ts.map +0 -1
  116. package/dist/src/__fixtures__/model-test-helpers.js +0 -85
  117. package/dist/src/__fixtures__/model-test-helpers.js.map +0 -1
  118. package/dist/src/__fixtures__/register-node-defaults.d.ts +0 -2
  119. package/dist/src/__fixtures__/register-node-defaults.d.ts.map +0 -1
  120. package/dist/src/__fixtures__/register-node-defaults.js +0 -6
  121. package/dist/src/__fixtures__/register-node-defaults.js.map +0 -1
  122. package/dist/src/__fixtures__/slim-types.d.ts +0 -51
  123. package/dist/src/__fixtures__/slim-types.d.ts.map +0 -1
  124. package/dist/src/__fixtures__/slim-types.js +0 -6
  125. package/dist/src/__fixtures__/slim-types.js.map +0 -1
  126. package/dist/src/__fixtures__/test-sandbox.node.d.ts +0 -15
  127. package/dist/src/__fixtures__/test-sandbox.node.d.ts.map +0 -1
  128. package/dist/src/__fixtures__/test-sandbox.node.js +0 -23
  129. package/dist/src/__fixtures__/test-sandbox.node.js.map +0 -1
  130. package/dist/src/__fixtures__/tool-helpers.d.ts +0 -45
  131. package/dist/src/__fixtures__/tool-helpers.d.ts.map +0 -1
  132. package/dist/src/__fixtures__/tool-helpers.js +0 -101
  133. package/dist/src/__fixtures__/tool-helpers.js.map +0 -1
  134. package/dist/src/__tests__/default-slot.test.d.ts +0 -2
  135. package/dist/src/__tests__/default-slot.test.d.ts.map +0 -1
  136. package/dist/src/__tests__/default-slot.test.js +0 -33
  137. package/dist/src/__tests__/default-slot.test.js.map +0 -1
  138. package/dist/src/__tests__/errors.test.d.ts +0 -2
  139. package/dist/src/__tests__/errors.test.d.ts.map +0 -1
  140. package/dist/src/__tests__/errors.test.js +0 -170
  141. package/dist/src/__tests__/errors.test.js.map +0 -1
  142. package/dist/src/__tests__/index.test.d.ts +0 -2
  143. package/dist/src/__tests__/index.test.d.ts.map +0 -1
  144. package/dist/src/__tests__/index.test.js +0 -48
  145. package/dist/src/__tests__/index.test.js.map +0 -1
  146. package/dist/src/__tests__/interrupt.test.d.ts +0 -2
  147. package/dist/src/__tests__/interrupt.test.d.ts.map +0 -1
  148. package/dist/src/__tests__/interrupt.test.js +0 -264
  149. package/dist/src/__tests__/interrupt.test.js.map +0 -1
  150. package/dist/src/__tests__/mcp.test.d.ts +0 -2
  151. package/dist/src/__tests__/mcp.test.d.ts.map +0 -1
  152. package/dist/src/__tests__/mcp.test.js +0 -1003
  153. package/dist/src/__tests__/mcp.test.js.map +0 -1
  154. package/dist/src/__tests__/mime.test.d.ts +0 -2
  155. package/dist/src/__tests__/mime.test.d.ts.map +0 -1
  156. package/dist/src/__tests__/mime.test.js +0 -83
  157. package/dist/src/__tests__/mime.test.js.map +0 -1
  158. package/dist/src/__tests__/state-store.test.d.ts +0 -2
  159. package/dist/src/__tests__/state-store.test.d.ts.map +0 -1
  160. package/dist/src/__tests__/state-store.test.js +0 -285
  161. package/dist/src/__tests__/state-store.test.js.map +0 -1
  162. package/dist/src/a2a/__tests__/a2a-agent.test.d.ts +0 -2
  163. package/dist/src/a2a/__tests__/a2a-agent.test.d.ts.map +0 -1
  164. package/dist/src/a2a/__tests__/a2a-agent.test.js +0 -383
  165. package/dist/src/a2a/__tests__/a2a-agent.test.js.map +0 -1
  166. package/dist/src/a2a/__tests__/adapters.test.d.ts +0 -2
  167. package/dist/src/a2a/__tests__/adapters.test.d.ts.map +0 -1
  168. package/dist/src/a2a/__tests__/adapters.test.js +0 -151
  169. package/dist/src/a2a/__tests__/adapters.test.js.map +0 -1
  170. package/dist/src/a2a/__tests__/async-lock.test.d.ts +0 -2
  171. package/dist/src/a2a/__tests__/async-lock.test.d.ts.map +0 -1
  172. package/dist/src/a2a/__tests__/async-lock.test.js +0 -137
  173. package/dist/src/a2a/__tests__/async-lock.test.js.map +0 -1
  174. package/dist/src/a2a/__tests__/events.test.d.ts +0 -2
  175. package/dist/src/a2a/__tests__/events.test.d.ts.map +0 -1
  176. package/dist/src/a2a/__tests__/events.test.js +0 -68
  177. package/dist/src/a2a/__tests__/events.test.js.map +0 -1
  178. package/dist/src/a2a/__tests__/executor.test.d.ts +0 -2
  179. package/dist/src/a2a/__tests__/executor.test.d.ts.map +0 -1
  180. package/dist/src/a2a/__tests__/executor.test.js +0 -345
  181. package/dist/src/a2a/__tests__/executor.test.js.map +0 -1
  182. package/dist/src/a2a/__tests__/server.test.d.ts +0 -2
  183. package/dist/src/a2a/__tests__/server.test.d.ts.map +0 -1
  184. package/dist/src/a2a/__tests__/server.test.js +0 -71
  185. package/dist/src/a2a/__tests__/server.test.js.map +0 -1
  186. package/dist/src/a2a/__tests__/server.test.node.d.ts +0 -2
  187. package/dist/src/a2a/__tests__/server.test.node.d.ts.map +0 -1
  188. package/dist/src/a2a/__tests__/server.test.node.js +0 -110
  189. package/dist/src/a2a/__tests__/server.test.node.js.map +0 -1
  190. package/dist/src/agent/__tests__/agent-as-tool.invocation-state.test.d.ts +0 -2
  191. package/dist/src/agent/__tests__/agent-as-tool.invocation-state.test.d.ts.map +0 -1
  192. package/dist/src/agent/__tests__/agent-as-tool.invocation-state.test.js +0 -23
  193. package/dist/src/agent/__tests__/agent-as-tool.invocation-state.test.js.map +0 -1
  194. package/dist/src/agent/__tests__/agent-as-tool.test.d.ts +0 -2
  195. package/dist/src/agent/__tests__/agent-as-tool.test.d.ts.map +0 -1
  196. package/dist/src/agent/__tests__/agent-as-tool.test.js +0 -347
  197. package/dist/src/agent/__tests__/agent-as-tool.test.js.map +0 -1
  198. package/dist/src/agent/__tests__/agent.cancel.test.d.ts +0 -2
  199. package/dist/src/agent/__tests__/agent.cancel.test.d.ts.map +0 -1
  200. package/dist/src/agent/__tests__/agent.cancel.test.js +0 -337
  201. package/dist/src/agent/__tests__/agent.cancel.test.js.map +0 -1
  202. package/dist/src/agent/__tests__/agent.concurrent.test.d.ts +0 -2
  203. package/dist/src/agent/__tests__/agent.concurrent.test.d.ts.map +0 -1
  204. package/dist/src/agent/__tests__/agent.concurrent.test.js +0 -488
  205. package/dist/src/agent/__tests__/agent.concurrent.test.js.map +0 -1
  206. package/dist/src/agent/__tests__/agent.context-manager.test.d.ts +0 -2
  207. package/dist/src/agent/__tests__/agent.context-manager.test.d.ts.map +0 -1
  208. package/dist/src/agent/__tests__/agent.context-manager.test.js +0 -106
  209. package/dist/src/agent/__tests__/agent.context-manager.test.js.map +0 -1
  210. package/dist/src/agent/__tests__/agent.hook.test.d.ts +0 -2
  211. package/dist/src/agent/__tests__/agent.hook.test.d.ts.map +0 -1
  212. package/dist/src/agent/__tests__/agent.hook.test.js +0 -1332
  213. package/dist/src/agent/__tests__/agent.hook.test.js.map +0 -1
  214. package/dist/src/agent/__tests__/agent.interrupt.test.d.ts +0 -2
  215. package/dist/src/agent/__tests__/agent.interrupt.test.d.ts.map +0 -1
  216. package/dist/src/agent/__tests__/agent.interrupt.test.js +0 -779
  217. package/dist/src/agent/__tests__/agent.interrupt.test.js.map +0 -1
  218. package/dist/src/agent/__tests__/agent.invocation-state.test.d.ts +0 -2
  219. package/dist/src/agent/__tests__/agent.invocation-state.test.d.ts.map +0 -1
  220. package/dist/src/agent/__tests__/agent.invocation-state.test.js +0 -219
  221. package/dist/src/agent/__tests__/agent.invocation-state.test.js.map +0 -1
  222. package/dist/src/agent/__tests__/agent.model-retry.test.d.ts +0 -2
  223. package/dist/src/agent/__tests__/agent.model-retry.test.d.ts.map +0 -1
  224. package/dist/src/agent/__tests__/agent.model-retry.test.js +0 -161
  225. package/dist/src/agent/__tests__/agent.model-retry.test.js.map +0 -1
  226. package/dist/src/agent/__tests__/agent.stateful-model.test.d.ts +0 -2
  227. package/dist/src/agent/__tests__/agent.stateful-model.test.d.ts.map +0 -1
  228. package/dist/src/agent/__tests__/agent.stateful-model.test.js +0 -169
  229. package/dist/src/agent/__tests__/agent.stateful-model.test.js.map +0 -1
  230. package/dist/src/agent/__tests__/agent.test.d.ts +0 -2
  231. package/dist/src/agent/__tests__/agent.test.d.ts.map +0 -1
  232. package/dist/src/agent/__tests__/agent.test.js +0 -1624
  233. package/dist/src/agent/__tests__/agent.test.js.map +0 -1
  234. package/dist/src/agent/__tests__/agent.tracer.test.node.d.ts +0 -2
  235. package/dist/src/agent/__tests__/agent.tracer.test.node.d.ts.map +0 -1
  236. package/dist/src/agent/__tests__/agent.tracer.test.node.js +0 -535
  237. package/dist/src/agent/__tests__/agent.tracer.test.node.js.map +0 -1
  238. package/dist/src/agent/__tests__/printer.test.d.ts +0 -2
  239. package/dist/src/agent/__tests__/printer.test.d.ts.map +0 -1
  240. package/dist/src/agent/__tests__/printer.test.js +0 -188
  241. package/dist/src/agent/__tests__/printer.test.js.map +0 -1
  242. package/dist/src/agent/__tests__/snapshot.test.d.ts +0 -2
  243. package/dist/src/agent/__tests__/snapshot.test.d.ts.map +0 -1
  244. package/dist/src/agent/__tests__/snapshot.test.js +0 -442
  245. package/dist/src/agent/__tests__/snapshot.test.js.map +0 -1
  246. package/dist/src/agent/__tests__/tool-caller.test.d.ts +0 -2
  247. package/dist/src/agent/__tests__/tool-caller.test.d.ts.map +0 -1
  248. package/dist/src/agent/__tests__/tool-caller.test.js +0 -459
  249. package/dist/src/agent/__tests__/tool-caller.test.js.map +0 -1
  250. package/dist/src/conversation-manager/__tests__/agentic-context.test.d.ts +0 -2
  251. package/dist/src/conversation-manager/__tests__/agentic-context.test.d.ts.map +0 -1
  252. package/dist/src/conversation-manager/__tests__/agentic-context.test.js +0 -332
  253. package/dist/src/conversation-manager/__tests__/agentic-context.test.js.map +0 -1
  254. package/dist/src/conversation-manager/__tests__/context-compression.test.d.ts +0 -2
  255. package/dist/src/conversation-manager/__tests__/context-compression.test.d.ts.map +0 -1
  256. package/dist/src/conversation-manager/__tests__/context-compression.test.js +0 -176
  257. package/dist/src/conversation-manager/__tests__/context-compression.test.js.map +0 -1
  258. package/dist/src/conversation-manager/__tests__/conversation-manager.test.d.ts +0 -2
  259. package/dist/src/conversation-manager/__tests__/conversation-manager.test.d.ts.map +0 -1
  260. package/dist/src/conversation-manager/__tests__/conversation-manager.test.js +0 -321
  261. package/dist/src/conversation-manager/__tests__/conversation-manager.test.js.map +0 -1
  262. package/dist/src/conversation-manager/__tests__/null-conversation-manager.test.d.ts +0 -2
  263. package/dist/src/conversation-manager/__tests__/null-conversation-manager.test.d.ts.map +0 -1
  264. package/dist/src/conversation-manager/__tests__/null-conversation-manager.test.js +0 -64
  265. package/dist/src/conversation-manager/__tests__/null-conversation-manager.test.js.map +0 -1
  266. package/dist/src/conversation-manager/__tests__/pin.test.d.ts +0 -2
  267. package/dist/src/conversation-manager/__tests__/pin.test.d.ts.map +0 -1
  268. package/dist/src/conversation-manager/__tests__/pin.test.js +0 -119
  269. package/dist/src/conversation-manager/__tests__/pin.test.js.map +0 -1
  270. package/dist/src/conversation-manager/__tests__/sliding-window-conversation-manager.test.d.ts +0 -2
  271. package/dist/src/conversation-manager/__tests__/sliding-window-conversation-manager.test.d.ts.map +0 -1
  272. package/dist/src/conversation-manager/__tests__/sliding-window-conversation-manager.test.js +0 -1080
  273. package/dist/src/conversation-manager/__tests__/sliding-window-conversation-manager.test.js.map +0 -1
  274. package/dist/src/conversation-manager/__tests__/summarizing-conversation-manager.test.d.ts +0 -2
  275. package/dist/src/conversation-manager/__tests__/summarizing-conversation-manager.test.d.ts.map +0 -1
  276. package/dist/src/conversation-manager/__tests__/summarizing-conversation-manager.test.js +0 -400
  277. package/dist/src/conversation-manager/__tests__/summarizing-conversation-manager.test.js.map +0 -1
  278. package/dist/src/conversation-manager/__tests__/token-usage-middleware.test.d.ts +0 -2
  279. package/dist/src/conversation-manager/__tests__/token-usage-middleware.test.d.ts.map +0 -1
  280. package/dist/src/conversation-manager/__tests__/token-usage-middleware.test.js +0 -138
  281. package/dist/src/conversation-manager/__tests__/token-usage-middleware.test.js.map +0 -1
  282. package/dist/src/hooks/__tests__/events.test.d.ts +0 -2
  283. package/dist/src/hooks/__tests__/events.test.d.ts.map +0 -1
  284. package/dist/src/hooks/__tests__/events.test.js +0 -1060
  285. package/dist/src/hooks/__tests__/events.test.js.map +0 -1
  286. package/dist/src/hooks/__tests__/registry.test.d.ts +0 -2
  287. package/dist/src/hooks/__tests__/registry.test.d.ts.map +0 -1
  288. package/dist/src/hooks/__tests__/registry.test.js +0 -325
  289. package/dist/src/hooks/__tests__/registry.test.js.map +0 -1
  290. package/dist/src/injection/__tests__/message-injection.test.d.ts +0 -2
  291. package/dist/src/injection/__tests__/message-injection.test.d.ts.map +0 -1
  292. package/dist/src/injection/__tests__/message-injection.test.js +0 -200
  293. package/dist/src/injection/__tests__/message-injection.test.js.map +0 -1
  294. package/dist/src/interventions/__tests__/handler.test.d.ts +0 -2
  295. package/dist/src/interventions/__tests__/handler.test.d.ts.map +0 -1
  296. package/dist/src/interventions/__tests__/handler.test.js +0 -35
  297. package/dist/src/interventions/__tests__/handler.test.js.map +0 -1
  298. package/dist/src/interventions/__tests__/registry.test.d.ts +0 -2
  299. package/dist/src/interventions/__tests__/registry.test.d.ts.map +0 -1
  300. package/dist/src/interventions/__tests__/registry.test.js +0 -692
  301. package/dist/src/interventions/__tests__/registry.test.js.map +0 -1
  302. package/dist/src/logging/__tests__/logger.test.d.ts +0 -2
  303. package/dist/src/logging/__tests__/logger.test.d.ts.map +0 -1
  304. package/dist/src/logging/__tests__/logger.test.js +0 -70
  305. package/dist/src/logging/__tests__/logger.test.js.map +0 -1
  306. package/dist/src/logging/__tests__/warn-once.test.d.ts +0 -2
  307. package/dist/src/logging/__tests__/warn-once.test.d.ts.map +0 -1
  308. package/dist/src/logging/__tests__/warn-once.test.js +0 -30
  309. package/dist/src/logging/__tests__/warn-once.test.js.map +0 -1
  310. package/dist/src/mcp.d.ts.map +0 -1
  311. package/dist/src/mcp.js.map +0 -1
  312. package/dist/src/memory/__tests__/memory-manager.test.d.ts +0 -2
  313. package/dist/src/memory/__tests__/memory-manager.test.d.ts.map +0 -1
  314. package/dist/src/memory/__tests__/memory-manager.test.js +0 -679
  315. package/dist/src/memory/__tests__/memory-manager.test.js.map +0 -1
  316. package/dist/src/memory/__tests__/memory-tracing.test.d.ts +0 -2
  317. package/dist/src/memory/__tests__/memory-tracing.test.d.ts.map +0 -1
  318. package/dist/src/memory/__tests__/memory-tracing.test.js +0 -250
  319. package/dist/src/memory/__tests__/memory-tracing.test.js.map +0 -1
  320. package/dist/src/memory/extraction/__tests__/extraction.test.d.ts +0 -2
  321. package/dist/src/memory/extraction/__tests__/extraction.test.d.ts.map +0 -1
  322. package/dist/src/memory/extraction/__tests__/extraction.test.js +0 -639
  323. package/dist/src/memory/extraction/__tests__/extraction.test.js.map +0 -1
  324. package/dist/src/memory/extraction/__tests__/model-extractor.test.d.ts +0 -2
  325. package/dist/src/memory/extraction/__tests__/model-extractor.test.d.ts.map +0 -1
  326. package/dist/src/memory/extraction/__tests__/model-extractor.test.js +0 -104
  327. package/dist/src/memory/extraction/__tests__/model-extractor.test.js.map +0 -1
  328. package/dist/src/memory/extraction/__tests__/resolve-extraction-config.test.d.ts +0 -2
  329. package/dist/src/memory/extraction/__tests__/resolve-extraction-config.test.d.ts.map +0 -1
  330. package/dist/src/memory/extraction/__tests__/resolve-extraction-config.test.js +0 -81
  331. package/dist/src/memory/extraction/__tests__/resolve-extraction-config.test.js.map +0 -1
  332. package/dist/src/middleware/__tests__/agent-middleware.test.d.ts +0 -2
  333. package/dist/src/middleware/__tests__/agent-middleware.test.d.ts.map +0 -1
  334. package/dist/src/middleware/__tests__/agent-middleware.test.js +0 -1206
  335. package/dist/src/middleware/__tests__/agent-middleware.test.js.map +0 -1
  336. package/dist/src/middleware/__tests__/copy-on-input.test.d.ts +0 -2
  337. package/dist/src/middleware/__tests__/copy-on-input.test.d.ts.map +0 -1
  338. package/dist/src/middleware/__tests__/copy-on-input.test.js +0 -379
  339. package/dist/src/middleware/__tests__/copy-on-input.test.js.map +0 -1
  340. package/dist/src/middleware/__tests__/custom-stages.test.d.ts +0 -2
  341. package/dist/src/middleware/__tests__/custom-stages.test.d.ts.map +0 -1
  342. package/dist/src/middleware/__tests__/custom-stages.test.js +0 -97
  343. package/dist/src/middleware/__tests__/custom-stages.test.js.map +0 -1
  344. package/dist/src/middleware/__tests__/middleware-interrupts.test.d.ts +0 -2
  345. package/dist/src/middleware/__tests__/middleware-interrupts.test.d.ts.map +0 -1
  346. package/dist/src/middleware/__tests__/middleware-interrupts.test.js +0 -267
  347. package/dist/src/middleware/__tests__/middleware-interrupts.test.js.map +0 -1
  348. package/dist/src/middleware/__tests__/registry.test.d.ts +0 -2
  349. package/dist/src/middleware/__tests__/registry.test.d.ts.map +0 -1
  350. package/dist/src/middleware/__tests__/registry.test.js +0 -525
  351. package/dist/src/middleware/__tests__/registry.test.js.map +0 -1
  352. package/dist/src/models/__tests__/anthropic.test.d.ts +0 -2
  353. package/dist/src/models/__tests__/anthropic.test.d.ts.map +0 -1
  354. package/dist/src/models/__tests__/anthropic.test.js +0 -793
  355. package/dist/src/models/__tests__/anthropic.test.js.map +0 -1
  356. package/dist/src/models/__tests__/bedrock.test.d.ts +0 -2
  357. package/dist/src/models/__tests__/bedrock.test.d.ts.map +0 -1
  358. package/dist/src/models/__tests__/bedrock.test.js +0 -3964
  359. package/dist/src/models/__tests__/bedrock.test.js.map +0 -1
  360. package/dist/src/models/__tests__/defaults.test.d.ts +0 -2
  361. package/dist/src/models/__tests__/defaults.test.d.ts.map +0 -1
  362. package/dist/src/models/__tests__/defaults.test.js +0 -36
  363. package/dist/src/models/__tests__/defaults.test.js.map +0 -1
  364. package/dist/src/models/__tests__/google.test.d.ts +0 -2
  365. package/dist/src/models/__tests__/google.test.d.ts.map +0 -1
  366. package/dist/src/models/__tests__/google.test.js +0 -1145
  367. package/dist/src/models/__tests__/google.test.js.map +0 -1
  368. package/dist/src/models/__tests__/model.test.d.ts +0 -2
  369. package/dist/src/models/__tests__/model.test.d.ts.map +0 -1
  370. package/dist/src/models/__tests__/model.test.js +0 -921
  371. package/dist/src/models/__tests__/model.test.js.map +0 -1
  372. package/dist/src/models/__tests__/streaming.test.d.ts +0 -2
  373. package/dist/src/models/__tests__/streaming.test.d.ts.map +0 -1
  374. package/dist/src/models/__tests__/streaming.test.js +0 -50
  375. package/dist/src/models/__tests__/streaming.test.js.map +0 -1
  376. package/dist/src/models/__tests__/test-utils.d.ts +0 -10
  377. package/dist/src/models/__tests__/test-utils.d.ts.map +0 -1
  378. package/dist/src/models/__tests__/test-utils.js +0 -17
  379. package/dist/src/models/__tests__/test-utils.js.map +0 -1
  380. package/dist/src/models/__tests__/vercel.test.d.ts +0 -2
  381. package/dist/src/models/__tests__/vercel.test.d.ts.map +0 -1
  382. package/dist/src/models/__tests__/vercel.test.js +0 -740
  383. package/dist/src/models/__tests__/vercel.test.js.map +0 -1
  384. package/dist/src/models/openai/__tests__/chat.test.d.ts +0 -2
  385. package/dist/src/models/openai/__tests__/chat.test.d.ts.map +0 -1
  386. package/dist/src/models/openai/__tests__/chat.test.js +0 -1586
  387. package/dist/src/models/openai/__tests__/chat.test.js.map +0 -1
  388. package/dist/src/models/openai/__tests__/errors.test.d.ts +0 -2
  389. package/dist/src/models/openai/__tests__/errors.test.d.ts.map +0 -1
  390. package/dist/src/models/openai/__tests__/errors.test.js +0 -39
  391. package/dist/src/models/openai/__tests__/errors.test.js.map +0 -1
  392. package/dist/src/models/openai/__tests__/mantle.test.d.ts +0 -2
  393. package/dist/src/models/openai/__tests__/mantle.test.d.ts.map +0 -1
  394. package/dist/src/models/openai/__tests__/mantle.test.js +0 -189
  395. package/dist/src/models/openai/__tests__/mantle.test.js.map +0 -1
  396. package/dist/src/models/openai/__tests__/responses.test.d.ts +0 -2
  397. package/dist/src/models/openai/__tests__/responses.test.d.ts.map +0 -1
  398. package/dist/src/models/openai/__tests__/responses.test.js +0 -709
  399. package/dist/src/models/openai/__tests__/responses.test.js.map +0 -1
  400. package/dist/src/multiagent/__tests__/events.test.d.ts +0 -2
  401. package/dist/src/multiagent/__tests__/events.test.d.ts.map +0 -1
  402. package/dist/src/multiagent/__tests__/events.test.js +0 -493
  403. package/dist/src/multiagent/__tests__/events.test.js.map +0 -1
  404. package/dist/src/multiagent/__tests__/graph.invocation-state.test.d.ts +0 -2
  405. package/dist/src/multiagent/__tests__/graph.invocation-state.test.d.ts.map +0 -1
  406. package/dist/src/multiagent/__tests__/graph.invocation-state.test.js +0 -95
  407. package/dist/src/multiagent/__tests__/graph.invocation-state.test.js.map +0 -1
  408. package/dist/src/multiagent/__tests__/graph.test.d.ts +0 -2
  409. package/dist/src/multiagent/__tests__/graph.test.d.ts.map +0 -1
  410. package/dist/src/multiagent/__tests__/graph.test.js +0 -698
  411. package/dist/src/multiagent/__tests__/graph.test.js.map +0 -1
  412. package/dist/src/multiagent/__tests__/graph.tracer.test.d.ts +0 -2
  413. package/dist/src/multiagent/__tests__/graph.tracer.test.d.ts.map +0 -1
  414. package/dist/src/multiagent/__tests__/graph.tracer.test.js +0 -218
  415. package/dist/src/multiagent/__tests__/graph.tracer.test.js.map +0 -1
  416. package/dist/src/multiagent/__tests__/interrupts.test.d.ts +0 -2
  417. package/dist/src/multiagent/__tests__/interrupts.test.d.ts.map +0 -1
  418. package/dist/src/multiagent/__tests__/interrupts.test.js +0 -390
  419. package/dist/src/multiagent/__tests__/interrupts.test.js.map +0 -1
  420. package/dist/src/multiagent/__tests__/nodes.test.d.ts +0 -2
  421. package/dist/src/multiagent/__tests__/nodes.test.d.ts.map +0 -1
  422. package/dist/src/multiagent/__tests__/nodes.test.js +0 -321
  423. package/dist/src/multiagent/__tests__/nodes.test.js.map +0 -1
  424. package/dist/src/multiagent/__tests__/queue.test.d.ts +0 -2
  425. package/dist/src/multiagent/__tests__/queue.test.d.ts.map +0 -1
  426. package/dist/src/multiagent/__tests__/queue.test.js +0 -118
  427. package/dist/src/multiagent/__tests__/queue.test.js.map +0 -1
  428. package/dist/src/multiagent/__tests__/snapshot.test.d.ts +0 -2
  429. package/dist/src/multiagent/__tests__/snapshot.test.d.ts.map +0 -1
  430. package/dist/src/multiagent/__tests__/snapshot.test.js +0 -161
  431. package/dist/src/multiagent/__tests__/snapshot.test.js.map +0 -1
  432. package/dist/src/multiagent/__tests__/state.test.d.ts +0 -2
  433. package/dist/src/multiagent/__tests__/state.test.d.ts.map +0 -1
  434. package/dist/src/multiagent/__tests__/state.test.js +0 -526
  435. package/dist/src/multiagent/__tests__/state.test.js.map +0 -1
  436. package/dist/src/multiagent/__tests__/swarm.invocation-state.test.d.ts +0 -2
  437. package/dist/src/multiagent/__tests__/swarm.invocation-state.test.d.ts.map +0 -1
  438. package/dist/src/multiagent/__tests__/swarm.invocation-state.test.js +0 -56
  439. package/dist/src/multiagent/__tests__/swarm.invocation-state.test.js.map +0 -1
  440. package/dist/src/multiagent/__tests__/swarm.test.d.ts +0 -2
  441. package/dist/src/multiagent/__tests__/swarm.test.d.ts.map +0 -1
  442. package/dist/src/multiagent/__tests__/swarm.test.js +0 -477
  443. package/dist/src/multiagent/__tests__/swarm.test.js.map +0 -1
  444. package/dist/src/multiagent/__tests__/swarm.tracer.test.d.ts +0 -2
  445. package/dist/src/multiagent/__tests__/swarm.tracer.test.d.ts.map +0 -1
  446. package/dist/src/multiagent/__tests__/swarm.tracer.test.js +0 -235
  447. package/dist/src/multiagent/__tests__/swarm.tracer.test.js.map +0 -1
  448. package/dist/src/plugins/__tests__/plugin.test.d.ts +0 -2
  449. package/dist/src/plugins/__tests__/plugin.test.d.ts.map +0 -1
  450. package/dist/src/plugins/__tests__/plugin.test.js +0 -114
  451. package/dist/src/plugins/__tests__/plugin.test.js.map +0 -1
  452. package/dist/src/plugins/__tests__/registry.test.d.ts +0 -2
  453. package/dist/src/plugins/__tests__/registry.test.d.ts.map +0 -1
  454. package/dist/src/plugins/__tests__/registry.test.js +0 -147
  455. package/dist/src/plugins/__tests__/registry.test.js.map +0 -1
  456. package/dist/src/registry/__tests__/tool-registry.test.d.ts +0 -2
  457. package/dist/src/registry/__tests__/tool-registry.test.d.ts.map +0 -1
  458. package/dist/src/registry/__tests__/tool-registry.test.js +0 -210
  459. package/dist/src/registry/__tests__/tool-registry.test.js.map +0 -1
  460. package/dist/src/retry/__tests__/backoff-strategy.test.d.ts +0 -2
  461. package/dist/src/retry/__tests__/backoff-strategy.test.d.ts.map +0 -1
  462. package/dist/src/retry/__tests__/backoff-strategy.test.js +0 -116
  463. package/dist/src/retry/__tests__/backoff-strategy.test.js.map +0 -1
  464. package/dist/src/retry/__tests__/default-model-retry-strategy.test.d.ts +0 -2
  465. package/dist/src/retry/__tests__/default-model-retry-strategy.test.d.ts.map +0 -1
  466. package/dist/src/retry/__tests__/default-model-retry-strategy.test.js +0 -225
  467. package/dist/src/retry/__tests__/default-model-retry-strategy.test.js.map +0 -1
  468. package/dist/src/sandbox/__tests__/default.test.browser.d.ts +0 -2
  469. package/dist/src/sandbox/__tests__/default.test.browser.d.ts.map +0 -1
  470. package/dist/src/sandbox/__tests__/default.test.browser.js +0 -11
  471. package/dist/src/sandbox/__tests__/default.test.browser.js.map +0 -1
  472. package/dist/src/sandbox/__tests__/default.test.node.d.ts +0 -2
  473. package/dist/src/sandbox/__tests__/default.test.node.d.ts.map +0 -1
  474. package/dist/src/sandbox/__tests__/default.test.node.js +0 -23
  475. package/dist/src/sandbox/__tests__/default.test.node.js.map +0 -1
  476. package/dist/src/sandbox/__tests__/docker.test.node.d.ts +0 -2
  477. package/dist/src/sandbox/__tests__/docker.test.node.d.ts.map +0 -1
  478. package/dist/src/sandbox/__tests__/docker.test.node.js +0 -89
  479. package/dist/src/sandbox/__tests__/docker.test.node.js.map +0 -1
  480. package/dist/src/sandbox/__tests__/errors.test.node.d.ts +0 -2
  481. package/dist/src/sandbox/__tests__/errors.test.node.d.ts.map +0 -1
  482. package/dist/src/sandbox/__tests__/errors.test.node.js +0 -33
  483. package/dist/src/sandbox/__tests__/errors.test.node.js.map +0 -1
  484. package/dist/src/sandbox/__tests__/not-a-sandbox-local-environment.test.node.d.ts +0 -2
  485. package/dist/src/sandbox/__tests__/not-a-sandbox-local-environment.test.node.d.ts.map +0 -1
  486. package/dist/src/sandbox/__tests__/not-a-sandbox-local-environment.test.node.js +0 -124
  487. package/dist/src/sandbox/__tests__/not-a-sandbox-local-environment.test.node.js.map +0 -1
  488. package/dist/src/sandbox/__tests__/posix-shell.test.node.d.ts +0 -2
  489. package/dist/src/sandbox/__tests__/posix-shell.test.node.d.ts.map +0 -1
  490. package/dist/src/sandbox/__tests__/posix-shell.test.node.js +0 -298
  491. package/dist/src/sandbox/__tests__/posix-shell.test.node.js.map +0 -1
  492. package/dist/src/sandbox/__tests__/ssh.test.node.d.ts +0 -2
  493. package/dist/src/sandbox/__tests__/ssh.test.node.d.ts.map +0 -1
  494. package/dist/src/sandbox/__tests__/ssh.test.node.js +0 -262
  495. package/dist/src/sandbox/__tests__/ssh.test.node.js.map +0 -1
  496. package/dist/src/session/__tests__/file-storage.test.node.d.ts +0 -2
  497. package/dist/src/session/__tests__/file-storage.test.node.d.ts.map +0 -1
  498. package/dist/src/session/__tests__/file-storage.test.node.js +0 -278
  499. package/dist/src/session/__tests__/file-storage.test.node.js.map +0 -1
  500. package/dist/src/session/__tests__/s3-storage.test.d.ts +0 -2
  501. package/dist/src/session/__tests__/s3-storage.test.d.ts.map +0 -1
  502. package/dist/src/session/__tests__/s3-storage.test.js +0 -461
  503. package/dist/src/session/__tests__/s3-storage.test.js.map +0 -1
  504. package/dist/src/session/__tests__/session-manager.test.d.ts +0 -2
  505. package/dist/src/session/__tests__/session-manager.test.d.ts.map +0 -1
  506. package/dist/src/session/__tests__/session-manager.test.js +0 -832
  507. package/dist/src/session/__tests__/session-manager.test.js.map +0 -1
  508. package/dist/src/session/__tests__/validation.test.d.ts +0 -2
  509. package/dist/src/session/__tests__/validation.test.d.ts.map +0 -1
  510. package/dist/src/session/__tests__/validation.test.js +0 -47
  511. package/dist/src/session/__tests__/validation.test.js.map +0 -1
  512. package/dist/src/telemetry/__tests__/config.test.d.ts +0 -2
  513. package/dist/src/telemetry/__tests__/config.test.d.ts.map +0 -1
  514. package/dist/src/telemetry/__tests__/config.test.js +0 -64
  515. package/dist/src/telemetry/__tests__/config.test.js.map +0 -1
  516. package/dist/src/telemetry/__tests__/config.test.node.d.ts +0 -2
  517. package/dist/src/telemetry/__tests__/config.test.node.d.ts.map +0 -1
  518. package/dist/src/telemetry/__tests__/config.test.node.js +0 -164
  519. package/dist/src/telemetry/__tests__/config.test.node.js.map +0 -1
  520. package/dist/src/telemetry/__tests__/json.test.d.ts +0 -2
  521. package/dist/src/telemetry/__tests__/json.test.d.ts.map +0 -1
  522. package/dist/src/telemetry/__tests__/json.test.js +0 -89
  523. package/dist/src/telemetry/__tests__/json.test.js.map +0 -1
  524. package/dist/src/telemetry/__tests__/local-trace.test.d.ts +0 -2
  525. package/dist/src/telemetry/__tests__/local-trace.test.d.ts.map +0 -1
  526. package/dist/src/telemetry/__tests__/local-trace.test.js +0 -158
  527. package/dist/src/telemetry/__tests__/local-trace.test.js.map +0 -1
  528. package/dist/src/telemetry/__tests__/meter.test.d.ts +0 -2
  529. package/dist/src/telemetry/__tests__/meter.test.d.ts.map +0 -1
  530. package/dist/src/telemetry/__tests__/meter.test.js +0 -695
  531. package/dist/src/telemetry/__tests__/meter.test.js.map +0 -1
  532. package/dist/src/telemetry/__tests__/tracer.test.node.d.ts +0 -2
  533. package/dist/src/telemetry/__tests__/tracer.test.node.d.ts.map +0 -1
  534. package/dist/src/telemetry/__tests__/tracer.test.node.js +0 -958
  535. package/dist/src/telemetry/__tests__/tracer.test.node.js.map +0 -1
  536. package/dist/src/tools/__tests__/structured-output-tool.test.d.ts +0 -2
  537. package/dist/src/tools/__tests__/structured-output-tool.test.d.ts.map +0 -1
  538. package/dist/src/tools/__tests__/structured-output-tool.test.js +0 -84
  539. package/dist/src/tools/__tests__/structured-output-tool.test.js.map +0 -1
  540. package/dist/src/tools/__tests__/tool-factory.test.d.ts +0 -2
  541. package/dist/src/tools/__tests__/tool-factory.test.d.ts.map +0 -1
  542. package/dist/src/tools/__tests__/tool-factory.test.js +0 -98
  543. package/dist/src/tools/__tests__/tool-factory.test.js.map +0 -1
  544. package/dist/src/tools/__tests__/tool.test.d.ts +0 -2
  545. package/dist/src/tools/__tests__/tool.test.d.ts.map +0 -1
  546. package/dist/src/tools/__tests__/tool.test.js +0 -1043
  547. package/dist/src/tools/__tests__/tool.test.js.map +0 -1
  548. package/dist/src/tools/__tests__/zod-tool.test-d.d.ts +0 -2
  549. package/dist/src/tools/__tests__/zod-tool.test-d.d.ts.map +0 -1
  550. package/dist/src/tools/__tests__/zod-tool.test-d.js +0 -227
  551. package/dist/src/tools/__tests__/zod-tool.test-d.js.map +0 -1
  552. package/dist/src/tools/__tests__/zod-tool.test.d.ts +0 -2
  553. package/dist/src/tools/__tests__/zod-tool.test.d.ts.map +0 -1
  554. package/dist/src/tools/__tests__/zod-tool.test.js +0 -563
  555. package/dist/src/tools/__tests__/zod-tool.test.js.map +0 -1
  556. package/dist/src/types/__tests__/agent.test.d.ts +0 -2
  557. package/dist/src/types/__tests__/agent.test.d.ts.map +0 -1
  558. package/dist/src/types/__tests__/agent.test.js +0 -476
  559. package/dist/src/types/__tests__/agent.test.js.map +0 -1
  560. package/dist/src/types/__tests__/citations.test.d.ts +0 -2
  561. package/dist/src/types/__tests__/citations.test.d.ts.map +0 -1
  562. package/dist/src/types/__tests__/citations.test.js +0 -104
  563. package/dist/src/types/__tests__/citations.test.js.map +0 -1
  564. package/dist/src/types/__tests__/json.test.d.ts +0 -2
  565. package/dist/src/types/__tests__/json.test.d.ts.map +0 -1
  566. package/dist/src/types/__tests__/json.test.js +0 -298
  567. package/dist/src/types/__tests__/json.test.js.map +0 -1
  568. package/dist/src/types/__tests__/media.test.d.ts +0 -2
  569. package/dist/src/types/__tests__/media.test.d.ts.map +0 -1
  570. package/dist/src/types/__tests__/media.test.js +0 -478
  571. package/dist/src/types/__tests__/media.test.js.map +0 -1
  572. package/dist/src/types/__tests__/messages.test.d.ts +0 -2
  573. package/dist/src/types/__tests__/messages.test.d.ts.map +0 -1
  574. package/dist/src/types/__tests__/messages.test.js +0 -681
  575. package/dist/src/types/__tests__/messages.test.js.map +0 -1
  576. package/dist/src/types/__tests__/validation.test.d.ts +0 -2
  577. package/dist/src/types/__tests__/validation.test.d.ts.map +0 -1
  578. package/dist/src/types/__tests__/validation.test.js +0 -30
  579. package/dist/src/types/__tests__/validation.test.js.map +0 -1
  580. package/dist/src/vended-interventions/cedar/__tests__/cedar.test.node.d.ts +0 -2
  581. package/dist/src/vended-interventions/cedar/__tests__/cedar.test.node.d.ts.map +0 -1
  582. package/dist/src/vended-interventions/cedar/__tests__/cedar.test.node.js +0 -756
  583. package/dist/src/vended-interventions/cedar/__tests__/cedar.test.node.js.map +0 -1
  584. package/dist/src/vended-interventions/hitl/__tests__/hitl.test.d.ts +0 -2
  585. package/dist/src/vended-interventions/hitl/__tests__/hitl.test.d.ts.map +0 -1
  586. package/dist/src/vended-interventions/hitl/__tests__/hitl.test.js +0 -358
  587. package/dist/src/vended-interventions/hitl/__tests__/hitl.test.js.map +0 -1
  588. package/dist/src/vended-interventions/steering/__tests__/handler.test.d.ts +0 -2
  589. package/dist/src/vended-interventions/steering/__tests__/handler.test.d.ts.map +0 -1
  590. package/dist/src/vended-interventions/steering/__tests__/handler.test.js +0 -163
  591. package/dist/src/vended-interventions/steering/__tests__/handler.test.js.map +0 -1
  592. package/dist/src/vended-interventions/steering/__tests__/llm.test.d.ts +0 -2
  593. package/dist/src/vended-interventions/steering/__tests__/llm.test.d.ts.map +0 -1
  594. package/dist/src/vended-interventions/steering/__tests__/llm.test.js +0 -60
  595. package/dist/src/vended-interventions/steering/__tests__/llm.test.js.map +0 -1
  596. package/dist/src/vended-interventions/steering/__tests__/tool-ledger.test.d.ts +0 -2
  597. package/dist/src/vended-interventions/steering/__tests__/tool-ledger.test.d.ts.map +0 -1
  598. package/dist/src/vended-interventions/steering/__tests__/tool-ledger.test.js +0 -94
  599. package/dist/src/vended-interventions/steering/__tests__/tool-ledger.test.js.map +0 -1
  600. package/dist/src/vended-memory-stores/bedrock-knowledge-base/__tests__/bedrock-knowledge-base-store.test.node.d.ts +0 -2
  601. package/dist/src/vended-memory-stores/bedrock-knowledge-base/__tests__/bedrock-knowledge-base-store.test.node.d.ts.map +0 -1
  602. package/dist/src/vended-memory-stores/bedrock-knowledge-base/__tests__/bedrock-knowledge-base-store.test.node.js +0 -758
  603. package/dist/src/vended-memory-stores/bedrock-knowledge-base/__tests__/bedrock-knowledge-base-store.test.node.js.map +0 -1
  604. package/dist/src/vended-plugins/context-injector/__tests__/plugin.test.d.ts +0 -2
  605. package/dist/src/vended-plugins/context-injector/__tests__/plugin.test.d.ts.map +0 -1
  606. package/dist/src/vended-plugins/context-injector/__tests__/plugin.test.js +0 -96
  607. package/dist/src/vended-plugins/context-injector/__tests__/plugin.test.js.map +0 -1
  608. package/dist/src/vended-plugins/context-offloader/__tests__/file-storage-sandbox.test.node.d.ts +0 -2
  609. package/dist/src/vended-plugins/context-offloader/__tests__/file-storage-sandbox.test.node.d.ts.map +0 -1
  610. package/dist/src/vended-plugins/context-offloader/__tests__/file-storage-sandbox.test.node.js +0 -68
  611. package/dist/src/vended-plugins/context-offloader/__tests__/file-storage-sandbox.test.node.js.map +0 -1
  612. package/dist/src/vended-plugins/context-offloader/__tests__/plugin.test.d.ts +0 -2
  613. package/dist/src/vended-plugins/context-offloader/__tests__/plugin.test.d.ts.map +0 -1
  614. package/dist/src/vended-plugins/context-offloader/__tests__/plugin.test.js +0 -539
  615. package/dist/src/vended-plugins/context-offloader/__tests__/plugin.test.js.map +0 -1
  616. package/dist/src/vended-plugins/context-offloader/__tests__/plugin.test.node.d.ts +0 -2
  617. package/dist/src/vended-plugins/context-offloader/__tests__/plugin.test.node.d.ts.map +0 -1
  618. package/dist/src/vended-plugins/context-offloader/__tests__/plugin.test.node.js +0 -97
  619. package/dist/src/vended-plugins/context-offloader/__tests__/plugin.test.node.js.map +0 -1
  620. package/dist/src/vended-plugins/context-offloader/__tests__/search.test.d.ts +0 -2
  621. package/dist/src/vended-plugins/context-offloader/__tests__/search.test.d.ts.map +0 -1
  622. package/dist/src/vended-plugins/context-offloader/__tests__/search.test.js +0 -149
  623. package/dist/src/vended-plugins/context-offloader/__tests__/search.test.js.map +0 -1
  624. package/dist/src/vended-plugins/context-offloader/__tests__/storage.test.d.ts +0 -2
  625. package/dist/src/vended-plugins/context-offloader/__tests__/storage.test.d.ts.map +0 -1
  626. package/dist/src/vended-plugins/context-offloader/__tests__/storage.test.js +0 -216
  627. package/dist/src/vended-plugins/context-offloader/__tests__/storage.test.js.map +0 -1
  628. package/dist/src/vended-plugins/context-offloader/__tests__/storage.test.node.d.ts +0 -2
  629. package/dist/src/vended-plugins/context-offloader/__tests__/storage.test.node.d.ts.map +0 -1
  630. package/dist/src/vended-plugins/context-offloader/__tests__/storage.test.node.js +0 -78
  631. package/dist/src/vended-plugins/context-offloader/__tests__/storage.test.node.js.map +0 -1
  632. package/dist/src/vended-plugins/goal/__tests__/plugin.test.d.ts +0 -2
  633. package/dist/src/vended-plugins/goal/__tests__/plugin.test.d.ts.map +0 -1
  634. package/dist/src/vended-plugins/goal/__tests__/plugin.test.js +0 -736
  635. package/dist/src/vended-plugins/goal/__tests__/plugin.test.js.map +0 -1
  636. package/dist/src/vended-plugins/skills/__tests__/agent-skills.test.node.d.ts +0 -2
  637. package/dist/src/vended-plugins/skills/__tests__/agent-skills.test.node.d.ts.map +0 -1
  638. package/dist/src/vended-plugins/skills/__tests__/agent-skills.test.node.js +0 -482
  639. package/dist/src/vended-plugins/skills/__tests__/agent-skills.test.node.js.map +0 -1
  640. package/dist/src/vended-plugins/skills/__tests__/skill.test.node.d.ts +0 -2
  641. package/dist/src/vended-plugins/skills/__tests__/skill.test.node.d.ts.map +0 -1
  642. package/dist/src/vended-plugins/skills/__tests__/skill.test.node.js +0 -476
  643. package/dist/src/vended-plugins/skills/__tests__/skill.test.node.js.map +0 -1
  644. package/dist/src/vended-tools/bash/__tests__/bash.test.node.d.ts +0 -2
  645. package/dist/src/vended-tools/bash/__tests__/bash.test.node.d.ts.map +0 -1
  646. package/dist/src/vended-tools/bash/__tests__/bash.test.node.js +0 -390
  647. package/dist/src/vended-tools/bash/__tests__/bash.test.node.js.map +0 -1
  648. package/dist/src/vended-tools/file-editor/__tests__/file-editor.test.node.d.ts +0 -2
  649. package/dist/src/vended-tools/file-editor/__tests__/file-editor.test.node.d.ts.map +0 -1
  650. package/dist/src/vended-tools/file-editor/__tests__/file-editor.test.node.js +0 -452
  651. package/dist/src/vended-tools/file-editor/__tests__/file-editor.test.node.js.map +0 -1
  652. package/dist/src/vended-tools/http-request/__tests__/http-request.test.d.ts +0 -2
  653. package/dist/src/vended-tools/http-request/__tests__/http-request.test.d.ts.map +0 -1
  654. package/dist/src/vended-tools/http-request/__tests__/http-request.test.js +0 -189
  655. package/dist/src/vended-tools/http-request/__tests__/http-request.test.js.map +0 -1
  656. package/dist/src/vended-tools/notebook/__tests__/notebook.test.d.ts +0 -2
  657. package/dist/src/vended-tools/notebook/__tests__/notebook.test.d.ts.map +0 -1
  658. package/dist/src/vended-tools/notebook/__tests__/notebook.test.js +0 -388
  659. 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