@aws/agentcore-cdk 0.1.0-alpha.4 → 0.1.0-alpha.41

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 (330) hide show
  1. package/README.md +20 -12
  2. package/dist/cdk/constants.d.ts +8 -0
  3. package/dist/cdk/constants.d.ts.map +1 -1
  4. package/dist/cdk/constants.js +27 -1
  5. package/dist/cdk/constants.js.map +1 -1
  6. package/dist/cdk/constructs/bundling/container/ContainerSourceAssetFromPath.d.ts +17 -0
  7. package/dist/cdk/constructs/bundling/container/ContainerSourceAssetFromPath.d.ts.map +1 -0
  8. package/dist/cdk/constructs/bundling/container/ContainerSourceAssetFromPath.js +20 -0
  9. package/dist/cdk/constructs/bundling/container/ContainerSourceAssetFromPath.js.map +1 -0
  10. package/dist/cdk/constructs/bundling/container/index.d.ts +1 -0
  11. package/dist/cdk/constructs/bundling/container/index.d.ts.map +1 -1
  12. package/dist/cdk/constructs/bundling/container/index.js +3 -1
  13. package/dist/cdk/constructs/bundling/container/index.js.map +1 -1
  14. package/dist/cdk/constructs/bundling/index.d.ts +2 -0
  15. package/dist/cdk/constructs/bundling/index.d.ts.map +1 -1
  16. package/dist/cdk/constructs/bundling/index.js +6 -2
  17. package/dist/cdk/constructs/bundling/index.js.map +1 -1
  18. package/dist/cdk/constructs/bundling/zip/NodeBundledCodeZipAsset.d.ts +7 -0
  19. package/dist/cdk/constructs/bundling/zip/NodeBundledCodeZipAsset.d.ts.map +1 -0
  20. package/dist/cdk/constructs/bundling/zip/NodeBundledCodeZipAsset.js +30 -0
  21. package/dist/cdk/constructs/bundling/zip/NodeBundledCodeZipAsset.js.map +1 -0
  22. package/dist/cdk/constructs/bundling/zip/index.d.ts +1 -0
  23. package/dist/cdk/constructs/bundling/zip/index.d.ts.map +1 -1
  24. package/dist/cdk/constructs/bundling/zip/index.js +3 -1
  25. package/dist/cdk/constructs/bundling/zip/index.js.map +1 -1
  26. package/dist/cdk/constructs/components/base-props.d.ts +2 -0
  27. package/dist/cdk/constructs/components/base-props.d.ts.map +1 -1
  28. package/dist/cdk/constructs/components/container/ContainerBuildProject.d.ts.map +1 -1
  29. package/dist/cdk/constructs/components/container/ContainerBuildProject.js +5 -1
  30. package/dist/cdk/constructs/components/container/ContainerBuildProject.js.map +1 -1
  31. package/dist/cdk/constructs/components/container/ContainerImageBuilder.d.ts +4 -2
  32. package/dist/cdk/constructs/components/container/ContainerImageBuilder.d.ts.map +1 -1
  33. package/dist/cdk/constructs/components/container/ContainerImageBuilder.js +2 -2
  34. package/dist/cdk/constructs/components/container/ContainerImageBuilder.js.map +1 -1
  35. package/dist/cdk/constructs/components/container/container-build-handler.d.ts +1 -1
  36. package/dist/cdk/constructs/components/container/container-build-handler.d.ts.map +1 -1
  37. package/dist/cdk/constructs/components/container/container-build-handler.js +2 -3
  38. package/dist/cdk/constructs/components/container/container-build-handler.js.map +1 -1
  39. package/dist/cdk/constructs/components/mcp/Gateway.d.ts +71 -0
  40. package/dist/cdk/constructs/components/mcp/Gateway.d.ts.map +1 -0
  41. package/dist/cdk/constructs/components/mcp/Gateway.js +897 -0
  42. package/dist/cdk/constructs/components/mcp/Gateway.js.map +1 -0
  43. package/dist/cdk/constructs/components/mcp/McpLambdaCompute.js +2 -2
  44. package/dist/cdk/constructs/components/mcp/McpLambdaCompute.js.map +1 -1
  45. package/dist/cdk/constructs/components/mcp/McpRuntimeCompute.js +1 -1
  46. package/dist/cdk/constructs/components/mcp/McpRuntimeCompute.js.map +1 -1
  47. package/dist/cdk/constructs/components/mcp/connector-defaults.d.ts +20 -0
  48. package/dist/cdk/constructs/components/mcp/connector-defaults.d.ts.map +1 -0
  49. package/dist/cdk/constructs/components/mcp/connector-defaults.js +16 -0
  50. package/dist/cdk/constructs/components/mcp/connector-defaults.js.map +1 -0
  51. package/dist/cdk/constructs/components/mcp/index.d.ts +1 -1
  52. package/dist/cdk/constructs/components/mcp/index.d.ts.map +1 -1
  53. package/dist/cdk/constructs/components/mcp/index.js +3 -3
  54. package/dist/cdk/constructs/components/mcp/index.js.map +1 -1
  55. package/dist/cdk/constructs/components/mcp/mcp-utils.d.ts +1 -1
  56. package/dist/cdk/constructs/components/mcp/mcp-utils.d.ts.map +1 -1
  57. package/dist/cdk/constructs/components/mcp/mcp-utils.js +2 -2
  58. package/dist/cdk/constructs/components/mcp/mcp-utils.js.map +1 -1
  59. package/dist/cdk/constructs/components/primitives/BasePrimitiveConstruct.d.ts +51 -0
  60. package/dist/cdk/constructs/components/primitives/BasePrimitiveConstruct.d.ts.map +1 -0
  61. package/dist/cdk/constructs/components/primitives/BasePrimitiveConstruct.js +54 -0
  62. package/dist/cdk/constructs/components/primitives/BasePrimitiveConstruct.js.map +1 -0
  63. package/dist/cdk/constructs/components/primitives/config-bundle/AgentCoreConfigBundle.d.ts +36 -0
  64. package/dist/cdk/constructs/components/primitives/config-bundle/AgentCoreConfigBundle.d.ts.map +1 -0
  65. package/dist/cdk/constructs/components/primitives/config-bundle/AgentCoreConfigBundle.js +65 -0
  66. package/dist/cdk/constructs/components/primitives/config-bundle/AgentCoreConfigBundle.js.map +1 -0
  67. package/dist/cdk/constructs/components/primitives/config-bundle/index.d.ts +3 -0
  68. package/dist/cdk/constructs/components/primitives/config-bundle/index.d.ts.map +1 -0
  69. package/dist/cdk/constructs/components/primitives/config-bundle/index.js +6 -0
  70. package/dist/cdk/constructs/components/primitives/config-bundle/index.js.map +1 -0
  71. package/dist/cdk/constructs/components/primitives/dataset/AgentCoreDataset.d.ts +36 -0
  72. package/dist/cdk/constructs/components/primitives/dataset/AgentCoreDataset.d.ts.map +1 -0
  73. package/dist/cdk/constructs/components/primitives/dataset/AgentCoreDataset.js +91 -0
  74. package/dist/cdk/constructs/components/primitives/dataset/AgentCoreDataset.js.map +1 -0
  75. package/dist/cdk/constructs/components/primitives/dataset/index.d.ts +2 -0
  76. package/dist/cdk/constructs/components/primitives/dataset/index.d.ts.map +1 -0
  77. package/dist/cdk/constructs/components/primitives/dataset/index.js +6 -0
  78. package/dist/cdk/constructs/components/primitives/dataset/index.js.map +1 -0
  79. package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreEvaluator.d.ts +47 -0
  80. package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreEvaluator.d.ts.map +1 -0
  81. package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreEvaluator.js +192 -0
  82. package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreEvaluator.js.map +1 -0
  83. package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.d.ts +28 -0
  84. package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.d.ts.map +1 -0
  85. package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.js +222 -0
  86. package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.js.map +1 -0
  87. package/dist/cdk/constructs/components/primitives/evaluator/index.d.ts +3 -0
  88. package/dist/cdk/constructs/components/primitives/evaluator/index.d.ts.map +1 -0
  89. package/dist/cdk/constructs/components/primitives/evaluator/index.js +8 -0
  90. package/dist/cdk/constructs/components/primitives/evaluator/index.js.map +1 -0
  91. package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarness.d.ts +58 -0
  92. package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarness.d.ts.map +1 -0
  93. package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarness.js +79 -0
  94. package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarness.js.map +1 -0
  95. package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.d.ts +65 -0
  96. package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.d.ts.map +1 -0
  97. package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.js +445 -0
  98. package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.js.map +1 -0
  99. package/dist/cdk/constructs/components/primitives/harness/__tests__/AgentCoreHarnessRole.test.d.ts +2 -0
  100. package/dist/cdk/constructs/components/primitives/harness/__tests__/AgentCoreHarnessRole.test.d.ts.map +1 -0
  101. package/dist/cdk/constructs/components/primitives/harness/__tests__/AgentCoreHarnessRole.test.js +182 -0
  102. package/dist/cdk/constructs/components/primitives/harness/__tests__/AgentCoreHarnessRole.test.js.map +1 -0
  103. package/dist/cdk/constructs/components/primitives/harness/harness-cfn-mapping.d.ts +47 -0
  104. package/dist/cdk/constructs/components/primitives/harness/harness-cfn-mapping.d.ts.map +1 -0
  105. package/dist/cdk/constructs/components/primitives/harness/harness-cfn-mapping.js +391 -0
  106. package/dist/cdk/constructs/components/primitives/harness/harness-cfn-mapping.js.map +1 -0
  107. package/dist/cdk/constructs/components/primitives/harness/index.d.ts +3 -0
  108. package/dist/cdk/constructs/components/primitives/harness/index.d.ts.map +1 -0
  109. package/dist/cdk/constructs/components/primitives/harness/index.js +8 -0
  110. package/dist/cdk/constructs/components/primitives/harness/index.js.map +1 -0
  111. package/dist/cdk/constructs/components/primitives/index.d.ts +9 -0
  112. package/dist/cdk/constructs/components/primitives/index.d.ts.map +1 -1
  113. package/dist/cdk/constructs/components/primitives/index.js +21 -1
  114. package/dist/cdk/constructs/components/primitives/index.js.map +1 -1
  115. package/dist/cdk/constructs/components/primitives/knowledge-base/AgentCoreKnowledgeBase.d.ts +69 -0
  116. package/dist/cdk/constructs/components/primitives/knowledge-base/AgentCoreKnowledgeBase.d.ts.map +1 -0
  117. package/dist/cdk/constructs/components/primitives/knowledge-base/AgentCoreKnowledgeBase.js +292 -0
  118. package/dist/cdk/constructs/components/primitives/knowledge-base/AgentCoreKnowledgeBase.js.map +1 -0
  119. package/dist/cdk/constructs/components/primitives/knowledge-base/index.d.ts +2 -0
  120. package/dist/cdk/constructs/components/primitives/knowledge-base/index.d.ts.map +1 -0
  121. package/dist/cdk/constructs/components/primitives/knowledge-base/index.js +6 -0
  122. package/dist/cdk/constructs/components/primitives/knowledge-base/index.js.map +1 -0
  123. package/dist/cdk/constructs/components/primitives/memory/AgentCoreMemory.d.ts +15 -4
  124. package/dist/cdk/constructs/components/primitives/memory/AgentCoreMemory.d.ts.map +1 -1
  125. package/dist/cdk/constructs/components/primitives/memory/AgentCoreMemory.js +95 -63
  126. package/dist/cdk/constructs/components/primitives/memory/AgentCoreMemory.js.map +1 -1
  127. package/dist/cdk/constructs/components/primitives/memory/__tests__/AgentCoreMemory.test.d.ts +2 -0
  128. package/dist/cdk/constructs/components/primitives/memory/__tests__/AgentCoreMemory.test.d.ts.map +1 -0
  129. package/dist/cdk/constructs/components/primitives/memory/__tests__/AgentCoreMemory.test.js +146 -0
  130. package/dist/cdk/constructs/components/primitives/memory/__tests__/AgentCoreMemory.test.js.map +1 -0
  131. package/dist/cdk/constructs/components/primitives/memory/memory-actions.d.ts +15 -0
  132. package/dist/cdk/constructs/components/primitives/memory/memory-actions.d.ts.map +1 -0
  133. package/dist/cdk/constructs/components/primitives/memory/memory-actions.js +32 -0
  134. package/dist/cdk/constructs/components/primitives/memory/memory-actions.js.map +1 -0
  135. package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentConnector.d.ts +28 -0
  136. package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentConnector.d.ts.map +1 -0
  137. package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentConnector.js +44 -0
  138. package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentConnector.js.map +1 -0
  139. package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentManager.d.ts +38 -0
  140. package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentManager.d.ts.map +1 -0
  141. package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentManager.js +111 -0
  142. package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentManager.js.map +1 -0
  143. package/dist/cdk/constructs/components/primitives/payment/index.d.ts +3 -0
  144. package/dist/cdk/constructs/components/primitives/payment/index.d.ts.map +1 -0
  145. package/dist/cdk/constructs/components/primitives/payment/index.js +8 -0
  146. package/dist/cdk/constructs/components/primitives/payment/index.js.map +1 -0
  147. package/dist/cdk/constructs/components/primitives/policy/AgentCorePolicyEngine.d.ts +28 -0
  148. package/dist/cdk/constructs/components/primitives/policy/AgentCorePolicyEngine.d.ts.map +1 -0
  149. package/dist/cdk/constructs/components/primitives/policy/AgentCorePolicyEngine.js +72 -0
  150. package/dist/cdk/constructs/components/primitives/policy/AgentCorePolicyEngine.js.map +1 -0
  151. package/dist/cdk/constructs/components/primitives/policy/index.d.ts +2 -0
  152. package/dist/cdk/constructs/components/primitives/policy/index.d.ts.map +1 -0
  153. package/dist/cdk/constructs/components/primitives/policy/index.js +6 -0
  154. package/dist/cdk/constructs/components/primitives/policy/index.js.map +1 -0
  155. package/dist/cdk/constructs/components/primitives/runtime/AgentCoreRuntime.d.ts +35 -2
  156. package/dist/cdk/constructs/components/primitives/runtime/AgentCoreRuntime.d.ts.map +1 -1
  157. package/dist/cdk/constructs/components/primitives/runtime/AgentCoreRuntime.js +290 -80
  158. package/dist/cdk/constructs/components/primitives/runtime/AgentCoreRuntime.js.map +1 -1
  159. package/dist/cdk/constructs/components/primitives/runtime/__tests__/AgentCoreRuntime.test.d.ts +2 -0
  160. package/dist/cdk/constructs/components/primitives/runtime/__tests__/AgentCoreRuntime.test.d.ts.map +1 -0
  161. package/dist/cdk/constructs/components/primitives/runtime/__tests__/AgentCoreRuntime.test.js +113 -0
  162. package/dist/cdk/constructs/components/primitives/runtime/__tests__/AgentCoreRuntime.test.js.map +1 -0
  163. package/dist/cdk/constructs/components/shared/__tests__/build-authorizer-config.test.d.ts +2 -0
  164. package/dist/cdk/constructs/components/shared/__tests__/build-authorizer-config.test.d.ts.map +1 -0
  165. package/dist/cdk/constructs/components/shared/__tests__/build-authorizer-config.test.js +99 -0
  166. package/dist/cdk/constructs/components/shared/__tests__/build-authorizer-config.test.js.map +1 -0
  167. package/dist/cdk/constructs/components/shared/build-authorizer-config.d.ts +28 -0
  168. package/dist/cdk/constructs/components/shared/build-authorizer-config.d.ts.map +1 -0
  169. package/dist/cdk/constructs/components/shared/build-authorizer-config.js +39 -0
  170. package/dist/cdk/constructs/components/shared/build-authorizer-config.js.map +1 -0
  171. package/dist/cdk/constructs/components/shared/load-additional-policies.d.ts +18 -0
  172. package/dist/cdk/constructs/components/shared/load-additional-policies.d.ts.map +1 -0
  173. package/dist/cdk/constructs/components/shared/load-additional-policies.js +51 -0
  174. package/dist/cdk/constructs/components/shared/load-additional-policies.js.map +1 -0
  175. package/dist/cdk/constructs/connections/wire-connections.d.ts +24 -0
  176. package/dist/cdk/constructs/connections/wire-connections.d.ts.map +1 -0
  177. package/dist/cdk/constructs/connections/wire-connections.js +218 -0
  178. package/dist/cdk/constructs/connections/wire-connections.js.map +1 -0
  179. package/dist/cdk/constructs/index.d.ts +7 -3
  180. package/dist/cdk/constructs/index.d.ts.map +1 -1
  181. package/dist/cdk/constructs/index.js +20 -1
  182. package/dist/cdk/constructs/index.js.map +1 -1
  183. package/dist/cdk/constructs/l3/AgentCoreApplication.d.ts +133 -2
  184. package/dist/cdk/constructs/l3/AgentCoreApplication.d.ts.map +1 -1
  185. package/dist/cdk/constructs/l3/AgentCoreApplication.js +553 -10
  186. package/dist/cdk/constructs/l3/AgentCoreApplication.js.map +1 -1
  187. package/dist/cdk/constructs/l3/AgentCoreHarnessEnvironment.d.ts +38 -0
  188. package/dist/cdk/constructs/l3/AgentCoreHarnessEnvironment.d.ts.map +1 -0
  189. package/dist/cdk/constructs/l3/AgentCoreHarnessEnvironment.js +86 -0
  190. package/dist/cdk/constructs/l3/AgentCoreHarnessEnvironment.js.map +1 -0
  191. package/dist/cdk/constructs/l3/AgentCoreMcp.d.ts +9 -1
  192. package/dist/cdk/constructs/l3/AgentCoreMcp.d.ts.map +1 -1
  193. package/dist/cdk/constructs/l3/AgentCoreMcp.js +95 -17
  194. package/dist/cdk/constructs/l3/AgentCoreMcp.js.map +1 -1
  195. package/dist/cdk/constructs/l3/AgentEnvironment.d.ts +9 -0
  196. package/dist/cdk/constructs/l3/AgentEnvironment.d.ts.map +1 -1
  197. package/dist/cdk/constructs/l3/AgentEnvironment.js +42 -2
  198. package/dist/cdk/constructs/l3/AgentEnvironment.js.map +1 -1
  199. package/dist/cdk/constructs/l3/index.d.ts +2 -1
  200. package/dist/cdk/constructs/l3/index.d.ts.map +1 -1
  201. package/dist/cdk/constructs/l3/index.js +3 -1
  202. package/dist/cdk/constructs/l3/index.js.map +1 -1
  203. package/dist/cdk/index.d.ts +1 -1
  204. package/dist/cdk/index.d.ts.map +1 -1
  205. package/dist/cdk/index.js +15 -1
  206. package/dist/cdk/index.js.map +1 -1
  207. package/dist/cdk/utils/__tests__/tags.test.d.ts +2 -0
  208. package/dist/cdk/utils/__tests__/tags.test.d.ts.map +1 -0
  209. package/dist/cdk/utils/__tests__/tags.test.js +57 -0
  210. package/dist/cdk/utils/__tests__/tags.test.js.map +1 -0
  211. package/dist/cdk/utils/tags.d.ts +11 -0
  212. package/dist/cdk/utils/tags.d.ts.map +1 -0
  213. package/dist/cdk/utils/tags.js +22 -0
  214. package/dist/cdk/utils/tags.js.map +1 -0
  215. package/dist/index.d.ts +1 -1
  216. package/dist/index.d.ts.map +1 -1
  217. package/dist/index.js +15 -1
  218. package/dist/index.js.map +1 -1
  219. package/dist/lib/constants.d.ts +1 -0
  220. package/dist/lib/constants.d.ts.map +1 -1
  221. package/dist/lib/constants.js +2 -1
  222. package/dist/lib/constants.js.map +1 -1
  223. package/dist/lib/errors/config.js +1 -1
  224. package/dist/lib/errors/config.js.map +1 -1
  225. package/dist/lib/index.d.ts +1 -1
  226. package/dist/lib/index.d.ts.map +1 -1
  227. package/dist/lib/index.js +2 -1
  228. package/dist/lib/index.js.map +1 -1
  229. package/dist/lib/packaging/helpers.d.ts +4 -0
  230. package/dist/lib/packaging/helpers.d.ts.map +1 -1
  231. package/dist/lib/packaging/helpers.js +53 -16
  232. package/dist/lib/packaging/helpers.js.map +1 -1
  233. package/dist/lib/packaging/index.d.ts +2 -6
  234. package/dist/lib/packaging/index.d.ts.map +1 -1
  235. package/dist/lib/packaging/index.js +11 -10
  236. package/dist/lib/packaging/index.js.map +1 -1
  237. package/dist/lib/packaging/node.d.ts +6 -0
  238. package/dist/lib/packaging/node.d.ts.map +1 -0
  239. package/dist/lib/packaging/node.js +97 -0
  240. package/dist/lib/packaging/node.js.map +1 -0
  241. package/dist/lib/packaging/types/packaging.d.ts +2 -0
  242. package/dist/lib/packaging/types/packaging.d.ts.map +1 -1
  243. package/dist/lib/packaging/uv.d.ts.map +1 -1
  244. package/dist/lib/packaging/uv.js +1 -1
  245. package/dist/lib/packaging/uv.js.map +1 -1
  246. package/dist/lib/schemas/io/config-io.d.ts +6 -3
  247. package/dist/lib/schemas/io/config-io.d.ts.map +1 -1
  248. package/dist/lib/schemas/io/config-io.js +19 -11
  249. package/dist/lib/schemas/io/config-io.js.map +1 -1
  250. package/dist/schema/constants.d.ts +24 -0
  251. package/dist/schema/constants.d.ts.map +1 -1
  252. package/dist/schema/constants.js +43 -4
  253. package/dist/schema/constants.js.map +1 -1
  254. package/dist/schema/schemas/agent-env.d.ts +229 -6
  255. package/dist/schema/schemas/agent-env.d.ts.map +1 -1
  256. package/dist/schema/schemas/agent-env.js +260 -12
  257. package/dist/schema/schemas/agent-env.js.map +1 -1
  258. package/dist/schema/schemas/agentcore-project.d.ts +971 -22
  259. package/dist/schema/schemas/agentcore-project.d.ts.map +1 -1
  260. package/dist/schema/schemas/agentcore-project.js +297 -11
  261. package/dist/schema/schemas/agentcore-project.js.map +1 -1
  262. package/dist/schema/schemas/auth.d.ts +311 -0
  263. package/dist/schema/schemas/auth.d.ts.map +1 -0
  264. package/dist/schema/schemas/auth.js +236 -0
  265. package/dist/schema/schemas/auth.js.map +1 -0
  266. package/dist/schema/schemas/aws-targets.d.ts +21 -0
  267. package/dist/schema/schemas/aws-targets.d.ts.map +1 -1
  268. package/dist/schema/schemas/aws-targets.js +8 -0
  269. package/dist/schema/schemas/aws-targets.js.map +1 -1
  270. package/dist/schema/schemas/connections.d.ts +183 -0
  271. package/dist/schema/schemas/connections.d.ts.map +1 -0
  272. package/dist/schema/schemas/connections.js +176 -0
  273. package/dist/schema/schemas/connections.js.map +1 -0
  274. package/dist/schema/schemas/deployed-state.d.ts +224 -16
  275. package/dist/schema/schemas/deployed-state.d.ts.map +1 -1
  276. package/dist/schema/schemas/deployed-state.js +52 -4
  277. package/dist/schema/schemas/deployed-state.js.map +1 -1
  278. package/dist/schema/schemas/index.d.ts +2 -0
  279. package/dist/schema/schemas/index.d.ts.map +1 -1
  280. package/dist/schema/schemas/index.js +2 -0
  281. package/dist/schema/schemas/index.js.map +1 -1
  282. package/dist/schema/schemas/mcp.d.ts +628 -32
  283. package/dist/schema/schemas/mcp.d.ts.map +1 -1
  284. package/dist/schema/schemas/mcp.js +736 -44
  285. package/dist/schema/schemas/mcp.js.map +1 -1
  286. package/dist/schema/schemas/primitives/config-bundle.d.ts +30 -0
  287. package/dist/schema/schemas/primitives/config-bundle.d.ts.map +1 -0
  288. package/dist/schema/schemas/primitives/config-bundle.js +36 -0
  289. package/dist/schema/schemas/primitives/config-bundle.js.map +1 -0
  290. package/dist/schema/schemas/primitives/dataset.d.ts +53 -0
  291. package/dist/schema/schemas/primitives/dataset.d.ts.map +1 -0
  292. package/dist/schema/schemas/primitives/dataset.js +65 -0
  293. package/dist/schema/schemas/primitives/dataset.js.map +1 -0
  294. package/dist/schema/schemas/primitives/evaluator.d.ts +100 -0
  295. package/dist/schema/schemas/primitives/evaluator.d.ts.map +1 -0
  296. package/dist/schema/schemas/primitives/evaluator.js +73 -0
  297. package/dist/schema/schemas/primitives/evaluator.js.map +1 -0
  298. package/dist/schema/schemas/primitives/harness.d.ts +648 -0
  299. package/dist/schema/schemas/primitives/harness.d.ts.map +1 -0
  300. package/dist/schema/schemas/primitives/harness.js +579 -0
  301. package/dist/schema/schemas/primitives/harness.js.map +1 -0
  302. package/dist/schema/schemas/primitives/index.d.ts +16 -2
  303. package/dist/schema/schemas/primitives/index.d.ts.map +1 -1
  304. package/dist/schema/schemas/primitives/index.js +63 -1
  305. package/dist/schema/schemas/primitives/index.js.map +1 -1
  306. package/dist/schema/schemas/primitives/knowledge-base.d.ts +103 -0
  307. package/dist/schema/schemas/primitives/knowledge-base.d.ts.map +1 -0
  308. package/dist/schema/schemas/primitives/knowledge-base.js +98 -0
  309. package/dist/schema/schemas/primitives/knowledge-base.js.map +1 -0
  310. package/dist/schema/schemas/primitives/memory.d.ts +33 -2
  311. package/dist/schema/schemas/primitives/memory.d.ts.map +1 -1
  312. package/dist/schema/schemas/primitives/memory.js +33 -3
  313. package/dist/schema/schemas/primitives/memory.js.map +1 -1
  314. package/dist/schema/schemas/primitives/online-evaluation-config.d.ts +32 -0
  315. package/dist/schema/schemas/primitives/online-evaluation-config.d.ts.map +1 -0
  316. package/dist/schema/schemas/primitives/online-evaluation-config.js +66 -0
  317. package/dist/schema/schemas/primitives/online-evaluation-config.js.map +1 -0
  318. package/dist/schema/schemas/primitives/policy.d.ts +49 -0
  319. package/dist/schema/schemas/primitives/policy.d.ts.map +1 -0
  320. package/dist/schema/schemas/primitives/policy.js +62 -0
  321. package/dist/schema/schemas/primitives/policy.js.map +1 -0
  322. package/dist/schema/schemas/primitives/tags.d.ts +6 -0
  323. package/dist/schema/schemas/primitives/tags.d.ts.map +1 -0
  324. package/dist/schema/schemas/primitives/tags.js +20 -0
  325. package/dist/schema/schemas/primitives/tags.js.map +1 -0
  326. package/package.json +22 -5
  327. package/dist/cdk/constructs/components/mcp/McpGateway.d.ts +0 -49
  328. package/dist/cdk/constructs/components/mcp/McpGateway.d.ts.map +0 -1
  329. package/dist/cdk/constructs/components/mcp/McpGateway.js +0 -288
  330. package/dist/cdk/constructs/components/mcp/McpGateway.js.map +0 -1
