@aws/agentcore 1.0.0-preview.8 → 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +978 -145
- package/dist/assets/agent-inspector/index.css.asset +1 -0
- package/dist/assets/agent-inspector/index.js.asset +289 -0
- package/dist/assets/cdk/README.md +3 -0
- package/dist/assets/cdk/bin/cdk.ts +109 -59
- package/dist/assets/cdk/lib/cdk-stack.ts +30 -19
- package/dist/assets/cdk/package.json +9 -9
- package/dist/assets/cdk/test/cdk.test.ts +94 -2
- package/dist/assets/evaluators/autoevals-lambda/README.md +23 -0
- package/dist/assets/evaluators/autoevals-lambda/execution-role-policy.json +15 -0
- package/dist/assets/evaluators/autoevals-lambda/lambda_function.py +37 -0
- package/dist/assets/evaluators/autoevals-lambda/pyproject.toml +23 -0
- package/dist/assets/evaluators/deepeval-lambda/README.md +23 -0
- package/dist/assets/evaluators/deepeval-lambda/execution-role-policy.json +15 -0
- package/dist/assets/evaluators/deepeval-lambda/lambda_function.py +29 -0
- package/dist/assets/evaluators/deepeval-lambda/pyproject.toml +22 -0
- package/dist/assets/evaluators/python-lambda/README.md +28 -0
- package/dist/assets/evaluators/python-lambda/pyproject.toml +1 -1
- package/dist/assets/templates/a2a-python-strands/README.md +31 -0
- package/dist/assets/templates/a2a-python-strands/main.py +100 -0
- package/dist/assets/templates/a2a-python-strands/memory/session.py +35 -0
- package/dist/assets/templates/a2a-python-strands/model/load.py +6 -0
- package/dist/assets/templates/a2a-python-strands/pyproject.toml +20 -0
- package/dist/assets/templates/agent-python-langchain/README.md +55 -0
- package/dist/assets/{python/a2a/googleadk/base → templates/agent-python-langchain}/gitignore.template +1 -1
- package/dist/assets/templates/agent-python-langchain/main.py +54 -0
- package/dist/assets/templates/agent-python-langchain/model/load.py +9 -0
- package/dist/assets/templates/agent-python-langchain/pyproject.toml +21 -0
- package/dist/assets/templates/agent-python-minimal/README.md +31 -0
- package/dist/assets/templates/agent-python-minimal/main.py +13 -0
- package/dist/assets/templates/agent-python-minimal/pyproject.toml +18 -0
- package/dist/assets/{container/python/Dockerfile → templates/agent-python-strands/Dockerfile.template} +3 -1
- package/dist/assets/templates/agent-python-strands/README.md +46 -0
- package/dist/assets/{python/a2a/langchain_langgraph/base → templates/agent-python-strands}/gitignore.template +1 -1
- package/dist/assets/templates/agent-python-strands/main.py +106 -0
- package/dist/assets/templates/agent-python-strands/memory/__init__.py +0 -0
- package/dist/assets/templates/agent-python-strands/memory/session.py +35 -0
- package/dist/assets/{python/http/strands/base → templates/agent-python-strands}/model/load.py +46 -0
- package/dist/assets/templates/agent-python-strands/pyproject.toml +24 -0
- package/dist/assets/templates/agent-typescript-strands/README.md +29 -0
- package/dist/assets/templates/agent-typescript-strands/gitignore.template +22 -0
- package/dist/assets/templates/agent-typescript-strands/main.ts +86 -0
- package/dist/assets/templates/agent-typescript-strands/mcp_client/client.ts +11 -0
- package/dist/assets/templates/agent-typescript-strands/memory/memory.ts +44 -0
- package/dist/assets/templates/agent-typescript-strands/model/load.ts +5 -0
- package/dist/assets/templates/agent-typescript-strands/package.json.template +29 -0
- package/dist/assets/templates/agent-typescript-strands/tsconfig.json +19 -0
- package/dist/assets/templates/agent-typescript-vercel/README.md +22 -0
- package/dist/assets/templates/agent-typescript-vercel/gitignore.template +22 -0
- package/dist/assets/templates/agent-typescript-vercel/main.ts +35 -0
- package/dist/assets/templates/agent-typescript-vercel/package.json.template +24 -0
- package/dist/assets/templates/agent-typescript-vercel/tsconfig.json +19 -0
- package/dist/assets/templates/agui-python-strands/README.md +39 -0
- package/dist/assets/{python/a2a/strands/base → templates/agui-python-strands}/gitignore.template +1 -1
- package/dist/assets/{python/agui/strands/base → templates/agui-python-strands}/main.py +11 -14
- package/dist/assets/templates/agui-python-strands/memory/__init__.py +0 -0
- package/dist/assets/templates/agui-python-strands/memory/session.py +35 -0
- package/dist/assets/templates/agui-python-strands/model/load.py +6 -0
- package/dist/assets/templates/agui-python-strands/pyproject.toml +22 -0
- package/dist/assets/{python/http/strands/base → templates/export-harness-python}/README.md +15 -8
- package/dist/assets/templates/export-harness-python/gitignore.template +41 -0
- package/dist/assets/templates/export-harness-python/main.py +584 -0
- package/dist/assets/templates/export-harness-python/mcp_client/client.py +63 -0
- package/dist/assets/templates/export-harness-python/memory/__init__.py +0 -0
- package/dist/assets/templates/export-harness-python/memory/session.py +47 -0
- package/dist/assets/templates/export-harness-python/model/load.py +249 -0
- package/dist/assets/templates/export-harness-python/model/mantle_compat.py +21 -0
- package/dist/assets/templates/export-harness-python/pyproject.toml +22 -0
- package/dist/assets/templates/export-harness-python/skills/fetcher.py +279 -0
- package/dist/assets/templates/mcp-python-fastmcp/README.md +32 -0
- package/dist/assets/templates/mcp-python-fastmcp/gitignore.template +41 -0
- package/dist/assets/templates/mcp-python-fastmcp/main.py +83 -0
- package/dist/assets/{python/mcp/standalone/base → templates/mcp-python-fastmcp}/pyproject.toml +3 -2
- package/dist/assets/templates/shared/env.local.template +11 -0
- package/dist/assets/templates/shared/gitignore.template +19 -0
- package/dist/index.js +4 -27
- package/dist/main.js +1190 -0
- package/package.json +75 -149
- package/LICENSE +0 -175
- package/dist/agent-inspector/index.css +0 -1
- package/dist/agent-inspector/index.js +0 -279
- package/dist/assets/README.md +0 -104
- package/dist/assets/__tests__/__snapshots__/assets.snapshot.test.ts.snap +0 -5673
- package/dist/assets/__tests__/__snapshots__/dockerfile-render.test.ts.snap +0 -77
- package/dist/assets/__tests__/assets.snapshot.test.ts +0 -125
- package/dist/assets/__tests__/dockerfile-render.test.ts +0 -24
- package/dist/assets/agents/AGENTS.md +0 -141
- package/dist/assets/harness/invoke.py.template +0 -74
- package/dist/assets/mcp/python/README.md +0 -27
- package/dist/assets/mcp/python/pyproject.toml +0 -22
- package/dist/assets/mcp/python/server.py +0 -117
- package/dist/assets/mcp/python-lambda/README.md +0 -22
- package/dist/assets/mcp/python-lambda/handler.py +0 -144
- package/dist/assets/mcp/python-lambda/pyproject.toml +0 -15
- package/dist/assets/python/a2a/googleadk/base/README.md +0 -22
- package/dist/assets/python/a2a/googleadk/base/main.py +0 -110
- package/dist/assets/python/a2a/googleadk/base/model/load.py +0 -41
- package/dist/assets/python/a2a/googleadk/base/pyproject.toml +0 -20
- package/dist/assets/python/a2a/langchain_langgraph/base/README.md +0 -22
- package/dist/assets/python/a2a/langchain_langgraph/base/main.py +0 -130
- package/dist/assets/python/a2a/langchain_langgraph/base/model/load.py +0 -123
- package/dist/assets/python/a2a/langchain_langgraph/base/pyproject.toml +0 -25
- package/dist/assets/python/a2a/strands/base/README.md +0 -22
- package/dist/assets/python/a2a/strands/base/main.py +0 -107
- package/dist/assets/python/a2a/strands/base/model/load.py +0 -123
- package/dist/assets/python/a2a/strands/base/pyproject.toml +0 -23
- package/dist/assets/python/a2a/strands/capabilities/memory/session.py +0 -43
- package/dist/assets/python/agui/googleadk/base/README.md +0 -30
- package/dist/assets/python/agui/googleadk/base/gitignore.template +0 -41
- package/dist/assets/python/agui/googleadk/base/main.py +0 -31
- package/dist/assets/python/agui/googleadk/base/model/load.py +0 -41
- package/dist/assets/python/agui/googleadk/base/pyproject.toml +0 -24
- package/dist/assets/python/agui/langchain_langgraph/base/README.md +0 -22
- package/dist/assets/python/agui/langchain_langgraph/base/gitignore.template +0 -41
- package/dist/assets/python/agui/langchain_langgraph/base/main.py +0 -74
- package/dist/assets/python/agui/langchain_langgraph/base/model/load.py +0 -123
- package/dist/assets/python/agui/langchain_langgraph/base/pyproject.toml +0 -30
- package/dist/assets/python/agui/strands/base/README.md +0 -22
- package/dist/assets/python/agui/strands/base/gitignore.template +0 -41
- package/dist/assets/python/agui/strands/base/model/__init__.py +0 -1
- package/dist/assets/python/agui/strands/base/model/load.py +0 -123
- package/dist/assets/python/agui/strands/base/pyproject.toml +0 -27
- package/dist/assets/python/agui/strands/capabilities/memory/__init__.py +0 -1
- package/dist/assets/python/agui/strands/capabilities/memory/session.py +0 -43
- package/dist/assets/python/http/autogen/base/README.md +0 -39
- package/dist/assets/python/http/autogen/base/gitignore.template +0 -41
- package/dist/assets/python/http/autogen/base/main.py +0 -112
- package/dist/assets/python/http/autogen/base/mcp_client/__init__.py +0 -1
- package/dist/assets/python/http/autogen/base/mcp_client/client.py +0 -28
- package/dist/assets/python/http/autogen/base/model/__init__.py +0 -1
- package/dist/assets/python/http/autogen/base/model/load.py +0 -136
- package/dist/assets/python/http/autogen/base/pyproject.toml +0 -34
- package/dist/assets/python/http/googleadk/base/README.md +0 -39
- package/dist/assets/python/http/googleadk/base/gitignore.template +0 -41
- package/dist/assets/python/http/googleadk/base/main.py +0 -160
- package/dist/assets/python/http/googleadk/base/mcp_client/__init__.py +0 -1
- package/dist/assets/python/http/googleadk/base/mcp_client/client.py +0 -75
- package/dist/assets/python/http/googleadk/base/model/__init__.py +0 -1
- package/dist/assets/python/http/googleadk/base/model/load.py +0 -41
- package/dist/assets/python/http/googleadk/base/pyproject.toml +0 -22
- package/dist/assets/python/http/langchain_langgraph/base/README.md +0 -39
- package/dist/assets/python/http/langchain_langgraph/base/gitignore.template +0 -41
- package/dist/assets/python/http/langchain_langgraph/base/main.py +0 -176
- package/dist/assets/python/http/langchain_langgraph/base/mcp_client/__init__.py +0 -1
- package/dist/assets/python/http/langchain_langgraph/base/mcp_client/client.py +0 -77
- package/dist/assets/python/http/langchain_langgraph/base/model/__init__.py +0 -1
- package/dist/assets/python/http/langchain_langgraph/base/model/load.py +0 -123
- package/dist/assets/python/http/langchain_langgraph/base/pyproject.toml +0 -37
- package/dist/assets/python/http/openaiagents/base/README.md +0 -39
- package/dist/assets/python/http/openaiagents/base/gitignore.template +0 -41
- package/dist/assets/python/http/openaiagents/base/main.py +0 -169
- package/dist/assets/python/http/openaiagents/base/mcp_client/__init__.py +0 -1
- package/dist/assets/python/http/openaiagents/base/mcp_client/client.py +0 -74
- package/dist/assets/python/http/openaiagents/base/model/__init__.py +0 -1
- package/dist/assets/python/http/openaiagents/base/model/load.py +0 -37
- package/dist/assets/python/http/openaiagents/base/pyproject.toml +0 -21
- package/dist/assets/python/http/strands/base/main.py +0 -217
- package/dist/assets/python/http/strands/base/mcp_client/__init__.py +0 -1
- package/dist/assets/python/http/strands/base/mcp_client/client.py +0 -73
- package/dist/assets/python/http/strands/base/model/__init__.py +0 -1
- package/dist/assets/python/http/strands/base/pyproject.toml +0 -25
- package/dist/assets/python/http/strands/capabilities/memory/__init__.py +0 -1
- package/dist/assets/python/http/strands/capabilities/memory/session.py +0 -44
- package/dist/assets/python/mcp/standalone/base/README.md +0 -36
- package/dist/assets/python/mcp/standalone/base/gitignore.template +0 -41
- package/dist/assets/python/mcp/standalone/base/main.py +0 -25
- package/dist/cli/index.mjs +0 -1718
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/constants.d.ts +0 -37
- package/dist/lib/constants.d.ts.map +0 -1
- package/dist/lib/constants.js +0 -69
- package/dist/lib/constants.js.map +0 -1
- package/dist/lib/errors/config.d.ts +0 -49
- package/dist/lib/errors/config.d.ts.map +0 -1
- package/dist/lib/errors/config.js +0 -170
- package/dist/lib/errors/config.js.map +0 -1
- package/dist/lib/errors/index.d.ts +0 -2
- package/dist/lib/errors/index.d.ts.map +0 -1
- package/dist/lib/errors/index.js +0 -18
- package/dist/lib/errors/index.js.map +0 -1
- package/dist/lib/index.d.ts +0 -7
- package/dist/lib/index.d.ts.map +0 -1
- package/dist/lib/index.js +0 -44
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/packaging/build-args.d.ts +0 -6
- package/dist/lib/packaging/build-args.d.ts.map +0 -1
- package/dist/lib/packaging/build-args.js +0 -18
- package/dist/lib/packaging/build-args.js.map +0 -1
- package/dist/lib/packaging/container.d.ts +0 -10
- package/dist/lib/packaging/container.d.ts.map +0 -1
- package/dist/lib/packaging/container.js +0 -78
- package/dist/lib/packaging/container.js.map +0 -1
- package/dist/lib/packaging/errors.d.ts +0 -16
- package/dist/lib/packaging/errors.d.ts.map +0 -1
- package/dist/lib/packaging/errors.js +0 -36
- package/dist/lib/packaging/errors.js.map +0 -1
- package/dist/lib/packaging/helpers.d.ts +0 -54
- package/dist/lib/packaging/helpers.d.ts.map +0 -1
- package/dist/lib/packaging/helpers.js +0 -463
- package/dist/lib/packaging/helpers.js.map +0 -1
- package/dist/lib/packaging/index.d.ts +0 -40
- package/dist/lib/packaging/index.d.ts.map +0 -1
- package/dist/lib/packaging/index.js +0 -98
- package/dist/lib/packaging/index.js.map +0 -1
- package/dist/lib/packaging/node.d.ts +0 -22
- package/dist/lib/packaging/node.d.ts.map +0 -1
- package/dist/lib/packaging/node.js +0 -109
- package/dist/lib/packaging/node.js.map +0 -1
- package/dist/lib/packaging/python.d.ts +0 -23
- package/dist/lib/packaging/python.d.ts.map +0 -1
- package/dist/lib/packaging/python.js +0 -165
- package/dist/lib/packaging/python.js.map +0 -1
- package/dist/lib/packaging/types/index.d.ts +0 -2
- package/dist/lib/packaging/types/index.d.ts.map +0 -1
- package/dist/lib/packaging/types/index.js +0 -3
- package/dist/lib/packaging/types/index.js.map +0 -1
- package/dist/lib/packaging/types/packaging.d.ts +0 -57
- package/dist/lib/packaging/types/packaging.d.ts.map +0 -1
- package/dist/lib/packaging/types/packaging.js +0 -3
- package/dist/lib/packaging/types/packaging.js.map +0 -1
- package/dist/lib/packaging/uv.d.ts +0 -7
- package/dist/lib/packaging/uv.d.ts.map +0 -1
- package/dist/lib/packaging/uv.js +0 -40
- package/dist/lib/packaging/uv.js.map +0 -1
- package/dist/lib/schemas/io/config-io.d.ts +0 -119
- package/dist/lib/schemas/io/config-io.d.ts.map +0 -1
- package/dist/lib/schemas/io/config-io.js +0 -323
- package/dist/lib/schemas/io/config-io.js.map +0 -1
- package/dist/lib/schemas/io/global-config.d.ts +0 -33
- package/dist/lib/schemas/io/global-config.d.ts.map +0 -1
- package/dist/lib/schemas/io/global-config.js +0 -89
- package/dist/lib/schemas/io/global-config.js.map +0 -1
- package/dist/lib/schemas/io/index.d.ts +0 -3
- package/dist/lib/schemas/io/index.d.ts.map +0 -1
- package/dist/lib/schemas/io/index.js +0 -18
- package/dist/lib/schemas/io/index.js.map +0 -1
- package/dist/lib/schemas/io/path-resolver.d.ts +0 -119
- package/dist/lib/schemas/io/path-resolver.d.ts.map +0 -1
- package/dist/lib/schemas/io/path-resolver.js +0 -207
- package/dist/lib/schemas/io/path-resolver.js.map +0 -1
- package/dist/lib/utils/aws-account.d.ts +0 -7
- package/dist/lib/utils/aws-account.d.ts.map +0 -1
- package/dist/lib/utils/aws-account.js +0 -24
- package/dist/lib/utils/aws-account.js.map +0 -1
- package/dist/lib/utils/credentials.d.ts +0 -86
- package/dist/lib/utils/credentials.d.ts.map +0 -1
- package/dist/lib/utils/credentials.js +0 -153
- package/dist/lib/utils/credentials.js.map +0 -1
- package/dist/lib/utils/env.d.ts +0 -22
- package/dist/lib/utils/env.d.ts.map +0 -1
- package/dist/lib/utils/env.js +0 -65
- package/dist/lib/utils/env.js.map +0 -1
- package/dist/lib/utils/index.d.ts +0 -9
- package/dist/lib/utils/index.d.ts.map +0 -1
- package/dist/lib/utils/index.js +0 -27
- package/dist/lib/utils/index.js.map +0 -1
- package/dist/lib/utils/json-rpc.d.ts +0 -3
- package/dist/lib/utils/json-rpc.d.ts.map +0 -1
- package/dist/lib/utils/json-rpc.js +0 -27
- package/dist/lib/utils/json-rpc.js.map +0 -1
- package/dist/lib/utils/platform.d.ts +0 -63
- package/dist/lib/utils/platform.d.ts.map +0 -1
- package/dist/lib/utils/platform.js +0 -88
- package/dist/lib/utils/platform.js.map +0 -1
- package/dist/lib/utils/subprocess.d.ts +0 -29
- package/dist/lib/utils/subprocess.d.ts.map +0 -1
- package/dist/lib/utils/subprocess.js +0 -116
- package/dist/lib/utils/subprocess.js.map +0 -1
- package/dist/lib/utils/time-parser.d.ts +0 -11
- package/dist/lib/utils/time-parser.d.ts.map +0 -1
- package/dist/lib/utils/time-parser.js +0 -47
- package/dist/lib/utils/time-parser.js.map +0 -1
- package/dist/lib/utils/zod.d.ts +0 -14
- package/dist/lib/utils/zod.d.ts.map +0 -1
- package/dist/lib/utils/zod.js +0 -32
- package/dist/lib/utils/zod.js.map +0 -1
- package/dist/schema/constants.d.ts +0 -119
- package/dist/schema/constants.d.ts.map +0 -1
- package/dist/schema/constants.js +0 -170
- package/dist/schema/constants.js.map +0 -1
- package/dist/schema/index.d.ts +0 -4
- package/dist/schema/index.d.ts.map +0 -1
- package/dist/schema/index.js +0 -21
- package/dist/schema/index.js.map +0 -1
- package/dist/schema/schemas/agent-env.d.ts +0 -186
- package/dist/schema/schemas/agent-env.d.ts.map +0 -1
- package/dist/schema/schemas/agent-env.js +0 -240
- package/dist/schema/schemas/agent-env.js.map +0 -1
- package/dist/schema/schemas/agentcore-project.d.ts +0 -838
- package/dist/schema/schemas/agentcore-project.d.ts.map +0 -1
- package/dist/schema/schemas/agentcore-project.js +0 -335
- package/dist/schema/schemas/agentcore-project.js.map +0 -1
- package/dist/schema/schemas/auth.d.ts +0 -140
- package/dist/schema/schemas/auth.d.ts.map +0 -1
- package/dist/schema/schemas/auth.js +0 -114
- package/dist/schema/schemas/auth.js.map +0 -1
- package/dist/schema/schemas/aws-targets.d.ts +0 -71
- package/dist/schema/schemas/aws-targets.d.ts.map +0 -1
- package/dist/schema/schemas/aws-targets.js +0 -57
- package/dist/schema/schemas/aws-targets.js.map +0 -1
- package/dist/schema/schemas/deployed-state.d.ts +0 -725
- package/dist/schema/schemas/deployed-state.d.ts.map +0 -1
- package/dist/schema/schemas/deployed-state.js +0 -218
- package/dist/schema/schemas/deployed-state.js.map +0 -1
- package/dist/schema/schemas/index.d.ts +0 -9
- package/dist/schema/schemas/index.d.ts.map +0 -1
- package/dist/schema/schemas/index.js +0 -26
- package/dist/schema/schemas/index.js.map +0 -1
- package/dist/schema/schemas/mcp-defs.d.ts +0 -52
- package/dist/schema/schemas/mcp-defs.d.ts.map +0 -1
- package/dist/schema/schemas/mcp-defs.js +0 -50
- package/dist/schema/schemas/mcp-defs.js.map +0 -1
- package/dist/schema/schemas/mcp.d.ts +0 -820
- package/dist/schema/schemas/mcp.d.ts.map +0 -1
- package/dist/schema/schemas/mcp.js +0 -564
- package/dist/schema/schemas/mcp.js.map +0 -1
- package/dist/schema/schemas/primitives/ab-test.d.ts +0 -141
- package/dist/schema/schemas/primitives/ab-test.d.ts.map +0 -1
- package/dist/schema/schemas/primitives/ab-test.js +0 -97
- package/dist/schema/schemas/primitives/ab-test.js.map +0 -1
- package/dist/schema/schemas/primitives/config-bundle.d.ts +0 -31
- package/dist/schema/schemas/primitives/config-bundle.d.ts.map +0 -1
- package/dist/schema/schemas/primitives/config-bundle.js +0 -38
- package/dist/schema/schemas/primitives/config-bundle.js.map +0 -1
- package/dist/schema/schemas/primitives/evaluator.d.ts +0 -102
- package/dist/schema/schemas/primitives/evaluator.d.ts.map +0 -1
- package/dist/schema/schemas/primitives/evaluator.js +0 -84
- package/dist/schema/schemas/primitives/evaluator.js.map +0 -1
- package/dist/schema/schemas/primitives/harness.d.ts +0 -363
- package/dist/schema/schemas/primitives/harness.d.ts.map +0 -1
- package/dist/schema/schemas/primitives/harness.js +0 -261
- package/dist/schema/schemas/primitives/harness.js.map +0 -1
- package/dist/schema/schemas/primitives/http-gateway.d.ts +0 -21
- package/dist/schema/schemas/primitives/http-gateway.d.ts.map +0 -1
- package/dist/schema/schemas/primitives/http-gateway.js +0 -34
- package/dist/schema/schemas/primitives/http-gateway.js.map +0 -1
- package/dist/schema/schemas/primitives/index.d.ts +0 -15
- package/dist/schema/schemas/primitives/index.d.ts.map +0 -1
- package/dist/schema/schemas/primitives/index.js +0 -61
- package/dist/schema/schemas/primitives/index.js.map +0 -1
- package/dist/schema/schemas/primitives/memory.d.ts +0 -51
- package/dist/schema/schemas/primitives/memory.d.ts.map +0 -1
- package/dist/schema/schemas/primitives/memory.js +0 -73
- package/dist/schema/schemas/primitives/memory.js.map +0 -1
- package/dist/schema/schemas/primitives/online-eval-config.d.ts +0 -14
- package/dist/schema/schemas/primitives/online-eval-config.d.ts.map +0 -1
- package/dist/schema/schemas/primitives/online-eval-config.js +0 -30
- package/dist/schema/schemas/primitives/online-eval-config.js.map +0 -1
- package/dist/schema/schemas/primitives/policy.d.ts +0 -49
- package/dist/schema/schemas/primitives/policy.d.ts.map +0 -1
- package/dist/schema/schemas/primitives/policy.js +0 -62
- package/dist/schema/schemas/primitives/policy.js.map +0 -1
- package/dist/schema/schemas/primitives/tags.d.ts +0 -6
- package/dist/schema/schemas/primitives/tags.d.ts.map +0 -1
- package/dist/schema/schemas/primitives/tags.js +0 -27
- package/dist/schema/schemas/primitives/tags.js.map +0 -1
- package/dist/schema/schemas/zod-util.d.ts +0 -10
- package/dist/schema/schemas/zod-util.d.ts.map +0 -1
- package/dist/schema/schemas/zod-util.js +0 -23
- package/dist/schema/schemas/zod-util.js.map +0 -1
- package/dist/schema/types/index.d.ts +0 -2
- package/dist/schema/types/index.d.ts.map +0 -1
- package/dist/schema/types/index.js +0 -18
- package/dist/schema/types/index.js.map +0 -1
- package/dist/schema/types/path.d.ts +0 -27
- package/dist/schema/types/path.d.ts.map +0 -1
- package/dist/schema/types/path.js +0 -13
- package/dist/schema/types/path.js.map +0 -1
- package/scripts/bump-version.ts +0 -393
- package/scripts/bundle.mjs +0 -219
- package/scripts/check-old-cli.lib.mjs +0 -102
- package/scripts/check-old-cli.mjs +0 -10
- package/scripts/copy-assets.mjs +0 -64
- package/scripts/generate-schema.mjs +0 -40
- package/scripts/run-e2e-local.sh +0 -112
- package/scripts/start-tui-harness.sh +0 -90
- /package/dist/{agent-inspector/favicon.svg → assets/agent-inspector/favicon.svg.asset} +0 -0
- /package/dist/{agent-inspector/index.html → assets/agent-inspector/index.html.asset} +0 -0
- /package/dist/assets/{python/http/strands/base → templates/a2a-python-strands}/gitignore.template +0 -0
- /package/dist/assets/{typescript/.gitkeep → templates/a2a-python-strands/memory/__init__.py} +0 -0
- /package/dist/assets/{python/a2a/googleadk/base → templates/a2a-python-strands}/model/__init__.py +0 -0
- /package/dist/assets/{python/a2a/langchain_langgraph/base → templates/agent-python-langchain}/model/__init__.py +0 -0
- /package/dist/assets/{container/python → templates/agent-python-strands}/dockerignore.template +0 -0
- /package/dist/assets/{python/a2a/strands/base → templates/agent-python-strands}/model/__init__.py +0 -0
- /package/dist/assets/{python/a2a/strands/capabilities/memory → templates/agui-python-strands/model}/__init__.py +0 -0
- /package/dist/assets/{python/agui/googleadk/base/model → templates/export-harness-python/mcp_client}/__init__.py +0 -0
- /package/dist/assets/{python/agui/langchain_langgraph/base → templates/export-harness-python}/model/__init__.py +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"path.js","sourceRoot":"","sources":["../../../src/schema/types/path.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,6BAAwB;AAExB,sCAAsC;AACzB,QAAA,cAAc,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC"}
|
package/scripts/bump-version.ts
DELETED
|
@@ -1,393 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env npx tsx
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Version bump script for AgentCore CLI
|
|
5
|
-
*
|
|
6
|
-
* Usage:
|
|
7
|
-
* npx tsx scripts/bump-version.ts <bump_type> [options]
|
|
8
|
-
*
|
|
9
|
-
* Arguments:
|
|
10
|
-
* bump_type: major | minor | patch | prerelease
|
|
11
|
-
*
|
|
12
|
-
* Options:
|
|
13
|
-
* --changelog <text> Custom changelog entry
|
|
14
|
-
* --prerelease-tag <tag> Prerelease identifier (default: beta)
|
|
15
|
-
* --dry-run Show what would be done without making changes
|
|
16
|
-
*/
|
|
17
|
-
import { execSync } from 'child_process';
|
|
18
|
-
import { existsSync, readFileSync, writeFileSync } from 'fs';
|
|
19
|
-
|
|
20
|
-
// ===========================
|
|
21
|
-
// Types
|
|
22
|
-
// ===========================
|
|
23
|
-
|
|
24
|
-
type BumpType = 'major' | 'minor' | 'patch' | 'prerelease';
|
|
25
|
-
|
|
26
|
-
interface ParsedVersion {
|
|
27
|
-
major: number;
|
|
28
|
-
minor: number;
|
|
29
|
-
patch: number;
|
|
30
|
-
prerelease?: string;
|
|
31
|
-
prereleaseNum?: number;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
interface PackageJson {
|
|
35
|
-
version: string;
|
|
36
|
-
[key: string]: unknown;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
interface PackageLockJson {
|
|
40
|
-
version: string;
|
|
41
|
-
packages?: {
|
|
42
|
-
''?: { version: string };
|
|
43
|
-
[key: string]: unknown;
|
|
44
|
-
};
|
|
45
|
-
[key: string]: unknown;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// ===========================
|
|
49
|
-
// Version Parsing & Bumping
|
|
50
|
-
// ===========================
|
|
51
|
-
|
|
52
|
-
function parseVersion(version: string): ParsedVersion {
|
|
53
|
-
// Match standard versions like: 1.2.3, 1.2.3-beta.1, 1.2.3-rc.0
|
|
54
|
-
const match = /^(\d+)\.(\d+)\.(\d+)(?:-([a-zA-Z]+)\.(\d+))?$/.exec(version);
|
|
55
|
-
|
|
56
|
-
if (!match) {
|
|
57
|
-
throw new Error(`Invalid version format: ${version}`);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return {
|
|
61
|
-
major: parseInt(match[1]!, 10),
|
|
62
|
-
minor: parseInt(match[2]!, 10),
|
|
63
|
-
patch: parseInt(match[3]!, 10),
|
|
64
|
-
prerelease: match[4],
|
|
65
|
-
prereleaseNum: match[5] ? parseInt(match[5], 10) : undefined,
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function formatVersion(parsed: ParsedVersion): string {
|
|
70
|
-
const base = `${parsed.major}.${parsed.minor}.${parsed.patch}`;
|
|
71
|
-
|
|
72
|
-
// Handle standard prerelease format: X.Y.Z-tag.N
|
|
73
|
-
if (parsed.prerelease !== undefined && parsed.prereleaseNum !== undefined) {
|
|
74
|
-
return `${base}-${parsed.prerelease}.${parsed.prereleaseNum}`;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return base;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function bumpVersion(current: string, bumpType: BumpType, prereleaseTag = 'beta'): string {
|
|
81
|
-
const parsed = parseVersion(current);
|
|
82
|
-
|
|
83
|
-
switch (bumpType) {
|
|
84
|
-
case 'major':
|
|
85
|
-
return formatVersion({
|
|
86
|
-
major: parsed.major + 1,
|
|
87
|
-
minor: 0,
|
|
88
|
-
patch: 0,
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
case 'minor':
|
|
92
|
-
return formatVersion({
|
|
93
|
-
major: parsed.major,
|
|
94
|
-
minor: parsed.minor + 1,
|
|
95
|
-
patch: 0,
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
case 'patch':
|
|
99
|
-
// If currently a prerelease, just remove the suffix
|
|
100
|
-
if (parsed.prerelease) {
|
|
101
|
-
return formatVersion({
|
|
102
|
-
major: parsed.major,
|
|
103
|
-
minor: parsed.minor,
|
|
104
|
-
patch: parsed.patch,
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
return formatVersion({
|
|
108
|
-
major: parsed.major,
|
|
109
|
-
minor: parsed.minor,
|
|
110
|
-
patch: parsed.patch + 1,
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
case 'prerelease':
|
|
114
|
-
// If already a prerelease with same tag, increment the number
|
|
115
|
-
if (parsed.prerelease === prereleaseTag && parsed.prereleaseNum !== undefined) {
|
|
116
|
-
return formatVersion({
|
|
117
|
-
major: parsed.major,
|
|
118
|
-
minor: parsed.minor,
|
|
119
|
-
patch: parsed.patch,
|
|
120
|
-
prerelease: prereleaseTag,
|
|
121
|
-
prereleaseNum: parsed.prereleaseNum + 1,
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
// Otherwise, bump patch and start new prerelease
|
|
125
|
-
return formatVersion({
|
|
126
|
-
major: parsed.major,
|
|
127
|
-
minor: parsed.minor,
|
|
128
|
-
patch: parsed.prerelease ? parsed.patch : parsed.patch + 1,
|
|
129
|
-
prerelease: prereleaseTag,
|
|
130
|
-
prereleaseNum: 0,
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
default: {
|
|
134
|
-
const exhaustiveCheck: never = bumpType;
|
|
135
|
-
throw new Error(`Unknown bump type: ${exhaustiveCheck as string}`);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
// ===========================
|
|
141
|
-
// File Operations
|
|
142
|
-
// ===========================
|
|
143
|
-
|
|
144
|
-
function getCurrentVersion(): string {
|
|
145
|
-
const packageJson = JSON.parse(readFileSync('package.json', 'utf-8')) as PackageJson;
|
|
146
|
-
return packageJson.version;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
function updatePackageJson(newVersion: string): void {
|
|
150
|
-
const packageJson = JSON.parse(readFileSync('package.json', 'utf-8')) as PackageJson;
|
|
151
|
-
packageJson.version = newVersion;
|
|
152
|
-
writeFileSync('package.json', JSON.stringify(packageJson, null, 2) + '\n');
|
|
153
|
-
console.log('✓ Updated package.json');
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
function updatePackageLockJson(newVersion: string): void {
|
|
157
|
-
if (!existsSync('package-lock.json')) {
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
const packageLock = JSON.parse(readFileSync('package-lock.json', 'utf-8')) as PackageLockJson;
|
|
162
|
-
packageLock.version = newVersion;
|
|
163
|
-
|
|
164
|
-
// Also update the root package in packages
|
|
165
|
-
if (packageLock.packages?.['']) {
|
|
166
|
-
packageLock.packages[''].version = newVersion;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
writeFileSync('package-lock.json', JSON.stringify(packageLock, null, 2) + '\n');
|
|
170
|
-
console.log('✓ Updated package-lock.json');
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
// ===========================
|
|
174
|
-
// Git Log & Changelog
|
|
175
|
-
// ===========================
|
|
176
|
-
|
|
177
|
-
function getGitLog(sinceTag?: string): string {
|
|
178
|
-
try {
|
|
179
|
-
let cmd = 'git log --pretty=format:"- %s (%h)"';
|
|
180
|
-
|
|
181
|
-
if (sinceTag) {
|
|
182
|
-
cmd += ` ${sinceTag}..HEAD`;
|
|
183
|
-
} else {
|
|
184
|
-
// Try to get the last tag
|
|
185
|
-
try {
|
|
186
|
-
const lastTag = execSync('git describe --tags --abbrev=0', { encoding: 'utf-8' }).trim();
|
|
187
|
-
cmd += ` ${lastTag}..HEAD`;
|
|
188
|
-
} catch {
|
|
189
|
-
// No tags exist, get last 20 commits
|
|
190
|
-
cmd += ' -n 20';
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
return execSync(cmd, { encoding: 'utf-8' });
|
|
195
|
-
} catch {
|
|
196
|
-
return '';
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
interface CategorizedChanges {
|
|
201
|
-
features: string[];
|
|
202
|
-
fixes: string[];
|
|
203
|
-
docs: string[];
|
|
204
|
-
other: string[];
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
function categorizeCommits(gitLog: string): CategorizedChanges {
|
|
208
|
-
const result: CategorizedChanges = {
|
|
209
|
-
features: [],
|
|
210
|
-
fixes: [],
|
|
211
|
-
docs: [],
|
|
212
|
-
other: [],
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
for (const line of gitLog.split('\n')) {
|
|
216
|
-
const trimmed = line.trim();
|
|
217
|
-
if (!trimmed?.startsWith('-')) continue;
|
|
218
|
-
|
|
219
|
-
const msg = trimmed.slice(2).trim();
|
|
220
|
-
|
|
221
|
-
if (msg.startsWith('feat:') || msg.startsWith('feature:')) {
|
|
222
|
-
result.features.push(msg);
|
|
223
|
-
} else if (msg.startsWith('fix:') || msg.startsWith('bugfix:')) {
|
|
224
|
-
result.fixes.push(msg);
|
|
225
|
-
} else if (msg.startsWith('docs:') || msg.startsWith('doc:')) {
|
|
226
|
-
result.docs.push(msg);
|
|
227
|
-
} else {
|
|
228
|
-
result.other.push(msg);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
return result;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
function formatChangelog(changes: CategorizedChanges): string {
|
|
236
|
-
const sections: string[] = [];
|
|
237
|
-
|
|
238
|
-
if (changes.features.length > 0) {
|
|
239
|
-
sections.push('### Added\n' + changes.features.map(m => `- ${m}`).join('\n'));
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
if (changes.fixes.length > 0) {
|
|
243
|
-
sections.push('### Fixed\n' + changes.fixes.map(m => `- ${m}`).join('\n'));
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
if (changes.docs.length > 0) {
|
|
247
|
-
sections.push('### Documentation\n' + changes.docs.map(m => `- ${m}`).join('\n'));
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
if (changes.other.length > 0) {
|
|
251
|
-
sections.push('### Other Changes\n' + changes.other.map(m => `- ${m}`).join('\n'));
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
return sections.join('\n\n');
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
function updateChangelog(newVersion: string, customChanges?: string): void {
|
|
258
|
-
const changelogPath = 'CHANGELOG.md';
|
|
259
|
-
const date = new Date().toISOString().split('T')[0];
|
|
260
|
-
|
|
261
|
-
// Build the new entry
|
|
262
|
-
let entryContent = '';
|
|
263
|
-
if (customChanges) {
|
|
264
|
-
entryContent = `### Changes\n\n${customChanges}`;
|
|
265
|
-
} else {
|
|
266
|
-
console.log('\n⚠️ No changelog provided. Auto-generating from commits.');
|
|
267
|
-
console.log('💡 Tip: Use --changelog to provide meaningful release notes');
|
|
268
|
-
|
|
269
|
-
const gitLog = getGitLog();
|
|
270
|
-
if (gitLog) {
|
|
271
|
-
const categorized = categorizeCommits(gitLog);
|
|
272
|
-
const formatted = formatChangelog(categorized);
|
|
273
|
-
entryContent = formatted || `### Changes\n\n${gitLog}`;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
const entry = `## [${newVersion}] - ${date}\n\n${entryContent}`;
|
|
278
|
-
|
|
279
|
-
let content: string;
|
|
280
|
-
if (existsSync(changelogPath)) {
|
|
281
|
-
content = readFileSync(changelogPath, 'utf-8');
|
|
282
|
-
|
|
283
|
-
// Find where to insert (after # Changelog header line)
|
|
284
|
-
const lines = content.split('\n');
|
|
285
|
-
const headerIndex = lines.findIndex(line => line.startsWith('# Changelog'));
|
|
286
|
-
|
|
287
|
-
if (headerIndex !== -1) {
|
|
288
|
-
// Find the next ## or end of preamble (first non-empty line after a blank line)
|
|
289
|
-
let insertAt = headerIndex + 1;
|
|
290
|
-
|
|
291
|
-
// Skip blank lines and description text until we hit an existing ## or end
|
|
292
|
-
while (insertAt < lines.length && !lines[insertAt]?.startsWith('## ')) {
|
|
293
|
-
insertAt++;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
// Insert the new entry
|
|
297
|
-
lines.splice(insertAt, 0, '', entry, '');
|
|
298
|
-
content = lines.join('\n');
|
|
299
|
-
} else {
|
|
300
|
-
// No header found, prepend everything
|
|
301
|
-
content = `# Changelog\n\n${entry}\n\n${content}`;
|
|
302
|
-
}
|
|
303
|
-
} else {
|
|
304
|
-
content = `# Changelog\n\nAll notable changes to this project will be documented in this file.\n\n${entry}\n`;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
// Clean up multiple consecutive blank lines
|
|
308
|
-
content = content.replace(/\n{3,}/g, '\n\n');
|
|
309
|
-
|
|
310
|
-
// Ensure single trailing newline
|
|
311
|
-
content = content.trimEnd() + '\n';
|
|
312
|
-
|
|
313
|
-
writeFileSync(changelogPath, content);
|
|
314
|
-
console.log('✓ Updated CHANGELOG.md');
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
// ===========================
|
|
318
|
-
// CLI
|
|
319
|
-
// ===========================
|
|
320
|
-
|
|
321
|
-
function parseArgs(): { bumpType: BumpType; changelog?: string; prereleaseTag: string; dryRun: boolean } {
|
|
322
|
-
const args = process.argv.slice(2);
|
|
323
|
-
|
|
324
|
-
if (args.length === 0 || args[0] === '--help' || args[0] === '-h') {
|
|
325
|
-
console.log(`
|
|
326
|
-
Usage: npx tsx scripts/bump-version.ts <bump_type> [options]
|
|
327
|
-
|
|
328
|
-
Arguments:
|
|
329
|
-
bump_type: major | minor | patch | prerelease
|
|
330
|
-
|
|
331
|
-
Options:
|
|
332
|
-
--changelog <text> Custom changelog entry
|
|
333
|
-
--prerelease-tag <tag> Prerelease identifier (default: beta)
|
|
334
|
-
--dry-run Show what would be done without making changes
|
|
335
|
-
--help, -h Show this help message
|
|
336
|
-
`);
|
|
337
|
-
process.exit(0);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
const bumpType = args[0] as BumpType;
|
|
341
|
-
if (!['major', 'minor', 'patch', 'prerelease'].includes(bumpType)) {
|
|
342
|
-
console.error(`Error: Invalid bump type '${bumpType}'. Must be one of: major, minor, patch, prerelease`);
|
|
343
|
-
process.exit(1);
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
let changelog: string | undefined;
|
|
347
|
-
let prereleaseTag = 'beta';
|
|
348
|
-
let dryRun = false;
|
|
349
|
-
|
|
350
|
-
for (let i = 1; i < args.length; i++) {
|
|
351
|
-
if (args[i] === '--changelog' && args[i + 1]) {
|
|
352
|
-
changelog = args[++i];
|
|
353
|
-
} else if (args[i] === '--prerelease-tag' && args[i + 1]) {
|
|
354
|
-
prereleaseTag = args[++i]!;
|
|
355
|
-
} else if (args[i] === '--dry-run') {
|
|
356
|
-
dryRun = true;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
return { bumpType, changelog, prereleaseTag, dryRun };
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
function main(): void {
|
|
364
|
-
const { bumpType, changelog, prereleaseTag, dryRun } = parseArgs();
|
|
365
|
-
|
|
366
|
-
try {
|
|
367
|
-
const currentVersion = getCurrentVersion();
|
|
368
|
-
const newVersion = bumpVersion(currentVersion, bumpType, prereleaseTag);
|
|
369
|
-
|
|
370
|
-
console.log(`Current version: ${currentVersion}`);
|
|
371
|
-
console.log(`New version: ${newVersion}`);
|
|
372
|
-
|
|
373
|
-
if (dryRun) {
|
|
374
|
-
console.log('\nDry run - no changes made');
|
|
375
|
-
return;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
updatePackageJson(newVersion);
|
|
379
|
-
updatePackageLockJson(newVersion);
|
|
380
|
-
updateChangelog(newVersion, changelog);
|
|
381
|
-
|
|
382
|
-
console.log(`\n✓ Version bumped from ${currentVersion} to ${newVersion}`);
|
|
383
|
-
console.log('\nNext steps:');
|
|
384
|
-
console.log('1. Review changes: git diff');
|
|
385
|
-
console.log(`2. Commit: git add -A && git commit -m 'chore: bump version to ${newVersion}'`);
|
|
386
|
-
console.log('3. Create PR or push to trigger release workflow');
|
|
387
|
-
} catch (error) {
|
|
388
|
-
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
389
|
-
process.exit(1);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
main();
|
package/scripts/bundle.mjs
DELETED
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* bundle.mjs — Single command to build CLI + CDK constructs + frontend into one tarball.
|
|
3
|
-
*
|
|
4
|
-
* This is a testing-only workflow. It does NOT modify the default build or
|
|
5
|
-
* deployment flow. The normal `npm run build` + `npm pack` pipeline is unchanged.
|
|
6
|
-
*
|
|
7
|
-
* What this script does differently: after building both packages normally, it
|
|
8
|
-
* packs the CDK constructs into a tarball and places it in the CLI's dist/assets/.
|
|
9
|
-
* At `agentcore create` time, CDKRenderer detects this tarball and installs it
|
|
10
|
-
* after the normal `npm install`, overriding the registry version.
|
|
11
|
-
*
|
|
12
|
-
* It also builds the @aws/agent-inspector frontend and copies its dist-assets
|
|
13
|
-
* into the CLI's dist/agent-inspector/ directory, overriding the npm registry version.
|
|
14
|
-
*
|
|
15
|
-
* Usage:
|
|
16
|
-
* node scripts/bundle.mjs
|
|
17
|
-
* npm run bundle
|
|
18
|
-
*
|
|
19
|
-
* Environment variables:
|
|
20
|
-
* AGENTCORE_CDK_PATH — absolute path to the agentcore-l3-cdk-constructs repo
|
|
21
|
-
* AGENT_INSPECTOR_PATH — absolute path to the agent-inspector repo
|
|
22
|
-
*/
|
|
23
|
-
import { execFileSync } from 'node:child_process';
|
|
24
|
-
import * as fs from 'node:fs';
|
|
25
|
-
import * as path from 'node:path';
|
|
26
|
-
import { fileURLToPath } from 'node:url';
|
|
27
|
-
|
|
28
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
29
|
-
const __dirname = path.dirname(__filename);
|
|
30
|
-
const cliRoot = path.resolve(__dirname, '..');
|
|
31
|
-
|
|
32
|
-
const CDK_REPO_URL = 'https://github.com/aws/agentcore-l3-cdk-constructs.git';
|
|
33
|
-
|
|
34
|
-
function log(msg) {
|
|
35
|
-
console.log(`\n[bundle] ${msg}`);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function run(cmd, args = [], opts = {}) {
|
|
39
|
-
const display = [cmd, ...args].join(' ');
|
|
40
|
-
console.log(` > ${display}`);
|
|
41
|
-
execFileSync(cmd, args, { stdio: 'inherit', ...opts });
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Resolve the CDK constructs repo path. Priority:
|
|
46
|
-
* 1. AGENTCORE_CDK_PATH env var
|
|
47
|
-
* 2. Sibling directory ../agentcore-l3-cdk-constructs
|
|
48
|
-
* 3. Clone from GitHub into a temp directory under the CLI repo
|
|
49
|
-
*/
|
|
50
|
-
function resolveCdkPath() {
|
|
51
|
-
// 1. Env var
|
|
52
|
-
if (process.env.AGENTCORE_CDK_PATH) {
|
|
53
|
-
const p = path.resolve(process.env.AGENTCORE_CDK_PATH);
|
|
54
|
-
if (fs.existsSync(path.join(p, 'package.json'))) {
|
|
55
|
-
log(`Using CDK constructs from AGENTCORE_CDK_PATH: ${p}`);
|
|
56
|
-
return p;
|
|
57
|
-
}
|
|
58
|
-
console.warn(` WARNING: AGENTCORE_CDK_PATH=${p} does not contain package.json, ignoring.`);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// 2. Sibling directory
|
|
62
|
-
const sibling = path.resolve(cliRoot, '..', 'agentcore-l3-cdk-constructs');
|
|
63
|
-
if (fs.existsSync(path.join(sibling, 'package.json'))) {
|
|
64
|
-
log(`Using CDK constructs from sibling directory: ${sibling}`);
|
|
65
|
-
return sibling;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// 3. Clone latest from GitHub
|
|
69
|
-
const cloneDir = path.join(cliRoot, '.cdk-constructs-clone');
|
|
70
|
-
log(`CDK constructs repo not found locally. Cloning latest from GitHub...`);
|
|
71
|
-
|
|
72
|
-
if (fs.existsSync(cloneDir)) {
|
|
73
|
-
log('Pulling latest changes...');
|
|
74
|
-
run('git', ['pull', 'origin', 'main'], { cwd: cloneDir });
|
|
75
|
-
} else {
|
|
76
|
-
run('git', ['clone', '--depth', '1', CDK_REPO_URL, cloneDir]);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return cloneDir;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Resolve the agent-inspector repo path. Priority:
|
|
84
|
-
* 1. AGENT_INSPECTOR_PATH env var
|
|
85
|
-
* 2. Sibling directory ../agent-inspector
|
|
86
|
-
*/
|
|
87
|
-
function resolveInspectorPath() {
|
|
88
|
-
if (process.env.AGENT_INSPECTOR_PATH) {
|
|
89
|
-
const p = path.resolve(process.env.AGENT_INSPECTOR_PATH);
|
|
90
|
-
if (fs.existsSync(path.join(p, 'package.json'))) {
|
|
91
|
-
log(`Using agent-inspector from AGENT_INSPECTOR_PATH: ${p}`);
|
|
92
|
-
return p;
|
|
93
|
-
}
|
|
94
|
-
console.warn(` WARNING: AGENT_INSPECTOR_PATH=${p} does not contain package.json, ignoring.`);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const sibling = path.resolve(cliRoot, '..', 'agent-inspector');
|
|
98
|
-
if (fs.existsSync(path.join(sibling, 'package.json'))) {
|
|
99
|
-
log(`Using agent-inspector from sibling directory: ${sibling}`);
|
|
100
|
-
return sibling;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// ---------------------------------------------------------------------------
|
|
107
|
-
// Main
|
|
108
|
-
// ---------------------------------------------------------------------------
|
|
109
|
-
|
|
110
|
-
log('Starting bundle process...');
|
|
111
|
-
|
|
112
|
-
const now = new Date();
|
|
113
|
-
const timestamp = now.toISOString().replace(/[-:T]/g, '').slice(0, 14);
|
|
114
|
-
log(`Bundle timestamp: ${timestamp}`);
|
|
115
|
-
|
|
116
|
-
// Helper to bump a package version with a unique e2e timestamp tag.
|
|
117
|
-
// Saves the original version so it can be restored after packing.
|
|
118
|
-
function bumpVersion(pkgDir) {
|
|
119
|
-
const pkgJsonPath = path.join(pkgDir, 'package.json');
|
|
120
|
-
const pkg = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf8'));
|
|
121
|
-
const originalVersion = pkg.version;
|
|
122
|
-
const baseVersion = originalVersion.split('-')[0];
|
|
123
|
-
const prerelease = originalVersion.includes('-') ? originalVersion.split('-').slice(1).join('-') : '';
|
|
124
|
-
const tag = prerelease ? `${prerelease}-${timestamp}` : timestamp;
|
|
125
|
-
pkg.version = `${baseVersion}-${tag}`;
|
|
126
|
-
fs.writeFileSync(pkgJsonPath, JSON.stringify(pkg, null, 2) + '\n');
|
|
127
|
-
log(`Bumped ${pkg.name} version: ${originalVersion} -> ${pkg.version}`);
|
|
128
|
-
return { pkgJsonPath, originalVersion, bumpedVersion: pkg.version };
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function restoreVersion({ pkgJsonPath, originalVersion }) {
|
|
132
|
-
const pkg = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf8'));
|
|
133
|
-
pkg.version = originalVersion;
|
|
134
|
-
fs.writeFileSync(pkgJsonPath, JSON.stringify(pkg, null, 2) + '\n');
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// Step 1: Resolve and build CDK constructs
|
|
138
|
-
const cdkPath = resolveCdkPath();
|
|
139
|
-
|
|
140
|
-
log('Installing CDK constructs dependencies...');
|
|
141
|
-
run('npm', ['install'], { cwd: cdkPath });
|
|
142
|
-
|
|
143
|
-
log('Building CDK constructs...');
|
|
144
|
-
run('npm', ['run', 'build'], { cwd: cdkPath });
|
|
145
|
-
|
|
146
|
-
// Step 2: Bump CDK version and pack into a tarball
|
|
147
|
-
const cdkVersionInfo = bumpVersion(cdkPath);
|
|
148
|
-
try {
|
|
149
|
-
log('Packing CDK constructs...');
|
|
150
|
-
run('npm', ['pack'], { cwd: cdkPath });
|
|
151
|
-
} finally {
|
|
152
|
-
restoreVersion(cdkVersionInfo);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
const cdkTarballName = `aws-agentcore-cdk-${cdkVersionInfo.bumpedVersion}.tgz`;
|
|
156
|
-
const cdkTarballSrc = path.join(cdkPath, cdkTarballName);
|
|
157
|
-
|
|
158
|
-
if (!fs.existsSync(cdkTarballSrc)) {
|
|
159
|
-
console.error(`ERROR: Expected CDK tarball at ${cdkTarballSrc} but not found.`);
|
|
160
|
-
process.exit(1);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
// Step 3: Build CLI normally (no modifications to copy-assets)
|
|
164
|
-
log('Installing CLI dependencies...');
|
|
165
|
-
run('npm', ['install'], { cwd: cliRoot });
|
|
166
|
-
|
|
167
|
-
log('Building CLI...');
|
|
168
|
-
run('npm', ['run', 'build'], { cwd: cliRoot });
|
|
169
|
-
|
|
170
|
-
// Step 4: Copy CDK tarball into dist/assets/ so CDKRenderer can detect it
|
|
171
|
-
const bundledTarballDest = path.join(cliRoot, 'dist', 'assets', 'bundled-agentcore-cdk.tgz');
|
|
172
|
-
fs.copyFileSync(cdkTarballSrc, bundledTarballDest);
|
|
173
|
-
log(`Placed CDK tarball at ${bundledTarballDest}`);
|
|
174
|
-
|
|
175
|
-
// Step 5: Build and bundle agent-inspector frontend (overrides the npm version)
|
|
176
|
-
const inspectorPath = resolveInspectorPath();
|
|
177
|
-
if (inspectorPath) {
|
|
178
|
-
log('Installing agent-inspector dependencies...');
|
|
179
|
-
run('npm', ['install'], { cwd: inspectorPath });
|
|
180
|
-
|
|
181
|
-
log('Building agent-inspector...');
|
|
182
|
-
run('npm', ['run', 'build'], { cwd: inspectorPath });
|
|
183
|
-
|
|
184
|
-
const inspectorDistSrc = path.join(inspectorPath, 'dist-assets');
|
|
185
|
-
const inspectorDistDest = path.join(cliRoot, 'dist', 'agent-inspector');
|
|
186
|
-
|
|
187
|
-
if (fs.existsSync(inspectorDistSrc)) {
|
|
188
|
-
if (fs.existsSync(inspectorDistDest)) {
|
|
189
|
-
fs.rmSync(inspectorDistDest, { recursive: true });
|
|
190
|
-
}
|
|
191
|
-
fs.cpSync(inspectorDistSrc, inspectorDistDest, { recursive: true });
|
|
192
|
-
log(`Copied agent-inspector frontend to ${inspectorDistDest}`);
|
|
193
|
-
} else {
|
|
194
|
-
console.error(`ERROR: agent-inspector build did not produce dist-assets/ at ${inspectorDistSrc}`);
|
|
195
|
-
process.exit(1);
|
|
196
|
-
}
|
|
197
|
-
} else {
|
|
198
|
-
log('No local agent-inspector found — using npm registry version.');
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
// Step 6: Bump CLI version and pack into final tarball (includes the bundled CDK tarball + frontend)
|
|
202
|
-
const cliVersionInfo = bumpVersion(cliRoot);
|
|
203
|
-
try {
|
|
204
|
-
log('Packing CLI tarball...');
|
|
205
|
-
run('npm', ['pack'], { cwd: cliRoot });
|
|
206
|
-
} finally {
|
|
207
|
-
restoreVersion(cliVersionInfo);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
const cliTarballName = `aws-agentcore-${cliVersionInfo.bumpedVersion}.tgz`;
|
|
211
|
-
const cliTarballPath = path.join(cliRoot, cliTarballName);
|
|
212
|
-
|
|
213
|
-
if (fs.existsSync(cliTarballPath)) {
|
|
214
|
-
log(`Done! Tarball: ${cliTarballPath}`);
|
|
215
|
-
log(`Install with: npm install ${cliTarballPath}`);
|
|
216
|
-
log('When you run agentcore create, the bundled CDK constructs will be installed automatically.');
|
|
217
|
-
} else {
|
|
218
|
-
log(`Done! Check ${cliRoot} for the .tgz file.`);
|
|
219
|
-
}
|