@aws/agentcore-cdk 0.1.0-alpha.8 → 1.0.0-rc.1

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 (453) hide show
  1. package/README.md +242 -40
  2. package/dist/cdk/constants.d.ts +2 -0
  3. package/dist/cdk/constants.d.ts.map +1 -1
  4. package/dist/cdk/constants.js +6 -1
  5. package/dist/cdk/constants.js.map +1 -1
  6. package/dist/cdk/constructs/bundling/container/ContainerSourceAsset.d.ts +26 -4
  7. package/dist/cdk/constructs/bundling/container/ContainerSourceAsset.d.ts.map +1 -1
  8. package/dist/cdk/constructs/bundling/container/ContainerSourceAsset.js +69 -10
  9. package/dist/cdk/constructs/bundling/container/ContainerSourceAsset.js.map +1 -1
  10. package/dist/cdk/constructs/bundling/container/ContainerSourceAssetFromPath.d.ts +17 -0
  11. package/dist/cdk/constructs/bundling/container/ContainerSourceAssetFromPath.d.ts.map +1 -0
  12. package/dist/cdk/constructs/bundling/container/ContainerSourceAssetFromPath.js +20 -0
  13. package/dist/cdk/constructs/bundling/container/ContainerSourceAssetFromPath.js.map +1 -0
  14. package/dist/cdk/constructs/bundling/container/index.d.ts +1 -0
  15. package/dist/cdk/constructs/bundling/container/index.d.ts.map +1 -1
  16. package/dist/cdk/constructs/bundling/container/index.js +3 -1
  17. package/dist/cdk/constructs/bundling/container/index.js.map +1 -1
  18. package/dist/cdk/constructs/bundling/index.d.ts +2 -0
  19. package/dist/cdk/constructs/bundling/index.d.ts.map +1 -1
  20. package/dist/cdk/constructs/bundling/index.js +6 -2
  21. package/dist/cdk/constructs/bundling/index.js.map +1 -1
  22. package/dist/cdk/constructs/bundling/zip/BundledCodeZipAsset.d.ts +5 -0
  23. package/dist/cdk/constructs/bundling/zip/BundledCodeZipAsset.d.ts.map +1 -1
  24. package/dist/cdk/constructs/bundling/zip/BundledCodeZipAsset.js +2 -7
  25. package/dist/cdk/constructs/bundling/zip/BundledCodeZipAsset.js.map +1 -1
  26. package/dist/cdk/constructs/bundling/zip/NodeBundledCodeZipAsset.d.ts +7 -0
  27. package/dist/cdk/constructs/bundling/zip/NodeBundledCodeZipAsset.d.ts.map +1 -0
  28. package/dist/cdk/constructs/bundling/zip/NodeBundledCodeZipAsset.js +30 -0
  29. package/dist/cdk/constructs/bundling/zip/NodeBundledCodeZipAsset.js.map +1 -0
  30. package/dist/cdk/constructs/bundling/zip/index.d.ts +1 -0
  31. package/dist/cdk/constructs/bundling/zip/index.d.ts.map +1 -1
  32. package/dist/cdk/constructs/bundling/zip/index.js +3 -1
  33. package/dist/cdk/constructs/bundling/zip/index.js.map +1 -1
  34. package/dist/cdk/constructs/components/base-props.d.ts +9 -2
  35. package/dist/cdk/constructs/components/base-props.d.ts.map +1 -1
  36. package/dist/cdk/constructs/components/container/ContainerBuildProject.d.ts +35 -8
  37. package/dist/cdk/constructs/components/container/ContainerBuildProject.d.ts.map +1 -1
  38. package/dist/cdk/constructs/components/container/ContainerBuildProject.js +117 -13
  39. package/dist/cdk/constructs/components/container/ContainerBuildProject.js.map +1 -1
  40. package/dist/cdk/constructs/components/container/ContainerImageBuilder.d.ts +25 -7
  41. package/dist/cdk/constructs/components/container/ContainerImageBuilder.d.ts.map +1 -1
  42. package/dist/cdk/constructs/components/container/ContainerImageBuilder.js +45 -7
  43. package/dist/cdk/constructs/components/container/ContainerImageBuilder.js.map +1 -1
  44. package/dist/cdk/constructs/components/container/ContainerRepository.d.ts +30 -0
  45. package/dist/cdk/constructs/components/container/ContainerRepository.d.ts.map +1 -0
  46. package/dist/cdk/constructs/components/container/{AgentEcrRepository.js → ContainerRepository.js} +19 -8
  47. package/dist/cdk/constructs/components/container/ContainerRepository.js.map +1 -0
  48. package/dist/cdk/constructs/components/container/container-build-handler.d.ts +4 -1
  49. package/dist/cdk/constructs/components/container/container-build-handler.d.ts.map +1 -1
  50. package/dist/cdk/constructs/components/container/container-build-handler.js +16 -3
  51. package/dist/cdk/constructs/components/container/container-build-handler.js.map +1 -1
  52. package/dist/cdk/constructs/components/container/index.d.ts +1 -1
  53. package/dist/cdk/constructs/components/container/index.d.ts.map +1 -1
  54. package/dist/cdk/constructs/components/container/index.js +3 -3
  55. package/dist/cdk/constructs/components/container/index.js.map +1 -1
  56. package/dist/cdk/constructs/components/gateway/AgentCoreGateway.d.ts +111 -0
  57. package/dist/cdk/constructs/components/gateway/AgentCoreGateway.d.ts.map +1 -0
  58. package/dist/cdk/constructs/components/gateway/AgentCoreGateway.js +611 -0
  59. package/dist/cdk/constructs/components/gateway/AgentCoreGateway.js.map +1 -0
  60. package/dist/cdk/constructs/components/gateway/connector-defaults.d.ts +20 -0
  61. package/dist/cdk/constructs/components/gateway/connector-defaults.d.ts.map +1 -0
  62. package/dist/cdk/constructs/components/gateway/connector-defaults.js +16 -0
  63. package/dist/cdk/constructs/components/gateway/connector-defaults.js.map +1 -0
  64. package/dist/cdk/constructs/components/gateway/gateway-targets.d.ts +25 -0
  65. package/dist/cdk/constructs/components/gateway/gateway-targets.d.ts.map +1 -0
  66. package/dist/cdk/constructs/components/gateway/gateway-targets.js +95 -0
  67. package/dist/cdk/constructs/components/gateway/gateway-targets.js.map +1 -0
  68. package/dist/cdk/constructs/components/gateway/index.d.ts +3 -0
  69. package/dist/cdk/constructs/components/gateway/index.d.ts.map +1 -0
  70. package/dist/cdk/constructs/components/gateway/index.js +8 -0
  71. package/dist/cdk/constructs/components/gateway/index.js.map +1 -0
  72. package/dist/cdk/constructs/components/index.d.ts +2 -1
  73. package/dist/cdk/constructs/components/index.d.ts.map +1 -1
  74. package/dist/cdk/constructs/components/index.js +2 -1
  75. package/dist/cdk/constructs/components/index.js.map +1 -1
  76. package/dist/cdk/constructs/components/primitives/capacity-provider/AgentCoreCapacityProvider.d.ts +42 -0
  77. package/dist/cdk/constructs/components/primitives/capacity-provider/AgentCoreCapacityProvider.d.ts.map +1 -0
  78. package/dist/cdk/constructs/components/primitives/capacity-provider/AgentCoreCapacityProvider.js +126 -0
  79. package/dist/cdk/constructs/components/primitives/capacity-provider/AgentCoreCapacityProvider.js.map +1 -0
  80. package/dist/cdk/constructs/components/primitives/capacity-provider/index.d.ts +2 -0
  81. package/dist/cdk/constructs/components/primitives/capacity-provider/index.d.ts.map +1 -0
  82. package/dist/cdk/constructs/components/primitives/capacity-provider/index.js +6 -0
  83. package/dist/cdk/constructs/components/primitives/capacity-provider/index.js.map +1 -0
  84. package/dist/cdk/constructs/components/primitives/config-bundle/AgentCoreConfigBundle.d.ts +31 -0
  85. package/dist/cdk/constructs/components/primitives/config-bundle/AgentCoreConfigBundle.d.ts.map +1 -0
  86. package/dist/cdk/constructs/components/primitives/config-bundle/AgentCoreConfigBundle.js +62 -0
  87. package/dist/cdk/constructs/components/primitives/config-bundle/AgentCoreConfigBundle.js.map +1 -0
  88. package/dist/cdk/constructs/components/primitives/config-bundle/index.d.ts +3 -0
  89. package/dist/cdk/constructs/components/primitives/config-bundle/index.d.ts.map +1 -0
  90. package/dist/cdk/constructs/components/primitives/config-bundle/index.js +6 -0
  91. package/dist/cdk/constructs/components/primitives/config-bundle/index.js.map +1 -0
  92. package/dist/cdk/constructs/components/primitives/dataset/AgentCoreDataset.d.ts +29 -0
  93. package/dist/cdk/constructs/components/primitives/dataset/AgentCoreDataset.d.ts.map +1 -0
  94. package/dist/cdk/constructs/components/primitives/dataset/AgentCoreDataset.js +80 -0
  95. package/dist/cdk/constructs/components/primitives/dataset/AgentCoreDataset.js.map +1 -0
  96. package/dist/cdk/constructs/components/primitives/dataset/index.d.ts +2 -0
  97. package/dist/cdk/constructs/components/primitives/dataset/index.d.ts.map +1 -0
  98. package/dist/cdk/constructs/components/primitives/dataset/index.js +6 -0
  99. package/dist/cdk/constructs/components/primitives/dataset/index.js.map +1 -0
  100. package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreEvaluator.d.ts +45 -0
  101. package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreEvaluator.d.ts.map +1 -0
  102. package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreEvaluator.js +160 -0
  103. package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreEvaluator.js.map +1 -0
  104. package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.d.ts +28 -0
  105. package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.d.ts.map +1 -0
  106. package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.js +131 -0
  107. package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.js.map +1 -0
  108. package/dist/cdk/constructs/components/primitives/evaluator/index.d.ts +3 -0
  109. package/dist/cdk/constructs/components/primitives/evaluator/index.d.ts.map +1 -0
  110. package/dist/cdk/constructs/components/primitives/evaluator/index.js +8 -0
  111. package/dist/cdk/constructs/components/primitives/evaluator/index.js.map +1 -0
  112. package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarness.d.ts +124 -0
  113. package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarness.d.ts.map +1 -0
  114. package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarness.js +185 -0
  115. package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarness.js.map +1 -0
  116. package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.d.ts +71 -0
  117. package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.d.ts.map +1 -0
  118. package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.js +389 -0
  119. package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.js.map +1 -0
  120. package/dist/cdk/constructs/components/primitives/harness/__tests__/AgentCoreHarnessRole.test.d.ts +2 -0
  121. package/dist/cdk/constructs/components/primitives/harness/__tests__/AgentCoreHarnessRole.test.d.ts.map +1 -0
  122. package/dist/cdk/constructs/components/primitives/harness/__tests__/AgentCoreHarnessRole.test.js +182 -0
  123. package/dist/cdk/constructs/components/primitives/harness/__tests__/AgentCoreHarnessRole.test.js.map +1 -0
  124. package/dist/cdk/constructs/components/primitives/harness/harness-cfn-mapping.d.ts +30 -0
  125. package/dist/cdk/constructs/components/primitives/harness/harness-cfn-mapping.d.ts.map +1 -0
  126. package/dist/cdk/constructs/components/primitives/harness/harness-cfn-mapping.js +165 -0
  127. package/dist/cdk/constructs/components/primitives/harness/harness-cfn-mapping.js.map +1 -0
  128. package/dist/cdk/constructs/components/primitives/harness/index.d.ts +3 -0
  129. package/dist/cdk/constructs/components/primitives/harness/index.d.ts.map +1 -0
  130. package/dist/cdk/constructs/components/primitives/harness/index.js +8 -0
  131. package/dist/cdk/constructs/components/primitives/harness/index.js.map +1 -0
  132. package/dist/cdk/constructs/components/primitives/index.d.ts +11 -3
  133. package/dist/cdk/constructs/components/primitives/index.d.ts.map +1 -1
  134. package/dist/cdk/constructs/components/primitives/index.js +21 -3
  135. package/dist/cdk/constructs/components/primitives/index.js.map +1 -1
  136. package/dist/cdk/constructs/components/primitives/knowledge-base/AgentCoreKnowledgeBase.d.ts +67 -0
  137. package/dist/cdk/constructs/components/primitives/knowledge-base/AgentCoreKnowledgeBase.d.ts.map +1 -0
  138. package/dist/cdk/constructs/components/primitives/knowledge-base/AgentCoreKnowledgeBase.js +282 -0
  139. package/dist/cdk/constructs/components/primitives/knowledge-base/AgentCoreKnowledgeBase.js.map +1 -0
  140. package/dist/cdk/constructs/components/primitives/knowledge-base/index.d.ts +2 -0
  141. package/dist/cdk/constructs/components/primitives/knowledge-base/index.d.ts.map +1 -0
  142. package/dist/cdk/constructs/components/primitives/knowledge-base/index.js +6 -0
  143. package/dist/cdk/constructs/components/primitives/knowledge-base/index.js.map +1 -0
  144. package/dist/cdk/constructs/components/primitives/memory/AgentCoreMemory.d.ts +30 -44
  145. package/dist/cdk/constructs/components/primitives/memory/AgentCoreMemory.d.ts.map +1 -1
  146. package/dist/cdk/constructs/components/primitives/memory/AgentCoreMemory.js +147 -154
  147. package/dist/cdk/constructs/components/primitives/memory/AgentCoreMemory.js.map +1 -1
  148. package/dist/cdk/constructs/components/primitives/memory/index.d.ts +1 -1
  149. package/dist/cdk/constructs/components/primitives/memory/index.d.ts.map +1 -1
  150. package/dist/cdk/constructs/components/primitives/memory/index.js.map +1 -1
  151. package/dist/cdk/constructs/components/primitives/memory/memory-actions.d.ts +17 -0
  152. package/dist/cdk/constructs/components/primitives/memory/memory-actions.d.ts.map +1 -0
  153. package/dist/cdk/constructs/components/primitives/memory/memory-actions.js +34 -0
  154. package/dist/cdk/constructs/components/primitives/memory/memory-actions.js.map +1 -0
  155. package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentConnector.d.ts +36 -0
  156. package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentConnector.d.ts.map +1 -0
  157. package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentConnector.js +52 -0
  158. package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentConnector.js.map +1 -0
  159. package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentManager.d.ts +65 -0
  160. package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentManager.d.ts.map +1 -0
  161. package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentManager.js +143 -0
  162. package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentManager.js.map +1 -0
  163. package/dist/cdk/constructs/components/primitives/payment/index.d.ts +3 -0
  164. package/dist/cdk/constructs/components/primitives/payment/index.d.ts.map +1 -0
  165. package/dist/cdk/constructs/components/primitives/payment/index.js +8 -0
  166. package/dist/cdk/constructs/components/primitives/payment/index.js.map +1 -0
  167. package/dist/cdk/constructs/components/primitives/policy/AgentCorePolicyEngine.d.ts +47 -0
  168. package/dist/cdk/constructs/components/primitives/policy/AgentCorePolicyEngine.d.ts.map +1 -0
  169. package/dist/cdk/constructs/components/primitives/policy/AgentCorePolicyEngine.js +94 -0
  170. package/dist/cdk/constructs/components/primitives/policy/AgentCorePolicyEngine.js.map +1 -0
  171. package/dist/cdk/constructs/components/primitives/policy/index.d.ts +2 -0
  172. package/dist/cdk/constructs/components/primitives/policy/index.d.ts.map +1 -0
  173. package/dist/cdk/constructs/components/primitives/policy/index.js +6 -0
  174. package/dist/cdk/constructs/components/primitives/policy/index.js.map +1 -0
  175. package/dist/cdk/constructs/components/primitives/runtime/AgentCoreRuntime.d.ts +110 -9
  176. package/dist/cdk/constructs/components/primitives/runtime/AgentCoreRuntime.d.ts.map +1 -1
  177. package/dist/cdk/constructs/components/primitives/runtime/AgentCoreRuntime.js +324 -135
  178. package/dist/cdk/constructs/components/primitives/runtime/AgentCoreRuntime.js.map +1 -1
  179. package/dist/cdk/constructs/components/primitives/runtime/index.d.ts +1 -1
  180. package/dist/cdk/constructs/components/primitives/runtime/index.d.ts.map +1 -1
  181. package/dist/cdk/constructs/components/primitives/runtime/index.js.map +1 -1
  182. package/dist/cdk/constructs/components/shared/bindable.d.ts +30 -0
  183. package/dist/cdk/constructs/components/shared/bindable.d.ts.map +1 -0
  184. package/dist/cdk/constructs/components/shared/bindable.js +9 -0
  185. package/dist/cdk/constructs/components/shared/bindable.js.map +1 -0
  186. package/dist/cdk/constructs/components/shared/environment-variables.d.ts +41 -0
  187. package/dist/cdk/constructs/components/shared/environment-variables.d.ts.map +1 -0
  188. package/dist/cdk/constructs/components/shared/environment-variables.js +77 -0
  189. package/dist/cdk/constructs/components/shared/environment-variables.js.map +1 -0
  190. package/dist/cdk/constructs/components/shared/execution-role-grants.d.ts +17 -0
  191. package/dist/cdk/constructs/components/shared/execution-role-grants.d.ts.map +1 -0
  192. package/dist/cdk/constructs/components/shared/execution-role-grants.js +65 -0
  193. package/dist/cdk/constructs/components/shared/execution-role-grants.js.map +1 -0
  194. package/dist/cdk/constructs/components/shared/filesystem-access.d.ts +15 -0
  195. package/dist/cdk/constructs/components/shared/filesystem-access.d.ts.map +1 -0
  196. package/dist/cdk/constructs/components/shared/filesystem-access.js +53 -0
  197. package/dist/cdk/constructs/components/shared/filesystem-access.js.map +1 -0
  198. package/dist/cdk/constructs/components/shared/identity-access.d.ts +30 -0
  199. package/dist/cdk/constructs/components/shared/identity-access.d.ts.map +1 -0
  200. package/dist/cdk/constructs/components/shared/identity-access.js +44 -0
  201. package/dist/cdk/constructs/components/shared/identity-access.js.map +1 -0
  202. package/dist/cdk/constructs/components/shared/imported-role-principal.d.ts +32 -0
  203. package/dist/cdk/constructs/components/shared/imported-role-principal.d.ts.map +1 -0
  204. package/dist/cdk/constructs/components/shared/imported-role-principal.js +51 -0
  205. package/dist/cdk/constructs/components/shared/imported-role-principal.js.map +1 -0
  206. package/dist/cdk/constructs/components/shared/jwt-authorizer.d.ts +10 -0
  207. package/dist/cdk/constructs/components/shared/jwt-authorizer.d.ts.map +1 -0
  208. package/dist/cdk/constructs/components/shared/jwt-authorizer.js +20 -0
  209. package/dist/cdk/constructs/components/shared/jwt-authorizer.js.map +1 -0
  210. package/dist/cdk/constructs/components/shared/load-additional-policies.d.ts +20 -0
  211. package/dist/cdk/constructs/components/shared/load-additional-policies.d.ts.map +1 -0
  212. package/dist/cdk/constructs/components/shared/load-additional-policies.js +47 -0
  213. package/dist/cdk/constructs/components/shared/load-additional-policies.js.map +1 -0
  214. package/dist/cdk/constructs/components/shared/managed-tool-access.d.ts +6 -0
  215. package/dist/cdk/constructs/components/shared/managed-tool-access.d.ts.map +1 -0
  216. package/dist/cdk/constructs/components/shared/managed-tool-access.js +24 -0
  217. package/dist/cdk/constructs/components/shared/managed-tool-access.js.map +1 -0
  218. package/dist/cdk/constructs/components/shared/physical-names.d.ts +17 -0
  219. package/dist/cdk/constructs/components/shared/physical-names.d.ts.map +1 -0
  220. package/dist/cdk/constructs/components/shared/physical-names.js +20 -0
  221. package/dist/cdk/constructs/components/shared/physical-names.js.map +1 -0
  222. package/dist/cdk/constructs/components/{mcp/McpLambdaCompute.d.ts → tools/LambdaToolTarget.d.ts} +6 -6
  223. package/dist/cdk/constructs/components/tools/LambdaToolTarget.d.ts.map +1 -0
  224. package/dist/cdk/constructs/components/{mcp/McpLambdaCompute.js → tools/LambdaToolTarget.js} +21 -12
  225. package/dist/cdk/constructs/components/tools/LambdaToolTarget.js.map +1 -0
  226. package/dist/cdk/constructs/components/tools/RuntimeToolTarget.d.ts +28 -0
  227. package/dist/cdk/constructs/components/tools/RuntimeToolTarget.d.ts.map +1 -0
  228. package/dist/cdk/constructs/components/{mcp/McpRuntimeCompute.js → tools/RuntimeToolTarget.js} +13 -29
  229. package/dist/cdk/constructs/components/tools/RuntimeToolTarget.js.map +1 -0
  230. package/dist/cdk/constructs/components/tools/index.d.ts +3 -0
  231. package/dist/cdk/constructs/components/tools/index.d.ts.map +1 -0
  232. package/dist/cdk/constructs/components/tools/index.js +8 -0
  233. package/dist/cdk/constructs/components/tools/index.js.map +1 -0
  234. package/dist/cdk/constructs/connections/import-connection.d.ts +10 -0
  235. package/dist/cdk/constructs/connections/import-connection.d.ts.map +1 -0
  236. package/dist/cdk/constructs/connections/import-connection.js +64 -0
  237. package/dist/cdk/constructs/connections/import-connection.js.map +1 -0
  238. package/dist/cdk/constructs/index.d.ts +9 -3
  239. package/dist/cdk/constructs/index.d.ts.map +1 -1
  240. package/dist/cdk/constructs/index.js +23 -3
  241. package/dist/cdk/constructs/index.js.map +1 -1
  242. package/dist/cdk/constructs/l3/AgentCoreApplication.d.ts +207 -12
  243. package/dist/cdk/constructs/l3/AgentCoreApplication.d.ts.map +1 -1
  244. package/dist/cdk/constructs/l3/AgentCoreApplication.js +819 -38
  245. package/dist/cdk/constructs/l3/AgentCoreApplication.js.map +1 -1
  246. package/dist/cdk/constructs/l3/AgentCoreHarnessEnvironment.d.ts +34 -0
  247. package/dist/cdk/constructs/l3/AgentCoreHarnessEnvironment.d.ts.map +1 -0
  248. package/dist/cdk/constructs/l3/AgentCoreHarnessEnvironment.js +96 -0
  249. package/dist/cdk/constructs/l3/AgentCoreHarnessEnvironment.js.map +1 -0
  250. package/dist/cdk/constructs/l3/AgentCorePayments.d.ts +24 -0
  251. package/dist/cdk/constructs/l3/AgentCorePayments.d.ts.map +1 -0
  252. package/dist/cdk/constructs/l3/AgentCorePayments.js +99 -0
  253. package/dist/cdk/constructs/l3/AgentCorePayments.js.map +1 -0
  254. package/dist/cdk/constructs/l3/RuntimeEnvironment.d.ts +47 -0
  255. package/dist/cdk/constructs/l3/RuntimeEnvironment.d.ts.map +1 -0
  256. package/dist/cdk/constructs/l3/RuntimeEnvironment.js +152 -0
  257. package/dist/cdk/constructs/l3/RuntimeEnvironment.js.map +1 -0
  258. package/dist/cdk/constructs/l3/index.d.ts +3 -3
  259. package/dist/cdk/constructs/l3/index.d.ts.map +1 -1
  260. package/dist/cdk/constructs/l3/index.js +5 -5
  261. package/dist/cdk/constructs/l3/index.js.map +1 -1
  262. package/dist/cdk/index.d.ts +2 -1
  263. package/dist/cdk/index.d.ts.map +1 -1
  264. package/dist/cdk/index.js +26 -3
  265. package/dist/cdk/index.js.map +1 -1
  266. package/dist/cdk/logical-ids.d.ts +5 -5
  267. package/dist/cdk/logical-ids.js +5 -5
  268. package/dist/cdk/project/index.d.ts +4 -0
  269. package/dist/cdk/project/index.d.ts.map +1 -0
  270. package/dist/cdk/project/index.js +13 -0
  271. package/dist/cdk/project/index.js.map +1 -0
  272. package/dist/cdk/project/read-project.d.ts +34 -0
  273. package/dist/cdk/project/read-project.d.ts.map +1 -0
  274. package/dist/cdk/project/read-project.js +86 -0
  275. package/dist/cdk/project/read-project.js.map +1 -0
  276. package/dist/cdk/project/target-stacks.d.ts +55 -0
  277. package/dist/cdk/project/target-stacks.d.ts.map +1 -0
  278. package/dist/cdk/project/target-stacks.js +50 -0
  279. package/dist/cdk/project/target-stacks.js.map +1 -0
  280. package/dist/cdk/project/transform.d.ts +38 -0
  281. package/dist/cdk/project/transform.d.ts.map +1 -0
  282. package/dist/cdk/project/transform.js +106 -0
  283. package/dist/cdk/project/transform.js.map +1 -0
  284. package/dist/cdk/utils/__tests__/tags.test.d.ts +2 -0
  285. package/dist/cdk/utils/__tests__/tags.test.d.ts.map +1 -0
  286. package/dist/cdk/utils/__tests__/tags.test.js +57 -0
  287. package/dist/cdk/utils/__tests__/tags.test.js.map +1 -0
  288. package/dist/cdk/utils/tags.d.ts +11 -0
  289. package/dist/cdk/utils/tags.d.ts.map +1 -0
  290. package/dist/cdk/utils/tags.js +22 -0
  291. package/dist/cdk/utils/tags.js.map +1 -0
  292. package/dist/index.d.ts +3 -7
  293. package/dist/index.d.ts.map +1 -1
  294. package/dist/index.js +27 -28
  295. package/dist/index.js.map +1 -1
  296. package/dist/lib/constants.d.ts +1 -1
  297. package/dist/lib/constants.d.ts.map +1 -1
  298. package/dist/lib/constants.js +2 -2
  299. package/dist/lib/constants.js.map +1 -1
  300. package/dist/lib/errors/config.d.ts +0 -16
  301. package/dist/lib/errors/config.d.ts.map +1 -1
  302. package/dist/lib/errors/config.js +2 -29
  303. package/dist/lib/errors/config.js.map +1 -1
  304. package/dist/lib/index.d.ts +1 -2
  305. package/dist/lib/index.d.ts.map +1 -1
  306. package/dist/lib/index.js +2 -3
  307. package/dist/lib/index.js.map +1 -1
  308. package/dist/lib/packaging/helpers.d.ts +19 -0
  309. package/dist/lib/packaging/helpers.d.ts.map +1 -1
  310. package/dist/lib/packaging/helpers.js +80 -27
  311. package/dist/lib/packaging/helpers.js.map +1 -1
  312. package/dist/lib/packaging/index.d.ts +3 -7
  313. package/dist/lib/packaging/index.d.ts.map +1 -1
  314. package/dist/lib/packaging/index.js +14 -11
  315. package/dist/lib/packaging/index.js.map +1 -1
  316. package/dist/lib/packaging/node.d.ts +6 -0
  317. package/dist/lib/packaging/node.d.ts.map +1 -0
  318. package/dist/lib/packaging/node.js +106 -0
  319. package/dist/lib/packaging/node.js.map +1 -0
  320. package/dist/lib/packaging/types/packaging.d.ts +2 -0
  321. package/dist/lib/packaging/types/packaging.d.ts.map +1 -1
  322. package/dist/lib/packaging/uv.d.ts.map +1 -1
  323. package/dist/lib/packaging/uv.js +1 -1
  324. package/dist/lib/packaging/uv.js.map +1 -1
  325. package/dist/lib/utils/subprocess.d.ts +5 -1
  326. package/dist/lib/utils/subprocess.d.ts.map +1 -1
  327. package/dist/lib/utils/subprocess.js +0 -6
  328. package/dist/lib/utils/subprocess.js.map +1 -1
  329. package/dist/schema/constants.d.ts +31 -1
  330. package/dist/schema/constants.d.ts.map +1 -1
  331. package/dist/schema/constants.js +59 -5
  332. package/dist/schema/constants.js.map +1 -1
  333. package/dist/schema/schemas/agent-env.d.ts +277 -5
  334. package/dist/schema/schemas/agent-env.d.ts.map +1 -1
  335. package/dist/schema/schemas/agent-env.js +435 -9
  336. package/dist/schema/schemas/agent-env.js.map +1 -1
  337. package/dist/schema/schemas/agentcore-project.d.ts +1110 -23
  338. package/dist/schema/schemas/agentcore-project.d.ts.map +1 -1
  339. package/dist/schema/schemas/agentcore-project.js +335 -11
  340. package/dist/schema/schemas/agentcore-project.js.map +1 -1
  341. package/dist/schema/schemas/auth.d.ts +318 -0
  342. package/dist/schema/schemas/auth.d.ts.map +1 -0
  343. package/dist/schema/schemas/auth.js +238 -0
  344. package/dist/schema/schemas/auth.js.map +1 -0
  345. package/dist/schema/schemas/aws-targets.d.ts +39 -0
  346. package/dist/schema/schemas/aws-targets.d.ts.map +1 -1
  347. package/dist/schema/schemas/aws-targets.js +16 -2
  348. package/dist/schema/schemas/aws-targets.js.map +1 -1
  349. package/dist/schema/schemas/connections.d.ts +183 -0
  350. package/dist/schema/schemas/connections.d.ts.map +1 -0
  351. package/dist/schema/schemas/connections.js +176 -0
  352. package/dist/schema/schemas/connections.js.map +1 -0
  353. package/dist/schema/schemas/deployed-state.d.ts +204 -16
  354. package/dist/schema/schemas/deployed-state.d.ts.map +1 -1
  355. package/dist/schema/schemas/deployed-state.js +44 -4
  356. package/dist/schema/schemas/deployed-state.js.map +1 -1
  357. package/dist/schema/schemas/index.d.ts +2 -0
  358. package/dist/schema/schemas/index.d.ts.map +1 -1
  359. package/dist/schema/schemas/index.js +2 -0
  360. package/dist/schema/schemas/index.js.map +1 -1
  361. package/dist/schema/schemas/mcp.d.ts +262 -256
  362. package/dist/schema/schemas/mcp.d.ts.map +1 -1
  363. package/dist/schema/schemas/mcp.js +317 -60
  364. package/dist/schema/schemas/mcp.js.map +1 -1
  365. package/dist/schema/schemas/primitives/capacity-provider.d.ts +239 -0
  366. package/dist/schema/schemas/primitives/capacity-provider.d.ts.map +1 -0
  367. package/dist/schema/schemas/primitives/capacity-provider.js +220 -0
  368. package/dist/schema/schemas/primitives/capacity-provider.js.map +1 -0
  369. package/dist/schema/schemas/primitives/config-bundle.d.ts +31 -0
  370. package/dist/schema/schemas/primitives/config-bundle.d.ts.map +1 -0
  371. package/dist/schema/schemas/primitives/config-bundle.js +41 -0
  372. package/dist/schema/schemas/primitives/config-bundle.js.map +1 -0
  373. package/dist/schema/schemas/primitives/dataset.d.ts +53 -0
  374. package/dist/schema/schemas/primitives/dataset.d.ts.map +1 -0
  375. package/dist/schema/schemas/primitives/dataset.js +65 -0
  376. package/dist/schema/schemas/primitives/dataset.js.map +1 -0
  377. package/dist/schema/schemas/primitives/evaluator.d.ts +113 -0
  378. package/dist/schema/schemas/primitives/evaluator.d.ts.map +1 -0
  379. package/dist/schema/schemas/primitives/evaluator.js +75 -0
  380. package/dist/schema/schemas/primitives/evaluator.js.map +1 -0
  381. package/dist/schema/schemas/primitives/harness.d.ts +649 -0
  382. package/dist/schema/schemas/primitives/harness.d.ts.map +1 -0
  383. package/dist/schema/schemas/primitives/harness.js +596 -0
  384. package/dist/schema/schemas/primitives/harness.js.map +1 -0
  385. package/dist/schema/schemas/primitives/index.d.ts +18 -2
  386. package/dist/schema/schemas/primitives/index.d.ts.map +1 -1
  387. package/dist/schema/schemas/primitives/index.js +80 -1
  388. package/dist/schema/schemas/primitives/index.js.map +1 -1
  389. package/dist/schema/schemas/primitives/knowledge-base.d.ts +103 -0
  390. package/dist/schema/schemas/primitives/knowledge-base.d.ts.map +1 -0
  391. package/dist/schema/schemas/primitives/knowledge-base.js +98 -0
  392. package/dist/schema/schemas/primitives/knowledge-base.js.map +1 -0
  393. package/dist/schema/schemas/primitives/memory.d.ts +33 -2
  394. package/dist/schema/schemas/primitives/memory.d.ts.map +1 -1
  395. package/dist/schema/schemas/primitives/memory.js +33 -3
  396. package/dist/schema/schemas/primitives/memory.js.map +1 -1
  397. package/dist/schema/schemas/primitives/online-evaluation-config.d.ts +32 -0
  398. package/dist/schema/schemas/primitives/online-evaluation-config.d.ts.map +1 -0
  399. package/dist/schema/schemas/primitives/online-evaluation-config.js +66 -0
  400. package/dist/schema/schemas/primitives/online-evaluation-config.js.map +1 -0
  401. package/dist/schema/schemas/primitives/policy.d.ts +62 -0
  402. package/dist/schema/schemas/primitives/policy.d.ts.map +1 -0
  403. package/dist/schema/schemas/primitives/policy.js +64 -0
  404. package/dist/schema/schemas/primitives/policy.js.map +1 -0
  405. package/dist/schema/schemas/primitives/tags.d.ts +6 -0
  406. package/dist/schema/schemas/primitives/tags.d.ts.map +1 -0
  407. package/dist/schema/schemas/primitives/tags.js +20 -0
  408. package/dist/schema/schemas/primitives/tags.js.map +1 -0
  409. package/package.json +13 -11
  410. package/dist/cdk/constructs/components/container/AgentEcrRepository.d.ts +0 -25
  411. package/dist/cdk/constructs/components/container/AgentEcrRepository.d.ts.map +0 -1
  412. package/dist/cdk/constructs/components/container/AgentEcrRepository.js.map +0 -1
  413. package/dist/cdk/constructs/components/mcp/Gateway.d.ts +0 -55
  414. package/dist/cdk/constructs/components/mcp/Gateway.d.ts.map +0 -1
  415. package/dist/cdk/constructs/components/mcp/Gateway.js +0 -454
  416. package/dist/cdk/constructs/components/mcp/Gateway.js.map +0 -1
  417. package/dist/cdk/constructs/components/mcp/McpLambdaCompute.d.ts.map +0 -1
  418. package/dist/cdk/constructs/components/mcp/McpLambdaCompute.js.map +0 -1
  419. package/dist/cdk/constructs/components/mcp/McpRuntimeCompute.d.ts +0 -36
  420. package/dist/cdk/constructs/components/mcp/McpRuntimeCompute.d.ts.map +0 -1
  421. package/dist/cdk/constructs/components/mcp/McpRuntimeCompute.js.map +0 -1
  422. package/dist/cdk/constructs/components/mcp/index.d.ts +0 -5
  423. package/dist/cdk/constructs/components/mcp/index.d.ts.map +0 -1
  424. package/dist/cdk/constructs/components/mcp/index.js +0 -17
  425. package/dist/cdk/constructs/components/mcp/index.js.map +0 -1
  426. package/dist/cdk/constructs/components/mcp/mcp-utils.d.ts +0 -25
  427. package/dist/cdk/constructs/components/mcp/mcp-utils.d.ts.map +0 -1
  428. package/dist/cdk/constructs/components/mcp/mcp-utils.js +0 -43
  429. package/dist/cdk/constructs/components/mcp/mcp-utils.js.map +0 -1
  430. package/dist/cdk/constructs/components/primitives/BasePrimitiveConstruct.d.ts +0 -46
  431. package/dist/cdk/constructs/components/primitives/BasePrimitiveConstruct.d.ts.map +0 -1
  432. package/dist/cdk/constructs/components/primitives/BasePrimitiveConstruct.js +0 -49
  433. package/dist/cdk/constructs/components/primitives/BasePrimitiveConstruct.js.map +0 -1
  434. package/dist/cdk/constructs/l3/AgentCoreMcp.d.ts +0 -86
  435. package/dist/cdk/constructs/l3/AgentCoreMcp.d.ts.map +0 -1
  436. package/dist/cdk/constructs/l3/AgentCoreMcp.js +0 -241
  437. package/dist/cdk/constructs/l3/AgentCoreMcp.js.map +0 -1
  438. package/dist/cdk/constructs/l3/AgentEnvironment.d.ts +0 -34
  439. package/dist/cdk/constructs/l3/AgentEnvironment.d.ts.map +0 -1
  440. package/dist/cdk/constructs/l3/AgentEnvironment.js +0 -99
  441. package/dist/cdk/constructs/l3/AgentEnvironment.js.map +0 -1
  442. package/dist/lib/schemas/io/config-io.d.ts +0 -99
  443. package/dist/lib/schemas/io/config-io.d.ts.map +0 -1
  444. package/dist/lib/schemas/io/config-io.js +0 -283
  445. package/dist/lib/schemas/io/config-io.js.map +0 -1
  446. package/dist/lib/schemas/io/index.d.ts +0 -3
  447. package/dist/lib/schemas/io/index.d.ts.map +0 -1
  448. package/dist/lib/schemas/io/index.js +0 -17
  449. package/dist/lib/schemas/io/index.js.map +0 -1
  450. package/dist/lib/schemas/io/path-resolver.d.ts +0 -112
  451. package/dist/lib/schemas/io/path-resolver.d.ts.map +0 -1
  452. package/dist/lib/schemas/io/path-resolver.js +0 -195
  453. package/dist/lib/schemas/io/path-resolver.js.map +0 -1