@@ -2,20 +2,34 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AgentCoreApplication = void 0;
4
4
  const lib_1 = require("../../../lib");
5
+ const constants_1 = require("../../constants");
5
6
  const logical_ids_1 = require("../../logical-ids");
7
+ const AgentCoreConfigBundle_1 = require("../components/primitives/config-bundle/AgentCoreConfigBundle");
8
+ const AgentCoreDataset_1 = require("../components/primitives/dataset/AgentCoreDataset");
9
+ const AgentCoreEvaluator_1 = require("../components/primitives/evaluator/AgentCoreEvaluator");
10
+ const AgentCoreOnlineEvaluationConfig_1 = require("../components/primitives/evaluator/AgentCoreOnlineEvaluationConfig");
11
+ const AgentCoreKnowledgeBase_1 = require("../components/primitives/knowledge-base/AgentCoreKnowledgeBase");
6
12
  const AgentCoreMemory_1 = require("../components/primitives/memory/AgentCoreMemory");
13
+ const AgentCorePolicyEngine_1 = require("../components/primitives/policy/AgentCorePolicyEngine");
14
+ const wire_connections_1 = require("../connections/wire-connections");
15
+ const AgentCoreHarnessEnvironment_1 = require("./AgentCoreHarnessEnvironment");
7
16
  const AgentEnvironment_1 = require("./AgentEnvironment");
