@aws/agentcore 1.0.0-preview.3 → 1.0.0-preview.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (330) hide show
  1. package/README.md +193 -33
  2. package/dist/agent-inspector/index.css +1 -1
  3. package/dist/agent-inspector/index.js +99 -84
  4. package/dist/assets/README.md +6 -2
  5. package/dist/assets/__tests__/__snapshots__/assets.snapshot.test.ts.snap +3344 -366
  6. package/dist/assets/__tests__/__snapshots__/dockerfile-render.test.ts.snap +6 -2
  7. package/dist/assets/__tests__/assets.snapshot.test.ts +10 -24
  8. package/dist/assets/__tests__/googleadk-observability.test.ts +23 -0
  9. package/dist/assets/__tests__/googleadk-session-eviction.test.ts +87 -0
  10. package/dist/assets/__tests__/input-validation.test.ts +44 -0
  11. package/dist/assets/__tests__/summarization-namespace.test.ts +43 -0
  12. package/dist/assets/agents/AGENTS.md +91 -14
  13. package/dist/assets/cdk/bin/cdk.ts +109 -24
  14. package/dist/assets/cdk/lib/cdk-stack.ts +227 -19
  15. package/dist/assets/cdk/package.json +9 -9
  16. package/dist/assets/cdk/test/cdk.test.ts +4 -0
  17. package/dist/assets/container/python/Dockerfile +7 -1
  18. package/dist/assets/container/typescript/Dockerfile +25 -0
  19. package/dist/assets/container/typescript/dockerignore.template +24 -0
  20. package/dist/assets/datasets/predefined-v1.jsonl +3 -0
  21. package/dist/assets/datasets/simulated-v1.jsonl +3 -0
  22. package/dist/assets/evaluators/autoevals-lambda/execution-role-policy.json +15 -0
  23. package/dist/assets/evaluators/autoevals-lambda/lambda_function.py +37 -0
  24. package/dist/assets/evaluators/autoevals-lambda/pyproject.toml +22 -0
  25. package/dist/assets/evaluators/deepeval-lambda/execution-role-policy.json +15 -0
  26. package/dist/assets/evaluators/deepeval-lambda/lambda_function.py +29 -0
  27. package/dist/assets/evaluators/deepeval-lambda/pyproject.toml +19 -0
  28. package/dist/assets/mcp/python/pyproject.toml +1 -1
  29. package/dist/assets/python/a2a/googleadk/base/main.py +32 -18
  30. package/dist/assets/python/a2a/googleadk/base/pyproject.toml +6 -4
  31. package/dist/assets/python/a2a/langchain_langgraph/base/main.py +35 -21
  32. package/dist/assets/python/a2a/langchain_langgraph/base/pyproject.toml +4 -3
  33. package/dist/assets/python/a2a/strands/base/main.py +23 -17
  34. package/dist/assets/python/a2a/strands/base/pyproject.toml +3 -3
  35. package/dist/assets/python/a2a/strands/capabilities/memory/session.py +4 -1
  36. package/dist/assets/python/agui/googleadk/base/main.py +62 -2
  37. package/dist/assets/python/agui/googleadk/base/pyproject.toml +6 -5
  38. package/dist/assets/python/agui/langchain_langgraph/base/main.py +56 -0
  39. package/dist/assets/python/agui/langchain_langgraph/base/pyproject.toml +3 -2
  40. package/dist/assets/python/agui/strands/base/main.py +63 -1
  41. package/dist/assets/python/agui/strands/base/pyproject.toml +2 -2
  42. package/dist/assets/python/agui/strands/capabilities/memory/session.py +4 -1
  43. package/dist/assets/python/http/autogen/base/README.md +7 -1
  44. package/dist/assets/python/http/autogen/base/main.py +62 -29
  45. package/dist/assets/python/http/autogen/base/pyproject.toml +1 -1
  46. package/dist/assets/python/http/googleadk/base/README.md +7 -1
  47. package/dist/assets/python/http/googleadk/base/main.py +71 -24
  48. package/dist/assets/python/http/googleadk/base/mcp_client/client.py +7 -7
  49. package/dist/assets/python/http/googleadk/base/pyproject.toml +5 -3
  50. package/dist/assets/python/http/langchain_langgraph/base/README.md +7 -1
  51. package/dist/assets/python/http/langchain_langgraph/base/main.py +119 -24
  52. package/dist/assets/python/http/langchain_langgraph/base/mcp_client/client.py +10 -8
  53. package/dist/assets/python/http/langchain_langgraph/base/pyproject.toml +5 -4
  54. package/dist/assets/python/http/openaiagents/base/README.md +7 -1
  55. package/dist/assets/python/http/openaiagents/base/main.py +63 -32
  56. package/dist/assets/python/http/openaiagents/base/mcp_client/client.py +4 -4
  57. package/dist/assets/python/http/openaiagents/base/pyproject.toml +3 -3
  58. package/dist/assets/python/http/strands/base/README.md +8 -1
  59. package/dist/assets/python/http/strands/base/main.py +607 -47
  60. package/dist/assets/python/http/strands/base/mcp_client/client.py +49 -6
  61. package/dist/assets/python/http/strands/base/model/load.py +119 -3
  62. package/dist/assets/python/http/strands/base/model/mantle_compat.py +21 -0
  63. package/dist/assets/python/http/strands/base/pyproject.toml +11 -5
  64. package/dist/assets/python/http/strands/base/skills/fetcher.py +279 -0
  65. package/dist/assets/python/http/strands/capabilities/execution-limits/hooks/execution_limits.py +54 -0
  66. package/dist/assets/python/http/strands/capabilities/memory/session.py +4 -1
  67. package/dist/assets/python/http/strands/capabilities/payments/__init__.py +4 -0
  68. package/dist/assets/python/http/strands/capabilities/payments/payments.py +142 -0
  69. package/dist/assets/python/mcp/standalone/base/main.py +58 -0
  70. package/dist/assets/python/mcp/standalone/base/pyproject.toml +1 -1
  71. package/dist/assets/typescript/http/strands/base/README.md +42 -0
  72. package/dist/assets/typescript/http/strands/base/gitignore.template +22 -0
  73. package/dist/assets/typescript/http/strands/base/main.ts +149 -0
  74. package/dist/assets/typescript/http/strands/base/mcp_client/client.ts +11 -0
  75. package/dist/assets/typescript/http/strands/base/model/load.ts +102 -0
  76. package/dist/assets/typescript/http/strands/base/package.json +38 -0
  77. package/dist/assets/typescript/http/strands/base/tsconfig.json +19 -0
  78. package/dist/assets/typescript/http/strands/capabilities/memory/memory.ts +52 -0
  79. package/dist/assets/typescript/http/vercelai/base/README.md +42 -0
  80. package/dist/assets/typescript/http/vercelai/base/gitignore.template +22 -0
  81. package/dist/assets/typescript/http/vercelai/base/main.ts +70 -0
  82. package/dist/assets/typescript/http/vercelai/base/model/load.ts +121 -0
  83. package/dist/assets/typescript/http/vercelai/base/package.json +35 -0
  84. package/dist/assets/typescript/http/vercelai/base/tsconfig.json +19 -0
  85. package/dist/cli/index.mjs +1743 -627
  86. package/dist/lib/constants.d.ts +8 -4
  87. package/dist/lib/constants.d.ts.map +1 -1
  88. package/dist/lib/constants.js +13 -7
  89. package/dist/lib/constants.js.map +1 -1
  90. package/dist/lib/dependency-management/index.d.ts +5 -0
  91. package/dist/lib/dependency-management/index.d.ts.map +1 -0
  92. package/dist/lib/dependency-management/index.js +8 -0
  93. package/dist/lib/dependency-management/index.js.map +1 -0
  94. package/dist/lib/dependency-management/messages.d.ts +30 -0
  95. package/dist/lib/dependency-management/messages.d.ts.map +1 -0
  96. package/dist/lib/dependency-management/messages.js +86 -0
  97. package/dist/lib/dependency-management/messages.js.map +1 -0
  98. package/dist/lib/dependency-management/plan.d.ts +25 -0
  99. package/dist/lib/dependency-management/plan.d.ts.map +1 -0
  100. package/dist/lib/dependency-management/plan.js +67 -0
  101. package/dist/lib/dependency-management/plan.js.map +1 -0
  102. package/dist/lib/dependency-management/semver.d.ts +21 -0
  103. package/dist/lib/dependency-management/semver.d.ts.map +1 -0
  104. package/dist/lib/dependency-management/semver.js +51 -0
  105. package/dist/lib/dependency-management/semver.js.map +1 -0
  106. package/dist/lib/dependency-management/sync.d.ts +26 -0
  107. package/dist/lib/dependency-management/sync.d.ts.map +1 -0
  108. package/dist/lib/dependency-management/sync.js +141 -0
  109. package/dist/lib/dependency-management/sync.js.map +1 -0
  110. package/dist/lib/dependency-management/types.d.ts +85 -0
  111. package/dist/lib/dependency-management/types.d.ts.map +1 -0
  112. package/dist/lib/dependency-management/types.js +3 -0
  113. package/dist/lib/dependency-management/types.js.map +1 -0
  114. package/dist/lib/errors/index.d.ts +1 -1
  115. package/dist/lib/errors/index.d.ts.map +1 -1
  116. package/dist/lib/errors/index.js +1 -1
  117. package/dist/lib/errors/index.js.map +1 -1
  118. package/dist/lib/errors/types.d.ts +274 -0
  119. package/dist/lib/errors/types.d.ts.map +1 -0
  120. package/dist/lib/errors/types.js +423 -0
  121. package/dist/lib/errors/types.js.map +1 -0
  122. package/dist/lib/errors/zod.d.ts +8 -0
  123. package/dist/lib/errors/zod.d.ts.map +1 -0
  124. package/dist/lib/errors/{config.js → zod.js} +8 -81
  125. package/dist/lib/errors/zod.js.map +1 -0
  126. package/dist/lib/index.d.ts +3 -0
  127. package/dist/lib/index.d.ts.map +1 -1
  128. package/dist/lib/index.js +4 -1
  129. package/dist/lib/index.js.map +1 -1
  130. package/dist/lib/packaging/build-args.d.ts +6 -0
  131. package/dist/lib/packaging/build-args.d.ts.map +1 -1
  132. package/dist/lib/packaging/build-args.js +11 -2
  133. package/dist/lib/packaging/build-args.js.map +1 -1
  134. package/dist/lib/packaging/build-context-dockerignore.d.ts +23 -0
  135. package/dist/lib/packaging/build-context-dockerignore.d.ts.map +1 -0
  136. package/dist/lib/packaging/build-context-dockerignore.js +63 -0
  137. package/dist/lib/packaging/build-context-dockerignore.js.map +1 -0
  138. package/dist/lib/packaging/build-context.d.ts +21 -0
  139. package/dist/lib/packaging/build-context.d.ts.map +1 -0
  140. package/dist/lib/packaging/build-context.js +21 -0
  141. package/dist/lib/packaging/build-context.js.map +1 -0
  142. package/dist/lib/packaging/container.d.ts.map +1 -1
  143. package/dist/lib/packaging/container.js +20 -9
  144. package/dist/lib/packaging/container.js.map +1 -1
  145. package/dist/lib/packaging/helpers.d.ts +16 -0
  146. package/dist/lib/packaging/helpers.d.ts.map +1 -1
  147. package/dist/lib/packaging/helpers.js +127 -29
  148. package/dist/lib/packaging/helpers.js.map +1 -1
  149. package/dist/lib/packaging/index.d.ts +2 -1
  150. package/dist/lib/packaging/index.d.ts.map +1 -1
  151. package/dist/lib/packaging/index.js +9 -20
  152. package/dist/lib/packaging/index.js.map +1 -1
  153. package/dist/lib/packaging/node.d.ts +2 -2
  154. package/dist/lib/packaging/node.d.ts.map +1 -1
  155. package/dist/lib/packaging/node.js +83 -38
  156. package/dist/lib/packaging/node.js.map +1 -1
  157. package/dist/lib/packaging/python.js +12 -12
  158. package/dist/lib/packaging/python.js.map +1 -1
  159. package/dist/lib/result.d.ts +57 -0
  160. package/dist/lib/result.d.ts.map +1 -0
  161. package/dist/lib/result.js +62 -0
  162. package/dist/lib/result.js.map +1 -0
  163. package/dist/lib/schemas/io/config-io.d.ts +14 -0
  164. package/dist/lib/schemas/io/config-io.d.ts.map +1 -1
  165. package/dist/lib/schemas/io/config-io.js +89 -5
  166. package/dist/lib/schemas/io/config-io.js.map +1 -1
  167. package/dist/lib/schemas/io/global-config.d.ts +41 -0
  168. package/dist/lib/schemas/io/global-config.d.ts.map +1 -0
  169. package/dist/lib/schemas/io/global-config.js +119 -0
  170. package/dist/lib/schemas/io/global-config.js.map +1 -0
  171. package/dist/lib/schemas/io/index.d.ts +1 -2
  172. package/dist/lib/schemas/io/index.d.ts.map +1 -1
  173. package/dist/lib/schemas/io/index.js +1 -4
  174. package/dist/lib/schemas/io/index.js.map +1 -1
  175. package/dist/lib/schemas/io/path-resolver.d.ts +0 -6
  176. package/dist/lib/schemas/io/path-resolver.d.ts.map +1 -1
  177. package/dist/lib/schemas/io/path-resolver.js +3 -13
  178. package/dist/lib/schemas/io/path-resolver.js.map +1 -1
  179. package/dist/lib/secrets/cipher.d.ts +12 -0
  180. package/dist/lib/secrets/cipher.d.ts.map +1 -0
  181. package/dist/lib/secrets/cipher.js +54 -0
  182. package/dist/lib/secrets/cipher.js.map +1 -0
  183. package/dist/lib/secrets/index.d.ts +4 -0
  184. package/dist/lib/secrets/index.d.ts.map +1 -0
  185. package/dist/lib/secrets/index.js +15 -0
  186. package/dist/lib/secrets/index.js.map +1 -0
  187. package/dist/lib/secrets/key-provider.d.ts +16 -0
  188. package/dist/lib/secrets/key-provider.d.ts.map +1 -0
  189. package/dist/lib/secrets/key-provider.js +191 -0
  190. package/dist/lib/secrets/key-provider.js.map +1 -0
  191. package/dist/lib/secrets/sensitive-keys.d.ts +21 -0
  192. package/dist/lib/secrets/sensitive-keys.d.ts.map +1 -0
  193. package/dist/lib/secrets/sensitive-keys.js +67 -0
  194. package/dist/lib/secrets/sensitive-keys.js.map +1 -0
  195. package/dist/lib/time-constants.d.ts +5 -0
  196. package/dist/lib/time-constants.d.ts.map +1 -0
  197. package/dist/lib/time-constants.js +8 -0
  198. package/dist/lib/time-constants.js.map +1 -0
  199. package/dist/lib/utils/env.d.ts +8 -2
  200. package/dist/lib/utils/env.d.ts.map +1 -1
  201. package/dist/lib/utils/env.js +65 -17
  202. package/dist/lib/utils/env.js.map +1 -1
  203. package/dist/lib/utils/index.d.ts +3 -2
  204. package/dist/lib/utils/index.d.ts.map +1 -1
  205. package/dist/lib/utils/index.js +6 -1
  206. package/dist/lib/utils/index.js.map +1 -1
  207. package/dist/lib/utils/polling.d.ts +31 -0
  208. package/dist/lib/utils/polling.d.ts.map +1 -0
  209. package/dist/lib/utils/polling.js +61 -0
  210. package/dist/lib/utils/polling.js.map +1 -0
  211. package/dist/lib/utils/subprocess.d.ts +4 -1
  212. package/dist/lib/utils/subprocess.d.ts.map +1 -1
  213. package/dist/lib/utils/subprocess.js +11 -57
  214. package/dist/lib/utils/subprocess.js.map +1 -1
  215. package/dist/lib/utils/zod.d.ts +16 -0
  216. package/dist/lib/utils/zod.d.ts.map +1 -1
  217. package/dist/lib/utils/zod.js +45 -0
  218. package/dist/lib/utils/zod.js.map +1 -1
  219. package/dist/schema/constants.d.ts +56 -2
  220. package/dist/schema/constants.d.ts.map +1 -1
  221. package/dist/schema/constants.js +82 -7
  222. package/dist/schema/constants.js.map +1 -1
  223. package/dist/schema/schemas/agent-env.d.ts +187 -7
  224. package/dist/schema/schemas/agent-env.d.ts.map +1 -1
  225. package/dist/schema/schemas/agent-env.js +323 -27
  226. package/dist/schema/schemas/agent-env.js.map +1 -1
  227. package/dist/schema/schemas/agentcore-project.d.ts +519 -12
  228. package/dist/schema/schemas/agentcore-project.d.ts.map +1 -1
  229. package/dist/schema/schemas/agentcore-project.js +342 -13
  230. package/dist/schema/schemas/agentcore-project.js.map +1 -1
  231. package/dist/schema/schemas/auth.d.ts +174 -0
  232. package/dist/schema/schemas/auth.d.ts.map +1 -1
  233. package/dist/schema/schemas/auth.js +127 -3
  234. package/dist/schema/schemas/auth.js.map +1 -1
  235. package/dist/schema/schemas/aws-targets.d.ts +18 -0
  236. package/dist/schema/schemas/aws-targets.d.ts.map +1 -1
  237. package/dist/schema/schemas/aws-targets.js +6 -0
  238. package/dist/schema/schemas/aws-targets.js.map +1 -1
  239. package/dist/schema/schemas/connections.d.ts +185 -0
  240. package/dist/schema/schemas/connections.d.ts.map +1 -0
  241. package/dist/schema/schemas/connections.js +176 -0
  242. package/dist/schema/schemas/connections.js.map +1 -0
  243. package/dist/schema/schemas/deployed-state.d.ts +392 -5
  244. package/dist/schema/schemas/deployed-state.d.ts.map +1 -1
  245. package/dist/schema/schemas/deployed-state.js +112 -2
  246. package/dist/schema/schemas/deployed-state.js.map +1 -1
  247. package/dist/schema/schemas/index.d.ts +3 -0
  248. package/dist/schema/schemas/index.d.ts.map +1 -1
  249. package/dist/schema/schemas/index.js +5 -0
  250. package/dist/schema/schemas/index.js.map +1 -1
  251. package/dist/schema/schemas/mcp-defs.d.ts +2 -1
  252. package/dist/schema/schemas/mcp-defs.d.ts.map +1 -1
  253. package/dist/schema/schemas/mcp-defs.js +3 -2
  254. package/dist/schema/schemas/mcp-defs.js.map +1 -1
  255. package/dist/schema/schemas/mcp.d.ts +197 -0
  256. package/dist/schema/schemas/mcp.d.ts.map +1 -1
  257. package/dist/schema/schemas/mcp.js +334 -5
  258. package/dist/schema/schemas/mcp.js.map +1 -1
  259. package/dist/schema/schemas/primitives/ab-test.d.ts +135 -0
  260. package/dist/schema/schemas/primitives/ab-test.d.ts.map +1 -0
  261. package/dist/schema/schemas/primitives/ab-test.js +95 -0
  262. package/dist/schema/schemas/primitives/ab-test.js.map +1 -0
  263. package/dist/schema/schemas/primitives/capacity-provider.d.ts +237 -0
  264. package/dist/schema/schemas/primitives/capacity-provider.d.ts.map +1 -0
  265. package/dist/schema/schemas/primitives/capacity-provider.js +220 -0
  266. package/dist/schema/schemas/primitives/capacity-provider.js.map +1 -0
  267. package/dist/schema/schemas/primitives/config-bundle.d.ts +32 -0
  268. package/dist/schema/schemas/primitives/config-bundle.d.ts.map +1 -0
  269. package/dist/schema/schemas/primitives/config-bundle.js +41 -0
  270. package/dist/schema/schemas/primitives/config-bundle.js.map +1 -0
  271. package/dist/schema/schemas/primitives/dataset.d.ts +48 -0
  272. package/dist/schema/schemas/primitives/dataset.d.ts.map +1 -0
  273. package/dist/schema/schemas/primitives/dataset.js +58 -0
  274. package/dist/schema/schemas/primitives/dataset.js.map +1 -0
  275. package/dist/schema/schemas/primitives/evaluator.d.ts +22 -0
  276. package/dist/schema/schemas/primitives/evaluator.d.ts.map +1 -1
  277. package/dist/schema/schemas/primitives/evaluator.js +28 -3
  278. package/dist/schema/schemas/primitives/evaluator.js.map +1 -1
  279. package/dist/schema/schemas/primitives/harness.d.ts +377 -19
  280. package/dist/schema/schemas/primitives/harness.d.ts.map +1 -1
  281. package/dist/schema/schemas/primitives/harness.js +379 -24
  282. package/dist/schema/schemas/primitives/harness.js.map +1 -1
  283. package/dist/schema/schemas/primitives/index.d.ts +17 -9
  284. package/dist/schema/schemas/primitives/index.d.ts.map +1 -1
  285. package/dist/schema/schemas/primitives/index.js +62 -1
  286. package/dist/schema/schemas/primitives/index.js.map +1 -1
  287. package/dist/schema/schemas/primitives/knowledge-base.d.ts +104 -0
  288. package/dist/schema/schemas/primitives/knowledge-base.d.ts.map +1 -0
  289. package/dist/schema/schemas/primitives/knowledge-base.js +99 -0
  290. package/dist/schema/schemas/primitives/knowledge-base.js.map +1 -0
  291. package/dist/schema/schemas/primitives/memory.d.ts +22 -4
  292. package/dist/schema/schemas/primitives/memory.d.ts.map +1 -1
  293. package/dist/schema/schemas/primitives/memory.js +57 -16
  294. package/dist/schema/schemas/primitives/memory.js.map +1 -1
  295. package/dist/schema/schemas/primitives/online-eval-config.d.ts +21 -2
  296. package/dist/schema/schemas/primitives/online-eval-config.d.ts.map +1 -1
  297. package/dist/schema/schemas/primitives/online-eval-config.js +45 -5
  298. package/dist/schema/schemas/primitives/online-eval-config.js.map +1 -1
  299. package/dist/schema/schemas/primitives/payment.d.ts +86 -0
  300. package/dist/schema/schemas/primitives/payment.d.ts.map +1 -0
  301. package/dist/schema/schemas/primitives/payment.js +88 -0
  302. package/dist/schema/schemas/primitives/payment.js.map +1 -0
  303. package/dist/schema/schemas/primitives/policy.d.ts +26 -0
  304. package/dist/schema/schemas/primitives/policy.d.ts.map +1 -1
  305. package/dist/schema/schemas/primitives/policy.js +5 -1
  306. package/dist/schema/schemas/primitives/policy.js.map +1 -1
  307. package/npm-shrinkwrap.json +16874 -0
  308. package/package.json +49 -21
  309. package/scripts/bump-version.ts +4 -4
  310. package/scripts/bundle.mjs +70 -41
  311. package/scripts/extract-cli-model.mjs +269 -0
  312. package/scripts/extract-cli-model.test.mjs +43 -0
  313. package/scripts/render_adoc.py +350 -0
  314. package/scripts/run-e2e-dev.sh +56 -0
  315. package/scripts/run-e2e-local.sh +145 -0
  316. package/scripts/safe-junit-reporter.ts +7 -0
  317. package/scripts/sanitize-test-artifacts.ts +65 -0
  318. package/scripts/sync-vended-cdk.ts +49 -0
  319. package/scripts/test_render_adoc.py +38 -0
  320. package/dist/lib/errors/config.d.ts +0 -49
  321. package/dist/lib/errors/config.d.ts.map +0 -1
  322. package/dist/lib/errors/config.js.map +0 -1
  323. package/dist/lib/packaging/errors.d.ts +0 -16
  324. package/dist/lib/packaging/errors.d.ts.map +0 -1
  325. package/dist/lib/packaging/errors.js +0 -36
  326. package/dist/lib/packaging/errors.js.map +0 -1
  327. package/dist/lib/schemas/io/cli-config.d.ts +0 -12
  328. package/dist/lib/schemas/io/cli-config.d.ts.map +0 -1
  329. package/dist/lib/schemas/io/cli-config.js +0 -35
  330. package/dist/lib/schemas/io/cli-config.js.map +0 -1