@@ -2,98 +2,564 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AgentCoreApplication = void 0;
4
4
  const lib_1 = require("../../../lib");
5
+ const schema_1 = require("../../../schema");
5
6
  const logical_ids_1 = require("../../logical-ids");
7
+ const gateway_1 = require("../components/gateway");
8
+ const AgentCoreCapacityProvider_1 = require("../components/primitives/capacity-provider/AgentCoreCapacityProvider");
9
+ const AgentCoreConfigBundle_1 = require("../components/primitives/config-bundle/AgentCoreConfigBundle");
10
+ const AgentCoreDataset_1 = require("../components/primitives/dataset/AgentCoreDataset");
11
+ const AgentCoreEvaluator_1 = require("../components/primitives/evaluator/AgentCoreEvaluator");
12
+ const AgentCoreOnlineEvaluationConfig_1 = require("../components/primitives/evaluator/AgentCoreOnlineEvaluationConfig");
13
+ const AgentCoreKnowledgeBase_1 = require("../components/primitives/knowledge-base/AgentCoreKnowledgeBase");
6
14
  const AgentCoreMemory_1 = require("../components/primitives/memory/AgentCoreMemory");
7
- const AgentEnvironment_1 = require("./AgentEnvironment");
15
+ const AgentCorePolicyEngine_1 = require("../components/primitives/policy/AgentCorePolicyEngine");
16
+ const bindable_1 = require("../components/shared/bindable");
17
+ const tools_1 = require("../components/tools");
18
+ const import_connection_1 = require("../connections/import-connection");
19
+ const AgentCoreHarnessEnvironment_1 = require("./AgentCoreHarnessEnvironment");
20
+ const AgentCorePayments_1 = require("./AgentCorePayments");
21
+ const RuntimeEnvironment_1 = require("./RuntimeEnvironment");
8
22
  const aws_cdk_lib_1 = require("aws-cdk-lib");