8
17
  const aws_cdk_lib_1 = require("aws-cdk-lib");
18
+ const aws_cdk_lib_2 = require("aws-cdk-lib");
9
19
  const constructs_1 = require("constructs");
10
20
  /**
11
21
  * AgentCore Application L3 Construct - v2 resource-centric model.
12
22
  *
13
23
  * Creates:
14
- * - Agent environments (runtimes) for each agent
24
+ * - Agent environments (runtimes) for each agent (may be empty for memory-only deployments)
15
25
  * - Memory resources at project level
26
+ * - Evaluator resources at project level
27
+ * - Online evaluation config resources at project level
16
28
  * - Wires all agents to all memories (implicit access)
17
29
  * - Wires credentials to all agents
18
30
  *
31
+ * Creation order: memories → evaluators → agents → online evaluation configs
32
+ *
19
33
  * All child constructs use stable logical IDs derived from resource names
20
34
  * via the logical-ids utility to ensure deterministic CloudFormation updates.
21
35
  */
@@ -24,10 +38,53 @@ class AgentCoreApplication extends constructs_1.Construct {
24
38
  environments = new Map();
25
39
  /** Memories keyed by memory name */
26
40
  memories = new Map();
41
+ /**
42
+ * Knowledge bases keyed by KB name.
43
+ *
44
+ * Public so Wave 2 can resolve `knowledgeBaseId` when wiring connector
45
+ * gateway targets — `app.knowledgeBases.get(kbName).knowledgeBaseId`.
46
+ * Do not narrow this back to private without updating Wave 2's lookup
47
+ * path; the contract is consumed cross-construct.
48
+ */
49
+ knowledgeBases = new Map();
50
+ /** Evaluators keyed by evaluator name */
51
+ evaluators = new Map();
52
+ /** Online evaluation configs keyed by config name */
53
+ onlineEvalConfigs = new Map();
54
+ /** Policy engines keyed by engine name */
55
+ policyEngines = new Map();
56
+ /** Config bundles keyed by bundle name */
57
+ configBundles = new Map();
58
+ /** Datasets keyed by dataset name */
59
+ datasets = new Map();
60
+ /** Harness roles keyed by harness name */
61
+ harnessRoles = new Map();
62
+ /** Harness CFN resources keyed by harness name (only those deployed via CDK with a full spec) */
63
+ harnesses = new Map();
27
64
  constructor(scope, id, props) {
28
65
  super(scope, id);
29
- const { spec } = props;
66
+ const { spec, connectorParametersByFile } = props;
30
67
  const projectName = spec.name;
68
+ const projectTags = spec.tags;
69
+ // Apply project-level tags via Tags.of() for propagation to supporting AWS resources.
70
+ // Exclude BedrockAgentCore resource types so that composeTags() on primary resources
71
+ // can correctly handle resource-level tag overrides on key conflicts.
72
+ if (projectTags) {
73
+ for (const [key, value] of Object.entries(projectTags)) {
74
+ aws_cdk_lib_1.Tags.of(this).add(key, value, {
75
+ excludeResourceTypes: [
76
+ 'AWS::BedrockAgentCore::Runtime',
77
+ 'AWS::BedrockAgentCore::Memory',
78
+ 'AWS::BedrockAgentCore::Evaluator',
79
+ 'AWS::BedrockAgentCore::OnlineEvaluationConfig',
80
+ 'AWS::BedrockAgentCore::PolicyEngine',
81
+ 'AWS::BedrockAgentCore::Gateway',
82
+ 'AWS::BedrockAgentCore::Dataset',
83
+ 'AWS::BedrockAgentCore::Harness',
84
+ ],
85
+ });
86
+ }
87
+ }
31
88
  // Resolve config root once for all environments
32
89
  const configRoot = (0, lib_1.findConfigRoot)();
33
90
  if (!configRoot) {
@@ -40,21 +97,113 @@ class AgentCoreApplication extends constructs_1.Construct {
40
97
  const memory = new AgentCoreMemory_1.AgentCoreMemory(this, (0, logical_ids_1.toPascalId)('Memory', memorySpec.name), {
41
98
  projectName,
42
99
  memory: memorySpec,
100
+ projectTags,
43
101
  });
44
102
  this.memories.set(memorySpec.name, memory);
45
103
  }
46
104
  // ═══════════════════════════════════════════════════════════════════
105
+ // Create all knowledge bases (project-level resources)
106
+ // ═══════════════════════════════════════════════════════════════════
107
+ for (const kbSpec of spec.knowledgeBases ?? []) {
108
+ const kb = new AgentCoreKnowledgeBase_1.AgentCoreKnowledgeBase(this, (0, logical_ids_1.toPascalId)('KnowledgeBase', kbSpec.name), {
109
+ projectName,
110
+ knowledgeBase: kbSpec,
111
+ projectTags,
112
+ connectorParametersByFile,
113
+ });
114
+ this.knowledgeBases.set(kbSpec.name, kb);
115
+ }
116
+ // ═══════════════════════════════════════════════════════════════════
117
+ // Create all evaluators (project-level resources)
118
+ // ═══════════════════════════════════════════════════════════════════
119
+ for (const evalSpec of spec.evaluators ?? []) {
120
+ const evaluator = new AgentCoreEvaluator_1.AgentCoreEvaluator(this, (0, logical_ids_1.toPascalId)('Evaluator', evalSpec.name), {
121
+ projectName,
122
+ evaluator: evalSpec,
123
+ projectTags,
124
+ });
125
+ this.evaluators.set(evalSpec.name, evaluator);
126
+ }
127
+ // ═══════════════════════════════════════════════════════════════════
128
+ // Create all policy engines (project-level resources)
129
+ // ═══════════════════════════════════════════════════════════════════
130
+ for (const policyEngineSpec of spec.policyEngines ?? []) {
131
+ const policyEngine = new AgentCorePolicyEngine_1.AgentCorePolicyEngine(this, (0, logical_ids_1.toPascalId)('PolicyEngine', policyEngineSpec.name), {
132
+ projectName,
133
+ policyEngine: policyEngineSpec,
134
+ projectTags,
135
+ });
136
+ this.policyEngines.set(policyEngineSpec.name, policyEngine);
137
+ }
138
+ // ═══════════════════════════════════════════════════════════════════
139
+ // Create all datasets (project-level resources)
140
+ // ═══════════════════════════════════════════════════════════════════
141
+ for (const datasetSpec of spec.datasets ?? []) {
142
+ const dataset = new AgentCoreDataset_1.AgentCoreDataset(this, (0, logical_ids_1.toPascalId)('Dataset', datasetSpec.name), {
143
+ projectName,
144
+ dataset: datasetSpec,
145
+ projectTags,
146
+ });
147
+ this.datasets.set(datasetSpec.name, dataset);
148
+ }
149
+ // ═══════════════════════════════════════════════════════════════════
47
150
  // Create all agent environments
48
151
  // ═══════════════════════════════════════════════════════════════════
49
- for (const agentSpec of spec.agents ?? []) {
152
+ for (const agentSpec of spec.runtimes ?? []) {
50
153
  const env = new AgentEnvironment_1.AgentEnvironment(this, (0, logical_ids_1.toPascalId)('Agent', agentSpec.name), {
51
154
  projectName,
52
155
  agent: agentSpec,
53
156
  configRoot,
157
+ projectTags,
54
158
  });
55
159
  this.environments.set(agentSpec.name, env);
56
160
  }
57
161
  // ═══════════════════════════════════════════════════════════════════
162
+ // Create all config bundles (depend on runtimes/gateways for ARN refs)
163
+ // ═══════════════════════════════════════════════════════════════════
164
+ for (const bundleSpec of spec.configBundles ?? []) {
165
+ const resolvedComponents = this.resolveConfigBundleComponents(bundleSpec.components);
166
+ const configBundle = new AgentCoreConfigBundle_1.AgentCoreConfigBundle(this, (0, logical_ids_1.toPascalId)('ConfigBundle', bundleSpec.name), {
167
+ projectName,
168
+ configBundle: bundleSpec,
169
+ resolvedComponents,
170
+ projectTags,
171
+ });
172
+ this.configBundles.set(bundleSpec.name, configBundle);
173
+ }
174
+ // ═══════════════════════════════════════════════════════════════════
175
+ // Create all harnesses (IAM role + optional container + the CFN resource)
176
+ // ═══════════════════════════════════════════════════════════════════
177
+ for (const harness of props.harnesses ?? []) {
178
+ const { memoryArn, retrievalConfig } = this.resolveHarnessMemory(harness, spec.memories ?? []);
179
+ const harnessEnv = new AgentCoreHarnessEnvironment_1.AgentCoreHarnessEnvironment(this, (0, logical_ids_1.toPascalId)('Harness', harness.name), {
180
+ projectName,
181
+ projectTags,
182
+ harness,
183
+ spec: harness.spec,
184
+ harnessDir: harness.harnessDir,
185
+ memoryArn,
186
+ retrievalConfig,
187
+ credentials: props.credentials,
188
+ });
189
+ this.harnessRoles.set(harness.name, harnessEnv.harnessRole);
190
+ if (harnessEnv.harness)
191
+ this.harnesses.set(harness.name, harnessEnv.harness);
192
+ }
193
+ // ═══════════════════════════════════════════════════════════════════
194
+ // Create all online eval configs (depend on evaluators + agents)
195
+ // ═══════════════════════════════════════════════════════════════════
196
+ for (const configSpec of spec.onlineEvalConfigs ?? []) {
197
+ const onlineEvalConfig = new AgentCoreOnlineEvaluationConfig_1.AgentCoreOnlineEvaluationConfig(this, (0, logical_ids_1.toPascalId)('OnlineEval', configSpec.name), {
198
+ projectName,
199
+ config: configSpec,
200
+ environments: this.environments,
201
+ evaluators: this.evaluators,
202
+ projectTags,
203
+ });
204
+ this.onlineEvalConfigs.set(configSpec.name, onlineEvalConfig);
205
+ }
206
+ // ═══════════════════════════════════════════════════════════════════
58
207
  // Wire all agents to all memories (implicit project-level access)
59
208
  // ═══════════════════════════════════════════════════════════════════
60
209
  this.wireMemoriesToAgents(spec.memories ?? []);
@@ -63,9 +212,105 @@ class AgentCoreApplication extends constructs_1.Construct {
63
212
  // ═══════════════════════════════════════════════════════════════════
64
213
  this.wireCredentialsToAgents(spec.credentials ?? []);
65
214
  // ═══════════════════════════════════════════════════════════════════
66
- // Create memory outputs
215
+ // Wire all memories to all harness roles
216
+ // ═══════════════════════════════════════════════════════════════════
217
+ this.wireMemoriesToHarnesses(props.harnesses ?? []);
218
+ // ═══════════════════════════════════════════════════════════════════
219
+ // Wire harness connections to external AgentCore resources (IAM only —
220
+ // the harness runtime reads target config from its spec, not env vars)
221
+ // ═══════════════════════════════════════════════════════════════════
222
+ this.wireConnectionsToHarnesses(props.harnesses ?? []);
223
+ // ═══════════════════════════════════════════════════════════════════
224
+ // Create outputs
67
225
  // ═══════════════════════════════════════════════════════════════════
68
226
  this.createMemoryOutputs();
227
+ this.createEvaluatorOutputs();
228
+ this.createOnlineEvaluationConfigOutputs();
229
+ // ═══════════════════════════════════════════════════════════════════
230
+ // Create policy engine outputs
231
+ // ═══════════════════════════════════════════════════════════════════
232
+ this.createPolicyOutputs();
233
+ // ═══════════════════════════════════════════════════════════════════
234
+ // Create dataset outputs
235
+ // ═══════════════════════════════════════════════════════════════════
236
+ this.createDatasetOutputs();
237
+ // ═══════════════════════════════════════════════════════════════════
238
+ // Create config bundle outputs
239
+ // ═══════════════════════════════════════════════════════════════════
240
+ this.createConfigBundleOutputs();
241
+ // ═══════════════════════════════════════════════════════════════════
242
+ // Create knowledge base outputs
243
+ // ═══════════════════════════════════════════════════════════════════
244
+ this.createKnowledgeBaseOutputs();
245
+ // ═══════════════════════════════════════════════════════════════════
246
+ // Create harness outputs
247
+ // ═══════════════════════════════════════════════════════════════════
248
+ this.createHarnessOutputs();
249
+ }
250
+ /**
251
+ * Resolve a harness's referenced memory into the in-stack ARN token + the
252
+ * retrievalConfig derived from that memory's strategy namespaces.
253
+ * Direct ARN (`memory.arn`) takes precedence over a by-name reference.
254
+ */
255
+ resolveHarnessMemory(harness, memories) {
256
+ const memoryRef = harness.spec?.memory;
257
+ if (!memoryRef)
258
+ return {};
259
+ // Managed memory is owned by the harness internally; disabled has none. Neither resolves a
260
+ // sibling memory ARN or per-namespace retrievalConfig — those only apply to `existing`.
261
+ if (memoryRef.mode !== 'existing')
262
+ return {};
263
+ let memoryArn;
264
+ let memorySpec;
265
+ if (memoryRef.arn) {
266
+ memoryArn = memoryRef.arn;
267
+ }
268
+ else if (memoryRef.name) {
269
+ const memory = this.memories.get(memoryRef.name);
270
+ if (!memory) {
271
+ throw new Error(`Memory "${memoryRef.name}" referenced by harness "${harness.name}" is not defined in this project.`);
272
+ }
273
+ memoryArn = memory.memoryArn;
274
+ memorySpec = memories.find(m => m.name === memoryRef.name);
275
+ }
276
+ return { memoryArn, retrievalConfig: buildRetrievalConfig(memorySpec, memoryRef.retrievalConfig) };
277
+ }
278
+ /**
279
+ * Creates CloudFormation outputs for harnesses deployed via CDK.
280
+ * Per-harness: HarnessId, HarnessArn, Status, Version, AgentRuntimeArn.
281
+ * (The execution-role ARN output is emitted separately by AgentCoreHarnessRole.)
282
+ */
283
+ createHarnessOutputs() {
284
+ if (this.harnesses.size === 0)
285
+ return;
286
+ const stack = aws_cdk_lib_1.Stack.of(this);
287
+ for (const [harnessName, harness] of this.harnesses) {
288
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Harness', harnessName), 'Id'), {
289
+ description: `Harness ID for: ${harnessName}`,
290
+ value: harness.harnessId,
291
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Harness', harnessName, 'Id'),
292
+ });
293
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Harness', harnessName), 'Arn'), {
294
+ description: `Harness ARN for: ${harnessName}`,
295
+ value: harness.harnessArn,
296
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Harness', harnessName, 'Arn'),
297
+ });
298
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Harness', harnessName), 'Status'), {
299
+ description: `Harness status for: ${harnessName}`,
300
+ value: harness.status,
301
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Harness', harnessName, 'Status'),
302
+ });
303
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Harness', harnessName), 'Version'), {
304
+ description: `Harness config version for: ${harnessName}`,
305
+ value: harness.harnessVersion,
306
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Harness', harnessName, 'Version'),
307
+ });
308
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Harness', harnessName), 'AgentRuntimeArn'), {
309
+ description: `Underlying AgentCore Runtime ARN for harness: ${harnessName}`,
310
+ value: harness.agentRuntimeArn,
311
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Harness', harnessName, 'AgentRuntimeArn'),
312
+ });
313
+ }
69
314
  }
