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

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