9
23
  const constructs_1 = require("constructs");
24
+ const path_1 = require("path");
25
+ /** The payments SDK is Python and speaks HTTP, so only those runtimes receive payment configuration. */
26
+ function isPaymentEligible(runtime) {
27
+ if (runtime.protocol && runtime.protocol !== 'HTTP')
28
+ return false;
29
+ return (runtime.entrypoint.split(':')[0] ?? '').endsWith('.py');
30
+ }
10
31
  /**
11
32
  * AgentCore Application L3 Construct - v2 resource-centric model.
12
33
  *
13
34
  * Creates:
14
35
  * - Agent environments (runtimes) for each agent (may be empty for memory-only deployments)
15
36
  * - Memory resources at project level
16
- * - Wires all agents to all memories (implicit access)
17
- * - Wires credentials to all agents
37
+ * - Evaluator resources at project level
38
+ * - Online evaluation config resources at project level
39
+ * - Gateways with the compute behind their targets, and standalone tool runtimes
40
+ * - Payment managers/connectors (the `Payments` child)
41
+ *
42
+ * Creation order: memories → evaluators → agents → online evaluation configs → gateways →
43
+ * tool runtimes → payments.
44
+ * Once everything exists, `bindResources` binds each resource to the workloads that use it
45
+ * (every memory and gateway to every runtime, payments to eligible runtimes, a harness's
46
+ * referenced memory to that harness, connections and tool runtimes to the workload that names them).
18
47
  *
19
48
  * All child constructs use stable logical IDs derived from resource names
20
49
  * via the logical-ids utility to ensure deterministic CloudFormation updates.
50
+ *
51
+ * Every resource the application creates is reachable through a typed map (`runtimes`,
52
+ * `harnesses`, `gateways`, ...) or a throwing getter (`runtime('checkout')`, `harness('support')`,
53
+ * `gateway('tools')`, ...) so a stack can wire its own resources to them.
21
54
  */