70
315
  /**
71
316
  * Wire all memories to all agents in the project.
@@ -78,8 +323,7 @@ class AgentCoreApplication extends constructs_1.Construct {
78
323
  for (const env of this.environments.values()) {
79
324
  memory.grant(env.runtime);
80
325
  // Add memory ID as environment variable (using MEMORY_{NAME}_ID pattern)
81
- const envVarName = `MEMORY_${memorySpec.name.toUpperCase()}_ID`;
82
- env.runtime.addEnvironmentVariable(envVarName, memory.memoryId);
326
+ env.runtime.addEnvironmentVariable(memory.getEnvVarName(), memory.getEnvVarValue());
83
327
  }
84
328
  }
85
329
  }
@@ -88,21 +332,92 @@ class AgentCoreApplication extends constructs_1.Construct {
88
332
  * Sets credential provider name env vars for each agent.
89
333
  */
90
334
  wireCredentialsToAgents(credentials) {
91
- for (const credential of credentials) {
92
- // Add credential provider name as env var to all agents
93
- const envVarName = `CREDENTIAL_${credential.name.toUpperCase().replace(/[.-]/g, '_')}_NAME`;
94
- for (const env of this.environments.values()) {
335
+ if (credentials.length === 0)
336
+ return;
337
+ for (const env of this.environments.values()) {
338
+ // Grant AgentCore Identity & API key permissions (only when credentials are configured)
339
+ env.runtime.grantCredentialAccess();
340
+ // Add credential provider name as env var
341
+ for (const credential of credentials) {
342
+ const envVarName = `CREDENTIAL_${credential.name.toUpperCase().replace(/[.-]/g, '_')}_NAME`;
95
343
  env.runtime.addEnvironmentVariable(envVarName, credential.name);
96
344
  }
97
345
  }
98
346
  }
347
+ /**
348
+ * Wire each harness role to its specific `existing` memory (if configured).
349
+ * Unlike agents which get implicit access to all memories, harnesses only get access to the
350
+ * single memory they reference. An `existing` ref resolves to a memory ARN one of two ways:
351
+ * - by name → a sibling project memory (looked up in `this.memories`); or
352
+ * - by ARN → an EXTERNAL memory not defined in this project.
353
+ * Both must receive the data-plane grant, scoped to the resolved ARN. (Managed/disabled/omitted
354
+ * memory is granted separately by AgentCoreHarnessRole's AgentCoreManagedMemory statement.)
355
+ */
356
+ wireMemoriesToHarnesses(harnesses) {
357
+ for (const harness of harnesses) {
358
+ const harnessRole = this.harnessRoles.get(harness.name);
359
+ if (!harnessRole)
360
+ continue;
361
+ // Resolve the target memory ARN: a sibling by name, or an external ARN carried on the spec.
362
+ let memoryArn;
363
+ if (harness.memoryName) {
364
+ memoryArn = this.memories.get(harness.memoryName)?.memoryArn;
365
+ }
366
+ else if (harness.spec?.memory?.mode === 'existing' && harness.spec.memory.arn) {
367
+ memoryArn = harness.spec.memory.arn;
368
+ }
369
+ if (!memoryArn)
370
+ continue;
371
+ harnessRole.addToPolicy(new aws_cdk_lib_2.aws_iam.PolicyStatement({
372
+ sid: 'AgentCoreExistingMemory',
373
+ actions: [...constants_1.HARNESS_MEMORY_DATA_PLANE_ACTIONS],
374
+ resources: [memoryArn],
375
+ }));
376
+ }
377
+ }
378
+ /**
379
+ * Wire each harness's external connections (memory/gateway/runtime) onto its execution role.
380
+ * IAM only — the harness runtime reads target config (auth, memory) from its spec, so no env
381
+ * vars are injected (and the harness CFN env vars are already fixed at construction). Imported
382
+ * roles emit a synth-time warning instead of attaching (AgentCoreHarnessRole.addToPolicy).
383
+ */
384
+ wireConnectionsToHarnesses(harnesses) {
385
+ for (const harness of harnesses) {
386
+ const connections = harness.spec?.connections;
387
+ if (!connections?.length)
388
+ continue;
389
+ const harnessRole = this.harnessRoles.get(harness.name);
390
+ if (!harnessRole)
391
+ continue;
392
+ for (const connection of connections) {
393
+ const { statements } = (0, wire_connections_1.buildConnectionWiring)(harnessRole, connection);
394
+ for (const statement of statements)
395
+ harnessRole.addToPolicy(statement);
396
+ }
397
+ }
398
+ }
99
399
  /**
100
400
  * Creates CloudFormation outputs for memories.
401
+ * Produces per-memory outputs (Id, Arn) plus aggregate outputs for backwards compatibility.
101
402
  */
102
403
  createMemoryOutputs() {
103
404
  if (this.memories.size === 0)
104
405
  return;
105
406
  const stack = aws_cdk_lib_1.Stack.of(this);
407
+ // Per-memory outputs
408
+ for (const [memoryName, memory] of this.memories) {
409
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Memory', memoryName), 'Id'), {
410
+ description: `Memory ID for: ${memoryName}`,
411
+ value: memory.memoryId,
412
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Memory', memoryName, 'Id'),
413
+ });
414
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Memory', memoryName), 'Arn'), {
415
+ description: `Memory ARN for: ${memoryName}`,
416
+ value: memory.memoryArn,
417
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Memory', memoryName, 'Arn'),
418
+ });
419
+ }
420
+ // Aggregate outputs (backwards compatibility)
106
421
  const memoryIds = Array.from(this.memories.values()).map(m => m.memoryId);
