@aws/agentcore 1.0.0-preview.9 → 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
package/dist/assets/{python/http/strands/base → templates/agent-python-strands}/model/load.py
RENAMED
|
@@ -121,3 +121,49 @@ def load_model() -> GeminiModel:
|
|
|
121
121
|
model_id="gemini-2.5-flash",
|
|
122
122
|
)
|
|
123
123
|
{{/if}}
|
|
124
|
+
{{#if (eq modelProvider "LiteLLM")}}
|
|
125
|
+
{{#if identityProviders.[0].name}}
|
|
126
|
+
import os
|
|
127
|
+
|
|
128
|
+
{{/if}}
|
|
129
|
+
from strands.models.litellm import LiteLLMModel
|
|
130
|
+
{{#if identityProviders.[0].name}}
|
|
131
|
+
from bedrock_agentcore.identity.auth import requires_api_key
|
|
132
|
+
|
|
133
|
+
IDENTITY_PROVIDER_NAME = "{{identityProviders.[0].name}}"
|
|
134
|
+
IDENTITY_ENV_VAR = "{{identityProviders.[0].envVarName}}"
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
@requires_api_key(provider_name=IDENTITY_PROVIDER_NAME)
|
|
138
|
+
def _agentcore_identity_api_key_provider(api_key: str) -> str:
|
|
139
|
+
"""Fetch API key from AgentCore Identity."""
|
|
140
|
+
return api_key
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
def _get_api_key() -> str:
|
|
144
|
+
"""
|
|
145
|
+
Uses AgentCore Identity for API key management in deployed environments.
|
|
146
|
+
For local development, run via 'agentcore dev' which loads agentcore/.env.
|
|
147
|
+
"""
|
|
148
|
+
if os.getenv("LOCAL_DEV") == "1":
|
|
149
|
+
api_key = os.getenv(IDENTITY_ENV_VAR)
|
|
150
|
+
if not api_key:
|
|
151
|
+
raise RuntimeError(
|
|
152
|
+
f"{IDENTITY_ENV_VAR} not found. Add {IDENTITY_ENV_VAR}=your-key to .env.local"
|
|
153
|
+
)
|
|
154
|
+
return api_key
|
|
155
|
+
return _agentcore_identity_api_key_provider()
|
|
156
|
+
{{/if}}
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def load_model() -> LiteLLMModel:
|
|
160
|
+
"""Get a LiteLLM model client (proxies to the provider encoded in model_id)."""
|
|
161
|
+
client_args = {}
|
|
162
|
+
{{#if identityProviders.[0].name}}
|
|
163
|
+
client_args["api_key"] = _get_api_key()
|
|
164
|
+
{{/if}}
|
|
165
|
+
return LiteLLMModel(
|
|
166
|
+
client_args=client_args,
|
|
167
|
+
model_id="bedrock/us.anthropic.claude-sonnet-4-5-20250514-v1:0",
|
|
168
|
+
)
|
|
169
|
+
{{/if}}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling ~= 1.27.0"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "{{ name }}"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "AgentCore Runtime Application using Strands SDK"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
dependencies = [
|
|
12
|
+
"aws-opentelemetry-distro ~= 0.18.0",
|
|
13
|
+
"bedrock-agentcore ~= 1.9.1",
|
|
14
|
+
"botocore[crt] ~= 1.43.0",
|
|
15
|
+
{{#if (eq modelProvider "Anthropic")}}"strands-agents[anthropic] ~= 1.15.0",
|
|
16
|
+
{{else}}{{#if (eq modelProvider "OpenAI")}}"strands-agents[openai] ~= 1.15.0",
|
|
17
|
+
{{else}}{{#if (eq modelProvider "Gemini")}}"strands-agents[gemini] ~= 1.15.0",
|
|
18
|
+
{{else}}{{#if (eq modelProvider "LiteLLM")}}"strands-agents[litellm] ~= 1.15.0",
|
|
19
|
+
{{else}}"strands-agents ~= 1.15.0",
|
|
20
|
+
{{/if}}{{/if}}{{/if}}{{/if}}
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[tool.hatch.build.targets.wheel]
|
|
24
|
+
packages = ["."]
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
This is a project generated by the AgentCore CLI!
|
|
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.ts`. Using the AgentCore SDK `BedrockAgentCoreApp`, this file
|
|
12
|
+
defines an HTTP server that streams tokens from your chosen Agent framework SDK.
|
|
13
|
+
|
|
14
|
+
`model/load.ts` instantiates your chosen model provider.
|
|
15
|
+
|
|
16
|
+
## Input Validation
|
|
17
|
+
|
|
18
|
+
The generated Zod request schema keeps plain prompts typed as strings before forwarding them to Strands. Retain this
|
|
19
|
+
validation when extending the request shape, and pass only prompt text to the agent.
|
|
20
|
+
|
|
21
|
+
# Developing locally
|
|
22
|
+
|
|
23
|
+
If installation was successful, `node_modules/` is already populated with dependencies.
|
|
24
|
+
|
|
25
|
+
`agentcore project dev` will start a local server using `tsx watch main.ts` for hot reload on 0.0.0.0:8080.
|
|
26
|
+
|
|
27
|
+
# Deployment
|
|
28
|
+
|
|
29
|
+
After providing credentials, `agentcore project deploy` will deploy your project into Amazon Bedrock AgentCore.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { BedrockAgentCoreApp } from 'bedrock-agentcore/runtime';
|
|
2
|
+
import { Agent, McpClient, tool, type ToolList } from '@strands-agents/sdk';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { loadModel } from './model/load.js';
|
|
5
|
+
import { getStreamableHttpMcpClient } from './mcp_client/client.js';
|
|
6
|
+
import { getActorId, getOrCreateMemoryManager } from './memory/memory.js';
|
|
7
|
+
|
|
8
|
+
// Define a collection of MCP clients (filter out anything that failed to initialize)
|
|
9
|
+
const mcpClients: McpClient[] = [getStreamableHttpMcpClient()].filter(
|
|
10
|
+
(client): client is McpClient => Boolean(client)
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
// Define a collection of tools used by the model
|
|
14
|
+
const tools: ToolList = [];
|
|
15
|
+
|
|
16
|
+
// Define a simple function tool — the Zod schema gives us type inference and runtime validation for free
|
|
17
|
+
const addNumbers = tool({
|
|
18
|
+
name: 'add_numbers',
|
|
19
|
+
description: 'Return the sum of two numbers',
|
|
20
|
+
inputSchema: z.object({
|
|
21
|
+
a: z.number(),
|
|
22
|
+
b: z.number(),
|
|
23
|
+
}),
|
|
24
|
+
callback: async ({ a, b }) => a + b,
|
|
25
|
+
});
|
|
26
|
+
tools.push(addNumbers);
|
|
27
|
+
|
|
28
|
+
// Add MCP clients to tools
|
|
29
|
+
tools.push(...mcpClients);
|
|
30
|
+
|
|
31
|
+
const SYSTEM_PROMPT = `
|
|
32
|
+
You are a helpful assistant. Use tools when appropriate.
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
const requestSchema = z.object({
|
|
36
|
+
prompt: z.string().default(''),
|
|
37
|
+
userId: z.string().optional(),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const agentCache = new Map<string, Agent>();
|
|
41
|
+
|
|
42
|
+
async function getOrCreateAgent(sessionId: string, actorId: string): Promise<Agent> {
|
|
43
|
+
const key = `${actorId}:${sessionId}`;
|
|
44
|
+
let agent = agentCache.get(key);
|
|
45
|
+
if (agent) return agent;
|
|
46
|
+
|
|
47
|
+
const model = await loadModel();
|
|
48
|
+
agent = new Agent({
|
|
49
|
+
model,
|
|
50
|
+
systemPrompt: SYSTEM_PROMPT,
|
|
51
|
+
tools,
|
|
52
|
+
memoryManager: getOrCreateMemoryManager(sessionId, actorId) ?? undefined,
|
|
53
|
+
});
|
|
54
|
+
agentCache.set(key, agent);
|
|
55
|
+
return agent;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const app = new BedrockAgentCoreApp({
|
|
59
|
+
invocationHandler: {
|
|
60
|
+
requestSchema,
|
|
61
|
+
async *process(payload, context) {
|
|
62
|
+
const sessionId = context?.sessionId ?? 'default-session';
|
|
63
|
+
const actorId = getActorId(payload, context);
|
|
64
|
+
const agent = await getOrCreateAgent(sessionId, actorId);
|
|
65
|
+
|
|
66
|
+
try {
|
|
67
|
+
for await (const event of agent.stream(payload.prompt)) {
|
|
68
|
+
if (
|
|
69
|
+
event.type === 'modelStreamUpdateEvent' &&
|
|
70
|
+
event.event?.type === 'modelContentBlockDeltaEvent' &&
|
|
71
|
+
event.event.delta?.type === 'textDelta'
|
|
72
|
+
) {
|
|
73
|
+
yield { data: event.event.delta.text };
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
} finally {
|
|
77
|
+
// Drain in-flight createEvent calls before the runtime can reclaim
|
|
78
|
+
// the session microVM. flush() is the durability mechanism — without
|
|
79
|
+
// it, an idle reclamation can lose the tail of the conversation.
|
|
80
|
+
await agent.memoryManager?.flush();
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
app.run({ port: parseInt(process.env.PORT ?? '8080') });
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { McpClient } from '@strands-agents/sdk';
|
|
2
|
+
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
3
|
+
|
|
4
|
+
// ExaAI provides information about code through web searches, crawling and code context searches through their platform. Requires no authentication
|
|
5
|
+
const EXAMPLE_MCP_ENDPOINT = 'https://mcp.exa.ai/mcp';
|
|
6
|
+
|
|
7
|
+
export function getStreamableHttpMcpClient(): McpClient {
|
|
8
|
+
// to use an MCP server that supports bearer authentication, add a headers() callback to requestInit
|
|
9
|
+
const transport = new StreamableHTTPClientTransport(new URL(EXAMPLE_MCP_ENDPOINT));
|
|
10
|
+
return new McpClient({ transport });
|
|
11
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { MemoryManager } from '@strands-agents/sdk';
|
|
3
|
+
import { createAgentCoreMemoryStores } from 'bedrock-agentcore/experimental/memory/strands';
|
|
4
|
+
|
|
5
|
+
const MEMORY_ID = process.env.{{memoryEnvVarName}};
|
|
6
|
+
|
|
7
|
+
const CUSTOM_ACTOR_ID_HEADER = 'x-amzn-bedrock-agentcore-runtime-custom-actor-id';
|
|
8
|
+
|
|
9
|
+
export function getActorId(payload: any, context: any): string {
|
|
10
|
+
const raw =
|
|
11
|
+
context?.headers?.[CUSTOM_ACTOR_ID_HEADER] ||
|
|
12
|
+
payload?.userId ||
|
|
13
|
+
context?.sessionId;
|
|
14
|
+
return typeof raw === 'string' && raw.trim().length > 0 ? raw.trim() : randomUUID();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const memoryManagerCache = new Map<string, MemoryManager>();
|
|
18
|
+
|
|
19
|
+
export function getOrCreateMemoryManager(sessionId: string, actorId: string): MemoryManager | null {
|
|
20
|
+
if (!MEMORY_ID) return null;
|
|
21
|
+
|
|
22
|
+
const key = `${actorId}:${sessionId}`;
|
|
23
|
+
let manager = memoryManagerCache.get(key);
|
|
24
|
+
if (manager) return manager;
|
|
25
|
+
|
|
26
|
+
const stores = createAgentCoreMemoryStores({
|
|
27
|
+
memoryId: MEMORY_ID,
|
|
28
|
+
actorId,
|
|
29
|
+
sessionId,
|
|
30
|
+
namespaces: [
|
|
31
|
+
{ namespace: '/users/{actorId}/facts' },
|
|
32
|
+
{ namespace: '/users/{actorId}/preferences' },
|
|
33
|
+
{ namespace: '/episodes/{actorId}/{sessionId}' },
|
|
34
|
+
{ namespace: '/summaries/{actorId}/{sessionId}' },
|
|
35
|
+
],
|
|
36
|
+
// readMode defaults to 'per-namespace' (one retrieve call per namespace).
|
|
37
|
+
// Switch to 'subtree' to consolidate to a single hierarchical recall call.
|
|
38
|
+
extraction: true,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
manager = new MemoryManager({ stores });
|
|
42
|
+
memoryManagerCache.set(key, manager);
|
|
43
|
+
return manager;
|
|
44
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{name}}",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "AgentCore Runtime Application using Strands TypeScript SDK",
|
|
5
|
+
"private": true,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"start": "node dist/main.js",
|
|
10
|
+
"dev": "tsx watch main.ts"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@modelcontextprotocol/sdk": "~1.25.2",
|
|
14
|
+
"@opentelemetry/api": "~1.9.0",
|
|
15
|
+
"@strands-agents/sdk": "~1.5.0",
|
|
16
|
+
"bedrock-agentcore": "~0.3.0",
|
|
17
|
+
"tsx": "~4.19.0",
|
|
18
|
+
"zod": "~4.4.3"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@types/node": "~22.0.0",
|
|
22
|
+
"typescript": "~5.6.0"
|
|
23
|
+
},
|
|
24
|
+
"overrides": {
|
|
25
|
+
"bedrock-agentcore": {
|
|
26
|
+
"@strands-agents/sdk": "$@strands-agents/sdk"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"forceConsistentCasingInFileNames": true,
|
|
10
|
+
"resolveJsonModule": true,
|
|
11
|
+
"declaration": false,
|
|
12
|
+
"sourceMap": true,
|
|
13
|
+
"outDir": "dist",
|
|
14
|
+
"rootDir": ".",
|
|
15
|
+
"types": ["node"]
|
|
16
|
+
},
|
|
17
|
+
"include": ["**/*.ts"],
|
|
18
|
+
"exclude": ["node_modules", "dist"]
|
|
19
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
This is a project generated by the AgentCore CLI!
|
|
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.ts`. Using the AgentCore SDK `BedrockAgentCoreApp`, this file
|
|
12
|
+
defines an HTTP server that streams tokens from Amazon Bedrock via the Vercel AI SDK's `streamText` API.
|
|
13
|
+
|
|
14
|
+
# Developing locally
|
|
15
|
+
|
|
16
|
+
If installation was successful, `node_modules/` is already populated with dependencies.
|
|
17
|
+
|
|
18
|
+
`agentcore project dev` will start a local server using `tsx watch main.ts` for hot reload on 0.0.0.0:8080.
|
|
19
|
+
|
|
20
|
+
# Deployment
|
|
21
|
+
|
|
22
|
+
After providing credentials, `agentcore project deploy` will deploy your project into Amazon Bedrock AgentCore.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { BedrockAgentCoreApp } from 'bedrock-agentcore/runtime';
|
|
2
|
+
import { createAmazonBedrock } from '@ai-sdk/amazon-bedrock';
|
|
3
|
+
import { fromNodeProviderChain } from '@aws-sdk/credential-providers';
|
|
4
|
+
import { streamText } from 'ai';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
|
|
7
|
+
const SYSTEM_PROMPT = `You are a helpful assistant.`;
|
|
8
|
+
|
|
9
|
+
const bedrock = createAmazonBedrock({
|
|
10
|
+
region: process.env.AWS_REGION ?? 'us-east-1',
|
|
11
|
+
credentialProvider: fromNodeProviderChain(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const requestSchema = z.object({
|
|
15
|
+
prompt: z.string().default(''),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const app = new BedrockAgentCoreApp({
|
|
19
|
+
invocationHandler: {
|
|
20
|
+
requestSchema,
|
|
21
|
+
async *process(payload) {
|
|
22
|
+
const result = streamText({
|
|
23
|
+
model: bedrock('global.anthropic.claude-sonnet-4-5-20250929-v1:0'),
|
|
24
|
+
system: SYSTEM_PROMPT,
|
|
25
|
+
prompt: payload.prompt,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
for await (const chunk of result.textStream) {
|
|
29
|
+
yield { data: chunk };
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
app.run({ port: parseInt(process.env.PORT ?? '8080') });
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{name}}",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "AgentCore Runtime Application using the Vercel AI SDK",
|
|
5
|
+
"private": true,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"start": "node dist/main.js",
|
|
10
|
+
"dev": "tsx watch main.ts"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@ai-sdk/amazon-bedrock": "~4.0.0",
|
|
14
|
+
"@aws-sdk/credential-providers": "~3.1126.0",
|
|
15
|
+
"ai": "~6.0.0",
|
|
16
|
+
"bedrock-agentcore": "~0.3.0",
|
|
17
|
+
"tsx": "~4.19.0",
|
|
18
|
+
"zod": "~4.4.3"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@types/node": "~22.0.0",
|
|
22
|
+
"typescript": "~5.6.0"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"forceConsistentCasingInFileNames": true,
|
|
10
|
+
"resolveJsonModule": true,
|
|
11
|
+
"declaration": false,
|
|
12
|
+
"sourceMap": true,
|
|
13
|
+
"outDir": "dist",
|
|
14
|
+
"rootDir": ".",
|
|
15
|
+
"types": ["node"]
|
|
16
|
+
},
|
|
17
|
+
"include": ["**/*.ts"],
|
|
18
|
+
"exclude": ["node_modules", "dist"]
|
|
19
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# {{ name }}
|
|
2
|
+
|
|
3
|
+
An AG-UI agent deployed on Amazon Bedrock AgentCore using the Strands SDK.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This agent speaks the [AG-UI protocol](https://docs.ag-ui.com/introduction), which
|
|
8
|
+
streams agent-to-UI events over HTTP. It exposes an `/invocations` endpoint that accepts
|
|
9
|
+
an AG-UI `RunAgentInput` body and streams the response back as AG-UI server-sent events,
|
|
10
|
+
matching the AgentCore Runtime HTTP service contract.
|
|
11
|
+
|
|
12
|
+
## Adding Tools
|
|
13
|
+
|
|
14
|
+
Define tools with the `@tool` decorator in `main.py` and add them to the agent's `tools` list:
|
|
15
|
+
|
|
16
|
+
```python
|
|
17
|
+
@tool
|
|
18
|
+
def my_tool(param: str) -> str:
|
|
19
|
+
"""Description of what the tool does."""
|
|
20
|
+
return f"Result: {param}"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Developing locally
|
|
24
|
+
|
|
25
|
+
`agentcore project dev` starts the agent locally on `0.0.0.0:8080`. Post an AG-UI
|
|
26
|
+
`RunAgentInput` body to `http://127.0.0.1:8080/invocations` to invoke it, and check its
|
|
27
|
+
health at `http://127.0.0.1:8080/ping`.
|
|
28
|
+
|
|
29
|
+
## Deployment
|
|
30
|
+
|
|
31
|
+
`agentcore project deploy` deploys the agent into Amazon Bedrock AgentCore. Invoke the deployed
|
|
32
|
+
runtime with an AG-UI `RunAgentInput` payload:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
agentcore project invoke runtime --name agui_python_strands \
|
|
36
|
+
--payload '{"threadId":"t1","runId":"r1","state":{},"messages":[{"id":"m1","role":"user","content":"Hello!"}],"tools":[],"context":[],"forwardedProps":{}}'
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The response streams back as AG-UI server-sent events.
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import os
|
|
2
2
|
|
|
3
|
-
# Suppress OpenTelemetry warnings during local development; remove for production
|
|
4
|
-
if os.getenv("LOCAL_DEV") == "1":
|
|
5
|
-
os.environ["OTEL_SDK_DISABLED"] = "true"
|
|
6
|
-
|
|
7
3
|
import uvicorn
|
|
8
4
|
from strands import Agent, tool
|
|
9
5
|
from ag_ui_strands import StrandsAgent, StrandsAgentConfig, create_strands_app
|
|
10
6
|
from model.load import load_model
|
|
11
|
-
{{#if hasMemory}}
|
|
12
7
|
from memory.session import get_memory_session_manager
|
|
13
|
-
{{/if}}
|
|
14
8
|
|
|
15
9
|
|
|
16
10
|
@tool
|
|
@@ -19,24 +13,27 @@ def add_numbers(a: int, b: int) -> int:
|
|
|
19
13
|
return a + b
|
|
20
14
|
|
|
21
15
|
|
|
22
|
-
tools = [add_numbers]
|
|
23
|
-
|
|
24
16
|
agent = Agent(
|
|
25
17
|
model=load_model(),
|
|
26
18
|
system_prompt="You are a helpful assistant. Use tools when appropriate.",
|
|
27
|
-
tools=
|
|
19
|
+
tools=[add_numbers],
|
|
28
20
|
)
|
|
29
21
|
|
|
30
|
-
|
|
22
|
+
# The AG-UI protocol carries a per-conversation thread_id; each thread gets its
|
|
23
|
+
# own session manager so history is scoped to the conversation. Returns None
|
|
24
|
+
# (in-process history only) until the deployed MEMORY_ID env var is set.
|
|
31
25
|
def session_manager_provider(input_data):
|
|
32
26
|
return get_memory_session_manager(input_data.thread_id, "default-user")
|
|
33
27
|
|
|
28
|
+
|
|
34
29
|
config = StrandsAgentConfig(session_manager_provider=session_manager_provider)
|
|
35
|
-
{{else}}
|
|
36
|
-
config = StrandsAgentConfig()
|
|
37
|
-
{{/if}}
|
|
38
30
|
|
|
39
|
-
agui_agent = StrandsAgent(
|
|
31
|
+
agui_agent = StrandsAgent(
|
|
32
|
+
agent=agent, name="{{ name }}", description="A helpful assistant", config=config
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
# create_strands_app publishes the AG-UI endpoint at /invocations and a health
|
|
36
|
+
# check at /ping, matching the AgentCore Runtime HTTP service contract on 8080.
|
|
40
37
|
app = create_strands_app(agui_agent, path="/invocations", ping_path="/ping")
|
|
41
38
|
|
|
42
39
|
if __name__ == "__main__":
|
|
File without changes
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import uuid
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
from bedrock_agentcore.memory.integrations.strands.config import AgentCoreMemoryConfig, RetrievalConfig
|
|
6
|
+
from bedrock_agentcore.memory.integrations.strands.session_manager import AgentCoreMemorySessionManager
|
|
7
|
+
|
|
8
|
+
MEMORY_ID = os.getenv("{{memoryEnvVarName}}")
|
|
9
|
+
REGION = os.getenv("AWS_REGION")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def get_memory_session_manager(
|
|
13
|
+
session_id: Optional[str], actor_id: str
|
|
14
|
+
) -> Optional[AgentCoreMemorySessionManager]:
|
|
15
|
+
if not MEMORY_ID:
|
|
16
|
+
return None
|
|
17
|
+
|
|
18
|
+
session_id = session_id or uuid.uuid4().hex
|
|
19
|
+
|
|
20
|
+
retrieval_config = {
|
|
21
|
+
f"/users/{actor_id}/facts": RetrievalConfig(top_k=3, relevance_score=0.5),
|
|
22
|
+
f"/users/{actor_id}/preferences": RetrievalConfig(top_k=3, relevance_score=0.5),
|
|
23
|
+
f"/episodes/{actor_id}/{session_id}": RetrievalConfig(top_k=5, relevance_score=0.5),
|
|
24
|
+
f"/summaries/{actor_id}": RetrievalConfig(top_k=3, relevance_score=0.5),
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return AgentCoreMemorySessionManager(
|
|
28
|
+
AgentCoreMemoryConfig(
|
|
29
|
+
memory_id=MEMORY_ID,
|
|
30
|
+
session_id=session_id,
|
|
31
|
+
actor_id=actor_id,
|
|
32
|
+
retrieval_config=retrieval_config,
|
|
33
|
+
),
|
|
34
|
+
REGION,
|
|
35
|
+
)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling ~= 1.27.0"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "{{ name }}"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "AgentCore AG-UI Agent using Strands SDK"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.12"
|
|
11
|
+
dependencies = [
|
|
12
|
+
"ag-ui-strands >= 0.3.0, < 0.4.0",
|
|
13
|
+
"ag-ui-protocol >= 0.1.19, < 0.2.0",
|
|
14
|
+
"aws-opentelemetry-distro ~= 0.17.0",
|
|
15
|
+
"bedrock-agentcore ~= 1.9.1",
|
|
16
|
+
"botocore[crt] ~= 1.43.0",
|
|
17
|
+
"strands-agents ~= 1.15.0",
|
|
18
|
+
"uvicorn >= 0.34.3, < 1.0.0",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
[tool.hatch.build.targets.wheel]
|
|
22
|
+
packages = ["."]
|
|
@@ -13,6 +13,12 @@ file defines a Starlette ASGI app with the chosen Agent framework SDK running wi
|
|
|
13
13
|
|
|
14
14
|
`model/load.py` instantiates your chosen model provider.
|
|
15
15
|
|
|
16
|
+
## Input Validation
|
|
17
|
+
|
|
18
|
+
Validate invocation input before forwarding it to Strands. Keep plain prompts typed as strings. If the app accepts a
|
|
19
|
+
caller-supplied message history, retain `strip_trailing_tool_use()`, which normalizes the history tail before
|
|
20
|
+
invoking the agent.
|
|
21
|
+
|
|
16
22
|
## Environment Variables
|
|
17
23
|
|
|
18
24
|
| Variable | Required | Description |
|
|
@@ -24,16 +30,17 @@ file defines a Starlette ASGI app with the chosen Agent framework SDK running wi
|
|
|
24
30
|
|
|
25
31
|
If installation was successful, a virtual environment is already created with dependencies installed.
|
|
26
32
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
`agentcore dev` will start a local server on 0.0.0.0:8080.
|
|
33
|
+
Activate the environment with `source .venv/bin/activate` on macOS/Linux, `.venv\Scripts\activate.bat` in Windows
|
|
34
|
+
Command Prompt, or `.\.venv\Scripts\activate.ps1` in Windows PowerShell.
|
|
30
35
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
`agentcore invoke --dev "What can you do"`
|
|
36
|
+
`agentcore project dev` will start a local server on 0.0.0.0:8080.
|
|
34
37
|
|
|
35
38
|
# Deployment
|
|
36
39
|
|
|
37
|
-
After providing credentials, `agentcore deploy` will deploy your project into Amazon Bedrock AgentCore.
|
|
40
|
+
After providing credentials, `agentcore project deploy` will deploy your project into Amazon Bedrock AgentCore.
|
|
41
|
+
|
|
42
|
+
Invoke the deployed Runtime with its native payload:
|
|
38
43
|
|
|
39
|
-
|
|
44
|
+
```bash
|
|
45
|
+
agentcore project invoke runtime --payload '{"prompt":"Hello!"}'
|
|
46
|
+
```
|