@aws/agentcore 1.0.0-preview.9 → 1.0.0-rc.3
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 +1218 -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 +43 -17
- package/dist/assets/cdk/bin/cdk.ts +22 -123
- package/dist/assets/cdk/lib/cdk-stack.ts +18 -69
- package/dist/assets/cdk/package.json +6 -13
- package/dist/assets/cdk/tsconfig.json +1 -1
- package/dist/assets/evaluators/python-lambda/README.md +32 -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 +56 -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 +50 -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 +60 -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 +65 -0
- package/dist/assets/templates/agent-python-strands/memory/__init__.py +0 -0
- package/dist/assets/templates/agent-python-strands/memory/session.py +31 -0
- package/dist/assets/{python/http/strands/base → templates/agent-python-strands}/model/load.py +49 -3
- package/dist/assets/templates/agent-python-strands/parse.py +41 -0
- package/dist/assets/templates/agent-python-strands/pyproject.toml +24 -0
- package/dist/assets/templates/agent-typescript-strands/README.md +50 -0
- package/dist/assets/templates/agent-typescript-strands/gitignore.template +22 -0
- package/dist/assets/templates/agent-typescript-strands/main.ts +77 -0
- package/dist/assets/templates/agent-typescript-strands/memory/memory.ts +33 -0
- package/dist/assets/templates/agent-typescript-strands/model/load.ts +5 -0
- package/dist/assets/templates/agent-typescript-strands/package.json.template +28 -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/harness/harness.yaml +157 -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 +1582 -0
- package/package.json +76 -148
- 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/cdk/.prettierrc +0 -8
- package/dist/assets/cdk/jest.config.js +0 -9
- package/dist/assets/cdk/npmignore.template +0 -6
- package/dist/assets/cdk/test/cdk.test.ts +0 -28
- 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
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
{{#if (eq modelProvider "Bedrock")}}
|
|
2
|
-
import os
|
|
3
|
-
from autogen_ext.models.anthropic import AnthropicBedrockChatCompletionClient
|
|
4
|
-
from autogen_core.models import ModelInfo, ModelFamily
|
|
5
|
-
|
|
6
|
-
# Uses global inference profile for Claude Sonnet 4.5
|
|
7
|
-
# https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-support.html
|
|
8
|
-
MODEL_ID = "global.anthropic.claude-sonnet-4-5-20250929-v1:0"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def load_model() -> AnthropicBedrockChatCompletionClient:
|
|
12
|
-
"""Get Bedrock model client using IAM credentials."""
|
|
13
|
-
return AnthropicBedrockChatCompletionClient(
|
|
14
|
-
model=MODEL_ID,
|
|
15
|
-
model_info=ModelInfo(
|
|
16
|
-
vision=False,
|
|
17
|
-
function_calling=True,
|
|
18
|
-
json_output=False,
|
|
19
|
-
family=ModelFamily.CLAUDE_4_SONNET,
|
|
20
|
-
structured_output=True
|
|
21
|
-
),
|
|
22
|
-
bedrock_info={"aws_region": os.environ.get("AWS_REGION", "us-east-1")}
|
|
23
|
-
)
|
|
24
|
-
{{/if}}
|
|
25
|
-
{{#if (eq modelProvider "Anthropic")}}
|
|
26
|
-
import os
|
|
27
|
-
from autogen_ext.models.anthropic import AnthropicChatCompletionClient
|
|
28
|
-
from bedrock_agentcore.identity.auth import requires_api_key
|
|
29
|
-
|
|
30
|
-
IDENTITY_PROVIDER_NAME = "{{identityProviders.[0].name}}"
|
|
31
|
-
IDENTITY_ENV_VAR = "{{identityProviders.[0].envVarName}}"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
@requires_api_key(provider_name=IDENTITY_PROVIDER_NAME)
|
|
35
|
-
def _agentcore_identity_api_key_provider(api_key: str) -> str:
|
|
36
|
-
"""Fetch API key from AgentCore Identity."""
|
|
37
|
-
return api_key
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
def _get_api_key() -> str:
|
|
41
|
-
"""
|
|
42
|
-
Uses AgentCore Identity for API key management in deployed environments.
|
|
43
|
-
For local development, run via 'agentcore dev' which loads agentcore/.env.
|
|
44
|
-
"""
|
|
45
|
-
if os.getenv("LOCAL_DEV") == "1":
|
|
46
|
-
api_key = os.getenv(IDENTITY_ENV_VAR)
|
|
47
|
-
if not api_key:
|
|
48
|
-
raise RuntimeError(
|
|
49
|
-
f"{IDENTITY_ENV_VAR} not found. Add {IDENTITY_ENV_VAR}=your-key to .env.local"
|
|
50
|
-
)
|
|
51
|
-
return api_key
|
|
52
|
-
return _agentcore_identity_api_key_provider()
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
def load_model() -> AnthropicChatCompletionClient:
|
|
56
|
-
"""Get authenticated Anthropic model client."""
|
|
57
|
-
return AnthropicChatCompletionClient(
|
|
58
|
-
model="claude-sonnet-4-5-20250929",
|
|
59
|
-
api_key=_get_api_key()
|
|
60
|
-
)
|
|
61
|
-
{{/if}}
|
|
62
|
-
{{#if (eq modelProvider "OpenAI")}}
|
|
63
|
-
import os
|
|
64
|
-
from autogen_ext.models.openai import OpenAIChatCompletionClient
|
|
65
|
-
from bedrock_agentcore.identity.auth import requires_api_key
|
|
66
|
-
|
|
67
|
-
IDENTITY_PROVIDER_NAME = "{{identityProviders.[0].name}}"
|
|
68
|
-
IDENTITY_ENV_VAR = "{{identityProviders.[0].envVarName}}"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
@requires_api_key(provider_name=IDENTITY_PROVIDER_NAME)
|
|
72
|
-
def _agentcore_identity_api_key_provider(api_key: str) -> str:
|
|
73
|
-
"""Fetch API key from AgentCore Identity."""
|
|
74
|
-
return api_key
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
def _get_api_key() -> str:
|
|
78
|
-
"""
|
|
79
|
-
Uses AgentCore Identity for API key management in deployed environments.
|
|
80
|
-
For local development, run via 'agentcore dev' which loads agentcore/.env.
|
|
81
|
-
"""
|
|
82
|
-
if os.getenv("LOCAL_DEV") == "1":
|
|
83
|
-
api_key = os.getenv(IDENTITY_ENV_VAR)
|
|
84
|
-
if not api_key:
|
|
85
|
-
raise RuntimeError(
|
|
86
|
-
f"{IDENTITY_ENV_VAR} not found. Add {IDENTITY_ENV_VAR}=your-key to .env.local"
|
|
87
|
-
)
|
|
88
|
-
return api_key
|
|
89
|
-
return _agentcore_identity_api_key_provider()
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
def load_model() -> OpenAIChatCompletionClient:
|
|
93
|
-
"""Get authenticated OpenAI model client."""
|
|
94
|
-
return OpenAIChatCompletionClient(
|
|
95
|
-
model="gpt-4o",
|
|
96
|
-
api_key=_get_api_key()
|
|
97
|
-
)
|
|
98
|
-
{{/if}}
|
|
99
|
-
{{#if (eq modelProvider "Gemini")}}
|
|
100
|
-
import os
|
|
101
|
-
from autogen_ext.models.openai import OpenAIChatCompletionClient
|
|
102
|
-
from bedrock_agentcore.identity.auth import requires_api_key
|
|
103
|
-
|
|
104
|
-
IDENTITY_PROVIDER_NAME = "{{identityProviders.[0].name}}"
|
|
105
|
-
IDENTITY_ENV_VAR = "{{identityProviders.[0].envVarName}}"
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
@requires_api_key(provider_name=IDENTITY_PROVIDER_NAME)
|
|
109
|
-
def _agentcore_identity_api_key_provider(api_key: str) -> str:
|
|
110
|
-
"""Fetch API key from AgentCore Identity."""
|
|
111
|
-
return api_key
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
def _get_api_key() -> str:
|
|
115
|
-
"""
|
|
116
|
-
Uses AgentCore Identity for API key management in deployed environments.
|
|
117
|
-
For local development, run via 'agentcore dev' which loads agentcore/.env.
|
|
118
|
-
"""
|
|
119
|
-
if os.getenv("LOCAL_DEV") == "1":
|
|
120
|
-
api_key = os.getenv(IDENTITY_ENV_VAR)
|
|
121
|
-
if not api_key:
|
|
122
|
-
raise RuntimeError(
|
|
123
|
-
f"{IDENTITY_ENV_VAR} not found. Add {IDENTITY_ENV_VAR}=your-key to .env.local"
|
|
124
|
-
)
|
|
125
|
-
return api_key
|
|
126
|
-
return _agentcore_identity_api_key_provider()
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
def load_model() -> OpenAIChatCompletionClient:
|
|
130
|
-
"""Get authenticated Gemini model client via OpenAI-compatible API."""
|
|
131
|
-
return OpenAIChatCompletionClient(
|
|
132
|
-
model="gemini-2.0-flash",
|
|
133
|
-
api_key=_get_api_key(),
|
|
134
|
-
base_url="https://generativelanguage.googleapis.com/v1beta/openai/"
|
|
135
|
-
)
|
|
136
|
-
{{/if}}
|
|
@@ -1,34 +0,0 @@
|
|
|
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 Runtime Application using AutoGen SDK"
|
|
9
|
-
readme = "README.md"
|
|
10
|
-
requires-python = ">=3.10"
|
|
11
|
-
dependencies = [
|
|
12
|
-
"autogen-agentchat >= 0.7.5",
|
|
13
|
-
"autogen-ext[mcp] >= 0.7.5",
|
|
14
|
-
"opentelemetry-distro",
|
|
15
|
-
"opentelemetry-exporter-otlp",
|
|
16
|
-
"bedrock-agentcore >= 1.0.3",
|
|
17
|
-
"botocore[crt] >= 1.35.0",
|
|
18
|
-
"tiktoken",
|
|
19
|
-
{{#if (eq modelProvider "Bedrock")}}
|
|
20
|
-
"autogen-ext[anthropic] >= 0.7.5",
|
|
21
|
-
{{/if}}
|
|
22
|
-
{{#if (eq modelProvider "Anthropic")}}
|
|
23
|
-
"autogen-ext[anthropic] >= 0.7.5",
|
|
24
|
-
{{/if}}
|
|
25
|
-
{{#if (eq modelProvider "OpenAI")}}
|
|
26
|
-
"autogen-ext[openai] >= 0.7.5",
|
|
27
|
-
{{/if}}
|
|
28
|
-
{{#if (eq modelProvider "Gemini")}}
|
|
29
|
-
"autogen-ext[openai] >= 0.7.5",
|
|
30
|
-
{{/if}}
|
|
31
|
-
]
|
|
32
|
-
|
|
33
|
-
[tool.hatch.build.targets.wheel]
|
|
34
|
-
packages = ["."]
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
This is a project generated by the agentcore create CLI tool!
|
|
2
|
-
|
|
3
|
-
# Layout
|
|
4
|
-
|
|
5
|
-
The generated application code lives at the agent root directory. At the root, there is a `.gitignore` file, an
|
|
6
|
-
`agentcore/` folder which represents the configurations and state associated with this project. Other `agentcore`
|
|
7
|
-
commands like `deploy`, `dev`, and `invoke` rely on the configuration stored here.
|
|
8
|
-
|
|
9
|
-
## Agent Root
|
|
10
|
-
|
|
11
|
-
The main entrypoint to your app is defined in `main.py`. Using the AgentCore SDK `@app.entrypoint` decorator, this
|
|
12
|
-
file defines a Starlette ASGI app with the Google ADK framework running within.
|
|
13
|
-
|
|
14
|
-
`model/load.py` instantiates your chosen model provider (Gemini).
|
|
15
|
-
|
|
16
|
-
## Environment Variables
|
|
17
|
-
|
|
18
|
-
| Variable | Required | Description |
|
|
19
|
-
| --- | --- | --- |
|
|
20
|
-
{{#if hasIdentity}}| `{{identityProviders.[0].envVarName}}` | Yes | {{modelProvider}} API key (local) or Identity provider name (deployed) |
|
|
21
|
-
{{/if}}| `LOCAL_DEV` | No | Set to `1` to use `.env.local` instead of AgentCore Identity |
|
|
22
|
-
|
|
23
|
-
# Developing locally
|
|
24
|
-
|
|
25
|
-
If installation was successful, a virtual environment is already created with dependencies installed.
|
|
26
|
-
|
|
27
|
-
Run `source .venv/bin/activate` before developing.
|
|
28
|
-
|
|
29
|
-
`agentcore dev` will start a local server on 0.0.0.0:8080.
|
|
30
|
-
|
|
31
|
-
In a new terminal, you can invoke that server with:
|
|
32
|
-
|
|
33
|
-
`agentcore invoke --dev "What can you do"`
|
|
34
|
-
|
|
35
|
-
# Deployment
|
|
36
|
-
|
|
37
|
-
After providing credentials, `agentcore deploy` will deploy your project into Amazon Bedrock AgentCore.
|
|
38
|
-
|
|
39
|
-
Use `agentcore invoke` to invoke your deployed agent.
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# Environment variables
|
|
2
|
-
.env
|
|
3
|
-
|
|
4
|
-
# Python
|
|
5
|
-
__pycache__/
|
|
6
|
-
*.py[cod]
|
|
7
|
-
*$py.class
|
|
8
|
-
*.so
|
|
9
|
-
.Python
|
|
10
|
-
build/
|
|
11
|
-
develop-eggs/
|
|
12
|
-
dist/
|
|
13
|
-
downloads/
|
|
14
|
-
eggs/
|
|
15
|
-
.eggs/
|
|
16
|
-
lib/
|
|
17
|
-
lib64/
|
|
18
|
-
parts/
|
|
19
|
-
sdist/
|
|
20
|
-
var/
|
|
21
|
-
wheels/
|
|
22
|
-
*.egg-info/
|
|
23
|
-
.installed.cfg
|
|
24
|
-
*.egg
|
|
25
|
-
|
|
26
|
-
# Virtual environments
|
|
27
|
-
.venv/
|
|
28
|
-
venv/
|
|
29
|
-
ENV/
|
|
30
|
-
env/
|
|
31
|
-
|
|
32
|
-
# IDE
|
|
33
|
-
.vscode/
|
|
34
|
-
.idea/
|
|
35
|
-
*.swp
|
|
36
|
-
*.swo
|
|
37
|
-
*~
|
|
38
|
-
|
|
39
|
-
# OS
|
|
40
|
-
.DS_Store
|
|
41
|
-
Thumbs.db
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
from google.adk.agents import Agent
|
|
3
|
-
from google.adk.runners import Runner
|
|
4
|
-
from google.adk.sessions import InMemorySessionService
|
|
5
|
-
from google.genai import types
|
|
6
|
-
from bedrock_agentcore.runtime import BedrockAgentCoreApp
|
|
7
|
-
from model.load import load_model
|
|
8
|
-
{{#if hasGateway}}
|
|
9
|
-
from mcp_client.client import get_all_gateway_mcp_toolsets
|
|
10
|
-
{{else}}
|
|
11
|
-
from mcp_client.client import get_streamable_http_mcp_client
|
|
12
|
-
{{/if}}
|
|
13
|
-
|
|
14
|
-
app = BedrockAgentCoreApp()
|
|
15
|
-
log = app.logger
|
|
16
|
-
|
|
17
|
-
APP_NAME = "{{ name }}"
|
|
18
|
-
|
|
19
|
-
# https://google.github.io/adk-docs/agents/models/
|
|
20
|
-
MODEL_ID = "gemini-2.5-flash"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
# Define a simple function tool
|
|
24
|
-
def add_numbers(a: int, b: int) -> int:
|
|
25
|
-
"""Return the sum of two numbers"""
|
|
26
|
-
return a + b
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
# Define a collection of tools used by the model
|
|
30
|
-
tools = [add_numbers]
|
|
31
|
-
|
|
32
|
-
{{#if sessionStorageMountPath}}
|
|
33
|
-
SESSION_STORAGE_PATH = "{{sessionStorageMountPath}}"
|
|
34
|
-
|
|
35
|
-
def _safe_resolve(path: str) -> str:
|
|
36
|
-
"""Resolve path safely within the storage boundary."""
|
|
37
|
-
resolved = os.path.realpath(os.path.join(SESSION_STORAGE_PATH, path.lstrip("/")))
|
|
38
|
-
if not resolved.startswith(os.path.realpath(SESSION_STORAGE_PATH)):
|
|
39
|
-
raise ValueError(f"Path '{path}' is outside the storage boundary")
|
|
40
|
-
return resolved
|
|
41
|
-
|
|
42
|
-
def file_read(path: str) -> str:
|
|
43
|
-
"""Read a file from persistent storage. The path is relative to the storage root."""
|
|
44
|
-
try:
|
|
45
|
-
full_path = _safe_resolve(path)
|
|
46
|
-
with open(full_path) as f:
|
|
47
|
-
return f.read()
|
|
48
|
-
except ValueError as e:
|
|
49
|
-
return str(e)
|
|
50
|
-
except OSError as e:
|
|
51
|
-
return f"Error reading '{path}': {e.strerror}"
|
|
52
|
-
|
|
53
|
-
def file_write(path: str, content: str) -> str:
|
|
54
|
-
"""Write content to a file in persistent storage. The path is relative to the storage root."""
|
|
55
|
-
try:
|
|
56
|
-
full_path = _safe_resolve(path)
|
|
57
|
-
parent = os.path.dirname(full_path)
|
|
58
|
-
if parent:
|
|
59
|
-
os.makedirs(parent, exist_ok=True)
|
|
60
|
-
with open(full_path, "w") as f:
|
|
61
|
-
f.write(content)
|
|
62
|
-
return f"Written to {path}"
|
|
63
|
-
except ValueError as e:
|
|
64
|
-
return str(e)
|
|
65
|
-
except OSError as e:
|
|
66
|
-
return f"Error writing '{path}': {e.strerror}"
|
|
67
|
-
|
|
68
|
-
def list_files(directory: str = "") -> str:
|
|
69
|
-
"""List files in persistent storage. The directory is relative to the storage root."""
|
|
70
|
-
try:
|
|
71
|
-
target = _safe_resolve(directory)
|
|
72
|
-
entries = os.listdir(target)
|
|
73
|
-
return "\n".join(entries) if entries else "(empty directory)"
|
|
74
|
-
except ValueError as e:
|
|
75
|
-
return str(e)
|
|
76
|
-
except OSError as e:
|
|
77
|
-
return f"Error listing '{directory}': {e.strerror}"
|
|
78
|
-
|
|
79
|
-
tools.extend([file_read, file_write, list_files])
|
|
80
|
-
{{/if}}
|
|
81
|
-
|
|
82
|
-
AGENT_INSTRUCTION = """
|
|
83
|
-
I can answer your questions using the knowledge I have!
|
|
84
|
-
{{#if sessionStorageMountPath}}
|
|
85
|
-
You have persistent storage at {{sessionStorageMountPath}}. Use file tools to read and write files. Data persists across sessions.
|
|
86
|
-
{{/if}}
|
|
87
|
-
"""
|
|
88
|
-
|
|
89
|
-
# Get MCP Toolset
|
|
90
|
-
{{#if hasGateway}}
|
|
91
|
-
mcp_toolset = get_all_gateway_mcp_toolsets()
|
|
92
|
-
{{else}}
|
|
93
|
-
mcp_client = get_streamable_http_mcp_client()
|
|
94
|
-
mcp_toolset = [mcp_client] if mcp_client else []
|
|
95
|
-
{{/if}}
|
|
96
|
-
|
|
97
|
-
_credentials_loaded = False
|
|
98
|
-
|
|
99
|
-
def ensure_credentials_loaded():
|
|
100
|
-
global _credentials_loaded
|
|
101
|
-
if not _credentials_loaded:
|
|
102
|
-
load_model()
|
|
103
|
-
_credentials_loaded = True
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
# Agent Definition
|
|
107
|
-
agent = Agent(
|
|
108
|
-
model=MODEL_ID,
|
|
109
|
-
name="{{ name }}",
|
|
110
|
-
description="Agent to answer questions",
|
|
111
|
-
instruction=AGENT_INSTRUCTION,
|
|
112
|
-
tools=mcp_toolset + tools,
|
|
113
|
-
)
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
# Session and Runner
|
|
117
|
-
async def setup_session_and_runner(user_id, session_id):
|
|
118
|
-
ensure_credentials_loaded()
|
|
119
|
-
session_service = InMemorySessionService()
|
|
120
|
-
session = await session_service.create_session(
|
|
121
|
-
app_name=APP_NAME, user_id=user_id, session_id=session_id
|
|
122
|
-
)
|
|
123
|
-
runner = Runner(agent=agent, app_name=APP_NAME, session_service=session_service)
|
|
124
|
-
return session, runner
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
# Agent Interaction
|
|
128
|
-
async def call_agent_async(query, user_id, session_id):
|
|
129
|
-
content = types.Content(role="user", parts=[types.Part(text=query)])
|
|
130
|
-
session, runner = await setup_session_and_runner(user_id, session_id)
|
|
131
|
-
events = runner.run_async(
|
|
132
|
-
user_id=user_id, session_id=session.id, new_message=content
|
|
133
|
-
)
|
|
134
|
-
|
|
135
|
-
final_response = None
|
|
136
|
-
async for event in events:
|
|
137
|
-
if event.is_final_response():
|
|
138
|
-
final_response = event.content.parts[0].text
|
|
139
|
-
|
|
140
|
-
return final_response
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
@app.entrypoint
|
|
144
|
-
async def invoke(payload, context):
|
|
145
|
-
log.info("Invoking Agent.....")
|
|
146
|
-
|
|
147
|
-
# Process the user prompt
|
|
148
|
-
prompt = payload.get("prompt", "What can you help me with?")
|
|
149
|
-
session_id = getattr(context, "session_id", "default_session")
|
|
150
|
-
user_id = payload.get("user_id", "default_user")
|
|
151
|
-
|
|
152
|
-
# Run the agent
|
|
153
|
-
result = await call_agent_async(prompt, user_id, session_id)
|
|
154
|
-
|
|
155
|
-
# Return result
|
|
156
|
-
return {"result": result}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
if __name__ == "__main__":
|
|
160
|
-
app.run()
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# Package marker
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import logging
|
|
3
|
-
from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset
|
|
4
|
-
from google.adk.tools.mcp_tool.mcp_session_manager import StreamableHTTPConnectionParams
|
|
5
|
-
|
|
6
|
-
logger = logging.getLogger(__name__)
|
|
7
|
-
|
|
8
|
-
{{#if hasGateway}}
|
|
9
|
-
{{#if (includes gatewayAuthTypes "AWS_IAM")}}
|
|
10
|
-
import httpx
|
|
11
|
-
from mcp_proxy_for_aws.sigv4_helper import SigV4HTTPXAuth, create_aws_session
|
|
12
|
-
{{/if}}
|
|
13
|
-
{{#if (includes gatewayAuthTypes "CUSTOM_JWT")}}
|
|
14
|
-
from bedrock_agentcore.identity import requires_access_token
|
|
15
|
-
{{/if}}
|
|
16
|
-
|
|
17
|
-
{{#each gatewayProviders}}
|
|
18
|
-
{{#if (eq authType "CUSTOM_JWT")}}
|
|
19
|
-
@requires_access_token(
|
|
20
|
-
provider_name="{{credentialProviderName}}",
|
|
21
|
-
scopes=[{{#if scopes}}"{{scopes}}"{{/if}}],
|
|
22
|
-
auth_flow="M2M",
|
|
23
|
-
)
|
|
24
|
-
def _get_bearer_token_{{snakeCase name}}(*, access_token: str):
|
|
25
|
-
"""Obtain OAuth access token via AgentCore Identity for {{name}}."""
|
|
26
|
-
return access_token
|
|
27
|
-
|
|
28
|
-
{{/if}}
|
|
29
|
-
{{/each}}
|
|
30
|
-
|
|
31
|
-
def get_all_gateway_mcp_toolsets() -> list[MCPToolset]:
|
|
32
|
-
"""Returns MCP Toolsets for all configured gateways."""
|
|
33
|
-
toolsets = []
|
|
34
|
-
{{#each gatewayProviders}}
|
|
35
|
-
url = os.environ.get("{{envVarName}}")
|
|
36
|
-
if url:
|
|
37
|
-
{{#if (eq authType "AWS_IAM")}}
|
|
38
|
-
session = create_aws_session()
|
|
39
|
-
auth = SigV4HTTPXAuth(session.get_credentials(), "bedrock-agentcore", session.region_name)
|
|
40
|
-
toolsets.append(MCPToolset(connection_params=StreamableHTTPConnectionParams(
|
|
41
|
-
url=url,
|
|
42
|
-
httpx_client_factory=lambda **kwargs: httpx.AsyncClient(auth=auth, **kwargs)
|
|
43
|
-
)))
|
|
44
|
-
{{else if (eq authType "CUSTOM_JWT")}}
|
|
45
|
-
token = _get_bearer_token_{{snakeCase name}}()
|
|
46
|
-
headers = {"Authorization": f"Bearer {token}"} if token else None
|
|
47
|
-
toolsets.append(MCPToolset(connection_params=StreamableHTTPConnectionParams(url=url, headers=headers)))
|
|
48
|
-
{{else}}
|
|
49
|
-
toolsets.append(MCPToolset(connection_params=StreamableHTTPConnectionParams(url=url)))
|
|
50
|
-
{{/if}}
|
|
51
|
-
else:
|
|
52
|
-
logger.warning("{{envVarName}} not set — {{name}} gateway tools unavailable")
|
|
53
|
-
{{/each}}
|
|
54
|
-
return toolsets
|
|
55
|
-
{{else}}
|
|
56
|
-
{{#if isVpc}}
|
|
57
|
-
# VPC mode: external MCP endpoints are not reachable without a NAT gateway.
|
|
58
|
-
# Add an AgentCore Gateway with `agentcore add gateway`, or configure your own endpoint below.
|
|
59
|
-
|
|
60
|
-
def get_streamable_http_mcp_client() -> MCPToolset | None:
|
|
61
|
-
"""No MCP server configured. Add a gateway with `agentcore add gateway`."""
|
|
62
|
-
return None
|
|
63
|
-
{{else}}
|
|
64
|
-
# ExaAI provides information about code through web searches, crawling and code context searches through their platform. Requires no authentication
|
|
65
|
-
EXAMPLE_MCP_ENDPOINT = "https://mcp.exa.ai/mcp"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
def get_streamable_http_mcp_client() -> MCPToolset:
|
|
69
|
-
"""Returns an MCP Toolset compatible with Google ADK."""
|
|
70
|
-
# to use an MCP server that supports bearer authentication, add headers={"Authorization": f"Bearer {access_token}"}
|
|
71
|
-
return MCPToolset(
|
|
72
|
-
connection_params=StreamableHTTPConnectionParams(url=EXAMPLE_MCP_ENDPOINT)
|
|
73
|
-
)
|
|
74
|
-
{{/if}}
|
|
75
|
-
{{/if}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# Package marker
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
from bedrock_agentcore.identity.auth import requires_api_key
|
|
3
|
-
|
|
4
|
-
IDENTITY_PROVIDER_NAME = "{{identityProviders.[0].name}}"
|
|
5
|
-
IDENTITY_ENV_VAR = "{{identityProviders.[0].envVarName}}"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
@requires_api_key(provider_name=IDENTITY_PROVIDER_NAME)
|
|
9
|
-
def _agentcore_identity_api_key_provider(api_key: str) -> str:
|
|
10
|
-
"""Fetch API key from AgentCore Identity."""
|
|
11
|
-
return api_key
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def _get_api_key() -> str:
|
|
15
|
-
"""
|
|
16
|
-
Uses AgentCore Identity for API key management in deployed environments.
|
|
17
|
-
For local development, run via 'agentcore dev' which loads agentcore/.env.
|
|
18
|
-
"""
|
|
19
|
-
if os.getenv("LOCAL_DEV") == "1":
|
|
20
|
-
api_key = os.getenv(IDENTITY_ENV_VAR)
|
|
21
|
-
if not api_key:
|
|
22
|
-
raise RuntimeError(
|
|
23
|
-
f"{IDENTITY_ENV_VAR} not found. Add {IDENTITY_ENV_VAR}=your-key to .env.local"
|
|
24
|
-
)
|
|
25
|
-
return api_key
|
|
26
|
-
return _agentcore_identity_api_key_provider()
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def load_model() -> None:
|
|
30
|
-
"""
|
|
31
|
-
Set up Gemini API key authentication.
|
|
32
|
-
Uses AgentCore Identity for API key management in deployed environments,
|
|
33
|
-
and falls back to .env file for local development.
|
|
34
|
-
Sets the GOOGLE_API_KEY environment variable for the Google ADK.
|
|
35
|
-
"""
|
|
36
|
-
api_key = _get_api_key()
|
|
37
|
-
# Use Google AI Studios API Key Authentication.
|
|
38
|
-
# https://google.github.io/adk-docs/agents/models/#google-ai-studio
|
|
39
|
-
os.environ["GOOGLE_API_KEY"] = api_key
|
|
40
|
-
# Set to TRUE is using Google Vertex AI, Set to FALSE for Google AI Studio
|
|
41
|
-
os.environ["GOOGLE_GENAI_USE_VERTEXAI"] = "FALSE"
|
|
@@ -1,22 +0,0 @@
|
|
|
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 Runtime Application using Google ADK"
|
|
9
|
-
readme = "README.md"
|
|
10
|
-
requires-python = ">=3.10"
|
|
11
|
-
dependencies = [
|
|
12
|
-
"opentelemetry-distro",
|
|
13
|
-
"opentelemetry-exporter-otlp",
|
|
14
|
-
"google-adk >= 1.17.0",
|
|
15
|
-
"bedrock-agentcore >= 1.0.3",
|
|
16
|
-
"botocore[crt] >= 1.35.0",
|
|
17
|
-
{{#if hasGateway}}{{#if (includes gatewayAuthTypes "AWS_IAM")}}"mcp-proxy-for-aws >= 1.1.0",
|
|
18
|
-
{{/if}}{{/if}}
|
|
19
|
-
]
|
|
20
|
-
|
|
21
|
-
[tool.hatch.build.targets.wheel]
|
|
22
|
-
packages = ["."]
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
This is a project generated by the agentcore create CLI tool!
|
|
2
|
-
|
|
3
|
-
# Layout
|
|
4
|
-
|
|
5
|
-
The generated application code lives at the agent root directory. At the root, there is a `.gitignore` file, an
|
|
6
|
-
`agentcore/` folder which represents the configurations and state associated with this project. Other `agentcore`
|
|
7
|
-
commands like `deploy`, `dev`, and `invoke` rely on the configuration stored here.
|
|
8
|
-
|
|
9
|
-
## Agent Root
|
|
10
|
-
|
|
11
|
-
The main entrypoint to your app is defined in `main.py`. Using the AgentCore SDK `@app.entrypoint` decorator, this
|
|
12
|
-
file defines a Starlette ASGI app with the LangChain/LangGraph framework running within.
|
|
13
|
-
|
|
14
|
-
`model/load.py` instantiates your chosen model provider.
|
|
15
|
-
|
|
16
|
-
## Environment Variables
|
|
17
|
-
|
|
18
|
-
| Variable | Required | Description |
|
|
19
|
-
| --- | --- | --- |
|
|
20
|
-
{{#if hasIdentity}}| `{{identityProviders.[0].envVarName}}` | Yes | {{modelProvider}} API key (local) or Identity provider name (deployed) |
|
|
21
|
-
{{/if}}| `LOCAL_DEV` | No | Set to `1` to use `.env.local` instead of AgentCore Identity |
|
|
22
|
-
|
|
23
|
-
# Developing locally
|
|
24
|
-
|
|
25
|
-
If installation was successful, a virtual environment is already created with dependencies installed.
|
|
26
|
-
|
|
27
|
-
Run `source .venv/bin/activate` before developing.
|
|
28
|
-
|
|
29
|
-
`agentcore dev` will start a local server on 0.0.0.0:8080.
|
|
30
|
-
|
|
31
|
-
In a new terminal, you can invoke that server with:
|
|
32
|
-
|
|
33
|
-
`agentcore invoke --dev "What can you do"`
|
|
34
|
-
|
|
35
|
-
# Deployment
|
|
36
|
-
|
|
37
|
-
After providing credentials, `agentcore deploy` will deploy your project into Amazon Bedrock AgentCore.
|
|
38
|
-
|
|
39
|
-
Use `agentcore invoke` to invoke your deployed agent.
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# Environment variables
|
|
2
|
-
.env
|
|
3
|
-
|
|
4
|
-
# Python
|
|
5
|
-
__pycache__/
|
|
6
|
-
*.py[cod]
|
|
7
|
-
*$py.class
|
|
8
|
-
*.so
|
|
9
|
-
.Python
|
|
10
|
-
build/
|
|
11
|
-
develop-eggs/
|
|
12
|
-
dist/
|
|
13
|
-
downloads/
|
|
14
|
-
eggs/
|
|
15
|
-
.eggs/
|
|
16
|
-
lib/
|
|
17
|
-
lib64/
|
|
18
|
-
parts/
|
|
19
|
-
sdist/
|
|
20
|
-
var/
|
|
21
|
-
wheels/
|
|
22
|
-
*.egg-info/
|
|
23
|
-
.installed.cfg
|
|
24
|
-
*.egg
|
|
25
|
-
|
|
26
|
-
# Virtual environments
|
|
27
|
-
.venv/
|
|
28
|
-
venv/
|
|
29
|
-
ENV/
|
|
30
|
-
env/
|
|
31
|
-
|
|
32
|
-
# IDE
|
|
33
|
-
.vscode/
|
|
34
|
-
.idea/
|
|
35
|
-
*.swp
|
|
36
|
-
*.swo
|
|
37
|
-
*~
|
|
38
|
-
|
|
39
|
-
# OS
|
|
40
|
-
.DS_Store
|
|
41
|
-
Thumbs.db
|