107
422
  const memoryNames = Array.from(this.memories.keys());
108
423
  new aws_cdk_lib_1.CfnOutput(this, 'MemoryIds', {
@@ -116,6 +431,234 @@ class AgentCoreApplication extends constructs_1.Construct {
116
431
  exportName: `${stack.stackName}-MemoryNames`,
117
432
  });
118
433
  }
434
+ /**
435
+ * Creates CloudFormation outputs for evaluators.
436
+ */
437
+ createEvaluatorOutputs() {
438
+ if (this.evaluators.size === 0)
439
+ return;
440
+ const stack = aws_cdk_lib_1.Stack.of(this);
441
+ for (const [evalName, evaluator] of this.evaluators) {
442
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Evaluator', evalName), 'Id'), {
443
+ description: `Evaluator ID for: ${evalName}`,
444
+ value: evaluator.evaluatorId,
445
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Evaluator', evalName, 'Id'),
446
+ });
447
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Evaluator', evalName), 'Arn'), {
448
+ description: `Evaluator ARN for: ${evalName}`,
449
+ value: evaluator.evaluatorArn,
450
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Evaluator', evalName, 'Arn'),
451
+ });
452
+ }
453
+ }
454
+ /**
455
+ * Creates CloudFormation outputs for online eval configs.
456
+ */
457
+ createOnlineEvaluationConfigOutputs() {
458
+ if (this.onlineEvalConfigs.size === 0)
459
+ return;
460
+ const stack = aws_cdk_lib_1.Stack.of(this);
461
+ for (const [configName, config] of this.onlineEvalConfigs) {
462
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('OnlineEval', configName), 'Id'), {
463
+ description: `Online evaluation config ID for: ${configName}`,
464
+ value: config.configId,
465
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'OnlineEval', configName, 'Id'),
466
+ });
467
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('OnlineEval', configName), 'Arn'), {
468
+ description: `Online evaluation config ARN for: ${configName}`,
469
+ value: config.configArn,
470
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'OnlineEval', configName, 'Arn'),
471
+ });
472
+ }
473
+ }
474
+ /**
475
+ * Creates CloudFormation outputs for datasets.
476
+ * Produces per-dataset outputs (Id, Arn).
477
+ */
478
+ createDatasetOutputs() {
479
+ if (this.datasets.size === 0)
480
+ return;
481
+ const stack = aws_cdk_lib_1.Stack.of(this);
482
+ for (const [datasetName, dataset] of this.datasets) {
483
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Dataset', datasetName), 'Id'), {
484
+ description: `Dataset ID for: ${datasetName}`,
485
+ value: dataset.datasetId,
486
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Dataset', datasetName, 'Id'),
487
+ });
488
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Dataset', datasetName), 'Arn'), {
489
+ description: `Dataset ARN for: ${datasetName}`,
490
+ value: dataset.datasetArn,
491
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Dataset', datasetName, 'Arn'),
492
+ });
493
+ }
494
+ }
495
+ /**
496
+ * Creates CloudFormation outputs for knowledge bases and their data sources.
497
+ *
498
+ * Per-KB outputs: Id, Arn.
499
+ * Per-DS outputs: DataSourceN.Id and DataSourceN.Uri, where N is the index
500
+ * into the local `dataSources[]` array. Consumers (e.g. the CLI post-deploy
501
+ * hook) read these to map local URI → deployed DS id deterministically
502
+ * instead of parsing physical names.
503
+ */
504
+ createKnowledgeBaseOutputs() {
505
+ if (this.knowledgeBases.size === 0)
506
+ return;
507
+ const stack = aws_cdk_lib_1.Stack.of(this);
508
+ for (const [kbName, kb] of this.knowledgeBases) {
509
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('KnowledgeBase', kbName), 'Id'), {
510
+ description: `Knowledge Base ID for: ${kbName}`,
511
+ value: kb.knowledgeBaseId,
512
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'KnowledgeBase', kbName, 'Id'),
513
+ });
514
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('KnowledgeBase', kbName), 'Arn'), {
515
+ description: `Knowledge Base ARN for: ${kbName}`,
516
+ value: kb.knowledgeBaseArn,
517
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'KnowledgeBase', kbName, 'Arn'),
518
+ });
519
+ kb.dataSources.forEach((ds, index) => {
520
+ const dsLabel = `DataSource${index}`;
521
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('KnowledgeBase', kbName), dsLabel, 'Id'), {
522
+ description: `Data Source ${index} ID for KB: ${kbName}`,
523
+ value: ds.id,
524
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'KnowledgeBase', kbName, dsLabel, 'Id'),
525
+ });
526
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('KnowledgeBase', kbName), dsLabel, 'Uri'), {
527
+ description: `Data Source ${index} URI for KB: ${kbName}`,
528
+ value: ds.uri,
529
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'KnowledgeBase', kbName, dsLabel, 'Uri'),
530
+ });
531
+ });
532
+ }
533
+ }
534
+ /**
535
+ * Creates CloudFormation outputs for policy engines and their policies.
536
+ * Produces per-engine outputs (Id, Arn) and per-policy outputs (Id, Arn).
537
+ */
538
+ createPolicyOutputs() {
539
+ if (this.policyEngines.size === 0)
540
+ return;
541
+ const stack = aws_cdk_lib_1.Stack.of(this);
542
+ for (const [engineName, engine] of this.policyEngines) {
543
+ // Per-engine outputs
544
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('PolicyEngine', engineName), 'Id'), {
545
+ description: `Policy Engine ID for: ${engineName}`,
546
+ value: engine.policyEngineId,
547
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'PolicyEngine', engineName, 'Id'),
548
+ });
549
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('PolicyEngine', engineName), 'Arn'), {
550
+ description: `Policy Engine ARN for: ${engineName}`,
551
+ value: engine.policyEngineArn,
552
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'PolicyEngine', engineName, 'Arn'),
553
+ });
554
+ // Per-policy outputs
555
+ for (const [policyName, policy] of engine.policies) {
556
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Policy', engineName, policyName), 'Id'), {
557
+ description: `Policy ID for: ${engineName}/${policyName}`,
558
+ value: policy.policyId,
559
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Policy', engineName, policyName, 'Id'),
560
+ });
561
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Policy', engineName, policyName), 'Arn'), {
562
+ description: `Policy ARN for: ${engineName}/${policyName}`,
563
+ value: policy.policyArn,
564
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Policy', engineName, policyName, 'Arn'),
565
+ });
566
+ }
567
+ }
568
+ }
569
+ createConfigBundleOutputs() {
570
+ if (this.configBundles.size === 0)
571
+ return;
572
+ const stack = aws_cdk_lib_1.Stack.of(this);
573
+ for (const [bundleName, bundle] of this.configBundles) {
574
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('ConfigBundle', bundleName), 'Id'), {
575
+ description: `ConfigBundle ID for: ${bundleName}`,
576
+ value: bundle.bundleId,
577
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'ConfigBundle', bundleName, 'Id'),
578
+ });
579
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('ConfigBundle', bundleName), 'Arn'), {
580
+ description: `ConfigBundle ARN for: ${bundleName}`,
581
+ value: bundle.bundleArn,
582
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'ConfigBundle', bundleName, 'Arn'),
583
+ });
584
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('ConfigBundle', bundleName), 'VersionId'), {
585
+ description: `ConfigBundle VersionId for: ${bundleName}`,
586
+ value: bundle.versionId,
587
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'ConfigBundle', bundleName, 'VersionId'),
588
+ });
589
+ }
590
+ }
591
+ /**
592
+ * Resolve placeholder component keys (e.g., {{runtime:name}}, {{gateway:name}})
593
+ * to CDK token references from already-created constructs.
594
+ */
595
+ resolveConfigBundleComponents(components) {
596
+ const resolved = {};
597
+ for (const [key, value] of Object.entries(components)) {
598
+ // resolveComponentKey turns a {{runtime:name}} placeholder into the runtime ARN, which is an
599
+ // unresolved CDK token (cfnRuntime.attrAgentRuntimeArn → Fn::GetAtt). A token can't be used as
600
+ // a CFN map key directly, but that's fine here: AgentCoreConfigBundle wraps the whole Components
601
+ // map in CfnJson, which defers resolution to deploy time and emits a concrete ARN-keyed object.
602
+ // (resolveComponentKey still throws for unknown runtimes and unsupported {{gateway:...}} keys.)
603
+ resolved[this.resolveComponentKey(key)] = value;
604
+ }
605
+ return resolved;
606
+ }
607
+ resolveComponentKey(key) {
608
+ if (key.startsWith('arn:'))
609
+ return key;
610
+ const rtMatch = /^\{\{runtime:(.+)\}\}$/.exec(key);
611
+ if (rtMatch) {
612
+ const rtName = rtMatch[1];
613
+ const env = this.environments.get(rtName);
614
+ if (!env) {
615
+ throw new Error(`Config bundle references runtime "${rtName}" but it is not defined in runtimes[]. ` +
616
+ 'Ensure the runtime is listed in agentcore.json.');
617
+ }
618
+ return env.runtime.runtimeArn;
619
+ }
620
+ const gwMatch = /^\{\{gateway:(.+)\}\}$/.exec(key);
621
+ if (gwMatch) {
622
+ throw new Error(`Config bundle references gateway "${gwMatch[1]}" — gateway ARN resolution in config bundles ` +
623
+ 'requires the MCP construct. Use the full gateway ARN as the component key instead.');
624
+ }
625
+ return key;
626
+ }
119
627
  }