@@ -1,7 +1,9 @@
1
1
  // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
3
  exports[`Dockerfile enableOtel rendering > renders opentelemetry-instrument CMD when enableOtel is true > Dockerfile-enableOtel-true 1`] = `
4
- "FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
4
+ "FROM public.ecr.aws/docker/library/python:3.12-slim-trixie
5
+
6
+ RUN pip install --no-cache-dir uv
5
7
 
6
8
  ARG UV_DEFAULT_INDEX
7
9
  ARG UV_INDEX
@@ -39,7 +41,9 @@ CMD ["opentelemetry-instrument", "python", "-m", "main"]
39
41
  `;
40
42
 
41
43
  exports[`Dockerfile enableOtel rendering > renders plain python CMD when enableOtel is false > Dockerfile-enableOtel-false 1`] = `
42
- "FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
44
+ "FROM public.ecr.aws/docker/library/python:3.12-slim-trixie
45
+
46
+ RUN pip install --no-cache-dir uv
43
47
 
44
48
  ARG UV_DEFAULT_INDEX
45
49
  ARG UV_INDEX
@@ -87,36 +87,22 @@ describe('Assets Directory Snapshots', () => {
87
87
  });
88
88
  });
89
89
 
90
- describe('Static assets', () => {
90
+ describe.skipIf(assetFiles.filter(f => f.startsWith('static/')).length === 0)('Static assets', () => {
91
91
  const staticFiles = assetFiles.filter(f => f.startsWith('static/'));
92
92
 
93
- if (staticFiles.length > 0) {
94
- it.each(staticFiles)('static/%s should match snapshot', file => {
95
- const content = readFileContent(path.join(ASSETS_DIR, file));
96
- expect(content).toMatchSnapshot();
97
- });
98
- } else {
99
- it('static directory is empty or does not exist', () => {
100
- // Static assets may not exist
101
- expect(true).toBe(true);
102
- });
103
- }
93
+ it.each(staticFiles)('static/%s should match snapshot', file => {
94
+ const content = readFileContent(path.join(ASSETS_DIR, file));
95
+ expect(content).toMatchSnapshot();
96
+ });
104
97
  });
105
98
 
106
- describe('TypeScript assets', () => {
99
+ describe.skipIf(assetFiles.filter(f => f.startsWith('typescript/')).length === 0)('TypeScript assets', () => {
107
100
  const tsFiles = assetFiles.filter(f => f.startsWith('typescript/'));
108
101
 
109
- if (tsFiles.length > 0) {
110
- it.each(tsFiles)('typescript/%s should match snapshot', file => {
111
- const content = readFileContent(path.join(ASSETS_DIR, file));
112
- expect(content).toMatchSnapshot();
113
- });
114
- } else {
115
- it('typescript directory is empty or contains only placeholder files', () => {
116
- // TypeScript assets may not exist yet
117
- expect(true).toBe(true);
118
- });
119
- }
102
+ it.each(tsFiles)('typescript/%s should match snapshot', file => {
103
+ const content = readFileContent(path.join(ASSETS_DIR, file));
104
+ expect(content).toMatchSnapshot();
105
+ });
120
106
  });
121
107
 
122
108
  describe('Root-level assets', () => {
@@ -0,0 +1,23 @@
1
+ import * as fs from 'fs';
2
+ import * as path from 'path';
3
+ import { describe, expect, it } from 'vitest';
4
+
5
+ const ASSETS_DIR = path.resolve(__dirname, '..', 'python');
6
+ const EXPECTED_DEPENDENCIES = [
7
+ ['http', '"aws-opentelemetry-distro >= 0.17.0"'],
8
+ ['agui', '"aws-opentelemetry-distro >= 0.17.0"'],
9
+ ['a2a', '"aws-opentelemetry-distro"'],
10
+ ] as const;
11
+
12
+ describe('Google ADK observability dependencies', () => {
13
+ it.each(EXPECTED_DEPENDENCIES)('%s uses the AWS OpenTelemetry distro', (protocol, expectedDependency) => {
14
+ const pyproject = fs.readFileSync(
15
+ path.join(ASSETS_DIR, protocol, 'googleadk', 'base', 'pyproject.toml'),
16
+ 'utf-8'
17
+ );
18
+
19
+ expect(pyproject).toContain(expectedDependency);
20
+ expect(pyproject).not.toMatch(/^\s*"opentelemetry-distro",?$/m);
21
+ expect(pyproject).not.toMatch(/^\s*"opentelemetry-exporter-otlp",?$/m);
22
+ });
23
+ });
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Regression test for the GoogleADK session-store LRU eviction (#808, #1639).
3
+ *
4
+ * The rendered template bounds InMemorySessionService to 128 sessions via an
5
+ * OrderedDict whose KEY is the composite (user_id, session_id) tuple. The
6
+ * eviction must unpack the key tuple from popitem() -- popitem() returns
7
+ * (key, value), so the value (always True) must be discarded. A previous
8
+ * bug unpacked `old_user_id, old_session_id = popitem(...)`, which assigned the
9
+ * tuple key to old_user_id and True to old_session_id, so delete_session() was
10
+ * called with garbage and the real session was never freed -- growing unbounded.
11
+ */
12
+ import * as fs from 'fs';
13
+ import Handlebars from 'handlebars';
14
+ import * as path from 'path';
15
+ import { describe, expect, it } from 'vitest';
16
+
17
+ const MAIN_PATH = path.resolve(__dirname, '..', 'python', 'http', 'googleadk', 'base', 'main.py');
18
+
19
+ const SESSION_LIMIT = 128;
20
+ const SEP = '::';
21
+
22
+ /**
23
+ * Mirror of the rendered template's `get_or_create_session` eviction loop so we
24
+ * can assert the observable behavior (store cap + correct delete ids) without a
25
+ * Python runtime. Returns the keys still tracked and the (user_id, session_id)
26
+ * pairs that delete_session was invoked with, in eviction order.
27
+ */
28
+ function simulateEviction(sessions: Array<[string, string]>): {
29
+ tracked: Set<string>;
30
+ deleted: Array<[string, string]>;
31
+ } {
32
+ const keys = new Map<string, true>();
33
+ const deleted: Array<[string, string]> = [];
34
+
35
+ for (const [userId, sessionId] of sessions) {
36
+ const key = `${userId}${SEP}${sessionId}`;
37
+ if (keys.has(key)) {
38
+ keys.delete(key);
39
+ keys.set(key, true);
40
+ continue;
41
+ }
42
+ while (keys.size >= SESSION_LIMIT) {
43
+ const oldest = keys.keys().next().value as string;
44
+ keys.delete(oldest);
45
+ const [oldUser, oldSession] = oldest.split(SEP);
46
+ deleted.push([oldUser, oldSession]);
47
+ }
48
+ keys.set(key, true);
49
+ }
50
+
51
+ return { tracked: new Set(keys.keys()), deleted };
52
+ }
53
+
54
+ describe('GoogleADK session store LRU eviction', () => {
55
+ const template = Handlebars.compile(fs.readFileSync(MAIN_PATH, 'utf-8'));
56
+ const rendered = template({ name: 'evictionagent', needsOs: false, hasGateway: false });
57
+
58
+ it('unpacks the composite key tuple from popitem (not key->user_id, value->session_id)', () => {
59
+ // The load-bearing fix: the key tuple must be destructured, value discarded.
60
+ expect(rendered).toContain('(old_user_id, old_session_id), _ = _session_keys.popitem(last=False)');
61
+ // Guard against the buggy form regressing back in.
62
+ expect(rendered).not.toMatch(/^\s*old_user_id, old_session_id = _session_keys\.popitem/m);
63
+ });
64
+
65
+ it('passes the unpacked ids straight to delete_session', () => {
66
+ expect(rendered).toContain('user_id=old_user_id, session_id=old_session_id');
67
+ });
68
+
69
+ it('caps the store at 128 and evicts the oldest sessions in order', () => {
70
+ const sessions: Array<[string, string]> = [];
71
+ for (let i = 0; i < 200; i++) {
72
+ sessions.push(['u', `s${i}`]);
73
+ }
74
+
75
+ const { tracked, deleted } = simulateEviction(sessions);
76
+
77
+ // Store stays bounded at the limit regardless of how many distinct sessions arrive.
78
+ expect(tracked.size).toBe(SESSION_LIMIT);
79
+ // 200 inserts - 128 retained = 72 evictions, oldest first.
80
+ expect(deleted.length).toBe(200 - SESSION_LIMIT);
81
+ expect(deleted[0]).toEqual(['u', 's0']);
82
+ expect(deleted[deleted.length - 1]).toEqual(['u', `s${200 - SESSION_LIMIT - 1}`]);
83
+ // The most recent session is retained; the first evicted one is gone.
84
+ expect(tracked.has(`u${SEP}s199`)).toBe(true);
85
+ expect(tracked.has(`u${SEP}s0`)).toBe(false);
86
+ });
87
+ });
@@ -0,0 +1,44 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { resolve } from 'node:path';
3
+ import { describe, expect, it } from 'vitest';
4
+
5
+ const ASSETS_DIR = resolve(__dirname, '..');
6
+
7
+ const PYTHON_HTTP_ENTRYPOINTS = [
8
+ 'python/http/autogen/base/main.py',
9
+ 'python/http/googleadk/base/main.py',
10
+ 'python/http/langchain_langgraph/base/main.py',
11
+ 'python/http/openaiagents/base/main.py',
12
+ 'python/http/strands/base/main.py',
13
+ ];
14
+
15
+ const TYPESCRIPT_HTTP_ENTRYPOINTS = [
16
+ 'typescript/http/strands/base/main.ts',
17
+ 'typescript/http/vercelai/base/main.ts',
18
+ ];
19
+
20
+ describe('HTTP agent template input validation', () => {
21
+ it.each(PYTHON_HTTP_ENTRYPOINTS)('%s rejects non-string prompts', templatePath => {
22
+ const template = readFileSync(resolve(ASSETS_DIR, templatePath), 'utf8');
23
+
24
+ expect(template).toContain('if not isinstance(prompt, str):');
25
+ expect(template).toContain('raise ValueError("prompt must be a string")');
26
+ });
27
+
28
+ it.each(TYPESCRIPT_HTTP_ENTRYPOINTS)('%s validates prompts with Zod', templatePath => {
29
+ const template = readFileSync(resolve(ASSETS_DIR, templatePath), 'utf8');
30
+
31
+ expect(template).toContain("prompt: z.string().default('')");
32
+ expect(template).toContain('requestSchema,');
33
+ });
34
+
35
+ it('strips toolUse blocks from the Python Strands message-history tail', () => {
36
+ const template = readFileSync(resolve(ASSETS_DIR, 'python/http/strands/base/main.py'), 'utf8');
37
+
38
+ expect(template).toContain('def strip_trailing_tool_use(messages: Any) -> list[dict]:');
39
+ expect(template).toContain('while messages:');
40
+ expect(template).toContain('content = [block for block in original_content if "toolUse" not in block]');
41
+ expect(template).toContain('messages.pop()');
42
+ expect(template).toContain('return strip_trailing_tool_use(payload["messages"])');
43
+ });
44
+ });
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Regression test for cross-session SUMMARIZATION recall (issue #665).
3
+ *
4
+ * The SUMMARIZATION retrieval namespace must be actor-scoped (`/summaries/{actor_id}`),
5
+ * not session-scoped. The SDK's namespace_path is a hierarchical prefix match, so a
6
+ * per-session prefix (`/summaries/{actor_id}/{session_id}`) only ever matches the current
7
+ * session's own summaries and never surfaces summaries written by prior sessions —
8
+ * silently breaking cross-session recall. This guards against another silent revert
9
+ * (see PR #1299, reverted by squash release #1547).
10
+ */
11
+ import Handlebars from 'handlebars';
12
+ import * as fs from 'fs';
13
+ import * as path from 'path';
14
+ import { describe, expect, it } from 'vitest';
15
+ // Importing render registers the `includes` Handlebars helper used by the template.
16
+ import '../../cli/templates/render.js';
17
+
18
+ const FLAVORS = ['http', 'agui', 'a2a'] as const;
19
+
20
+ function renderSessionTemplate(flavor: string): string {
21
+ const templatePath = path.resolve(
22
+ __dirname,
23
+ '..',
24
+ 'python',
25
+ flavor,
26
+ 'strands',
27
+ 'capabilities',
28
+ 'memory',
29
+ 'session.py'
30
+ );
31
+ const content = fs.readFileSync(templatePath, 'utf-8');
32
+ return Handlebars.compile(content)({
33
+ memoryProviders: [{ envVarName: 'MEMORY_TEST_ID', strategies: ['SUMMARIZATION'] }],
34
+ });
35
+ }
36
+
37
+ describe('SUMMARIZATION retrieval namespace', () => {
38
+ it.each(FLAVORS)('%s session.py uses an actor-scoped summary namespace', flavor => {
39
+ const rendered = renderSessionTemplate(flavor);
40
+ expect(rendered).toContain('f"/summaries/{actor_id}": RetrievalConfig');
41
+ expect(rendered).not.toContain('/summaries/{actor_id}/{session_id}');
42
+ });
43
+ });
@@ -23,6 +23,8 @@ Tags defined in `agentcore.json` flow through to deployed CloudFormation resourc
23
23
  `agentcore validate` to check.
24
24
  4. **Resource Removal:** Use `agentcore remove` to remove resources. Run `agentcore deploy` after removal to tear down
25
25
  deployed infrastructure.
26
+ 5. **Invocation Input:** Validate runtime payloads and require text prompts to be strings. If a Strands app accepts a
27
+ caller-supplied message history, normalize the history tail with `strip_trailing_tool_use()` before invocation.
26
28
 
27
29
  ## Directory Structure
28
30
 
@@ -36,8 +38,7 @@ myProject/
36
38
  │ ├── .llm-context/ # TypeScript type definitions for AI assistants
37
39
  │ │ ├── README.md # Guide to using schema files
38
40
  │ │ ├── agentcore.ts # AgentCoreProjectSpec types
39
- │ │ ├── aws-targets.ts # AWS deployment target types
40
- │ │ └── mcp.ts # Gateway and MCP tool types
41
+ │ │ └── aws-targets.ts # AWS deployment target types
41
42
  │ └── cdk/ # AWS CDK project (@aws/agentcore-cdk L3 constructs)
42
43
  ├── app/ # Agent application code
43
44
  └── evaluators/ # Custom evaluator code (if any)
@@ -51,18 +52,25 @@ file maps to a JSON config file and includes validation constraints as comments
51
52
  | JSON Config | Schema File | Root Type |
52
53
  | --- | --- | --- |
53
54
  | `agentcore/agentcore.json` | `agentcore/.llm-context/agentcore.ts` | `AgentCoreProjectSpec` |
54
- | `agentcore/agentcore.json` (gateways) | `agentcore/.llm-context/mcp.ts` | `AgentCoreMcpSpec` |
55
55
  | `agentcore/aws-targets.json` | `agentcore/.llm-context/aws-targets.ts` | `AwsDeploymentTarget[]` |
56
56
 
57
57
  ### Key Types
58
58
 
59
- - **AgentCoreProjectSpec**: Root config with `runtimes`, `memories`, `credentials`, `agentCoreGateways`, `evaluators`, `onlineEvalConfigs`, `policyEngines` arrays
59
+ - **AgentCoreProjectSpec**: Root config with runtimes, memories, knowledge bases, credentials, evaluators, online evals and insights, gateways, policy engines, config bundles, A/B tests, harness registrations, datasets, payment managers, and capacity providers
60
60
  - **AgentEnvSpec**: Agent configuration (build type, entrypoint, code location, runtime version, network mode)
61
61
  - **Memory**: Memory resource with strategies (SEMANTIC, SUMMARIZATION, USER_PREFERENCE, EPISODIC) and expiry
62
62
  - **Credential**: API key or OAuth credential provider
63
- - **AgentCoreGateway**: MCP gateway with targets (Lambda, MCP server, OpenAPI, Smithy, API Gateway)
63
+ - **AgentCoreGateway**: MCP gateway with targets (Lambda, MCP server, OpenAPI, Smithy, API Gateway, web-search, knowledge-base)
64
64
  - **Evaluator**: LLM-as-a-Judge or code-based evaluator
65
65
  - **OnlineEvalConfig**: Continuous evaluation pipeline bound to an agent
66
+ - **OnlineInsightsConfig** _[preview]_: Continuous failure-pattern analysis bound to an agent
67
+ - **KnowledgeBase**: Managed Bedrock Knowledge Base auto-wired to a gateway
68
+ - **Harness**: Declarative agent — runtime + tools + skills + memory + observability without writing agent code
69
+ - **PolicyEngine** + **Policy**: Cedar policy engine with form-based guardrails (Bedrock content filters, prompt-attack, sensitive-info) or raw Cedar policies
70
+ - **PaymentManager** + **PaymentConnector**: x402-protocol payment orchestration with provider credentials (CoinbaseCDP, StripePrivy)
71
+ - **ConfigBundle**: Versioned runtime configuration as a separately-deployable resource
72
+ - **Dataset**: Curated session dataset for batch evaluation and recommendation runs
73
+ - **RuntimeEndpoint**: Named endpoint (e.g. `PROMPT_V1`) targeting a specific runtime version
66
74
 
67
75
  ### Common Enum Values
68
76
 
@@ -70,8 +78,11 @@ file maps to a JSON config file and includes validation constraints as comments
70
78
  - **NetworkMode**: `'PUBLIC'` | `'VPC'`
71
79
  - **RuntimeVersion**: `'PYTHON_3_10'` | `'PYTHON_3_11'` | `'PYTHON_3_12'` | `'PYTHON_3_13'` | `'PYTHON_3_14'` | `'NODE_18'` | `'NODE_20'` | `'NODE_22'`
72
80
  - **MemoryStrategyType**: `'SEMANTIC'` | `'SUMMARIZATION'` | `'USER_PREFERENCE'` | `'EPISODIC'`
73
- - **GatewayTargetType**: `'lambda'` | `'mcpServer'` | `'openApiSchema'` | `'smithyModel'` | `'apiGateway'` | `'lambdaFunctionArn'`
81
+ - **GatewayTargetType**: `'lambda'` | `'mcpServer'` | `'openApiSchema'` | `'smithyModel'` | `'apiGateway'` | `'lambdaFunctionArn'` | `'connector'` (web-search, bedrock-knowledge-bases)
74
82
  - **ModelProvider**: `'Bedrock'` | `'Gemini'` | `'OpenAI'` | `'Anthropic'`
83
+ - **PaymentProvider**: `'CoinbaseCDP'` | `'StripePrivy'`
84
+ - **PolicyEnforcementMode**: `'ACTIVE'` | `'PASSIVE'`
85
+ - **GuardrailContentFilter**: `'VIOLENCE'` | `'HATE'` | `'SEXUAL'` | `'MISCONDUCT'` | `'INSULTS'`
75
86
 
76
87
  ### Build Types
77
88
 
@@ -122,20 +133,86 @@ When modifying JSON config files:
122
133
  4. Use CloudFormation-safe names (alphanumeric, start with letter)
123
134
  5. Run `agentcore validate` to verify changes
124
135
 
136
+ ## Harness Export
137
+
138
+ `agentcore export harness` converts a harness configuration into a deployable Strands Python agent under `app/<agentName>/`.
139
+
140
+ **After every export, you MUST read `app/<agentName>/EXPORT_NOTES.md` before proceeding.**
141
+
142
+ This file lists any manual follow-up items required before the agent will deploy or run correctly — missing files to create, IAM policies to add, or configuration steps the exporter could not automate. A clean export produces "No manual steps required." Complete every item in the file before running `agentcore deploy`.
143
+
144
+ ```bash
145
+ agentcore export harness --name <harnessName> # generates app/<agentName>/EXPORT_NOTES.md
146
+ cat app/<agentName>/EXPORT_NOTES.md # read this before touching anything else
147
+ ```
148
+
125
149
  ## CLI Commands
126
150
 
151
+ Run `agentcore --help` or `agentcore <command> --help` for full flags. Commonly used:
152
+
153
+ **Project lifecycle**
154
+
127
155
  | Command | Description |
128
156
  | --- | --- |
129
157
  | `agentcore create` | Create a new project |
130
- | `agentcore add <resource>` | Add agent, memory, credential, gateway, evaluator, policy |
131
- | `agentcore remove <resource>` | Remove a resource |
132
158
  | `agentcore dev` | Run agent locally with hot-reload |
133
159
  | `agentcore deploy` | Deploy to AWS |
134
- | `agentcore status` | Show deployment status |
135
160
  | `agentcore invoke` | Invoke agent (local or deployed) |
136
- | `agentcore logs` | View agent logs |
137
- | `agentcore traces` | View agent traces |
138
- | `agentcore eval` | Run evaluations against an agent |
139
- | `agentcore package` | Package agent artifacts |
161
+ | `agentcore capacity-provider delete-session` | Delete (deprovision) a live capacity provider session |
162
+ | `agentcore status` | Show deployment status |
140
163
  | `agentcore validate` | Validate configuration |
141
- | `agentcore pause` / `resume` | Pause or resume a deployed agent |
164
+ | `agentcore package` | Package agent artifacts |
165
+ | `agentcore import` | Import resources from a Bedrock AgentCore Starter Toolkit project |
166
+
167
+ **Resources**
168
+
169
+ | Command | Description |
170
+ | --- | --- |
171
+ | `agentcore add <resource>` | Add agent, memory, credential, gateway, gateway-target, evaluator, online-eval, online-insights, knowledge-base, harness, policy-engine, policy, payment-manager, payment-connector, capacity-provider, config-bundle, dataset, runtime-endpoint |
172
+ | `agentcore remove <resource>` | Remove any resource |
173
+ | `agentcore export harness` | Export a harness to a Strands runtime agent under `app/<agentName>/` |
174
+
175
+ **Jobs (run, view, archive, lifecycle)**
176
+
177
+ | Command | Description |
178
+ | --- | --- |
179
+ | `agentcore run eval` | Run on-demand evaluation against agent traces |
180
+ | `agentcore run batch-evaluation` | Run evaluators across all sessions at scale |
181
+ | `agentcore run recommendation` | Optimize prompts or tool descriptions from real traces |
182
+ | `agentcore run insights` _[preview]_ | Run failure-pattern analysis across sessions |
183
+ | `agentcore run ab-test` | Start an A/B test (config-bundle or target-based) |
184
+ | `agentcore run ingest` | Start a fresh ingestion job for every data source on a deployed knowledge base |
185
+ | `agentcore view <type>` | List or view jobs (recommendation, batch-evaluation, ab-test, insights) |
186
+ | `agentcore archive <type>` | Delete a job on the service + clear local history |
187
+ | `agentcore stop <type>` | Stop a running batch-evaluation or ab-test |
188
+ | `agentcore promote ab-test` | Apply the winning variant to `agentcore.json` |
189
+ | `agentcore pause <type>` / `agentcore resume <type>` | Pause/resume a deployed online-eval, online-insights, or ab-test |
190
+
191
+ **Config bundles & datasets**
192
+
193
+ | Command | Description |
194
+ | --- | --- |
195
+ | `agentcore config-bundle versions` (alias `cb versions`) | List version history for a bundle |
196
+ | `agentcore config-bundle diff` | Diff two versions of a bundle |
197
+ | `agentcore config-bundle create-branch` | Create a new branch on an existing bundle |
198
+ | `agentcore dataset download` | Download a dataset version locally |
199
+ | `agentcore dataset publish-version` | Publish a new dataset version |
200
+ | `agentcore dataset remove-version` | Remove a dataset version |
201
+
202
+ **Observability & history**
203
+
204
+ | Command | Description |
205
+ | --- | --- |
206
+ | `agentcore logs` | Stream/search agent runtime logs |
207
+ | `agentcore logs evals` | Stream/search online-eval logs |
208
+ | `agentcore traces list` / `agentcore traces get` | List recent traces or download one to JSON |
209
+ | `agentcore evals history` | View past on-demand eval results |
210
+
211
+ **Utilities**
212
+
213
+ | Command | Description |
214
+ | --- | --- |
215
+ | `agentcore fetch access` | Fetch access info for deployed gateway or agent |
216
+ | `agentcore feedback` | Send feedback (with optional screenshot) to the AgentCore team |
217
+ | `agentcore update` | Check for and install CLI updates |
218
+ | `agentcore telemetry` | View or change telemetry preferences |
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { AgentCoreStack } from '../lib/cdk-stack';
3
- import { ConfigIO, type AwsDeploymentTarget } from '@aws/agentcore-cdk';
2
+ import { AgentCoreStack, type HarnessConfig } from '../lib/cdk-stack';
3
+ import { ConfigIO, HarnessSpecSchema, type AwsDeploymentTarget } from '@aws/agentcore-cdk';
4
4
  import { App, type Environment } from 'aws-cdk-lib';
5
5
  import * as path from 'path';
6
6
  import * as fs from 'fs';
@@ -28,12 +28,14 @@ async function main() {
28
28
  const spec = await configIO.readProjectSpec();
29
29
  const targets = await configIO.readAWSDeploymentTargets();
30
30
 
31
- // Extract MCP configuration from project spec.
32
- // Gateway fields are stored in agentcore.json but may not yet be on the
33
- // AgentCoreProjectSpec type from @aws/agentcore-cdk, so we read them
34
- // dynamically and cast the resulting object.
31
+ // The vended CDK project compiles against the published @aws/agentcore-cdk
32
+ // schema type, which may lag the CLI's own AgentCoreProjectSpec (e.g. payments,
33
+ // harnesses, gateway fields). Cast once so those fields are reachable.
35
34
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
35
  const specAny = spec as any;
36
+
37
+ // Extract MCP configuration from project spec.
38
+ // Gateway fields are stored in agentcore.json but may not yet be on the
37
39
  const mcpSpec = specAny.agentCoreGateways?.length
38
40
  ? {
39
41
  agentCoreGateways: specAny.agentCoreGateways,
@@ -54,37 +56,55 @@ async function main() {
54
56
  throw new Error('No deployment targets configured. Please define targets in agentcore/aws-targets.json');
55
57
  }
56
58
 
57
- // Read harness configs for role creation.
58
- // Harness fields may not yet be on the AgentCoreProjectSpec type from @aws/agentcore-cdk,
59
- // so we read them dynamically via specAny (same pattern as gateways above).
60
- // Harness paths in agentcore.json are relative to the project root (parent of agentcore/).
59
+ // Read harness configs: the full validated spec drives the CFN resource; the
60
+ // role-scoped fields drive the IAM role + container build.
61
61
  const projectRoot = path.resolve(configRoot, '..');
62
- const harnessConfigs: {
63
- name: string;
64
- executionRoleArn?: string;
65
- memoryName?: string;
66
- containerUri?: string;
67
- hasDockerfile?: boolean;
68
- dockerfile?: string;
69
- codeLocation?: string;
70
- tools?: { type: string; name: string }[];
71
- apiKeyArn?: string;
72
- }[] = [];
62
+
63
+ // Read non-S3 KB connector-config files and pass their parsed contents to the
64
+ // L3 verbatim. The L3 does not read files; it expects the parsed
65
+ // connectorParameters keyed by the data source's connectorConfigFile path.
66
+ const connectorParametersByFile: Record<string, Record<string, unknown>> = {};
67
+ for (const kb of specAny.knowledgeBases ?? []) {
68
+ for (const ds of kb.dataSources ?? []) {
69
+ if (ds.type !== 'S3' && ds.connectorConfigFile) {
70
+ const abs = path.resolve(projectRoot, ds.connectorConfigFile);
71
+ try {
72
+ connectorParametersByFile[ds.connectorConfigFile] = JSON.parse(fs.readFileSync(abs, 'utf-8'));
73
+ } catch (err) {
74
+ throw new Error(
75
+ `Could not read connector config '${ds.connectorConfigFile}' for knowledge base '${kb.name}' at ${abs}: ${err instanceof Error ? err.message : err}`
76
+ );
77
+ }
78
+ }
79
+ }
80
+ }
81
+
82
+ // Synthesize an AWS::BedrockAgentCore::Harness resource for each harness entry in the spec.
83
+ const harnessConfigs: HarnessConfig[] = [];
73
84
  for (const entry of specAny.harnesses ?? []) {
74
85
  const harnessDir = path.resolve(projectRoot, entry.path);
75
86
  const harnessPath = path.resolve(harnessDir, 'harness.json');
76
87
  try {
77
- const harnessSpec = JSON.parse(fs.readFileSync(harnessPath, 'utf-8'));
88
+ const harnessSpec = HarnessSpecSchema.parse(JSON.parse(fs.readFileSync(harnessPath, 'utf-8')));
78
89
  harnessConfigs.push({
79
90
  name: entry.name,
80
91
  executionRoleArn: harnessSpec.executionRoleArn,
81
- memoryName: harnessSpec.memory?.name,
92
+ // Only an `existing` memory ref carries a name to wire IAM against; managed memory is
93
+ // owned by the harness (no sibling) and disabled has none — both resolve to undefined.
94
+ memoryName: harnessSpec.memory?.mode === 'existing' ? harnessSpec.memory.name : undefined,
82
95
  containerUri: harnessSpec.containerUri,
83
96
  hasDockerfile: !!harnessSpec.dockerfile,
84
97
  dockerfile: harnessSpec.dockerfile,
85
98
  codeLocation: harnessSpec.dockerfile ? harnessDir : undefined,
86
99
  tools: harnessSpec.tools,
100
+ skills: harnessSpec.skills,
87
101
  apiKeyArn: harnessSpec.model?.apiKeyArn,
102
+ efsAccessPoints: harnessSpec.efsAccessPoints,
103
+ s3AccessPoints: harnessSpec.s3AccessPoints,
104
+ apiFormat: harnessSpec.model?.apiFormat,
105
+ // Full spec + dir drive the AWS::BedrockAgentCore::Harness CFN resource.
106
+ spec: harnessSpec,
107
+ harnessDir,
88
108
  });
89
109
  } catch (err) {
90
110
  throw new Error(
@@ -108,11 +128,76 @@ async function main() {
108
128
  | Record<string, { credentialProviderArn: string; clientSecretArn?: string }>
109
129
  | undefined;
110
130
 
131
+ // Payment credential provider ARNs live in the same credentials map as identity credentials
132
+ const paymentCredentials = credentials;
133
+
134
+ const paymentSpec = specAny.payments?.length
135
+ ? specAny.payments.map(
136
+ (p: {
137
+ name: string;
138
+ description?: string;
139
+ authorizerType: 'AWS_IAM' | 'CUSTOM_JWT';
140
+ authorizerConfiguration?: unknown;
141
+ autoPayment?: boolean;
142
+ paymentToolAllowlist?: string[];
143
+ networkPreferences?: string[];
144
+ connectors: {
145
+ name: string;
146
+ provider?: string;
147
+ provisionMode?: 'MANUAL' | 'QUICK_CREATE';
148
+ credentialName?: string;
149
+ }[];
150
+ }) => ({
151
+ name: p.name,
152
+ description: p.description,
153
+ authorizerType: p.authorizerType,
154
+ authorizerConfiguration: p.authorizerConfiguration,
155
+ autoPayment: p.autoPayment,
156
+ paymentToolAllowlist: p.paymentToolAllowlist,
157
+ networkPreferences: p.networkPreferences,
158
+ connectors: p.connectors.map(c => {
159
+ if (c.provisionMode === 'QUICK_CREATE') {
160
+ return {
161
+ name: c.name,
162
+ provider: 'CoinbaseCDP' as const,
163
+ provisionMode: 'QUICK_CREATE' as const,
164
+ };
165
+ }
166
+
167
+ if (!c.credentialName) {
168
+ throw new Error(
169
+ `Manual payment connector "${c.name}" on manager "${p.name}" is missing its credential name.`
170
+ );
171
+ }
172
+ const credentialProviderArn = paymentCredentials?.[c.credentialName]?.credentialProviderArn;
173
+ if (!credentialProviderArn) {
174
+ // Fail fast with an actionable message rather than passing an empty
175
+ // ARN that fails opaquely server-side at CreatePaymentConnector.
176
+ throw new Error(
177
+ `Payment connector "${c.name}" on manager "${p.name}" references credential ` +
178
+ `"${c.credentialName}", but no deployed credential provider was found for it. ` +
179
+ `Run \`agentcore deploy\` so the credential provider is created first.`
180
+ );
181
+ }
182
+ return {
183
+ name: c.name,
184
+ provider: c.provider,
185
+ ...(c.provisionMode && { provisionMode: c.provisionMode }),
186
+ credentialName: c.credentialName,
187
+ credentialProviderArn,
188
+ };
189
+ }),
190
+ })
191
+ )
192
+ : undefined;
193
+
111
194
  new AgentCoreStack(app, stackName, {
112
195
  spec,
113
196
  mcpSpec,
114
197
  credentials,
198
+ connectorParametersByFile,
115
199
  harnesses: harnessConfigs.length > 0 ? harnessConfigs : undefined,
200
+ paymentSpec,
116
201
  env,
117
202
  description: `AgentCore stack for ${spec.name} deployed to ${target.name} (${target.region})`,
118
203
  tags: {
@@ -127,5 +212,5 @@ async function main() {
127
212
 
128
213
  main().catch((error: unknown) => {
129
214
  console.error('AgentCore CDK synthesis failed:', error instanceof Error ? error.message : error);
130
- process.exitCode = 1;
215
+ process.exit(1);
131
216
  });