@aws/agentcore 1.0.0-preview.8 → 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +978 -145
- package/dist/assets/agent-inspector/index.css.asset +1 -0
- package/dist/assets/agent-inspector/index.js.asset +289 -0
- package/dist/assets/cdk/README.md +3 -0
- package/dist/assets/cdk/bin/cdk.ts +109 -59
- package/dist/assets/cdk/lib/cdk-stack.ts +30 -19
- package/dist/assets/cdk/package.json +9 -9
- package/dist/assets/cdk/test/cdk.test.ts +94 -2
- package/dist/assets/evaluators/autoevals-lambda/README.md +23 -0
- package/dist/assets/evaluators/autoevals-lambda/execution-role-policy.json +15 -0
- package/dist/assets/evaluators/autoevals-lambda/lambda_function.py +37 -0
- package/dist/assets/evaluators/autoevals-lambda/pyproject.toml +23 -0
- package/dist/assets/evaluators/deepeval-lambda/README.md +23 -0
- package/dist/assets/evaluators/deepeval-lambda/execution-role-policy.json +15 -0
- package/dist/assets/evaluators/deepeval-lambda/lambda_function.py +29 -0
- package/dist/assets/evaluators/deepeval-lambda/pyproject.toml +22 -0
- package/dist/assets/evaluators/python-lambda/README.md +28 -0
- package/dist/assets/evaluators/python-lambda/pyproject.toml +1 -1
- package/dist/assets/templates/a2a-python-strands/README.md +31 -0
- package/dist/assets/templates/a2a-python-strands/main.py +100 -0
- package/dist/assets/templates/a2a-python-strands/memory/session.py +35 -0
- package/dist/assets/templates/a2a-python-strands/model/load.py +6 -0
- package/dist/assets/templates/a2a-python-strands/pyproject.toml +20 -0
- package/dist/assets/templates/agent-python-langchain/README.md +55 -0
- package/dist/assets/{python/a2a/googleadk/base → templates/agent-python-langchain}/gitignore.template +1 -1
- package/dist/assets/templates/agent-python-langchain/main.py +54 -0
- package/dist/assets/templates/agent-python-langchain/model/load.py +9 -0
- package/dist/assets/templates/agent-python-langchain/pyproject.toml +21 -0
- package/dist/assets/templates/agent-python-minimal/README.md +31 -0
- package/dist/assets/templates/agent-python-minimal/main.py +13 -0
- package/dist/assets/templates/agent-python-minimal/pyproject.toml +18 -0
- package/dist/assets/{container/python/Dockerfile → templates/agent-python-strands/Dockerfile.template} +3 -1
- package/dist/assets/templates/agent-python-strands/README.md +46 -0
- package/dist/assets/{python/a2a/langchain_langgraph/base → templates/agent-python-strands}/gitignore.template +1 -1
- package/dist/assets/templates/agent-python-strands/main.py +106 -0
- package/dist/assets/templates/agent-python-strands/memory/__init__.py +0 -0
- package/dist/assets/templates/agent-python-strands/memory/session.py +35 -0
- package/dist/assets/{python/http/strands/base → templates/agent-python-strands}/model/load.py +46 -0
- package/dist/assets/templates/agent-python-strands/pyproject.toml +24 -0
- package/dist/assets/templates/agent-typescript-strands/README.md +29 -0
- package/dist/assets/templates/agent-typescript-strands/gitignore.template +22 -0
- package/dist/assets/templates/agent-typescript-strands/main.ts +86 -0
- package/dist/assets/templates/agent-typescript-strands/mcp_client/client.ts +11 -0
- package/dist/assets/templates/agent-typescript-strands/memory/memory.ts +44 -0
- package/dist/assets/templates/agent-typescript-strands/model/load.ts +5 -0
- package/dist/assets/templates/agent-typescript-strands/package.json.template +29 -0
- package/dist/assets/templates/agent-typescript-strands/tsconfig.json +19 -0
- package/dist/assets/templates/agent-typescript-vercel/README.md +22 -0
- package/dist/assets/templates/agent-typescript-vercel/gitignore.template +22 -0
- package/dist/assets/templates/agent-typescript-vercel/main.ts +35 -0
- package/dist/assets/templates/agent-typescript-vercel/package.json.template +24 -0
- package/dist/assets/templates/agent-typescript-vercel/tsconfig.json +19 -0
- package/dist/assets/templates/agui-python-strands/README.md +39 -0
- package/dist/assets/{python/a2a/strands/base → templates/agui-python-strands}/gitignore.template +1 -1
- package/dist/assets/{python/agui/strands/base → templates/agui-python-strands}/main.py +11 -14
- package/dist/assets/templates/agui-python-strands/memory/__init__.py +0 -0
- package/dist/assets/templates/agui-python-strands/memory/session.py +35 -0
- package/dist/assets/templates/agui-python-strands/model/load.py +6 -0
- package/dist/assets/templates/agui-python-strands/pyproject.toml +22 -0
- package/dist/assets/{python/http/strands/base → templates/export-harness-python}/README.md +15 -8
- package/dist/assets/templates/export-harness-python/gitignore.template +41 -0
- package/dist/assets/templates/export-harness-python/main.py +584 -0
- package/dist/assets/templates/export-harness-python/mcp_client/client.py +63 -0
- package/dist/assets/templates/export-harness-python/memory/__init__.py +0 -0
- package/dist/assets/templates/export-harness-python/memory/session.py +47 -0
- package/dist/assets/templates/export-harness-python/model/load.py +249 -0
- package/dist/assets/templates/export-harness-python/model/mantle_compat.py +21 -0
- package/dist/assets/templates/export-harness-python/pyproject.toml +22 -0
- package/dist/assets/templates/export-harness-python/skills/fetcher.py +279 -0
- package/dist/assets/templates/mcp-python-fastmcp/README.md +32 -0
- package/dist/assets/templates/mcp-python-fastmcp/gitignore.template +41 -0
- package/dist/assets/templates/mcp-python-fastmcp/main.py +83 -0
- package/dist/assets/{python/mcp/standalone/base → templates/mcp-python-fastmcp}/pyproject.toml +3 -2
- package/dist/assets/templates/shared/env.local.template +11 -0
- package/dist/assets/templates/shared/gitignore.template +19 -0
- package/dist/index.js +4 -27
- package/dist/main.js +1190 -0
- package/package.json +75 -149
- package/LICENSE +0 -175
- package/dist/agent-inspector/index.css +0 -1
- package/dist/agent-inspector/index.js +0 -279
- package/dist/assets/README.md +0 -104
- package/dist/assets/__tests__/__snapshots__/assets.snapshot.test.ts.snap +0 -5673
- package/dist/assets/__tests__/__snapshots__/dockerfile-render.test.ts.snap +0 -77
- package/dist/assets/__tests__/assets.snapshot.test.ts +0 -125
- package/dist/assets/__tests__/dockerfile-render.test.ts +0 -24
- package/dist/assets/agents/AGENTS.md +0 -141
- package/dist/assets/harness/invoke.py.template +0 -74
- package/dist/assets/mcp/python/README.md +0 -27
- package/dist/assets/mcp/python/pyproject.toml +0 -22
- package/dist/assets/mcp/python/server.py +0 -117
- package/dist/assets/mcp/python-lambda/README.md +0 -22
- package/dist/assets/mcp/python-lambda/handler.py +0 -144
- package/dist/assets/mcp/python-lambda/pyproject.toml +0 -15
- package/dist/assets/python/a2a/googleadk/base/README.md +0 -22
- package/dist/assets/python/a2a/googleadk/base/main.py +0 -110
- package/dist/assets/python/a2a/googleadk/base/model/load.py +0 -41
- package/dist/assets/python/a2a/googleadk/base/pyproject.toml +0 -20
- package/dist/assets/python/a2a/langchain_langgraph/base/README.md +0 -22
- package/dist/assets/python/a2a/langchain_langgraph/base/main.py +0 -130
- package/dist/assets/python/a2a/langchain_langgraph/base/model/load.py +0 -123
- package/dist/assets/python/a2a/langchain_langgraph/base/pyproject.toml +0 -25
- package/dist/assets/python/a2a/strands/base/README.md +0 -22
- package/dist/assets/python/a2a/strands/base/main.py +0 -107
- package/dist/assets/python/a2a/strands/base/model/load.py +0 -123
- package/dist/assets/python/a2a/strands/base/pyproject.toml +0 -23
- package/dist/assets/python/a2a/strands/capabilities/memory/session.py +0 -43
- package/dist/assets/python/agui/googleadk/base/README.md +0 -30
- package/dist/assets/python/agui/googleadk/base/gitignore.template +0 -41
- package/dist/assets/python/agui/googleadk/base/main.py +0 -31
- package/dist/assets/python/agui/googleadk/base/model/load.py +0 -41
- package/dist/assets/python/agui/googleadk/base/pyproject.toml +0 -24
- package/dist/assets/python/agui/langchain_langgraph/base/README.md +0 -22
- package/dist/assets/python/agui/langchain_langgraph/base/gitignore.template +0 -41
- package/dist/assets/python/agui/langchain_langgraph/base/main.py +0 -74
- package/dist/assets/python/agui/langchain_langgraph/base/model/load.py +0 -123
- package/dist/assets/python/agui/langchain_langgraph/base/pyproject.toml +0 -30
- package/dist/assets/python/agui/strands/base/README.md +0 -22
- package/dist/assets/python/agui/strands/base/gitignore.template +0 -41
- package/dist/assets/python/agui/strands/base/model/__init__.py +0 -1
- package/dist/assets/python/agui/strands/base/model/load.py +0 -123
- package/dist/assets/python/agui/strands/base/pyproject.toml +0 -27
- package/dist/assets/python/agui/strands/capabilities/memory/__init__.py +0 -1
- package/dist/assets/python/agui/strands/capabilities/memory/session.py +0 -43
- package/dist/assets/python/http/autogen/base/README.md +0 -39
- package/dist/assets/python/http/autogen/base/gitignore.template +0 -41
- package/dist/assets/python/http/autogen/base/main.py +0 -112
- package/dist/assets/python/http/autogen/base/mcp_client/__init__.py +0 -1
- package/dist/assets/python/http/autogen/base/mcp_client/client.py +0 -28
- package/dist/assets/python/http/autogen/base/model/__init__.py +0 -1
- package/dist/assets/python/http/autogen/base/model/load.py +0 -136
- package/dist/assets/python/http/autogen/base/pyproject.toml +0 -34
- package/dist/assets/python/http/googleadk/base/README.md +0 -39
- package/dist/assets/python/http/googleadk/base/gitignore.template +0 -41
- package/dist/assets/python/http/googleadk/base/main.py +0 -160
- package/dist/assets/python/http/googleadk/base/mcp_client/__init__.py +0 -1
- package/dist/assets/python/http/googleadk/base/mcp_client/client.py +0 -75
- package/dist/assets/python/http/googleadk/base/model/__init__.py +0 -1
- package/dist/assets/python/http/googleadk/base/model/load.py +0 -41
- package/dist/assets/python/http/googleadk/base/pyproject.toml +0 -22
- package/dist/assets/python/http/langchain_langgraph/base/README.md +0 -39
- package/dist/assets/python/http/langchain_langgraph/base/gitignore.template +0 -41
- package/dist/assets/python/http/langchain_langgraph/base/main.py +0 -176
- package/dist/assets/python/http/langchain_langgraph/base/mcp_client/__init__.py +0 -1
- package/dist/assets/python/http/langchain_langgraph/base/mcp_client/client.py +0 -77
- package/dist/assets/python/http/langchain_langgraph/base/model/__init__.py +0 -1
- package/dist/assets/python/http/langchain_langgraph/base/model/load.py +0 -123
- package/dist/assets/python/http/langchain_langgraph/base/pyproject.toml +0 -37
- package/dist/assets/python/http/openaiagents/base/README.md +0 -39
- package/dist/assets/python/http/openaiagents/base/gitignore.template +0 -41
- package/dist/assets/python/http/openaiagents/base/main.py +0 -169
- package/dist/assets/python/http/openaiagents/base/mcp_client/__init__.py +0 -1
- package/dist/assets/python/http/openaiagents/base/mcp_client/client.py +0 -74
- package/dist/assets/python/http/openaiagents/base/model/__init__.py +0 -1
- package/dist/assets/python/http/openaiagents/base/model/load.py +0 -37
- package/dist/assets/python/http/openaiagents/base/pyproject.toml +0 -21
- package/dist/assets/python/http/strands/base/main.py +0 -217
- package/dist/assets/python/http/strands/base/mcp_client/__init__.py +0 -1
- package/dist/assets/python/http/strands/base/mcp_client/client.py +0 -73
- package/dist/assets/python/http/strands/base/model/__init__.py +0 -1
- package/dist/assets/python/http/strands/base/pyproject.toml +0 -25
- package/dist/assets/python/http/strands/capabilities/memory/__init__.py +0 -1
- package/dist/assets/python/http/strands/capabilities/memory/session.py +0 -44
- package/dist/assets/python/mcp/standalone/base/README.md +0 -36
- package/dist/assets/python/mcp/standalone/base/gitignore.template +0 -41
- package/dist/assets/python/mcp/standalone/base/main.py +0 -25
- package/dist/cli/index.mjs +0 -1718
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/constants.d.ts +0 -37
- package/dist/lib/constants.d.ts.map +0 -1
- package/dist/lib/constants.js +0 -69
- package/dist/lib/constants.js.map +0 -1
- package/dist/lib/errors/config.d.ts +0 -49
- package/dist/lib/errors/config.d.ts.map +0 -1
- package/dist/lib/errors/config.js +0 -170
- package/dist/lib/errors/config.js.map +0 -1
- package/dist/lib/errors/index.d.ts +0 -2
- package/dist/lib/errors/index.d.ts.map +0 -1
- package/dist/lib/errors/index.js +0 -18
- package/dist/lib/errors/index.js.map +0 -1
- package/dist/lib/index.d.ts +0 -7
- package/dist/lib/index.d.ts.map +0 -1
- package/dist/lib/index.js +0 -44
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/packaging/build-args.d.ts +0 -6
- package/dist/lib/packaging/build-args.d.ts.map +0 -1
- package/dist/lib/packaging/build-args.js +0 -18
- package/dist/lib/packaging/build-args.js.map +0 -1
- package/dist/lib/packaging/container.d.ts +0 -10
- package/dist/lib/packaging/container.d.ts.map +0 -1
- package/dist/lib/packaging/container.js +0 -78
- package/dist/lib/packaging/container.js.map +0 -1
- package/dist/lib/packaging/errors.d.ts +0 -16
- package/dist/lib/packaging/errors.d.ts.map +0 -1
- package/dist/lib/packaging/errors.js +0 -36
- package/dist/lib/packaging/errors.js.map +0 -1
- package/dist/lib/packaging/helpers.d.ts +0 -54
- package/dist/lib/packaging/helpers.d.ts.map +0 -1
- package/dist/lib/packaging/helpers.js +0 -463
- package/dist/lib/packaging/helpers.js.map +0 -1
- package/dist/lib/packaging/index.d.ts +0 -40
- package/dist/lib/packaging/index.d.ts.map +0 -1
- package/dist/lib/packaging/index.js +0 -98
- package/dist/lib/packaging/index.js.map +0 -1
- package/dist/lib/packaging/node.d.ts +0 -22
- package/dist/lib/packaging/node.d.ts.map +0 -1
- package/dist/lib/packaging/node.js +0 -109
- package/dist/lib/packaging/node.js.map +0 -1
- package/dist/lib/packaging/python.d.ts +0 -23
- package/dist/lib/packaging/python.d.ts.map +0 -1
- package/dist/lib/packaging/python.js +0 -165
- package/dist/lib/packaging/python.js.map +0 -1
- package/dist/lib/packaging/types/index.d.ts +0 -2
- package/dist/lib/packaging/types/index.d.ts.map +0 -1
- package/dist/lib/packaging/types/index.js +0 -3
- package/dist/lib/packaging/types/index.js.map +0 -1
- package/dist/lib/packaging/types/packaging.d.ts +0 -57
- package/dist/lib/packaging/types/packaging.d.ts.map +0 -1
- package/dist/lib/packaging/types/packaging.js +0 -3
- package/dist/lib/packaging/types/packaging.js.map +0 -1
- package/dist/lib/packaging/uv.d.ts +0 -7
- package/dist/lib/packaging/uv.d.ts.map +0 -1
- package/dist/lib/packaging/uv.js +0 -40
- package/dist/lib/packaging/uv.js.map +0 -1
- package/dist/lib/schemas/io/config-io.d.ts +0 -119
- package/dist/lib/schemas/io/config-io.d.ts.map +0 -1
- package/dist/lib/schemas/io/config-io.js +0 -323
- package/dist/lib/schemas/io/config-io.js.map +0 -1
- package/dist/lib/schemas/io/global-config.d.ts +0 -33
- package/dist/lib/schemas/io/global-config.d.ts.map +0 -1
- package/dist/lib/schemas/io/global-config.js +0 -89
- package/dist/lib/schemas/io/global-config.js.map +0 -1
- package/dist/lib/schemas/io/index.d.ts +0 -3
- package/dist/lib/schemas/io/index.d.ts.map +0 -1
- package/dist/lib/schemas/io/index.js +0 -18
- package/dist/lib/schemas/io/index.js.map +0 -1
- package/dist/lib/schemas/io/path-resolver.d.ts +0 -119
- package/dist/lib/schemas/io/path-resolver.d.ts.map +0 -1
- package/dist/lib/schemas/io/path-resolver.js +0 -207
- package/dist/lib/schemas/io/path-resolver.js.map +0 -1
- package/dist/lib/utils/aws-account.d.ts +0 -7
- package/dist/lib/utils/aws-account.d.ts.map +0 -1
- package/dist/lib/utils/aws-account.js +0 -24
- package/dist/lib/utils/aws-account.js.map +0 -1
- package/dist/lib/utils/credentials.d.ts +0 -86
- package/dist/lib/utils/credentials.d.ts.map +0 -1
- package/dist/lib/utils/credentials.js +0 -153
- package/dist/lib/utils/credentials.js.map +0 -1
- package/dist/lib/utils/env.d.ts +0 -22
- package/dist/lib/utils/env.d.ts.map +0 -1
- package/dist/lib/utils/env.js +0 -65
- package/dist/lib/utils/env.js.map +0 -1
- package/dist/lib/utils/index.d.ts +0 -9
- package/dist/lib/utils/index.d.ts.map +0 -1
- package/dist/lib/utils/index.js +0 -27
- package/dist/lib/utils/index.js.map +0 -1
- package/dist/lib/utils/json-rpc.d.ts +0 -3
- package/dist/lib/utils/json-rpc.d.ts.map +0 -1
- package/dist/lib/utils/json-rpc.js +0 -27
- package/dist/lib/utils/json-rpc.js.map +0 -1
- package/dist/lib/utils/platform.d.ts +0 -63
- package/dist/lib/utils/platform.d.ts.map +0 -1
- package/dist/lib/utils/platform.js +0 -88
- package/dist/lib/utils/platform.js.map +0 -1
- package/dist/lib/utils/subprocess.d.ts +0 -29
- package/dist/lib/utils/subprocess.d.ts.map +0 -1
- package/dist/lib/utils/subprocess.js +0 -116
- package/dist/lib/utils/subprocess.js.map +0 -1
- package/dist/lib/utils/time-parser.d.ts +0 -11
- package/dist/lib/utils/time-parser.d.ts.map +0 -1
- package/dist/lib/utils/time-parser.js +0 -47
- package/dist/lib/utils/time-parser.js.map +0 -1
- package/dist/lib/utils/zod.d.ts +0 -14
- package/dist/lib/utils/zod.d.ts.map +0 -1
- package/dist/lib/utils/zod.js +0 -32
- package/dist/lib/utils/zod.js.map +0 -1
- package/dist/schema/constants.d.ts +0 -119
- package/dist/schema/constants.d.ts.map +0 -1
- package/dist/schema/constants.js +0 -170
- package/dist/schema/constants.js.map +0 -1
- package/dist/schema/index.d.ts +0 -4
- package/dist/schema/index.d.ts.map +0 -1
- package/dist/schema/index.js +0 -21
- package/dist/schema/index.js.map +0 -1
- package/dist/schema/schemas/agent-env.d.ts +0 -186
- package/dist/schema/schemas/agent-env.d.ts.map +0 -1
- package/dist/schema/schemas/agent-env.js +0 -240
- package/dist/schema/schemas/agent-env.js.map +0 -1
- package/dist/schema/schemas/agentcore-project.d.ts +0 -838
- package/dist/schema/schemas/agentcore-project.d.ts.map +0 -1
- package/dist/schema/schemas/agentcore-project.js +0 -335
- package/dist/schema/schemas/agentcore-project.js.map +0 -1
- package/dist/schema/schemas/auth.d.ts +0 -140
- package/dist/schema/schemas/auth.d.ts.map +0 -1
- package/dist/schema/schemas/auth.js +0 -114
- package/dist/schema/schemas/auth.js.map +0 -1
- package/dist/schema/schemas/aws-targets.d.ts +0 -71
- package/dist/schema/schemas/aws-targets.d.ts.map +0 -1
- package/dist/schema/schemas/aws-targets.js +0 -57
- package/dist/schema/schemas/aws-targets.js.map +0 -1
- package/dist/schema/schemas/deployed-state.d.ts +0 -725
- package/dist/schema/schemas/deployed-state.d.ts.map +0 -1
- package/dist/schema/schemas/deployed-state.js +0 -218
- package/dist/schema/schemas/deployed-state.js.map +0 -1
- package/dist/schema/schemas/index.d.ts +0 -9
- package/dist/schema/schemas/index.d.ts.map +0 -1
- package/dist/schema/schemas/index.js +0 -26
- package/dist/schema/schemas/index.js.map +0 -1
- package/dist/schema/schemas/mcp-defs.d.ts +0 -52
- package/dist/schema/schemas/mcp-defs.d.ts.map +0 -1
- package/dist/schema/schemas/mcp-defs.js +0 -50
- package/dist/schema/schemas/mcp-defs.js.map +0 -1
- package/dist/schema/schemas/mcp.d.ts +0 -820
- package/dist/schema/schemas/mcp.d.ts.map +0 -1
- package/dist/schema/schemas/mcp.js +0 -564
- package/dist/schema/schemas/mcp.js.map +0 -1
- package/dist/schema/schemas/primitives/ab-test.d.ts +0 -141
- package/dist/schema/schemas/primitives/ab-test.d.ts.map +0 -1
- package/dist/schema/schemas/primitives/ab-test.js +0 -97
- package/dist/schema/schemas/primitives/ab-test.js.map +0 -1
- package/dist/schema/schemas/primitives/config-bundle.d.ts +0 -31
- package/dist/schema/schemas/primitives/config-bundle.d.ts.map +0 -1
- package/dist/schema/schemas/primitives/config-bundle.js +0 -38
- package/dist/schema/schemas/primitives/config-bundle.js.map +0 -1
- package/dist/schema/schemas/primitives/evaluator.d.ts +0 -102
- package/dist/schema/schemas/primitives/evaluator.d.ts.map +0 -1
- package/dist/schema/schemas/primitives/evaluator.js +0 -84
- package/dist/schema/schemas/primitives/evaluator.js.map +0 -1
- package/dist/schema/schemas/primitives/harness.d.ts +0 -363
- package/dist/schema/schemas/primitives/harness.d.ts.map +0 -1
- package/dist/schema/schemas/primitives/harness.js +0 -261
- package/dist/schema/schemas/primitives/harness.js.map +0 -1
- package/dist/schema/schemas/primitives/http-gateway.d.ts +0 -21
- package/dist/schema/schemas/primitives/http-gateway.d.ts.map +0 -1
- package/dist/schema/schemas/primitives/http-gateway.js +0 -34
- package/dist/schema/schemas/primitives/http-gateway.js.map +0 -1
- package/dist/schema/schemas/primitives/index.d.ts +0 -15
- package/dist/schema/schemas/primitives/index.d.ts.map +0 -1
- package/dist/schema/schemas/primitives/index.js +0 -61
- package/dist/schema/schemas/primitives/index.js.map +0 -1
- package/dist/schema/schemas/primitives/memory.d.ts +0 -51
- package/dist/schema/schemas/primitives/memory.d.ts.map +0 -1
- package/dist/schema/schemas/primitives/memory.js +0 -73
- package/dist/schema/schemas/primitives/memory.js.map +0 -1
- package/dist/schema/schemas/primitives/online-eval-config.d.ts +0 -14
- package/dist/schema/schemas/primitives/online-eval-config.d.ts.map +0 -1
- package/dist/schema/schemas/primitives/online-eval-config.js +0 -30
- package/dist/schema/schemas/primitives/online-eval-config.js.map +0 -1
- package/dist/schema/schemas/primitives/policy.d.ts +0 -49
- package/dist/schema/schemas/primitives/policy.d.ts.map +0 -1
- package/dist/schema/schemas/primitives/policy.js +0 -62
- package/dist/schema/schemas/primitives/policy.js.map +0 -1
- package/dist/schema/schemas/primitives/tags.d.ts +0 -6
- package/dist/schema/schemas/primitives/tags.d.ts.map +0 -1
- package/dist/schema/schemas/primitives/tags.js +0 -27
- package/dist/schema/schemas/primitives/tags.js.map +0 -1
- package/dist/schema/schemas/zod-util.d.ts +0 -10
- package/dist/schema/schemas/zod-util.d.ts.map +0 -1
- package/dist/schema/schemas/zod-util.js +0 -23
- package/dist/schema/schemas/zod-util.js.map +0 -1
- package/dist/schema/types/index.d.ts +0 -2
- package/dist/schema/types/index.d.ts.map +0 -1
- package/dist/schema/types/index.js +0 -18
- package/dist/schema/types/index.js.map +0 -1
- package/dist/schema/types/path.d.ts +0 -27
- package/dist/schema/types/path.d.ts.map +0 -1
- package/dist/schema/types/path.js +0 -13
- package/dist/schema/types/path.js.map +0 -1
- package/scripts/bump-version.ts +0 -393
- package/scripts/bundle.mjs +0 -219
- package/scripts/check-old-cli.lib.mjs +0 -102
- package/scripts/check-old-cli.mjs +0 -10
- package/scripts/copy-assets.mjs +0 -64
- package/scripts/generate-schema.mjs +0 -40
- package/scripts/run-e2e-local.sh +0 -112
- package/scripts/start-tui-harness.sh +0 -90
- /package/dist/{agent-inspector/favicon.svg → assets/agent-inspector/favicon.svg.asset} +0 -0
- /package/dist/{agent-inspector/index.html → assets/agent-inspector/index.html.asset} +0 -0
- /package/dist/assets/{python/http/strands/base → templates/a2a-python-strands}/gitignore.template +0 -0
- /package/dist/assets/{typescript/.gitkeep → templates/a2a-python-strands/memory/__init__.py} +0 -0
- /package/dist/assets/{python/a2a/googleadk/base → templates/a2a-python-strands}/model/__init__.py +0 -0
- /package/dist/assets/{python/a2a/langchain_langgraph/base → templates/agent-python-langchain}/model/__init__.py +0 -0
- /package/dist/assets/{container/python → templates/agent-python-strands}/dockerignore.template +0 -0
- /package/dist/assets/{python/a2a/strands/base → templates/agent-python-strands}/model/__init__.py +0 -0
- /package/dist/assets/{python/a2a/strands/capabilities/memory → templates/agui-python-strands/model}/__init__.py +0 -0
- /package/dist/assets/{python/agui/googleadk/base/model → templates/export-harness-python/mcp_client}/__init__.py +0 -0
- /package/dist/assets/{python/agui/langchain_langgraph/base → templates/export-harness-python}/model/__init__.py +0 -0
|
@@ -20,6 +20,9 @@ This CDK project is managed by the AgentCore CLI. It deploys your agent infrastr
|
|
|
20
20
|
|
|
21
21
|
You typically don't need to interact with this directory directly. The AgentCore CLI handles synthesis and deployment:
|
|
22
22
|
|
|
23
|
+
<!-- TODO: revisit these commands once the project CLI surface is final —
|
|
24
|
+
they may need a project prefix (e.g. --project / cwd) to disambiguate. -->
|
|
25
|
+
|
|
23
26
|
```bash
|
|
24
27
|
agentcore deploy # synthesizes and deploys via CDK
|
|
25
28
|
agentcore status # checks deployment status
|
|
@@ -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';
|
|
@@ -20,71 +20,79 @@ function toStackName(projectName: string, targetName: string): string {
|
|
|
20
20
|
return `AgentCore-${sanitize(projectName)}-${sanitize(targetName)}`;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
// The vended CDK project compiles against the published @aws/agentcore-cdk schema
|
|
24
|
+
// type, which may lag the CLI's own AgentCoreProjectSpec (e.g. payments, harnesses,
|
|
25
|
+
// gateway fields). This alias documents each read of those not-yet-published fields.
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
|
+
type SpecWithLatestFields = any;
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
// AgentCoreProjectSpec type from @aws/agentcore-cdk, so we read them
|
|
34
|
-
// dynamically and cast the resulting object.
|
|
35
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
36
|
-
const specAny = spec as any;
|
|
37
|
-
const mcpSpec = specAny.agentCoreGateways?.length
|
|
29
|
+
// Extract MCP configuration from the project spec. Gateway fields are stored in
|
|
30
|
+
// agentcore.json but may not yet be on the published spec type, so they are read
|
|
31
|
+
// off the loosened alias.
|
|
32
|
+
function resolveMcpSpec(spec: SpecWithLatestFields) {
|
|
33
|
+
return spec.agentCoreGateways?.length
|
|
38
34
|
? {
|
|
39
|
-
agentCoreGateways:
|
|
40
|
-
mcpRuntimeTools:
|
|
41
|
-
unassignedTargets:
|
|
35
|
+
agentCoreGateways: spec.agentCoreGateways,
|
|
36
|
+
mcpRuntimeTools: spec.mcpRuntimeTools,
|
|
37
|
+
unassignedTargets: spec.unassignedTargets,
|
|
42
38
|
}
|
|
43
39
|
: undefined;
|
|
40
|
+
}
|
|
44
41
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
42
|
+
// Read non-S3 KB connector-config files and return their parsed contents keyed by
|
|
43
|
+
// the data source's connectorConfigFile path. The L3 does not read files; it
|
|
44
|
+
// expects these parsed connectorParameters verbatim.
|
|
45
|
+
function resolveConnectorParametersByFile(
|
|
46
|
+
spec: SpecWithLatestFields,
|
|
47
|
+
projectRoot: string
|
|
48
|
+
): Record<string, Record<string, unknown>> {
|
|
49
|
+
const connectorParametersByFile: Record<string, Record<string, unknown>> = {};
|
|
50
|
+
for (const kb of spec.knowledgeBases ?? []) {
|
|
51
|
+
for (const ds of kb.dataSources ?? []) {
|
|
52
|
+
if (ds.type !== 'S3' && ds.connectorConfigFile) {
|
|
53
|
+
const abs = path.resolve(projectRoot, ds.connectorConfigFile);
|
|
54
|
+
try {
|
|
55
|
+
connectorParametersByFile[ds.connectorConfigFile] = JSON.parse(fs.readFileSync(abs, 'utf-8'));
|
|
56
|
+
} catch (err) {
|
|
57
|
+
throw new Error(
|
|
58
|
+
`Could not read connector config '${ds.connectorConfigFile}' for knowledge base '${kb.name}' at ${abs}: ${err instanceof Error ? err.message : err}`
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
55
63
|
}
|
|
64
|
+
return connectorParametersByFile;
|
|
65
|
+
}
|
|
56
66
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
const
|
|
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
|
-
}[] = [];
|
|
73
|
-
for (const entry of specAny.harnesses ?? []) {
|
|
67
|
+
// Synthesize a HarnessConfig for each harness entry in the spec. The full validated
|
|
68
|
+
// spec drives the AWS::BedrockAgentCore::Harness CFN resource; the role-scoped
|
|
69
|
+
// fields drive the IAM role + container build.
|
|
70
|
+
function resolveHarnessConfigs(spec: SpecWithLatestFields, projectRoot: string): HarnessConfig[] {
|
|
71
|
+
const harnessConfigs: HarnessConfig[] = [];
|
|
72
|
+
for (const entry of spec.harnesses ?? []) {
|
|
74
73
|
const harnessDir = path.resolve(projectRoot, entry.path);
|
|
75
74
|
const harnessPath = path.resolve(harnessDir, 'harness.json');
|
|
76
75
|
try {
|
|
77
|
-
const harnessSpec = JSON.parse(fs.readFileSync(harnessPath, 'utf-8'));
|
|
76
|
+
const harnessSpec = HarnessSpecSchema.parse(JSON.parse(fs.readFileSync(harnessPath, 'utf-8')));
|
|
78
77
|
harnessConfigs.push({
|
|
79
78
|
name: entry.name,
|
|
80
79
|
executionRoleArn: harnessSpec.executionRoleArn,
|
|
81
|
-
|
|
80
|
+
// Only an `existing` memory ref carries a name to wire IAM against; managed memory is
|
|
81
|
+
// owned by the harness (no sibling) and disabled has none — both resolve to undefined.
|
|
82
|
+
memoryName: harnessSpec.memory?.mode === 'existing' ? harnessSpec.memory.name : undefined,
|
|
82
83
|
containerUri: harnessSpec.containerUri,
|
|
83
84
|
hasDockerfile: !!harnessSpec.dockerfile,
|
|
84
85
|
dockerfile: harnessSpec.dockerfile,
|
|
85
86
|
codeLocation: harnessSpec.dockerfile ? harnessDir : undefined,
|
|
86
87
|
tools: harnessSpec.tools,
|
|
88
|
+
skills: harnessSpec.skills,
|
|
87
89
|
apiKeyArn: harnessSpec.model?.apiKeyArn,
|
|
90
|
+
efsAccessPoints: harnessSpec.efsAccessPoints,
|
|
91
|
+
s3AccessPoints: harnessSpec.s3AccessPoints,
|
|
92
|
+
apiFormat: harnessSpec.model?.apiFormat,
|
|
93
|
+
// Full spec + dir drive the AWS::BedrockAgentCore::Harness CFN resource.
|
|
94
|
+
spec: harnessSpec,
|
|
95
|
+
harnessDir,
|
|
88
96
|
});
|
|
89
97
|
} catch (err) {
|
|
90
98
|
throw new Error(
|
|
@@ -92,32 +100,74 @@ async function main() {
|
|
|
92
100
|
);
|
|
93
101
|
}
|
|
94
102
|
}
|
|
103
|
+
return harnessConfigs;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
async function main() {
|
|
107
|
+
// Config root is parent of cdk/ directory. The CLI sets process.cwd() to agentcore/cdk/.
|
|
108
|
+
const configRoot = path.resolve(process.cwd(), '..');
|
|
109
|
+
const configIO = new ConfigIO({ baseDir: configRoot });
|
|
110
|
+
|
|
111
|
+
const spec = await configIO.readProjectSpec();
|
|
112
|
+
const targets = await configIO.readAWSDeploymentTargets();
|
|
113
|
+
|
|
114
|
+
// `project build` runs before a project has anywhere to deploy, so an empty target
|
|
115
|
+
// list is not an error: it synthesizes a single environment-agnostic stack, which is
|
|
116
|
+
// enough to typecheck the app and produce a template. Only a stack synthesized for a
|
|
117
|
+
// real target is a deploy candidate; the target tag below is what marks one.
|
|
118
|
+
const stackTargets: (AwsDeploymentTarget | undefined)[] = targets.length > 0 ? targets : [undefined];
|
|
119
|
+
|
|
120
|
+
const specAny: SpecWithLatestFields = spec;
|
|
121
|
+
const projectRoot = path.resolve(configRoot, '..');
|
|
122
|
+
|
|
123
|
+
const mcpSpec = resolveMcpSpec(specAny);
|
|
124
|
+
const connectorParametersByFile = resolveConnectorParametersByFile(specAny, projectRoot);
|
|
125
|
+
const harnessConfigs = resolveHarnessConfigs(specAny, projectRoot);
|
|
126
|
+
|
|
127
|
+
// Read deployed state for credential ARNs (populated by pre-deploy identity setup).
|
|
128
|
+
// Under agentcore/.cli/ to match the released CLI's location.
|
|
129
|
+
let deployedState: Record<string, unknown> | undefined;
|
|
130
|
+
try {
|
|
131
|
+
deployedState = JSON.parse(fs.readFileSync(path.join(configRoot, '.cli', 'deployed-state.json'), 'utf8'));
|
|
132
|
+
} catch (err) {
|
|
133
|
+
// A missing file is the normal first-deploy case. A malformed one is not:
|
|
134
|
+
// surface it rather than silently synthesizing without the credential ARNs
|
|
135
|
+
// it holds (which would drop them from the stack).
|
|
136
|
+
if ((err as NodeJS.ErrnoException).code !== 'ENOENT') throw err;
|
|
137
|
+
}
|
|
95
138
|
|
|
96
139
|
const app = new App();
|
|
97
140
|
|
|
98
|
-
for (const target of
|
|
99
|
-
|
|
100
|
-
|
|
141
|
+
for (const target of stackTargets) {
|
|
142
|
+
// An environment-agnostic stack resolves its account and region from CloudFormation
|
|
143
|
+
// pseudo-parameters at deploy time instead of pinning them at synth time.
|
|
144
|
+
const env = target ? toEnvironment(target) : undefined;
|
|
145
|
+
const stackName = target ? toStackName(spec.name, target.name) : `AgentCore-${sanitize(spec.name)}`;
|
|
101
146
|
|
|
102
147
|
// Extract credentials from deployed state for this target
|
|
103
148
|
const targetState = (deployedState as Record<string, unknown>)?.targets as
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
149
|
+
Record<string, Record<string, unknown>> | undefined;
|
|
150
|
+
const targetResources = target
|
|
151
|
+
? (targetState?.[target.name]?.resources as Record<string, unknown> | undefined)
|
|
152
|
+
: undefined;
|
|
107
153
|
const credentials = targetResources?.credentials as
|
|
108
|
-
|
|
109
|
-
| undefined;
|
|
154
|
+
Record<string, { credentialProviderArn: string; clientSecretArn?: string }> | undefined;
|
|
110
155
|
|
|
111
156
|
new AgentCoreStack(app, stackName, {
|
|
112
157
|
spec,
|
|
113
158
|
mcpSpec,
|
|
114
159
|
credentials,
|
|
160
|
+
connectorParametersByFile,
|
|
115
161
|
harnesses: harnessConfigs.length > 0 ? harnessConfigs : undefined,
|
|
116
162
|
env,
|
|
117
|
-
description:
|
|
163
|
+
description: target
|
|
164
|
+
? `AgentCore stack for ${spec.name} deployed to ${target.name} (${target.region})`
|
|
165
|
+
: `AgentCore stack for ${spec.name} (no deployment target configured)`,
|
|
166
|
+
// Only a stack synthesized for a real target carries the target tag, which is
|
|
167
|
+
// how deploy selects the stack to ship.
|
|
118
168
|
tags: {
|
|
119
169
|
'agentcore:project-name': spec.name,
|
|
120
|
-
'agentcore:target-name': target.name,
|
|
170
|
+
...(target ? { 'agentcore:target-name': target.name } : {}),
|
|
121
171
|
},
|
|
122
172
|
});
|
|
123
173
|
}
|
|
@@ -127,5 +177,5 @@ async function main() {
|
|
|
127
177
|
|
|
128
178
|
main().catch((error: unknown) => {
|
|
129
179
|
console.error('AgentCore CDK synthesis failed:', error instanceof Error ? error.message : error);
|
|
130
|
-
process.
|
|
180
|
+
process.exit(1);
|
|
131
181
|
});
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentCoreApplication,
|
|
3
3
|
AgentCoreMcp,
|
|
4
|
+
AgentCorePayments,
|
|
4
5
|
type AgentCoreProjectSpec,
|
|
5
6
|
type AgentCoreMcpSpec,
|
|
7
|
+
type HarnessDeploymentConfig,
|
|
6
8
|
} from '@aws/agentcore-cdk';
|
|
7
9
|
import { CfnOutput, Stack, type StackProps } from 'aws-cdk-lib';
|
|
8
10
|
import { Construct } from 'constructs';
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
dockerfile?: string;
|
|
17
|
-
codeLocation?: string;
|
|
18
|
-
tools?: { type: string; name: string }[];
|
|
19
|
-
apiKeyArn?: string;
|
|
20
|
-
}
|
|
12
|
+
/**
|
|
13
|
+
* Harness deployment config: role-scoped fields (for IAM role + container build)
|
|
14
|
+
* plus the full validated spec + its config directory so the L3 construct can
|
|
15
|
+
* synthesize the AWS::BedrockAgentCore::Harness resource.
|
|
16
|
+
*/
|
|
17
|
+
export type HarnessConfig = HarnessDeploymentConfig;
|
|
21
18
|
|
|
22
19
|
export interface AgentCoreStackProps extends StackProps {
|
|
23
20
|
/**
|
|
@@ -33,13 +30,14 @@ export interface AgentCoreStackProps extends StackProps {
|
|
|
33
30
|
*/
|
|
34
31
|
credentials?: Record<string, { credentialProviderArn: string; clientSecretArn?: string }>;
|
|
35
32
|
/**
|
|
36
|
-
* Harness role configurations.
|
|
37
|
-
*
|
|
38
|
-
* When `hasDockerfile` is true and `codeLocation` is provided (without an explicit
|
|
39
|
-
* `containerUri`), the L3 construct builds and pushes a container image via CodeBuild
|
|
40
|
-
* and emits its URI as a stack output for the post-CDK harness deployer.
|
|
33
|
+
* Harness role configurations.
|
|
41
34
|
*/
|
|
42
35
|
harnesses?: HarnessConfig[];
|
|
36
|
+
/**
|
|
37
|
+
* Parsed connectorParameters for non-S3 KB data sources, keyed by
|
|
38
|
+
* connectorConfigFile path. Forwarded to AgentCoreApplication.
|
|
39
|
+
*/
|
|
40
|
+
connectorParametersByFile?: Record<string, Record<string, unknown>>;
|
|
43
41
|
}
|
|
44
42
|
|
|
45
43
|
/**
|
|
@@ -55,12 +53,25 @@ export class AgentCoreStack extends Stack {
|
|
|
55
53
|
constructor(scope: Construct, id: string, props: AgentCoreStackProps) {
|
|
56
54
|
super(scope, id, props);
|
|
57
55
|
|
|
58
|
-
const { spec, mcpSpec, credentials, harnesses } = props;
|
|
56
|
+
const { spec, mcpSpec, credentials, harnesses, connectorParametersByFile } = props;
|
|
59
57
|
|
|
60
58
|
// Create AgentCoreApplication with all agents and harness roles
|
|
61
|
-
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
60
|
+
const appProps: Record<string, unknown> = { spec };
|
|
61
|
+
if (harnesses?.length) {
|
|
62
|
+
appProps.harnesses = harnesses;
|
|
63
|
+
}
|
|
64
|
+
if (connectorParametersByFile && Object.keys(connectorParametersByFile).length > 0) {
|
|
65
|
+
appProps.connectorParametersByFile = connectorParametersByFile;
|
|
66
|
+
}
|
|
67
|
+
if (credentials) {
|
|
68
|
+
appProps.credentials = credentials;
|
|
69
|
+
}
|
|
70
|
+
this.application = new AgentCoreApplication(this, 'Application', appProps as any);
|
|
71
|
+
new AgentCorePayments(this, 'Payments', {
|
|
62
72
|
spec,
|
|
63
|
-
|
|
73
|
+
credentials,
|
|
74
|
+
agentCoreApplication: this.application,
|
|
64
75
|
});
|
|
65
76
|
|
|
66
77
|
// Create AgentCoreMcp if there are gateways configured
|
|
@@ -14,17 +14,17 @@
|
|
|
14
14
|
"format:check": "prettier --check ."
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@types/jest": "
|
|
18
|
-
"@types/node": "
|
|
19
|
-
"jest": "
|
|
20
|
-
"ts-jest": "
|
|
21
|
-
"aws-cdk": "2.
|
|
22
|
-
"prettier": "
|
|
17
|
+
"@types/jest": "~29.5.14",
|
|
18
|
+
"@types/node": "~24.13.3",
|
|
19
|
+
"jest": "~29.7.0",
|
|
20
|
+
"ts-jest": "~29.4.11",
|
|
21
|
+
"aws-cdk": "~2.1126.0",
|
|
22
|
+
"prettier": "~3.9.5",
|
|
23
23
|
"typescript": "~5.9.3"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@aws/agentcore-cdk": "
|
|
27
|
-
"aws-cdk-lib": "
|
|
28
|
-
"constructs": "
|
|
26
|
+
"@aws/agentcore-cdk": "0.1.0-alpha.52",
|
|
27
|
+
"aws-cdk-lib": "~2.266.0",
|
|
28
|
+
"constructs": "~10.7.0"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -1,6 +1,29 @@
|
|
|
1
|
+
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { tmpdir } from 'node:os';
|
|
3
|
+
import { join } from 'node:path';
|
|
1
4
|
import * as cdk from 'aws-cdk-lib';
|
|
2
|
-
import { Template } from 'aws-cdk-lib/assertions';
|
|
3
|
-
|
|
5
|
+
import { Match, Template } from 'aws-cdk-lib/assertions';
|
|
6
|
+
|
|
7
|
+
const originalCwd = process.cwd();
|
|
8
|
+
const originalInitCwd = process.env.INIT_CWD;
|
|
9
|
+
const testRoot = mkdtempSync(join(tmpdir(), 'agentcore-cdk-test-'));
|
|
10
|
+
const testConfigDir = join(testRoot, 'agentcore');
|
|
11
|
+
let AgentCoreStack: typeof import('../lib/cdk-stack').AgentCoreStack;
|
|
12
|
+
|
|
13
|
+
beforeAll(async () => {
|
|
14
|
+
process.chdir(testRoot);
|
|
15
|
+
process.env.INIT_CWD = testRoot;
|
|
16
|
+
mkdirSync(testConfigDir, { recursive: true });
|
|
17
|
+
writeFileSync(join(testConfigDir, 'agentcore.json'), '{}');
|
|
18
|
+
({ AgentCoreStack } = await import('../lib/cdk-stack'));
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
afterAll(() => {
|
|
22
|
+
process.chdir(originalCwd);
|
|
23
|
+
if (originalInitCwd === undefined) delete process.env.INIT_CWD;
|
|
24
|
+
else process.env.INIT_CWD = originalInitCwd;
|
|
25
|
+
rmSync(testRoot, { recursive: true, force: true });
|
|
26
|
+
});
|
|
4
27
|
|
|
5
28
|
test('AgentCoreStack synthesizes with empty spec', () => {
|
|
6
29
|
const app = new cdk.App();
|
|
@@ -16,9 +39,12 @@ test('AgentCoreStack synthesizes with empty spec', () => {
|
|
|
16
39
|
onlineEvalConfigs: [],
|
|
17
40
|
configBundles: [],
|
|
18
41
|
policyEngines: [],
|
|
42
|
+
payments: [],
|
|
19
43
|
agentCoreGateways: [],
|
|
20
44
|
mcpRuntimeTools: [],
|
|
21
45
|
unassignedTargets: [],
|
|
46
|
+
datasets: [],
|
|
47
|
+
knowledgeBases: [],
|
|
22
48
|
},
|
|
23
49
|
});
|
|
24
50
|
const template = Template.fromStack(stack);
|
|
@@ -26,3 +52,69 @@ test('AgentCoreStack synthesizes with empty spec', () => {
|
|
|
26
52
|
Description: 'Name of the CloudFormation Stack',
|
|
27
53
|
});
|
|
28
54
|
});
|
|
55
|
+
|
|
56
|
+
test('AgentCoreStack synthesizes manual and Quick Create payment connectors', () => {
|
|
57
|
+
const app = new cdk.App();
|
|
58
|
+
const stack = new AgentCoreStack(app, 'TestStack', {
|
|
59
|
+
spec: {
|
|
60
|
+
name: 'testproject',
|
|
61
|
+
version: 1,
|
|
62
|
+
managedBy: 'CDK' as const,
|
|
63
|
+
runtimes: [],
|
|
64
|
+
memories: [],
|
|
65
|
+
credentials: [
|
|
66
|
+
{
|
|
67
|
+
authorizerType: 'PaymentCredentialProvider',
|
|
68
|
+
name: 'coinbase',
|
|
69
|
+
provider: 'CoinbaseCDP',
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
evaluators: [],
|
|
73
|
+
onlineEvalConfigs: [],
|
|
74
|
+
configBundles: [],
|
|
75
|
+
policyEngines: [],
|
|
76
|
+
payments: [
|
|
77
|
+
{
|
|
78
|
+
name: 'Payments',
|
|
79
|
+
authorizerType: 'AWS_IAM',
|
|
80
|
+
connectors: [
|
|
81
|
+
{
|
|
82
|
+
name: 'Manual',
|
|
83
|
+
provider: 'CoinbaseCDP',
|
|
84
|
+
credentialName: 'coinbase',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: 'Quick',
|
|
88
|
+
provider: 'CoinbaseCDP',
|
|
89
|
+
provisionMode: 'QUICK_CREATE',
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
agentCoreGateways: [],
|
|
95
|
+
mcpRuntimeTools: [],
|
|
96
|
+
unassignedTargets: [],
|
|
97
|
+
datasets: [],
|
|
98
|
+
knowledgeBases: [],
|
|
99
|
+
},
|
|
100
|
+
credentials: {
|
|
101
|
+
coinbase: {
|
|
102
|
+
credentialProviderArn:
|
|
103
|
+
'arn:aws:bedrock-agentcore:us-east-1:123456789012:token-vault/default/paymentcredentialprovider/coinbase',
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
const template = Template.fromStack(stack);
|
|
108
|
+
|
|
109
|
+
template.resourceCountIs('AWS::BedrockAgentCore::PaymentConnector', 2);
|
|
110
|
+
template.hasResourceProperties('AWS::BedrockAgentCore::PaymentConnector', {
|
|
111
|
+
ConnectorName: 'Manual',
|
|
112
|
+
ProvisionMode: Match.absent(),
|
|
113
|
+
});
|
|
114
|
+
template.hasResourceProperties('AWS::BedrockAgentCore::PaymentConnector', {
|
|
115
|
+
ConnectorName: 'Quick',
|
|
116
|
+
ConnectorType: 'CoinbaseCDP',
|
|
117
|
+
ProvisionMode: 'QUICK_CREATE',
|
|
118
|
+
CredentialProviderConfigurations: [],
|
|
119
|
+
});
|
|
120
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# {{ Name }}
|
|
2
|
+
|
|
3
|
+
An AgentCore **code-based evaluator** backed by
|
|
4
|
+
[autoevals](https://github.com/braintrustdata/autoevals) — scores each session
|
|
5
|
+
with autoevals' `{{ EvaluatorClass }}` scorer.
|
|
6
|
+
|
|
7
|
+
## What's here
|
|
8
|
+
|
|
9
|
+
- `lambda_function.py` — wraps `{{ EvaluatorClass }}` in an `AutoEvalsAdapter`
|
|
10
|
+
behind the standard `@custom_code_based_evaluator()` handler. With a Bedrock
|
|
11
|
+
judge model set, autoevals grades via a LiteLLM client → Bedrock.
|
|
12
|
+
- `pyproject.toml` — autoevals + judge dependencies, managed with
|
|
13
|
+
[uv](https://docs.astral.sh/uv/).
|
|
14
|
+
- `execution-role-policy.json` — grants the Lambda `bedrock:InvokeModel` for the
|
|
15
|
+
judge model.
|
|
16
|
+
|
|
17
|
+
## Customize
|
|
18
|
+
|
|
19
|
+
- Change the scorer or its arguments in `lambda_function.py`.
|
|
20
|
+
- Scorers like `Factuality` / `ClosedQA` / `SQL` need an expected/reference
|
|
21
|
+
output — provide it when you invoke the evaluator.
|
|
22
|
+
|
|
23
|
+
`agentcore project deploy` packages this directory into the evaluator Lambda.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Version": "2012-10-17",
|
|
3
|
+
"Statement": [
|
|
4
|
+
{
|
|
5
|
+
"Effect": "Allow",
|
|
6
|
+
"Action": ["logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents"],
|
|
7
|
+
"Resource": "arn:*:logs:*:*:log-group:/aws/lambda/*"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"Effect": "Allow",
|
|
11
|
+
"Action": ["bedrock:InvokeModel"],
|
|
12
|
+
"Resource": "*"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{{#if ModelProviderBedrock}}
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
# litellm's Bedrock provider reads AWS_REGION_NAME; Lambda only sets AWS_REGION/AWS_DEFAULT_REGION.
|
|
5
|
+
os.environ.setdefault("AWS_REGION_NAME", os.environ.get("AWS_REGION", "us-west-2"))
|
|
6
|
+
|
|
7
|
+
from autoevals import {{ EvaluatorClass }}, init
|
|
8
|
+
from autoevals.litellm import LiteLLMClient
|
|
9
|
+
|
|
10
|
+
from bedrock_agentcore.evaluation.custom_code_based_evaluators import (
|
|
11
|
+
EvaluatorInput,
|
|
12
|
+
EvaluatorOutput,
|
|
13
|
+
custom_code_based_evaluator,
|
|
14
|
+
)
|
|
15
|
+
from bedrock_agentcore.evaluation.custom_code_based_evaluators.third_party.autoevals import AutoEvalsAdapter
|
|
16
|
+
|
|
17
|
+
client = LiteLLMClient()
|
|
18
|
+
init(client=client, default_model="bedrock/{{ Model }}")
|
|
19
|
+
|
|
20
|
+
adapter = AutoEvalsAdapter(metric={{ EvaluatorClass }}(client=client, model="bedrock/{{ Model }}"){{#if EvaluatorParams}}, {{{ EvaluatorParams }}}{{/if}})
|
|
21
|
+
{{else}}
|
|
22
|
+
from autoevals import {{ EvaluatorClass }}
|
|
23
|
+
|
|
24
|
+
from bedrock_agentcore.evaluation.custom_code_based_evaluators import (
|
|
25
|
+
EvaluatorInput,
|
|
26
|
+
EvaluatorOutput,
|
|
27
|
+
custom_code_based_evaluator,
|
|
28
|
+
)
|
|
29
|
+
from bedrock_agentcore.evaluation.custom_code_based_evaluators.third_party.autoevals import AutoEvalsAdapter
|
|
30
|
+
|
|
31
|
+
adapter = AutoEvalsAdapter(metric={{ EvaluatorClass }}({{#if Model}}model="{{ Model }}"{{/if}}){{#if EvaluatorParams}}, {{{ EvaluatorParams }}}{{/if}})
|
|
32
|
+
{{/if}}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@custom_code_based_evaluator()
|
|
36
|
+
def handler(evaluator_input: EvaluatorInput, context) -> EvaluatorOutput:
|
|
37
|
+
return adapter(evaluator_input, context)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "{{ Name }}"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "AgentCore Code-Based Evaluator (Autoevals)"
|
|
9
|
+
requires-python = ">=3.10"
|
|
10
|
+
dependencies = [
|
|
11
|
+
# 1.20.0 is the first release shipping third_party.autoevals.AutoEvalsAdapter;
|
|
12
|
+
# the extra owns the autoevals version, so pinning it here only conflicts.
|
|
13
|
+
"bedrock-agentcore[autoevals]>=1.20.0,<2.0.0",
|
|
14
|
+
{{#if ModelProviderBedrock}}
|
|
15
|
+
# autoevals grades via LiteLLMClient -> Bedrock (Converse); litellm replaces the openai judge
|
|
16
|
+
"litellm>=1.60,<1.85",
|
|
17
|
+
{{else}}
|
|
18
|
+
"openai>=1.0.0,<2.0.0",
|
|
19
|
+
{{/if}}
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
[tool.hatch.build.targets.wheel]
|
|
23
|
+
packages = ["."]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# {{ Name }}
|
|
2
|
+
|
|
3
|
+
An AgentCore **code-based evaluator** backed by
|
|
4
|
+
[DeepEval](https://docs.confident-ai.com/) — scores each session with DeepEval's
|
|
5
|
+
`{{ EvaluatorClass }}` metric, judged by Amazon Bedrock.
|
|
6
|
+
|
|
7
|
+
## What's here
|
|
8
|
+
|
|
9
|
+
- `lambda_function.py` — wraps `{{ EvaluatorClass }}` in a `DeepEvalAdapter`
|
|
10
|
+
behind the standard `@custom_code_based_evaluator()` handler.
|
|
11
|
+
- `pyproject.toml` — DeepEval + Bedrock dependencies, managed with
|
|
12
|
+
[uv](https://docs.astral.sh/uv/).
|
|
13
|
+
- `execution-role-policy.json` — grants the Lambda `bedrock:InvokeModel` for the
|
|
14
|
+
judge model; add more if your metric needs it.
|
|
15
|
+
|
|
16
|
+
## Customize
|
|
17
|
+
|
|
18
|
+
- Swap the metric or tune its threshold in `lambda_function.py`.
|
|
19
|
+
- Some DeepEval metrics need retrieval context or a reference/expected output —
|
|
20
|
+
supply those when you invoke the evaluator, or the metric returns
|
|
21
|
+
`MISSING_REQUIRED_FIELD`.
|
|
22
|
+
|
|
23
|
+
`agentcore project deploy` packages this directory into the evaluator Lambda.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Version": "2012-10-17",
|
|
3
|
+
"Statement": [
|
|
4
|
+
{
|
|
5
|
+
"Effect": "Allow",
|
|
6
|
+
"Action": ["logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents"],
|
|
7
|
+
"Resource": "arn:*:logs:*:*:log-group:/aws/lambda/*"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"Effect": "Allow",
|
|
11
|
+
"Action": ["bedrock:InvokeModel"],
|
|
12
|
+
"Resource": "*"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
os.environ.setdefault("DEEPEVAL_RESULTS_FOLDER", "/tmp/.deepeval")
|
|
4
|
+
os.environ.setdefault("DEEPEVAL_TELEMETRY_OPT_OUT", "YES")
|
|
5
|
+
os.chdir("/tmp")
|
|
6
|
+
|
|
7
|
+
{{#if ModelProviderBedrock}}
|
|
8
|
+
from deepeval.models import AmazonBedrockModel
|
|
9
|
+
{{/if}}
|
|
10
|
+
from deepeval.metrics import {{ EvaluatorClass }}
|
|
11
|
+
|
|
12
|
+
from bedrock_agentcore.evaluation.custom_code_based_evaluators import (
|
|
13
|
+
EvaluatorInput,
|
|
14
|
+
EvaluatorOutput,
|
|
15
|
+
custom_code_based_evaluator,
|
|
16
|
+
)
|
|
17
|
+
from bedrock_agentcore.evaluation.custom_code_based_evaluators.third_party.deepeval import DeepEvalAdapter
|
|
18
|
+
|
|
19
|
+
{{#if ModelProviderBedrock}}
|
|
20
|
+
model = AmazonBedrockModel(model="{{ Model }}", region=os.environ.get("AWS_REGION", "us-west-2"))
|
|
21
|
+
adapter = DeepEvalAdapter(metric={{ EvaluatorClass }}(model=model{{#if EvaluatorParams}}, {{{ EvaluatorParams }}}{{/if}}))
|
|
22
|
+
{{else}}
|
|
23
|
+
adapter = DeepEvalAdapter(metric={{ EvaluatorClass }}({{{ EvaluatorParams }}}))
|
|
24
|
+
{{/if}}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@custom_code_based_evaluator()
|
|
28
|
+
def handler(evaluator_input: EvaluatorInput, context) -> EvaluatorOutput:
|
|
29
|
+
return adapter(evaluator_input, context)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "{{ Name }}"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "AgentCore Code-Based Evaluator (DeepEval)"
|
|
9
|
+
requires-python = ">=3.10"
|
|
10
|
+
dependencies = [
|
|
11
|
+
# 1.20.0 is the first release shipping third_party.deepeval.DeepEvalAdapter;
|
|
12
|
+
# the extra owns the deepeval version, so pinning it here only conflicts.
|
|
13
|
+
"bedrock-agentcore[deepeval]>=1.20.0,<2.0.0",
|
|
14
|
+
{{#if ModelProviderBedrock}}
|
|
15
|
+
# deepeval's AmazonBedrockModel imports aiobotocore at runtime; only 3.x
|
|
16
|
+
# allows the botocore that bedrock-agentcore requires.
|
|
17
|
+
"aiobotocore>=3.0.0,<4.0.0",
|
|
18
|
+
{{/if}}
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
[tool.hatch.build.targets.wheel]
|
|
22
|
+
packages = ["."]
|