22
55
  class AgentCoreApplication extends constructs_1.Construct {
23
- /** Agent environments keyed by agent name */
24
- environments = new Map();
56
+ /** Runtime environments keyed by runtime name */
57
+ runtimeEnvironments = new Map();
58
+ /** The runtime of each runtime environment, keyed by runtime name */
59
+ runtimes = new Map();
25
60
  /** Memories keyed by memory name */
26
61
  memories = new Map();
62
+ /** Knowledge bases keyed by KB name */
63
+ knowledgeBases = new Map();
64
+ /** Evaluators keyed by evaluator name */
65
+ evaluators = new Map();
66
+ /** Online evaluation configs keyed by config name */
67
+ onlineEvalConfigs = new Map();
68
+ /** Policy engines keyed by engine name */
69
+ policyEngines = new Map();
70
+ /** Config bundles keyed by bundle name */
71
+ configBundles = new Map();
72
+ /** Datasets keyed by dataset name */
73
+ datasets = new Map();
74
+ /** Capacity providers keyed by capacity provider name */
75
+ capacityProviders = new Map();
76
+ /** Harness roles keyed by harness name */
77
+ harnessRoles = new Map();
78
+ /** Harness CFN resources keyed by harness name (only those deployed via CDK with a full spec) */
79
+ harnesses = new Map();
80
+ /** Gateways keyed by gateway name */
81
+ gateways = new Map();
82
+ /** Tool runtimes keyed by tool name: standalone tool runtimes and the runtimes behind gateway targets */
83
+ toolRuntimes = new Map();
84
+ /** The Lambda functions behind gateway targets, keyed by tool name */
85
+ toolLambdaFunctions = new Map();
86
+ /** The payments child construct; present when the spec declares payments. */
87
+ payments;
88
+ /** Payment managers keyed by manager name. */
89
+ paymentManagers;
90
+ /** Payment connectors keyed by `<manager>/<connector>`. */
91
+ paymentConnectors;
92
+ projectName;
93
+ /** Harnesses configured without a full spec (legacy role-only path); `harness()` names them in its error. */
94
+ roleOnlyHarnesses = new Set();
27
95
  constructor(scope, id, props) {
28
96
  super(scope, id);
29
- const { spec } = props;
97
+ const { spec, connectorParametersByFile, targetName } = props;
30
98
  const projectName = spec.name;
31
- // Resolve config root once for all environments
32
- const configRoot = (0, lib_1.findConfigRoot)();
33
- if (!configRoot) {
34
- throw new Error('Could not find agentcore directory. Ensure you are running from within an AgentCore project.');
99
+ const projectTags = spec.tags;
100
+ this.projectName = projectName;
101
+ // Apply project-level tags via Tags.of() for propagation to supporting AWS resources.
102
+ // Exclude BedrockAgentCore resource types so that composeTags() on primary resources
103
+ // can correctly handle resource-level tag overrides on key conflicts.
104
+ if (projectTags) {
105
+ for (const [key, value] of Object.entries(projectTags)) {
106
+ aws_cdk_lib_1.Tags.of(this).add(key, value, {
107
+ excludeResourceTypes: [
108
+ 'AWS::BedrockAgentCore::Runtime',
109
+ 'AWS::BedrockAgentCore::Memory',
110
+ 'AWS::BedrockAgentCore::Evaluator',
111
+ 'AWS::BedrockAgentCore::OnlineEvaluationConfig',
112
+ 'AWS::BedrockAgentCore::PolicyEngine',
113
+ 'AWS::BedrockAgentCore::Gateway',
114
+ 'AWS::BedrockAgentCore::Dataset',
115
+ 'AWS::BedrockAgentCore::Harness',
116
+ 'AWS::BedrockAgentCore::CapacityProvider',
117
+ ],
118
+ });
119
+ }
35
120
  }
121
+ // Resolve the config root once and thread it to every path-resolving child.
122
+ const configRoot = (0, path_1.join)(props.projectRoot, lib_1.CONFIG_DIR);
36
123
  // ═══════════════════════════════════════════════════════════════════
37
124
  // Create all memories (project-level resources)
38
125
  // ═══════════════════════════════════════════════════════════════════
39
126
  for (const memorySpec of spec.memories ?? []) {
40
127
  const memory = new AgentCoreMemory_1.AgentCoreMemory(this, (0, logical_ids_1.toPascalId)('Memory', memorySpec.name), {
41
128
  projectName,
129
+ targetName,
42
130
  memory: memorySpec,
131
+ projectTags,
43
132
  });
44
133
  this.memories.set(memorySpec.name, memory);
45
134
  }
46
135
  // ═══════════════════════════════════════════════════════════════════
47
- // Create all agent environments
136
+ // Create all knowledge bases (project-level resources)
48
137
  // ═══════════════════════════════════════════════════════════════════
49
- for (const agentSpec of spec.agents ?? []) {
50
- const env = new AgentEnvironment_1.AgentEnvironment(this, (0, logical_ids_1.toPascalId)('Agent', agentSpec.name), {
138
+ for (const kbSpec of spec.knowledgeBases ?? []) {
139
+ const kb = new AgentCoreKnowledgeBase_1.AgentCoreKnowledgeBase(this, (0, logical_ids_1.toPascalId)('KnowledgeBase', kbSpec.name), {
51
140
  projectName,
52
- agent: agentSpec,
141
+ targetName,
142
+ knowledgeBase: kbSpec,
143
+ projectTags,
144
+ connectorParametersByFile,
145
+ });
146
+ this.knowledgeBases.set(kbSpec.name, kb);
147
+ }
148
+ // ═══════════════════════════════════════════════════════════════════
149
+ // Create all evaluators (project-level resources)
150
+ // ═══════════════════════════════════════════════════════════════════
151
+ for (const evalSpec of spec.evaluators ?? []) {
152
+ const evaluator = new AgentCoreEvaluator_1.AgentCoreEvaluator(this, (0, logical_ids_1.toPascalId)('Evaluator', evalSpec.name), {
153
+ projectName,
154
+ targetName,
155
+ evaluator: evalSpec,
156
+ projectTags,
53
157
  configRoot,
54
158
  });
55
- this.environments.set(agentSpec.name, env);
159
+ this.evaluators.set(evalSpec.name, evaluator);
160
+ }
161
+ // ═══════════════════════════════════════════════════════════════════
162
+ // Create all policy engines (project-level resources)
163
+ // ═══════════════════════════════════════════════════════════════════
164
+ for (const policyEngineSpec of spec.policyEngines ?? []) {
165
+ const policyEngine = new AgentCorePolicyEngine_1.AgentCorePolicyEngine(this, (0, logical_ids_1.toPascalId)('PolicyEngine', policyEngineSpec.name), {
166
+ projectName,
167
+ targetName,
168
+ policyEngine: policyEngineSpec,
169
+ projectTags,
170
+ });
171
+ this.policyEngines.set(policyEngineSpec.name, policyEngine);
56
172
  }
57
173
  // ═══════════════════════════════════════════════════════════════════
58
- // Wire all agents to all memories (implicit project-level access)
174
+ // Create all datasets (project-level resources)
59
175
  // ═══════════════════════════════════════════════════════════════════
60
- this.wireMemoriesToAgents(spec.memories ?? []);
176
+ for (const datasetSpec of spec.datasets ?? []) {
177
+ const dataset = new AgentCoreDataset_1.AgentCoreDataset(this, (0, logical_ids_1.toPascalId)('Dataset', datasetSpec.name), {
178
+ projectName,
179
+ targetName,
180
+ dataset: datasetSpec,
181
+ projectTags,
182
+ });
183
+ this.datasets.set(datasetSpec.name, dataset);
184
+ }
61
185
  // ═══════════════════════════════════════════════════════════════════
62
- // Wire credentials to all agents
186
+ // Create all capacity providers (project-level resources)
187
+ // Created before runtimes so a runtime can reference a sibling capacity
188
+ // provider by name (Journey 2).
63
189
  // ═══════════════════════════════════════════════════════════════════
64
- this.wireCredentialsToAgents(spec.credentials ?? []);
190
+ for (const capacityProviderSpec of spec.capacityProviders ?? []) {
191
+ const capacityProvider = new AgentCoreCapacityProvider_1.AgentCoreCapacityProvider(this, (0, logical_ids_1.toPascalId)('CapacityProvider', capacityProviderSpec.name), {
192
+ projectName,
193
+ targetName,
194
+ capacityProvider: capacityProviderSpec,
195
+ projectTags,
196
+ });
197
+ this.capacityProviders.set(capacityProviderSpec.name, capacityProvider);
198
+ }
199
+ // ═══════════════════════════════════════════════════════════════════
200
+ // Create all runtime environments
201
+ // ═══════════════════════════════════════════════════════════════════
202
+ for (const agentSpec of spec.runtimes ?? []) {
203
+ const env = new RuntimeEnvironment_1.RuntimeEnvironment(this, (0, logical_ids_1.toPascalId)('Runtime', agentSpec.name), {
204
+ projectName,
205
+ targetName,
206
+ spec: agentSpec,
207
+ configRoot,
208
+ projectTags,
209
+ capacityProviderArn: this.resolveCapacityProviderArn(agentSpec),
210
+ });
211
+ this.runtimeEnvironments.set(agentSpec.name, env);
212
+ this.runtimes.set(agentSpec.name, env.runtime);
213
+ }
65
214
  // ═══════════════════════════════════════════════════════════════════
66
- // Create memory outputs
215
+ // Create all config bundles (depend on runtimes/gateways for ARN refs)
216
+ // ═══════════════════════════════════════════════════════════════════
217
+ for (const bundleSpec of spec.configBundles ?? []) {
218
+ const resolvedComponents = this.resolveConfigBundleComponents(bundleSpec.components);
219
+ const configBundle = new AgentCoreConfigBundle_1.AgentCoreConfigBundle(this, (0, logical_ids_1.toPascalId)('ConfigBundle', bundleSpec.name), {
220
+ projectName,
221
+ targetName,
222
+ configBundle: bundleSpec,
223
+ resolvedComponents,
224
+ projectTags,
225
+ });
226
+ this.configBundles.set(bundleSpec.name, configBundle);
227
+ }
228
+ // ═══════════════════════════════════════════════════════════════════
229
+ // Create all harnesses (IAM role + optional container + the CFN resource)
230
+ // ═══════════════════════════════════════════════════════════════════
231
+ for (const harness of props.harnesses ?? []) {
232
+ const { memoryArn, retrievalConfig } = this.resolveHarnessMemory(harness, spec.memories ?? []);
233
+ const harnessEnv = new AgentCoreHarnessEnvironment_1.AgentCoreHarnessEnvironment(this, (0, logical_ids_1.toPascalId)('Harness', harness.name), {
234
+ projectName,
235
+ targetName,
236
+ projectTags,
237
+ harness,
238
+ spec: harness.spec,
239
+ harnessDir: harness.harnessDir,
240
+ memoryArn,
241
+ retrievalConfig,
242
+ credentials: props.credentials,
243
+ });
244
+ this.harnessRoles.set(harness.name, harnessEnv.harnessRole);
245
+ if (harnessEnv.harness)
246
+ this.harnesses.set(harness.name, harnessEnv.harness);
247
+ else
248
+ this.roleOnlyHarnesses.add(harness.name);
249
+ }
250
+ // ═══════════════════════════════════════════════════════════════════
251
+ // Create all online eval configs (depend on evaluators + agents)
252
+ // ═══════════════════════════════════════════════════════════════════
253
+ for (const configSpec of spec.onlineEvalConfigs ?? []) {
254
+ const onlineEvalConfig = new AgentCoreOnlineEvaluationConfig_1.AgentCoreOnlineEvaluationConfig(this, (0, logical_ids_1.toPascalId)('OnlineEval', configSpec.name), {
255
+ projectName,
256
+ targetName,
257
+ config: configSpec,
258
+ runtimeEnvironments: this.runtimeEnvironments,
259
+ evaluators: this.evaluators,
260
+ projectTags,
261
+ });
262
+ this.onlineEvalConfigs.set(configSpec.name, onlineEvalConfig);
263
+ }
264
+ // ═══════════════════════════════════════════════════════════════════
265
+ // Create all gateways and the compute behind their targets
266
+ // ═══════════════════════════════════════════════════════════════════
267
+ const runtimeArns = new Map([...this.runtimes].map(([name, runtime]) => [name, runtime.runtimeArn]));
268
+ for (const gatewaySpec of spec.agentCoreGateways) {
269
+ const gateway = new gateway_1.AgentCoreGateway(this, (0, logical_ids_1.toPascalId)('Gateway', gatewaySpec.name), {
270
+ gateway: gatewaySpec,
271
+ projectName,
272
+ targetName,
273
+ configRoot,
274
+ credentials: props.credentials,
275
+ policyEngine: this.resolveGatewayPolicyEngine(gatewaySpec),
276
+ policyEngineMode: gatewaySpec.policyEngineConfiguration?.mode,
277
+ projectTags,
278
+ knowledgeBases: this.knowledgeBases,
279
+ });
280
+ this.gateways.set(gatewaySpec.name, gateway);
281
+ for (const target of gatewaySpec.targets) {
282
+ const { runtime, lambdaFunction } = (0, gateway_1.addGatewayTarget)(gateway, target, {
283
+ computeScope: this,
284
+ projectName,
285
+ targetName,
286
+ configRoot,
287
+ runtimeArns,
288
+ });
289
+ if (runtime)
290
+ this.toolRuntimes.set(target.name, runtime);
291
+ if (lambdaFunction)
292
+ this.toolLambdaFunctions.set(target.name, lambdaFunction);
293
+ }
294
+ }
295
+ // ═══════════════════════════════════════════════════════════════════
296
+ // Create all standalone tool runtimes
297
+ // ═══════════════════════════════════════════════════════════════════
298
+ for (const tool of spec.toolRuntimes ?? []) {
299
+ const toolTarget = new tools_1.RuntimeToolTarget(this, (0, logical_ids_1.toPascalId)('ToolRuntime', tool.name), {
300
+ toolName: tool.name,
301
+ compute: tool.compute,
302
+ projectName,
303
+ targetName,
304
+ configRoot,
305
+ });
306
+ this.toolRuntimes.set(tool.name, toolTarget.runtime);
307
+ }
308
+ // ═══════════════════════════════════════════════════════════════════
309
+ // Create outputs
67
310
  // ═══════════════════════════════════════════════════════════════════
68
311
  this.createMemoryOutputs();
312
+ this.createEvaluatorOutputs();
313
+ this.createOnlineEvaluationConfigOutputs();
314
+ // ═══════════════════════════════════════════════════════════════════
315
+ // Create policy engine outputs
316
+ // ═══════════════════════════════════════════════════════════════════
317
+ this.createPolicyOutputs();
318
+ // ═══════════════════════════════════════════════════════════════════
319
+ // Create dataset outputs
320
+ // ═══════════════════════════════════════════════════════════════════
321
+ this.createDatasetOutputs();
322
+ // ═══════════════════════════════════════════════════════════════════
323
+ // Create capacity provider outputs
324
+ // ═══════════════════════════════════════════════════════════════════
325
+ this.createCapacityProviderOutputs();
326
+ // ═══════════════════════════════════════════════════════════════════
327
+ // Create config bundle outputs
328
+ // ═══════════════════════════════════════════════════════════════════
329
+ this.createConfigBundleOutputs();
330
+ // ═══════════════════════════════════════════════════════════════════
331
+ // Create knowledge base outputs
332
+ // ═══════════════════════════════════════════════════════════════════
333
+ this.createKnowledgeBaseOutputs();
334
+ // ═══════════════════════════════════════════════════════════════════
335
+ // Create harness outputs
336
+ // ═══════════════════════════════════════════════════════════════════
337
+ this.createHarnessOutputs();
338
+ // ═══════════════════════════════════════════════════════════════════
339
+ // Create gateway and tool outputs
340
+ // ═══════════════════════════════════════════════════════════════════
341
+ this.createGatewayOutputs();
342
+ this.createToolOutputs();
343
+ // ═══════════════════════════════════════════════════════════════════
344
+ // Payments as a child
345
+ // ═══════════════════════════════════════════════════════════════════
346
+ if (spec.payments?.length) {
347
+ this.payments = new AgentCorePayments_1.AgentCorePayments(this, 'Payments', { spec, credentials: props.credentials });
348
+ }
349
+ this.paymentManagers = this.payments?.managers ?? new Map();
350
+ this.paymentConnectors = this.payments?.connectors ?? new Map();
351
+ this.bindResources(spec, props.credentials);
352
+ }
353
+ // ═══════════════════════════════════════════════════════════════════
354
+ // Typed accessors. Each throws for an unknown name and lists what exists,
355
+ // so a typo in a stack that extends the application fails at synth with
356
+ // the fix in the message.
357
+ // ═══════════════════════════════════════════════════════════════════
358
+ /** The runtime of the agent named `name`. */
359
+ runtime(name) {
360
+ return this.lookup('runtime', this.runtimes, name);
361
+ }
362
+ /**
363
+ * The harness named `name`. Available only for harnesses synthesized by this application (a full
364
+ * spec); a harness configured through the legacy role-only path has just an execution role.
365
+ */
366
+ harness(name) {
367
+ if (this.roleOnlyHarnesses.has(name) && !this.harnesses.has(name)) {
368
+ throw new Error(`Harness "${name}" in project "${this.projectName}" was not synthesized by this application: it was ` +
369
+ `configured without a full spec (legacy role-only path), so only its execution role exists. ` +
370
+ `Use harnessRoles.get("${name}") to grant permissions to that role.`);
371
+ }
372
+ return this.lookup('harness', this.harnesses, name);
373
+ }
374
+ /** The gateway named `name`. */
375
+ gateway(name) {
376
+ return this.lookup('gateway', this.gateways, name);
377
+ }
378
+ /** The memory named `name`. */
379
+ memory(name) {
380
+ return this.lookup('memory', this.memories, name);
381
+ }
382
+ /** The knowledge base named `name`. */
383
+ knowledgeBase(name) {
384
+ return this.lookup('knowledge base', this.knowledgeBases, name);
385
+ }
386
+ /** The evaluator named `name`. */
387
+ evaluator(name) {
388
+ return this.lookup('evaluator', this.evaluators, name);
389
+ }
390
+ /** The online evaluation config named `name`. */
391
+ onlineEvalConfig(name) {
392
+ return this.lookup('online evaluation config', this.onlineEvalConfigs, name);
393
+ }
394
+ /** The policy engine named `name`. */
395
+ policyEngine(name) {
396
+ return this.lookup('policy engine', this.policyEngines, name);
397
+ }
398
+ /** The configuration bundle named `name`. */
399
+ configBundle(name) {
400
+ return this.lookup('config bundle', this.configBundles, name);
401
+ }
402
+ /** The dataset named `name`. */
403
+ dataset(name) {
404
+ return this.lookup('dataset', this.datasets, name);
405
+ }
406
+ /** The capacity provider named `name`. */
407
+ capacityProvider(name) {
408
+ return this.lookup('capacity provider', this.capacityProviders, name);
409
+ }
410
+ /** The runtime backing the tool named `name`. */
411
+ toolRuntime(name) {
412
+ return this.lookup('tool runtime', this.toolRuntimes, name);
413
+ }
414
+ /** The payment manager named `name`. */
415
+ paymentManager(name) {
416
+ return this.lookup('payment manager', this.paymentManagers, name);
417
+ }
418
+ /** The payment connector `connector` on the manager `manager`. */
419
+ paymentConnector(manager, connector) {
420
+ return this.lookup('payment connector', this.paymentConnectors, `${manager}/${connector}`);
421
+ }
422
+ lookup(kind, map, name) {
423
+ const found = map.get(name);
424
+ if (found !== undefined)
425
+ return found;
426
+ const available = [...map.keys()].join(', ') || 'none';
427
+ throw new Error(`Unknown ${kind} "${name}" in project "${this.projectName}". Available: ${available}`);
428
+ }
429
+ resolveCapacityProviderArn(agent) {
430
+ const ref = agent.capacityProviderConfiguration;
431
+ if (!ref)
432
+ return undefined;
433
+ if (ref.capacityProviderArn)
434
+ return ref.capacityProviderArn;
435
+ const name = ref.capacityProviderName;
436
+ const capacityProvider = this.capacityProviders.get(name);
437
+ if (!capacityProvider) {
438
+ throw new Error(`Capacity provider "${name}" referenced by runtime "${agent.name}" is not defined in this project.`);
439
+ }
440
+ return capacityProvider.capacityProviderArn;
441
+ }
442
+ resolveGatewayPolicyEngine(gateway) {
443
+ const config = gateway.policyEngineConfiguration;
444
+ if (!config)
445
+ return undefined;
446
+ const policyEngine = this.policyEngines.get(config.policyEngineName);
447
+ if (!policyEngine) {
448
+ throw new Error(`Gateway "${gateway.name}" references policy engine "${config.policyEngineName}" which is not defined in the project.`);
449
+ }
450
+ return policyEngine;
69
451
  }
70
452
  /**
71
- * Wire all memories to all agents in the project.
72
- * In the v2 schema, all resources within a project have implicit access.
453
+ * Resolve a harness's referenced memory into the in-stack ARN token + the
454
+ * retrievalConfig derived from that memory's strategy namespaces.
455
+ * Direct ARN (`memory.arn`) takes precedence over a by-name reference.
73
456
  */
74
- wireMemoriesToAgents(memories) {
75
- for (const memorySpec of memories) {
76
- const memory = this.memories.get(memorySpec.name);
77
- // Grant all agents access to this memory
78
- for (const env of this.environments.values()) {
79
- memory.grant(env.runtime);
80
- // Add memory ID as environment variable (using MEMORY_{NAME}_ID pattern)
81
- env.runtime.addEnvironmentVariable(memory.getEnvVarName(), memory.getEnvVarValue());
457
+ resolveHarnessMemory(harness, memories) {
458
+ const memoryRef = harness.spec?.memory;
459
+ if (!memoryRef)
460
+ return {};
461
+ // Managed memory is owned by the harness internally; disabled has none. Neither resolves a
462
+ // sibling memory ARN or per-namespace retrievalConfig — those only apply to `existing`.
463
+ if (memoryRef.mode !== 'existing')
464
+ return {};
465
+ let memoryArn;
466
+ let memorySpec;
467
+ if (memoryRef.arn) {
468
+ memoryArn = memoryRef.arn;
469
+ }
470
+ else if (memoryRef.name) {
471
+ const memory = this.memories.get(memoryRef.name);
472
+ if (!memory) {
473
+ throw new Error(`Memory "${memoryRef.name}" referenced by harness "${harness.name}" is not defined in this project.`);
82
474
  }
475
+ memoryArn = memory.memoryArn;
476
+ memorySpec = memories.find(m => m.name === memoryRef.name);
83
477
  }
478
+ return { memoryArn, retrievalConfig: buildRetrievalConfig(memorySpec, memoryRef.retrievalConfig) };
84
479
  }
85
480
  /**
86
- * Wire credentials to all agents.
87
- * Sets credential provider name env vars for each agent.
481
+ * Creates CloudFormation outputs for harnesses deployed via CDK.
482
+ * Per-harness: HarnessId, HarnessArn, Status, Version, AgentRuntimeArn.
483
+ * (The execution-role ARN output is emitted separately by AgentCoreHarnessRole.)
88
484
  */
89
- wireCredentialsToAgents(credentials) {
90
- for (const credential of credentials) {
91
- // Add credential provider name as env var to all agents
92
- const envVarName = `CREDENTIAL_${credential.name.toUpperCase().replace(/[.-]/g, '_')}_NAME`;
93
- for (const env of this.environments.values()) {
94
- env.runtime.addEnvironmentVariable(envVarName, credential.name);
485
+ createHarnessOutputs() {
486
+ if (this.harnesses.size === 0)
487
+ return;
488
+ const stack = aws_cdk_lib_1.Stack.of(this);
489
+ for (const [harnessName, harness] of this.harnesses) {
490
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Harness', harnessName), 'Id'), {
491
+ description: `Harness ID for: ${harnessName}`,
492
+ value: harness.harnessId,
493
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Harness', harnessName, 'Id'),
494
+ });
495
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Harness', harnessName), 'Arn'), {
496
+ description: `Harness ARN for: ${harnessName}`,
497
+ value: harness.harnessArn,
498
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Harness', harnessName, 'Arn'),
499
+ });
500
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Harness', harnessName), 'Status'), {
501
+ description: `Harness status for: ${harnessName}`,
502
+ value: harness.status,
503
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Harness', harnessName, 'Status'),
504
+ });
505
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Harness', harnessName), 'Version'), {
506
+ description: `Harness config version for: ${harnessName}`,
507
+ value: harness.harnessVersion,
508
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Harness', harnessName, 'Version'),
509
+ });
510
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Harness', harnessName), 'AgentRuntimeArn'), {
511
+ description: `Underlying AgentCore Runtime ARN for harness: ${harnessName}`,
512
+ value: harness.agentRuntimeArn,
513
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Harness', harnessName, 'AgentRuntimeArn'),
514
+ });
515
+ }
516
+ }
517
+ /**
518
+ * Bind every resource to the workloads that use it. Each `bind` grants the workload's execution
519
+ * role the resource's data-plane access and sets the `AGENTCORE_<TYPE>_<NAME>_*` discovery
520
+ * variables; the env var map rejects a name set to two different values.
521
+ */
522
+ bindResources(spec, deployedCredentials) {
523
+ const credentials = spec.credentials ?? [];
524
+ for (const runtime of this.runtimes.values()) {
525
+ for (const memory of this.memories.values())
526
+ memory.bind(runtime);
527
+ for (const gateway of this.gateways.values())
528
+ gateway.bind(runtime);
529
+ if (isPaymentEligible(runtime.spec)) {
530
+ for (const manager of this.paymentManagers.values())
531
+ manager.bind(runtime);
95
532
  }
533
+ if (credentials.length > 0)
534
+ runtime.grantCredentialAccess();
535
+ for (const credential of credentials) {
536
+ const providerArn = deployedCredentials?.[credential.name]?.credentialProviderArn;
537
+ runtime.addEnvironmentVariable(`${(0, bindable_1.discoveryPrefix)('CREDENTIAL', credential.name)}_NAME`, providerArn ? (0, schema_1.resourceIdFromArn)(providerArn) : credential.name);
538
+ }
539
+ for (const connection of runtime.spec.connections ?? [])
540
+ (0, import_connection_1.bindConnection)(runtime, connection);
541
+ }
542
+ for (const harness of this.harnesses.values()) {
543
+ this.referencedMemory(harness)?.bind(harness);
544
+ for (const gateway of this.gateways.values())
545
+ gateway.bind(harness);
546
+ for (const connection of harness.spec.connections ?? [])
547
+ (0, import_connection_1.bindConnection)(harness, connection);
96
548
  }
549
+ for (const tool of spec.toolRuntimes ?? []) {
550
+ for (const binding of tool.bindings ?? []) {
551
+ this.toolRuntime(tool.name).bind(this.runtime(binding.runtimeName), { envVarName: binding.envVarName });
552
+ }
553
+ }
554
+ }
555
+ /** The `existing` memory a harness references: a project memory by name or an import by ARN. */
556
+ referencedMemory(harness) {
557
+ const ref = harness.spec.memory;
558
+ if (ref?.mode !== 'existing')
559
+ return undefined;
560
+ if (ref.arn)
561
+ return AgentCoreMemory_1.AgentCoreMemory.fromMemoryArn(harness, (0, schema_1.resourceIdFromArn)(ref.arn), ref.arn);
562
+ return this.memory(ref.name);
97
563
  }
98
564
  /**
99
565
  * Creates CloudFormation outputs for memories.
@@ -130,6 +596,321 @@ class AgentCoreApplication extends constructs_1.Construct {
130
596
  exportName: `${stack.stackName}-MemoryNames`,
131
597
  });
132
598
  }
599
+ /**
600
+ * Creates CloudFormation outputs for evaluators.
601
+ */
602
+ createEvaluatorOutputs() {
603
+ if (this.evaluators.size === 0)
604
+ return;
605
+ const stack = aws_cdk_lib_1.Stack.of(this);
606
+ for (const [evalName, evaluator] of this.evaluators) {
607
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Evaluator', evalName), 'Id'), {
608
+ description: `Evaluator ID for: ${evalName}`,
609
+ value: evaluator.evaluatorId,
610
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Evaluator', evalName, 'Id'),
611
+ });
612
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Evaluator', evalName), 'Arn'), {
613
+ description: `Evaluator ARN for: ${evalName}`,
614
+ value: evaluator.evaluatorArn,
615
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Evaluator', evalName, 'Arn'),
616
+ });
617
+ }
618
+ }
619
+ /**
620
+ * Creates CloudFormation outputs for online eval configs.
621
+ */
622
+ createOnlineEvaluationConfigOutputs() {
623
+ if (this.onlineEvalConfigs.size === 0)
624
+ return;
625
+ const stack = aws_cdk_lib_1.Stack.of(this);
626
+ for (const [configName, config] of this.onlineEvalConfigs) {
627
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('OnlineEval', configName), 'Id'), {
628
+ description: `Online evaluation config ID for: ${configName}`,
629
+ value: config.configId,
630
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'OnlineEval', configName, 'Id'),
631
+ });
632
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('OnlineEval', configName), 'Arn'), {
633
+ description: `Online evaluation config ARN for: ${configName}`,
634
+ value: config.configArn,
635
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'OnlineEval', configName, 'Arn'),
636
+ });
637
+ }
638
+ }
639
+ /**
640
+ * Creates CloudFormation outputs for datasets.
641
+ * Produces per-dataset outputs (Id, Arn).
642
+ */
643
+ createDatasetOutputs() {
644
+ if (this.datasets.size === 0)
645
+ return;
646
+ const stack = aws_cdk_lib_1.Stack.of(this);
647
+ for (const [datasetName, dataset] of this.datasets) {
648
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Dataset', datasetName), 'Id'), {
649
+ description: `Dataset ID for: ${datasetName}`,
650
+ value: dataset.datasetId,
651
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Dataset', datasetName, 'Id'),
652
+ });
653
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Dataset', datasetName), 'Arn'), {
654
+ description: `Dataset ARN for: ${datasetName}`,
655
+ value: dataset.datasetArn,
656
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Dataset', datasetName, 'Arn'),
657
+ });
658
+ }
659
+ }
660
+ /**
661
+ * Creates CloudFormation outputs for capacity providers.
662
+ * Produces per-capacity-provider outputs (Id, Arn).
663
+ */
664
+ createCapacityProviderOutputs() {
665
+ if (this.capacityProviders.size === 0)
666
+ return;
667
+ const stack = aws_cdk_lib_1.Stack.of(this);
668
+ for (const [capacityProviderName, capacityProvider] of this.capacityProviders) {
669
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('CapacityProvider', capacityProviderName), 'Id'), {
670
+ description: `Capacity provider ID for: ${capacityProviderName}`,
671
+ value: capacityProvider.capacityProviderId,
672
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'CapacityProvider', capacityProviderName, 'Id'),
673
+ });
674
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('CapacityProvider', capacityProviderName), 'Arn'), {
675
+ description: `Capacity provider ARN for: ${capacityProviderName}`,
676
+ value: capacityProvider.capacityProviderArn,
677
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'CapacityProvider', capacityProviderName, 'Arn'),
678
+ });
679
+ }
680
+ }
681
+ /**
682
+ * Creates CloudFormation outputs for knowledge bases and their data sources.
683
+ *
684
+ * Per-KB outputs: Id, Arn.
685
+ * Per-DS outputs: DataSourceN.Id and DataSourceN.Uri, where N is the index
686
+ * into the local `dataSources[]` array. Consumers (e.g. the CLI post-deploy
687
+ * hook) read these to map local URI → deployed DS id deterministically
688
+ * instead of parsing physical names.
689
+ */
690
+ createKnowledgeBaseOutputs() {
691
+ if (this.knowledgeBases.size === 0)
692
+ return;
693
+ const stack = aws_cdk_lib_1.Stack.of(this);
694
+ for (const [kbName, kb] of this.knowledgeBases) {
695
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('KnowledgeBase', kbName), 'Id'), {
696
+ description: `Knowledge Base ID for: ${kbName}`,
697
+ value: kb.knowledgeBaseId,
698
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'KnowledgeBase', kbName, 'Id'),
699
+ });
700
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('KnowledgeBase', kbName), 'Arn'), {
701
+ description: `Knowledge Base ARN for: ${kbName}`,
702
+ value: kb.knowledgeBaseArn,
703
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'KnowledgeBase', kbName, 'Arn'),
704
+ });
705
+ kb.dataSources.forEach((ds, index) => {
706
+ const dsLabel = `DataSource${index}`;
707
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('KnowledgeBase', kbName), dsLabel, 'Id'), {
708
+ description: `Data Source ${index} ID for KB: ${kbName}`,
709
+ value: ds.id,
710
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'KnowledgeBase', kbName, dsLabel, 'Id'),
711
+ });
712
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('KnowledgeBase', kbName), dsLabel, 'Uri'), {
713
+ description: `Data Source ${index} URI for KB: ${kbName}`,
714
+ value: ds.uri,
715
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'KnowledgeBase', kbName, dsLabel, 'Uri'),
716
+ });
717
+ });
718
+ }
719
+ }
720
+ /**
721
+ * Creates CloudFormation outputs for policy engines and their policies.
722
+ * Produces per-engine outputs (Id, Arn) and per-policy outputs (Id, Arn).
723
+ */
724
+ createPolicyOutputs() {
725
+ if (this.policyEngines.size === 0)
726
+ return;
727
+ const stack = aws_cdk_lib_1.Stack.of(this);
728
+ for (const [engineName, engine] of this.policyEngines) {
729
+ // Per-engine outputs
730
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('PolicyEngine', engineName), 'Id'), {
731
+ description: `Policy Engine ID for: ${engineName}`,
732
+ value: engine.policyEngineId,
733
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'PolicyEngine', engineName, 'Id'),
734
+ });
735
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('PolicyEngine', engineName), 'Arn'), {
736
+ description: `Policy Engine ARN for: ${engineName}`,
737
+ value: engine.policyEngineArn,
738
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'PolicyEngine', engineName, 'Arn'),
739
+ });
740
+ // Per-policy outputs
741
+ for (const [policyName, policy] of engine.policies) {
742
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Policy', engineName, policyName), 'Id'), {
743
+ description: `Policy ID for: ${engineName}/${policyName}`,
744
+ value: policy.policyId,
745
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Policy', engineName, policyName, 'Id'),
746
+ });
747
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Policy', engineName, policyName), 'Arn'), {
748
+ description: `Policy ARN for: ${engineName}/${policyName}`,
749
+ value: policy.policyArn,
750
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Policy', engineName, policyName, 'Arn'),
751
+ });
752
+ }
753
+ }
754
+ }
755
+ /**
756
+ * Creates CloudFormation outputs for gateways and their targets.
757
+ * Produces per-gateway outputs (Id, Arn, Url) and per-target outputs (Id).
758
+ */
759
+ createGatewayOutputs() {
760
+ if (this.gateways.size === 0)
761
+ return;
762
+ const stack = aws_cdk_lib_1.Stack.of(this);
763
+ for (const [gatewayName, gateway] of this.gateways) {
764
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Gateway', gatewayName), 'Id'), {
765
+ description: `Gateway ID for: ${gatewayName}`,
766
+ value: gateway.gatewayId,
767
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Gateway', gatewayName, 'Id'),
768
+ });
769
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Gateway', gatewayName), 'Arn'), {
770
+ description: `Gateway ARN for: ${gatewayName}`,
771
+ value: gateway.gatewayArn,
772
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Gateway', gatewayName, 'Arn'),
773
+ });
774
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Gateway', gatewayName), 'Url'), {
775
+ description: `Gateway URL for: ${gatewayName}`,
776
+ value: gateway.gatewayUrl,
777
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Gateway', gatewayName, 'Url'),
778
+ });
779
+ for (const [targetName, target] of gateway.gatewayTargets) {
780
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('GatewayTarget', targetName), 'Id'), {
781
+ description: `Gateway Target ID for: ${targetName} (gateway: ${gatewayName})`,
782
+ value: target.targetId,
783
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'GatewayTarget', targetName, 'Id'),
784
+ });
785
+ }
786
+ }
787
+ }
788
+ /**
789
+ * Creates CloudFormation outputs for tool runtimes (Id, Arn, Endpoint) and tool functions (Arn, Name).
790
+ */
791
+ createToolOutputs() {
792
+ if (this.toolRuntimes.size === 0 && this.toolLambdaFunctions.size === 0)
793
+ return;
794
+ const stack = aws_cdk_lib_1.Stack.of(this);
795
+ for (const [toolName, runtime] of this.toolRuntimes) {
796
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('ToolRuntime', toolName), 'Id'), {
797
+ description: `Tool runtime ID for: ${toolName}`,
798
+ value: runtime.runtimeId,
799
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'ToolRuntime', toolName, 'Id'),
800
+ });
801
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('ToolRuntime', toolName), 'Arn'), {
802
+ description: `Tool runtime ARN for: ${toolName}`,
803
+ value: runtime.runtimeArn,
804
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'ToolRuntime', toolName, 'Arn'),
805
+ });
806
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('ToolRuntime', toolName), 'Endpoint'), {
807
+ description: `Tool runtime endpoint for: ${toolName}`,
808
+ value: runtime.invocationUrl,
809
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'ToolRuntime', toolName, 'Endpoint'),
810
+ });
811
+ }
812
+ for (const [toolName, lambdaFn] of this.toolLambdaFunctions) {
813
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('ToolFunction', toolName), 'Arn'), {
814
+ description: `Tool function ARN for: ${toolName}`,
815
+ value: lambdaFn.functionArn,
816
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'ToolFunction', toolName, 'Arn'),
817
+ });
818
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('ToolFunction', toolName), 'Name'), {
819
+ description: `Tool function name for: ${toolName}`,
820
+ value: lambdaFn.functionName,
821
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'ToolFunction', toolName, 'Name'),
822
+ });
823
+ }
824
+ }
825
+ createConfigBundleOutputs() {
826
+ if (this.configBundles.size === 0)
827
+ return;
828
+ const stack = aws_cdk_lib_1.Stack.of(this);
829
+ for (const [bundleName, bundle] of this.configBundles) {
830
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('ConfigBundle', bundleName), 'Id'), {
831
+ description: `ConfigBundle ID for: ${bundleName}`,
832
+ value: bundle.bundleId,
833
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'ConfigBundle', bundleName, 'Id'),
834
+ });
835
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('ConfigBundle', bundleName), 'Arn'), {
836
+ description: `ConfigBundle ARN for: ${bundleName}`,
837
+ value: bundle.bundleArn,
838
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'ConfigBundle', bundleName, 'Arn'),
839
+ });
840
+ new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('ConfigBundle', bundleName), 'VersionId'), {
841
+ description: `ConfigBundle VersionId for: ${bundleName}`,
842
+ value: bundle.versionId,
843
+ exportName: (0, logical_ids_1.exportName)(stack.stackName, 'ConfigBundle', bundleName, 'VersionId'),
844
+ });
845
+ }
846
+ }
847
+ /**
848
+ * Resolve placeholder component keys (e.g., {{runtime:name}}, {{gateway:name}})
849
+ * to CDK token references from already-created constructs.
850
+ */
851
+ resolveConfigBundleComponents(components) {
852
+ const resolved = {};
853
+ for (const [key, value] of Object.entries(components)) {
854
+ // resolveComponentKey turns a {{runtime:name}} placeholder into the runtime ARN, which is an
855
+ // unresolved CDK token (cfnRuntime.attrAgentRuntimeArn → Fn::GetAtt). A token can't be used as
856
+ // a CFN map key directly, but that's fine here: AgentCoreConfigBundle wraps the whole Components
857
+ // map in CfnJson, which defers resolution to deploy time and emits a concrete ARN-keyed object.
858
+ // (resolveComponentKey still throws for unknown runtimes and unsupported {{gateway:...}} keys.)
859
+ resolved[this.resolveComponentKey(key)] = value;
860
+ }
861
+ return resolved;
862
+ }
863
+ resolveComponentKey(key) {
864
+ if (key.startsWith('arn:'))
865
+ return key;
866
+ const rtMatch = /^\{\{runtime:(.+)\}\}$/.exec(key);
867
+ if (rtMatch) {
868
+ const rtName = rtMatch[1];
869
+ const env = this.runtimeEnvironments.get(rtName);
870
+ if (!env) {
871
+ throw new Error(`Config bundle references runtime "${rtName}" but it is not defined in runtimes[]. ` +
872
+ 'Ensure the runtime is listed in agentcore.json.');
873
+ }
874
+ return env.runtime.runtimeArn;
875
+ }
876
+ const gwMatch = /^\{\{gateway:(.+)\}\}$/.exec(key);
877
+ if (gwMatch) {
878
+ throw new Error(`Config bundle references gateway "${gwMatch[1]}", but gateway placeholders are not resolved in ` +
879
+ 'config bundles. Use the full gateway ARN as the component key instead.');
880
+ }
881
+ return key;
882
+ }
133
883
  }
