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