120
628
  exports.AgentCoreApplication = AgentCoreApplication;
629
+ /**
630
+ * Derive a harness retrievalConfig from the referenced memory's strategy namespaces,
631
+ * so the harness runtime knows which namespaces to search at inference time. The
632
+ * user-supplied flat tuning (`harness.memory.retrievalConfig`) is fanned out to every
633
+ * namespace — namespaces are only known here (from the resolved Memory's strategies),
634
+ * so a per-namespace map cannot be authored in the harness spec.
635
+ *
636
+ * Reads `namespaceTemplates` (preferred) and falls back to the deprecated `namespaces`,
637
+ * matching AgentCoreMemory's own resolution — a memory defined with only the new
638
+ * template fields would otherwise produce no retrieval namespaces at all.
639
+ */
640
+ function buildRetrievalConfig(memorySpec, tuning) {
641
+ if (!memorySpec?.strategies?.length)
642
+ return undefined;
643
+ // Multiple strategies can declare the same namespace template (e.g. SEMANTIC + USER_PREFERENCE
644
+ // both scoped to /users/{actorId}/profile). Dedup explicitly rather than relying on
645
+ // Object.fromEntries' implicit last-write-wins, which would silently collapse duplicates. The
646
+ // dedup is safe today only because every namespace receives the identical `perNamespace` value;
647
+ // if per-strategy tuning overrides are ever added, this must merge per namespace instead.
648
+ const namespaces = [
649
+ ...new Set(memorySpec.strategies.flatMap(s => [
650
+ ...(s.namespaceTemplates ?? s.namespaces ?? []),
651
+ ...(s.type === 'EPISODIC' ? (s.reflectionNamespaceTemplates ?? s.reflectionNamespaces ?? []) : []),
652
+ ])),
653
+ ];
654
+ if (namespaces.length === 0)
655
+ return undefined;
656
+ const perNamespace = {
657
+ ...(tuning?.topK !== undefined && { TopK: tuning.topK }),
658
+ ...(tuning?.relevanceScore !== undefined && { RelevanceScore: tuning.relevanceScore }),
659
+ };
660
+ // Spread a fresh copy per namespace so the entries don't alias one shared object — a future
661
+ // per-namespace tweak would otherwise mutate every namespace at once.
662
+ return Object.fromEntries(namespaces.map(ns => [ns, { ...perNamespace }]));
663
+ }
121
664
  //# sourceMappingURL=AgentCoreApplication.js.map