@aws/agentcore 0.12.2 → 0.13.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 +26 -10
- package/dist/agent-inspector/index.css +1 -1
- package/dist/agent-inspector/index.js +86 -81
- package/dist/assets/__tests__/__snapshots__/assets.snapshot.test.ts.snap +125 -17
- package/dist/assets/cdk/test/cdk.test.ts +1 -0
- package/dist/assets/python/http/langchain_langgraph/base/main.py +52 -8
- package/dist/assets/python/http/strands/base/main.py +71 -8
- package/dist/cli/index.mjs +972 -610
- package/dist/lib/packaging/build-args.js +2 -2
- package/dist/lib/packaging/build-args.js.map +1 -1
- package/dist/lib/packaging/helpers.d.ts.map +1 -1
- package/dist/lib/packaging/helpers.js +10 -6
- package/dist/lib/packaging/helpers.js.map +1 -1
- package/dist/lib/schemas/io/config-io.d.ts.map +1 -1
- package/dist/lib/schemas/io/config-io.js +9 -1
- package/dist/lib/schemas/io/config-io.js.map +1 -1
- package/dist/lib/schemas/io/global-config.d.ts +33 -0
- package/dist/lib/schemas/io/global-config.d.ts.map +1 -0
- package/dist/lib/schemas/io/global-config.js +89 -0
- package/dist/lib/schemas/io/global-config.js.map +1 -0
- package/dist/lib/schemas/io/index.d.ts +0 -1
- package/dist/lib/schemas/io/index.d.ts.map +1 -1
- package/dist/lib/schemas/io/index.js +1 -3
- package/dist/lib/schemas/io/index.js.map +1 -1
- package/dist/schema/schemas/agentcore-project.d.ts +81 -0
- package/dist/schema/schemas/agentcore-project.d.ts.map +1 -1
- package/dist/schema/schemas/agentcore-project.js +87 -1
- package/dist/schema/schemas/agentcore-project.js.map +1 -1
- package/dist/schema/schemas/deployed-state.d.ts +113 -0
- package/dist/schema/schemas/deployed-state.d.ts.map +1 -1
- package/dist/schema/schemas/deployed-state.js +40 -1
- package/dist/schema/schemas/deployed-state.js.map +1 -1
- package/dist/schema/schemas/mcp.js +1 -1
- package/dist/schema/schemas/mcp.js.map +1 -1
- package/dist/schema/schemas/primitives/ab-test.d.ts +141 -0
- package/dist/schema/schemas/primitives/ab-test.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/ab-test.js +97 -0
- package/dist/schema/schemas/primitives/ab-test.js.map +1 -0
- package/dist/schema/schemas/primitives/config-bundle.d.ts +31 -0
- package/dist/schema/schemas/primitives/config-bundle.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/config-bundle.js +38 -0
- package/dist/schema/schemas/primitives/config-bundle.js.map +1 -0
- package/dist/schema/schemas/primitives/http-gateway.d.ts +21 -0
- package/dist/schema/schemas/primitives/http-gateway.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/http-gateway.js +34 -0
- package/dist/schema/schemas/primitives/http-gateway.js.map +1 -0
- package/dist/schema/schemas/primitives/index.d.ts +4 -0
- package/dist/schema/schemas/primitives/index.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/index.js +15 -1
- package/dist/schema/schemas/primitives/index.js.map +1 -1
- package/dist/schema/schemas/primitives/online-eval-config.d.ts +1 -0
- package/dist/schema/schemas/primitives/online-eval-config.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/online-eval-config.js +2 -0
- package/dist/schema/schemas/primitives/online-eval-config.js.map +1 -1
- package/package.json +6 -4
- package/scripts/bundle.mjs +5 -2
- package/scripts/run-e2e-local.sh +112 -0
- 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
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Run E2E tests locally, replicating the GitHub Actions e2e-tests.yml workflow.
|
|
3
|
+
#
|
|
4
|
+
# Required env vars:
|
|
5
|
+
# E2E_ROLE_ARN — IAM role ARN to assume (grants access to the test account)
|
|
6
|
+
# E2E_SECRET_ARN — Secrets Manager ARN containing ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY
|
|
7
|
+
#
|
|
8
|
+
# Optional env vars:
|
|
9
|
+
# AWS_REGION — defaults to us-east-1
|
|
10
|
+
#
|
|
11
|
+
# Usage:
|
|
12
|
+
# export E2E_ROLE_ARN=arn:aws:iam::<account>:role/<role>
|
|
13
|
+
# export E2E_SECRET_ARN=arn:aws:secretsmanager:<region>:<account>:secret:<name>
|
|
14
|
+
# ./scripts/run-e2e-local.sh # runs strands-bedrock.test.ts (CI default)
|
|
15
|
+
# ./scripts/run-e2e-local.sh --all # runs the full e2e suite
|
|
16
|
+
# ./scripts/run-e2e-local.sh e2e-tests/foo.test.ts # runs a specific test file
|
|
17
|
+
#
|
|
18
|
+
# Prerequisites: aws CLI, node >=20.19, npm, git, uv, jq
|
|
19
|
+
|
|
20
|
+
set -euo pipefail
|
|
21
|
+
|
|
22
|
+
ROLE_ARN="${E2E_ROLE_ARN:-}"
|
|
23
|
+
SECRET_ARN="${E2E_SECRET_ARN:-}"
|
|
24
|
+
AWS_REGION="${AWS_REGION:-us-east-1}"
|
|
25
|
+
|
|
26
|
+
if [[ -z "$ROLE_ARN" ]]; then
|
|
27
|
+
echo "❌ E2E_ROLE_ARN is not set. Export it before running this script:"
|
|
28
|
+
echo " export E2E_ROLE_ARN=arn:aws:iam::<account>:role/<role-name>"
|
|
29
|
+
exit 1
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
if [[ -z "$SECRET_ARN" ]]; then
|
|
33
|
+
echo "❌ E2E_SECRET_ARN is not set. Export it before running this script:"
|
|
34
|
+
echo " export E2E_SECRET_ARN=arn:aws:secretsmanager:<region>:<account>:secret:<name>"
|
|
35
|
+
exit 1
|
|
36
|
+
fi
|
|
37
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
38
|
+
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
39
|
+
|
|
40
|
+
# ── Parse arguments ────────────────────────────────────────────────────────────
|
|
41
|
+
RUN_ALL=false
|
|
42
|
+
TEST_FILES=()
|
|
43
|
+
for arg in "$@"; do
|
|
44
|
+
if [[ "$arg" == "--all" ]]; then
|
|
45
|
+
RUN_ALL=true
|
|
46
|
+
else
|
|
47
|
+
TEST_FILES+=("$arg")
|
|
48
|
+
fi
|
|
49
|
+
done
|
|
50
|
+
|
|
51
|
+
echo "=== Assuming IAM role ==="
|
|
52
|
+
CREDS=$(aws sts assume-role \
|
|
53
|
+
--role-arn "$ROLE_ARN" \
|
|
54
|
+
--role-session-name "local-e2e-$(date +%s)" \
|
|
55
|
+
--duration-seconds 3600 \
|
|
56
|
+
--query 'Credentials.[AccessKeyId,SecretAccessKey,SessionToken]' \
|
|
57
|
+
--output text)
|
|
58
|
+
|
|
59
|
+
export AWS_ACCESS_KEY_ID=$(echo "$CREDS" | awk '{print $1}')
|
|
60
|
+
export AWS_SECRET_ACCESS_KEY=$(echo "$CREDS" | awk '{print $2}')
|
|
61
|
+
export AWS_SESSION_TOKEN=$(echo "$CREDS" | awk '{print $3}')
|
|
62
|
+
export AWS_REGION
|
|
63
|
+
|
|
64
|
+
echo "✅ Assumed role successfully"
|
|
65
|
+
|
|
66
|
+
echo "=== Fetching API keys from Secrets Manager ==="
|
|
67
|
+
SECRET_JSON=$(aws secretsmanager get-secret-value \
|
|
68
|
+
--secret-id "$SECRET_ARN" \
|
|
69
|
+
--region "$AWS_REGION" \
|
|
70
|
+
--query SecretString \
|
|
71
|
+
--output text)
|
|
72
|
+
|
|
73
|
+
# Mirror the GitHub workflow: parse-json-secrets maps keys to E2E_<KEY> then
|
|
74
|
+
# the workflow maps them to the bare names the tests expect.
|
|
75
|
+
export ANTHROPIC_API_KEY=$(echo "$SECRET_JSON" | jq -r '.ANTHROPIC_API_KEY // empty')
|
|
76
|
+
export OPENAI_API_KEY=$(echo "$SECRET_JSON" | jq -r '.OPENAI_API_KEY // empty')
|
|
77
|
+
export GEMINI_API_KEY=$(echo "$SECRET_JSON" | jq -r '.GEMINI_API_KEY // empty')
|
|
78
|
+
|
|
79
|
+
echo "✅ Secrets loaded (keys present: $(echo "$SECRET_JSON" | jq -r 'keys | join(", ")')"
|
|
80
|
+
|
|
81
|
+
echo "=== Setting AWS account env var ==="
|
|
82
|
+
export AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
|
|
83
|
+
echo "✅ AWS_ACCOUNT_ID=$AWS_ACCOUNT_ID AWS_REGION=$AWS_REGION"
|
|
84
|
+
|
|
85
|
+
echo "=== Configuring git (required for agentcore create) ==="
|
|
86
|
+
git config --global user.email "ci@local" 2>/dev/null || true
|
|
87
|
+
git config --global user.name "Local E2E" 2>/dev/null || true
|
|
88
|
+
|
|
89
|
+
cd "$REPO_ROOT"
|
|
90
|
+
|
|
91
|
+
echo "=== Installing dependencies ==="
|
|
92
|
+
npm ci
|
|
93
|
+
|
|
94
|
+
echo "=== Building CLI ==="
|
|
95
|
+
npm run build
|
|
96
|
+
|
|
97
|
+
echo "=== Installing CLI globally ==="
|
|
98
|
+
TARBALL=$(npm pack | tail -1)
|
|
99
|
+
npm install -g "$TARBALL"
|
|
100
|
+
echo "✅ Installed: $(agentcore --version)"
|
|
101
|
+
|
|
102
|
+
echo "=== Running E2E tests ==="
|
|
103
|
+
if [[ "$RUN_ALL" == "true" ]]; then
|
|
104
|
+
echo "Running full e2e suite"
|
|
105
|
+
npx vitest run --project e2e
|
|
106
|
+
elif [[ ${#TEST_FILES[@]} -gt 0 ]]; then
|
|
107
|
+
echo "Running: ${TEST_FILES[*]}"
|
|
108
|
+
npx vitest run --project e2e "${TEST_FILES[@]}"
|
|
109
|
+
else
|
|
110
|
+
echo "Running default: e2e-tests/strands-bedrock.test.ts"
|
|
111
|
+
npx vitest run --project e2e e2e-tests/strands-bedrock.test.ts
|
|
112
|
+
fi
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface CliConfig {
|
|
2
|
-
uvDefaultIndex?: string;
|
|
3
|
-
uvIndex?: string;
|
|
4
|
-
disableTransactionSearch?: boolean;
|
|
5
|
-
transactionSearchIndexPercentage?: number;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Read the global CLI config from ~/.agentcore/config.json.
|
|
9
|
-
* Returns an empty object if the file doesn't exist or is malformed.
|
|
10
|
-
*/
|
|
11
|
-
export declare function readCliConfig(): CliConfig;
|
|
12
|
-
//# sourceMappingURL=cli-config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-config.d.ts","sourceRoot":"","sources":["../../../../src/lib/schemas/io/cli-config.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,SAAS;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,gCAAgC,CAAC,EAAE,MAAM,CAAC;CAC3C;AAED;;;GAGG;AACH,wBAAgB,aAAa,IAAI,SAAS,CAkBzC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.readCliConfig = readCliConfig;
|
|
4
|
-
const fs_1 = require("fs");
|
|
5
|
-
const os_1 = require("os");
|
|
6
|
-
const path_1 = require("path");
|
|
7
|
-
const CONFIG_FILE = (0, path_1.join)((0, os_1.homedir)(), '.agentcore', 'config.json');
|
|
8
|
-
/**
|
|
9
|
-
* Read the global CLI config from ~/.agentcore/config.json.
|
|
10
|
-
* Returns an empty object if the file doesn't exist or is malformed.
|
|
11
|
-
*/
|
|
12
|
-
function readCliConfig() {
|
|
13
|
-
try {
|
|
14
|
-
const data = (0, fs_1.readFileSync)(CONFIG_FILE, 'utf-8');
|
|
15
|
-
const parsed = JSON.parse(data);
|
|
16
|
-
const config = {};
|
|
17
|
-
if (typeof parsed.uvDefaultIndex === 'string')
|
|
18
|
-
config.uvDefaultIndex = parsed.uvDefaultIndex;
|
|
19
|
-
if (typeof parsed.uvIndex === 'string')
|
|
20
|
-
config.uvIndex = parsed.uvIndex;
|
|
21
|
-
if (parsed.disableTransactionSearch === true)
|
|
22
|
-
config.disableTransactionSearch = true;
|
|
23
|
-
if (typeof parsed.transactionSearchIndexPercentage === 'number') {
|
|
24
|
-
const pct = parsed.transactionSearchIndexPercentage;
|
|
25
|
-
if (pct >= 0 && pct <= 100) {
|
|
26
|
-
config.transactionSearchIndexPercentage = pct;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return config;
|
|
30
|
-
}
|
|
31
|
-
catch {
|
|
32
|
-
return {};
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=cli-config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-config.js","sourceRoot":"","sources":["../../../../src/lib/schemas/io/cli-config.ts"],"names":[],"mappings":";;AAiBA,sCAkBC;AAnCD,2BAAkC;AAClC,2BAA6B;AAC7B,+BAA4B;AAE5B,MAAM,WAAW,GAAG,IAAA,WAAI,EAAC,IAAA,YAAO,GAAE,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC;AASjE;;;GAGG;AACH,SAAgB,aAAa;IAC3B,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAAA,iBAAY,EAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAChD,MAAM,MAAM,GAA4B,IAAI,CAAC,KAAK,CAAC,IAAI,CAA4B,CAAC;QACpF,MAAM,MAAM,GAAc,EAAE,CAAC;QAC7B,IAAI,OAAO,MAAM,CAAC,cAAc,KAAK,QAAQ;YAAE,MAAM,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;QAC7F,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ;YAAE,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QACxE,IAAI,MAAM,CAAC,wBAAwB,KAAK,IAAI;YAAE,MAAM,CAAC,wBAAwB,GAAG,IAAI,CAAC;QACrF,IAAI,OAAO,MAAM,CAAC,gCAAgC,KAAK,QAAQ,EAAE,CAAC;YAChE,MAAM,GAAG,GAAG,MAAM,CAAC,gCAAgC,CAAC;YACpD,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;gBAC3B,MAAM,CAAC,gCAAgC,GAAG,GAAG,CAAC;YAChD,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|