@aws/agentcore-cdk 0.1.0-alpha.9 → 1.0.0-rc.2

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