134
884
  exports.AgentCoreApplication = AgentCoreApplication;
885
+ /**
886
+ * Derive a harness retrievalConfig from the referenced memory's strategy namespaces,
887
+ * so the harness runtime knows which namespaces to search at inference time. The
888
+ * user-supplied flat tuning (`harness.memory.retrievalConfig`) is fanned out to every
889
+ * namespace — namespaces are only known here (from the resolved Memory's strategies),
890
+ * so a per-namespace map cannot be authored in the harness spec.
891
+ *
892
+ * Reads `namespaceTemplates` (preferred) and falls back to the deprecated `namespaces`,
893
+ * matching AgentCoreMemory's own resolution — a memory defined with only the new
894
+ * template fields would otherwise produce no retrieval namespaces at all.
895
+ */
896
+ function buildRetrievalConfig(memorySpec, tuning) {
897
+ if (!memorySpec?.strategies?.length)
898
+ return undefined;
899
+ // Multiple strategies can declare the same namespace template (e.g. SEMANTIC + USER_PREFERENCE
900
+ // both scoped to /users/{actorId}/profile). Dedup explicitly rather than relying on
901
+ // Object.fromEntries' implicit last-write-wins, which would silently collapse duplicates. The
902
+ // dedup is safe today only because every namespace receives the identical `tuning` value;
903
+ // if per-strategy tuning overrides are ever added, this must merge per namespace instead.
904
+ const namespaces = [
905
+ ...new Set(memorySpec.strategies.flatMap(s => [
906
+ ...(s.namespaceTemplates ?? s.namespaces ?? []),
907
+ ...(s.type === 'EPISODIC' ? (s.reflectionNamespaceTemplates ?? s.reflectionNamespaces ?? []) : []),
908
+ ])),
909
+ ];
910
+ if (namespaces.length === 0)
911
+ return undefined;
912
+ // Spread a fresh copy per namespace so the entries don't alias one shared object — a future
913
+ // per-namespace tweak would otherwise mutate every namespace at once.
914
+ return Object.fromEntries(namespaces.map(ns => [ns, { ...tuning }]));
915
+ }
135
916
  //# sourceMappingURL=AgentCoreApplication.js.map